var alertstringnumadultsninos='Please select at least one person';
var alertstringdate='Please select your date';
var alertstringschedule='Please select your schedule';

function validateform(thisform) {	
  
  if (thisform.touradults==null && thisform.tourchild==null) {
   alert(alertstringnumadultsninos);
   return false;
  }
   if (thisform.touradults.value=='' && thisform.tourchild.value=='') {
   alert(alertstringnumadultsninos);
   return false;
  }
  if (thisform.touradults.value==0 && thisform.tourchild.value==0) {
   alert(alertstringnumadultsninos);
   return false;
  }
  
  if (parseInt(thisform.touradults.value,10)<parseInt(thisform.tourchild.value,10) && (thisform.tourcode.value=='ROYS' || thisform.tourcode.value=='SADV' || thisform.tourcode.value=='JUTB' || thisform.tourcode.value=='SLDP' || thisform.tourcode.value=='SSLI' || thisform.tourcode.value=='DADV' || thisform.tourcode.value=='SDIS' || thisform.tourcode.value=='GDROYS' || thisform.tourcode.value=='GDSADV' || thisform.tourcode.value=='GRROYS' || thisform.tourcode.value=='GRSADV' || thisform.tourcode.value=='SADP' || thisform.tourcode.value=='ROYP')) {
   alert('Each child must come with a paying adult for this program');
   return false;
  }
  
  if (parseInt(thisform.touradults.value,10)<parseInt(thisform.tourchild.value,10) && (thisform.tourcode.value=='DISS' || thisform.tourcode.value=='ENCO') && thisform.numcupon.value=='DISNEYCZ09') {
   alert('Each child must come with a paying adult with this promotion');
   return false;
  }
  
  if (((parseInt(thisform.touradults.value,10)+parseInt(thisform.tourchild.value,10))<3) && (thisform.tourcode.value=='ROYP' || thisform.tourcode.value=='SADP')) {
   alert('The minimum number of participants for this tour is 3');
   return false;
  }
  
  if (thisform.tourdate==null || thisform.tourdate.value=='') {
   alert(alertstringdate);
   return false;
  }
  
  
  
  if (thisform.toursched==null || thisform.toursched.value=='' || thisform.toursched.value=='-- select --') {
   alert(alertstringschedule);
   return false;
  }	
  return true;
}

function validateformaddon(thisform) {	
  
  if (thisform.addonclave==null && thisform.addonclave==null) {
   alert('Error booking in add-on code');
   return false;
  }
   if (thisform.addonadults.value=='' && thisform.addonchilds.value=='') {
   alert(alertstringnumadultsninos);
   return false;
  }
  if (thisform.addonadults.value==0 && thisform.addonchilds.value==0) {
   alert(alertstringnumadultsninos);
   return false;
  }
  
  return true;
}
