
function doImg(imgName, imgSrc){
 document.images[imgName].src = imgSrc.src;
}

var ns=(document.layers);
var ie=(document.all);
var w3=(document.getElementById && !ie);
var calunit=ns? "" : "px"

function showLarge(){
	if(!ns && !ie && !w3) return;
	if (ie){
	 documentWidth=truebody().offsetWidth/2+truebody().scrollLeft-20;
	 documentHeight =truebody().offsetHeight/2+truebody().scrollTop-20;
	}
	if (ns){
	 documentWidth=window.innerWidth/2+window.pageXOffset-20;
	 documentHeight=window.innerHeight/2+window.pageYOffset-20;
	} 
	if (w3){
	 documentWidth=self.innerWidth/2+window.pageXOffset-20;
	 documentHeight=self.innerHeight/2+window.pageYOffset-20;
	} 
    document.getElementById("overlayDiv").style.display="block";
	document.getElementById("largeDiv").style.left=0+calunit;
	document.getElementById("largeDiv").style.top=documentHeight-250+calunit;
    document.getElementById("largeDiv").style.display="block";
}

function closeLarge(){
	document.getElementById("largeDivContentImg").src="../images/pixel.gif";
	document.getElementById("largeDivContentText").innerHTML="";
    document.getElementById("largeDiv").style.display="none";
    document.getElementById("overlayDiv").style.display="none";
}

function truebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body}

function showPhoto(theImag, theText){
	document.getElementById("largeDivContentImg").src=theImag;
	document.getElementById("largeDivContentText").innerHTML=theText;
	showLarge();
}


function doShowHide(divID)
{
	var divIDStyle = document.getElementById(divID).style;
	if(divIDStyle.display=="block") divIDStyle.display="none";
	else divIDStyle.display="block";
}

function GetXmlHttpObject(handler)
{ 
var objXmlHttp=null;
 
if (navigator.userAgent.indexOf("MSIE")>=0)
{ 
var strName="Msxml2.XMLHTTP";
if (navigator.appVersion.indexOf("MSIE 5.5")>=0)
{
strName="Microsoft.XMLHTTP";
} 
try
{ 
objXmlHttp=new ActiveXObject(strName);
objXmlHttp.onreadystatechange=handler;
return objXmlHttp;
} 
catch(e)
{ 
alert("Error. Scripting for ActiveX might be disabled");
return;
} 
} 
if (navigator.userAgent.indexOf("Mozilla")>=0)
{
objXmlHttp=new XMLHttpRequest();
objXmlHttp.onload=handler;
objXmlHttp.onerror=handler;
return objXmlHttp;
}
} 
 
 
function doVcode()
{ 
	thePage = "check_vcode.php?vcodeID=" + document.form1.vcodeID.value + "&vcode=" + document.form1.vcode.value;
	xmlHttp=GetXmlHttpObject(stateChanged);
	xmlHttp.open("GET", thePage , true);
	xmlHttp.send(null);
} 
 
function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
   {
	document.form1.vcodeTrue.value=xmlHttp.responseText;
   }	
} 


