 /*---------------------------------------------------------
 ---------------------------------------------------------*/ 
 function BrowserInfo()	
		{
		  if(navigator.userAgent.indexOf("Opera")!=-1){
		  	return 2;
		  }else
		  	if(navigator.userAgent.indexOf("MSIE")!=-1){
				return 3;
			}else
			  if(navigator.userAgent.indexOf("Firefox")!=-1){
				return 19;
			  }
		}
		
	  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); 
		
		  return yWithScroll; 
		 
	  } 

		function Overlay(Divname,Formbox,Sendwidth,page){
		
		var my_width  = 0;
		var my_height = 0;
		var decreaseWidth = 0;
		var adjustHeigt =0; // Add value to adjust your overy lay according to the height you want.
		decreaseWidth = BrowserInfo();
		
		if ( typeof( window.innerWidth ) == 'number' ){
			my_width  = window.innerWidth;
			my_height = window.innerHeight;
		}else if ( document.documentElement && 
				 ( document.documentElement.clientWidth ||
				   document.documentElement.clientHeight ) ){
			my_width  = document.documentElement.clientWidth;
			my_height = document.documentElement.clientHeight;
		}
		else if ( document.body && 
				( document.body.clientWidth || document.body.clientHeight ) ){
			my_width  = document.body.clientWidth;
			my_height = document.body.clientHeight;
		}
		my_new_height = getPageSizeWithScroll();
				
		document.getElementById(Divname).style.position = 'absolute';
		document.getElementById(Divname).style.zIndex   = 99;
		document.getElementById(Divname).style.display='block';
		
		document.getElementById(Formbox).style.position = 'absolute';
		document.getElementById(Formbox).style.zIndex   = 99;
		document.getElementById(Formbox).style.display='block';
		
		var scrollY = 0;
		
		if ( document.documentElement && document.documentElement.scrollTop ){
			scrollY = document.documentElement.scrollTop;
		}else if ( document.body && document.body.scrollTop ){
			scrollY = document.body.scrollTop;
		}else if ( window.pageYOffset ){
			scrollY = window.pageYOffset;
		}else if ( window.scrollY ){
			scrollY = window.scrollY;
		}
		
		//var divWidth = document.getElementById(Formbox).offsetWidth;
		var divWidth=Sendwidth;
		var divHeight = document.getElementById(Formbox).offsetHeight;
		
		var setX = ( my_width  - divWidth  ) / 2;
		var setY = ( my_height - divHeight ) / 2 +scrollY;
		
		setX = ( setX < 0 ) ? 0 : setX;
		setY = ( setY < 0 ) ? 0 : setY;
		
		document.getElementById(Divname).style.left =0 + "px";
		document.getElementById(Divname).style.top  = 0 + "px";
		document.getElementById(Divname).style.height= (parseInt(my_new_height) + parseInt(my_height)-adjustHeigt)+ "px";
		document.getElementById(Divname).style.width= (my_width - decreaseWidth) + "px";
		document.getElementById(Formbox).style.width= Sendwidth + "px";
		document.getElementById(Formbox).style.left = setX + "px";
		document.getElementById(Formbox).style.top  = 10 + "px";
		//alert(page);
		makeRequestImg(page);
		}
	function hideDiv(Divname,Formbox){
		document.getElementById(Divname).style.display='none';
		document.getElementById(Formbox).style.display='none';
		document.getElementById('showimg').innerHTML ="loading";
}