var timeout;

function disablesubmit() {
	
resform.disabled = true; 
	
}

function enablesubmit() {
	
resform.disabled = false;
	
}

function openInfoDialog() {
  Dialog.info("<center><br>" + waitingmsg + "<br>5s ...</center>",
               {width:250, height:100, showProgress: true});
  timeout=5;
  setTimeout(infoTimeout, 1000)
}

function infoTimeout() {
  timeout--;
  if (timeout >0) {
    Dialog.setInfoMessage("<center><br>" + waitingmsg + "<br>" + timeout + "s ...</center>")
    setTimeout(infoTimeout, 1000)
 }
 else
  Dialog.closeInfo()
}

function openUpdateUser() {
  Dialog.info("<center><br>" + waitingmsg + "</center>",
               {width:250, height:100, showProgress: true});
  timeout=2;
  setTimeout(UpdateTimeout, 1000)
}

function UpdateTimeout() {
  timeout--;
  if (timeout >0) {
    Dialog.setInfoMessage("<center><br>" + waitingmsg + "</center>")
    setTimeout(UpdateTimeout, 1000)
 }
 else
  Dialog.closeInfo()
}

function openAlert() {
  Dialog.info("<center><br>" + alertmsg + "</center>",
               {width:250, height:100, showProgress: true});
  timeout=2;
  setTimeout(alertTimeout, 1000)
}

function alertTimeout() {
  timeout--;
  if (timeout >0) {
    Dialog.setInfoMessage("<center><br>" + alertmsg + "</center>")
    setTimeout(alertTimeout, 1000)
 }
 else
  Dialog.closeInfo()
}

function openAlertSend() {
  Dialog.info("<center><br>" + alertmsgsend + "</center>",
               {width:250, height:100, showProgress: true});
  timeout=1;
  setTimeout(alertTimeoutSend, 1000)
}

function alertTimeoutSend() {
  timeout--;
  if (timeout >0) {
    Dialog.setInfoMessage("<center><br>" + alertmsgsend + "</center>")
    setTimeout(alertTimeoutSend, 1000)
 }
 else
  Dialog.closeInfo()
}


function showtours1()
{
$('tours1_show').className = 'show displayshow-block';
}

function showtours2()
{
$('tours2_show').className = 'show displayshow-block';
}

function showtours3()
{
$('tours3_show').className = 'show displayshow-block';
}

function showtours4()
{
$('tours4_show').className = 'show displayshow-block';
}

function showextras1()
{
$('extras1_show').className = 'show displayshow-block';
}

function showextras2()
{
$('extras2_show').className = 'show displayshow-block';
}

function showextras3()
{
$('extras3_show').className = 'show displayshow-block';
}

function showextras4()
{
$('extras4_show').className = 'show displayshow-block';
}


function validate_book_unit()
{
	
	var formok = false;
	
	if($F('startdate') == '')
	{
		$('startdate').focus();
		$('startdate_validator').className = 'validator display-block';
		return false;
	}
	if($F('enddate') == '')
	{
		$('enddate').focus();
		$('enddate_validator').className = 'validator display-block';
		return false;
	}
	
	if (have_tours == true) { 
	
	if($F('tid0') != '' && $F('tstartdate0') == '') 
	{
		$('tstartdate0').focus();
		$('tstartdate0_validator').className = 'validator display-block';
	    return false;
	}
	if($F('tid1') != '' && $F('tstartdate1') == '') 
	{
		$('tstartdate1').focus();
		$('tstartdate1_validator').className = 'validator display-block';
	    return false;
	}
	if($F('tid2') != '' && $F('tstartdate2') == '') 
	{
		$('tstartdate2').focus();
		$('tstartdate2_validator').className = 'validator display-block';
	    return false;
	}
	if($F('tid3') != '' && $F('tstartdate3') == '') 
	{
		$('tstartdate3').focus();
		$('tstartdate3_validator').className = 'validator display-block';
	    return false;
	}
	if($F('tid4') != '' && $F('tstartdate4') == '') 
	{
		$('tstartdate4').focus();
		$('tstartdate4_validator').className = 'validator display-block';
	    return false;
	}
	
	}
	
	if (have_extras == true) { 
	
	if($F('eid0') != '' && $F('estartdate0') == '') 
	{
		$('estartdate0').focus();
		$('estartdate0_validator').className = 'validator display-block';
	    return false;
	}
	if($F('eid1') != '' && $F('estartdate1') == '') 
	{
		$('estartdate1').focus();
		$('estartdate1_validator').className = 'validator display-block';
	    return false;
	}
	if($F('eid2') != '' && $F('estartdate2') == '') 
	{
		$('estartdate2').focus();
		$('estartdate2_validator').className = 'validator display-block';
	    return false;
	}
	if($F('eid3') != '' && $F('estartdate3') == '') 
	{
		$('estartdate3').focus();
		$('estartdate3_validator').className = 'validator display-block';
	    return false;
	}
	if($F('eid4') != '' && $F('estartdate4') == '') 
	{
		$('estartdate4').focus();
		$('estartdate4_validator').className = 'validator display-block';
	    return false;
	}
   
	}
	
	var formok = true;
	
	if (formok == true) {
		
	  openAlertSend();	
	  enablesubmit();
	  return true;	
	 	
	} else {
		
	return false;
			
	}	
}

