// JavaScript Document
function validate_destination(theForm)
{

  if (theForm.location.value == "")
  {
    alert("Please choose a destination to find a local vendors.");
    theForm.location.focus();
    return (false);
  }
  if (theForm.location.value == "suggest")
  {
	alert("Thank you for suggesting a new destination.  Please fill out the contact form to make your suggestion.");
   	document.location='/contact/';
	return (false);
  }
  
  return (true);
}

function Acoastasl_jumpMenu(targ,subscription,selObj,restore){ 
	Set_Cookie( 'subscription', subscription, 1, '/' );
	Set_Cookie( 'duration', selObj.options[selObj.selectedIndex].value, 1, '/' );
    eval(targ+".location='/my_account_new/'");
    if (restore) selObj.selectedIndex=0;
}

function Set_Cookie( name, value, expires, path )
{
	// set time, it's in milliseconds
	var today = new Date();
	today.setTime( today.getTime() );
	
	/*
	if the expires variable is set, make the correct
	expires time, the current script below will set
	it for x number of days, to make it for hours,
	delete * 24, for minutes, delete * 60 * 24
	*/
	if ( expires )
	{
	expires = expires * 1000 * 60 * 60 * 24;
	}
	var expires_date = new Date( today.getTime() + (expires) );
	
	document.cookie = name + "=" +escape( value ) +
	( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
	( ( path ) ? ";path=" + path : "" );
}

