
function goHome(){
location.href='http://www.beachesndreams.com';
}

function topMarg(){
  
   if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
    if (isIE){
    document.write('<div align="center">');}
     else {
  document.write('<div align="center" class="bodypos">');}
 }
 
function footerVIP(){

document.write('<td height="56" class="bottomnav" scope="col"><a href="http://www.beachesndreams.com" class="bottomnav">Home</a>&nbsp;&nbsp;&nbsp;|');
document.write('&nbsp;&nbsp;&nbsp;<a href="http://www.beachesndreams.com/floridasbest.asp" class="bottomnav">Florida\'s  Best</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;');
document.write('<a href="http://www.beachesndreams.com/hawaiisbest.asp" class="bottomnav">Hawaii\'s Best</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;');
document.write('<a href="http://www.beachesndreams.com/floridavip.asp" class="bottomnav">VIP  Program</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;');
document.write('<a href="https://site158.mysite4now.com/vickifb/bnd/vipsignup.asp" class="bottomnav">VIP  Sign-up</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;');
document.write('<a href="http://www.beachesndreams.com/purchase.asp" class="bottomnav">Purchase</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;');
document.write('<a href="http://www.beachesndreams.com/contactus.asp" class="bottomnav">Contact  Us</a></td>');
} 

function footer(){

document.write('<td height="56" class="bottomnav" scope="col"><a href="http://www.beachesndreams.com" class="bottomnav">Home</a>');
document.write('&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href="http://www.beachesndreams.com/floridasbest.asp" class="bottomnav">Florida\'s  Best</a>');
document.write('&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href="http://www.beachesndreams.com/hawaiisbest.asp" class="bottomnav">Hawaii\'s Best</a>');
document.write('&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href="http://www.beachesndreams.com/purchase.asp" class="bottomnav">Purchase</a>');
document.write('&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href="http://www.beachesndreams.com/contactus.asp" class="bottomnav">Contact  Us</a></td>');

}

function topNavMenu(){

document.write('<th height="21" bordercolor="#ECE9D8" background="images/topbanner.jpg" scope="col"><a href="http://www.beachesndreams.com">Home</a>');
document.write('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.beachesndreams.com/floridasbest.asp">');
document.write('Florida\'s Best</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;');
document.write('<a href="http://www.beachesndreams.com/hawaiisbest.asp">Hawaii\'s Best</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;');
document.write('<a href="http://www.beachesndreams.com/purchase.asp">Purchase</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;');
document.write('<a href="http://www.beachesndreams.com/contactus.asp">Contact  Us</a></th>');

}

<!-- Original:  Ronnie T. Moore Web Site:  The JavaScript Source -->
/*Dynamic 'fix' by: Nannette Thacker  Web Site: http://www.shiningstar.net

This script and many more are available free online at The JavaScript Source!! http://javascript.internet.com */

