function CheckSearchType()
{
  var Type = ($('QSTour').checked) ? 'Tour' : 'Accommodation';

  var AccomTypes = [$H({id:1, name:'Apartments'}),$H({id:2, name:'Hotel'}),$H({id:3, name:'Resort'})];
  var TourTypes = [$H({id:9, name:'Adventure'}),$H({id:15,name:'Attractions'}),$H({id:14, name:'Cruises'}),$H({id:6, name:'Diving'}),$H({id:19, name:'Extended Touring'}),$H({id:16, name:'Islands'}),$H({id:10, name:'Night Tours'}),$H({id:21, name:'Outback'}), $H({id:20, name:'Port Douglas'}),$H({id:8, name:'Rainforest'}),$H({id:12, name:'Reef'}),$H({id:18, name:'Sailing'}),$H({id:13, name:'Scenic Flights'}),$H({id:25, name:'Sightseeing'}),$H({id:11, name:'Fishing'}),$H({id:26, name:'Spas'})];
  var TypesArray = (Type == 'Accommodation') ? AccomTypes : TourTypes;
  $('SearchType').value=Type;
  
  $('typeselect').length=1;
  TypesArray.each(function(k) 
  { 
    $('typeselect').options[$('typeselect').length] = new Option(k.name, k.id);
  });
  
  $('typeselect').value= ($('SearchTypeSC').value > 0) ? $('SearchTypeSC').value : 0 ;
}

function UpdateSearchType() {
  $('SupplierType').value=$('typeselect').value;
}

function PopWindow(type, id1, id2, w, h) {
  width=parseInt(w)+20;
  height=parseInt(h)+20;
  if(type=='Tour') {
    window.open("/images/photos/p"+id1+"/"+id2+"_z.jpg","Window1", "menubar=no,width="+width+",height="+height+",toolbar=no");
  }else {
    window.open("/images/photos/s"+id1+"/"+id2+"_z.jpg","Window1", "menubar=no,width="+width+",height="+height+",toolbar=no");
  }  
}

function ChangeSearchOptions() {
  var Type = ($('QSTour').checked) ? 'Tour' : 'Accommodation';
  if(Type=='Tour') {
    $('locationselect').length=0;
    $('locationselect').options[$('locationselect').length] = new Option('Cairns and Surrounds', 15);
  }else {
    $('locationselect').length=0;
    $('locationselect').options[$('locationselect').length] = new Option('Cairns', 15);
    $('locationselect').options[$('locationselect').length] = new Option('Daintree & Cape Tribulation', 20);
    $('locationselect').options[$('locationselect').length] = new Option('Northern Beaches', 14);
    $('locationselect').options[$('locationselect').length] = new Option('Palm Cove', 19);
    $('locationselect').options[$('locationselect').length] = new Option('Port Douglas', 17);
    $('locationselect').options[$('locationselect').length] = new Option('Trinity Beach', 18);
  }
}

function PopV(p) 
{
  window.open('/video?p='+p,'Video', 'menubar=no,width=543,height=423,toolbar=no');
}