	function voerUitPost(agent) {


		//autocompheenv = document.getElementById("ysearchinput2").value;
                //autocompterugv = document.getElementById("ysearchinput3").value;	
		//autocompheen = document.getElementById("ysearchinput2").value;
                //autocompterug = document.getElementById("ysearchinput3").value;
				if(autocompheen.substring(autocompheen.length-1) == ")") {
					autocompheen = autocompheen.substring((autocompheen.length-4),(autocompheen.length-1)) ;
				}
				else {
					autocompheen = autocompheen.substring((0),(3)) ;
				}
				if(autocompterug.substring(autocompterug.length-1) == ")") {
					autocompterug = autocompterug.substring((autocompterug.length-4),(autocompterug.length-1)) ;
				}
				else {
					autocompterug = autocompterug.substring((0),(3)) ;
				}
                dagheen = document.dates.selDay.value;
                maandheen = document.dates.selMonth.value;
                var selYear = document.getElementById("selYear");
                jaarheen = selYear.options[selYear.selectedIndex].innerHTML;
                dagterug = document.datesT.selDayT.value;
                maandterug = document.datesT.selMonthT.value;
                var selYearT = document.getElementById("selYearT");
                jaarterug = selYearT.options[selYearT.selectedIndex].innerHTML;
                maandheenint = maandheen;
                maandterugint = maandterug;
                if (maandheen.length <2) {
                    maandheen = "0"+maandheen;
                }
                if (maandterug.length <2) {
                    maandterug = "0"+maandterug;
                }
                dagheenint = dagheen;
                dagterugint = dagterug;
                if (dagheen.length <2) {
                    dagheen = "0"+dagheen;
                }
                if (dagterug.length <2) {
                    dagterug = "0"+dagterug;
                }
                datumheenstr = jaarheen +"/"+ maandheen +"/"+ dagheen;
                datumterugstr = jaarterug +"/"+ maandterug +"/"+ dagterug; 	//  YYYY/MM/DD
                datumheenint = parseInt(jaarheen + maandheen + dagheen);
                datumterugint = parseInt(jaarterug + maandterug + dagterug); //YYYMMDD
                datumheen = datumheenstr;
                datumterug = datumterugstr;

                for (i=0; i<2; i++) {
                    if(document.radiobutton.radio1[i].checked){
                        waarde = document.radiobutton.radio1[i].value;
                        break;
                    }
                }
                retourenkel = waarde;
				if (retourenkel == "Enkel") {retourenkel = "e";}
				else {retourenkel = "r";}
                aantalreiz = document.reizigers.adults.value;              

	if (agent=="VT") {
    		document.forms.VTform.s.value = "VT";
	    	document.forms.VTform.v.value = autocompheen;
		document.forms.VTform.b.value = autocompterug;
		document.forms.VTform.hd.value = datumheenint;
		document.forms.VTform.td.value = datumterugint;
		document.forms.VTform.r.value = aantalreiz;
		document.forms.VTform.t.value = retourenkel;		
	        document.forms.VTform.submit();
		document.forms.VTform.action=document.forms.VTform.action + '1';
		Analytics(agent, autocompheen, autocompterug, datumheenint, datumterugint, aantalreiz, retourenkel);
	}
	if (agent=="CT") {
		//var nrselectvertrek = document.selectformvertrek.selectvertrek.selectedIndex;
		//var nrselectbestemming = document.selectform.selectbestemming.selectedIndex;
	    	document.forms.CTform.s.value = "CT";
	    	//document.forms.CTform.v.value = document.selectformvertrek.selectvertrek.options[nrselectvertrek].text; //autocompheen;
		//document.forms.CTform.b.value =  document.selectform.selectbestemming.options[nrselectbestemming].text;  //autocompterug;
	    	document.forms.CTform.vv.value = autocompheen; //aangepast!
		document.forms.CTform.bv.value = autocompterug; //aangepast!
                document.forms.CTform.v.value = autocompheen;
		document.forms.CTform.b.value = autocompterug;
		document.forms.CTform.hd.value = datumheenint;
		document.forms.CTform.td.value = datumterugint;
		document.forms.CTform.r.value = aantalreiz;
		document.forms.CTform.t.value = retourenkel;		
	        document.forms.CTform.submit();
		document.forms.CTform.action=document.forms.CTform.action + '1';
		Analytics(agent, autocompheen, autocompterug, datumheenint, datumterugint, aantalreiz, retourenkel);
	}
	if (agent=="VF") {
	    	document.forms.VFform.s.value = "VF";
	    	document.forms.VFform.v.value = autocompheen;
		document.forms.VFform.b.value = autocompterug;
		document.forms.VFform.hd.value = datumheenint;
		document.forms.VFform.td.value = datumterugint;
		document.forms.VFform.r.value = aantalreiz;
		document.forms.VFform.t.value = retourenkel;		
	        document.forms.VFform.submit();
		document.forms.VFform.action=document.forms.VFform.action + '1';
		Analytics(agent, autocompheen, autocompterug, datumheenint, datumterugint, aantalreiz, retourenkel);
	}

	if (agent=="EB") {
	    	document.forms.EBform.s.value = "EB";
	    	document.forms.EBform.v.value = autocompheen;
		document.forms.EBform.b.value = autocompterug;
		document.forms.EBform.hd.value = datumheenint;
		document.forms.EBform.td.value = datumterugint;
		document.forms.EBform.r.value = aantalreiz;
		document.forms.EBform.t.value = retourenkel;		
	        document.forms.EBform.submit();
		document.forms.EBform.action=document.forms.EBform.action + '1';
		Analytics(agent, autocompheen, autocompterug, datumheenint, datumterugint, aantalreiz, retourenkel);
	}
	if (agent=="WT") {
	    	document.forms.WTform.s.value = "WT";
	    	document.forms.WTform.v.value = autocompheen;
		document.forms.WTform.b.value = autocompterug;
		document.forms.WTform.hd.value = datumheenint;
		document.forms.WTform.td.value = datumterugint;
		document.forms.WTform.r.value = aantalreiz;
		document.forms.WTform.t.value = retourenkel;		
	        document.forms.WTform.submit();
		document.forms.WTform.action=document.forms.WTform.action + '1';
		Analytics(agent, autocompheen, autocompterug, datumheenint, datumterugint, aantalreiz, retourenkel);
	}
	if (agent=="CH") {

/*if ((autocompterugv.substring((autocompterugv.length-6),(autocompterugv.length-5)) != " ") &&  (autocompterugv.substring(3,4) != " ") ) {
	autocompterugv = autocompterug;
}
if ((origstad.substring(3,4) != " ") && (origstad.length > 0)  ) {
	autocompterugv = autocompterug;
}*/

	    	document.forms.CHform.s.value = "CH";
	    	document.forms.CHform.v.value = autocompheen;
		document.forms.CHform.b.value = autocompterug;
	    	document.forms.CHform.vv.value = autocompheen;  //aangepast!
		document.forms.CHform.bv.value = autocompterug; //aangepast!
		document.forms.CHform.hd.value = datumheenint;
		document.forms.CHform.td.value = datumterugint;
		document.forms.CHform.r.value = aantalreiz;
		document.forms.CHform.t.value = retourenkel;		
	        document.forms.CHform.submit();
		document.forms.CHform.action=document.forms.CHform.action + '1';
		Analytics(agent, autocompheen, autocompterug, datumheenint, datumterugint, aantalreiz, retourenkel);
	}
	if (agent=="VW") {
	    	document.forms.VWform.s.value = "VW";
	    	document.forms.VWform.v.value = autocompheen;
		document.forms.VWform.b.value = autocompterug;
	    	

		document.forms.VWform.hd.value = datumheenint;
		document.forms.VWform.td.value = datumterugint;
		document.forms.VWform.r.value = aantalreiz;
		document.forms.VWform.t.value = retourenkel;		
	        document.forms.VWform.submit();
		document.forms.VWform.action=document.forms.VWform.action + '1';
		Analytics(agent, autocompheen, autocompterug, datumheenint, datumterugint, aantalreiz, retourenkel);
	}	
	if (agent=="BG") {
	    	document.forms.BGform.s.value = "BG";
	    	document.forms.BGform.v.value = autocompheen;
		document.forms.BGform.b.value = autocompterug;
	    	

		document.forms.BGform.hd.value = datumheenint;
		document.forms.BGform.td.value = datumterugint;
		document.forms.BGform.r.value = aantalreiz;
		document.forms.BGform.t.value = retourenkel;		
	        document.forms.BGform.submit();
		document.forms.BGform.action=document.forms.BGform.action + '1';
		Analytics(agent, autocompheen, autocompterug, datumheenint, datumterugint, aantalreiz, retourenkel);
	}
	if (agent=="KL") {
           if (retourenkel == "r") {
	    	document.forms.KLform.s.value = "KL";
	    	document.forms.KLform.v.value = autocompheen;
		document.forms.KLform.b.value = autocompterug;
		document.forms.KLform.hd.value = datumheenint;
		document.forms.KLform.td.value = datumterugint;
		document.forms.KLform.r.value = aantalreiz;
		document.forms.KLform.t.value = retourenkel;		
	        document.forms.KLform.submit();
		document.forms.KLform.action=document.forms.KLform.action + '1';
		Analytics(agent, autocompheen, autocompterug, datumheenint, datumterugint, aantalreiz, retourenkel);
		ArrayR = new Array ("Aberdeen","Abu Dhabi","Abuja","Accre","Addis Ababa","Almaty","Aruba","Athene","Atlanta","Bahrein ","Bangkok","Barcelona","Bazel","Peking","Bergen","Berlijn","Billund","Birmingham","Bologna","Bonaire","Bordeaux","Boston","Bremen","Bristol","Brussel","Boekarest","Boedapest ","Cairo","Calgary","Cancun","Kaapstad","Cardiff","Chengdu","Chicago","Clermont-Ferrand","Keulen","Kopenhagen","Cork","Curacao","Dallas","Damman","Dar es Salaam","Delhi","Denpasar Bali","Detroit","Doha","Dubai","Dublin","Dusseldorf","Edinburgh","Entebbe","Florence","Frankfurt","Geneve","Glasgow","Gotenburg","Guangzhou","Guayaquil","Hamburg","Hangzhou","Hannover","Havana","Helsinki","Hong Kong","Houston","Humberside","Teheran","Istanbul","Jakarta","Johannesburg","Kano","Khartoum","Kiev","Kilimanjaro","Kristiansand","Kuala Lumpur","Kuwait","Lagos","Larnaca","Leeds","Lima","Linkoping","Lissabon","Liverpool","Londen Heathrow","Londen City","Londen","Los Angeles","Luxemburg","Lyon","Madrid","Manchester","Manila","Marseille","Mephis","Mexico","Milaan Linate","Milaan Malpensa","Milaan","Minneapolis","Montreal","Moskou","Mulhouse","Mumbai","Munchen","Muscat","Nairobi","Nantes","New York JFK","New York Newark","New York NYC","Newcastle","Nice","Norwich","Neurenberg ","Osaka","Oslo","Panama City","Paphos","Paramaribo","Parijs","Portland","Praag","Punta Cana","Quito","Rome","Sint Maarten","Sint Petersburg","San Francisco","Sao Paulo","Seattle","Seoul","Shanghai","Singapore","Stavanger","Stockholm","Straatsburg","Stuttgart","Teesside","Tel Aviv","Tokyo","Toronto","Toulouse","Tripoli","Trondheim","Turijn ","Vancouver","Venetie","Wenen","Vilnius","Warschau","Washington ","Zurich");
            }
	    else {
		 CheckKarray = new Array ("Aberdeen","Abidjan","Abu Dhabi","Abuja","Acapulco","Accra","Addis Ababa","Adelaide","Agadir","Aguascalientes","Ajaccio","Akron Canton","Albany","Albuquerque","Alexandria","Alexandri�","Algiers","Alicante","Alpena","Amman","Amsterdam","Anchorage","Ancona","Angers","Annecy","Antaninvarivo","Antwerpen","Appleton","Aruba","Arusha","Asmara","Aspen","Asuncion","Athene","Atlanta","Auckland","Austin-Bergstrom","Avignon","Bahrein","Baltimore","Bamako","Bangalore","Bangkok","Banqui","Barcelona","Bari","Bastia","Baton Rouge","Bazel","Beiroet","Belfast","Belgrado","Bellingham","Bemidji","Bergen","Berlijn","Biarritz","Bilbao","Billings","Billund","Biloxi","Birmingham","Birmingham VS","Bismarck","Blantyre","Bloemfontein","Bloomington","Boedapest","Bogota","Boise","Bombay","Bonaire","Bordeaux","Boston","Bozeman","Brainerd","Brasilia","Bremen","Brest","Bridgetown","Brindisi","Brisbane","Bristol","Brussel","Buenos Aires","Buffalo","Bujumbura","Burbank","Burlington","Busan","Butte","Caen","Cairo","Calgary","Calvi","Campeche","Campinas","Campo Grande","Cancun","Caracas","Cardiff","Casablanca","Casper","Catania","Cayenne","Cedar Rapids","Chambery","Champaign","Changchun","Charleston","Charleston","Charlotte","Charlottesville","Chattanooga","Chennai","Chergdu","Chicago","Chisholm","Chongqing","Christchurch","Cincinnati","Ciudad Juarez","Clermont","Cleveland","Colorado Springs","Columbus","Conakry","Cork","Corpus Christi","Cuiaba","Culiacan","Cura�ao","Curitiba","Dabra","Dakar","Dalian","Dallas","Dammam","Dammam","Dar es Salaam","Darwin","Dayton","Delhi","Denis Reunion","Denpasar","Denver","Des Moines,","Detroit","Djibouti","Doha","Douala","Dubai","Dublin","Dubuque","Duluth","Durban","Durham","Dusseldorf","East London","Easton","Eau Claire","Edinburgh","Eindhoven","El Paso","Eldoret","Elmira","Entebbe","Erie","Eugene","Eureka","Evansville","Fairbanks","Fargo","Figari","Flint","Florence","Florianopolis","Fort de France","Fort Dodge","Fort Lauderdale","Fort Smith","Fort Wayne","Frankfurt","Fresno","Fuerteventura","Gaborone","Gainesville","Geneve","Genua","George","Glasgow","Gotenburg","Grand Forks","Grand Rapids","Great Falls","Green Bay","Greenville","Guadalajara","Guayaquil","Guilin","Hakodate","hamburg","Hancock","Hangzhou","Hannover","Harbin","Harrisburg","Havanna","Helena","Helsinki","Hendersonville","Hermosillo","High Point","Hoedspruit","Holguin","Hong Kong","Honolulu","Houston","Humberside","Huntsville","Hyderabad","Ibiza","Iguazu","Indianapolis","Innsbruck","International Falls","Istanbul","Ithaca","Jackson","Jackson Hole","Jacksonville","Jeddah","Johannesburg","Johnson City","Joplin","Juneau","Kaapstad","Kalamazoo","Kano","Katowice","Ketchikan","Keulen","Kiev","Kigali","Kilimanjaro","Kimmirut","Kingsport","Kitchener","Knoxville","Koeweit","Kona","Kopenhagen","Kota Kinabalu","Kuala Lumpur","Kwethluk","La Crosse","Laayoune","Lafayette","Lagos","Lamezia-Terme","Lamu","Langkawi","Lannion","Lansing","Lanzarote","Las Palmas","Las Vegas","Le Havre","Leeds","Leipzig","Leon","Lewiston","Lexington","Libreville","Lille","Lilongwe","Lima","Limoges","Lincoln","Linkoping","Linz","Lissabon","Little Rock","Liverpool","Livingstone","Ljubliana","Lome","Londen","Londrina","Lorient","Los Angeles","Louisville","Lourdes","Luanda","Lulea","Lumbashi","Lusaka","Luxemburg","Luxor","Lyon","Maastricht","Madison","Madrid","Mahe Island","Malaga","Male","Malindi","Malta","Manaus","Manchester","Manchester","Manila","Manzini","Maputo","Margate","Marquette","Marrakech","Marseille","Maseru","Mason City","Maui","Mauritius","Medford","Melbourne","Memphis","Menorca","Merida","Metz","Mexico","Miami","Milaan","Milwaukee","Minneapolis","Minot","Missoula","Mobile","Moline","Mombasa","Monterrey","Montgomery","Montpellier","Moskou","Muenster","Mulhouse","Munchen","Muscle Shoals","Muskegon","Musqat","Nagoya","Nairobi","Nantes","Napels","Nashville","Nassau","Natal","Ndjamena","Nelspruit","Neurenberg","New Orleans","New York","Newburgh","Newcastle","Niamey","Nice","Norfolk","Norwich","Nouakchott","Noumea","Oakland","Oklahoma","Omaha","Ontario","Orlando","Osaka","Oslo","Oslo","Ouagadougou","Paducah","Palermo","Palm Springs","Palma de Mallorca","Panama","Panama","Papeete","Paramaribo","Parijs","Pasco","Pau","Pellston","Penang","Pensacola","Peoria","Perpignan","Perth","Perugia","Petersburg","Phalaborwa","Philadelphia","Phoenix","Pierre","Pietermaritzburg","Pietersburg","Pisa","Pittsburgh","Pocatello","Pointe-a-Pitre","Poitiers","Port Angeles","Port Au Prince","Port Elizabeth","Port Harcourt","Portland","Portland Jetport","Porto","Porto Alegre","Praag","Providence","Puerto Plata","Puerto Vallarta","Pullman","Punta Cana","quebec","Quimper","Quito","Rabat","Rapid City","Recife","Redmond","Reggio","Regina","Rennes","Reno","Rhinelander","Richards Bay","Richmond","Rio de Janeiro","Riyadh","Roanoke","Rochester","Rochester","Rodez","Rome","Rota","Rotterdam","Rouen","Saginaw","Saint Cloud","Saint Louis","Saipan","Salt Lake City","Salvadore","Salzburg","San Antonio","San Diego","San Francisco","San Jose","Santa Ana","Santo Domingo","Sanya","Sao Paulo","Sarasota","Saskatoon","Savannah","Seattle","Seoul","Sevilla","Shenzhen","Shreveport","Singapore","Sint-Maarten","Sioux City","Sioux Falls","Sofia","South Bend","Southampton","Spartanburg","Spokane","Springfield","Springfield-Hartford","State College","Stavanger","Stevens Point","Stockholm","Straatsburg","Stuttgart","Sydney","Syracuse","Taipei","Tallahassee","Tampa","Tapachula","Teesside","Teheran","Tel Aviv","Thessaloniki","Thief River Falls","Thunder Bay","Tijuana","Tinian","Tobago","Tokyo","Toledo","Torreon","Toulon","Toulouse","Tours","Traverse City","Trieste","Tripoli","Trondheim","Tucson","Tulsa","Tunis","Tupelo","Turijn","Upington","Valencia","Valladolid","Vancouver","Varadero","Venetie","Verona","Vigo","Villahermosa","Vilnius","Walla Walla","Walvis Bay","Warschau","Washington","Waterloo","Watertown","Wenatchee","wenen","West Palm Beach","Westchester","Wichita","Windhoek","Winnipeg","Winton","Wuhan","Yakima","Yaounde","Yerevan","Zanzibar","Zhengzha","Zurich");   //KLM lijst
		alert("KLM heeft geen concurrerend tarief voor enkele reis");
            }
	}
	if (agent=="SP") {
	    	document.forms.SPform.s.value = "SP";
	    	document.forms.SPform.v.value = autocompheen;
		document.forms.SPform.b.value = autocompterug;
		document.forms.SPform.hd.value = datumheenint;
		document.forms.SPform.td.value = datumterugint;
		document.forms.SPform.r.value = aantalreiz;
		document.forms.SPform.t.value = retourenkel;		
	        document.forms.SPform.submit();
		document.forms.SPform.action=document.forms.SPform.action + '1';
		Analytics(agent, autocompheen, autocompterug, datumheenint, datumterugint, aantalreiz, retourenkel);
	}
		if (agent=="VL") {
	    	document.forms.VLform.s.value = "VL";
	    	document.forms.VLform.v.value = autocompheen;
		document.forms.VLform.b.value = autocompterug;
		document.forms.VLform.hd.value = datumheenint;
		document.forms.VLform.td.value = datumterugint;
		document.forms.VLform.r.value = aantalreiz;
		document.forms.VLform.t.value = retourenkel;		
	        document.forms.VLform.submit();
		document.forms.VLform.action=document.forms.VLform.action + '1';
		Analytics(agent, autocompheen, autocompterug, datumheenint, datumterugint, aantalreiz, retourenkel);
	}
	if (agent=="TX") {
	    	document.forms.TXform.s.value = "TX";
	    	document.forms.TXform.v.value = autocompheen;
		document.forms.TXform.b.value = autocompterug;
		document.forms.TXform.hd.value = datumheenint;
		document.forms.TXform.td.value = datumterugint;
		document.forms.TXform.r.value = aantalreiz;
		document.forms.TXform.t.value = retourenkel;		
	        document.forms.TXform.submit();
		document.forms.TXform.action=document.forms.TXform.action + '1';
		Analytics(agent, autocompheen, autocompterug, datumheenint, datumterugint, aantalreiz, retourenkel);
	}
		if (agent=="VZ") {
	    	document.forms.VZform.s.value = "VZ";
	    	document.forms.VZform.v.value = autocompheen;
		document.forms.VZform.b.value = autocompterug;
		document.forms.VZform.hd.value = datumheenint;
		document.forms.VZform.td.value = datumterugint;
		document.forms.VZform.r.value = aantalreiz;
		document.forms.VZform.t.value = retourenkel;		
Analytics(agent, autocompheen, autocompterug, datumheenint, datumterugint, aantalreiz, retourenkel);
	        document.forms.VZform.submit();
		document.forms.VZform.action=document.forms.VZform.action + '1';

	}
		if (agent=="EX") {
	    	document.forms.EXform.s.value = "EX";
	    	document.forms.EXform.v.value = autocompheen;
		document.forms.EXform.b.value = autocompterug;
		document.forms.EXform.hd.value = datumheenint;
		document.forms.EXform.td.value = datumterugint;
		document.forms.EXform.r.value = aantalreiz;
		document.forms.EXform.t.value = retourenkel;		
	        document.forms.EXform.submit();
		document.forms.EXform.action=document.forms.EXform.action + '1';
		Analytics(agent, autocompheen, autocompterug, datumheenint, datumterugint, aantalreiz, retourenkel);
	}
		if (agent=="ST") {
	    	document.forms.STform.s.value = "ST";
	    	document.forms.STform.v.value = autocompheen;
		document.forms.STform.b.value = autocompterug;
		document.forms.STform.hd.value = datumheenint;
		document.forms.STform.td.value = datumterugint;
		document.forms.STform.r.value = aantalreiz;
		document.forms.STform.t.value = retourenkel;		
	        document.forms.STform.submit();
		document.forms.STform.action=document.forms.STform.action + '1';
		Analytics(agent, autocompheen, autocompterug, datumheenint, datumterugint, aantalreiz, retourenkel);
	}
	if (agent=="TA") {
   	    TAarray = new Array ("AGA","AHO","ALC","LEI","AMS","AYT","ATH","BCN","EGC","TXL","BJV","CTA","CHQ","JKH","CPH","CFU","CLY","LCA","DLM","DJE","FAO","FEZ","FDH","FUE","GVA","GRO","LPA","GNB","HER","HRG","IBZ","INN","ADB","KLX","AOK","KVA","EFL","KRK","KIT","SUF","ACE","SPC","PVK","MJT","LIS","LXR","FNC","AGP","MLA","RAK","RMF","MAH","BGY","MIR","MPL","JMK","NAP","NCE","OLB","OZZ","OUD","PMO","PMI","PFO","ORY","PUF","PSA","OPO","RHO","FCO","RTM","RVN","SZG","SMI","JTR","SSH","JSI","SKU","TCP","TFS","SKG","TLN","TOE","VLC","VAR","TSF","VRN","ZTH");   //lijst met bestemmingen Transavia
	    if (autocompheen == "LON") {autocompheen = "LGW"}
	    if (autocompterug == "LON") {autocompterug = "LGW"}
	    if (autocompheen == "STN") {autocompheen = "LGW"}
	    if (autocompterug == "STN") {autocompterug = "LGW"}
	    if (autocompheen == "LHR") {autocompheen = "LGW"}
	    if (autocompterug == "LHR") {autocompterug = "LGW"}
	    if (autocompheen == "LCY") {autocompheen = "LGW"}
	    if (autocompterug == "LCY") {autocompterug = "LGW"}
	    if (autocompheen == "MIL") {autocompheen = "BGY"}	
	    if (autocompterug == "MIL") {autocompterug = "BGY"}
	    if (autocompheen == "MXP") {autocompheen = "BGY"}	
	    if (autocompterug == "MXP") {autocompterug = "BGY"}
	    if (autocompheen == "LIN") {autocompheen = "BGY"}	
	    if (autocompterug == "LIN") {autocompterug = "BGY"}			
	    if (autocompheen == "BER") {autocompheen = "TXL"}
	    if (autocompterug == "BER") {autocompterug = "TXL"}
	    if (autocompheen == "SXF") {autocompheen = "TXL"}
	    if (autocompterug == "SXF") {autocompterug = "TXL"}
	    if (autocompheen == "THF") {autocompheen = "TXL"}
	    if (autocompterug == "THF") {autocompterug = "TXL"}
	    if (autocompheen == "ROM") {autocompheen = "FCO"}
	    if (autocompterug == "ROM") {autocompterug = "FCO"}
	    if (autocompheen == "CIA") {autocompheen = "FCO"}
	    if (autocompterug == "CIA") {autocompterug = "FCO"}
	    if (autocompheen == "VCE") {autocompheen = "TSF"}
	    if (autocompterug == "VCE") {autocompterug = "TSF"}
	    if (autocompheen == "PAR") {autocompheen = "ORY"}
	    if (autocompterug == "PAR") {autocompterug = "ORY"}
	    if (autocompheen == "CDG") {autocompheen = "ORY"}
	    if (autocompterug == "CDG") {autocompterug = "ORY"}

	    var heenok = "false";
	    var	terugok = "false";
	    for (var i=0; i<TAarray.length; i++) {
		if(autocompheen == TAarray[i]) {
			heenok = "true";
		}
		if(autocompterug == TAarray[i]) {
			terugok = "true";
		}
	    }
	    if ((heenok == "true") && (terugok == "true")) {				
	    	document.forms.TAform.s.value = "TA";
	    	document.forms.TAform.v.value = autocompheen;
		document.forms.TAform.b.value = autocompterug;
		document.forms.TAform.hd.value = datumheenint;
		document.forms.TAform.td.value = datumterugint;
		document.forms.TAform.r.value = aantalreiz;
		document.forms.TAform.t.value = retourenkel;		
	        document.forms.TAform.submit();
		document.forms.TAform.action=document.forms.TAform.action + '1';
		Analytics(agent, autocompheen, autocompterug, datumheenint, datumterugint, aantalreiz, retourenkel);
	    }
            else {
		alert("Transavia vliegt niet op deze luchthaven");
	    }
	}
        if (agent=="OV") { 
	 if (document.forms.OVform.selectOverig.value == "TA") {
 		TAarray = new Array ("AGA","AHO","ALC","LEI","AMS","AYT","ATH","BCN","EGC","TXL","BJV","CTA","CHQ","JKH","CPH","CFU","CLY","LCA","DLM","DJE","FAO","FEZ","FDH","FUE","GVA","GRO","LPA","GNB","HER","HRG","IBZ","INN","ADB","KLX","AOK","KVA","EFL","KRK","KIT","SUF","ACE","SPC","PVK","MJT","LIS","LXR","FNC","AGP","MLA","RAK","RMF","MAH","BGY","MIR","MPL","JMK","NAP","NCE","OLB","OZZ","OUD","PMO","PMI","PFO","ORY","PUF","PSA","OPO","RHO","FCO","RTM","RVN","SZG","SMI","JTR","SSH","JSI","SKU","TCP","TFS","SKG","TLN","TOE","VLC","VAR","TSF","VRN","ZTH");   //lijst met bestemmingen Transavia
	    if (autocompheen == "LON") {autocompheen = "LGW"}
	    if (autocompterug == "LON") {autocompterug = "LGW"}
	    if (autocompheen == "STN") {autocompheen = "LGW"}
	    if (autocompterug == "STN") {autocompterug = "LGW"}
	    if (autocompheen == "LHR") {autocompheen = "LGW"}
	    if (autocompterug == "LHR") {autocompterug = "LGW"}
	    if (autocompheen == "LCY") {autocompheen = "LGW"}
	    if (autocompterug == "LCY") {autocompterug = "LGW"}
	    if (autocompheen == "MIL") {autocompheen = "BGY"}	
	    if (autocompterug == "MIL") {autocompterug = "BGY"}
	    if (autocompheen == "MXP") {autocompheen = "BGY"}	
	    if (autocompterug == "MXP") {autocompterug = "BGY"}
	    if (autocompheen == "LIN") {autocompheen = "BGY"}	
	    if (autocompterug == "LIN") {autocompterug = "BGY"}			
	    if (autocompheen == "BER") {autocompheen = "TXL"}
	    if (autocompterug == "BER") {autocompterug = "TXL"}
	    if (autocompheen == "SXF") {autocompheen = "TXL"}
	    if (autocompterug == "SXF") {autocompterug = "TXL"}
	    if (autocompheen == "THF") {autocompheen = "TXL"}
	    if (autocompterug == "THF") {autocompterug = "TXL"}
	    if (autocompheen == "ROM") {autocompheen = "FCO"}
	    if (autocompterug == "ROM") {autocompterug = "FCO"}
	    if (autocompheen == "CIA") {autocompheen = "FCO"}
	    if (autocompterug == "CIA") {autocompterug = "FCO"}
	    if (autocompheen == "VCE") {autocompheen = "TSF"}
	    if (autocompterug == "VCE") {autocompterug = "TSF"}
	    if (autocompheen == "PAR") {autocompheen = "ORY"}
	    if (autocompterug == "PAR") {autocompterug = "ORY"}
	    if (autocompheen == "CDG") {autocompheen = "ORY"}
	    if (autocompterug == "CDG") {autocompterug = "ORY"}

	    var heenok = "false";
	    var	terugok = "false";
	    for (var i=0; i<TAarray.length; i++) {
		if(autocompheen == TAarray[i]) {
			heenok = "true";
		}
		if(autocompterug == TAarray[i]) {
			terugok = "true";
		}
	    }
 		if ((heenok == "true") && (terugok == "true")) {
			if (document.forms.OVform.selectOverig.value != "geen") {
	    	document.forms.OVform.s.value = document.forms.OVform.selectOverig.value;
	    	document.forms.OVform.v.value = autocompheen;
			document.forms.OVform.b.value = autocompterug;
			document.forms.OVform.hd.value = datumheenint;
			document.forms.OVform.td.value = datumterugint;
			document.forms.OVform.r.value = aantalreiz;
			document.forms.OVform.t.value = retourenkel;		
	        document.forms.OVform.submit();
		document.forms.OVform.action=document.forms.OVform.action + '1';
			Analytics(document.forms.OVform.selectOverig.value, autocompheen, autocompterug, datumheenint, datumterugint, aantalreiz, retourenkel);  
		   }
           else {
				alert("Selecteer ��n van de aanbieders");
		   }	
		
		
		}
		else {
			alert("Transavia vliegt niet op deze luchthaven");
	    }
	 } 		
	 else{
	  if (document.forms.OVform.selectOverig.value != "geen") {
	    	document.forms.OVform.s.value = document.forms.OVform.selectOverig.value;
	    	document.forms.OVform.v.value = autocompheen;
		document.forms.OVform.b.value = autocompterug;
		document.forms.OVform.hd.value = datumheenint;
		document.forms.OVform.td.value = datumterugint;
		document.forms.OVform.r.value = aantalreiz;
		document.forms.OVform.t.value = retourenkel;		
	        document.forms.OVform.submit();
		document.forms.OVform.action=document.forms.OVform.action + '1';
		Analytics(document.forms.OVform.selectOverig.value, autocompheen, autocompterug, datumheenint, datumterugint, aantalreiz, retourenkel);  
	   }
           else {
		alert("Selecteer ��n van de aanbieders");
	   }	
	  } 
	}




	
	}

	

	function Analytics(website, vertrk, bestem, hdat, tdat, rei, typ) {	
	  try{
           urchinTracker('/VV/doorklik/'+website+'/'+vertrk+'/'+bestem+'/'+hdat+'/'+tdat+'/'+rei+'/'+typ);
   	  } catch(er) {}
	}
		
		
		
		
		
		
		
		
            //SETTINGS:
            var retourdatumveranderd = "false";
            var firstload = -2;
            //var aantalmaanden = 12; //aantal maanden die in kalender worden meegenomen
            var aantaldagenvertrek = 14; //aantal dagen na vandaag die in de kalender standaard wordt geselecteerd voor heendatum
            var aantaldagenretour = 21; //aantal dagen na vandaag die in de kalender standaard wordt geselecteerd voor retourdatum
            var complete2 = false;
            var complete3 = false;
           var homeurl = "http://www.vliegticketsvergelijken.nl";

            var city = "";

            ///////////////////////////////////////////////////////////////
            var sebox1;
	    var klm_box1;
            var retourdatumbox1;
            var retourdatumtekstbox1;
            var currentTime = new Date();
            maand = currentTime.getMonth()+1;
            dag = currentTime.getDate();
            jaar = currentTime.getFullYear();
            maandT = 25;
            var currentheendatum = new Date();
            var currentterugdatum = new Date();
            currentheendatum.setDate(currentheendatum.getDate()+aantaldagenvertrek);
            currentterugdatum.setDate(currentterugdatum.getDate()+aantaldagenretour);
            var myRand;
            var clickdef = "false"; //om te kijken of plaatje moet worden gefreezed

            ////////////////////////////////////////////////////////////////////////

            chars = new Array ('0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z');
            charCount = chars.length;
            stringLength = 20;
            function mkRandomString() {
                i = 0;
                do {
                    random = Math.random();
                    random *= charCount;
                    random = Math.floor(random);
                    random = chars[random];
                    if (myRand == undefined) {
                        myRand = random;
                    }
                    else {
                        myRand = myRand + random;
                    }
                    i++;
                }
                while (i < stringLength);
            }
            mkRandomString();


            YAHOO.namespace("example.calendar");

            function handleSelect(type,args,obj) {
                var dates = args[0];
                var date = dates[0];
                var year = date[0], month = date[1], day = date[2];

                var selMonth = document.getElementById("selMonth");
                var selDay = document.getElementById("selDay");
                var selYear = document.getElementById("selYear");

                selMonth.selectedIndex = month-1;
                selDay.selectedIndex = day-1;

                for (var y = 0;y < selYear.options.length;y++) {
                    if (selYear.options[y].text == year) {
                        selYear.selectedIndex = y;
                        break;
                    }
                }
                //alert("Datum Selected: ");
                hideLayer("cal1Container");
                //zet de retourdatum op dezelfde datum als deze eerder is
                if ((retourdatumveranderd == "false") && (firstload > 0 )) {
                    var selMonthT = document.getElementById("selMonthT");
                    var selDayT = document.getElementById("selDayT");
                    var selYearT = document.getElementById("selYearT");
                    var selMonthvalue = parseInt(selMonth.options[selMonth.selectedIndex].value);
                    var selDayvalue = parseInt(selDay.options[selDay.selectedIndex].value);
                    var selYearvalue = parseInt(selYear.options[selYear.selectedIndex].innerHTML);
                    var selMonthTvalue = parseInt(selMonthT.options[selMonthT.selectedIndex].value);
                    var selDayTvalue = parseInt(selDayT.options[selDayT.selectedIndex].value);
                    var selYearTvalue = parseInt(selYearT.options[selYearT.selectedIndex].innerHTML)                    
                    if ( (selYearTvalue < selYearvalue) || ((selYearTvalue == selYearvalue) && (selMonthTvalue < selMonthvalue)) ||  ( (selYearTvalue == selYearvalue)&&(selMonthTvalue == selMonthvalue)&&(selDayTvalue < selDayvalue) )  ) {
                        selMonthT.selectedIndex = month-1;
                        selDayT.selectedIndex = day-1;
                        for (var y = 0;y < selYearT.options.length;y++) {
                        if (selYearT.options[y].text == year) {
                            selYearT.selectedIndex = y;
                            break;
                        }
                        }
                        updateCalT("false");
                    }
                }
                firstload++; //om te kijken of de gebruiker de datum al een keer heeft veranderd
            }

            function handleSelectT(type,argsT,obj) {
                //retourdatumveranderd = "true";
                var datesT = argsT[0];
                var dateT = datesT[0];
                var yearT = dateT[0], monthT = dateT[1], dayT = dateT[2];

                var selMonthT = document.getElementById("selMonthT");
                var selDayT = document.getElementById("selDayT");
                var selYearT = document.getElementById("selYearT");

                selMonthT.selectedIndex = monthT-1;
                selDayT.selectedIndex = dayT-1;

                for (var y = 0;y < selYearT.options.length;y++) {
                    if (selYearT.options[y].text == yearT) {
                        selYearT.selectedIndex = y;
                        break;
                    }
                }
                //alert("Datum Selected: ");
                hideLayer("cal1ContainerT");
                firstload++; //om te kijken of de gebruiker de datum al een keer heeft veranderd
            }

            function updateCal(firstl) {
                //listener van de pulldownbox is geactiveerd.
                //zet de kalender op de juiste maand
                var selMonth = document.getElementById("selMonth");
                var selDay = document.getElementById("selDay");
                var selYear = document.getElementById("selYear");

                var month = parseInt(selMonth.options[selMonth.selectedIndex].value);
                var day = parseInt(selDay.options[selDay.selectedIndex].value);
                var year = parseInt(selYear.options[selYear.selectedIndex].innerHTML);

                if (! isNaN(month) && ! isNaN(day) && ! isNaN(year)) {
                    var date = month + "/" + day + "/" + year;

                    YAHOO.example.calendar.cal1.select(date);
                    YAHOO.example.calendar.cal1.cfg.setProperty("pagedate", month + "/" + year);
                    YAHOO.example.calendar.cal1.render();
                }
                //zet de retourdatum op dezelfde datum als deze eerder is
                  if ((retourdatumveranderd == "false") && (firstload > 0 )) {
                    var selMonthT = document.getElementById("selMonthT");
                    var selDayT = document.getElementById("selDayT");
                    var selYearT = document.getElementById("selYearT");
                    var selMonthvalue = parseInt(selMonth.options[selMonth.selectedIndex].value);
                    var selDayvalue = parseInt(selDay.options[selDay.selectedIndex].value);
                    var selYearvalue = parseInt(selYear.options[selYear.selectedIndex].value);
                    var selMonthTvalue = parseInt(selMonthT.options[selMonthT.selectedIndex].value);
                    var selDayTvalue = parseInt(selDayT.options[selDayT.selectedIndex].value);
                    var selYearTvalue = parseInt(selYearT.options[selYearT.selectedIndex].value);
                    if ( (selYearTvalue < selYearvalue) || ((selYearTvalue == selYearvalue) && (selMonthTvalue < selMonthvalue)) ||  ( (selYearTvalue == selYearvalue)&&(selMonthTvalue == selMonthvalue)&&(selDayTvalue < selDayvalue) )  ) {
                        selMonthT.selectedIndex = month-1;
                        selDayT.selectedIndex = day-1;
                        for (var y = 0;y < selYearT.options.length;y++) {
                        if (selYearT.options[y].text == year) {
                            selYearT.selectedIndex = y;
                            break;
                        }
                        }
                        updateCalT("false");
                    }
                }
                if (firstl == "true") {
                    firstload++; //om te kijken of de gebruiker de datum al een keer heeft veranderd
                }

            }
            

            function updateCalT(firstl) {
                //retourdatumveranderd = true;
                var selMonthT = document.getElementById("selMonthT");
                var selDayT = document.getElementById("selDayT");
                var selYearT = document.getElementById("selYearT");

                var monthT = parseInt(selMonthT.options[selMonthT.selectedIndex].value);
                var dayT = parseInt(selDayT.options[selDayT.selectedIndex].value);
                var yearT = parseInt(selYearT.options[selYearT.selectedIndex].innerHTML);

                if (! isNaN(monthT) && ! isNaN(dayT) && ! isNaN(yearT)) {
                    var dateT = monthT + "/" + dayT + "/" + yearT;

                    YAHOO.example.calendar.cal1T.select(dateT);
                    YAHOO.example.calendar.cal1T.cfg.setProperty("pagedate", monthT + "/" + yearT);
                    YAHOO.example.calendar.cal1T.render();
                }
                if (firstl == "true") {
                    firstload++; //om te kijken of de gebruiker de datum al een keer heeft veranderd
                }
            }

             function SwapImageRes() {
                 if (clickdef=="false") {
                        MM_swapImgRestore();
                 }
             }

             function SwapImage() {
                 if (clickdef=="false") {
                        MM_swapImage('Zoek','','images/button-zoek-down.gif',1);
                 }
             }


              function MM_swapImgRestore() { //v3.0
                var i,x,a=document.MM_sr;for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
              }

              function MM_preloadImages() { //v3.0
              var d=document;if(d.images){if(!d.MM_p) d.MM_p=new Array();
                   var i,j=d.MM_p.length,a=MM_preloadImages.arguments;for(i=0; i<a.length; i++)
                   if (a[i].indexOf("#")!=0){d.MM_p[j]=new Image;d.MM_p[j++].src=a[i];}}
              }

              function MM_findObj(n, d) { //v4.01
                    var p,i,x;if(!d) d=document;if((p=n.indexOf("?"))>0&&parent.frames.length) {
                    d=parent.frames[n.substring(p+1)].document;n=n.substring(0,p);}
                    if(!(x=d[n])&&d.all) x=d.all[n];for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
                    for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
                    if(!x && d.getElementById) x=d.getElementById(n);return x;
              }

              function MM_swapImage() { //v3.0
                   var i,j=0,x,a=MM_swapImage.arguments;var aant = a.length-2;document.MM_sr=new Array;for(i=0; i<aant; i+=3)
                   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x;if(!x.oSrc) x.oSrc=x.src;x.src=a[i+2];}
              }

            function init() {

		twdlength = window.location.search.length;
		if (twdlength > 33) {		
			stad = window.location.search.substring(6,(twdlength-33));
		}
		else {
			stad = window.location.search.substring(6,twdlength);
		}
		origstad = stad;
		for (i=0; i<stad.length; i++) {
			stad = stad.replace("-"," ");
		}
		stad = stad.replace("("," (");	
		
		stadklm_box = stad;
		if (stadklm_box.substring(stadklm_box.length-5,stadklm_box.length-4) == "("  ) { //airport code eraf
			stadklm_box = stadklm_box.substring(0,stadklm_box.length-6);
		}
                autocompterug = origstad;
		if(autocompterug.substring(autocompterug.length-1) == ")") {
			autocompterug = autocompterug.substring((autocompterug.length-4),(autocompterug.length-1)) ;
		}
		else {
			autocompterug = autocompterug.substring((0),(3)) ;
		}
		/*
		klm_boxd = document.getElementById('klm_box');
		klm_box1 = new YAHOO.widget.Overlay(klm_boxd, { width:"500px"} );
		klm_box1.setBody('<table><tr><td width="1">&nbsp;</td><td align="middle" height="50" class="PlainBOLD">Of ga direct naar: <a href="http://www.vliegticketsvergelijken.nl/red.php?s=KL&b='+autocompterug+'&v=AMS" target="_BLANK">www.klm.com/'+stadklm_box+'</a></td></tr></table>'); //<font color="#06aff0"> 
                if (stadklm_box.length > 0) {
	                klm_box1.render();
			klm_box1.show();
		} else {
			klm_box1.hide();
		}
		*/
		/*
		stadsebox = stad;
		if (stadsebox.substring(stadsebox.length-5,stadsebox.length-4) == "("  ) { //airport code eraf
			stadsebox = stadsebox.substring(0,stadsebox.length-6);
		}
		seboxd = document.getElementById('sebox');
		sebox1 = new YAHOO.widget.Overlay(seboxd, { width:"500px"} );
		sebox1.setBody('<table><tr><td width="1">&nbsp;</td><td align="middle" height="50" class="HeaderBOLD">Vergelijk vliegtickets naar '+stadsebox+':</td></tr></table>'); //<font color="#06aff0"> 
                if (stad.length > 0) {
	                sebox1.render();
			sebox1.show();
		} else {
			sebox1.hide();
		}

		*/
                retourdatumboxd = document.getElementById('retourdatumbox');
                retourdatumbox1 =new YAHOO.widget.Panel(retourdatumboxd, {width:"1px", constraintoviewport:false, fixedcenter: false, visible: true, draggable: false, underlay:"none"} );
                retourdatumbox1.setBody(' Retourdatum  <table width="258" border="0" cellpadding="0" cellspacing="0"><tr><td> <form name="datesT">                                            <select name="selDayT" id="selDayT" class="kalenderdag">                                                <option value="1">1</option>                                                <option value="2">2</option>                                                <option value="3">3</option>                                                <option value="4">4</option>                                                <option value="5">5</option>                                                <option value="6">6</option>                                                <option value="7">7</option>                                                <option value="8">8</option>                                                <option value="9">9</option>                                                <option value="10">10</option>                                                <option value="11">11</option>                                                <option value="12">12</option>                                                <option value="13">13</option>                                                <option value="14">14</option>                                                <option value="15">15</option>                                                <option value="16">16</option>                                                <option value="17">17</option>                                                <option value="18">18</option>                                                <option value="19">19</option>                                                <option value="20">20</option>                                                <option value="21">21</option>                                                <option value="22">22</option>                                                <option value="23">23</option>                                                <option value="24">24</option>                                                <option value="25">25</option>                                                <option value="26">26</option>                                                <option value="27">27</option>                                                <option value="28">28</option>                                                <option value="29">29</option>                                                <option value="30">30</option>                                                <option value="31">31</option>                                            </select>                                            <select id="selMonthT" name="selMonthT" class="kalenderdag">                                                <option value="1"> januari </option>                                                <option value="2"> februari</option>                                                <option value="3"> maart </option>                                                <option value="4">  april  </option>                                                <option value="5">    mei   </option>                                                <option value="6">   juni   </option>                                                <option value="7">  juli   </option>                                                <option value="8">  augustus    </option>                                                <option value="9">   september    </option>                                                <option value="10">   oktober   </option>                                                <option value="11">   november   </option>                                                <option value="12">   december      </option>                                            </select>                                            <select name="selYearT" id="selYearT" class="kalenderdag">                                                <option value="1">2006</option>                                                <option value="2">2007</option>                                            </select>                                            <img src="images/kalender3.gif" width="22" height="17" id="show3upT" style="cursor: pointer; border: 0px solid green;" title="Date selector"                                                 onmouseover="this.style.background=\'#0099ff\';" onmouseout="this.style.background=\'\'" onclick="javascript:showLayer(\'cal1ContainerT\')"/>                                        </form></td></tr></table>');
                retourdatumbox1.render();
                retourdatumbox1.show();
                //YAHOO.example.container.manager = new YAHOO.widget.OverlayManager();
                //YAHOO.example.container.manager.register([retourdatumbox1]);

         /*       retourdatumtekstboxd = document.getElementById('retourdatumtekstbox');
               retourdatumtekstbox1 =new YAHOO.widget.Panel(retourdatumtekstboxd, { width:"1px", constraintoviewport:false, fixedcenter: false, visible: true, draggable: false, underlay:"none" } );
                retourdatumtekstbox1.setBody('<table width="258" border="0" cellpadding="0" cellspacing="0"><tr><td>Retourdatum</td></tr></table>');
                retourdatumtekstbox1.render();
                retourdatumtekstbox1.show(); */

                contrRetourEnkelBegin();

                SetDatumInitieel();

		YAHOO.example.calendar.cal1 = new YAHOO.widget.CalendarGroup("cal1","cal1Container", {pages:2, mindate:maand+"/"+dag+"/"+jaar ,maxdate:maandT+"/"+0+"/"+jaar,title: "Selecteer een datum", close:true} );  //parseInt(maand+13)
                YAHOO.example.calendar.cal1T = new YAHOO.widget.CalendarGroup("cal1T","cal1ContainerT", {pages:2, mindate:maand+"/"+dag+"/"+jaar ,maxdate:maandT+"/"+0+"/"+jaar,title:"Selecteer een datum", close:true} );
                
                YAHOO.example.calendar.cal1.selectEvent.subscribe(handleSelect, YAHOO.example.calendar.cal1, true);
                YAHOO.example.calendar.cal1T.selectEvent.subscribe(handleSelectT, YAHOO.example.calendar.cal1T, true);
                YAHOO.example.calendar.cal1.cfg.setProperty("MONTHS_LONG",["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"]);
                YAHOO.example.calendar.cal1.cfg.setProperty("WEEKDAYS_SHORT",["Zo","Ma","Di","Wo","Do","Vr","Za"]);
                YAHOO.example.calendar.cal1T.cfg.setProperty("MONTHS_LONG",["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"]);
                YAHOO.example.calendar.cal1T.cfg.setProperty("WEEKDAYS_SHORT",["Zo","Ma","Di","Wo","Do","Vr","Za"]);
                // Listener to show the 3-up Calendar when the button is clicked
                YAHOO.util.Event.addListener("show3up", "click", YAHOO.example.calendar.cal1.show, YAHOO.example.calendar.cal1, true);
                YAHOO.util.Event.addListener("show3upT", "click", YAHOO.example.calendar.cal1T.show, YAHOO.example.calendar.cal1T, true);
                //YAHOO.example.calendar.cal1.cfg.setProperty("DATE_FIELD_DELIMITER", "/");
                //YAHOO.example.calendar.cal1.cfg.setProperty("MDY_DAY_POSITION", 1);
                //YAHOO.example.calendar.cal1.cfg.setProperty("MDY_MONTH_POSITION", 2);
                //YAHOO.example.calendar.cal1.cfg.setProperty("MDY_YEAR_POSITION", 3);
                YAHOO.example.calendar.cal1.render();
                YAHOO.example.calendar.cal1T.render();

                YAHOO.util.Event.addListener(["selMonth","selDay","selYear"], "change", updateCal);
                YAHOO.util.Event.addListener(["selMonthT","selDayT","selYearT"], "change", updateCalT);
                updateCal("true");
                updateCalT("true");
                retourdatumveranderd = "false";
                YAHOO.example.ACFlatData.init();
                //document.getElementById("ysearchinput3").focus();

                var kl = new YAHOO.util.KeyListener(document, {keys:13},
                {fn:submitGedaan} );
                kl.enable();
                if (stad.length > 0) {
                    //document.getElementById('ysearchinput3').value=stad;   //alleen als automcomp aan staat
			stadcode = autocompterug ; //is code 
			var selectjava = document.selectform.selectbestemming;
				for ( var i = 0; i < selectjava.options.length; i++) {
				     if (selectjava.options[i].value == stadcode) {
				     	selectjava.options[i].selected = true;
				     }
				}

                }
            }
            YAHOO.util.Event.onDOMReady(init);

            function hideLayer(layerName)
            {
                if (document.layers){ //ns4

                    document.layers[layerName].visibility = "hide";

                } else if (document.getElementById){ //ie4

                    document.getElementById(layerName).style.visibility="hidden";
                    document.getElementById(layerName).style.display='none';
                }
            }

            function submitGedaan() {
                checksubmitform();
            }

            function showLayer(layerName)
            {
                if (document.layers){ //ns4
                    if (document.layers[layerName]) {
                        document.layers[layerName].visibility = "show";
                        document.layers[layerName].left = window.innerWidth/2 -134;
                    }

                } else if (document.getElementById){ //ie4, NS6
                    document.getElementById(layerName).style.visibility='visible';
                    document.getElementById(layerName).style.display='';
                }
            }

            function SetDatumInitieel() {


                //jaren gaan veranderen in de selYear in form op pagina:
                var jaar1 = jaar;
                var jaar2 = jaar+1;
                document.dates.selYear.options[0]=new Option(jaar1);
                document.dates.selYear.options[1]=new Option(jaar2);

                document.datesT.selYearT.options[0]=new Option(jaar1);
                document.datesT.selYearT.options[1]=new Option(jaar2);

                maandheen = currentheendatum.getMonth() ;
                dagheen = currentheendatum.getDate();
                jaarheen = currentheendatum.getFullYear();

                maandterug = currentterugdatum.getMonth() ;
                dagterug = currentterugdatum.getDate();
                jaarterug = currentterugdatum.getFullYear();

                document.dates.selDay.selectedIndex = dagheen-1;
                
                document.dates.selMonth.selectedIndex = maandheen;
                if (jaar1 == jaarheen) {
                    document.dates.selYear.selectedIndex = (0);
                }
                else {
                    document.dates.selYear.selectedIndex = (1);
                }

                document.datesT.selDayT.selectedIndex = dagterug-1;
                document.datesT.selMonthT.selectedIndex = maandterug;
                if (jaar1 == jaarterug) {
                    document.datesT.selYearT.selectedIndex = (0);
                }
                else {
                    document.datesT.selYearT.selectedIndex = (1);
                }
            }

            function checksubmitform(agent){

                autocompheen = document.getElementById('ysearchinput2').value; //document.selectformvertrek.selectvertrek.value; // document.getElementById("ysearchinput2").value;
            	autocompterug =	document.getElementById('ysearchinput3').value; //document.selectform.selectbestemming.value;			 //   autocompterug = document.getElementById("ysearchinput3").value;
                dagheen = document.dates.selDay.value;
                maandheen = document.dates.selMonth.value;
                var selYear = document.getElementById("selYear");
                jaarheen = selYear.options[selYear.selectedIndex].innerHTML;
                dagterug = document.datesT.selDayT.value;
                maandterug = document.datesT.selMonthT.value;
                var selYearT = document.getElementById("selYearT");
                jaarterug = selYearT.options[selYearT.selectedIndex].innerHTML;
                maandheenint = maandheen;
                maandterugint = maandterug;
                if (maandheen.length <2) {
                    maandheen = "0"+maandheen;
                }
                if (maandterug.length <2) {
                    maandterug = "0"+maandterug;
                }
                dagheenint = dagheen;
                dagterugint = dagterug;
                if (dagheen.length <2) {
                    dagheen = "0"+dagheen;
                }
                if (dagterug.length <2) {
                    dagterug = "0"+dagterug;
                }
                datumheenstr = jaarheen +"/"+ maandheen +"/"+ dagheen;
                datumterugstr = jaarterug +"/"+ maandterug +"/"+ dagterug; 	//  YYYY/MM/DD
                datumheenint = parseInt(jaarheen + maandheen + dagheen);
                datumterugint = parseInt(jaarterug + maandterug + dagterug); //YYYMMDD
                datumheen = datumheenstr;
                datumterug = datumterugstr;

                for (i=0; i<2; i++) {
                    if(document.radiobutton.radio1[i].checked){
                        waarde = document.radiobutton.radio1[i].value;
                        break;
                    }
                }
                retourenkel = waarde;
                aantalreiz = document.reizigers.adults.value;              
				//prefnonstop = document.reizigers.nonstop.checked;  //false : geen non-stop geprefereed
				prefnonstop = false;
                //aantalkin = 0  //aantalbab = 0

                var isok = true;
				if(  !(autocompheen.substring(autocompheen.length-1) == ")") &&  !(autocompheen.substring(4,5) == "-")) {
				     alert("Vul a.u.b. een geldige vertrekstad in");
                    //alert("Vul a.u.b. een geldige vertrekstad in");
                    isok = false;				
				}
				if(  !(autocompterug.substring(autocompterug.length-1) == ")") &&  !(autocompterug.substring(4,5) == "-") ) {
				     alert("Vul a.u.b. een geldige bestemming in");
                    //alert("Vul a.u.b. een geldige bestemming in");
                    isok = false;				
				}					
                if ((autocompheen.length < 3) && (isok == true)){
                    alert("Vul a.u.b. een geldige vertrekstad in");
                    //alert("Vul a.u.b. een geldige vertrekstad in");
                    isok = false;

                }
                if ((autocompterug.length < 3) && (isok == true)){
                    alert("Vul a.u.b. een geldige bestemming in");
                    //alert("Vul a.u.b. een geldige bestemming in");
                    isok = false;

                }
                if (!checkdate( maandheenint, dagheenint, parseInt(jaarheen) )){
                    alert("Vul a.u.b. een geldige heendatum in");
                    //alert("Vul a.u.b. een geldige heendatum");
                    isok = false;

                }
                if (!checkdate( maandterugint, dagterugint, parseInt(jaarterug) )){
                    //alert("Vul a.u.b. een geldige retourdatum");
                    alert("Vul a.u.b. een geldige retourdatum in");
                    isok = false;

                }
                if (datumheenint > datumterugint) {
                    //alert("De retourdatum moet later zijn dan de vertrekdatum");
                    alert("De retourdatum moet later zijn dan de vertrekdatum");
                    isok = false;

                }

                if(isok == true){
					voerUitPost(agent);
				
				/*
                    document.getElementById('Zoek').src='images/button-zoek-clicked.gif';
                    clickdef="true"; //nu kan het plaatje niet meer worden veranderd
                    autocompheene = escape(autocompheen);
                    autocompteruge = escape(autocompterug);
                    datumheene = escape(datumheen);
                    datumteruge = escape(datumterug);
                    retourenkele = escape(retourenkel);
                    aantalreize = escape(aantalreiz);
                    prefnonstope = "false";
                    taal ="nl";
                    postdat = "autocompheen="+autocompheene+"&autocompterug="+autocompteruge+"&datumheen="+datumheene+"&datumterug="+datumteruge+"&retourenkel="+retourenkele+"&aantalreiz="+aantalreize+"&aantalkin=0"+"&aantalbab=0"+"&prefnonstop="+prefnonstope+"&uq="+myRand+"&lan="+taal;
                    //aantalkin = 0  //aantalbab = 0
                    voerUit(postdat);*/

        } else {
            //alert("Helaas ging er iets fout");
        }
    }


    function checkdate( month, day, year ) {
        var myDate = new Date();
        myDate.setFullYear( year, (month - 1), day );
        return ( (myDate.getMonth()+1) == month );
    }

    var veldleeginit = 0;
    function veldleegmaken() {
        if (veldleeginit == 0) {
            document.getElementById('ysearchinput2').value='';
            veldleeginit++;

        }
    }

    function DoeSuggestie(suggestie) {
       //document.getElementById('ysearchinput2').value=suggestie;
    }

    function DoeSuggestieT(suggestie) {
       //document.getElementById('ysearchinput3').value=suggestie;
    }

    function eenSuggestieT(suggestie) {
      /*     document.getElementById('Zoek').src='images/button-zoek-up.gif'; //zet plaatje terug
           clickdef = "false";
           document.getElementById('ysearchinput3').value="";
           suggestiecode = '<a href="#"  onclick="DoeSuggestieT('+suggestie+')">'+suggestie+'</a>';
           doeMelding('De bestemming is niet gevonden. Bedoelde u <a href="#"  onclick="DoeSuggestieT(\''+suggestie+'\')">'+suggestie+'</a> ?','zwart'); */

    }

    function voerUit(postdat) {
        var postData = postdat;
        var sUrl = homeurl + "/prepare-request.php";
        var request = YAHOO.util.Connect.asyncRequest('POST', sUrl, callback, postData);   ///////STOND OP POST!!!!
    }

    var handleSuccess = function(o){
        var root = o.responseXML.documentElement;
        var status = root.getElementsByTagName('description')[0].getAttribute('status');  //als status == 1 dan okay
        if (status == "1") {
            voerDefinitiefUit();


           //suggestie = "AMS - All Airports";
           //eenSuggestieT(suggestie);
           
           
        }
        if (status == "0") {
            document.getElementById('Zoek').src='images/button-zoek-up.gif'; //zet plaatje terug
            clickdef = "false";
            var errorcode = root.getElementsByTagName('description')[0].getAttribute('errorcode');
            if (errorcode == "1") {
                doeMelding("Er is geen verbinding met de server mogelijk. Probeert u het later nogmaals.","rood");
            }
            if (errorcode == "2") {
                doeMelding("De opgegeven vertrekstad kan niet worden gevonden.","rood");
            }
            if (errorcode == "3") {
                doeMelding("De opgegeven bestemming kan niet worden gevonden.","rood");
            }
            if (errorcode == "4") {
                doeMelding("De opgegeven vertrekdatum is niet juist.","rood");
            }
            if (errorcode == "5") {
                doeMelding("De opgegeven retourdatum is niet juist.","rood");
            }
            if (errorcode == "6") {
                doeMelding("De vertrekdatum moet later zijn dan de retourdatum.","rood");
            }
            if (errorcode == "7") {
                doeMelding("De vertrekstad moet anders zijn dan de bestemming.","rood");
            }
        }
    }

    var handleFailure = function(o){
        document.getElementById('Zoek').src='images/button-zoek-up.gif'; //zet plaatje terug
        clickdef = "false";
        doeMelding("Er is geen verbinding met de server mogelijk. Probeert u het later nogmaals.","rood");
    }

    var callback =
        {
        success:handleSuccess,
        failure: handleFailure,
        argument: ['foo','bar']
    };

    function voerDefinitiefUit() {
        document.submitform.uq.value = myRand;
        document.submitform.submit();
    }

    function doeMelding(melding,kleur) {
        if (kleur == "rood") {
            document.getElementById("foutm").innerHTML = "<table width='700' border='0' align='center'><p>&nbsp;</p><font color='red' size='2'><b>"+melding+"</b></font></table>";
        }
        if (kleur == "zwart") {
            document.getElementById("foutm").innerHTML = "<table width='700' border='0' align='center' zwart_standaard><p>&nbsp;</p>"+melding+"</table>";
        }
}

    function contrlett2() {
        tekststring = document.getElementById('ysearchinput2').value;
        if (tekststring.length < 3) {
            complete2 = false;
        }
        else {
            complete2 = true;
        }
    }
    function contrlett3() {
        tekststring = document.getElementById('ysearchinput3').value;
        if (tekststring.length < 3) {
            complete3 = false;
        }
        else {
            complete3 = true;
        }
    }

    function verwijderTerugdatum() {

    retourdatumbox1.hide();
    //retourdatumtekstbox1.hide();

    }

function zetTerugdatum() {
    retourdatumbox1.show();
    //retourdatumtekstbox1.show();
}

function contrRetourEnkelBegin() {
    var RetourEnkelInitieel;
    for (i=0; i<2; i++) {
       if(document.radiobutton.radio1[i].checked){
        RetourEnkelInitieel = document.radiobutton.radio1[i].value;
        break;
       }
    }
    if (RetourEnkelInitieel == "Enkel") {
            retourdatumbox1.hide();
           // retourdatumtekstbox1.hide();

    }   
}


function changebestemming(best) {
	//document.getElementById('ysearchinput3').value= document.forms.selectform.selectbestemming.value;


}