function validate_book_customer()
{
	
	if (have_units == true) {
	
	if($F('uid') != '' && $F('startdate') == '')
	{
		$('startdate').focus();
		$('startdate_validator').className = 'validator display-block';
		return false;
	}
	if($F('uid') != '' && $F('enddate') == '')
	{
		$('enddate').focus();
		$('enddate_validator').className = 'validator display-block';
		return false;
	}
	
	}
	
	if (have_tours == true) { 
	
	if($F('tid0') != '' && $F('tstartdate0') == '') 
	{
		$('tstartdate0').focus();
		$('tstartdate0_validator').className = 'validator display-block';
	    return false;
	}
	if($F('tid1') != '' && $F('tstartdate1') == '') 
	{
		$('tstartdate1').focus();
		$('tstartdate1_validator').className = 'validator display-block';
	    return false;
	}
	if($F('tid2') != '' && $F('tstartdate2') == '') 
	{
		$('tstartdate2').focus();
		$('tstartdate2_validator').className = 'validator display-block';
	    return false;
	}
	if($F('tid3') != '' && $F('tstartdate3') == '') 
	{
		$('tstartdate3').focus();
		$('tstartdate3_validator').className = 'validator display-block';
	    return false;
	}
	if($F('tid4') != '' && $F('tstartdate4') == '') 
	{
		$('tstartdate4').focus();
		$('tstartdate4_validator').className = 'validator display-block';
	    return false;
	}
	
	}
	
	if (have_extras == true) { 
	
	if($F('eid0') != '' && $F('estartdate0') == '') 
	{
		$('estartdate0').focus();
		$('estartdate0_validator').className = 'validator display-block';
	    return false;
	}
	if($F('eid1') != '' && $F('estartdate1') == '') 
	{
		$('estartdate1').focus();
		$('estartdate1_validator').className = 'validator display-block';
	    return false;
	}
	if($F('eid2') != '' && $F('estartdate2') == '') 
	{
		$('estartdate2').focus();
		$('estartdate2_validator').className = 'validator display-block';
	    return false;
	}
	if($F('eid3') != '' && $F('estartdate3') == '') 
	{
		$('estartdate3').focus();
		$('estartdate3_validator').className = 'validator display-block';
	    return false;
	}
	if($F('eid4') != '' && $F('estartdate4') == '') 
	{
		$('estartdate4').focus();
		$('estartdate4_validator').className = 'validator display-block';
	    return false;
	}
	
	}
	
	// Tours/Extras  
	if (have_units == false && have_tours == true && have_extras == true) {
		
	if($F('tid0') == '' && $F('eid0') == '')
	{
		openAlert();
		return false;
	}
	else
	{
	openAlertSend();	
	enablesubmit();	
	return true;
	}     
	
	}
	
	// Lodgings/Tours
	if (have_units == true && have_tours == true && have_extras == false) {
		
	if($F('uid') == '' && $F('tid0') == '')
	{
		openAlert();
		return false;
	}
	else
	{
	openAlertSend();	
	enablesubmit();	
	return true;
	}     
	
	}
	
	// Tours
	if (have_units == false && have_tours == true && have_extras == false) {
		
	if($F('tid0') == '')
	{
		openAlert();
		return false;
	}
	else
	{
	openAlertSend();	
	enablesubmit();	
	return true;
	}     
	
	}
	
	// Extras
	if (have_units == false && have_tours == false && have_extras == true) {
		
	if($F('eid0') == '')
	{
		openAlert();
		return false;
	}
	else
	{
	openAlertSend();	
	enablesubmit();	
	return true;
	}     
	
	}
	
	// Lodgings/Tours/Extras
	if (have_units == true && have_tours == true && have_extras == true) {
		
	if($F('uid') == '' && $F('tid0') == '' && $F('eid0') == '')
	{
		openAlert();
		return false;
	}
	else
	{
	openAlertSend();	
	enablesubmit();	
	return true;
	  }     
	
	}
	
	// Lodgings
	if (have_units == true && have_tours == false && have_extras == false) {
		
	if($F('uid') == '')
	{
		openAlert();
		return false;
	}
	else
	{
	openAlertSend();	
	enablesubmit();	
	return true;
	  }     
	
	}
	
	// Lodgings/Extras
	if (have_units == true && have_tours == false && have_extras == true) {
		
	if($F('uid') == '' && $F('eid0') == '')
	{
		openAlert();
		return false;
	}
	else
	{
	openAlertSend();	
	enablesubmit();	
	return true;
	  }     
	
	}
	
	// All Empty
	if (have_units == false && have_tours == false && have_extras == false) {
	
		openAlert();
		return false;
		
	}
	
}



