function checkFeedBack() {
	document.feedback.visitorName.value = trimSpaces(document.feedback.visitorName.value);
	if(document.feedback.visitorName.value.length <= 0) {
		alert("Please enter your name");
		document.feedback.visitorName.focus();
		return false;
	}

	document.feedback.emailAddress.value = trimSpaces(document.feedback.emailAddress.value);
	if(document.feedback.emailAddress.value.length <= 0) {
		alert("Please enter your email address");
		document.feedback.emailAddress.focus();
		return false;
	}
	if(!checkEmail(document.feedback.emailAddress.value)) {
		document.feedback.emailAddress.focus();
		document.feedback.emailAddress.select();
		return false;
	}
	document.feedback.visitorComments.value = trimSpaces(document.feedback.visitorComments.value);
	if(document.feedback.visitorComments.value.length <= 0) {
		alert("Please enter your comments");
		document.feedback.visitorComments.focus();
		return false;
	}
	document.feedback.frmAction.value = "update";
}


function checkContact(){
	contactname = trimSpaces(document.contact.visitorName.value);
	contactemail = trimSpaces(document.contact.visitorEmail.value);
	contactphone = trimSpaces(document.contact.visitorPhone.value);
	suggestions = trimSpaces(document.contact.visitorComments.value);

	if(contactname.length <= 0){
		alert("Please enter your name.");
		document.contact.visitorName.focus();
		return false;
	}
	if(!checkEmail(contactemail)) {
		document.contact.visitorEmail.focus();
		return false;
	}
	if(contactphone.length <= 0){
		alert("Please enter your telephone #.");
		document.contact.visitorPhone.focus();
		return false;
	}
	if(suggestions.length <= 0){
		alert("Please enter your queries/suggestions.");
		document.contact.visitorComments.focus();
		return false;
	}
	
	document.contact.frmAction.value = "send";

}

function closeWindow() {
	parent.window.opener.window.focus();
	parent.window.close();
}

function printWindow() {
	parent.mainFrame.focus();
	window.print(parent.mainFrame);
}

function hideText(frmElement){
	frmObject = eval("document.forms[0]." + frmElement);
	frmObject.value = "";
}

function checkSubscription() {
	
	firstName = trimSpaces(document.forms[0].firstName.value);
	if(firstName.length <= 0) {
		alert("Please enter your first name.");
		document.forms[0].firstName.focus();
		return false;
	}
	
	lastName = trimSpaces(document.forms[0].lastName.value);
	if(lastName.length <= 0) {
		alert("Please enter your last name.");
		document.forms[0].lastName.focus();
		return false;
	}
	
	subscriberEmail = trimSpaces(document.forms[0].subscriberemail.value);
	if(subscriberEmail.length <= 0) {
		alert("Please enter your email.");
		document.forms[0].subscriberemail.focus();
		return false;
	}
	if(subscriberEmail.length > 0){
		if(!checkEmail(subscriberEmail)){
			document.forms[0].subscriberemail.focus();
			return false;
		}
	}
	
	document.forms[0].frmAction.value = "update";

}
function checkQuantity1()
	{

		qtyCount = 0;
		if(document.cart.elements["quantity[]"].length){

			qtyLength = document.cart.elements["quantity[]"].length;

			for (i=0;i<qtyLength;i++) {
				qtyCount += parseInt(document.cart.elements["quantity[]"][i].value);
				if(document.cart.elements["quantity[]"][i].value!=document.cart.elements["h_quantity[]"][i].value){
				alert("Please Click the Update Button before placing the order");
				return false;
				}
			}

			if (qtyCount < 5) {
				alert("You must purchase minimum 5 quantity of a product or combination of products.");
				return false;
			}
			
		}else{
				qtyCount += document.cart.elements["quantity[]"].value; 
				if(document.cart.elements["quantity[]"].value!=document.cart.elements["h_quantity[]"].value){
				alert("Please Click the Update Button before placing the order");
				return false;
				}
			if (qtyCount < 5) {
				alert("You must purchase minimum 5 quantity of a product or combination of products.");
				return false;
			}
		}
		window.location.href='memberLogin.php?linkid=2';	
}

