// JavaScript Document
  function confirmMsg(msg){
	if(!confirm(msg)){
		return false;
	} else {
		return true;
	}
}

function calldel(a)
{

	if(!confirm(a))
	{
		return false;
	}
	else
	return true;
}


function poplinks(url)
{
	newwindow=window.open(url,'ImageDisplay','height=400,width=600,left=0,top=0,resizable=yes,scrollbars=yes');
	if (window.focus) {newwindow.focus()}
}

function poplinks_print(url)
{
	newwindow=window.open(url,'ImageDisplay','height=325,width=850,left=0,top=0,resizable=No,scrollbars=yes');
	if (window.focus) {newwindow.focus()}
}
function poplinks_cert(url)
{
	newwindow=window.open(url,'ImageDisplay','height=400,width=850,left=0,top=0,resizable=no,scrollbars=yes');
	if (window.focus) {newwindow.focus()}
}

function login_validate()
{
	     var txtusername = document.login.txtusername.value;
		 if (txtusername == "" )
		 { 
			 alert ("Please enter Your Username");
			 document.login.txtusername.focus();
			 return false;
		 }
		 var txtpassword = document.login.txtpassword.value;
		 if (txtpassword == "" )
		 { 
			 alert ("Please enter Your Password");
			 document.login.txtpassword.focus();
			 return false;
		 }	
		 
}

function validateEmail(addr,man,db) {
	if (addr == '' && man) {
	   if (db) alert('Email address is mandatory');
	   return false;
	}
	var invalidChars = '\/\'\\ ";:?!()[]\{\}^|';
	for (i=0; i<invalidChars.length; i++) {
	   if (addr.indexOf(invalidChars.charAt(i),0) > -1) {
		  if (db) alert('Email address contains invalid characters');
		  return false;
	   }
	}
	for (i=0; i<addr.length; i++) {
	   if (addr.charCodeAt(i)>127) {
		  if (db) alert("Email address contains non ascii characters.");
		  return false;
	   }
	}
	var atPos = addr.indexOf('@',0);
	if (atPos == -1) {
	   if (db) alert('Email address must contain an @');
	   return false;
	}
	if (atPos == 0) {
	   if (db) alert('Email address must not start with @');
	   return false;
	}
	if (addr.indexOf('@', atPos + 1) > - 1) {
	   if (db) alert('Email address must contain only one @');
	   return false;
	}
	if (addr.indexOf('.', atPos) == -1) {
	   if (db) alert('Email address must contain a period in the domain name');
	   return false;
	}
	if (addr.indexOf('@.',0) != -1) {
	   if (db) alert('period must not immediately follow @ in email address');
	   return false;
	}
	if (addr.indexOf('.@',0) != -1){
	   if (db) alert('period must not immediately precede @ in email address');
	   return false;
	}
	if (addr.indexOf('..',0) != -1) {
	   if (db) alert('two periods must not be adjacent in email address');
	   return false;
	}
	var suffix = addr.substring(addr.lastIndexOf('.')+1);
	if (suffix.length != 2 && suffix != 'com' && suffix != 'net' && suffix != 'org' && suffix != 'edu' && suffix != 'int' && suffix != 'mil' && suffix != 'gov' & suffix != 'arpa' && suffix != 'biz' && suffix != 'aero' && suffix != 'name' && suffix != 'coop' && suffix != 'info' && suffix != 'pro' && suffix != 'museum') {
	   if (db) alert('invalid primary domain in email address');
	   return false;
	}
return true;
}

function myprofile_validate()
{
   if (document.form_myprofile.txt_contactperson.value== "" )
	{ 
			 alert ("Please enter the Person");
			 document.form_myprofile.txt_contactperson.focus();
			 return false;
    }
	var txt_email = document.form_myprofile.txt_email.value;
	 if (txt_email == "")
	 { 
		 alert ("Please enter the Email Address");
		 document.form_myprofile.txt_email.focus();
		 return false;
	 }	
	if (!validateEmail(document.form_myprofile.txt_email.value,1,1)) 
	 {
		 document.form_myprofile.txt_email.focus();
		 return false;
	 }
	
	var txt_phone = document.form_myprofile.txt_phone.value;
	 if (txt_phone == "")
	 { 
		 alert ("Please enter the Business Phone Number");
		 document.form_myprofile.txt_phone.focus();
		 return false;
	 }	
	 phone = document.form_myprofile.txt_phone;
		if (checkInternationalPhone(phone.value)==false){
			alert("Please Enter a Valid Phone Number")
			phone.value=""
			phone.focus()
			return false
			}
	/* if (isNaN(document.form_myprofile.txt_phone.value))
	 { 
		 alert ("Phone Number must be numeric");
		 document.form_myprofile.txt_phone.focus();
		 return false;
	 }*/
	   var txt_username = document.form_myprofile.txt_username.value;
		 if (txt_username == "" )
		 { 
			 alert ("Please enter Your Username");
			 document.form_myprofile.txt_username.focus();
			 return false;
		 }
		 var txtpassword = document.form_myprofile.txt_password.value;
		 if (txtpassword == "" )
		 { 
			 alert ("Please enter Your Password");
			 document.form_myprofile.txt_password.focus();
			 return false;
		 }
}