function validate_book_promo()
{
	if($F('pstartdate') == '')
	{
		$('pstartdate').focus();
		$('pstartdate_validator').className = 'validator display-block';
		return false;
	}
	else
	{
	openAlertSend();	
	enablesubmit();		
	return true;		
	}	
}

function validate_userinfo_unit()
{	
	if($F('startdate') == '')
	{
		$('startdate').focus();
		$('startdate_validator').className = 'validator display-block';
		return false;
	}
	if($F('enddate') == '')
	{
		$('enddate').focus();
		$('enddate_validator').className = 'validator display-block';
		return false;
	}
	
	if (have_tours == true) { 
	
	if($F('tid0') != '' && $F('tstartdate0') == '') 
	{
		$('tstartdate0').focus();
		$('tstartdate0_validator').className = 'validator display-block';
	    return false;
	}
	if($F('tid1') != '' && $F('tstartdate1') == '') 
	{
		$('tstartdate1').focus();
		$('tstartdate1_validator').className = 'validator display-block';
	    return false;
	}
	if($F('tid2') != '' && $F('tstartdate2') == '') 
	{
		$('tstartdate2').focus();
		$('tstartdate2_validator').className = 'validator display-block';
	    return false;
	}
	if($F('tid3') != '' && $F('tstartdate3') == '') 
	{
		$('tstartdate3').focus();
		$('tstartdate3_validator').className = 'validator display-block';
	    return false;
	}
	if($F('tid4') != '' && $F('tstartdate4') == '') 
	{
		$('tstartdate4').focus();
		$('tstartdate4_validator').className = 'validator display-block';
	    return false;
	}
	
	}
	
	if (have_extras == true) { 
	
	if($F('eid0') != '' && $F('estartdate0') == '') 
	{
		$('estartdate0').focus();
		$('estartdate0_validator').className = 'validator display-block';
	    return false;
	}
	if($F('eid1') != '' && $F('estartdate1') == '') 
	{
		$('estartdate1').focus();
		$('estartdate1_validator').className = 'validator display-block';
	    return false;
	}
	if($F('eid2') != '' && $F('estartdate2') == '') 
	{
		$('estartdate2').focus();
		$('estartdate2_validator').className = 'validator display-block';
	    return false;
	}
	if($F('eid3') != '' && $F('estartdate3') == '') 
	{
		$('estartdate3').focus();
		$('estartdate3_validator').className = 'validator display-block';
	    return false;
	}
	if($F('eid4') != '' && $F('estartdate4') == '') 
	{
		$('estartdate4').focus();
		$('estartdate4_validator').className = 'validator display-block';
	    return false;
	}
	
	}
	  
	
	if($F('firstname') == '')
	{
		$('firstname').focus();
		$('firstname_validator').className = 'validator display-block';
		return false;
	}
	if($F('surname') == '')
	{
		$('surname').focus();
		$('surname_validator').className = 'validator display-block';
		return false;
	}
	if($F('address1') == '')
	{
		$('address1').focus();
		$('address1_validator').className = 'validator display-block';
		return false;
	}
	if($F('postcode') == '')
	{
		$('postcode').focus();
		$('postcode_validator').className = 'validator display-block';
		return false;
	}
	if($F('city') == '')
	{
		$('city').focus();
		$('city_validator').className = 'validator display-block';
		return false;
	}
	if($F('country') == '')
	{
		$('country').focus();
		$('country_validator').className = 'validator display-block';
		return false;
	}	
	if ($F('email') == '')
	{
		$('email').focus();
		$('email_validator').className = 'validator display-block';
		return false;
	}
	if (echeck($F('email')) == false)
	{
		$('email').focus();
		$('email2_validator').className = 'validator display-block';
		return false;
	}
	if($F('telephone') == '')
	{
		$('telephone').focus();
		$('telephone_validator').className = 'validator display-block';
		return false;
	}
	if(isNaN($F('telephone')))
	{
		$('telephone').focus();
		$('telephone2_validator').className = 'validator display-block';
		return false;
	}
	if($F('vatid') == '')
	{
		$('vatid').focus();
		$('vatid_validator').className = 'validator display-block';
		return false;
	}
	if($F('password') == '')
	{
		$('password').focus();
		$('password_validator').className = 'validator display-block';
		return false;
	}
	if($F('password_confirm') == '')
	{
		$('password_confirm').focus();
		$('password_confirm_validator').className = 'validator display-block';
		return false;
	}
	if($F('password') != $F('password_confirm'))
	{
		$('password').focus();
		$('password2_validator').className = 'validator display-block';
		return false;
	}
	if(!$('Agree').checked)
	{
		$('Agree').focus();
		$('Agree_validator').className = 'validator display-block';
		return false;
	}
	else
	{
	openAlertSend();	
	enablesubmit();	
	return true;	
	}     
}


