//setToday();
function rowColor()
{
	var colorVal = false;
	var curr_row;
	var oTable = document.all("posTable");
	for (curr_row = 0; curr_row < oTable.length; curr_row++) {
	if (curr_row % 2!=0) {
		oTable(curr_row).style.backgroundColor = ((colorVal=!colorVal)?"beige":"beige");
		}
	}
	}
function isEmail(Email) {
   invalidChars = " /:,;"

      if (Email == "") {
     return false;
   }
    for (i=0; i<invalidChars.length; i++) {
     badChar = invalidChars.charAt(i)

   if (Email.indexOf(badChar,0) > -1) {
    return false;
 }
}
 atPos = Email.indexOf("@",1)
  if (atPos == -1) {
   return false;
 }
  if (Email.indexOf("@",atPos+1) > -1) {
    return false;
}
  
 periodPos = Email.indexOf(".",atPos)
  if (periodPos == -1) {
   return false;
 }
  if (periodPos+3 > Email.length) {
   return false;
 }
   return true;
}
//
function isProper(string) {

   if (!string) return false;
   var iChars = "*|,\"<:>[]{}`\';()@&$#%";

   for (var i = 0; i < string.length; i++) {
      if (iChars.indexOf(string.charAt(i)) != -1)
         return false;
   }
   return true;
}                      
function isReady(resform) {
    if (isEmail(resform.Email.value) == false) {
        alert("Please enter a valid email address.");
        resform.Email.focus();
        return false;
    }
	 if (isProper(resform.Region.value) == "") {
        alert("Please enter a charter region.");
        resform.Region.focus();
        return false;
    }
	
    if (isProper(resform.Firstname.value) == false) {
        alert("Please enter a valid firstname.");
        resform.Firstname.focus();
        return false;
    }
    if (isProper(resform.Lastname.value) == false) {
        alert("Please enter a valid lastname.");
        resform.Lastname.focus();
        return false;
    }
	document.resform.action="/includes/sendReservationGlb.asp";
	return true;
}

function chooseRadio(form) {
	form.checked = true;
}

//function formHandler(){
//var URL = document.form.site.options[document.form.site.selectedIndex].value;
//window.location.href = URL;
//}

function changeImage(theSlot,theSrc){
var theString="document."+theSlot+".src="+theSrc+".src";
eval(theString);
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
// rollover script
ns4=(document.layers)?true:false;
ns6=(document.getElementById)?true:false;
ie5=(document.all)?true:false;

function toggle(myString){
	for(i=0;i<helpArray.length;i++){
		if(helpArray[i]==myString){
			//location.href="/SailGreece/default.asp#he";
			showIt(helpArray[i]);
			}else{
			hideIt(helpArray[i]);
		}
	}
}

function layerRef(theString){
	if(ns6){
		block=eval('document.getElementById.'+theString);
	}
	if(ie5){
		block=eval('document.all.'+theString+'.style');
	}
	if(ns4) {
	block=eval('document.'+theString);
	}
	return block;
}
function showIt(theString) {
if(ns6||ie5) {
	
	document.getElementById(theString).style.visibility = "visible";
	
}
if(ns4) {
layerRef(theString).visibility = "show";
}
}
function hideIt(theString) {
if(ns6||ie5) {
	document.getElementById(theString).style.visibility = "hidden";
}
if(ns4){
layerRef(theString).visibility = "hide";
}
}

var zValue=2;
function changeZ(myString){
zValue++;
layerRef(myString).zIndex=zValue;
}

function bookmarksite(title,url){
if (window.sidebar) // firefox
window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
var elem = document.createElement('a');
elem.setAttribute('href',url);
elem.setAttribute('title',title);
elem.setAttribute('rel','sidebar');
elem.click();
}
else if(document.all)// ie
window.external.AddFavorite(url, title);
}