function checkQuote(){
	/*var rowChecked = false;
	companyname = trimSpaces(document.forms[0].companyname.value);
	companyaddress = trimSpaces(document.forms[0].companyaddress.value);
	contactperson = trimSpaces(document.forms[0].contactperson.value);
	telephone = trimSpaces(document.forms[0].telephone.value);
	email = trimSpaces(document.forms[0].email.value);
	productLength = document.forms[0].elements["products"].length;
	
	if(companyname.length <= 0){
		alert("Please enter the company name.");
		document.forms[0].companyname.focus();
		return false;
	}
	if(companyaddress.length <= 0){
		alert("Please enter the company address.");
		document.forms[0].companyaddress.focus();
		return false;
	}
	if(contactperson.length <= 0){
		alert("Please enter the contact person.");
		document.forms[0].contactperson.focus();
		return false;
	}
	if(telephone.length <= 0){
		alert("Please enter the telephone number.");
		document.forms[0].telephone.focus();
		return false;
	}
	if(email.length <= 0){
		alert("Please enter the email address.");
		document.forms[0].email.focus();
		return false;
	}
	if(!checkEmail(email)){
		document.forms[0].email.focus();
		return false;
	}
	for(i = 0; i < productLength; i++){
		if(document.forms[0].elements["products"][i].checked != 0)
			rowChecked = true;
	}
	if(!rowChecked){
		alert("Please select atleast one products/services you are interested in.");
		return false;
	}
	
	document.forms[0].frmAction.value = "send";*/
}