function validate_userinfo_customer()
{
	if (have_units == true) {
	
	if($F('uid') != '' && $F('startdate') == '')
	{
		$('startdate').focus();
		$('startdate_validator').className = 'validator display-block';
		return false;
	}
	if($F('uid') != '' && $F('enddate') == '')
	{
		$('enddate').focus();
		$('enddate_validator').className = 'validator display-block';
		return false;
	}
	
	}
	
	if (have_tours == true) {
	
	if($F('tid0') != '' && $F('tstartdate0') == '') 
	{
		$('tstartdate0').focus();
		$('tstartdate0_validator').className = 'validator display-block';
	    return false;
	}
	if($F('tid1') != '' && $F('tstartdate1') == '') 
	{
		$('tstartdate1').focus();
		$('tstartdate1_validator').className = 'validator display-block';
	    return false;
	}
	if($F('tid2') != '' && $F('tstartdate2') == '') 
	{
		$('tstartdate2').focus();
		$('tstartdate2_validator').className = 'validator display-block';
	    return false;
	}
	if($F('tid3') != '' && $F('tstartdate3') == '') 
	{
		$('tstartdate3').focus();
		$('tstartdate3_validator').className = 'validator display-block';
	    return false;
	}
	if($F('tid4') != '' && $F('tstartdate4') == '') 
	{
		$('tstartdate4').focus();
		$('tstartdate4_validator').className = 'validator display-block';
	    return false;
	}
	
    }
	
	if (have_extras == true) {
	
	
	if($F('eid0') != '' && $F('estartdate0') == '') 
	{
		$('estartdate0').focus();
		$('estartdate0_validator').className = 'validator display-block';
	    return false;
	}
	if($F('eid1') != '' && $F('estartdate1') == '') 
	{
		$('estartdate1').focus();
		$('estartdate1_validator').className = 'validator display-block';
	    return false;
	}
	if($F('eid2') != '' && $F('estartdate2') == '') 
	{
		$('estartdate2').focus();
		$('estartdate2_validator').className = 'validator display-block';
	    return false;
	}
	if($F('eid3') != '' && $F('estartdate3') == '') 
	{
		$('estartdate3').focus();
		$('estartdate3_validator').className = 'validator display-block';
	    return false;
	}
	if($F('eid4') != '' && $F('estartdate4') == '') 
	{
		$('estartdate4').focus();
		$('estartdate4_validator').className = 'validator display-block';
	    return false;
	}
	
	}
 	
	
	if($F('firstname') == '')
	{
		$('firstname').focus();
		$('firstname_validator').className = 'validator display-block';
		return false;
	}
	if($F('surname') == '')
	{
		$('surname').focus();
		$('surname_validator').className = 'validator display-block';
		return false;
	}
	if($F('address1') == '')
	{
		$('address1').focus();
		$('address1_validator').className = 'validator display-block';
		return false;
	}
	if($F('postcode') == '')
	{
		$('postcode').focus();
		$('postcode_validator').className = 'validator display-block';
		return false;
	}
	if($F('city') == '')
	{
		$('city').focus();
		$('city_validator').className = 'validator display-block';
		return false;
	}
	if($F('country') == '')
	{
		$('country').focus();
		$('country_validator').className = 'validator display-block';
		return false;
	}	
	if ($F('email') == '')
	{
		$('email').focus();
		$('email_validator').className = 'validator display-block';
		return false;
	}
	if (echeck($F('email')) == false)
	{
		$('email').focus();
		$('email2_validator').className = 'validator display-block';
		return false;
	}
	if($F('telephone') == '')
	{
		$('telephone').focus();
		$('telephone_validator').className = 'validator display-block';
		return false;
	}
	if(isNaN($F('telephone')))
	{
		$('telephone').focus();
		$('telephone2_validator').className = 'validator display-block';
		return false;
	}
	if($F('vatid') == '')
	{
		$('vatid').focus();
		$('vatid_validator').className = 'validator display-block';
		return false;
	}
	if($F('password') == '')
	{
		$('password').focus();
		$('password_validator').className = 'validator display-block';
		return false;
	}
	if($F('password_confirm') == '')
	{
		$('password_confirm').focus();
		$('password_confirm_validator').className = 'validator display-block';
		return false;
	}
	if($F('password') != $F('password_confirm'))
	{
		$('password').focus();
		$('password2_validator').className = 'validator display-block';
		return false;
	}
	if(!$('Agree').checked)
	{
		$('Agree').focus();
		$('Agree_validator').className = 'validator display-block';
		return false;
	}
	
	// Tours/Extras  
	if (have_units == false && have_tours == true && have_extras == true) {
		
	if($F('tid0') == '' && $F('eid0') == '')
	{
		openAlert();
		return false;
	}
	else
	{
	openAlertSend();	
	enablesubmit();	
	return true;
	}     
	
	}
	
	// Lodgings/Tours
	if (have_units == true && have_tours == true && have_extras == false) {
		
	if($F('uid') == '' && $F('tid0') == '')
	{
		openAlert();
		return false;
	}
	else
	{
	openAlertSend();	
	enablesubmit();	
	return true;
	}     
	
	}
	
	// Tours
	if (have_units == false && have_tours == true && have_extras == false) {
		
	if($F('tid0') == '')
	{
		openAlert();
		return false;
	}
	else
	{
	openAlertSend();	
	enablesubmit();	
	return true;
	}     
	
	}
	
	// Extras
	if (have_units == false && have_tours == false && have_extras == true) {
		
	if($F('eid0') == '')
	{
		openAlert();
		return false;
	}
	else
	{
	openAlertSend();	
	enablesubmit();	
	return true;
	}     
	
	}
	
	// Lodgings/Tours/Extras
	if (have_units == true && have_tours == true && have_extras == true) {
		
	if($F('uid') == '' && $F('tid0') == '' && $F('eid0') == '')
	{
		openAlert();
		return false;
	}
	else
	{
	openAlertSend();	
	enablesubmit();	
	return true;
	  }     
	
	}
	
	// Lodgings
	if (have_units == true && have_tours == false && have_extras == false) {
		
	if($F('uid') == '')
	{
		openAlert();
		return false;
	}
	else
	{
	openAlertSend();	
	enablesubmit();	
	return true;
	  }     
	
	}
	
	// Lodgings/Extras
	if (have_units == true && have_tours == false && have_extras == true) {
		
	if($F('uid') == '' && $F('eid0') == '')
	{
		openAlert();
		return false;
	}
	else
	{
	openAlertSend();	
	enablesubmit();	
	return true;
	  }     
	
	}
	
	// All Empty
	if (have_units == false && have_tours == false && have_extras == false) {
	
		openAlert();
		return false;
		
	}
	
}


