	function SelectAll(id) {
	    document.getElementById(id).focus();
	    document.getElementById(id).select();
	}



	var isCSS, isW3C, isIE4, isNN4, isIE6CSS, isSafari; 

	function initDHTMLAPI() {

		//alert("Calling initDHTMLAPI");

		if (document.images) {

			isCSS=(document.body && document.body.style) ? true : false;

			isW3C=(isCSS && document.getElementById) ? true : false;

			isIE4=(isCSS && document.all) ? true : false;

			isNN4=(document.layers) ? true : false;

			isIE6CSS=(document.compatMode && document.compatMode.indexOf("CSS1") >= 0) ? true : false;

			isSafari=(navigator.userAgent.indexOf("Safari") != -1);

		}

		//alert('isCSS='+isCSS+', isSafari='+isSafari);

	}

	function getInsideWindowWidth() {

		//alert("Calling getInsideWindowWidth");

		if (window.innerWidth) return window.innerWidth;

		else if (isIE6CSS) return document.body.parentElement.clientWidth;

		else if (document.body && document.body.clientWidth) return document.body.clientWidth;

		return 0;

	

	}

	function getInsideWindowHeight() {

		//alert("Calling getInsideWindowHeight");

		if (window.innerHeight) return window.innerHeight;

		else if (isIE6CSS) return document.body.parentElement.clientHeight;

		else if (document.body && document.body.clientHeight) return document.body.clientHeight;

		return 0;

	

	}

	function getRawObject(obj) {

		var theObj;

		if (typeof obj == "string") {

		   if (isW3C) theObj=document.getElementById(obj);

		   else if (isIE4) theObj=document.all(obj);

		   else if (isNN4) theObj=seekLayer(document, obj);

		} else theObj=obj; // pass through object reference

		return theObj;

	}

	function getObject(obj) {

		var theObj=getRawObject(obj);

		if (theObj && isCSS) theObj=theObj.style;

		return theObj;

	}

	function getObjectWidth(obj)  {

		var elem=getRawObject(obj);

		var result=0;

		if (elem.offsetWidth) result=elem.offsetWidth;

		else if (elem.clip && elem.clip.width) result=elem.clip.width;

		else if (elem.style && elem.style.pixelWidth) result=elem.style.pixelWidth;

		return parseInt(result);

	}

	function getObjectHeight(obj)  {

		var elem=getRawObject(obj);

		var result=0;

		if (elem.offsetHeight) result=elem.offsetHeight;

		else if (elem.clip && elem.clip.height) result=elem.clip.height;

		else if (elem.style && elem.style.pixelHeight) result=elem.style.pixelHeight;

		return parseInt(result);

	}

	function windowlayout() {

	

		//alert("Calling window layout manager");

	

		// First calculate the window area for width and height

		pagewidth=getInsideWindowWidth();

		//alert(pagewidth);

		hmid=Math.round(pagewidth/2);

		//alert(hmid);

		pageheight=getInsideWindowHeight();

		vmid=Math.round(pageheight/2);

		//alert(pageheight);

		//alert("vmid="+vmid);

		tabj=Math.round(486/2);

		tabj=vmid-tabj;

		//alert("tabj="+tabj);

		// Then set each piece of the display in position

		

		// This is the background image, which is filled with a photograph and dropped behind the text
		
		left=hmid-(Math.round(768/2));

		document.getElementById("wrapit").style.left=""+left+"px";

		document.getElementById("wrapit").style.marginTop=""+tabj+"px";

		document.getElementById("wrapit").style.visibility='visible';

		document.getElementById("news-slider").style.visibility='visible';
		

	}


	function extendlayout() {

		var knowreturn=getObjectHeight("howlongtothepointofknowreturn");

		//alert("knowreturn="+knowreturn);

		if (knowreturn > 999) {

			//alert("knowreturn > 999");

			// how many times greater?

			//alert(Math.round(knowreturn/999));

			document.getElementById("backgroundgridlg").style.top='999px';

			document.getElementById("backgroundgridlg").style.height=(knowreturn-880)+'px';

			//alert("hght="+document.getElementById("backgroundgridlg").style.height);

			if (knowreturn > 1684) {

				document.getElementById("backgroundgridlgr").style.top='1888px';

				var thrihlt=knowreturn-(1770);

				//alert(thrihlt);

				document.getElementById("backgroundgridlgr").style.height=""+thrihlt+'px';

				//alert("hght="+document.getElementById("backgroundgridlg").style.height);

			}

			document.getElementById("wrapit").style.marginTop="0px";

			

		} else {

			document.getElementById("backgroundgridlg").style.height=0+'px';

			if (knowreturn < 999) document.getElementById("howlongtothepointofknowreturn").style.height='879px';

			document.getElementById("wrapit").style.marginTop="0px";

		}

	}

	function r(i,s) {

		if (s) document.getElementById(i).src='images/ROLL/'+i+'_on.jpg';

		else document.getElementById(i).src='images/ROLL/'+i+'_off.jpg';

	}


