<!--
/*************************/
//Navig

function doOnLoad() {
	preload('/assets/images/presite_btn_home_a.gif');
	preload('/assets/images/presite_btn_menu_a.gif');
	preload('/assets/images/presite_btn_music_a.gif');
	preload('/assets/images/presite_btn_banquet_a.gif');
	preload('/assets/images/presite_btn_press_a.gif');
	preload('/assets/images/presite_btn_contact_a.gif');

	var page_to_image_map = new Array();
	page_to_image_map['index'] = 'home';
	page_to_image_map['menu'] = 'menu';
	page_to_image_map['music'] = 'music';
	page_to_image_map['banquets'] = 'banquets';
	page_to_image_map['press'] = 'press';
	page_to_image_map['contact'] = 'contact';

	var pagename;
	if(matches = document.location.href.match(/[\/]([^\/]*?)\.html$/)) {
		pagename = matches[1];
	} else pagename = 'index';

	if(!page_to_image_map[pagename]) pagename = 'index';
	pagename = page_to_image_map[pagename];

	document.images[pagename].onmouseover();
	document.images[pagename].onmouseout=do_void;
}

function do_void() {}

function preload(imghref) {
	if(!window.preload_images) window.preload_images = new Array();
	var i = window.preload_images.length;
	window.preload_images[i] = new Image();
	window.preload_images[i].src = imghref;
}

function rollover(that) {
	that.src = '/assets/images/presite_btn_'+that.name+'_a.gif';
}
function rollout(that) {
	that.src = '/assets/images/presite_btn_'+that.name+'.gif';
}

/*************************/
//erase input box content
var effaced=0;
function efface (elem) {
	if (effaced == 1){
		elem.value='';
	}
	effaced=effaced+1;
}

//Date
var time = new Date(), year;
year = time.getFullYear();

//Date
function makeArray() {
for (i = 0; i<makeArray.arguments.length; i++)
this[i + 1] = makeArray.arguments[i];
}

var months = new makeArray('January','February','March','April','May',
'June','July','August','September','October','November','December');
var date = new Date();
var day = date.getDate();
var month = date.getMonth() + 1;
var yy = date.getYear();
var year = (yy < 1000) ? yy + 1900 : yy;


//function to validate by length
function validlength(item, len) {
   return (item.length >= len);
}
//function to validate an email address
function validemail(item) {
   if (!validlength(item, 5)) return false;
   if (item.indexOf ('@', 0) == -1) return false;
   return true;
}
// display an error alert
function error(elem, text) {
// abort if we already found an error
   if (errfound) return;
   window.alert(text);
   elem.select();
   elem.focus();
   errfound = true;
}
function error2(elem, text) {
// abort if we already found an error
   if (errfound) return;
   window.alert(text);
   elem.focus();
   errfound = true;
}

// newsletter validation function
function validate_enewsletter() {
	errfound = false;
	if (!validemail(document.newsletter.email.value))
		error(document.newsletter.email,"Sorry, Invalid Email Address");
	return !errfound; /* true if there are no errors */
}
// contact validation function
function validate_contact() {
	errfound = false;
	if (
		   !validlength(document.contactform.review.value,1)
		&& !validlength(document.contactform.first_name.value,1)
		&& !validlength(document.contactform.last_name.value,1)
		&& !validlength(document.contactform.email.value,1)
		&& !validlength(document.contactform.address1.value,1)
		&& !validlength(document.contactform.address2.value,1)
		&& !validlength(document.contactform.city.value,1)
		&& !validlength(document.contactform.zip.value,1)
		&& !validlength(document.contactform.telephone.value,1)
		&& !validlength(document.contactform.fax.value,1)
		) {
		window.alert("Sorry, the form is empty!");
		errfound = true;
	}
	
	//if (!validlength(document.contactform.review.value,2))
	//	error(document.contactform.review,"Sorry, you did not provide any message");
	//if (!validlength(document.contactform.first_name.value,2))
	//	error(document.contactform.first_name,"Sorry, Invalid Fist Name");
	//if (!validlength(document.contactform.last_name.value,2))
	//	error(document.contactform.last_name,"Sorry, Invalid Last Name");
	//if (!validemail(document.contactform.email.value))
	//	error(document.contactform.email,"Sorry, Invalid Email Address");
	return !errfound; /* true if there are no errors */
}


// show / hide
var Open = ""
var Closed = ""

function showhide(id, what2) {
var what = document.getElementById ? document.getElementById(id) : 
document.all ? document.all(id) : null;
if (what) {
what.style.display = (what.style.display == 'none') ? '' : 'none';
}
}