function validate_userinfo_promo()
{	
	if($F('pstartdate') == '')
	{
		$('pstartdate').focus();
		$('pstartdate_validator').className = 'validator display-block';
		return false;
	}
	if($F('firstname') == '')
	{
		$('firstname').focus();
		$('firstname_validator').className = 'validator display-block';
		return false;
	}
	if($F('surname') == '')
	{
		$('surname').focus();
		$('surname_validator').className = 'validator display-block';
		return false;
	}
	if($F('address1') == '')
	{
		$('address1').focus();
		$('address1_validator').className = 'validator display-block';
		return false;
	}
	if($F('postcode') == '')
	{
		$('postcode').focus();
		$('postcode_validator').className = 'validator display-block';
		return false;
	}
	if($F('city') == '')
	{
		$('city').focus();
		$('city_validator').className = 'validator display-block';
		return false;
	}
	if($F('country') == '')
	{
		$('country').focus();
		$('country_validator').className = 'validator display-block';
		return false;
	}	
	if ($F('email') == '')
	{
		$('email').focus();
		$('email_validator').className = 'validator display-block';
		return false;
	}
	if (echeck($F('email')) == false)
	{
		$('email').focus();
		$('email2_validator').className = 'validator display-block';
		return false;
	}
	if($F('telephone') == '')
	{
		$('telephone').focus();
		$('telephone_validator').className = 'validator display-block';
		return false;
	}
	if(isNaN($F('telephone')))
	{
		$('telephone').focus();
		$('telephone2_validator').className = 'validator display-block';
		return false;
	}
	if($F('vatid') == '')
	{
		$('vatid').focus();
		$('vatid_validator').className = 'validator display-block';
		return false;
	}
	if($F('password') == '')
	{
		$('password').focus();
		$('password_validator').className = 'validator display-block';
		return false;
	}
	if($F('password_confirm') == '')
	{
		$('password_confirm').focus();
		$('password_confirm_validator').className = 'validator display-block';
		return false;
	}
	if($F('password') != $F('password_confirm'))
	{
		$('password').focus();
		$('password2_validator').className = 'validator display-block';
		return false;
	}
	if(!$('Agree').checked)
	{
		$('Agree').focus();
		$('Agree_validator').className = 'validator display-block';
		return false;
	}
	else
	{
	openAlertSend();	
	enablesubmit();	
	return true;	
	}     
}

