function checkNull(objText) {
  var vForm = document.frmGroupRequest; 
  var xLen = eval(vForm.name+"."+objText.name).value.length; 
  var s = eval(vForm.name+"."+objText.name).value;

  if(xLen>0){
    if(s.charAt(0)==" "){
      while(s.charAt(0)==" "&&s.length>=1){
        s=s.substring(1);
        if(s.length==0){
          eval(vForm.name+"."+objText.name).value="";
        }
      }
      xLen = s.length;
    }
    
    if(s.charAt((xLen-1))==" "){
      while(s.charAt((xLen-1))==" "){
        s=s.substring(0,(xLen-1)); 
        xLen = s.length;
      }
    }
    
    eval(vForm.name+"."+objText.name).value=s;
  }
}

function validatePhone(objText){
  var validChar="0123456789-()."; 
  var myLen = objText.value.length; 
  var mathOK = false;

  if (myLen < 1) { 
    objText.value = ""; 
  } else { 
    for (var i=0; i < myLen; i++ ){ 
      if(validChar.indexOf(objText.value.charAt(i))<0){ 
        objText.value="";
        objText.focus();
      } 
    } 
  }
}

function validateTextChars(objText){
  var validChar="qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM@.,;!?()1234567890 ";
  var validAccent="ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÑÒÓÔÕÖÙÚÛÜÝàáâãäåæçèéêëìíîïñòóôõöùúûüýÿ"
  validChar = validChar+validAccent
  var myLen = objText.value.length; 
  var mathOK = false;

  if (myLen < 1) { 
    objText.value = ""; 
  } else { 
    for (var i=0; i < myLen; i++ ){ 
      if(validChar.indexOf(objText.value.charAt(i))<0){ 
        objText.value="";
        objText.focus();
      } 
    } 
  }
  chopSpaces(objText);
}

function chopSpaces(objTextT){
  var vForm = document.frmGroupRequest; 
  var s = eval(vForm.name+"."+objTextT.name).value;
  var xLen = s.length; 
  
  for(i = 0; i < xLen; i++){
    if(s.charAt(0)==" "){ 
      s = s.substring(1,s.length) 
    }
    if(s.charAt(s.indexOf(" ")+1) == " "){ 
      s = s.replace(s.charAt(s.indexOf(" ")+1),"")
    }
    if(s.charAt(s.length-1)==" "){
      s = s.substring(0,s.lastIndexOf(" ")) 
    } 
  }
  eval(vForm.name+"."+objTextT.name).value=s;
}

// validation of required information
function validate(){
  var vForm = document.frmGroupRequest;
  var sObj = eval(vForm.name+".txt1").value; if (sObj == ""){ document.frmGroupRequest.txt1.focus(); return false; }
  sObj = eval(vForm.name+".txt5").value; if (sObj == ""){ document.frmGroupRequest.txt5.focus(); return false; }
  sObj = eval(vForm.name+".txt8").value; if (sObj == ""){ document.frmGroupRequest.txt8.focus(); return false; }
  sObj = eval(vForm.name+".txt9").value; if (sObj == ""){ document.frmGroupRequest.txt9.focus(); return false; }
  sObj = eval(vForm.name+".txt10").value; if (sObj == ""){ document.frmGroupRequest.txt10.focus(); return false; }
  sObj = eval(vForm.name+".txt11").value; if (sObj == ""){ document.frmGroupRequest.txt11.focus(); return false; }
  sObj = eval(vForm.name+".txt13").value; if (sObj == ""){ document.frmGroupRequest.txt13.focus(); return false; }
  sObj = eval(vForm.name+".txt14").value; if (sObj == ""){ document.frmGroupRequest.txt14.focus(); return false; }
  sObj = document.frmGroupRequest.rad1[0].checked;
  if (sObj == true){
	sObj = eval(vForm.name+".txt16").value; if (sObj == ""){ document.frmGroupRequest.txt16.focus(); return false; }
    sObj = eval(vForm.name+".txt17").value; if (sObj == ""){ document.frmGroupRequest.txt17.focus(); return false; }
    sObj = eval(vForm.name+".txt18").value; if (sObj == ""){ document.frmGroupRequest.txt18.focus(); return false; }
    sObj = eval(vForm.name+".txt19").value; if (sObj == ""){ document.frmGroupRequest.txt19.focus(); return false; }
  }
  return true;
}

function clearHotel(){
  document.getElementById('hotel_t1').style.display = 'none';
  document.getElementById('hotel_t2').style.display = 'none';
  
/*  if (document.frmGroupRequest.rad1[1].checked == true){
    document.frmGroupRequest.txt15.value = "";
	document.frmGroupRequest.txt16.value = "";
    document.frmGroupRequest.txt17.value = "";
    document.frmGroupRequest.txt18.value = "";
    document.frmGroupRequest.txt19.value = "";
	document.frmGroupRequest.txt20.value = "";
    document.frmGroupRequest.cbo1.focus();
  }
 */ 
}

function showHotel(){
  document.getElementById('hotel_t1').style.display = 'block';
  document.getElementById('hotel_t2').style.display = 'block';
}

function clearAir(){
  document.getElementById('air_t1').style.display = 'none';
  document.getElementById('air_t2').style.display = 'none';
}

function showAir(){
  document.getElementById('air_t1').style.display = 'block';
  document.getElementById('air_t2').style.display = 'block';
}

function clearCruise(){
  document.getElementById('cruise_t1').style.display = 'none';
  document.getElementById('cruise_t2').style.display = 'none';
  document.getElementById('cruise_t3').style.display = 'none';
  document.getElementById('cruise_t4').style.display = 'none';
  document.getElementById('cruise_t5').style.display = 'none';
}

function showCruise(){
  document.getElementById('cruise_t1').style.display = 'block';
  document.getElementById('cruise_t2').style.display = 'block';
  document.getElementById('cruise_t3').style.display = 'block';
  document.getElementById('cruise_t4').style.display = 'block';
  document.getElementById('cruise_t5').style.display = 'block';
}