//var main_path="http://192.168.0.3/baileydiamonds/";
var main_path="http://www.baileydiamonds.com/";
//var main_path="http://205.234.171.136/";

function validate_register()
{
		if(!checkBlank(document.frmregister.Email,'Email address')) return false;
		if(!checkEmail(document.frmregister.Email,'Email Address')) return false;
		if(!checkBlank(document.frmregister.PWD,'Password')) return false;
		if(!checkLessLen(document.frmregister.PWD,'Password',4)) return false;
		if(!checkBlank(document.frmregister.CPWD,'Password')) return false;
		if(!checkLessLen(document.frmregister.CPWD,'Password',4)) return false;

		if(document.frmregister.PWD.value != document.frmregister.CPWD.value)
		{
			alert("Password & Confirm password should be same !");
			document.frmregister.PWD.focus();			
			return false;
		}

		if(!checkBlank(document.frmregister.Fname,'First Name')) return false;
		if(!checkBlank(document.frmregister.Lname,'Last Name')) return false;
}

function confirm_register()
{
	var email=document.frmregister.Email.value;
	document.frmregister.action="login_chk.php";
	document.frmregister.submit();
}

function validate_billing()
{
	if(!checkBlank(document.frmregisterbill.Fname,'First Name')) return false;
	if(!checkBlank(document.frmregisterbill.Lname,'Last Name')) return false;
	if(!checkBlank(document.frmregisterbill.Addr1,'Address 1')) return false;
	var textblock=document.getElementById("showstatetext");	
	var listblock=document.getElementById("showstatelist");	

	if(textblock.style.display == "block")
	 {
		if(!checkBlank(document.frmregisterbill.state,'State')) return false;
  	 }
	if(listblock.style.display == "block")
	 {	
		if(document.frmregisterbill.statelist.options.selectedIndex == 0) 
			{	
				alert("Please Enter State")
				document.frmregisterbill.statelist.focus();
				return false;
			}
	 }
	if(!checkBlank(document.frmregisterbill.City,'City')) return false;
	if(!checkBlank(document.frmregisterbill.Zip,'Zip')) return false;
	if(!checkBlank(document.frmregisterbill.Phone,'Phone')) return false;
	if(!checkBlank(document.frmregisterbill.dobdate,'Date')) return false;
	if(!checkBlank(document.frmregisterbill.dobmonth,'Month')) return false;
	if(!checkBlank(document.frmregisterbill.dobyear,'Year')) return false;

	if (document.frmregisterbill.sex[0].checked==false && document.frmregisterbill.sex[1].checked==false)
			{
				alert ("Select your Gender...");
				return false;
			}
}


function validate_manu()
{
	var textblock=document.getElementById("showstatetext");	
	var listblock=document.getElementById("showstatelist");	

	if(textblock.style.display == "block")
	 {
		if(!checkBlank(document.manform.state,'State')) return false;
  	 }
	if(listblock.style.display == "block")
	 {	
		if(document.manform.statelist.options.selectedIndex == 0) 
			{	
				alert("Please Enter State")
				document.manform.statelist.focus();
				return false;
			}
	 }
	if(!checkBlank(document.manform.mancity,'City')) return false;
	if(!checkBlank(document.manform.manzip,'Zip')) return false;
	if(!checkBlank(document.manform.mantel,'Phone')) return false;
}

function confirm_shipping1()
{
	var shipemail=document.frmregistership.semail.value;
	document.frmregisterbill.action="registersuccess.php?eid="+shipemail;
	document.frmregisterbill.submit();
}