function showNews(newsid, pageType) {
	sWidth = screen.availWidth;
	sHeight = screen.availHeight;
	
	winWidth = 600;
	winHeight = 500;
	
	sLeft = (sWidth - winWidth) / 2;
	sTop = (sHeight - winHeight) / 2;
	
	if(pageType == "home") {
		pageUrl = "php/";
	}
	else {
		pageUrl = "";
	}

	window.open(pageUrl + "showNewsFrame.php?newsid=" + newsid, "news", "width=" + winWidth + ",height=" + winHeight + ",top=" + sTop + ",left=" + sLeft + ",toolbar=0,menubar=0,status=0,scrollbars=1,resizable=0");
	return;
}
function showFamilyPicture(familyimages_id, photoType,family,linkid) {
	
	sWidth = screen.availWidth;
	sHeight = screen.availHeight;
	
	winWidth = 600;
	winHeight = 500;
	
	sLeft = (sWidth - winWidth) / 2;
	sTop = (sHeight - winHeight) / 2;
	//alert("showPictureFrame.php?familyimages_id=" + familyimages_id + "&photoType=" + photoType + "&family="+family + "&linkid="+linkid, "family", "width=" + winWidth + ",height=" + winHeight + ",top=" + sTop + ",left=" + sLeft + ",toolbar=0,menubar=0,status=0,scrollbars=1,resizable=0");
	window.open("showPictureFrame.php?familyimages_id=" + familyimages_id + "&photoType=" + photoType + "&family="+family + "&linkid="+linkid, "family", "width=" + winWidth + ",height=" + winHeight + ",top=" + sTop + ",left=" + sLeft + ",toolbar=0,menubar=0,status=0,scrollbars=1,resizable=0");
	return;
}
function checkNews(frmName,elemName1,elemName2) {
	newsHeading = trimSpaces(document.frmName.newsHeading.value);
	if(newsHeading.length <= 0) {
		alert("Please enter the heading");
		document.frmName.newsHeading.focus();
		return false;
	}
	frmObject = eval("document." + frmName);
	frmElement = eval("document." + frmName + "." + elemName1);
	frmElement.value =eval(elemName2 + ".document.body.innerHTML");
	if(trimSpaces(frmElement.value).length<=0)
	  {
	  alert("Please make sure all fields are filled!");
	  return false;
	  }
	document.frmName.frmAction.value = 'update';
}
function showPhoto(photoUrl,menu) { 

	sWidth = screen.availWidth;
	sHeight = screen.availHeight;
	
	winWidth = 400;
	winHeight = 400;
	
	sLeft = (sWidth - winWidth) / 2;
	sTop = (sHeight - winHeight) / 2; 
	
	//window.open("showPhotoDesc.php?id=" + photoUrl + "&menu=" + menu,"photoURL","width=" + winWidth + ",height=" + winHeight + ",top=" + sTop + ",left=" + sLeft + ",toolbar=0,menubar=0,status=0,scrollbars=1,resizable=0");
}
/*function showDesc(elementName)
{   alert("1");
	if(elementName=='product'){
	    if(document.forms[0].select1.value==0){
		alert("Select a product");
		document.forms[0].select1.focus();
		return false;
		}
		document.forms[0].id.value = trimSpaces(document.forms[0].select1.value);
		document.forms[0].linkid.value = 2;
		document.forms[0].action="showProductCatalogue.php";
		document.forms[0].submit();
				
	}
	if(elementName=='search'){
		document.forms[0].textfield.value =trimSpaces(document.forms[0].textfield.value);
		if(document.forms[0].textfield.value=="")
		{
		alert("Enter search string");
		document.forms[0].textfield.focus();
		return false;
		}
		else
		{
		document.forms[0].action="../php/showSearchResult.php";
		document.forms[0].submit();
        }
	}
}*/
function showDesc(elementName,page)
{				

    if(elementName=='distributor' && page=='home'){
	     if(document.distributor.select2.value==""){
		 alert("Select a State / Region");
		 document.distributor.select2.focus();
		 return false;
		 }
		 else
		 {
			document.distributor.action="php/showDistributor.php";
			document.distributor.submit();
			return true;
		 }
	}
	if(elementName=='distributor' && page=='sub'){
	     if(document.distributor.select2.value==""){
		 alert("Select a State / Region");
		 document.distributor.select2.focus();
		 return false;
		 }
		 else
		 {
			document.distributor.action="showDistributor.php";
			document.distributor.submit();
			return true;
		 }
	}

	if(elementName=='product' && page=='home'){
	
	    if(document.product.select1.value=="")
		{
		alert("select a product");
		document.product.select1.focus();
		return false;
		}
		else{
		document.product.id.value = trimSpaces(document.product.select1.value);
		document.product.linkid.value = 2;
		document.product.action="php/showPhotoDesc.php";
		document.product.submit();
		}
		//document.forms[0].action="showProductCatalogue.php";
	}
		if(elementName=='product' && page=='sub'){
	
	    if(document.product.select1.value=="")
		{
		alert("select a product");
		document.product.select1.focus();
		return false;
		}
		else{
		document.product.id.value = trimSpaces(document.product.select1.value);
		document.product.linkid.value = 2;
		document.product.action="showPhotoDesc.php";
		document.product.submit();
		}
		//document.forms[0].action="showProductCatalogue.php";
	}

	if(elementName=='search' && page=='home'){
		document.search.searchKey.value =trimSpaces(document.search.searchKey.value);
		if(document.search.searchKey.value=="")
		{
		alert("Enter search string");
		document.search.searchKey.focus();
		return false;
		}
		else
		{
		document.search.action="php/displaySearch.php";
		document.search.submit();
        }
	}
	if(elementName=='search' && page=='sub'){
		document.search.searchKey.value =trimSpaces(document.search.searchKey.value);
		if(document.search.searchKey.value=="")
		{
		alert("Enter search string");
		document.search.searchKey.focus();
		return false;
		}
		else
		{
		document.search.action="displaySearch.php";
		document.search.submit();
        }
	}
	if(elementName=='login' && page=='home'){
		document.login.email.value =trimSpaces(document.login.email.value);
		document.login.pwd.value=trimSpaces(document.login.pwd.value);
		if(document.login.email.value=="")
		{
		alert("Please provide your Email");
		document.login.email.focus();
		return false;
		}
		if(document.login.pwd.value=="")
		{
		alert("Please provide your Password");
		document.login.pwd.focus();
		return false;
		}
		else
		{
		document.login.action="php/verifymember.php?linkid=37";
		document.login.submit();
        }
	}
	
}
function rateIt(id) {
	sWidth = screen.availWidth;
	sHeight = screen.availHeight;
	winWidth=500;
	winHeight=500; 
	sLeft = (sWidth - winWidth) / 2;
	sTop = (sHeight - winHeight) / 2;

	window.open("ratethisRecipe.php?id="+id, "recipes", "width=" + winWidth + ",height=" + winHeight + ",top=" + sTop + ",left=" + sLeft + ",toolbar=0,menubar=0,status=0,scrollbars=1,resizable=0");
	return;
} 
function showpicRecipe(id) {
	sWidth = screen.availWidth;
	sHeight = screen.availHeight;
	winWidth=500;
	winHeight=600;
	sLeft = (sWidth - winWidth) / 2;
	sTop = (sHeight - winHeight) / 2; 

	window.open("showRecipePhoto.php?id="+id, "Recipes", "width=" + winWidth + ",height=" + winHeight + ",top=" + sTop + ",left=" + sLeft + ",toolbar=0,menubar=0,status=0,scrollbars=1,resizable=0");
	return;
} 
function txtClear(dispText)
{
	if(dispText.value==dispText.defaultValue)
	{
		dispText.value="";
	}
}
function chkpdtlocator(){
	storetype=trimSpaces(document.productlocator.storetype.value);
	country=trimSpaces(document.productlocator.category.value);
	state=trimSpaces(document.productlocator.opt1.value);
	name=trimSpaces(document.productlocator.name.value);
	if(storetype=="" && country=="" && state=="" && name==""){
	alert("Select atleast one search");
	document.productlocator.storetype.focus();
	return false;
	}
	else{
	document.productlocator.action="showlocation.php";
	document.productlocator.submit();
	return true;
	}
} 
function valUserRegistration()
{
   
   email = document.member.email.value;
	if(email.length <= 0) {
		alert("Enter your email");
		document.member.email.focus();
		return false;
    }
	else
	 {
	   if(!checkEmail(document.member.email.value))
	   {
		document.member.email.focus();
	    return false;
	   }
	 }  	 

	
	pwd = trimSpaces(document.member.pwd.value);
	if(pwd.length <= 0) {
		alert("Enter your password");
		document.member.pwd.focus();
		return false;
    }
	
	if(pwd.length < 6) {
		alert("Enter password between 6 to 20 characters");
		document.member.pwd.focus();
		return false;
    }	
	
	c_pwd = trimSpaces(document.member.c_pwd.value);
	if(c_pwd.length <= 0) {
		alert("Enter re enter your password");
		document.member.c_pwd.focus();
		return false;
    }
	
	c_pwd = trimSpaces(document.member.c_pwd.value);
	if(pwd != c_pwd) {
		alert("Your passwords does not match");
		document.member.c_pwd.focus();
		return false;
    }	

	document.member.first_name.value=trimSpaces(document.member.first_name.value);
	if(document.member.first_name.value.length<=0)
	 {
	 	alert("Enter your First Name");
		document.member.first_name.focus();
		return false;
	 }
	 
	document.member.last_name.value=trimSpaces(document.member.last_name.value);
	if(document.member.last_name.value.length<=0)
	 {
	 	alert("Enter your Last Name");
		document.member.last_name.focus();
		return false;
	 }

	document.member.address.value=trimSpaces(document.member.address.value);
	if(document.member.address.value.length<=0)
	 {
	 	alert("Enter Street");
		document.member.address.focus();
		return false;
	 }
	document.member.suite.value=trimSpaces(document.member.suite.value);
	if(document.member.suite.value.length<=0)
	 {
	 	alert("Enter Suite");
		document.member.suite.focus();
		return false;
	 }
	document.member.city.value=trimSpaces(document.member.city.value);
	if(document.member.city.value.length<=0)
	 {
	 	alert("Enter City");
		document.member.city.focus();
		return false;
	 }
	document.member.city.value=trimSpaces(document.member.city.value);
	if(document.member.state.value.length<=0)
	 {
	 	alert("Enter State");
		document.member.state.focus();
		return false;
	 }
	country = document.member.country.options[document.member.country.selectedIndex].value;
	if(country == "")
	 {
	 	alert("Select Country");
		document.member.country.focus();
		return false;
	 }

	document.member.zip.value=trimSpaces(document.member.zip.value);
	if(document.member.zip.value.length<=0)
	 {
	 	alert("Enter Zip");
		document.member.zip.focus();
		return false;
	 }
	   	
	document.member.phoneC.value=trimSpaces(document.member.phoneC.value);
	if(document.member.phoneC.value.length<=0)
	 {
	 	alert("Enter Phone code");
		document.member.phoneC.focus();
		return false;
	 }
	 
	document.member.phoneN.value=trimSpaces(document.member.phoneN.value);
	if(document.member.phoneN.value.length<=0)
	 {
	 	alert("Enter Phone number");
		document.member.phoneN.focus();
		return false;
	 }
	 
	document.member.frmAction.value="update";
	//document.member.submit();
}
function checkLoginForm() {
	userName = trimSpaces(document.investor.userName.value);
	password = trimSpaces(document.investor.password.value);
	
	if(userName.length <= 0) {
		alert("Please provide your Email");
		document.forms[0].investor.focus();
		return false;
	}
	
	if(password.length <= 0) {
		alert("Please provide your Password");
		document.investor.password.focus();
		return false;
	}
	document.investor.frmAction.value="login";
	document.investor.submit();

}
function chkForm()
{
	username = trimSpaces(document.frmPassSend.username.value);
	if (username == "")
	{
		alert("Please enter the Email ID");
		document.frmPassSend.username.focus();
		return false;
	}
	document.frmPassSend.frmAction.value="Send";
	document.frmPassSend.submit();
}
function showrecipePop(id) {
	sWidth = screen.availWidth;  
	sHeight = screen.availHeight;
	winWidth = 450;
	winHeight = 400;
	sLeft = (sWidth - winWidth) / 2; 
	sTop = (sHeight - winHeight) / 2;
	window.open("showRecipePhoto.php?id="+id,"Cities","width=" + winWidth + ",height=" + winHeight + ",top=" + sTop + ",left=" + sLeft + ",toolbar=0,menubar=0,status=0,scrollbars=1,resizable=0");
}
function chkEnquiry(){
	name=trimSpaces(document.enquiries.name.value);
	if(name==""){
	alert("Please enter the name");
	document.enquiries.name.focus();
	return false;
	}
	street=trimSpaces(document.enquiries.street.value);
	if(street==""){
	alert("Please enter the Street Address");
	document.enquiries.street.focus();
	return false;
	}
	city=trimSpaces(document.enquiries.city.value);
	if(city==""){
	alert("Please enter the City");
	document.enquiries.city.focus();
	return false;
	}
	state=trimSpaces(document.enquiries.state.value);
	if(state==""){
	alert("Please enter the State");
	document.enquiries.state.focus();
	return false;
	}
	country=trimSpaces(document.enquiries.country.value);
	if(country==""){
	alert("Please enter the Country");
	document.enquiries.country.focus();
	return false;
	}
	email=trimSpaces(document.enquiries.email.value);
	if(email==""){
	alert("Please enter the Email");
	document.enquiries.email.focus();
	return false;
	}
	else
	{
	   if(!checkEmail(document.enquiries.email.value))
	   {
		document.enquiries.email.focus();
	    return false;
	   }
	}  
	document.enquiries.frmAction.value="save";
}
function checkOut()
{
	document.forms[0].action="memberLogin.php";
	document.forms[0].submit();
}
function populateShipping()
			{
			 document.orderForm.ship_firstname.value=document.orderForm.bill_firstname.value;
			 document.orderForm.ship_lastname.value=document.orderForm.bill_lastname.value;
			 document.orderForm.ship_company.value=document.orderForm.bill_company.value;
			 document.orderForm.ship_address.value=document.orderForm.bill_address.value;
			 document.orderForm.ship_apartment.value=document.orderForm.bill_apartment.value;
			 document.orderForm.ship_city.value=document.orderForm.bill_city.value;
			 document.orderForm.ship_state.value=document.orderForm.bill_state.value;
			 document.orderForm.ship_zip.value=document.orderForm.bill_zip.value;
			 document.orderForm.ship_country.value=document.orderForm.bill_country.value;
			 document.orderForm.ship_dphone.value=document.orderForm.bill_dphone.value;
			 document.orderForm.ship_ephone.value=document.orderForm.bill_ephone.value;
			 
			}
