var remail=/^([_&a-zA-Z0-9-]+(\.[_&a-zA-Z0-9-]+)*@[&a-zA-Z0-9-]+\.+[&a-zA-Z0-9-]+)/;



function checkEmail(fieldvalue){

	if(remail.test(fieldvalue))

		return false;

	else

		return true;		

}



function validateuc()

{	

		if(!checkBlank(document.login_frm.emailid,'Email address')) return false;

		if(!checkSpace(document.login_frm.emailid,'Email address')) return false;

		if(!checkEmail(document.login_frm.emailid,'Email Address')) return false;



		if(!checkBlank(document.login_frm.password,'Password')) return false;

		if(!checkSpace(document.login_frm.password,'Password')) return false;

		//alert(document.login_frm.ref_url.value);

	}	

	function MM_openBrWindow(theURL,winName,features) 

	{ //v2.0

		window.open(theURL,winName,features);

	}



	function MM_preloadImages() { //v3.0

  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

}



function MM_swapImgRestore() { //v3.0

  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;

}



function MM_findObj(n, d) { //v4.0

  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 && document.getElementById) x=document.getElementById(n); return x;

}



function MM_swapImage() { //v3.0

  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

}



function delfromwl(rid)

	{		

		if (confirm("The selected product will be deleted from the wish list?"))

		{

			strurl="/asp/mywishlist/deletewl.asp?rid=" + rid;

			document.frm.action= strurl;

			location.href=strurl;			

		}

	

	}

	function add2sc(rid,pid)

	{	

		strurl="/asp/mywishlist/insertwish2shop.asp?rid=" + rid + "&pid="+ pid;

		document.frm.action= strurl;

		location.href=strurl;

	}



	function detailviewpop(id)

	{

		//alert("here");

		window.open("orderdetailview.asp?oid="+id,"Oreder_Details","resizable=yes,toolbar=no,status=no,scrollbars=yes,location=no,menubar=no,directories=no,width=520,height=375");

	}



	function validate()

	{

		if(!checkBlank(document.custphy.txtar_question,'Question')) return false;

	}

	function MM_openBrWindow(theURL,winName,features) 

	{ //v2.0



		window.open(theURL,winName,features);

	}



	function add2wl(pid)

	{	

		var qty;

		qty=document.frm.qty.value;		

		strurl="/asp/mywishlist/insertwl.asp?pid=" + pid + "&qty="+ qty;

		document.frm.action= strurl;

		document.frm.submit();

	}

	function add2sc(pid)

	{	

		var qty;

		qty=document.frm.qty.value;		

		strurl="/asp/mywishlist/insertsc.asp?pid=" + pid + "&qty="+ qty;

		//alert(strurl);

		document.frm.action= strurl;

		document.frm.submit();

		//location.href=strurl;

	}



	function validate1()

	{	

		if(!checkBlank(document.login_frm1.txt_fname,'Name')) return false;

		if(!checkBlank(document.login_frm1.txt_emailid,'Email address')) return false;

		if(!checkSpace(document.login_frm1.txt_emailid,'Email address')) return false;

		if(!checkEmail(document.login_frm1.txt_emailid,'Email Address')) return false;



	}





function validate2()

