//\//////////////////////////////////////////////////////////////////////////////////
//\  Zoek en Boek block extra javascripts
//\  altijd aanroepen naast include zoek_boek.php
     
     	          function GetForm() {
    	                  // Workaround Browser Bugs
    	                  if (document.search) return document.search;
    	                  if (document.forms.search) return document.forms.search;
    	                  if (document.layers["body"].document.search) return document.layers["body"].document.search;
    	                  alert("Error in GetForm()");
    	                  return document.search;
	              }

                 
                 function SetFocus()
                 {
                       document.getElementById("bestemming1").focus();
                 }
                 function NavigateUrl(link) {
                    document.location = link;
                    this.style.cursor = cursor.hand;
                 }
                 
                 function ChangeCursor(from) {
                    from.style.cursor = "pointer";

                 }

                function DisableRetourFields() {
			  var f = GetForm();	
                
                    if (document.getElementById("retour_date").getAttribute("disabled")) {
                        document.getElementById("retour_date").removeAttribute("disabled");
                        document.getElementById("sel_time2").style.color = "#00336d";
                        document.getElementById("retour_date").style.backgroundColor = "#ffffff";
                        document.getElementById("sel_time2").removeAttribute("disabled");
                        document.getElementById("sel_time2").style.backgroundColor = "#ffffff";
                        document.getElementById("a_selWay").innerHTML = "Enkele reis";
                        f.Roundtrip.value=1;
                        document.getElementById("img_retour_date").src = "images/calendar.gif"
                        document.getElementById("img_retour_date").setAttribute("onClick","openKalender(document.getElementById('retour_date'),'vertrek_date','retour_date','kalender_popup')")
                        document.getElementById("img_retour_date").removeAttribute("disabled");
                    }
                    else
                    {
                        document.getElementById("retour_date").style.backgroundColor = "#f2f2f2";
                        document.getElementById("sel_time2").style.color = "#e5e5e5";
                        document.getElementById("retour_date").setAttribute("disabled","disabled");
                        document.getElementById("sel_time2").style.backgroundColor = "#f2f2f2";
                        document.getElementById("sel_time2").setAttribute("disabled","disabled");  
                        document.getElementById("a_selWay").innerHTML = "Retour";
                        f.Roundtrip.value=0;
                        document.getElementById("img_retour_date").src = "images/calendar_disabled.gif"
                        document.getElementById("img_retour_date").setAttribute("disabled","disabled");  
                        document.getElementById("img_retour_date").setAttribute("onClick","");
                    }
                    }
                    
                    
                function ChooseAirport(params) {
		              window.open( "landlookup_popup.html?veld=" + params,
          	 	              "ExtraInformation", 
           		              "scrollbars=yes,height=400,width=550,left=100,top=0");
	              }

	              function SetAirport(field, airport, code) {
		              var f = GetForm();
					field = eval("f."+field);	
			              field.value = airport+ ' ('+ code +')';
			              field.focus();
	              }    
                   function update_inf() 
	                  {
	                  var f = GetForm();
	                  var adults = parseInt(f.nr_adults.options[f.nr_adults.selectedIndex].value,10);
	                  var inf = parseInt(f.nr_infants.options[f.nr_infants.selectedIndex].value,10);
	                  while (adults < f.nr_infants.options.length) 
		                  {
		                  f.nr_infants.options[(f.nr_infants.options.length - 1)] = null;
		                  }

	                  for (var i=0; i <= adults; i++) 
		                  {
		                  f.nr_infants.options[i] = new Option(i,i);
		                  }
	                  if (inf <= f.nr_infants.options.length)
		                  {
		                  f.nr_infants.selectedIndex = inf;
		                  }
	                  }
                    
	function goto_step1()
		{
		var f = GetForm();	
            f.goto_step1.value=1;
		document.search.submit();
		}

	function submit_search_form()
		{
		document.search.submit();
		}
