function emptyvalidation(entered, alertbox)
{
with (entered)
{
if (value==null || value=="")
{if (alertbox!="") {alert(alertbox);} return false;}
else {return true;}
}
}


function nonevalidation(entered, alertbox)
{
with (entered)
{
if (value=="none")
{if (alertbox!="") {alert(alertbox);} return false;}
else {return true;}
}
}




function staffvalidation(form) {
	with (form) {
	if (emptyvalidation(sc_username,"Please enter your USERNAME")==false) {sc_username.focus(); return false;};
	if (emptyvalidation(sc_password,"Please enter your PASSWORD")==false) {sc_password.focus(); return false;};
	
this.form.submit();
}
}

function formvalidation(form) {
	with (form) {
	if (emptyvalidation(name,"Please Enter Your Name")==false) {name.focus(); return false;};
	if (emptyvalidation(email,"Please Enter An Email Address")==false) {email.focus(); return false;};
	if (emptyvalidation(comments,"Please Specify Your Comments")==false) {comments.focus(); return false;};
this.form.submit();
}
}

function go()
{
	box = document.forms[0].country;
	destination = box.options[box.selectedIndex].value;
	theurl = "misc.php?page_id=93&country="+destination;
	if (destination) location.href = theurl;
}
function go3()
{
	box = document.forms[0].country;
	destination = box.options[box.selectedIndex].value;
	theurl = "reservations.php?page_id=104&country="+destination;
	if (destination) location.href = theurl;
}

function goCC()
{
this.form.submit();
}


function validate_nums(string) {
    if (!string) return false;
    var nums = "0123456789";
    for (var n = 0; n < string.length; n++) {
       if (nums.indexOf(string.charAt(n)) == -1)
          return false;
    }
    return true;
}  
function validate_letters(string) {
    if (!string) return false;
    string=string.toUpperCase(); 
    var chars = "QWERTYUIOPASDFGHJKLZXCVBNM";
    for (var m = 0; m < string.length; m++) {
       if (chars.indexOf(string.charAt(m)) == -1)
          return false;
    }
    return true;
}






function formvalidation(form) {
	with (form) {
	if (emptyvalidation(keyword,"Please Enter a Search word")==false) {keyword.focus(); return false;};

this.form.submit();
}
}


function openSesame(theURL) {
		leftPos = (screen.width / 2) - 200;
	topPos = (screen.height / 2) - 150;
  window.open(theURL,'vid','width=400,height=300,left='+leftPos+',top='+topPos+',innerHeight=0,innerWidth=0,outerHeight=0,outerWidth=0,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0');
}
function openJoe()
{	
	leftPos = (screen.width / 2) - 200;
	topPos = (screen.height / 2) - 150;
	newwin = window.open('joe.php','joe','width=400,height=300,left='+leftPos+',top='+topPos+',innerHeight=0,innerWidth=0,outerHeight=0,outerWidth=0,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0');
}


function paylogin_validation(form) {
	with (form) {
	if (emptyvalidation(conf_num,"Please Enter Your Confirmation Number")==false) {conf_num.focus(); return false;};
	if (emptyvalidation(password,"Please Enter a Password")==false) {password.focus(); return false;};
	
this.form.submit();
}
}


function IsEmailValid(FormName,ElemName)
{
var EmailOk  = true
var Temp     = document.forms[FormName].elements[ElemName]
var AtSym    = Temp.value.indexOf('@')
var Period   = Temp.value.lastIndexOf('.')
var Space    = Temp.value.indexOf(' ')
var Length   = Temp.value.length - 1   

if ((AtSym < 1) ||                    
    (Period <= AtSym+1) ||            
    (Period == Length ) ||          
    (Space  != -1))                  
   {  
      EmailOk = false
      alert("Please enter a valid e-mail address!");
      Temp.value="";
      Temp.focus()
   }
return EmailOk
}


function waiverfname_response(){

document.form.f_name.value = "";
document.form.f_name.focus();
alert('Letters Only Please');

}
function waiverlname_response(){

document.form.l_name.value = "";
document.form.l_name.focus();
alert('Letters Only Please');
}

function appfname_response(){

document.form.fname.value = "";
document.form.fname.focus();
alert('Letters Only Without Spaces Please');

}
function applname_response(){

document.form.lname.value = "";
document.form.lname.focus();
alert('Letters Only Without Spaces Please');
}

function brofname_response(){

document.form.f_name.value = "";
document.form.f_name.focus();
alert('Letters Only Without Spaces Please');

}
function brolname_response(){

document.form.l_name.value = "";
document.form.l_name.focus();
alert('Letters Only Without Spaces Please');
}

function openPagePrint(page_id) {	
	leftPos = (screen.width / 2) - 360;
	topPos = (screen.height / 2) - 270;
	newwin = window.open('print_page.php?page_id='+page_id+'','PrintPage','width=720,height=540,left='+leftPos+',top='+topPos+',innerHeight=0,innerWidth=0,outerHeight=0,outerWidth=0,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=1,scrollbars=1,status=0,toolbar=1');
}
