﻿function GetXmlHttpObject(){
	if(window.XMLHttpRequest){
  	// code for IE7+, Firefox, Chrome, Opera, Safari
  		return new XMLHttpRequest();
  		}
	else if (window.ActiveXObject){
	// code for IE6, IE5
  		return new ActiveXObject("Microsoft.XMLHTTP");
  		}
	else{
		alert ("Your browser does not support AJAX!");
		return null;
		}
	}

function UnlockCus(UnlockCode){
	xmlhttp=GetXmlHttpObject();
	if(xmlhttp != null){
		rand = Math.random();
		var AllVariable='UnlockCode='+UnlockCode;
		xmlhttp.open('POST', 'account/login.inc.php?Rand='+rand, false);
		xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlhttp.onreadystatechange = function(){
			if(xmlhttp.readyState==4 && xmlhttp.status==200){
				alert(xmlhttp.responseText);
				}
			}
		xmlhttp.send(AllVariable);
		}
	}

function MoreInfo(BaseUrl, RecNo){
	var InfoWin = window.open(BaseUrl+'more-info.php?RID='+RecNo,'MoreInfo','toolbar=no,directories=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=700,height=500,left=15,top=15,screenX=15,screenY=15');
	}

function SiginPage(SSLpageURL, MyAccount, ProductID, SubCat, IorP, ToggleIP){
	var SiginPage = window.open(SSLpageURL+'account/signin.php?MyAccount='+MyAccount+'&ProductID='+ProductID+'&SubCat='+SubCat+'&IorP='+IorP+'&ToggleIP='+ToggleIP,'SignIn','directories=no,scrollbars=yes,location=no,status=no,menubar=no,resizable=yes,copyhistory=no,width=450,height=400,left=150,top=100,screenX=15,screenY=30');
	}

function NewCustomerPage(SSLpageURL, MyAccount, ProductID, SubCat, IorP, ToggleIP){
	window.open(SSLpageURL+'account/signin.php?NewCustomer=1&MyAccount='+MyAccount+'&ProductID='+ProductID+'&SubCat='+SubCat+'&IorP='+IorP+'&ToggleIP='+ToggleIP,'Register','directories=no,scrollbars=yes,location=no,status=no,menubar=no,resizable=yes,copyhistory=no,width=450,height=400,left=150,top=100,screenX=15,screenY=30');
	}

function Click2Check(ClickName){
	if(!document.getElementById(ClickName).checked){
		document.getElementById(ClickName).checked=true;
		}
	else{
		document.getElementById(ClickName).checked=false;
		}
	}
