////// HIDE EMAIL SCRIPT /////
function hideEmail(path1, path2, path3)
{
 path = path1
 path += path2
 path += path3
 window.open(path);
}

//  href="#" onclick="hideEmail('mailto:CLIENT@', 'URL', '.com');return false;"


//POPUP WINDOWS

function eventpop(imagename) {
popwin = this.open(imagename, "events", "width=586,height=400, toolbar=no,menubar=no,location=no,scrollbars=yes,resize=yes,yesresize");
popwin.focus()
	//href=javascript:eventpop("events.asp")
}

function menupop(imagename) {
popwin = this.open(imagename, "menu", "width=600,height=440, toolbar=no,menubar=no,location=no,resize=no,noresize,scrollbars=yes");
popwin.focus();
//href=javascript:menupop("menu.html")
}

function respop(imagename) {
popwin = this.open(imagename, "reservations", "width=500,height=429, toolbar=no,menubar=no,location=no,resize=no,noresize,scrollbars=yes");
popwin.focus();}
//href=javascript:menupop("menu.html")

function mappop(imagename) {
popwin = this.open(imagename, "map", "width=400,height=400, toolbar=no,menubar=no,location=no,resize=no,noresize");
popwin.focus();}
//href=javascript:mappop("map.html")

function gallerypop(imagename) {
popwin = this.open(imagename, "gallery", "width=500,height=375, toolbar=no,menubar=no,location=no,scrollbars=no,resize=no,noresize");
popwin.focus();}
// href=javascript:gallerypop("gallery/1.html")

//-------------------------------------------------------------------------------------

//RANDOM IMAGES


var ListPIC = new Array("IMAGE", "IMAGE", "IMAGE")
function RandomPIC(){
	if(document.images){
		randomNum = Math.floor((Math.random()*10))%3
			document.NAME.src = "images/"+ ListPIC[randomNum]
	}
}

//usage: onLoad="RandomPIC()"

//-------------------------------------------------------------------------------------

//IMAGE PRELOADER & ROLLOVER FUNCTIONS

function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}}

function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;}

function MM_findObj(n, d) { //v4.01
var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}}

//-------------------------------------------------------------------------------------

//DEFINE FLASH VARIABLE
/*Flash setup
create variable or dynamic textbox in the root timeline called VAR
*/
 function flashVar(text) {
 window.document.FLASHNAME.SetVariable("VAR", text);
 }
//
/*USAGE
BODY  add-> onLoad="flashVar('VALUE')"

OBJECT  add->  ID="FLASHNAME"
EMBED  add->  NAME="FLASHNAME" swLiveconnect=true
*/

//-------------------------------------------------------------------------------------

//SCREEN REZ CHECKER


//Screen resolution detecter script: By JavaScript Kit (www.javascriptkit.com) More free scripts here! Note: Credit must stay intact for use.

var correctwidth=800;
var correctheight=600;
var supa=800;
var correctheight=600;
if (screen.width<correctwidth||screen.height<correctheight){
alert("This webpage is bested viewed with screen resolution "+correctwidth+"*"+correctheight+" or above. Your current resolution is "+screen.width+"*"+screen.height+". If possible, please change the resolution!");
}

//-------------------------------------------------------------------------------------


//DYNAMIC FORM VALUE RESTORE
//-------------------------------------------------------------------------------------
function Text_Input(elm, onoff)
{
	if (typeof(onoff) == "undefined" ){
		onoff = "blur";
	}

	if (!elm.base){
		elm.base = elm.value;
	}

	if (elm.value == elm.base && onoff != "blur"){
		elm.value = "";
	}
	else if (elm.value == "" && onoff == "blur"){
		elm.value = elm.base;
	}
}
//usage:<input type="text" value="TEXT" onBlur="Text_Input(this, 'blur')" onFocus="Text_Input(this, 'focus')">
//-------------------------------------------------------------------------------------




//-------------------------------------------------------------------------------------

