function doajax(xvalue,spanid)
{
//alert(xvalue)
//alert(spanid)
xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return false;
	} 
var url="ajax/setnextsearch.asp?key="+xvalue;
//alert(url)
xmlHttp.onreadystatechange=statesearch(spanid)
xmlHttp.open("get",url,true)
xmlHttp.send(null)
//alert("ok")
}

function statesearch(y) 
{ 
//alert(y)
	if (xmlHttp.readyState==1)
	{document.getElementById(y).innerHTML="<center>Loading.........</center>";} 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{document.getElementById(y).innerHTML=xmlHttp.responseText;}
	alert(xmlHttp.responseText)
} 	




function frmlogin1()
{

	name=document.frmlogin.txtname.value;
	pwd=document.frmlogin.txtpwd.value;
	
	if (name=="")
	{
	alert("Enter User id");
	document.frmlogin.txtname.focus();
	return false;
	}
	if (pwd=="")
	{
	alert("Enter Password");
	document.frmlogin.txtpwd.focus();
	return false;
	}
	
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return false;
	} 
	var url="ajax/frmlogin.asp?name="+name+"&pwd="+pwd;

	xmlHttp.onreadystatechange=stateChangedfrmlogin
	xmlHttp.open("get",url,true)
	xmlHttp.send(null)


}

function stateChangedfrmlogin() 
{ 
	if (xmlHttp.readyState==1)
	{document.getElementById("frmlogin").innerHTML="<center>validating.....</center>";} 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{document.getElementById("frmlogin").innerHTML=xmlHttp.responseText;}
	if(xmlHttp.responseText=="1")
	{
	location.href="member_home.asp"
	}
} 



function fnvalidate()
{
	name=document.frmreg.txtname.value;
	txtcname=document.frmreg.txtcname.value;
	txtdesignation=document.frmreg.txtdesignation.value;
	txtemail=document.frmreg.txtemail.value;
	txtphone=document.frmreg.txtphone.value;
	txtfax=document.frmreg.txtfax.value;
	txtmobile=document.frmreg.txtmobile.value;
	txtaddress=document.frmreg.txtaddress.value;
	txtbtype=document.frmreg.txtbtype.value;
	txtuserid=document.frmreg.txtuserid.value;
	txtpwd=document.frmreg.txtpwd.value;
	txtpwd1=document.frmreg.txtrpwd.value;
	
	
	
	/*
	if(name=="")
	{
		document.getElementById('txterr').innerHTML="->Enter Your Name";
		document.frmreg.txtname.focus();
		return false;
	}

	if(txtcname=="")
	{
		document.getElementById('txterr').innerHTML="->Enter Company Name";
		document.frmreg.txtcname.focus();
		return false;
	}
	
	if(txtdesignation=="")
	{
		document.getElementById('txterr').innerHTML="->Enter Your Designation";
		document.frmreg.txtdesignation.focus();
		return false;

	}
	
	if(txtemail=="")
	{
		document.getElementById('txterr').innerHTML="->Enter Your E-mail Address";
		document.frmreg.txtemail.focus();
		return false;

	}
	
	if(txtphone=="")
	{
		document.getElementById('txterr').innerHTML="->Enter Your Phone Number";
		document.frmreg.txtphone.focus();
		return false;

	}
	
	if(txtfax=="")
	{
		document.getElementById('txterr').innerHTML="->Enter Your Fax Number";
		document.frmreg.txtfax.focus();
		return false;

	}
	
	
	if(txtmobile=="")
	{
		document.getElementById('txterr').innerHTML="->Enter Your Mobile Number";
		document.frmreg.txtmobile.focus();
		return false;

	}
	
	
	if(txtaddress=="")
	{
		document.getElementById('txterr').innerHTML="->Enter Your Address";
		document.frmreg.txtaddress.focus();
		return false;

	}
	if(txtbtype=="")
	{
		document.getElementById('txterr').innerHTML="->Enter Business Type";
		document.frmreg.txtbtype.focus();
		return false;

	}
	if(txtuserid=="")
	{
		document.getElementById('txterr').innerHTML="->Enter User ID";
		document.frmreg.txtuserid.focus();
		return false;

	}
	
	if(txtpwd=="")
	{
		document.getElementById('txterr').innerHTML="->Enter Your Password";
		document.frmreg.txtpwd.focus();
		return false;

	}
	*/
	/*
	if(txtpwd1==txtpwd)
	{
		document.getElementById('txterr').innerHTML="->Password Not Matching ";
		document.frmreg.txtpwd.focus();
		return false;
	}
	*/
	
	name=document.frmreg.txtname.value;
	txtcname=document.frmreg.txtcname.value;
	txtdesignation=document.frmreg.txtdesignation.value;
	txtemail=document.frmreg.txtemail.value;
	txtphone=document.frmreg.txtphone.value;
	txtfax=document.frmreg.txtfax.value;
	txtmobile=document.frmreg.txtmobile.value;
	txtaddress=document.frmreg.txtaddress.value;
	txtbtype=document.frmreg.txtbtype.value;
	txtuserid=document.frmreg.txtuserid.value;
	txtpwd=document.frmreg.txtpwd.value;
	txtpwd1=document.frmreg.txtrpwd.value;
	xmlHttp=GetXmlHttpObject()

	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return false;
	}

	var url="ajax/userreg.asp?name="+name+"&txtcname="+txtcname+"&txtdesignation="+txtdesignation+"&txtemail="+txtemail+"&txtphone="+txtphone+"&txtfax="+txtfax+"&txtmobile="+txtmobile+"&txtaddress="+txtaddress+"&txtbtype="+txtbtype+"&txtuserid="+txtuserid+"&txtpwd="+txtpwd;
	xmlHttp.onreadystatechange=stateChangedreg
	xmlHttp.open("get",url,true)
	xmlHttp.send(null)
	
}



