function getdetails(prodid,catid)
{
document.frmpopular.prodid.value=prodid;
document.frmpopular.catid.value=catid;
document.frmpopular.action="details.php";
document.frmpopular.submit();
}
function category(catid,selfid)
{
document.frmcategory.catid.value=catid;
document.frmcategory.selfid.value=selfid;
document.frmcategory.action="category.php";
document.frmcategory.submit();
}
function validatezone()
{

	if(document.frmzone.lstzone.value="")
	{
		alert("Please select the zone");
		document.frmzone.lstzone.focus();
		return false;
	}
}
function sendenquiry()

{
document.frmenquiry.pid.value=pid;
document.frmenquiry.catid.value=catid;
document.frmenquiry.action="enquiry.php";
document.frmenquiry.submit();
}
function movepic(img_name,img_src) {
document[img_name].src=img_src;
}
function zoompic(img_name,width,height)
{
window.open("zoomimg.php?img="+img_name,"","height="+height+",width="+width+",status=yes,toolbar=no,menubar=no,location=no,top=150px,left=300px");

}
function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

 		 return true					
	}
function onlynum(){
	
if(!((event.keyCode>=48) && (event.keyCode <=57)))
event.keyCode=0;
}
function validatecareer()
{
if(document.frmcareer.txtname.value=="")
{
alert("Please Enter Name");
document.frmcareer.txtname.focus();
return false;
}
if(document.frmcareer.txtadd.value=="")
{
alert("Please Enter Email-address");
document.frmcareer.txtadd.focus();
return false;
}
var eID=document.frmcareer.txtadd;
	
	if ((eID.value!=""))
	{
	if (echeck(eID.value)==false)
	{
		eID.value=""
		eID.focus()
		return false
	}
	}
if(document.frmcareer.txtcontact.value=="")
{
alert("Please Enter Contact Number");
document.frmcareer.txtcontact.focus();
return false;
}
if(document.frmcareer.txtpost.value=="")
{
alert("Please Enter Position");
document.frmcareer.txtpost.focus();
return false;
}
/*if(document.frmcareer.txtresume.value=="")
{
alert("Please Browse Resume");
document.frmcareer.txtresume.focus();
return false;
}
if(document.frmcareer.txtresume.value!="")
	{
	var string = new String(document.frmcareer.txtresume.value)
	str = string.lastIndexOf(".")
	str = string.substr(str+1,5)
		if((str!="doc"))
		{
		alert("Upload only doc files");
		return false;
		}
	document.frmcareer.txtresume.focus();
	
	}*/
}
function addprodcart(prodid,actiontype)
{
document.frmproduct1.prodid.value=prodid;

//alert(price);
document.frmproduct1.actiontype.value=actiontype;
document.frmproduct1.submit();
}
function continueshop()
{
window.location="products.php";
}
function showex()
{
document.getElementById("existinguser").style["display"]="block";
document.getElementById("newuser").style["display"]="none";
document.getElementById("common").style["display"]="none";
}
function shownew()
{
document.getElementById("existinguser").style["display"]="none";
document.getElementById("newuser").style["display"]="block";
document.getElementById("common").style["display"]="none";
document.frmsignup.radvals.value="newreg";
}
function productperpage(itemqty)
{
//window.location="products.php";
document.frmqty.itemqty.value=itemqty;
document.frmqty.action="products.php";
document.frmqty.submit();
}