function generalsetting_validate()
{   
     if (document.form_general.txt_website.value == "") 
		{
			alert ("Please Enter the Website URL.");
			document.form_general.txt_website.focus();
			return false;
		}
		re = /^(file|http):\/\/\S+\.(com|net|org|info|biz|ws|us|tv|cc|in|cd|nw)$/i
		/* if (!(re.test(document.form_general.txt_website.value))) {
		 alert ("Invalid URL.");
		 document.form_general.txt_website.focus();
		 return false;
		 }*/
    var txt_numrows = document.form_general.txt_numrows.value;
	if (txt_numrows == "")
	 { 
		 alert ("Please enter the No Of Rows Displayed Per Page in Adminpanel");
		 document.form_general.txt_numrows.focus();
		 return false;
	 }	
	 if (isNaN(document.form_general.txt_numrows.value))
	 { 
		 alert ("No Of Rows Displayed Per Page in Adminpanel must be numeric");
		 document.form_general.txt_numrows.focus();
		 return false;
	 }
	 var txtnumrowsfront = document.form_general.txtnumrowsfront.value;
	 if (txtnumrowsfront == "")
	 { 
		 alert ("Please enter the No Of Rows Displayed Per Page in Frontpanel");
		 document.form_general.txtnumrowsfront.focus();
		 return false;
	 }	
	 if (isNaN(document.form_general.txtnumrowsfront.value))
	 { 
		 alert ("No Of Rows Displayed Per Page in Frontpanel must be numeric");
		 document.form_general.txtnumrowsfront.focus();
		 return false;
	 }
	 var txt_admintitle = document.form_general.txt_admintitle.value;
		 if (txt_admintitle == "" )
		 { 
			 alert ("Please enter Your Admintitle");
			 document.form_general.txt_admintitle.focus();
			 return false;
		 }
		 var txt_hometitle = document.form_general.txt_hometitle.value;
		 if (txt_hometitle == "" )
		 { 
			 alert ("Please enter Your Hometitle");
			 document.form_general.txt_hometitle.focus();
			 return false;
		 }
		 
		  
		 if (document.form_general.Quantity.value == "" )
		 { 
			 alert ("Please enter Your Quantity");
			 document.form_general.Quantity.focus();
			 return false;
		 }
		  if (isNaN(document.form_general.Quantity.value))
		 { 
		 alert ("Please enter Your Quantity  in numeric");
		 document.form_general.Quantity.focus();
		 return false;
	 }
}

