// FLASS OBJECTS
	function writeFlash(flashVar) {
		document.write(flashVar);
	}
	//uncomment the line below to make this function active
	//writeFlash(flash);
	// use  the funtion below for pages that require more then one flash object. Repeat and rename as needed
	function FLASHfunctionNAME(){
		document.write('pasteFLASHhere');
	}
// FLASS OBJECTS - END





//HIDE EMAIL SCRIPT
	function hideEmail(){
		 path = 'mailto:info@do'
		 path += 'main.'
		 path += 'com'
		 location.href = path;
	}

//  href="#" onclick="hideEmail();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=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.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>');
	}



//FLASH  100% sites

var mh = 570; // Min-Height of Flash Window
var mw = 760; // Min-Width of Flash Window
function checksize(){
//	alert('RESIZE');
	if(document.body.clientHeight > mh){
		document.getElementById("mainflash").style.height = "100%";
	} else {
		document.getElementById("mainflash").style.height = mh + "px";
	}

	if(document.body.clientWidth > mw){
		document.getElementById("mainflash").style.width = "100%";
	} else {
		document.getElementById("mainflash").style.width = mw + "px";
	}
}
window.onresize = checksize;
window.onload = checksize;