// JavaScript Document
(document.getElementById) ? dom = true : dom = false;

function hideIt() {
  	if (dom){
		document.getElementById("layer1").style.visibility='hidden';
		document.getElementById("OverlayBG").style.visibility='hidden';
	}
}

function showIt() {
  if (dom){
	var inWH=getPageSizeWithScroll();
	document.getElementById("OverlayBG").style.width=inWH[0]+'px';
	document.getElementById("OverlayBG").style.height=inWH[1]+'px';
	document.getElementById("layer1").style.visibility='visible';
	document.getElementById("OverlayBG").style.visibility='visible';
	}
}
function getPageSizeWithScroll(){
	if (window.innerHeight && window.scrollMaxY) {// Firefox
		yWithScroll = window.innerHeight + window.scrollMaxY;
		xWithScroll = window.innerWidth + window.scrollMaxX;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		yWithScroll = document.body.scrollHeight;
		xWithScroll = document.body.scrollWidth;
	} else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
		yWithScroll = document.body.offsetHeight;
		xWithScroll = document.body.offsetWidth;
  	}
	arrayPageSizeWithScroll = new Array(xWithScroll,yWithScroll);
	//alert( 'The height is ' + yWithScroll + ' and the width is ' + xWithScroll );
	return arrayPageSizeWithScroll;
}
function windowInnWH() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  return myHeight;
 // window.alert( 'Width = ' + myWidth );
 // window.alert( 'Height = ' + myHeight );
}

function placeIt() {
	var inWH2=getPageSizeWithScroll();
	var x1 = (inWH2[0]/2)-490;
	var yy1 = windowInnWH();
	var y1 = (yy1/2)-160;
  if (dom && !document.all) {document.getElementById("layer1").style.top = window.pageYOffset + (window.innerHeight - (window.innerHeight-y1)) + "px";}
  if (document.all) {document.all["layer1"].style.top = document.documentElement.scrollTop + (document.documentElement.clientHeight - (document.documentElement.clientHeight-y1)) + "px";}
  document.getElementById("layer1").style.left=x1+"px";
  window.setTimeout("placeIt()", 10); }