function validate_userinfo()
{	
	if($F('firstname') == '')
	{
		$('firstname').focus();
		$('firstname_validator').className = 'validator display-block';
		return false;
	}
	if($F('surname') == '')
	{
		$('surname').focus();
		$('surname_validator').className = 'validator display-block';
		return false;
	}
	if($F('address1') == '')
	{
		$('address1').focus();
		$('address1_validator').className = 'validator display-block';
		return false;
	}
	if($F('postcode') == '')
	{
		$('postcode').focus();
		$('postcode_validator').className = 'validator display-block';
		return false;
	}
	if($F('city') == '')
	{
		$('city').focus();
		$('city_validator').className = 'validator display-block';
		return false;
	}
	if($F('country') == '')
	{
		$('country').focus();
		$('country_validator').className = 'validator display-block';
		return false;
	}	
	if ($F('email') == '')
	{
		$('email').focus();
		$('email_validator').className = 'validator display-block';
		return false;
	}
	if (echeck($F('email')) == false)
	{
		$('email').focus();
		$('email2_validator').className = 'validator display-block';
		return false;
	}
	if($F('telephone') == '')
	{
		$('telephone').focus();
		$('telephone_validator').className = 'validator display-block';
		return false;
	}
	if(isNaN($F('telephone')))
	{
		$('telephone').focus();
		$('telephone2_validator').className = 'validator display-block';
		return false;
	}
	if($F('vatid') == '')
	{
		$('vatid').focus();
		$('vatid_validator').className = 'validator display-block';
		return false;
	}
	if($F('password') != '' && $F('password_confirm') == '')
	{
		$('password_confirm').focus();
		$('password_confirm_validator').className = 'validator display-block';
		return false;
	}
	if($F('password_confirm') != '' && $F('password') == '')
	{
		$('password').focus();
		$('password_validator').className = 'validator display-block';
		return false;
	}
	if($F('password') != $F('password_confirm'))
	{
		$('password').focus();
		$('password2_validator').className = 'validator display-block';
		return false;
	}
	else
	{
	openUpdateUser();	
	return true;	
	}     
}

