////// 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 menupop(imagename) {
popwin = this.open(imagename, "menu", "width=500,height=400, 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=500,height=375, 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")

function orderpop(imagename) {
popwin = this.open(imagename, "order", "width=550,height=420, toolbar=no,menubar=no,location=no,scrollbars=no,resize=no,noresize");
popwin.focus();}
// href=javascript:orderpop("order/order_frameset.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 newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		NAV_1_home_over = newImage("images/NAV_1_home_over.jpg");
		NAV_2_info_over = newImage("images/NAV_2_info_over.jpg");
		NAV_3_menus_over = newImage("images/NAV_3_menus_over.jpg");
		NAV_4_reviews_over = newImage("images/NAV_4_reviews_over.jpg");
		NAV_5_photos_over = newImage("images/NAV_5_photos_over.jpg");
		NAV_6_contact_over = newImage("images/NAV_6_contact_over.jpg");
		NAV_7_events_over = newImage("images/NAV_7_events_over.jpg");
		NAV_8_job_over = newImage("images/NAV_8_job_over.jpg");
		NAV_9_reservations_over = newImage("images/NAV_9_reservations_over.jpg");
		NAV_10_privatefunc_over = newImage("images/NAV_10_privatefunc_over.jpg");
		NAV_11_gift_over = newImage("images/NAV_11_gift_over.jpg");
		NAV_12_mmerchandise_over = newImage("images/NAV_12_mmerchandise_over.jpg");
		preloadFlag = true;
	}
}

//-------------------------------------------------------------------------------------

//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.user_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.date1x.value == ""){
alert("Please specify a Day of your reservation from the calendar.");
theForm.date1x.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);}

//-------------------------------------------------------------------------------------

//CALENDER  SCRIPT - creates popup window

function writeSource(div) {
	if (!document.getElementById) { return; }
	var o = document.getElementById(div);
	if (typeof(o) == "undefined" || o==null) { return; }
	var s = o.innerHTML;
	if (s==null || s.length==0) { 
		return;
		}
	else {
		var i;
		for(i=0;s.charAt(i)==" "||s.charAt(i)=="\n"||s.charAt(i)=="\r"||s.charAt(i)=="\t";i++) {}
		s = s.substring(i);
		for (i = s.length; i>0; i--) {
			if (s.charAt(i)=="<") {
				s = s.substring(0,i) + "&lt;" + s.substring(i+1) ;
				}
			}
		for (i = s.length; i>0; i--) {
			if (s.charAt(i)==">") {
				s = s.substring(0,i) + "&gt;" + s.substring(i+1) ;
				}
			}
		for (i = s.length; i>0; i--) {
			if (s.charAt(i)=="\t") {
				s = s.substring(0,i) + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + s.substring(i+1) ;
				}
			}
		for (i = s.length; i>0; i--) {
			if (s.charAt(i)=="\n") {
				s = s.substring(0,i) + "<BR>" + s.substring(i+1) ;
				}
			}
		s = s + "<BR>";
		}
	document.write('<A STYLE="font-family:arial; font-size:x-small; text-decoration:none;" HREF="#" onClick="var d=document.getElementById(\'jssource'+div+'\').style; if(d.display==\'block\'){d.display=\'none\';this.innerText=\'+ Show Source\';}else{d.display=\'block\';this.innerText=\'- Hide Source\';} return false;">+ Show Source</A><BR>');
	document.write('<SPAN ID="jssource'+div+'" STYLE="display:none;background-color:#EEEEEE"><TT>'+s+'</TT></SPAN>');
	}