//FORM VALIDATORS

//RESERVATIONS FORM

function Reservations_Validator(theForm){

if (theForm.user_salutation.value == "x"){
alert("Please select a Salutation.");
theForm.salutation.focus();
return (false);}

if (theForm.user_Fname.value == "First"){
alert("Please enter your First Name.");
theForm.user_Fname.focus();
return (false);}

if (theForm.user_Fname.value == ""){
alert("Please enter your First Name.");
theForm.user_Fname.focus();
return (false);}

if (theForm.user_Lname.value == "Last"){
alert("Please enter your Last Name.");
theForm.user_Lname.focus();
return (false);}

if (theForm.user_Lname.value == ""){
alert("Please enter your Last Name.");
theForm.user_Lname.focus();
return (false);}

if (theForm.user_phone.value == ""){
alert("Please enter your Phone Number.");
theForm.user_phone.focus();
return (false);}

if (theForm.user_phone.value.length < 10){
alert("Please include your area code in the \"Phone Number\" field.");
theForm.user_phone.focus();
return (false);}

if (theForm.res_day.value == "x"){
alert("Please specify what Day of the Week your reservation is for.");
theForm.res_day.focus();
return (false);}

if (theForm.res_month.value == "x"){
alert("Please specify what Month your reservation is for.");
theForm.res_month.focus();
return (false);}

if (theForm.res_datenum.value == "Date"){
alert("Please enter the date of your reservation.");
theForm.res_datenum.focus();
return (false);}

if (theForm.res_time.value == ""){
alert("Please enter the Time of Reservation.");
theForm.res_time.focus();
return (false);}

if (theForm.res_num_guests.value == ""){
alert("Please enter the Number of People in your party.");
theForm.res_num_guests.focus();
return (false);}
return (true);}

//---------------------------------------

//TELL A FRIEND FORM
function TellAFriend_Form_Validator(theForm)
{
  if (theForm.user_name.value == "")
  {
    alert("Please enter a value for the \"name\" field.");
    theForm.user_name.focus();
    return (false);
  }
  if (theForm.user_name.value.length < 2)
  {
    alert("Please enter at least 2 characters in the \"Your Name\" field.");
    theForm.user_name.focus();
    return (false);
  }
  if (theForm.user_email.value == "")
  {
    alert("Please enter a value for the \"Your E-mail\" field.");
    theForm.user_email.focus();
    return (false);
  }
  if (theForm.user_email.value.length < 6)
  {
    alert("Please enter at least 6 characters in the \"Your E-mail\" field.");
    theForm.user_email.focus();
    return (false);
  }
  return (true);
}

//---------------------------------------

//REQUEST INFO FORM
function RequestForm_Validator(theForm){

if (theForm.user_name.value == ""){
alert("Please enter a value for the \"Name\" field.");
theForm.user_name.focus();
return (false);}

if (theForm.tel.value == ""){
alert("Please enter a value for the \"Telephone\" field.");
theForm.tel.focus();
return (false);}

if (theForm.tel.value.length < 10){
alert("Please include your area code in the \"Telephone\" field.");
theForm.tel.focus();
return (false);}

	if (theForm.user_email.value == ""){
		alert("Please enter your email address");
		theForm.user_email.focus();
		return (false);
	}

		if (theForm.user_email.value.length < 6){
		alert("Please enter a valid email address");
		theForm.user_email.focus();
		return (false);
	}

if (theForm.date_of_event.value == ""){
alert("Please enter a value for the \"Date of Event\" field.");
theForm.date_of_event.focus();
return (false);}

if (theForm.date_of_event.value.length < 6){
alert("Please enter a valid date in the \"Date of Event\" field.");
theForm.date_of_event.focus();
return (false);}

if (theForm.number_of_people.value == ""){
alert("Please enter a value for the \"Number of People\" field.");
theForm.number_of_people.focus();
return (false);}

return (true);}

//-------------------------------------------------------------------------------------