{

		if(!checkBlank(document.custform.fname,'First Name')) return false;

		if(!checkSpecialChar2(document.custform.fname,'First Name')) return false;

		

		if(document.custform.fname.value.charCodeAt(0)==32)

		{

		alert("Enter First Name!");

 		this.document.custform.fname.focus();

 		err="x";

 		return false;

		}



		if(!checkBlank(document.custform.lname,'Last Name')) return false;

		if(!checkSpecialChar2(document.custform.lname,'Last Name')) return false;



		if(document.custform.lname.value.charCodeAt(0)==32)

		{

		alert("Enter Last Name!");

 		this.document.custform.lname.focus();

 		err="x";

 		return false;

		}

		

var emailID=document.custform.emailid

	

	if ((emailID.value==null)||(emailID.value==""))

	{

		alert("Please Enter your Email ID")

		emailID.focus()

		return false

	}

	if (echeck(emailID.value)==false)

	{

		emailID.value=""

		emailID.focus()

		return false

	}



		if(!checkBlank(document.custform.pwd,'Password')) return false;

		if(!checkLessLen(document.custform.pwd,'Password',4)) return false;

		if(document.custform.pwd.value != document.custform.cpwd.value)

		{

			alert("Password & Confirm password should be same !");

			document.custform.cpwd.focus();			

			return false;

		}

		if(document.custform.pwd.value.charCodeAt(0)==32)

		{

		alert("Enter Password!");

 		this.document.custform.pwd.focus();

 		err="x";

 		return false;

		}



		//if(!checkEmail(document.custform.emailid,'Email Address')) return false;

		if(!checkBlank(document.custform.addr,'Address')) return false;

		if(document.custform.addr.value.charCodeAt(0)==32)

		{

		alert("Enter Address!");

 		this.document.custform.addr.focus();

 		err="x";

 		return false;

		}

		if(!checkBlank(document.custform.city,'City')) return false;

		if(document.custform.city.value.charCodeAt(0)==32)

		{

		alert("Enter city!");

 		this.document.custform.city.focus();

 		err="x";

 		return false;

		}

		if(!checkBlank(document.custform.state,'State/County')) return false;

		if(document.custform.state.value.charCodeAt(0)==32)

		{

		alert("Enter state!");

 		this.document.custform.state.focus();

 		err="x";

 		return false;

		}

		if(!checkBlank(document.custform.zipcode,'Zip Code')) return false;

		if(document.custform.zipcode.value.charCodeAt(0)==32)

		{

		alert("Enter zipcode!");

 		this.document.custform.zipcode.focus();

 		err="x";

 		return false;

		}

		if(!checkBlank(document.custform.cno,'Contact Number')) return false;

		if(document.custform.cno.value.charCodeAt(0)==32)

		{

		alert("Enter contact number!");

 		this.document.custform.cno.focus();

 		err="x";

 		return false;

		}

		if(!checkBlank(document.custform.sname,'Shipping Name')) return false;

		if(document.custform.sname.value.charCodeAt(0)==32)

		{

		alert("Enter shipping Name!");

 		this.document.custform.sname.focus();

 		err="x";

 		return false;

		}

		if(!checkBlank(document.custform.saddr,'Shipping Address')) return false;

		if(document.custform.saddr.value.charCodeAt(0)==32)

		{

		alert("Enter Shipping Address");

 		this.document.custform.saddr.focus();

 		err="x";

 		return false;

		}

		if(!checkBlank(document.custform.scity,'Shipping City')) return false;

		if(document.custform.scity.value.charCodeAt(0)==32)

		{

		alert("Enter Shipping city!");

 		this.document.custform.scity.focus();

 		err="x";

 		return false;

		}

		if(!checkBlank(document.custform.sstate,'Shipping State')) return false;

		if(document.custform.sstate.value.charCodeAt(0)==32)

		{

		alert("Enter Shipping State!");

 		this.document.custform.sstate.focus();

 		err="x";

 		return false;

		}

		if(!checkBlank(document.custform.szipcode,'Shipping Zip Code')) return false;

		if(document.custform.szipcode.value.charCodeAt(0)==32)

		{

		alert("Enter Shipping Zip Code");

 		this.document.custform.szipcode.focus();

 		err="x";

 		return false;

		}

		if(!checkBlank(document.custform.scno,'your phone no in your shipping details. As per Courier \n policies, we are unable to ship your order without a valid phone no.')) return false;

		if(document.custform.scno.value.charCodeAt(0)==32)

		{

		alert("Enter shipping contact number!");

 		this.document.custform.scno.focus();

 		err="x";

 		return false;

		}		

		if(!checkBlank(document.custform.scno1,'your phone no in your shipping details. As per Courier \n policies, we are unable to ship your order without a valid phone no.')) return false;

		if(document.custform.scno1.value.charCodeAt(0)==32)

		{

		alert("Enter shipping contact number!");

 		this.document.custform.scno1.focus();

 		err="x";

 		return false;

		}

		if(!checkBlank(document.custform.baddr,'Billing Address')) return false;

		if(document.custform.baddr.value.charCodeAt(0)==32)

		{

		alert("Enter Billing Address!");

 		this.document.custform.baddr.focus();

 		err="x";

 		return false;

		}

		if(!checkBlank(document.custform.bcity,'Billing City')) return false;

		if(document.custform.bcity.value.charCodeAt(0)==32)

		{

		alert("Enter Billing City!");

 		this.document.custform.bcity.focus();

 		err="x";

 		return false;

		}

		if(!checkBlank(document.custform.bstate,'Billing State')) return false;

		if(document.custform.bstate.value.charCodeAt(0)==32)

		{

		alert("Enter Billing State!");

 		this.document.custform.bstate.focus();

 		err="x";

 		return false;

		}

		if(!checkBlank(document.custform.bzipcode,'Billing Zip Code')) return false;

		if(document.custform.bzipcode.value.charCodeAt(0)==32)

		{

		alert("Enter Billing Zip Code!");

 		this.document.custform.bzipcode.focus();

 		err="x";

 		return false;

		}		

		if(!checkBlank(document.custform.bcno,'Billing Contact Number')) return false;

		if(document.custform.bcno.value.charCodeAt(0)==32)

		{

		alert("Enter Billing Contact Number!");

 		this.document.custform.bcno.focus();

 		err="x";

 		return false;

		}



}//end validate()