function addrest_validate()
{
	 /*var restname = document.frm_addrest.restname.value;
		 if (restname == "" )
		 { 
			 alert ("Please enter Restaurant Name");
			 document.frm_addrest.restname.focus();
			 return false;
		 }*/
		 var ownername = document.frm_addrest.ownername.value;
		 if (ownername == "" )
		 { 
			 alert ("Please enter Owner Name");
			 document.frm_addrest.ownername.focus();
			 return false;
		 }
		 var addr1 = document.frm_addrest.addr1.value;
		 if (addr1 == "" )
		 { 
			 alert ("Please enter the Address");
			 document.frm_addrest.addr1.focus();
			 return false;
		 }
		 var city = document.frm_addrest.city.value;
		 if (city == "" )
		 { 
			 alert ("Please enter the City");
			 document.frm_addrest.city.focus();
			 return false;
		 }
		 var state= document.frm_addrest.state.value;
		 if (state== "")
		 { 
			 alert ("Please enter State");
			 document.frm_addrest.state.focus();
			 return false;
		 }
	 var pincode = document.frm_addrest.pincode.value;
	 if (pincode == "")
	 { 
		 alert ("Please enter the  Zip Code");
		 document.frm_addrest.pincode.focus();
		 return false;
	 }	
	
	var phone = document.frm_addrest.phone.value;
	 if (phone == "")
	 { 
		 alert ("Please enter the Business Phone Number");
		 document.frm_addrest.phone.focus();
		 return false;
	 }	
	 phonenumber = document.frm_addrest.phone;
		if (checkInternationalPhone(phonenumber.value)==false){
			alert("Please Enter a Valid Phone Number")
			phonenumber.value=""
			phonenumber.focus()
			return false
			}
	
	/*var email = document.frm_addrest.email.value;
	 if (email == "")
	   { 
		 alert ("Please enter the Email Address");
		 document.frm_addrest.email.focus();
		 return false;
	   }	
	  if (!validateEmail(document.frm_addrest.email.value,1,1)) 
	   {
		 document.frm_addrest.email.focus();
		 return false;
	  }*/
	  var username= document.frm_addrest.username.value;
		 if (username == "" )
		 { 
			 alert ("Please enter Your Username");
			 document.frm_addrest.username.focus();
			 return false;
		 }
	  	 var  password= document.frm_addrest.password.value;
	 if (password == "")
	 { 
	 alert ("Please enter the password");
	 document.frm_addrest.password.focus();
	 return false;
	 }	
	 var  password1= document.frm_addrest.password1.value;
	 if (password1 == "")
	 { 
	 alert ("Please enter the Confirm Password");
	 document.frm_addrest.password1.focus();
	 return false;
	 }	
	 if (password != password1)
	 { 
	 alert ("Password and Confirm Password must be the same");
	 document.frm_addrest.password1.focus();
	 return false;
	 }
}

function rest_validate()
{
	 var restname = document.frm_addrest.restname.value;
		 if (restname == "" )
		 { 
			 alert ("Please enter Restaurant Name");
			 document.frm_addrest.restname.focus();
			 return false;
		 }
		 var addr1 = document.frm_addrest.addr1.value;
		 if (addr1 == "" )
		 { 
			 alert ("Please enter the Address");
			 document.frm_addrest.addr1.focus();
			 return false;
		 }
		 var city = document.frm_addrest.city.value;
		 if (city == "" )
		 { 
			 alert ("Please enter the City");
			 document.frm_addrest.city.focus();
			 return false;
		 }
		 var state= document.frm_addrest.state.value;
		 if (state== "")
		 { 
			 alert ("Please enter State");
			 document.frm_addrest.state.focus();
			 return false;
		 }
		 var zipcode = document.frm_addrest.zipcode.value;
	 if (zipcode == "")
	 { 
		 alert ("Please enter the  Zip Code");
		 document.frm_addrest.zipcode.focus();
		 return false;
	 }	
	
		/*var email = document.frm_addrest.email.value;
		
	  if (email == "")
	   { 
		 alert ("Please enter the Email Address");
		 document.frm_addrest.email.focus();
		 return false;
	   }	
	  if (!validateEmail(document.frm_addrest.email.value,1,1)) 
	   {
		 document.frm_addrest.email.focus();
		 return false;
	  }*/
/*	  var logo= document.frm_addrest.logo.value;
		 if (logo == "" )
		 { 
			 alert ("Please Choose the Logo");
			 document.frm_addrest.logo.focus();
			 return false;
		 }
	  var image1= document.frm_addrest.image1.value;
		 if (image1 == "" )
		 { 
			 alert ("Please Choose the image1");
			 document.frm_addrest.image1.focus();
			 return false;
		 }
	  var image2= document.frm_addrest.image2.value;
		 if (image2 == "" )
		 { 
			 alert ("Please Choose the image2");
			 document.frm_addrest.image2.focus();
			 return false;
		 }
*/}


function addpages_validate()
{
    var pages = document.frm_addpages.pages.value;
		 if (pages == "" )
		 { 
			 alert ("Please enter the Page Tab Name");
			 document.frm_addpages.pages.focus();
			 return false;
		 }
		 var Heading = document.frm_addpages.Heading.value;
		 if (Heading == "" )
		 { 
			 alert ("Please enter the Heading");
			 document.frm_addpages.Heading.focus();
			 return false;
		 }
}
function editpages_validate()
{
    var pages = document.frm_editpages.pages.value;
		 if (pages == "" )
		 { 
			 alert ("Please enter the Page Tab Name");
			 document.frm_editpages.pages.focus();
			 return false;
		 }
		 var Heading = document.frm_editpages.Heading.value;
		 if (Heading == "" )
		 { 
			 alert ("Please enter the Heading");
			 document.frm_editpages.Heading.focus();
			 return false;
		 }
}
function menutype_validate()
{
    var menutype = document.frm_menutype.menutype.value;
		 if (menutype == "" )
		 { 
			 alert ("Please enter the Cuisine Type");
			 document.frm_menutype.menutype.focus();
			 return false;
		 }
}