function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    return false
		 }

 		 return true					
	}

function hideWarning(ValidatorId)
{
	$(ValidatorId).className = 'validator display-none';
}

function hideOptions(ShowID)
{
	$(ShowID).className = 'show displayshow-none';
}

function resetForm_userinfo_unit()
{
	if (have_units == true) {
	
	hideWarning('startdate_validator');
	hideWarning('enddate_validator');
	
	}
	
	if (have_tours == true) {

	hideWarning('tstartdate0_validator');
	hideWarning('tstartdate1_validator');
	hideWarning('tstartdate2_validator');
	hideWarning('tstartdate3_validator');
	hideWarning('tstartdate4_validator');
	
	}
	
	if (have_extras == true) {
		
	hideWarning('estartdate0_validator');
	hideWarning('estartdate1_validator');
	hideWarning('estartdate2_validator');
	hideWarning('estartdate3_validator');
	hideWarning('estartdate4_validator');
	
	}
	
	hideWarning('firstname_validator');
	hideWarning('surname_validator');
	hideWarning('address1_validator');
	hideWarning('postcode_validator');
	hideWarning('city_validator');
	hideWarning('country_validator');
	hideWarning('email_validator');
	hideWarning('email2_validator');
	hideWarning('telephone_validator');
	hideWarning('telephone2_validator');
	hideWarning('vatid_validator');
	hideWarning('password_validator');
	hideWarning('password2_validator');
	hideWarning('password_confirm_validator');
	hideWarning('Agree_validator');
	
	if (have_tours == true) {

	hideOptions('tours1_show');
	hideOptions('tours2_show');
	hideOptions('tours3_show');
	hideOptions('tours4_show');
	
	}
	
	if (have_extras == true) {
	
	hideOptions('extras1_show');
	hideOptions('extras2_show');
	hideOptions('extras3_show');
	hideOptions('extras4_show');

	}
	
}