function validate_shipping()
{
	if(!checkBlank(document.frmregistership.Fname,'First Name')) return false;
	if(!checkBlank(document.frmregistership.Lname,'Last Name')) return false;
	if(!checkBlank(document.frmregistership.Addr1,'Address 1')) return false;
	//if(!checkBlank(document.frmregistership.Addr2,'Address 2')) return false;
	var textblock=document.getElementById("showstatetext");	
	var listblock=document.getElementById("showstatelist");	

	if(textblock.style.display == "block")
	 {
		if(!checkBlank(document.frmregistership.state,'State')) return false;
  	 }
	if(listblock.style.display == "block")
	 {	
		if(document.frmregistership.statelist.options.selectedIndex == 0) 
			{	
				alert("Please Enter State")
				document.frmregistership.statelist.focus();
				return false;
			}
	 }
	if(!checkBlank(document.frmregistership.City,'City')) return false;
	if(!checkBlank(document.frmregistership.Zip,'Zip')) return false;
	if(!checkBlank(document.frmregistership.Phone,'Phone')) return false;
}

function validate_billedit()
{
	if(!checkBlank(document.frmbilledit.Fname,'First Name')) return false;
	if(!checkBlank(document.frmbilledit.Lname,'Last Name')) return false;
	if(!checkBlank(document.frmbilledit.Addr1,'Address 1')) return false;
	
	var textblock=document.getElementById("showstatetext");	
	var listblock=document.getElementById("showstatelist");	
	if(textblock.style.display == "block")
	 {
		if(!checkBlank(document.frmbilledit.state,'State')) return false;
  	 }

	if(listblock.style.display == "block")
	 {	
		if(document.frmbilledit.statelist.options.selectedIndex == 0) 
			{	
				alert("Please Enter State")
				document.frmbilledit.statelist.focus();
				return false;
			}
	 }
	if(!checkBlank(document.frmbilledit.City,'city')) return false;
	if(!checkBlank(document.frmbilledit.Zip,'zipcode')) return false;
	if(!checkBlank(document.frmbilledit.Phone,'phone number')) return false;
}

function validate_shipedit()
{
	if(!checkBlank(document.frmshipedit.Fname,'First Name')) return false;
	if(!checkBlank(document.frmshipedit.Lname,'Last Name')) return false;
	if(!checkBlank(document.frmshipedit.Addr1,'Address 1')) return false;
	var textblock=document.getElementById("showstatetext");	
	var listblock=document.getElementById("showstatelist");	

	if(textblock.style.display == "block")
	 {
		if(!checkBlank(document.frmshipedit.state,'State')) return false;
  	 }
	if(listblock.style.display == "block")
	 {	
		if(document.frmshipedit.statelist.options.selectedIndex == 0) 
			{	
				alert("Please Enter State")
				document.frmshipedit.statelist.focus();
				return false;
			}
	 }
	if(!checkBlank(document.frmshipedit.City,'city')) return false;
	if(!checkBlank(document.frmshipedit.Zip,'zipcode')) return false;
	if(!checkBlank(document.frmshipedit.Phone,'phone number')) return false;
}

function validate_personaledit()
{
	if(!checkBlank(document.frmpersonaledit.dobdate,'Date')) return false;
	if(!checkBlank(document.frmpersonaledit.dobmonth,'Month')) return false;
	if(!checkBlank(document.frmpersonaledit.dobyear,'Year')) return false;
	if (document.frmpersonaledit.sex[0].checked==false && document.frmpersonaledit.sex[1].checked==false)
			{
				alert ("Select your Gender");
				return false;
			}
}

function confirm_billing1() //not used now
{
	var fn=document.frmregisterbill.Fname.value;
	var email=document.frmregisterbill.tEmail.value;
	var actionval=document.frmregisterbill.actiontype.value;
}


function confirm_shippingfrom()
{
	var shipemail=document.frmregistership.semail.value;
	document.frmregistership.action="registersuccess.php?eid="+shipemail;
	document.frmregistership.submit();
}