function mailsetting_validate()
{
    var txt_subject = document.frm_mailsettings.txt_subject.value;
		 if (txt_subject == "" )
		 { 
			 alert ("Please enter the Subject");
			 document.frm_mailsettings.txt_subject.focus();
			 return false;
		 }
}
function restowners_validate()
{
    var name = document.frm_restowners.name.value;
		 if (name == "" )
		 { 
			 alert ("Please enter the Name");
			 document.frm_restowners.name.focus();
			 return false;
		 }
		 var email = document.frm_restowners.email.value;
		
	  if (email == "")
	   { 
		 alert ("Please enter the Email Address");
		 document.frm_restowners.email.focus();
		 return false;
	   }	
	  if (!validateEmail(document.frm_restowners.email.value,1,1)) 
	   {
		 document.frm_restowners.email.focus();
		 return false;
	  }
}
//Script validation for displaying the City list in the given state
var lists=new Array();

function emptyList( box ) 
{
	while ( box.options.length ) box.options[0] = null;
}

function fillList( box, arr ) 
{
	for ( i = 0; i < arr[0].length; i++ ) 
	{
		option = new Option( arr[0][i], arr[0][i+1] );
		box.options[box.length] = option;
		i=i+1;
	}
	//num=box.length;
	box.selectedIndex=0;
}

function changeList(box) 
{
	//alert(box.options[box.selectedIndex].value);
	list = lists[box.options[box.selectedIndex].value];
	if(box.options[box.selectedIndex].value != "" && box.options[box.selectedIndex].value != "choose")
	{
		emptyList(box.form.city);
		fillList( box.form.city, list );
	}
}
function menuimage_validate()
{
   /* var menutype = document.frm_menuimage.menutype.value;
		 if (menutype == "" )
		 { 
			 alert ("Please enter the Menu Type");
			 document.frm_menuimage.menutype.focus();
			 return false;
		 }*/
	var file = document.frm_menuimage.file.value;
		 if (file == "" )
		 { 
			 alert ("Please enter the Menu Image");
			 document.frm_menuimage.file.focus();
			 return false;
		 }
}
function menutype_validate()
{
    var menutype = document.frm_menutype.menutype.value;
		 if (menutype == "" )
		 { 
			 alert ("Please enter the Menu Type");
			 document.frm_menutype.menutype.focus();
			 return false;
		 }
}
function gift_validation()
{
     var price = document.frm_gift.price.value;
	 if (price == "")
	 { 
		 alert ("Please enter the Gift Price");
		 document.frm_gift.price.focus();
		 return false;
	 }	
	 if (isNaN(document.frm_gift.price.value))
	 { 
		 alert ("Gift Price must be numeric");
		 document.frm_gift.price.focus();
		 return false;
	 }
	 var value = document.frm_gift.value.value;
	 if (value == "")
	 { 
		 alert ("Please enter the Gift value");
		 document.frm_gift.value.focus();
		 return false;
	 }
	 if (isNaN(document.frm_gift.value.value))
	 { 
		 alert ("Gift value must be numeric");
		 document.frm_gift.value.focus();
		 return false;
	 }
}
function corporate_validate()
{
     var price = document.frm_corporate.price.value;
	 if (price == "")
	 { 
		 alert ("Please enter the Gift Price");
		 document.frm_corporate.price.focus();
		 return false;
	 }	
	 if (isNaN(document.frm_corporate.price.value))
	 { 
		 alert ("Gift Price must be numeric");
		 document.frm_corporate.price.focus();
		 return false;
	 }
	 var value = document.frm_corporate.value.value;
	 if (value == "")
	 { 
		 alert ("Please enter the Gift Price");
		 document.frm_corporate.value.focus();
		 return false;
	 }
}
startList = function() {

	//code only for IE
	if(!document.body.currentStyle) return;
	var subs = document.getElementsByName('submenu');
	for(var i=0; i<subs.length; i++) {
		var li = subs[i].parentNode;
		if(li && li.lastChild.style) {
			li.onmouseover = function() {
				this.lastChild.style.visibility = 'visible';
			}
			li.onmouseout = function() {
				this.lastChild.style.visibility = 'hidden';
			}
		}
	}
}
window.onload=startList;