function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else 
countfield.value = maxlimit - field.value.length;
}

 function ValidateHEsurvey(x)
{

  if ((!document.HealthyEaters.TransFats[0].checked)&&(!document.HealthyEaters.TransFats[1].checked))
{
  alert("You must choose \"Yes\" or \"No\" for use of TransFats.");
  //document.Signup.GlutenFree[1].checked=true;
  document.HealthyEaters.TransFats[1].focus();
  return false;

}  


  if ((!document.HealthyEaters.Coconut[0].checked)&&(!document.HealthyEaters.Coconut[1].checked))
{
  alert("You must choose \"Yes\" or \"No\" for use of Coconut Oil.");
  //document.Signup.GlutenFree[1].checked=true;
  document.HealthyEaters.Coconut[1].focus();
  return false;

}  


  if ((!document.HealthyEaters.Wheatallergies[0].checked)&&(!document.HealthyEaters.Wheatallergies[1].checked))
{
  alert("You must choose \"Yes\" or \"No\" for question about Wheat allergies.");
  //document.Signup.GlutenFree[1].checked=true;
  document.HealthyEaters.Wheatallergies[1].focus();
  return false;

}  


  if ((!document.HealthyEaters.Organic[0].checked)&&(!document.HealthyEaters.Organic[1].checked))
{
  alert("You must choose \"Yes\" or \"No\" for question about Organic foods.");
  //document.Signup.GlutenFree[1].checked=true;
  document.HealthyEaters.Organic[1].focus();
  return false;

}  


  if ((!document.HealthyEaters.Processed[0].checked)&&(!document.HealthyEaters.Processed[1].checked))
{
  alert("You must choose \"Yes\" or \"No\" for use of Processed foods.");
  //document.Signup.GlutenFree[1].checked=true;
  document.HealthyEaters.Processed[1].focus();
  return false;

}  

  var Val = document.HealthyEaters.Restaurant.value;
      Val = trim(Val);
  
        
   if ((Val == "")||(isWhitespace(Val)))
{
  alert("ENTRY CANNOT BE BLANK.  You must enter your Restaurant Name.");
  document.HealthyEaters.Restaurant.focus();
  return false;
}     

var Val = document.HealthyEaters.cName.value;
    Val = trim(Val);
   
   if ((Val == "")||(isWhitespace(Val)))
{
  alert("ENTRY CANNOT BE BLANK.  You must enter a contact name.");
  document.HealthyEaters.cName.focus();
  return false;
}     

 var Val = document.HealthyEaters.cPhone.value;
 Val = trim(Val);
 
 if ((Val=="")||(!checkIntPhone(Val)))
 {
  alert("ENTRY CANNOT BE BLANK. You must enter a valid phone number.");
  document.HealthyEaters.cPhone.focus();
  return false;
 }

 var Val = document.HealthyEaters.cEmail.value;
 Val = trim(Val);
 
 if ((Val=="")||(!emailvalidation(Val)))
 {
  alert("PLEASE enter a valid email address.");
  document.HealthyEaters.cEmail.focus();
  return false;
 }

else
    {
        
    document.HealthyEaters.action= x;
    document.HealthyEaters.submit();
	
  }
}

 function ValidateSignUp(x)
{

 
  var Val = document.Signup.rName.value;
      Val = trim(Val);
  
        
   if ((Val == "")||(isWhitespace(Val)))
{
  alert("ENTRY CANNOT BE BLANK.  You must enter your Restaurant Name.");
  document.Signup.rName.focus();
  return false;
}     

var Val = document.Signup.Cuisine.value;
    Val = trim(Val);
   
      
   if ((Val == "")||(isWhitespace(Val)))
   
{
  alert("ENTRY CANNOT BE BLANK.  You must enter a cuisine.");
  document.Signup.Cuisine.focus();
  return false;
}     

  if ((!document.Signup.GlutenFree[0].checked)&&(!document.Signup.GlutenFree[1].checked))
{
  alert("You must choose \"Yes\" or \"No\" for Gluten Free.");
  //document.Signup.GlutenFree[1].checked=true;
  document.Signup.GlutenFree[1].focus();
  return false;

  }  


var Val = document.Signup.rAddress1.value;
    Val = trim(Val);
  
      
   if ((Val == "")||(isWhitespace(Val)))
{
  alert("ENTRY CANNOT BE BLANK.  You must enter a valid Address. \n"
  + "PLEASE double check your entry for accuracy.");
  document.Signup.rAddress1.focus();
  return false;
}      

var Val = document.Signup.rCity.value;
    Val = trim(Val);
   
      
   if ((Val == "")||(isWhitespace(Val)))
{
  alert("ENTRY CANNOT BE BLANK.  Please enter a valid City. \n"
  + "PLEASE double check your entry for accuracy.");
  document.Signup.rCity.focus();
  return false;
}      

var Val = document.Signup.rZip.value;
    Val = trim(Val);
      
 if ((Val == "")||(isWhitespace(Val))||(Val.length < 4)||(Val.length > 10))
{
  alert("ENTRY IS REQUIRED.  You must enter a VALID Zip Code.");
  document.Signup.rZip.focus();
  return false;
}

 var Val = document.Signup.rPhone.value;
 Val = trim(Val);
 
 if ((Val=="")||(!checkIntPhone(Val)))
 {
  alert("ENTRY CANNOT BE BLANK. You must enter a valid phone number.");
  document.Signup.rPhone.focus();
  return false;
 }

 var Val = document.Signup.rEmail.value;
 Val = trim(Val);
 
 if ((Val=="")||(!emailvalidation(Val)))
 {
  alert("PLEASE enter a valid email address.");
  document.Signup.rEmail.focus();
  return false;
 }

var Val = document.Signup.cName.value;
    Val = trim(Val);
   
      
   if ((Val == "")||(isWhitespace(Val)))
   
{
  alert("ENTRY CANNOT BE BLANK.  You must enter a contact name.");
  document.Signup.cName.focus();
  return false;
}     

 var Val = document.Signup.cPhone.value;
 Val = trim(Val);
 
 if ((Val=="")||(!checkIntPhone(Val)))
 {
  alert("ENTRY CANNOT BE BLANK. You must enter a valid phone number.");
  document.Signup.cPhone.focus();
  return false;
 }

 var Val = document.Signup.cEmail.value;
 Val = trim(Val);
 
 if ((Val=="")||(!emailvalidation(Val)))
 {
  alert("PLEASE enter a valid email address.");
  document.Signup.cEmail.focus();
  return false;
 }

var Val = document.Signup.CardName.value;
    Val = trim(Val);
   
      
   if ((Val == "")||(isWhitespace(Val)))
   
{
  alert("ENTRY CANNOT BE BLANK.");
  document.Signup.CardName.focus();
  return false;
}     

var Val = document.Signup.CardNumber.value;
    Val = trim(Val);
   
      
   if ((Val == "")||(isWhitespace(Val)))
   
{
  alert("ENTRY CANNOT BE BLANK.");
  document.Signup.CardNumber.focus();
  return false;
}     

var Val = document.Signup.CardSecCode.value;
    Val = trim(Val);
   
      
   if ((Val == "")||(isWhitespace(Val)))
   
{
  alert("ENTRY CANNOT BE BLANK.  You must enter your 3 or 4 digit CVV code.");
  document.Signup.CardSecCode.focus();
  return false;
}     

var Val = document.Signup.rDescription.value;
    Val = trim(Val);
   
      
   if ((Val == "")||(isWhitespace(Val)))
   
{
  alert("ENTRY CANNOT BE BLANK.  Please enter a brief description of your restaurant.");
  document.Signup.rDescription.focus();
  return false;
}     

 var Val = document.getElementById("rImage").value;
 var perd = Val.lastIndexOf(".");
 var typ = Val.substring(perd,Val.length);

 if ((Val.substring(Val.length-4,Val.length).toLowerCase()!=".jpg")&&(Val.substring(Val.length-4,Val.length).toLowerCase()!=".gif"))
 {
  alert("You may only upload gif or jpg files.  \n"
  + "This is a " + typ + " file type");
  document.Signup.rImage.value="";
  document.Signup.rImage.focus();
  return false;
 } 


   if(!document.Signup.Terms.checked)
{
   alert("You must agree to the Terms Agreement.  Check the box."); 
   document.Signup.Terms.focus();
   
}
 
else
    {
        
    document.Signup.action= x;
    document.Signup.submit();
	
  }
 }


	function emailvalidation(em)
	{
		strRegExp= /^[\w\-\.]+@[a-zA-Z0-9\-\.\_]+((\.(com|net|org|edu|int|mil|gov))|(\.(com|net|org|edu|int|mil|gov)\.[a-zA-Z]{2})|(\.[a-zA-Z]{2}))$/;
		//var xx= em.value;
		em= em.toLowerCase();
		
		if (!strRegExp.test(em))
		{ return false;
		}
		return true;
	}
	