function validate_shippingfrom()
{
	if(!checkBlank(document.frmregistership.fname,'First Name')) return false;
	if(!checkBlank(document.frmregistership.lname,'Last Name')) return false;
	if(!checkBlank(document.frmregistership.addr1,'Address 1')) return false;
	var textblock=document.getElementById("showstatetext");	
	var listblock=document.getElementById("showstatelist");	

	if(textblock.style.display == "block")
	 {
		if(!checkBlank(document.frmregistership.state,'State')) return false;
  	 }
	if(listblock.style.display == "block")
	 {	
		if(document.frmregistership.statelist.options.selectedIndex == 0) 
			{	
				alert("Please Enter State")
				document.frmregistership.statelist.focus();
				return false;
			}
	 }
	if(!checkBlank(document.frmregistership.city,'City')) return false;
	if(!checkBlank(document.frmregistership.zipcode,'Zip')) return false;
	if(!checkBlank(document.frmregistership.phoneno,'Phone')) return false;
}

function check_option(id,elementname)
 {
	var block=document.getElementById(elementname);	
	
	if(id == 1)
	var rootblock1=document.frmregisterbill.shipsame;
	if(rootblock1.value == 1)
	block.style.display = "block";
	else
	block.style.display = "none";
 }

function check_search(elementname)
 {	

	var block=document.getElementById('search_eng');
	var block2=document.getElementById('keywords');
	var block3=document.getElementById('oth_search');
	var block1=document.getElementById('oth_search_eng');
	block1.style.display = "none";
	
	if(document.frmregisterbill.where1.value == "Other")
	{
		block3.style.display = "block";
	}
	else
	 {
	block3.style.display = "none";
	 }

	if(document.frmregisterbill.where1.value == "Search Engine")
	 {
	  block2.style.display = "block";
	  block.style.display = "block";
	 }
	else
	 {
	  block.style.display = "none";
	  block2.style.display = "none";
	 }
 }

function check_search1(elementname)
 {	
	var block1=document.getElementById('oth_search_eng');
	if(document.frmregisterbill.eng_name.value == "Other")
	block1.style.display = "block";
	else
	block1.style.display = "none";
 }

function check_search_pers(elementname)
 {	

	var block=document.getElementById('search_eng');
	var block2=document.getElementById('keywords');
	var block3=document.getElementById('oth_search');
	var block1=document.getElementById('oth_search_eng');
	block1.style.display = "none";
	
	if(document.frmpersonaledit.where1.value == "Other")
	{
		block3.style.display = "block";
	}
	else
	 {
	block3.style.display = "none";
	 }

	if(document.frmpersonaledit.where1.value == "Search Engine")
	 {
	  block2.style.display = "block";
	  block.style.display = "block";
	 }
	else
	 {
	  block.style.display = "none";
	  block2.style.display = "none";
	 }
 }

function check_search1_pers(elementname)
 {	
	var block1=document.getElementById('oth_search_eng');
	if(document.frmpersonaledit.eng_name.value == "Other")
	block1.style.display = "block";
	else
	block1.style.display = "none";
 }

function validate_login()
{
		if(!checkBlank(document.frmlogin.Email,'Email address')) return false;
		if(!checkSpace(document.frmlogin.Email,'Email address')) return false;
		if(!checkEmail(document.frmlogin.Email,'Email Address')) return false;

		if(!checkBlank(document.frmlogin.PWD,'Password')) return false;
		if(!checkSpace(document.frmlogin.PWD,'Password')) return false;
		if(!checkLessLen(document.frmlogin.PWD,'Password',4)) return false;
		
}

function confirm_login()
{
	document.frmlogin.action="login_chk.php";
	document.frmlogin.submit();
}

function edit_reg()
{
		document.custform.ActionType.value="edituser";
		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(!checkBlank(document.custform.addr,'Address Street1')) 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,'Phone Number')) return false;

		document.custform.ActionType.value="edituser";
		document.custform.action="editreg.php";
		document.custform.submit();
}

