$(function(){
	
	$("form.postcodeC").submit(function(){
		var l = $("input",this).eq(0).val().length;
		if (l != 4) {
			alert("Ongeldige postcode.");
			return false;
		}
	});

$("dl","#menu").hover(
		function(){
			$("img",this).attr("src",hoverImage(1,$("img",this).attr("src")));
			
			if (!$(this).hasClass("active")) {
				$("dt", this).animate({
					backgroundColor: "#E9EAEC"
				}, {
					queue: false,
					duration: 300
				});
			}
			//$("dt",this).animate({backgroundColor:"#ff0000"},1000);
		},
		function(){
			$("img",this).attr("src",hoverImage(0,$("img",this).attr("src")));
			if (!$(this).hasClass("active")) {
				$("dt", this).animate({
					backgroundColor: "#FFFFFF"
				}, 250);
			}

		}
	);
});

function hoverImage(isHover,src){
	if (isHover) {
		return src.replace("_hover", "");
	} else {
		return src.replace(".gif", "_hover.gif");
	}
}
function zipFocus(i){
	if(i.value == "Postcode"){
		i.value = "";
	}		
	else{
		i.select();
	}
}
function zipBlur(i){
	if(i.value.length != 4)		i.value = "Postcode";
}