function daysInFebruary (year){
	// February has 29 days in any year evenly divisible by four,
    // EXCEPT for centurial years which are not also divisible by 400.
    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function DaysArray(n) {
	for (var i = 1; i <= n; i++) {
		this[i] = 31
		if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
		if (i==2) {this[i] = 29}
   } 
   return this
}

function isDate(dtStr){
	var daysInMonth = DaysArray(12)
	var pos1=dtStr.indexOf(dtCh)
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	var strMonth=dtStr.substring(0,pos1)
	var strDay=dtStr.substring(pos1+1,pos2)
	var strYear=dtStr.substring(pos2+1)
	strYr=strYear
	if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
	if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
	for (var i = 1; i <= 3; i++) {
		if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
	}
	month=parseInt(strMonth)
	day=parseInt(strDay)
	year=parseInt(strYr)
	if (pos1==-1 || pos2==-1){
		alert("The date format should be : mm/dd/yyyy")
		return false;
	}
	if (strMonth.length<1 || month<1 || month>12){
		alert("Please enter a valid month")
		return false;
	}
	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
		alert("Please enter a valid day")
		return false;
	}
	if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
		alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear)
		return false;
	}
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
		alert("Please enter a valid date")
		return false;
	}
return true;
  }

function ltrim (s)
{
	return s.replace( /^\s*/, "" );
}
  function rtrim (s)
{
	return s.replace( /\s*$/, "" );
}
  function trim (s)
{
	return rtrim(ltrim(s));
}

var whitespace = "\t\n\r";
 // Check whether string s is empty.
function isEmpty(s)
{
return ((s == null) || (s.length == 0)) }
  // Returns true if string s is empty or 
// whitespace characters only.

function isWhitespace(s)
{   var i;

    // Is s empty?
    if (isEmpty(s)) {return true;}

    // Search through string's characters one by one
    // until we find a non-whitespace character.
    // When we do, return false; if we don't, return true.

    for (i = 0; i < s.length; i++)
    {   
	// Check that current character isn't whitespace.
	var c = s.charAt(i);

	if (whitespace.indexOf(c) == -1) {return false;}
    }

    // All characters are whitespace.
    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++){   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
   
}

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 checkIntPhone(strPhone){
 
 //var digits = "0123456789";
 
 var phoneNumberDelimiters = "()-.' '";
 
 var validWorldPhoneChars = phoneNumberDelimiters + "+";
 
 var minDgtsIntPhoneNum = 10;
  
   
   s= stripCharsInBag(strPhone, validWorldPhoneChars);
   return (isInteger(s)&& s.length >= minDgtsIntPhoneNum);
  }
  
  function doNothing()
  {}
