function tgv(id){ var ThisDiv=document.getElementById(id); if (ThisDiv.style.display=='block'){ ThisDiv.style.display='none'; } else{ ThisDiv.style.display='block'; } }
function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function() { if (oldonload) { oldonload(); } func(); } } }
function GoTo(url){ window.location = url; } function txtLimit(f,n){ var val=f.value; if (val.length>n){ f.value=val.substring(0,n) } }
function readCookie(name) { 	var nameEQ = name + "="; 	var ca = document.cookie.split(';'); 	for(var i=0;i < ca.length;i++) { 		var c = ca[i]; 		while (c.charAt(0)==' ') c = c.substring(1,c.length); 		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); 	} 	return null; } function createCookie(name,value,days) { 	if (days) { 		var date = new Date(); 		date.setTime(date.getTime()+(days*24*60*60*1000)); 		var expires = "; expires="+date.toGMTString(); 	} 	else var expires = ""; 	document.cookie = name+"="+value+expires+"; path=/"; } function eraseCookie(name) { 	createCookie(name,"",-1); }
function TotPgH(){ var pageHeight; if( window.innerHeight && window.scrollMaxY ) { pageHeight = window.innerHeight + window.scrollMaxY; } else if(document.body.scrollHeight > document.body.offsetHeight ) { pageHeight = document.body.scrollHeight; } else {pageHeight = document.body.offsetHeight + document.body.offsetTop; } return pageHeight; }
function getScrollXY() {   var scrOfX = 0, scrOfY = 0;   if( typeof( window.pageYOffset ) == 'number' ) {scrOfY = window.pageYOffset;     scrOfX = window.pageXOffset;   } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {scrOfY = document.body.scrollTop;     scrOfX = document.body.scrollLeft;   } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {scrOfY = document.documentElement.scrollTop;     scrOfX = document.documentElement.scrollLeft;   }   return [ scrOfX, scrOfY ]; }
function GetWindowSize() {   var myWidth = 0, myHeight = 0;   if( typeof( window.innerWidth ) == 'number' ) {myWidth = window.innerWidth;     myHeight = window.innerHeight;   } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {  myWidth = document.documentElement.clientWidth;     myHeight = document.documentElement.clientHeight;   } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {myWidth = document.body.clientWidth;     myHeight = document.body.clientHeight;   }return [ myWidth, myHeight ]; }

function enPic(pic){
var w=650;
var h=490;
//var MPicture=document.getElementById('Mpcr');
$('#Mpcr').html('<img src="../../javascript/'+pic+'" border="0" alt="" title="" width="640" height="480"/>');
// 

//MPicture.src=pic;
var modal=document.getElementById('PcDiv');
modal.style.display="block";
var Hs = getScrollXY();
var psz=GetWindowSize();
var cwd=(psz[1]-h)/2
modal.style.top=(Hs[1]+cwd)+'px';
modal.style.left=((psz[0]-w)/2)+"px"; 
modal.style.zIndex='350';
var mask=document.getElementById('mask');
mask.style.display="block";
mask.style.zIndex='350';
mask.style.height=TotPgH()+'px';
}

function ClPic(){
var modal=document.getElementById('PcDiv');
modal.style.display="none";
var mask=document.getElementById('mask');
mask.style.display="none";
}