function addshipaddress()

{

		if (document.custform.shipsame.checked)

		{

			shipname = document.custform.fname.value + " " + document.custform.lname.value;

			

			document.custform.sname.value = shipname;

			document.custform.saddr.value = document.custform.addr.value;

			document.custform.saddr2.value = document.custform.addr2.value;



			document.custform.scity.value = document.custform.city.value;

			document.custform.sstate.value = document.custform.state.value;



			document.custform.szipcode.value = document.custform.zipcode.value;



			document.custform.scno.value = document.custform.cno.value;



			document.custform.scountry.value = document.custform.country.value;





		}	

		else

		{

			document.custform.sname.value = "";



			document.custform.saddr.value = "";

			document.custform.saddr2.value = "";

			document.custform.scity.value = "";



			document.custform.sstate.value = "";



			document.custform.szipcode.value = "";



			document.custform.scno.value = "";



			document.custform.scountry.value = "3";

		}

}//end addshipaddress()



function addbilladdress()

{

		if (document.custform.billsame.checked)

		{

			

			document.custform.baddr.value = document.custform.addr.value;

			document.custform.baddr2.value = document.custform.addr2.value;

			document.custform.bcity.value = document.custform.city.value;



			document.custform.bstate.value = document.custform.state.value;



			document.custform.bzipcode.value = document.custform.zipcode.value;



			document.custform.bcno.value = document.custform.cno.value;



			document.custform.bcountry.value = document.custform.country.value;





		}	

		else

		{

			document.custform.baddr.value = "";

			document.custform.baddr2.value = "";

			document.custform.bcity.value = "";



			document.custform.bstate.value = "";



			document.custform.bzipcode.value = "";



			document.custform.bcno.value = "";



			document.custform.bcountry.value = "3";

		}	

}//end addbilladdress()



function validate3()

{

		if(!checkBlank(document.custform.fname,'First Name')) return false;

		if(!checkSpecialChar2(document.custform.fname,'First Name')) return false;



		if(!checkBlank(document.custform.lname,'Last Name')) return false;

		if(!checkSpecialChar2(document.custform.lname,'Last Name')) return false;



		//if(!checkEmail(document.custform.emailid,'Email Address')) return false;

		if(!checkBlank(document.custform.addr,'Address')) return false;

		if(!checkBlank(document.custform.city,'City')) return false;



		if(!checkBlank(document.custform.state,'State/County')) return false;

		if(!checkBlank(document.custform.zipcode,'Zip Code')) return false;



		if(!checkBlank(document.custform.cno,'Contact Number')) return false;



		if(!checkBlank(document.custform.sname,'Shipping Name')) return false;

		if(!checkBlank(document.custform.saddr,'Shipping Address')) return false;

		if(!checkBlank(document.custform.scity,'Shipping City')) return false;

		if(!checkBlank(document.custform.sstate,'Shipping State')) return false;

		if(!checkBlank(document.custform.szipcode,'Shipping Zip Code')) return false;

		if(!checkBlank(document.custform.scno,'Please enter your phone no in your shipping details. As per Courier \n policies, we are unable to ship your order without a valid phone no.')) return false;

		if(!checkBlank(document.custform.scno1,'Please enter your phone no in your shipping details. As per Courier \n policies, we are unable to ship your order without a valid phone no.')) return false;

		if(!checkBlank(document.custform.baddr,'Billing Address')) return false;

		if(!checkBlank(document.custform.bcity,'Billing City')) return false;

		if(!checkBlank(document.custform.bstate,'Billing State')) return false;

		if(!checkBlank(document.custform.bzipcode,'Billing Zip Code')) return false;

		if(!checkBlank(document.custform.bcno,'Billing Contact Number')) return false;



}//end validate()



