addLoadEvent(initHoverHelp);
  	addEvent(document.getElementById('body_type_id'), 'change', body_type_id_change, false);
  	addEvent(document.getElementById('make_name'),'change', make_name_change, false);
	addEvent(document.getElementById('model_year_from'),'change', model_year_from_change, false);
  	initSearch();
	//addEvent(document.getElementById('searchbutton'),'click', saveSearchInCookie, false);
	//addEvent(document.getElementById('resetsearch'),'click', deleteSearchCookie, false);
	function addZipcode()
	{
		zipcode = document.getElementById("newzipcode").value;
		if( !validateZipcode(zipcode) )
		{
			alert("Du har indtastet et ugyldigt postnummer.\nDet skal beste af 4 cifre");
			//return false;
		}
		
		document.getElementById("zipcode").value = zipcode;
		document.getElementById("enterzipcode").style.display="none";
		document.getElementById("searchform").submit();
		//return true;	
	}
	
	function model_year_from_change(ev) {
		select_from = document.getElementById("model_year_from");
		select_to = document.getElementById("model_year_to");
		selectedValue = select_from.options[select_from.selectedIndex].value;
		clear_options(select_to);
		select_to.options[0] = new Option("Til", "Til");
		var j=1;
		
		for( i=0; i<select_from.options.length; i++ ) {
			if( select_from.options[i].value >= selectedValue && select_from.options[i].value.length > 0 ) {
				select_to.options[j] = new Option(select_from.options[i].text, select_from.options[i].value);
				j += 1;
			}
		}
	}
	
	function setValueOnFocusLost(element, textToSet) {
		if( trim(element.value).length == '') {
			element.value = textToSet;
		}
	}

	function clearDefaultValueOnFocus( element, defaultValue ) {
		if( trim(element.value).toLowerCase() == defaultValue.toLowerCase() ) {
			element.value = "";
		}
	}