function valOrderForm(toDo)
 {
	bill_firstname = trimSpaces(document.orderForm.bill_firstname.value);
	bill_lastname = trimSpaces(document.orderForm.bill_lastname.value);
	bill_company = trimSpaces(document.orderForm.bill_company.value);
    bill_address = trimSpaces(document.orderForm.bill_address.value);
	bill_city = trimSpaces(document.orderForm.bill_city.value);
	bill_state = trimSpaces(document.orderForm.bill_state.value);
	bill_zip = trimSpaces(document.orderForm.bill_zip.value);
	bill_dphone = trimSpaces(document.orderForm.bill_dphone.value);
	
	ship_firstname = trimSpaces(document.orderForm.ship_firstname.value);
	ship_lastname = trimSpaces(document.orderForm.ship_lastname.value);
	ship_company = trimSpaces(document.orderForm.ship_company.value);
	ship_address = trimSpaces(document.orderForm.ship_address.value);
	ship_city = trimSpaces(document.orderForm.ship_city.value);
	ship_state = trimSpaces(document.orderForm.ship_state.value);
	ship_zip = trimSpaces(document.orderForm.ship_zip.value);
	ship_dphone = trimSpaces(document.orderForm.ship_dphone.value);
	
	
	
	if(bill_firstname.length <= 0) {
		alert("Please enter First name");
		document.orderForm.bill_firstname.focus();
		return false;
	}
	
	if(bill_lastname.length <= 0) {
		alert("Please enter Last name");
		document.orderForm.bill_lastname.focus();
		return false;
	}
	
	
	if(bill_address.length <= 0) {
		alert("Please enter Address");
		document.orderForm.bill_address.focus();
		return false;
	}
	
	
	
	if(bill_city.length <= 0) {
		alert("Please enter City");
		document.orderForm.bill_city.focus();
		return false;
	}
	
	
	if(bill_state.length <= 0) {
		alert("Please enter State");
		document.orderForm.bill_state.focus();
		return false;
	}
	
	
	if(bill_zip.length <= 0) {
		alert("Please enter zip");
		document.orderForm.bill_zip.focus();
		return false;
	}
	
		
	if(bill_dphone.length <= 0) {
		alert("Please enter Phone no.");
		document.orderForm.bill_dphone.focus();
		return false;
	}
	
	
	
	if(ship_firstname.length <= 0) {
		alert("Please enter First name");
		document.orderForm.ship_firstname.focus();
		return false;
	}
	
	if(ship_lastname.length <= 0) {
		alert("Please enter Last name");
		document.orderForm.ship_lastname.focus();
		return false;
	}
	
	
	if(ship_address.length <= 0) {
		alert("Please enter Address");
		document.orderForm.ship_address.focus();
		return false;
	}
	
	
	
	if(ship_city.length <= 0) {
		alert("Please enter City");
		document.orderForm.ship_city.focus();
		return false;
	}
	
	
	if(ship_state.length <= 0) {
		alert("Please enter State");
		document.orderForm.ship_state.focus();
		return false;
	}
	
	
	if(ship_zip.length <= 0) {
		alert("Please enter zip");
		document.orderForm.ship_zip.focus();
		return false;
	}
	
		
	if(ship_dphone.length <= 0) {
		alert("Please enter Phone no.");
		document.orderForm.ship_dphone.focus();
		return false;
	}
	if(document.orderForm.method_of_payment.value =="sel") {
		   alert("Sorry! You have to select method of payment");
		   document.orderForm.method_of_payment.focus();
		   return false;
	}
	
	
	///credit card acceptance section
	method_of_payment = document.orderForm.method_of_payment.options[document.orderForm.method_of_payment.selectedIndex].value;
	if(credit_card.style.display == "block"){
	name_on_card = trimSpaces(document.orderForm.name_on_card.value);
	billing_address = trimSpaces(document.orderForm.billing_address.value);
	city2 = trimSpaces(document.orderForm.city2.value);
	state2 = trimSpaces(document.orderForm.state2.value);
	zip2 = trimSpaces(document.orderForm.zip2.value);
	card_number = trimSpaces(document.orderForm.card_number.value);
	txtMonth = trimSpaces(document.orderForm.txtMonth.value);
	txtYear = trimSpaces(document.orderForm.txtYear.value);
	security_number=trimSpaces(document.orderForm.security_number.value);
	
	if(method_of_payment=="Credit Card"){
		if(name_on_card.length<=0)
			{
			alert("Please Enter your name on the card");
			document.orderForm.name_on_card.focus();
			return false;
			}	
			if(billing_address.length<=0)
			{
			alert("Please Enter your billing address");
			document.orderForm.billing_address.focus();
			return false;
			}
			if(city2.length<=0)
			{
			alert("Please Enter your city");
			document.orderForm.city2.focus();
			return false;
			}
			if(state2.length<=0)
			{
			alert("Please Enter your state");
			document.orderForm.state2.focus();
			return false;
			}
			if(zip2.length<=0)
			{
			alert("Please Enter zip code");
			document.orderForm.zip2.focus();
			return false;
			}
			if(card_number.length<=0)
			{
			alert("Please Enter card_number");
			document.orderForm.card_number.focus();
			return false;
			}
			if(txtMonth.length<=0)
			{
			alert("Please Enter Expiry Month of the card");
			document.orderForm.txtMonth.focus();
			return false;
			}
			if(txtYear.length<=0)
			{
			alert("Please Enter Expiry Year of the card");
			document.orderForm.txtYear.focus();
			return false;
			}
			if(security_number.length<=0)
			{
			alert("Please Enter security number of the card");
			document.orderForm.security_number.focus();
			return false;
			}
	    }
	}
	else{
	  document.orderForm.name_on_card.value ="";
	  document.orderForm.billing_address.value ="";
	  document.orderForm.city2.value ="";
	  document.orderForm.state2.value ="";
	  document.orderForm.zip2.value ="";
	  document.orderForm.credit_card_type.value ="";
	  document.orderForm.card_number.value ="";
	  document.orderForm.txtMonth.value ="";
	  document.orderForm.txtYear.value ="";
	  document.orderForm.security_number.value ="";
	}
	
	if(check.style.display == "block"){
		if(method_of_payment=="Check"){
			checkDetails = trimSpaces(document.orderForm.checkDetails.value);
	         if(checkDetails.length<=0){
               alert("Please enter the check details");
			   document.orderForm.checkDetails.focus();
			   return false;
			 }
		 }
	}
	else{
	document.orderForm.checkDetails.value="";
	}
		
	document.orderForm.frmAction.value = toDo;
}
function openDynWindow(url,width,height) {
	sWidth = screen.availWidth;
	sHeight = screen.availHeight;
	
	winWidth = width;
	winHeight = height;
	
	sLeft = (sWidth - winWidth) / 2;
	sTop = (sHeight - winHeight) / 2;
	window.open(url, "win", "width=" + winWidth + ",height=" + winHeight + ",top=" + sTop + ",left=" + sLeft + ",toolbar=0,menubar=0,status=0,scrollbars=1,resizable=0");
}
function valEditOrder()
{
if(document.orderDetails.order_status.value == 'C')
{
if (!confirm("Are you sure to cancel this order?"))
return false;
}
document.orderDetails.frmAction.value='update'
}
function valaskthechef()
{
   
   email = document.askthechef.email.value;
	if(email.length <= 0) {
		alert("Enter your email");
		document.askthechef.email.focus();
		return false;
    }
	else
	 {
	   if(!checkEmail(document.askthechef.email.value))
	   {
		document.askthechef.email.focus();
	    return false;
	   }
	 }  	 
	document.askthechef.first_name.value=trimSpaces(document.askthechef.first_name.value);
	if(document.askthechef.first_name.value.length<=0)
	 {
	 	alert("Enter your First Name");
		document.askthechef.first_name.focus();
		return false;
	 }
	 
	document.askthechef.last_name.value=trimSpaces(document.askthechef.last_name.value);
	if(document.askthechef.last_name.value.length<=0)
	 {
	 	alert("Enter your Last Name");
		document.askthechef.last_name.focus();
		return false;
	 }

	document.askthechef.address.value=trimSpaces(document.askthechef.address.value);
	if(document.askthechef.address.value.length<=0)
	 {
	 	alert("Enter Street");
		document.askthechef.address.focus();
		return false;
	 }
	document.askthechef.query.value=trimSpaces(document.askthechef.query.value);
	if(document.askthechef.query.value.length<=0)
	 {
	 	alert("Enter your query");
		document.askthechef.query.focus();
		return false;
	 }
	 
	document.askthechef.frmAction.value="update";
	//document.member.submit();
}

