var popupDivId='';
var browseNodeId;
var innerDocWidth = 0, innerDocHeight = 0;

  
if( typeof( window.innerWidth ) == 'number' )
{
	//Non-IE
	innerDocWidth = window.innerWidth;
	innerDocHeight = window.innerHeight;
}
else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
{
	//IE 6+ in 'standards compliant mode'
	innerDocWidth = document.documentElement.clientWidth;
	innerDocHeight = document.documentElement.clientHeight;
}
else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
{
	//IE 4 compatible
	innerDocWidth = document.body.clientWidth;
	innerDocHeight = document.body.clientHeight;
}
 
function showDivPopup(id)
{
 	popupDivId = id;
	totalHeightWithScroll=document.body.scrollHeight;
	if(totalHeightWithScroll<innerDocHeight)
	{
			totalHeightWithScroll=innerDocHeight;
	}
	
	divHeight = document.getElementById(popupDivId).scrollHeight;
	divWidth = document.getElementById(popupDivId).scrollWidth;
	document.getElementById(popupDivId).style.top=currentDocHeight + innerDocHeight/2 - (divHeight/2) +"px";
 	document.getElementById(popupDivId).style.left=currentDocWidth + innerDocWidth/2 - (divWidth/2) +"px";
	
	document.getElementById("blockSection").style.display='block';
	document.getElementById("blockSection").style.height=totalHeightWithScroll+"px";
	document.getElementById(popupDivId).style.display='block';
	document.getElementById(popupDivId).style.visibility='visible';
}

function hideDivPopup(id)
{
	document.getElementById("blockSection").style.display='none';
  document.getElementById(id).style.visible='hidden';
	document.getElementById(id).style.display='none';
	popupDivId = 0;
}


function scrollDetector(){	 // detect scroll browser event and change position of loading banner

	if (navigator.appName == "Microsoft Internet Explorer")
	{	 
		currentDocHeight=document.documentElement.scrollTop;
		currentDocWidth=document.documentElement.scrollLeft;
	}
	else
	{
		currentDocHeight=window.pageYOffset
		currentDocWidth=window.pageXOffset
	}
	if(popupDivId!=0)
	{
		divHeight = document.getElementById(popupDivId).scrollHeight;
		divWidth = document.getElementById(popupDivId).scrollWidth;
		document.getElementById(popupDivId).style.top=currentDocHeight + innerDocHeight/2 - (divHeight/2) +"px";
 	  document.getElementById(popupDivId).style.left=currentDocWidth + innerDocWidth/2 - (divWidth/2) +"px";
	}
}
 
// set event to capture scrolling event
setInterval("scrollDetector()", 5);