function SubmitToCart(formNm,actiontype,hid,price,size){
  formNm.method = "post";
  formNm.action = main_path+"shoppingcart/ShoppingModule.php?statusflg=1&sizevalue="+size+"&pricevalue="+price;
  formNm.ActionType.value = actiontype;
  formNm.product_id.value = hid;
  formNm.price.value = price;
  formNm.submit();
}


function SubmitToCartIn(formNm,actiontype,hid,sizeval,priceval)
{
var ss = priceval.substr(0,priceval.length-1);
var ssd = priceval.substr(priceval.length-1,priceval.length-1);
var ssdout = priceval.substr(priceval.length-3,priceval.length-1);
if(formNm.name=="prod_individual" && ssdout == "OUT" )
{
formNm.sizeactual.value=document.prod_individual.prodsize.options[document.prod_individual.prodsize.options.selectedIndex].text;
var tempstr = formNm.sizeactual.value;
var stockout = tempstr.substr(tempstr.length-1,tempstr.length-1);
if(stockout=="]")
{
alert('Product Out-of-Stock. Please e-mail us & we will inform you once the product is available');
window.location.reload( false );
}

formNm.product_id.value = hid;
formNm.pricetxt.value = priceval;
formNm.sizetxt.value = sizeval;
}


if(formNm.name=="prod_individual" && ssd == "1" )
{
formNm.sizeactual.value=document.prod_individual.prodsize.options[document.prod_individual.prodsize.options.selectedIndex].text;
formNm.product_id.value = hid;
formNm.pricetxt.value = priceval;
formNm.sizetxt.value = sizeval;
}
if(formNm.name=="prod_individual" && ssd == "0" )
{
priceval=ss;
formNm.sizeactual.value=ss;
formNm.product_id.value = hid;
formNm.pricetxt.value = priceval;
formNm.sizetxt.value = sizeval;
}
if(formNm.name=="frmcpgsrc")
formNm.sizeactual.value=0;
formNm.method = "post";
formNm.action = main_path+"shoppingcart/ShoppingModule.php";
formNm.ActionType.value = actiontype;
formNm.submit();
}

function SubmitToCartInSrc(formNm,actiontype,hid,sizeval,priceval)
{
if(formNm.name=="prod_individual")
formNm.sizeactual.value=document.prod_individual.prodsize.options[document.prod_individual.prodsize.options.selectedIndex].text;
if(formNm.name=="frmcpgsrc")
formNm.sizeactual.value=0;

formNm.product_id.value = hid;
formNm.pricetxt.value = priceval;
formNm.sizetxt.value = sizeval;
formNm.method = "post";
formNm.action = main_path+"shoppingcart/ShoppingModule.php?statusflg=1&sizevalue="+sizeval+"&pricevalue="+priceval;
formNm.ActionType.value = actiontype;
formNm.submit();
}

function SubmitToCartInIdx(formNm,actiontype,hid,sizeval,priceval)
{
//alert('ActionType: '+actiontype+',productid: '+hid+'size: '+sizeval+'price: '+priceval);
formNm.product_id.value = hid;
formNm.pricetxt.value = priceval;
formNm.sizetxt.value = sizeval;
formNm.method = "post";
formNm.action = main_path+"shoppingcart/ShoppingModule.php?statusflgidx=idx&sizevalue="+sizeval+"&pricevalue="+priceval;
formNm.ActionType.value = actiontype;
formNm.submit();
}

function deleteProduct(formnm,actiontype,id,sizedel,pricedel)
	{
		formnm.product_id_del.value= id;
		formnm.ActionType.value= actiontype;
		formnm.product_id_del.value= id;
		formnm.ActionType.value= actiontype;
		formnm.sizetodel.value=sizedel;
		formnm.pricetodel.value=pricedel;

		formnm.method="post";
		formnm.submit();
	}
function SubmitShopping1(formnm,ActionType)
{
	//alert();
  formNm.action = main_path+"shoppingcart/ShoppingModule.php";	
  formnm.ActionType.value="good";
	formnm.submit();
}