function changeimage(fromid,imgname){
	var imgid=document.getElementById(fromid);
	if(imgid){
	imgid.src="../images/"+imgname;
	}
}
 


//Function phone validation Script
// Declaring required variables
var digits = "0123456789";
// non-digit characters which are allowed in phone numbers
var phoneNumberDelimiters = "()- ";
// characters which are allowed in international phone numbers
// (a leading + is OK)
var validWorldPhoneChars = phoneNumberDelimiters + "+";
// Minimum no of digits in an international phone no.
var minDigitsInIPhoneNumber = 10;

function isInteger(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function checkInternationalPhone(strPhone){
s=stripCharsInBag(strPhone,validWorldPhoneChars);
return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);
}

function catering_validation()
{
	var intResId = document.frm_catering.intResId.value;
	 if (intResId == "")
	 { 
		 alert ("Please select the Restaurant Name");
		 document.frm_catering.intResId.focus();
		 return false;
	 }
	
	 
     var price = document.frm_catering.price.value;
	 if (price == "")
	 { 
		 alert ("Please enter the Price");
		 document.frm_catering.price.focus();
		 return false;
	 }	
	 if (isNaN(document.frm_catering.price.value))
	 { 
		 alert ("Price must be numeric");
		 document.frm_catering.price.focus();
		 return false;
	 }
	 var value = document.frm_catering.value.value;
	 if (value == "")
	 { 
		 alert ("Please enter the Value");
		 document.frm_catering.value.focus();
		 return false;
	 }if (isNaN(document.frm_catering.value.value))
	 { 
		 alert ("Value must be numeric");
		 document.frm_catering.value.focus();
		 return false;
	 }
	  var restriction = document.frm_catering.restriction.value;
	 if (restriction == "")
	 { 
		 alert ("Please enter the  Restriction Field");
		 document.frm_catering.restriction.focus();
		 return false;
	 }
}
function discount_validation()
{
     var discode = document.frm_discount.discode.value;
	 if (discode == "")
	 { 
		 alert ("Please enter the Discount code");
		 document.frm_discount.discode.focus();
		 return false;
	 }	
	 if (isNaN(document.frm_discount.discode.value))
	 { 
		 alert ("Discount code must be numeric");
		 document.frm_discount.discode.focus();
		 return false;
	 }
	
	 if (document.frm_discount.DiscountValue[0].checked == false && document.frm_discount.DiscountValue[1].checked == false)
		 {
			alert ("select the Discount Value");
			return false;
		 }
		 
		 
	 var disvalue = document.frm_discount.disvalue.value;
	 if (disvalue == "")
	 { 
		 alert ("Please enter the Discount Value");
		 document.frm_discount.disvalue.focus();
		 return false;
	 }
	  if (isNaN(document.frm_discount.disvalue.value))
	 { 
		 alert ("Discount Value must be numeric");
		 document.frm_discount.disvalue.focus();
		 return false;
	 }
	 
	   if (document.frm_discount.startdate.value == "")
	   { 
		 alert ("Please enter the startdate");
		 document.frm_discount.startdate.focus();
		 return false;
	 }
	  if (document.frm_discount.enddate.value == "")
	   { 
		 alert ("Please enter the enddate");
		 document.frm_discount.enddate.focus();
		 return false;
	 }
	 if (!date_valid(document.frm_discount.startdate.value,document.frm_discount.enddate.value)) 
			{
					alert ("Please choose the End date as greater than the start date");
					document.frm_discount.startdate.value == "";
					document.frm_discount.startdate.focus();
					return false;
			}
			
		if (document.frm_discount.Coupon[0].checked == false && document.frm_discount.Coupon[1].checked == false)
		 {
			alert ("select the Coupon");
			return false;
		 }
	
}

function paypalsetting_validate(){
	 if (document.form_paypal.token.value == "")
	   { 
		 alert ("Please enter the Token Number");
		 document.form_paypal.token.focus();
		 return false;
	 }
	  if (document.form_paypal.paypalemail.value == "")
	   { 
		 alert ("Please enter the Email Address");
		 document.form_paypal.paypalemail.focus();
		 return false;
	 }
	 if (!validateEmail(document.form_paypal.paypalemail.value,1,1)) 
	   {
		 document.form_paypal.paypalemail.focus();
		 return false;
	  }
}


