var _d = document;
var _w = window;
var _t = true;
var _f = false;
var _n = null;
var _o = new Array();

function isiPhoneUser(){
	return RegExp(" AppleWebKit/").test(navigator.userAgent);
}

function iniLayout(){
	_o = getLayoutOffsets();
	$('disableLayout').style.height = _o[3]+'px';
	//$('disableLayout').style.width = _o[2]+'px';
	$('disableLayout').style.width = '320px';
	if($('about').visible()) $('about').style.left = (_o[0]/2)-(obj.getWidth()/2)+'px';
	imagePreload('gfx/about_header.png','gfx/about_content.png','gfx/about_footer.png');
	_w.scrollTo(0, 1);
}

function about(){
	disableLayout();
	$('about').style.top = '75px';
	$('about').style.left = (_o[0]/2)-($('about').getWidth()/2)+'px';
	$('about').show();
}

function closeAbout(){
	$('about').hide();
	enableLayout();
}

function getLayoutOffsets(){
	var de = _d.documentElement;
	var screenWidth = _w.innerWidth || self.innerWidth || (de&&de.clientWidth) || _d.body.clientWidth;
	var screenHeight = _w.innerHeight || self.innerHeight || (de&&de.clientHeight) || _d.body.clientHeight;
	var pageWidth = _d.documentElement && _d.documentElement.scrollWidth ? _d.documentElement.scrollWidth : pageWidth = _d.body.scrollWidth;
	var pageHeight= _d.documentElement && _d.documentElement.scrollHeight ? _d.documentElement.scrollHeight : pageHeight = _d.body.scrollHeight;
	if(pageHeight<screenHeight) pageHeight = screenHeight;
	if(pageWidth<screenWidth) pageWidth = screenWidth;
	return [screenWidth,screenHeight,pageWidth,pageHeight];
}

function disableLayout(){
	$('disableLayout').show();
}

function enableLayout(){
	$('disableLayout').hide();
}

function imagePreload() {
	if (typeof(arguments) != 'undefined') {
		for (var i=0; i<arguments.length; i++ ) {
			var oImage = new Image;
			oImage.src = arguments[i];
		}
	}
}