
function closeInner() {

	hideLayer("innerframe");
	hideLayer("hideall");
}

function openInner() {

	//alert ('ok called');
	disableBack();
	
	document.getElementById("innerframe").innerHTML = '<iframe src="popup.html" width="580" height="428" frameborder="0" scrolling="no" ></iframe>';
	showdeadcenterdiv(580,428,"innerframe");
}


function hideLayer(id) {
	document.getElementById(id).style.display = 'none';
}

function disableBack() {

	var pageWidth, pageHeight; 

	if( window.innerHeight && window.scrollMaxY ) // Firefox 
	{
		pageWidth = window.innerWidth + window.scrollMaxX;
		pageHeight = window.innerHeight + window.scrollMaxY;
	}
	else if( document.body.scrollHeight > document.body.offsetHeight ) // all but Explorer Mac
	{
		pageWidth = document.body.scrollWidth;
		pageHeight = document.body.scrollHeight;
	}
	else // works in Explorer 6 Strict, Mozilla (not FF) and Safari
	{ 
		pageWidth = document.body.offsetWidth + document.body.offsetLeft; 
		pageHeight = document.body.offsetHeight + document.body.offsetTop; 
	}

	var o=document.getElementById("hideall"); 
	var r=o.style; 
	r.width = pageWidth + 'px';
	r.height = pageHeight + 'px';
	r.position='absolute'; 
	r.top = '0px'; 
	r.left = '0px'; 
	r.display = "block"; 
}

function showdeadcenterdiv(Xwidth,Yheight,divid) { 
	// First, determine how much the visitor has scrolled 

	var scrolledX, scrolledY; 
	if( self.pageYoffset ) { 
		scrolledX = self.pageXoffset; 
		scrolledY = self.pageYoffset; 
	} else if( document.documentElement && document.documentElement.scrollTop ) { 
		scrolledX = document.documentElement.scrollLeft; 
		scrolledY = document.documentElement.scrollTop; 
	} else if( document.body ) { 
		scrolledX = document.body.scrollLeft; 
		scrolledY = document.body.scrollTop; 
	} 
	
	// Next, determine the coordinates of the center of browser's window 
	var centerX, centerY; 
	if( self.innerHeight ) { 
		centerX = self.innerWidth; 
		centerY = self.innerHeight; 
	} else if( document.documentElement && document.documentElement.clientHeight ) { 
		centerX = document.documentElement.clientWidth; 
		centerY = document.documentElement.clientHeight; 
	} else if( document.body ) { 
		centerX = document.body.clientWidth; 
		centerY = document.body.clientHeight; 
	} 
	
	// Xwidth is the width of the div, Yheight is the height of the 
	// div passed as arguments to the function: 
	var leftoffset = scrolledX + (centerX - Xwidth) / 2; 
	var topoffset = scrolledY + (centerY - Yheight) / 2; 
	
	// the initial width and height of the div can be set in the 
	// style sheet with display:none; divid is passed as an argument to // the function 
	var o=document.getElementById(divid); 
	var r=o.style; 
	r.position='absolute'; 
	r.top = topoffset + 'px'; 
	r.left = leftoffset + 'px'; 
	r.display = "block"; 
} 