function memregistration_validate()
{
	 var email = document.frm_memreg.email.value;
		
	  if (email == "")
	   { 
		 alert ("Please enter the Email Address");
		 document.frm_memreg.email.focus();
		 return false;
	   }	
	  if (!validateEmail(document.frm_memreg.email.value,1,1)) 
	   {
		 document.frm_memreg.email.focus();
		 return false;
	  }
    var conemail = document.frm_memreg.conemail.value;
		 if (conemail == "" )
		 { 
			 alert ("Please enter the Email Again for Confirmaion");
			 document.frm_memreg.conemail.focus();
			 return false;
		 }
		 if (!validateEmail(document.frm_memreg.conemail.value,1,1)) 
	   {
		 document.frm_memreg.conemail.focus();
		 return false;
	  }
		 var password = document.frm_memreg.password.value;
		 if (password == "" )
		 { 
			 alert ("Please enter the Password");
			 document.frm_memreg.password.focus();
			 return false;
		 }
		 
	 var confirmpassword = document.frm_memreg.confirmpassword.value;
		 if (confirmpassword == "" )
		 { 
			 alert ("Please enter Your Confirm Password");
			 document.frm_memreg.confirmpassword.focus();
			 return false;
		 }
		 if (document.frm_memreg.confirmpassword.value != document.frm_memreg.password.value)
		 { 
			 alert ("Paasword and Confirm Password must be same");
			// document.frm_memreg.confirmpassword.focus();
			 return false;
		 }		 
		 var name = document.frm_memreg.name.value;
		 if (name == "" )
		 { 
			 alert ("Please enter the full Name");
			 document.frm_memreg.name.focus();
			 return false;
		 }
		 var address1 = document.frm_memreg.address1.value;
		 if (address1 == "" )
		 { 
			 alert ("Please enter the Address");
			 document.frm_memreg.address1.focus();
			 return false;
		 }
		 var city = document.frm_memreg.city.value;
		 if (city == "" )
		 { 
			 alert ("Please enter the City");
			 document.frm_memreg.city.focus();
			 return false;
		 }
		 var state = document.frm_memreg.state.value;
		 if (state == "Select" )
		 { 
			 alert ("Please Select the State");
			 document.frm_memreg.state.focus();
			 return false;
		 }
		 var zipcode = document.frm_memreg.zipcode.value;
		 if (zipcode == "" )
		 { 
			 alert ("Please enter the Zipcode");
			 document.frm_memreg.zipcode.focus();
			 return false;
		 }
		 var country = document.frm_memreg.country.value;
		 if (country == "" )
		 { 
			 alert ("Please enter the Country");
			 document.frm_memreg.country.focus();
			 return false;
		 }
}

function memberlogin_validate()
{    
      var email = document.frm_memlogin.email.value;
		
	  if (email == "")
	   { 
		 alert ("Please enter the Email Address");
		 document.frm_memlogin.email.focus();
		 return false;
	   }	
	  if (!validateEmail(document.frm_memlogin.email.value,1,1)) 
	   {
		 document.frm_memlogin.email.focus();
		 return false;
	  }
     var password = document.frm_memlogin.password.value;
	 if (password == "")
	 { 
		 alert ("Please enter the Password");
		 document.frm_memlogin.password.focus();
		 return false;
	 }	
	 		
}

function frontpro_validate()
{    

      var email = document.frm_frontmyprofile.email.value;
	  if (email == "")
	   { 
		 alert ("Please enter the Email Address");
		 document.frm_frontmyprofile.email.focus();
		 return false;
	   }	
	  if (!validateEmail(document.frm_frontmyprofile.email.value,1,1)) 
	   {
		 document.frm_frontmyprofile.email.focus();
		 return false;
	  }
     var password = document.frm_frontmyprofile.password.value;
	 if (password == "")
	 { 
		 alert ("Please enter the Password");
		 document.frm_frontmyprofile.password.focus();
		 return false;
	 }	
	  var name = document.frm_frontmyprofile.name.value;
		 if (name == "" )
		 { 
			 alert ("Please enter the full Name");
			 document.frm_frontmyprofile.name.focus();
			 return false;
		 }
		 var address1 = document.frm_frontmyprofile.address1.value;
		 if (address1 == "" )
		 { 
			 alert ("Please enter the Address");
			 document.frm_frontmyprofile.address1.focus();
			 return false;
		 }
		 var city = document.frm_frontmyprofile.city.value;
		 if (city == "" )
		 { 
			 alert ("Please enter the City");
			 document.frm_frontmyprofile.city.focus();
			 return false;
		 }
		 var state = document.frm_frontmyprofile.state.value;
		 if (state == "Select" )
		 { 
			 alert ("Please Choose the State");
			 document.frm_frontmyprofile.state.focus();
			 return false;
		 }
		 var zipcode = document.frm_frontmyprofile.zipcode.value;
		 if (zipcode == "" )
		 { 
			 alert ("Please enter the Zipcode");
			 document.frm_frontmyprofile.zipcode.focus();
			 return false;
		 }
		 var country = document.frm_frontmyprofile.country.value;
		 if (country == "" )
		 { 
			 alert ("Please enter the Country");
			 document.frm_frontmyprofile.country.focus();
			 return false;
		 }
}


