onresize=function(){
PositionDivs()
}

onload=function(){
PositionDivs()
}


function PositionDivs()
{
	var backdiv = document.getElementById("backdiv");
	var frontdiv = document.getElementById("frontdiv");

	var win = window;
	
	var intWidth = 0;
	var intHeight = 0;
	
	var s = navigator.userAgent.toLowerCase() ;
	
	if( s.indexOf('gecko/') > 0 || s.indexOf(' applewebkit/') > 0 || !!window.opera )
	{
		intWidth = win.innerWidth;
		intHeight = win.innerHeight;
	}
	else
	{

		var oSizeSource ;
	
		var oDoc = win.document.documentElement ;
		if ( oDoc && oDoc.clientWidth )				// IE6 Strict Mode
			oSizeSource = oDoc ;
		else
			oSizeSource = win.document.body ;		// Other IEs
	
		if ( oSizeSource )
		{
			intWidth = oSizeSource.clientWidth;
			intHeight = oSizeSource.clientHeight;
		}
	}
	
	var pageWidth = 0;
	var pageHeight = 0;
	
	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;
	}
	
	intWidth = ( pageWidth > intWidth ? pageWidth : intWidth );
	intHeight = ( pageHeight > intHeight ? pageHeight : intHeight );
	
	
	backdiv.style.width = intWidth + "px";
	backdiv.style.height = intHeight + "px";
	
	var frontdivwidth = 300
	
	frontdiv.style.left = ((intWidth/2) - (frontdivwidth/2)) + "px";
}

function SetOpacity(obj, opacity) {
	opacity = (opacity == 100)?99.99999999:opacity;
	
	// IE/Win
	obj.style.filter = "alpha(opacity:"+opacity+")";
	
	// Safari<1.2, Konqueror
	obj.style.KHTMLOpacity = opacity/100;
	
	// Older Mozilla and Firefox
	obj.style.MozOpacity = opacity/100;
	
	// Safari 1.2, newer Firefox and Mozilla, CSS3
	obj.style.opacity = opacity/100;
}


function DisplayDetails(strName,strAddress)
{
	var backdiv = document.getElementById("backdiv");
	var frontdiv = document.getElementById("frontdiv");
	SetOpacity( backdiv, 20 );
//	SetOpacity( frontdiv, 100 );
	
	PositionDivs();
	
	backdiv.style.display = "";
	frontdiv.style.display = "";
	
	var namediv = document.getElementById("namediv");
	var addressdiv = document.getElementById("addressdiv");
	
	namediv.innerHTML = strName;
	addressdiv.innerHTML = strAddress;
}

function CloseDetails()
{
	var backdiv = document.getElementById("backdiv");
	var frontdiv = document.getElementById("frontdiv");
	
	backdiv.style.display = "none";
	frontdiv.style.display = "none";
}
