function TypeCriteria() {
  var sTypes = '';
  if (document.forms[0].chCampground.checked == true) sTypes = '&chCampground=1';
  if (document.forms[0].chHotel.checked == true) sTypes = sTypes + '&chHotel=1';
  if (document.forms[0].chAttraction.checked == true) sTypes = sTypes + '&chAttraction=1';
  if (document.forms[0].cbActivity.value != '') sTypes = sTypes + '&Activity='+document.forms[0].cbActivity.value;
  return sTypes;
}
function ApplySearch(customQuery) {
  var sKeyword = '';
  var mapArg = '';
  if (document.forms[0].name == 'fmExtras')
     mapArg = '&MapType='+mapPointer.getCurrentMapType().getName(false);
  if (document.forms[0].Keywordsearch.value != '') sKeyword = '&Keyword='+document.forms[0].Keywordsearch.value;
  document.location = document.forms[0].action+'?SessionId='+document.forms[0].SessionId.value+'&Region='+document.forms[0].cbRegion.value+'&Prov='+document.forms[0].cbProv.value+'&City='+document.forms[0].searchCity.value+sKeyword+TypeCriteria()+customQuery+mapArg;
}
function ChangeActivity() {
  ApplySearch('');	 
}
function ChangeRegion() {
  document.forms[0].searchCity.value = '';
  document.forms[0].cbProv.selectedIndex = -1;
  ApplySearch('');
}
function ChangeProv() {
  document.forms[0].searchCity.value = ''
  document.forms[0].cbRegion.selectedIndex = -1;
  ApplySearch('');
}
function CityKeyPress(e) 
{
  var keynum;
  var keychar;
  var numcheck;
  if (window.event) keynum = e.keyCode;
  else if (e.which) keynum = e.which;
  keychar = String.fromCharCode(keynum);
  if ((keynum == 13) && (document.forms[0].searchCity.value != '')) {
     ApplySearch('');
     return false; 
  }	
}
function KeywordKeyPress(e) {
  var keynum;
  var keychar;
  var numcheck;
  if (window.event) keynum = e.keyCode;
  else if (e.which) keynum = e.which;
  keychar = String.fromCharCode(keynum);
  if ((keynum == 13) && (document.forms[0].Keywordsearch.value != '')) {
     ApplySearch('');
     return false; 
  }	
}