function resetForm_userinfo_customer()
{
	
	if (have_units == true) {
	
	hideWarning('startdate_validator');
	hideWarning('enddate_validator');
	
	}
	
	if (have_tours == true) {
	
	hideWarning('tstartdate0_validator');
	hideWarning('tstartdate1_validator');
	hideWarning('tstartdate2_validator');
	hideWarning('tstartdate3_validator');
	hideWarning('tstartdate4_validator');
	
	}
	
	if (have_extras == true) {
		
	hideWarning('estartdate0_validator');
	hideWarning('estartdate1_validator');
	hideWarning('estartdate2_validator');
	hideWarning('estartdate3_validator');
	hideWarning('estartdate4_validator');
	
	}
	
	hideWarning('firstname_validator');
	hideWarning('surname_validator');
	hideWarning('address1_validator');
	hideWarning('postcode_validator');
	hideWarning('city_validator');
	hideWarning('country_validator');
	hideWarning('email_validator');
	hideWarning('email2_validator');
	hideWarning('telephone_validator');
	hideWarning('telephone2_validator');
	hideWarning('vatid_validator');
	hideWarning('password_validator');
	hideWarning('password2_validator');
	hideWarning('password_confirm_validator');
	hideWarning('Agree_validator');
	
	if (have_tours == true) {
	
	hideOptions('tours1_show');
	hideOptions('tours2_show');
	hideOptions('tours3_show');
	hideOptions('tours4_show');
	
	}
	
	if (have_extras == true) {
	
	hideOptions('extras1_show');
	hideOptions('extras2_show');
	hideOptions('extras3_show');
	hideOptions('extras4_show');

	}
	
}


function resetForm_userinfo_promo()
{
	hideWarning('pstartdate_validator');
	hideWarning('firstname_validator');
	hideWarning('surname_validator');
	hideWarning('address1_validator');
	hideWarning('postcode_validator');
	hideWarning('city_validator');
	hideWarning('country_validator');
	hideWarning('email_validator');
	hideWarning('email2_validator');
	hideWarning('telephone_validator');
	hideWarning('telephone2_validator');
	hideWarning('vatid_validator');
	hideWarning('password_validator');
	hideWarning('password2_validator');
	hideWarning('password_confirm_validator');
	hideWarning('Agree_validator');
}


function resetForm_book_unit()
{
	hideWarning('startdate_validator');
	hideWarning('enddate_validator');
	
	if (have_tours == true) {
	
	hideWarning('tstartdate0_validator');
	hideWarning('tstartdate1_validator');
	hideWarning('tstartdate2_validator');
	hideWarning('tstartdate3_validator');
	hideWarning('tstartdate4_validator');
	
	}
	
	if (have_extras == true) {
	
	hideWarning('estartdate0_validator');
	hideWarning('estartdate1_validator');
	hideWarning('estartdate2_validator');
	hideWarning('estartdate3_validator');
	hideWarning('estartdate4_validator');
	
	}
	
	if (have_tours == true) {
	
	hideOptions('tours1_show');
	hideOptions('tours2_show');
	hideOptions('tours3_show');
	hideOptions('tours4_show');
	
	}
	
	if (have_extras == true) {
	
	hideOptions('extras1_show');
	hideOptions('extras2_show');
	hideOptions('extras3_show');
	hideOptions('extras4_show');

	}
	
}

function resetForm_book_customer()
{
	hideWarning('startdate_validator');
	hideWarning('enddate_validator');
	
	if (have_tours == true) {
	
	hideWarning('tstartdate0_validator');
	hideWarning('tstartdate1_validator');
	hideWarning('tstartdate2_validator');
	hideWarning('tstartdate3_validator');
	hideWarning('tstartdate4_validator');
	
	}
	
	if (have_extras == true) {
	
	hideWarning('estartdate0_validator');
	hideWarning('estartdate1_validator');
	hideWarning('estartdate2_validator');
	hideWarning('estartdate3_validator');
	hideWarning('estartdate4_validator');
	
	}
	
	if (have_tours == true) {
	
	hideOptions('tours1_show');
	hideOptions('tours2_show');
	hideOptions('tours3_show');
	hideOptions('tours4_show');
	
	}
	
	if (have_extras == true) {
	
	hideOptions('extras1_show');
	hideOptions('extras2_show');
	hideOptions('extras3_show');
	hideOptions('extras4_show');

	}
	
}

function resetForm_book_promo()
{
	hideWarning('pstartdate_validator');
}

