var alertstringnumadultsninos='Please select at least 1 person';
var alertstringdate='Please select your date';
var alertstringschedule='Please select your schedule';
var alertstringprogram='Please select a Program';
var nocorrectserv='Sorry, Google Promo does not apply to this program (only Dolphin Royal Swim, Dolphin Adventure and Dolphin Encounter ';
var nocorrectserv1='Sorry, Google Promo does not apply to this program (only ADM)';
var noappprommotion2='Sorry, Google Promo is only applicable to an even number of adult and children (2,4,6,8, etc)';
var noappprommotion3='Sorry, Google Promo is only applicable to a 3 multiple number of adult and children (3,6,9, etc)';



function validateform(thisform) {	

  //if (thisform.Q==null && thisform.QProgram=="") {
  // alert(alertstringprogram);
  // return false;
 //}
  if (thisform.NUMADULTS.value==0 && thisform.NUMJUNIORS.value==0) {
   alert(alertstringnumadultsninos);
   return false;
  }
   if (thisform.NUMADULTS.value=='0' && thisform.NUMJUNIORS.value=='0') {
   alert(alertstringnumadultsninos);
   return false;
  }
  if (thisform.NUMADULTS.value=='0' && thisform.NUMJUNIORS.value=='0') {
   alert(alertstringnumadultsninos);
   return false;
  }
    if (thisform.NUMADULTS.value==0 && thisform.NUMJUNIORS.value==0) {
   alert(alertstringnumadultsninos);
   return false;
  }
  if (thisform.NUMADULTS.value=='0') {
   alert('For this program you need to book at least 1 adult');
   return false;
  }
  if (parseInt(thisform.NUMADULTS.value,10)<parseInt(thisform.NUMJUNIORS.value,10) && thisform.ACTIVITY.value!='DOEN' && thisform.NAME.value!='DORO' && thisform.NAME.value!='SELI' && thisform.NAME.value!='SETI') {
	alert('Each child must come with a paying adult for this program');
	return false;
  }
  if (thisform.DATEP.value==null || thisform.DATEP.value=='') {
   alert(alertstringdate);
   return false;
  }
  if (thisform.SCHEDULE.value==null || thisform.SCHEDULE.value=='' || thisform.SCHEDULE.value=='-- select --') {
   alert(alertstringschedule);
   return false;
  }	
  
  //alert(thisform.COUPON.value.toUpperCase())
  
  
  
 if ((thisform.COUPON.value.toUpperCase()=='SLPGOOGLE001') || (thisform.COUPON.value.toUpperCase()=='SLPGOOGLE002')){
	 var numpax;
	 var modul;
	// alert("2")


	if ((thisform.ACTIVITY.value!=='DORO')&&(thisform.ACTIVITY.value!=='DOAD')&&(thisform.ACTIVITY.value!=='DOEN')) {
		alert(nocorrectserv);
		return false;
	}
	
	 numpax=parseInt(thisform.NUMADULTS.value,10)+parseInt(thisform.NUMJUNIORS.value,10);
	 modul=numpax%2;
	 //alert(modul)

	if (modul!==0) {
		alert(noappprommotion2);
		return false;
	}
	
	 
 }
 
 if  (thisform.COUPON.value.toUpperCase()=='SLPGOOGLE003'){
	 
	 if (thisform.ACTIVITY.value!=='GEAD'){
		alert(nocorrectserv1);
		return false;
	}
	 
	 numpax=parseInt(thisform.NUMADULTS.value,10)+parseInt(thisform.NUMJUNIORS.value,10);
	 modul=numpax%3;
	 if (modul!==0) {
		alert(noappprommotion3);
		return false;
	}

 }
 
  
  return true;
}
