function CenterDiv(id){
		
		if (!document.all){
			
			myCenterDIV = document.getElementById(id);
		
			myheight = document.getElementById(id).clientHeight; 
			mywidth  = document.getElementById(id).clientWidth; 
			//document.getElementById(id).style.top  = ( (window.innerHeight / 2 ) - ( myheight / 2 ) ) + "px";
			//document.getElementById(id).style.left = ( (window.innerWidth  / 2 ) - ( mywidth  / 2 ) ) + "px";
	
			document.getElementById(id).style.top  = (  window.pageYOffset ) + ( (window.innerHeight - myheight ) / 2 ) + "px";
			document.getElementById(id).style.left = (  window.pageXOffset ) + ( (window.innerWidth  - mywidth  ) / 2 ) + "px";
	
			
			document.getElementById(id).style.visibility = 'visible';
			
		}
		else if (document.all){
			
			myCenterDIV = document.all[id];
			
			myheight = document.all[id].clientHeight; 
			mywidth  = document.all[id].clientWidth; 
			//document.all[id].style.top  = ( (document.documentElement.clientHeight / 2) - ( myheight / 2 ) ) + "px";
			//document.all[id].style.left = ( (document.documentElement.clientWidth  / 2) - ( mywidth  / 2 ) ) + "px";
			
			document.getElementById(id).style.top  = ( document.documentElement.scrollTop  + (document.documentElement.clientHeight - myheight ) / 2 ) + "px";
			document.getElementById(id).style.left = ( document.documentElement.scrollLeft + (document.documentElement.clientWidth  - mywidth  ) / 2 ) + "px";

			document.all[id].style.visibility = 'visible';
		}


		window.onresize = function (){
 						    CenterDiv(id);	
						  }

}
//------------------------------------------------------------------------------------------------------------------
function CloseDIV(id){
	if (!document.all){
			myCenterDIV = document.getElementById(id);
		}
		else if (document.all){
			myCenterDIV = document.all[id];
		}
		
		myCenterDIV.style.visibility = 'hidden';
		myCenterDIV = null;
}	
	
