var POPUP=0;

function getClientWidth() {    return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth; }; 
function getClientHeight() {    return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight; }; 


window.onresize = function() {
	if (POPUP==1) show_pic();
}
function getDocumentHeight()  
{  
    return (document.body.scrollHeight > document.body.offsetHeight)?document.body.scrollHeight:document.body.offsetHeight;  
}  
function getBrowserInfo() {
	var t,v = undefined;
	if (window.opera) t = 'Opera';
	else if (document.all) {
		t = 'IE';
		var nv = navigator.appVersion;
		var s = nv.indexOf('MSIE')+5;
		v = nv.substring(s,s+1);
	}
 else if (navigator.appName) t = 'Netscape';
 return {type:t,version:v};
}


var IE=-1;
function show_pic(){


var jsmap=document.getElementById("jsmap");
		svn=document.getElementsByTagName("SELECT");
		for (a=0;a<svn.length;a++){
				svn[a].style.visibility="hidden";
		}
	POPUP=1;
	var out = {
			glass: document.getElementById('glass'),
			win: document.getElementById('win'),
			body: document.getElementById('body'),
			scrolltop: document.documentElement.scrollTop,
			scrollleft: document.documentElement.scrollLeft
	    };

	var b = getBrowserInfo();
	if (b.type == 'IE') {IE=out.scrolltop; setTimeout("window.scrollTo(0,0);",20);}
	
	var w=getClientWidth();
	var h=getClientHeight();

	if (b.type != 'Opera') {
		out.body.style.overflow="hidden";
	}

	document.getElementById('html').style.overflow="hidden";

		with(out.glass.style)
		{
			display = 'block';
		}
		
		var wh=getDocumentHeight()-145;
		var winh=wh+110;
		document.getElementById('win').style.height=winh+"px";
		document.getElementById('w1').style.height=wh+"px";
		document.getElementById('w2').style.height=wh+"px";
		document.getElementById('w3').style.height=wh+"px";
		document.getElementById('w4').style.height=wh-10+"px";
		document.getElementById('w5').style.height=wh-80+"px";
		document.getElementById('w6').style.height=wh+"px";

		with(out.win.style)
		{
			display = 'block';
         	if (winh<h){
         		top = 20+ 'px';
				
			} else {
				top = out.body.scrollTop +10+ 'px';
				
			}
			left = (out.scrollleft + (w - 875)/2) + 'px';
		}
}


function hide_popup(){
POPUP=0;
		if (IE!=-1){window.scrollTo(0,IE);}
		var out = {
			glass: document.getElementById('glass'),
			body: document.getElementById('body'),
			win: document.getElementById('win')
	    };
	
		out.glass.style.display="none";
		out.win.style.display="none";
		svn=document.getElementsByTagName("SELECT");
		for (a=0;a<svn.length;a++){
				svn[a].style.visibility="visible";
		}
		out.body.style.overflow="auto";
		document.getElementById('html').style.overflow="auto";

}
 