function SubmitWishList(formNm,actiontype,hid,minQty){

//		alert("action type is "+actiontype);

  formNm.method = "post"; 		

  formNm.action = "wishlist.php"; 		

  formNm.ActionType.value = actiontype;

    

  formNm.product_id.value = hid;

  formNm.quantity.value = minQty;

 

  formNm.submit();

}



function SubmitToCart(formNm,actiontype,hid,price,minQty){

	//	alert("tyoe is "+actiontype);

  formNm.method = "post";

		formNm.action = "shoppingcart/ShoppingModule.php" ;

  formNm.ActionType.value = actiontype;

  formNm.product_id.value = hid;

  formNm.quantity.value = minQty;

  formNm.price.value = price;

  formNm.submit();

}



function SubmitToCart2(formNm,actiontype,hid,price,minQty){

  formNm.method = "post";

	 formNm.action = "shoppingcart/ShoppingModule.php?actiontype="+actiontype+"&product_id="+hid+"&price="+price+"&quantity="+minQty;

  formNm.ActionType.value = actiontype;

  formNm.product_id.value = hid;

	 //formNm.quantity.value = minQty;
	
	//alert("cart is "+actiontype);
		//	alert("Hi i am here "+minQty);
  //alert(document.formNm.ref_url.value);

  formNm.price.value = price;
		
		

  formNm.submit();


}

function CheckOut(formnm,ActionType,press_filled)	{

var f_len =formnm.elements.length;

//alert("TYpe is "+ActionType+" username "+formnm.txt_username.value+" pass is "+formnm.txt_password.value);


	if (formnm.txt_username.value =="") {

				alert("Please Enter User Name");

				formnm.txt_username.focus();

			}else if (formnm.txt_password.value == "") {

				alert("Please Password");

				formnm.txt_password.focus();

			}else{

	 		formnm.action="ShoppingModule.php";					

				formnm.ActionType.value= ActionType;

				formnm.submit();

			}

}

function CheckOutold(formnm,ActionType,press_filled)	{



var f_len =formnm.elements.length;



if(formnm.opt_reminder.value=="yes")

{

flag=0;

for(i=0;i<=f_len-1;i++)

	{

	sstring=formnm.elements[i].name;

		if((formnm.elements[i].type == "text")&&(sstring.substring(0,12)=="txtreminder_")&&(formnm.elements[i].value==""))

		{

				

				alert("Please enter value for purchased for how many days");

				formnm.elements[i].focus();

				flag=1;

				break;

		}

		

	}



	if(flag==0)

	{

	

	if (formnm.txt_username.value =="") {

				alert("Please Enter User Name");

				formnm.txt_username.focus();

			}else if (formnm.txt_password.value == "") {

				alert("Please Password");

				formnm.txt_password.focus();

			}else{

			

				

	 		formnm.action="ShoppingModule.php";					

	  				

				formnm.ActionType.value= ActionType;

				formnm.submit();

			}

			}

}

else

{

		//if (press_filled == 0)	{

		//	alert("Please fill up homeopathy details");

		//}	else	{

		

			if (formnm.txt_username.value =="") {

				alert("Please Enter User Name");

				formnm.txt_username.focus();

			}else if (formnm.txt_password.value == "") {

				alert("Please Password");

				formnm.txt_password.focus();

			}else{

			

				

	 		formnm.action="ShoppingModule.php";					

	  				

				formnm.ActionType.value= ActionType;

				formnm.submit();

			}

		//}

	}

}

