
function moreInfo(branch,opening)
{
	var objBranch = document.getElementById(branch).style;
	var objOpening = document.getElementById(opening);
	
	if(objBranch.display=="block"){
		objBranch.display="none";
		objOpening.className='qaQ';
	}
	else{
		objBranch.display="block";
		objOpening.className='qaQ2';
	}
}

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 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;
   }	
} 


var lastTD = "";
function onmouseOverDiv(obj)
{
	obj.style.display = 'block';
}
function onmouseOutDiv(obj,className)
{
	obj.style.display = 'none';
}
function showSubMenu(objTd , name)
{
	lastTD=objTd;  // last td on menu bar
	var objDiv = document.getElementById (name);
	objDiv.style.display = (objDiv.style.display == "none" || objDiv.style.display == "")? "block" : "none";
	objDiv.style.left = getPosX(objTd) + objTd.offsetWidth - 156;
	objDiv.style.top = getPosY(objTd) + objTd.offsetHeight-1;
	
}
function hideMenu(name)
{
	var objDiv = document.getElementById(name);
	objDiv.style.display = "none";
}

function getPosX(obj)
{
	var curleft = 0;
	while (obj.offsetParent)
	{
	  curleft += obj.offsetLeft;
	  obj = obj.offsetParent;
	}
	return curleft;

}
function getPosY(obj)
{
	var curtop = 0;
	while (obj.offsetParent)
	{
	  curtop += obj.offsetTop;
	  obj = obj.offsetParent;
	}
	return curtop;

}
function changeColor(obj,color)
{
    var ob=document.getElementById(obj);
    if(ob != null)
    {
        ob.style.backgroundColor = color;
    }

}

function hideTitle(id)
{
  var title = document.getElementById(id);
}

function doM2off(obj)
{
 obj.className='m2off';
}

function doM2on(obj)
{
 obj.className='m2on';
}

function doM22off(obj)
{
 obj.className='m22off';
}

function doM22on(obj)
{
 obj.className='m22on';
}

function HideInfo(branch, theTitle)
{
	var objBranch = document.getElementById(branch).style;
	document.getElementById(theTitle).className="infoBoxOff";
	objBranch.display="none";
}

function ShowHideInfo(branch, theTitle)
{
	var objBranch = document.getElementById(branch).style;
	if(objBranch.display=="block")
	{
		theTitle.className="infoBoxOff";
		objBranch.display="none";
	} 
	else
	{
		theTitle.className="infoBoxOn";
		objBranch.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;
   }	
} 