function validateshop(formnm,ActionType)
{
	if(!checkSpecialChar2(document.product_shopUI.quantityuser,'Quantity ')) 
		return false 
	else 
		return true;

}
function SubmitShopping(formnm,ActionType)
{ 
	var newrate;
		if(ActionType == "DisplayCart")
	{
			
			document.forms[0].ActionType.value="DisplayCart";
			document.forms[0].action=main_path+"shoppingcart/ShoppingModule.php?statusflg=1";
			document.forms[0].submit();
			return ;
	}
	//alert(formnm+','+ActionType);	
	if(ActionType == "InsertDet" || ActionType == "ModifyDet")
	{
		shipsamevalue=formnm.shipsame.checked;
		billsamevalue=formnm.billsame.checked;
		if(ActionType == "InsertDet")
		{
			docsamevalue=formnm.docsame.checked;	
		}

		if(shipsamevalue == 1)
		{
			document.custform.sname.value = document.custform.fname.value + " " + document.custform.lname.value;
			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.scno1.value = document.custform.cno1.value;
			document.custform.scountry.value = document.custform.country.value;
		}
		
		if(billsamevalue == 1)
		{
			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;
		}
		
		if(ActionType == "InsertDet")
		{
		if(docsamevalue == 1)
		{
//			document.custform.dadr1.value = document.custform.addr.value;
//			document.custform.dadr2.value = document.custform.addr2.value;
			document.custform.dcountry.value = document.custform.country.value;
			document.custform.dstate.value = document.custform.state.value;
			document.custform.dcity.value = document.custform.city.value;
			document.custform.dzipcode.value = document.custform.zipcode.value;
		}
		}

		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(ActionType == "InsertDet" && formnm.dobmonth.value == "")
		{
			alert("Please Enter Month");
			formnm.dobmonth.focus();
		}
		else if(ActionType == "InsertDet" && formnm.dobdate.value == "")
		{
			alert("Please Enter Date");
			formnm.dobdate.focus();
		}
		else if(ActionType == "InsertDet" && formnm.dobyear.value == "")
		{
			alert("Please Enter Year");
			formnm.dobyear.focus();
		}
		else if(ActionType == "InsertDet" && formnm.sex.value == "")
		{
			alert("Please Select Sex");
			formnm.sex.focus();
		}
		else if (formnm.addr && isNull(formnm.addr.value)) 
		{
			alert("Please Enter Street1 Address");
			formnm.addr.focus();
		//}else if (formnm.addr2 && isNull(formnm.addr2.value)) {
		//	alert("Please Enter Street2 Address");
		//	formnm.addr2.focus();
		}
		else if (state_notpresent("showstatetext","showstatelist",formnm.state,formnm.statelist,"State"))
		{
			//return false;
		}
		else if (formnm.city && isNull(formnm.city.value)) 
		{
			alert("Please Enter City");
			formnm.city.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 Work Phone Number");
			formnm.cno.focus();
		}
		else if (formnm.cno1 && isNull(formnm.cno1.value)) 
		{
			alert("Please Enter Home Phone Number");
			formnm.cno1.focus();
		}
		else if (formnm.sname  && isNull(formnm.sname.value) && shipsamevalue != 1) 
		{
			alert("Please Enter Shipping Name");
			formnm.sname.focus();
		}
		else if (formnm.saddr  && isNull(formnm.saddr.value) && shipsamevalue != 1) 
		{
			alert("Please Enter Shipping Address");
			formnm.saddr.focus();
		}
		else if (shipsamevalue != 1 && state_notpresent("showsstatetext","showsstatelist",formnm.sstate,formnm.sstatelist,"Shipping State"))
		{
			alert("ttt"+shipsamevalue);
			//return false;
		}
		else if (formnm.scity  && isNull(formnm.scity.value) && shipsamevalue != 1) 
		{
			alert("Please Enter Shipping City");
			formnm.scity.focus();
		}
		else if (formnm.szipcode  && isNull(formnm.szipcode.value) && shipsamevalue != 1) 
		{
			alert("Please Enter Shipping Zip Code");
			formnm.szipcode.focus();
		}
		else if (formnm.scno  && isNull(formnm.scno.value) && shipsamevalue != 1) 
		{
			alert("Please Enter Shipping Phone Number ( Work) ");
			formnm.scno.focus();
		}
		else if (formnm.scno1  && isNull(formnm.scno1.value) && shipsamevalue != 1) 
		{
			alert("Please Enter Shipping Phone Number ( Home)");
			formnm.scno1.focus();
		}
		else if(formnm.baddr  && isNull(formnm.baddr.value) && billsamevalue != 1) 
		{
			alert("Please Enter Billing Address Street1");
			formnm.baddr.focus();
		}
		else if (billsamevalue != 1 && state_notpresent("showbstatetext","showbstatelist",formnm.bstate,formnm.bstatelist,"Billing State"))
		{
			//return false;
		}
		else if(formnm.bcity  && isNull(formnm.bcity.value) && billsamevalue != 1) 
		{
			alert("Please Enter Billing City");
			formnm.bcity.focus();
		}
		else if(formnm.bcno  && isNull(formnm.bcno.value) && billsamevalue != 1) 
		{
			alert("Please Enter Billing Phone Number");
			formnm.bcno.focus();
		}
		else if (ActionType == "InsertDet" && formnm.txt_username.value == "") 
		{
			alert("Please Enter Email Id");
			formnm.txt_username.focus();
		}
		else if (ActionType == "InsertDet" && !checkSpace(formnm.txt_username,'Email address')) 
		{ 
			formnm.txt_username.focus(); 
		}
		else if (ActionType == "InsertDet" && !checkEmail(formnm.txt_username,'Email Address'))
		{ 
			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.ActionType.value= ActionType;
			formnm.submit();				
		}
	}	
	else
	{
		 //formnm.ActionType.value= ActionType;
		 
		 //alert(formnm.name);
		 //alert('quantity: '+formnm.quantityuser.value);
		 //alert('price: '+formnm.totalvalue.value);
		 //newrate = formnm.quantityuser.value * formnm.pricefix.value;
		 //alert('new price'+newrate);
		 //formnm.newprice.value = newrate;
		 //formnm.priceupdate.value = newrate;
		 //formnm.subtotal.value=newrate;
		 //formnm.quantityuser.value = formnm.quantityuser.value;
		 //formnm.gtotal.value=newrate;
		 //formnm.submit();
	}

	if(ActionType=='UpdateCart')
	{
		formnm.ActionType.value= ActionType;
			//alert(formnm.ActionType.value);
			formnm.submit();
	}
}