function SubmitProfile(formnm,ActionType)	{

	if (ActionType == "changeprofile_todb" || ActionType == "addprofile_todb")	{

		if (formnm.cust_name.value =="") {

			alert("Please Enter Name");

			formnm.cust_name.focus();

		}else if (formnm.cust_phone.value == "") {

			alert("Please Enter Phone Number");

			formnm.cust_phone.focus();

		}else if (formnm.cust_email.value == "") {

			alert("Please Enter Email");

			formnm.cust_email.focus();

		}else if (checkEmail(formnm.cust_email.value) ){

			alert("Invalid Email Id");

			formnm.cust_email.focus();

		}else if (formnm.cust_address.value == "") {

			alert("Please Enter Address");

			formnm.cust_address.focus();

		}else if (formnm.city.value == "") {

			alert("Please Enter City");

			formnm.city.focus();

		}else if (formnm.zip.value == "") {

			alert("Please Enter Zip code");

			formnm.zip.focus();

		}else if (ActionType == "addprofile_todb" && formnm.txt_username.value =="") {

			alert("Please Enter User Name");

			formnm.txt_username.focus();

		}else if (ActionType == "addprofile_todb" && formnm.txt_password.value == "") {

			alert("Please Enter Password");

			formnm.txt_password.focus();			

		}else if (ActionType == "addprofile_todb" && formnm.txt_confpassword.value == "") {

			alert("Please Enter Password to Confirm");

			formnm.txt_confpassword.focus();			

		}else if (ActionType == "addprofile_todb" && (formnm.txt_password.value != formnm.txt_confpassword.value)) {

			alert("Confirm password to should be same as password");

			formnm.txt_confpassword.focus();			

		}else {		

			formnm.ActionType.value= ActionType;

			formnm.submit();				

		}

	}	

	else{

		formnm.ActionType.value= ActionType;

		formnm.submit();

	}

}

function isNull(FieldName){

	if(FieldName.charAt(0)==""){

		return true;

	}

	else{

		return false;

	}

 }

function resetForm(formnm) {

	formnm.reset();

}



function deleteProduct(formnm,ActionType,id){

		formnm.product_id.value= id;

		formnm.ActionType.value= ActionType;

		//alert(formnm.product_id.value);

		formnm.submit();



}

function offer(formnm)

{

//alert(formnm);

	formnm.action="try1.php";

//	formnm.ActionType.value = ActionType;

	

		formnm.submit();

}



function SubmitShopping(formnm,ActionType)