function member_validate()
{    

      var email = document.frm_member.email.value;
	  if (email == "")
	   { 
		 alert ("Please enter the Email Address");
		 document.frm_member.email.focus();
		 return false;
	   }	
	  if (!validateEmail(document.frm_member.email.value,1,1)) 
	   {
		 document.frm_member.email.focus();
		 return false;
	  }
	  var conemail = document.frm_member.conemail.value;
		 if (conemail == "" )
		 { 
			 alert ("Please enter the Email Again for Confirmaion");
			 document.frm_member.conemail.focus();
			 return false;
		 }
		   if (!validateEmail(document.frm_member.conemail.value,1,1)) 
	   {
		 document.frm_member.conemail.focus();
		 return false;
	  }
     var password = document.frm_member.password.value;
	 if (password == "")
	 { 
		 alert ("Please enter the Password");
		 document.frm_member.password.focus();
		 return false;
	 }	
	  var name = document.frm_member.name.value;
		 if (name == "" )
		 { 
			 alert ("Please enter the full Name");
			 document.frm_member.name.focus();
			 return false;
		 }
		 var address1 = document.frm_member.address1.value;
		 if (address1 == "" )
		 { 
			 alert ("Please enter the Address");
			 document.frm_member.address1.focus();
			 return false;
		 }
		 var city = document.frm_member.city.value;
		 if (city == "" )
		 { 
			 alert ("Please enter the City");
			 document.frm_member.city.focus();
			 return false;
		 }
		 var state = document.frm_member.state.value;
		 if (state == "Select" )
		 { 
			 alert ("Please Choose the State");
			 document.frm_member.state.focus();
			 return false;
		 }
		 var zipcode = document.frm_member.zipcode.value;
		 if (zipcode == "" )
		 { 
			 alert ("Please enter the Zipcode");
			 document.frm_member.zipcode.focus();
			 return false;
		 }
		 var country = document.frm_member.country.value;
		 if (country == "" )
		 { 
			 alert ("Please enter the Country");
			 document.frm_member.country.focus();
			 return false;
		 }
}
function addsurvey_validate()
{    

      var question = document.frm_addsurvey.question.value;
	  if (question == "")
	   { 
		 alert ("Please enter the  Question");
		 document.frm_addsurvey.question.focus();
		 return false;
	   }	
	      var option1 = document.frm_addsurvey.option1.value;
	  if (option1 == "")
	   { 
		 alert ("Please enter the Option");
		 document.frm_addsurvey.option1.focus();
		 return false;
	   }
	      var option2 = document.frm_addsurvey.option2.value;
	  if (option2 == "")
	   { 
		 alert ("Please enter the Option");
		 document.frm_addsurvey.option2.focus();
		 return false;
	   }
}
function milesearch_validate()
{    

      var zipcode = document.form_zip.zipcode.value;
	  if (zipcode == "")
	   { 
		 alert ("Please enter the Zipcode");
		 document.form_zip.zipcode.focus();
		 return false;
	   }	
}
function statesearch_validate()
{    

      var state = document.frm_statesearch.state.value;
	  if (state == "Choose")
	   { 
		 alert ("Please Choose the State");
		 document.frm_statesearch.state.focus();
		 return false;
	   }	
}
function cuisinesearch_validate()
{    

	   var cuisine = document.frm_cuisinesearch.cuisine.value;
	  if (cuisine == "Choose")
	   { 
		 alert ("Please Choose the Cuisine Type");
		 document.frm_cuisinesearch.cuisine.focus();
		 return false;
	   }	
}

function ressearch_validate()
{    
	
	  var resname = document.frm_ressearch.resname.value;
	  if (resname == "")
	   { 
		 alert ("Please enter the Restaurant Name");
		 document.frm_ressearch.resname.focus();
		 return false;
	   }	
}
function cms_validate()
{    

      var heading = document.frm_cms.heading.value;
	  if (heading == "")
	   { 
		 alert ("Please enter the Heading");
		 document.frm_cms.heading.focus();
		 return false;
	   }	
}