function proceed(formnm,islogin)	
	{
	var currentActionType;
	
	if(islogin == 0)
		currentActionType="user_details";
	else
		currentActionType="ProcessLoggedIn";

	formnm.ActionType.value= currentActionType;
	formnm.submit();

}

function validate_login_shop(place_holder)
	{
		var dom;
		//alert('hi');
		if(place_holder == 'local')
		{
		dom=document.login_frm;
		if(!checkBlank(dom.emailid,'Email address')) return false;
		if(!checkSpace(dom.emailid,'Email address')) return false;
		if(!checkEmail(dom.emailid,'Email Address')) return false;
		if(!checkBlank(dom.password,'Password')) return false;
		}
		if(place_holder == 'shopping')
		{
			dom=document.prescFrm;
		if(!checkBlank(dom.txt_username,'Email address')) return false;
		if(!checkSpace(dom.txt_username,'Email address')) return false;
		if(!checkEmail(dom.txt_username,'Email Address')) return false;
		if(!checkBlank(dom.txt_password,'Password')) return false;
		}
	
	}	



function SubmitWishList(formNm,actiontype,hid,sizeval,priceval)
{
document.prod_individual.product_id.value=hid;
document.prod_individual.sizetxt.value=sizeval;
document.prod_individual.pricetxt.value=priceval;
document.prod_individual.action = main_path+"myWishList.php?sizefro="+sizeval+"&pricefro="+priceval+"&pid="+hid; 		
document.prod_individual.submit();
}

