	var xmlHttp;
	var tempstr;
	var TargetDivId;
	var ActionID;
	function ShowHint(AID,url,TargetId){
		ActionID=AID;
		TargetDivId=TargetId;
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null){
			alert ("Browser does not support HTTP Request");
			return;
		}
		xmlHttp.onreadystatechange=stateChanged;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
	
	function stateChanged(){
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
			tempstr=xmlHttp.responseText;
			if(ActionID==5)//signup case
				window.location="checkout.htm";
			else if(ActionID==6){//signin case
				if(tempstr=="true"){
					window.location="myaccount.htm";
				}
				else
					document.getElementById(TargetDivId).innerHTML="Invalid signin information";
			}
			else{
				document.getElementById(TargetDivId).innerHTML="";
				document.getElementById(TargetDivId).innerHTML=tempstr;
			}
		}
	}
	
	function GetXmlHttpObject(){
		var objXMLHttp=null;
		if (window.XMLHttpRequest){
			objXMLHttp=new XMLHttpRequest();
		}
		else if (window.ActiveXObject){
			objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		return objXMLHttp;
	}
	
	function loadaddtocart(TargetDivId){
		var TargetURL="includes/addtocart.asp";
		document.getElementById(TargetDivId).innerHTML='<img src="images/processing.gif">';
		ShowHint(1,TargetURL,TargetDivId);
	}
	
	function GetDesignations(form){
		var IndustryID=form.Industry.value;
		var TargetURL="includes/getdesignation.asp?IndustryID="+IndustryID;
		document.getElementById("designation").innerHTML='Getting related designations <img src="images/processing.gif">';
		ShowHint(3,TargetURL,"designation");
	}
	
	function CheckEmail(){
		var LoginEmail=document.frmsignup.LoginEmail.value;
		var TargetURL="includes/checkemail.asp?LoginEmail="+LoginEmail;
		document.getElementById("emailstatus").innerHTML='Checking login email existance <img src="images/processing.gif">';
		ShowHint(4,TargetURL,"emailstatus");
	}
	
	function DoSignup(){
		var TargetURL="includes/dosignup.asp?";
		TargetURL=TargetURL+"LoginEmail="+document.frmsignup.LoginEmail.value;
		TargetURL=TargetURL+"&Password="+document.frmsignup.Password.value;
		document.getElementById("signup").innerHTML='Processing signup <img src="images/processing.gif">';
		ShowHint(5,TargetURL,"signup");
	}
	
	function DoSignIn(){
		var TargetURL="includes/dosignin.asp?";
		TargetURL=TargetURL+"LoginEmail="+document.frmsignin.LoginEmail.value;
		TargetURL=TargetURL+"&Password="+document.frmsignin.Password.value;
		TargetURL=TargetURL+"&RememberMe="+document.frmsignin.RememberMe.checked;
		document.getElementById("signin").innerHTML='Processing signin <img src="images/processing.gif">';
		ShowHint(6,TargetURL,"signin");
	}
	
	function DoForgotPassword(){
		var TargetURL="includes/doforgotpassword.asp?";
		TargetURL=TargetURL+"LoginEmail="+document.frmforgot.LoginEmail.value;
		ShowHint(7,TargetURL,"forgotpassword");
	}
	
	function DoProfile(){
		var TargetURL="includes/doprofile.asp?";
		TargetURL=TargetURL+"CustID="+document.frmprofile.CustID.value;
		TargetURL=TargetURL+"&LoginEmail="+document.frmprofile.LoginEmail.value;
		TargetURL=TargetURL+"&Password="+document.frmprofile.Password.value;
		TargetURL=TargetURL+"&FirstName="+document.frmprofile.FirstName.value;
		TargetURL=TargetURL+"&LastName="+document.frmprofile.LastName.value;
		TargetURL=TargetURL+"&Gender="+document.frmprofile.Gender.value;
		TargetURL=TargetURL+"&DOB="+document.frmprofile.optMonth.value+"/"+document.frmprofile.optDay.value+"/"+document.frmprofile.optYear.value;
		TargetURL=TargetURL+"&AlternateEmail="+document.frmprofile.AlternateEmail.value;
		TargetURL=TargetURL+"&Address="+document.frmprofile.Address.value;
		TargetURL=TargetURL+"&Country="+document.frmprofile.Country.value;
		TargetURL=TargetURL+"&Province="+document.frmprofile.Province.value;
		TargetURL=TargetURL+"&City="+document.frmprofile.City.value;
		TargetURL=TargetURL+"&ZipCode="+document.frmprofile.ZipCode.value;
		TargetURL=TargetURL+"&PhoneNo="+document.frmprofile.PhoneNo.value;
		TargetURL=TargetURL+"&Industry="+document.frmprofile.Industry.value;
		TargetURL=TargetURL+"&Designation="+document.frmprofile.Designation.value;
		ShowHint(8,TargetURL,"profile");
	}
	
	function DoContactUs(){
		var TargetURL="includes/docontactus.asp?";
		TargetURL=TargetURL+"FullName="+frmContactUs.FirstName.value+frmContactUs.LastName.value+"&";
		TargetURL=TargetURL+"Email="+frmContactUs.Email.value+"&";
		TargetURL=TargetURL+"PhoneNo="+frmContactUs.PhoneNo.value+"&";
		TargetURL=TargetURL+"OrderID="+frmContactUs.OrderID.value+"&";
		TargetURL=TargetURL+"Subject="+frmContactUs.Subject.value+"&";
		TargetURL=TargetURL+"Message="+frmContactUs.Message.value+"&";
		TargetURL=TargetURL+"Priority="+frmContactUs.Priority.value;
		document.getElementById("contactus").innerHTML='Message is sending... <img src="images/processing.gif">';
		ShowHint(11,TargetURL,"contactus");
	}
	
	function MM_findObj(n, d) { //v4.01
	  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	  if(!x && d.getElementById) x=d.getElementById(n); return x;
	}
	
	function checkcart(Form){
		var len;
		var checked = false;
		len = Form.ProductTypeId.length;
		for(i=0;i<len;i++){
			if(Form.ProductTypeId[i].checked){
				checked = true;
				break;
			}
		}
		if(!checked && len != undefined)
			alert('Please select any product to Add to Cart.');
		else
			Form.submit();
	}