function stateChangedreg() 
{ 
	if (xmlHttp.readyState==1)
	{document.getElementById("txterr").innerHTML="<center>Loading.....</center>";} 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{document.getElementById("txterr").innerHTML=xmlHttp.responseText;}
	
	if(xmlHttp.responseText=="success")
	{
	location.href="member_home.asp"
	}
	
} 






function fnremove(x)
{
/*
	togle=0;
	for (i = 0; i < document.frmcart.chknails.length; i++)
     {
	 	if (document.frmcart.chknails[i].checked)
		{
			togle=1
		}
		
	 }

	for (i = 0; i < document.frmcart.chkscrews.length; i++)
     {
	 	if (document.frmcart.chkscrews[i].checked)
		{
			togle=1
		}
		
	 }
	
	
	
	
	
	if (togle==1)
	{
		alert('select');
	}
	else
	{
	alert('Nothing');
	}
	
	*/
	

	
	document.frmcart.method="post";
	document.frmcart.action="removecart.asp?m="+x;
	document.frmcart.submit();
	
	
}








function fnaddtocart(id,t)
{
if (id!="")
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return false;
	} 
	var url="ajax/addtocart.asp?id="+id+"&t="+t;
	
	xmlHttp.onreadystatechange=stateChangedcart
	xmlHttp.open("get",url,true)
	xmlHttp.send(null)
}
}

function stateChangedcart() 
{ 
	if (xmlHttp.readyState==1)
	{document.getElementById("addtocart").innerHTML="<center>Loading.....</center>";} 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{document.getElementById("addtocart").innerHTML=xmlHttp.responseText;}
} 

function fntypestaple(x)
{
alert(ok)
if (x!="")
{

	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return false;
	} 
var url="ajax/setscrewtype.asp?key="+x;
xmlHttp.onreadystatechange=stateChangedscrewstype
xmlHttp.open("get",url,true)
xmlHttp.send(null)
}
}

function stateChangedscrewstype() 
{ 
	if (xmlHttp.readyState==1)
	{document.getElementById("stype").innerHTML="<center>Loading.........</center>";} 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{document.getElementById("stype").innerHTML=xmlHttp.responseText;}
} 	

function fnpackingscrew(x)
{
if (x!="")
{

	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return false;
	} 
var url="ajax/setscrewtype.asp?key="+x;
xmlHttp.onreadystatechange=stateChangedscrewstype
xmlHttp.open("get",url,true)
xmlHttp.send(null)
}
}
function stateChangedscrewstype() 
{ 
	if (xmlHttp.readyState==1)
	{document.getElementById("stype").innerHTML="<center>Loading.........</center>";} 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{document.getElementById("stype").innerHTML=xmlHttp.responseText;}
} 	

function fnpacking(x)
{
if (x!="")
{

	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return false;
	} 
var url="ajax/setnailtype.asp?key="+x;
xmlHttp.onreadystatechange=stateChangednailtype
xmlHttp.open("get",url,true)
xmlHttp.send(null)
}
}
function stateChangednailtype() 
{ 
	if (xmlHttp.readyState==1)
	{document.getElementById("ntype").innerHTML="<center>Loading.........</center>";} 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{document.getElementById("ntype").innerHTML=xmlHttp.responseText;}
} 	


function fncheck(x)
{
	
xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return false;
	} 
var url="setsessikon.asp?sess="+x;

xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("get",url,true)
xmlHttp.send(null)

//location.reload(true);
location.href="products_view.asp";
}
function stateChanged() 
{ 
	if (xmlHttp.readyState==1)
	{document.getElementById("content").innerHTML="<center></center>";} 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{document.getElementById("content").innerHTML=xmlHttp.responseText;
	
	}

} 	







function GetXmlHttpObject()
{ var objXMLHttp=null
if(window.XMLHttpRequest){
objXMLHttp = new XMLHttpRequest()}
else if (window.ActiveXObject){
objXMLHttp = new ActiveXObject("Microsoft.XMLHttp")}
return objXMLHttp
}	 