function giftterms_validate()
{    

      var heading = document.frm_giftterms.heading.value;
	  if (heading == "")
	   { 
		 alert ("Please enter the Heading");
		 document.frm_giftterms.heading.focus();
		 return false;
	   }	
}

function ownercms_validate()
{    

      var heading = document.frm_ownercms.heading.value;
	  if (heading == "")
	   { 
		 alert ("Please enter the Heading");
		 document.frm_ownercms.heading.focus();
		 return false;
	   }	
}

//script validation for date 
function date_valid(dateissue,dateissue2){
	var stdate=dateissue.split("/");
	var enddate=dateissue2.split("/");
	var prostdate = new Date();
	prostdate.setFullYear(stdate[2]);
	prostdate.setMonth(stdate[0]-1);
	prostdate.setDate(stdate[1]);
	
	var proenddate = new Date();
	proenddate.setFullYear(enddate[2]);
	proenddate.setMonth(enddate[0]-1);
	proenddate.setDate(enddate[1]);
	
	var startingdate = prostdate.getTime();
	var endingdate = proenddate.getTime();

	if(startingdate > endingdate)
	{
		return false;
	}
	return true;
}

function checkout1_validate()
{    

      var email = document.frm_checkout.email.value;
	  if (email == "")
	   { 
		 alert ("Please enter the Email Address");
		 document.frm_checkout.email.focus();
		 return false;
	   }	
	  if (!validateEmail(document.frm_checkout.email.value,1,1)) 
	   {
		 document.frm_checkout.email.focus();
		 return false;
	  }
	
	  var name = document.frm_checkout.name.value;
		 if (name == "" )
		 { 
			 alert ("Please enter the full Name");
			 document.frm_checkout.name.focus();
			 return false;
		 }
		 var address1 = document.frm_checkout.address1.value;
		 if (address1 == "" )
		 { 
			 alert ("Please enter the Address");
			 document.frm_checkout.address1.focus();
			 return false;
		 }
		 var city = document.frm_checkout.city.value;
		 if (city == "" )
		 { 
			 alert ("Please enter the City");
			 document.frm_checkout.city.focus();
			 return false;
		 }
		 var state = document.frm_checkout.state.value;
		 if (state == "Select" )
		 { 
			 alert ("Please Choose the State");
			 document.frm_checkout.state.focus();
			 return false;
		 }
		 var zipcode = document.frm_checkout.zipcode.value;
		 if (zipcode == "" )
		 { 
			 alert ("Please enter the Zipcode");
			 document.frm_checkout.zipcode.focus();
			 return false;
		 }
		 var country = document.frm_checkout.country.value;
		 if (country == "" )
		 { 
			 alert ("Please enter the Country");
			 document.frm_checkout.country.focus();
			 return false;
		 }
		 if (document.frm_checkout.payment[0].checked == true)
		 {
			  var account = document.frm_checkout.account.value;
				 if (account == "" )
				 { 
					 alert ("Please enter the Accouont No");
					 document.frm_checkout.account.focus();
					 return false;
				 }
		 }
		
}



function addcert_validate()
{
	
	 var restname = document.frm_addrest.name.value;
		 if (restname == "" )
		 { 
			 alert ("Please enter Certificate Name");
			 document.frm_addrest.name.focus();
			 return false;
		 }
		 var addr1 = document.frm_addrest.validity.value;
		 if (addr1 == "" )
		 { 
			 alert ("Please enter Certificate validity");
			 document.frm_addrest.validity.focus();
			 return false;
		 }
		 var city = document.frm_addrest.descr.value;
		 if (city == "" )
		 { 
			 alert ("Please enter the Description");
			 document.frm_addrest.descr.focus();
			 return false;
		 }
}

function staffs_validate()
{  
	 var username = document.frm_addstaffs.username.value;
	  if (username == "")
	   { 
	     alert ("Please enter the Username");
		 document.frm_addstaffs.username.focus();
		 return false;
	   }	
	    var password = document.frm_addstaffs.password.value;
	  if (password == "")
	   { 
		 alert ("Please enter the Password");
		 document.frm_addstaffs.password.focus();
		 return false;
	   }	
	   var email = document.frm_addstaffs.email.value;
	  if (email == "")
	   { 
		 alert ("Please enter the Email Address");
		 document.frm_addstaffs.email.focus();
		 return false;
	   }	
	  if (!validateEmail(document.frm_addstaffs.email.value,1,1)) 
	   {
		 document.frm_addstaffs.email.focus();
		 return false;
	  }
}