{


	if (ActionType == "InsertDet" || ActionType == "ModifyDet")	{

		if (formnm.fname && isNull(formnm.fname.value)) {

			alert("Please Enter Name");

			formnm.fname.focus();

		}else if (formnm.lname.value == "") {

			alert("Please Enter Last Name");

			formnm.lname.focus();

		}else if (formnm.addr && isNull(formnm.addr.value)) {

			alert("Please Enter Address");

			formnm.addr.focus();

		}else if (formnm.city && isNull(formnm.city.value)) {

			alert("Please Enter City");

			formnm.city.focus();

		}else if (formnm.state && isNull(formnm.state.value)) {

			alert("Please Enter State");

			formnm.state.focus();			

		}else if (formnm.zipcode && isNull(formnm.zipcode.value)) {

			alert("Please Enter Zipcode");

			formnm.zipcode.focus();

		}else if (formnm.cno && isNull(formnm.cno.value)) {

			alert("Please Enter Contact Number");

			formnm.cno.focus();

		}else if (formnm.sname  && isNull(formnm.sname.value)) {

			alert("Please Enter Shipping Name");

			formnm.sname.focus();

		}else if (formnm.saddr  && isNull(formnm.saddr.value)) {

			alert("Please Enter Shipping Address");

			formnm.saddr.focus();

		}else if (formnm.scity  && isNull(formnm.scity.value)) {

			alert("Please Enter Shipping City");

			formnm.scity.focus();

		}else if (formnm.sstate  && isNull(formnm.sstate.value)) {

			alert("Please Enter Shipping State");

			formnm.sstate.focus();

		}else if (formnm.szipcode  && isNull(formnm.szipcode.value)) {

			alert("Please Enter Shipping Zip Code");

			formnm.szipcode.focus();

		}else if (formnm.scno  && isNull(formnm.scno.value)) {

			alert("Please Enter Shipping Contact Number ( Work) ");

			formnm.scno.focus();

		}else if (formnm.scno1  && isNull(formnm.scno1.value)) {

			alert("Please Enter Shipping Contact Number ( Home)");

			formnm.scno1.focus();

		}else if(formnm.baddr  && isNull(formnm.baddr.value)) {

			alert("Please Enter Billing Address");

			formnm.baddr.focus();

		}else if(formnm.bcity  && isNull(formnm.bcity.value)) {

			alert("Please Enter Billing City");

			formnm.bcity.focus();

		}else if(formnm.bstate  && isNull(formnm.bstate.value)) {

			alert("Please Enter Billing State");

			formnm.bstate.focus();

		}else if(formnm.bzipcode  && isNull(formnm.bzipcode.value)) {

			alert("Please Enter Zip Code");

			formnm.bzipcode.focus();

		}else if(formnm.bcno  && isNull(formnm.bcno.value)) {

			alert("Please Enter Billing Contact Number");

			formnm.bcno.focus();

		} else if(formnm.txt_username  && isNull(formnm.txt_username.value)) {

			alert("Please Enter Email Address");

			formnm.txt_username.focus();

		} else if(checkEmail(formnm.txt_username.value)) {

			alert("Please Enter valid Email Address");

			formnm.txt_username.focus();

		}

		else if (ActionType == "InsertDet" && formnm.txt_username.value == "") {

			alert("Please Enter Email Id");

			formnm.txt_username.focus();

		}else if (ActionType == "InsertDet" && formnm.txt_password.value == "") {

			alert("Please Enter Password");

			formnm.txt_password.focus();			

		}else if (ActionType == "InsertDet" && formnm.txt_confpassword.value == "") {

			alert("Please Enter Password to Confirm");

			formnm.txt_confpassword.focus();			

		}else if (ActionType == "InsertDet" && (formnm.txt_password.value != formnm.txt_confpassword.value)) {

			alert("Confirm Password should be same as the password ");

			formnm.txt_confpassword.focus();

		

		}

		else 

		{

		

			formnm.action="ShoppingModule.php";

			formnm.ActionType.value= ActionType;

			formnm.submit();				

		}

	}	

	else if (ActionType == "purchase_history")	{

		formnm.action="shoppingcart/ShoppingModule.php";

		formnm.ActionType.value= ActionType;

	 	formnm.submit();

	}

	else{

		formnm.action="shoppingcart/ShoppingModule.php";

		 formnm.ActionType.value= ActionType;

		 formnm.submit();

	}

}



function SubmitPurchase(formnm,ActionType,press_filled)

{
var f_len = formnm.elements.length;

if (ActionType=="UpdateCart")

{

	for(i=0;i<=f_len-1;i++)

		{

		sstring=formnm.elements[i].name;

			if((formnm.elements[i].type == "text")&&(sstring.substring(0,12)=="txtreminder_")&&(formnm.elements[i].value==""))

			{

					

					alert("Please enter value for purchased for how many days");

					formnm.elements[i].focus();

					return false;

					break;

			}


		}



}

	formnm.action="ShoppingModule.php?actiontype="+ActionType;

		formnm.ActionType.value= ActionType;

		formnm.submit(); 

if (press_filled == 0)	{

			alert("Please fill up prescription details");

		} else {

formnm.action="ShoppingModule.php?actiontype="+ActionType;


	formnm.ActionType.value= ActionType;

	formnm.submit(); 









 }



}



function SubmitPurchase1(formnm,ActionType)

{

//alert("Hi i am here");
formnm.action="ShoppingModule.php?actiontype=" + ActionType;

//	formnm.ActionType.value= 'Pay';

//formnm.ActionType.value= ActionType;

	formnm.submit(); 



}



function submitqty(formnm,ActionType)

{



	formnm.action="ShoppingModule.php";

	formnm.ActionType.value= ActionType;

 	formnm.submit(); 

}



function submitqty1(formnm,ActionType,prodid)

{



	formnm.action="ShoppingModule.phpproductid=" + prodid ;

	formnm.ActionType.value= ActionType;



 	formnm.submit(); 

}

function SubmitShoppingCheckout(formnm,ActionType,press_filled)	{

var f_len = formnm.elements.length;



formnm.action="ShoppingModule.php";

		formnm.ActionType.value= ActionType;

		formnm.submit();

}



function validatetellfr()

{

	if(!checkBlank(document.subform.txtyname,'Your Name')) return false;

}

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					

	}

	