
function showstuff(boxid){
   document.getElementById(boxid).style.display="block";
}

function hidestuff(boxid){
     document.getElementById(boxid).style.display="none";
}


/*
function alternate(id){
 if(document.getElementsByTagName){  
   var table = document.getElementById(id);  
   var rows = table.getElementsByTagName("tr");  
   for(i = 0; i < rows.length; i++){          
 //manipulate rows
     if(i % 2 == 0){
       rows[i].className = "even";
     }else{
       rows[i].className = "odd";
     }      
   }
 }
}
*/

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);
}

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;
    }
	
	 if (isProper(resform.startdate.value) == false) {
        alert("Please enter a starting date.");
        resform.startdate.focus();
        return false;
    }
	
	if (isProper(resform.enddate.value) == false) {
        alert("Please enter an ending date.");
        resform.enddate.focus();
        return false;
    }
	
	document.resform.action="/includes/sendReservationGlb.asp";
	return true;
}


function alternate(id){
 if(document.getElementsByTagName){  
   var table = document.getElementById(id);  
   var rows = table.getElementsByTagName("tr");  
   for(i = 0; i < rows.length; i++){          
 //manipulate rows
     if(i % 2 == 0){
       rows[i].className = "even";
     }else{
       rows[i].className = "odd";
     }      
   }
 }
}



function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
