current_overID = '';
last_img = '';
last_click = '';

function mouseover2 (imgName) {
	if (document.images) {
		self.document.images [imgName].src = "/images/nav/nav_" + imgName +"_on.gif";
		if (last_img != '' && last_img != imgName && last_click != last_img) {
			self.document.images [last_img].src = "/images/nav/nav_" + last_img +"_off.gif";
		}
		last_img = imgName;
	}
}

function mouseoff2 (imgName) {
	if (document.images) {
		if (last_click != imgName) {
		  self.document.images [imgName].src = "/images/nav/nav_" + imgName +"_off.gif";
		  last_img = '';
		}
	}
}

function search_go(form) {
  var destvalue = document.search2.dest.options[document.search2.dest.selectedIndex].value;
  var optvalue = document.search2.accom.options[document.search2.accom.selectedIndex].value;
  if (optvalue == 'maps') {optvalue = 'map';}
  pagevalue = optvalue+".html";
  if (optvalue == 'condos') {pagevalue = 'index.html#condo';}
  	//alert(destvalue+':'+optvalue);
  if (destvalue != 'dash' && optvalue != 'dash') {
    return top.location.href ='http://caribbean.wheretostay.com/islands/'+destvalue+'/'+pagevalue;
  }
  return false;
}

function hm_form_carib(form) {
  var destvalue = document.search.dest.options[document.search.dest.selectedIndex].value;
  if (destvalue != 'dash') {
    top.location.href ='http://'+destvalue+'.wheretostay.com/';
  }
  return false;
}

function hm_form_hawaii(form) {
  var destvalue = document.search2.dest.options[document.search2.dest.selectedIndex].value;
  if (destvalue != 'dash') {
    top.location.href ='http://'+destvalue+'.wheretostay.com/';
  }
  return false;
}

function search_go1(form) {
  var locvalue = document.search1.loc.options[document.search1.loc.selectedIndex].value;
  var kwvalue = document.search1.search.value;
  if (locvalue != 'dash') {
    return top.location.href ='/cgi-bin/search/carib-'+locvalue+'.cgi?sp=sp&search='+kwvalue;
  }
  return false;
}

function poll_pop_up(form) {
poll_win = window.open('','PL','resizable=yes,status=0,width=350,height=400,scrollbars=1');
poll_win.focus();
return true;
}

function reader_review_pop_up(form) {
review_win = window.open('','RR','resizable=yes,status=0,width=450,height=500,scrollbars=1');
review_win.focus();
return true;
}

function email_friend_pop_up(form) {
email_win = window.open('','EM','resizable=yes,status=0,width=350,height=350,scrollbars=1');
email_win.focus();
return true;
}

function more_info_pop_up(form) {
more_win = window.open('','NOPE','resizable=yes,status=0,width=250,height=250,scrollbars=1');
more_win.focus();
return true;
}

function help_pop_up(url) {
help_win = window.open(url,'HP','resizable=yes,status=0,width=350,height=400,scrollbars=1');
help_win.focus();
return true;
}

function image_pop_up(w,h,url) {
img_win = window.open(url,'HP','resizable=yes,status=0,width='+w+',height='+h+',scrollbars=0');
img_win.focus();
return false;
}

function newsletterCheck() {
	var passed = false;
	// Validate form element named "fname".
	if (document.newsletter.email.value.indexOf("@") == -1 ||
		document.newsletter.email.value.indexOf(".") == -1) 
	{
	alert("Please include a proper e-mail address.");
	}
	//  If everything is in order, send the mail form.
	else {
		passed = true;
		_win = window.open('','NL','resizable=yes,status=0,width=300,height=300,scrollbars=1');
		_win.focus();
	}
	return passed;
}




