<!--

var submitit = 0;
function checkForm() {
	if (submitit == 1) {
		alert("Search already submitted, please be patient!");
		return false;
	}
	submitit = 1;
	if (document.getElementById("zoekkey").value == "fromposition") {
		if (document.getElementById("zoekpos").value == "") {
			melding = "fill in departure position!";
			alert (melding);		
			submitit = 0;
			return false;	
		}
	}
	if (document.getElementById("zoekkey").value == "toposition") {
		if (document.getElementById("zoekpos2").value == "") {
			melding = "fill in arrival position!";
			alert (melding);		
			submitit = 0;
			return false;	
		}
	}
	if (document.getElementById("zoekkey").value == "from-toposition") {
		if (document.getElementById("zoekpos").value == "" && document.getElementById("zoekpos2").value == "") {
			melding = "fill in departure and/or arrival position!";
			alert (melding);		
			submitit = 0;
			return false;	
		}
		if (document.getElementById("zoekpos").value == "") {
			document.getElementById("zoekkey").value = "toposition";
			return true;
		}
		if (document.getElementById("zoekpos2").value == "") {
			document.getElementById("zoekkey").value = "fromposition";
			return true;
		}
	}
	if (document.getElementById("zoekkey").value == "from-toposition-X") {
		if (document.getElementById("zoekpos").value == "" || document.getElementById("zoekpos2").value == "") {
			melding = "fill in departure and arrival position!";
			alert (melding);		
			submitit = 0;
			return false;	
		}
	}
	return true;
}

function basiswaarde(datumh, datumi, form, myobj) {
//vertalen
	var frequentie="frequency";
	var alles="all";
	var vanland="fromcountry";
	var naarland="tocountry";
	var vannaarland="from-tocountry";
	var vanplaats="fromcity";
	var naarplaats="tocity";
	var vannaarplaats="from-tocity"
	var vanprovincie="fromprovince";
	var naarprovincie="toprovince";
	var vannaarprovincie="from-toprovince";
	var vanpositie="fromposition";
	var naarpositie="toposition";
	var vannaarpositie="from-toposition";
	var vannaarpositiep="from-toposition-X";
	var vertrekdatum="departuredate";
	var nieuw="new";
	var gewijzigd="modified";
	var reden="reason";

	var titellocatie = new Array();
	titellocatie[0] = "All current rides sorted by departure date.";
	titellocatie[1] = "Rides that depart within x-kilometer from street and/or postal code and/or city and/or state/county/province and/or country.";
	titellocatie[2] = "Rides that arrive within x-kilometer from street and/or postal code and/or city and/or state/county/province and/or country.";
	titellocatie[3] = "Rides that satisfy to fromposition and/or toposition.";
	titellocatie[4] = "Rides that lie in the rectangle formed by fromposition and toposition.";
	titellocatie[5] = "Rides that have your search text in the departure city of the ride.";
	titellocatie[6] = "Rides that have your search text in the arrival city of the ride.";
	titellocatie[7] = "Rides that satisfy to fromcity and tocity.";
	titellocatie[8] = "Rides that have your search text in the departure province of the ride.";
	titellocatie[9] = "Rides that have your search text in the arrival provinve of the ride.";
	titellocatie[10] = "Rides that satisfy to fromprovince and toprovince.";
	titellocatie[11] = "Rides that depart from the country that you selected.";
	titellocatie[12] = "Rides that arrive in the country that you selected.";
	titellocatie[13] = "Rides that satisfy to fromcountry and tocountry.";
	titellocatie[14] = "New rides since a specified date.";
	titellocatie[15] = "Modified rides since a specified date.";
	titellocatie[16] = "Rides that depart after a specified date.";
	titellocatie[17] = "Rides that satisfy to a specified frequency";
	titellocatie[18] = "Rides that have your search text in reason.";
	
//einde vertalen

	document.getElementById('deel1').style.visibility='hidden'
	document.getElementById('deel1a').style.visibility='hidden'
	document.getElementById('deel1b').style.visibility='hidden'
	document.getElementById('deel2').style.visibility='hidden'
	document.getElementById('deel3').style.visibility='hidden'
	document.getElementById('deeldtm').style.visibility='hidden'
	document.getElementById('deelvl').style.visibility='hidden'
	document.getElementById('deelnl').style.visibility='hidden'
	document.getElementById('deelpos1a').style.visibility='hidden'
	document.getElementById('deelpos1b').style.visibility='hidden'
		
	var selkeuze = myobj.selectedIndex;
	document.getElementById('zoekkey').title=titellocatie[selkeuze];

	if (form.zoekkey.value == frequentie) {
		document.getElementById('deel2').style.visibility='visible'
		return
	}
	
	if (form.zoekkey.value == alles) {
		return
	}

	if (form.zoekkey.value == vanland || form.zoekkey.value == vannaarland) {
		document.getElementById('deelvl').style.visibility='visible';
	}
	if (form.zoekkey.value == naarland || form.zoekkey.value == vannaarland) {
		document.getElementById('deelnl').style.visibility='visible';
		return
	}

	if (form.zoekkey.value == vanplaats || form.zoekkey.value == vannaarplaats || form.zoekkey.value == vanprovincie || form.zoekkey.value == vannaarprovincie) {
		document.getElementById('deel1a').style.visibility='visible';
	}	
	if (form.zoekkey.value == naarplaats || form.zoekkey.value == vannaarplaats || form.zoekkey.value == naarprovincie || form.zoekkey.value == vannaarprovincie) {
		document.getElementById('deel1b').style.visibility='visible';
		return
	}

	if (form.zoekkey.value == vanpositie || form.zoekkey.value == vannaarpositie || form.zoekkey.value == vannaarpositiep) {
		document.getElementById('deelpos1a').style.visibility='visible';
	}
	if (form.zoekkey.value == naarpositie || form.zoekkey.value == vannaarpositie || form.zoekkey.value == vannaarpositiep) {
		document.getElementById('deelpos1b').style.visibility='visible';
	}		

	if (form.zoekkey.value == vertrekdatum || form.zoekkey.value == nieuw || form.zoekkey.value == gewijzigd) {
		document.getElementById('deel3').style.visibility='visible';
		document.getElementById('deeldtm').style.visibility='visible';
		
		if (form.zoekdatum.value.length != 10) {
			if (datumi == "") {
				form.zoekdatum.value = datumh.substring(8,10)+"-"+datumh.substring(5,7)+"-"+datumh.substring(0,4);
			}	
			else {
				form.zoekdatum.value = datumi.substring(8,10)+"-"+datumi.substring(5,7)+"-"+datumi.substring(0,4);
			}
		}
		return
	}
	
	if (form.zoekkey.value == reden) {
		document.getElementById('deel1').style.visibility='visible';
		return
	}
	
}

//-->