function WishToDelete(formNm,actiontype,flg_state)
{
	var RecID,flg,flg1,flg2;	
	flg1=1;
	//alert(flg_state+' is flagstate');
	if (flg_state != "")
		{
				//alert('emptying');
				//RecID=formNm.RecordID.value;
				RecID=flg_state;
				formNm.RecordID.value="";
				formNm.price.value="";
				formNm.quantity.value= "";
				formNm.prc.value="";
				formNm.qty.value="";
				formNm.product_id.value="";
		}

	flg2=confirm("You are about to DELETE this product from your Wish List!");

	if (!flg2)
		{
			return;
		}
	//alert(flg2+' delete value');	
	formNm.RecordID_str.value=RecID;
	formNm.method = "post";
	formNm.action = main_path+"myWishList.php";
	formNm.ActionType.value = actiontype;
	formNm.submit();
}

function validate_contactus()
{
	if(!checkBlank(document.frmcontactus.Fname,'First Name')) return false;
	if(!checkBlank(document.frmcontactus.Lname,'Last Name')) return false;
	if(!checkBlank(document.frmcontactus.Email,'Email')) return false;
	if(!checkEmail(document.frmcontactus.Email,'Email')) return false;
	if(!checkBlank(document.frmcontactus.Addr1,'Address 1')) return false;
	if(!checkBlank(document.frmcontactus.Addr2,'Address 2')) return false;

	if(!checkBlank(document.frmcontactus.Country,'Country')) return false;
	if(!checkBlank(document.frmcontactus.State,'State')) return false;
	if(!checkBlank(document.frmcontactus.City,'City')) return false;
	if(!checkBlank(document.frmcontactus.Zip,'Zip')) return false;
	if(!checkBlank(document.frmcontactus.Day_Phone,'Day Phone')) return false;
	if(!checkBlank(document.frmcontactus.Evening_Phone,'Evening Phone')) return false;
	if(!checkBlank(document.frmcontactus.Feedback,'Feedback')) return false;
	/*
	var textblock=document.getElementById("showstatetext");	
	var listblock=document.getElementById("showstatelist");	

	if(textblock.style.display == "block")
	 {
		if(!checkBlank(document.frmcontactus.state,'State')) return false;
  	 }
	if(listblock.style.display == "block")
	 {	
		if(document.frmcontactus.statelist.options.selectedIndex == 0) 
			{	
				alert("Please Enter State")
				document.frmcontactus.statelist.focus();
				return false;
			}
	 }
		if(!checkEmail(document.frmregister.Email,'Email Address')) return false;
	 */

}

function SubmitWishListSrch(formNm,actiontype,hid,sizeval,priceval)
{
var temp;
if(formNm=="prod_individual")
formNm.sizeactual.value=document.prod_individual.prodsize.options[document.prod_individual.prodsize.options.selectedIndex].text;
if(formNm=="frmcpgsrc")
	document.frmcpgsrc.sizeactual.value=0;
document.frmcpgsrc.product_id.value=hid;
document.frmcpgsrc.pricetxt.value=priceval;
document.frmcpgsrc.sizetxt.value=sizeval;
formNm.method = "post";
document.frmcpgsrc.action = main_path+"myWishList.php?sizefro="+sizeval+"&pricefro="+priceval+"&pid="+hid; 		
document.frmcpgsrc.ActionType.value = actiontype;
document.frmcpgsrc.submit();
}

