$(function() 
{	
	$("a,area,map,object").bind("focus",function(){if($(this).blur)$(this).blur();});	// links blurren
	$(".email").each(function(){v=$(this).html().split('|');if(v[1]){m=v[0]+'@'+v[1];$(this).html('<a href="mailto:'+m+'" title="Send an e-mail">'+m+'</a>');}});
	
	$(".overlabel").each(function() { if ($(this).val()=='') { $(this).val($(this).attr("title")).css('color','#666').addClass('overlabel_inactief'); }});
	$(".overlabel").focus(function() { if ($(this).val()==$(this).attr("title")) { $(this).val('').css('color','').removeClass('overlabel_inactief'); }});
	$(".overlabel").blur(function() { if ($(this).val()=='') { $(this).val($(this).attr("title")).css('color','#666').addClass('overlabel_inactief'); }});		

	$(".menu a:not(.actief)").mouseover(function() { $(this).removeClass("pressed").addClass("mouseover"); })
	$(".menu a:not(.actief)").mouseout(function() { $(this).removeClass("pressed").removeClass("mouseover"); });
	$(".menu a:not(.actief)").mousedown(function() { $(this).removeClass("mouseover").addClass("pressed"); });
	$(".menu a:not(.actief)").mouseup(function() { $(this).addClass("mouseover").removeClass("pressed"); });

	if ($(".home #flashheader").size()>0) 
	{	
		var params = { allowScriptAccess: "always", wmode: "transparent" };
		swfobject.embedSWF("/swf/header.swf", "flashheader", "903", "146", "9.0.0","swf/expressInstall.swf",{},{params:params});
	}
	
	if ($("#gmap").size()>0)
	{			
		map = new GMap2(document.getElementById("gmap")); 
		map.setUIToDefault();
		
		locatie = new GLatLng(52.083067, 5.18339);	
		center = new GLatLng(52.08603318352452, 5.178594589233398);
		
		map.setCenter(center, 14); 
		//map.setMapType(G_HYBRID_MAP);	
		
		function addMarker(point) {
				
			map.addOverlay(new GMarker(point));
		}		
		
		addMarker(locatie);				
	}
	
	$(".berekenroute_knop").click(function()
	{
		if ($(".route_input").hasClass("overlabel_inactief")) { notices('error','Please enter your location'); return false; }
		adres = escape($(".route_input").val());
		
		dest_adres = 'Yalelaan 44, Utrecht, The Netherlands';

		
		window.open('http://maps.google.nl/maps?f=d&source=s_d&saddr='+adres+'&daddr='+dest_adres);
		
	});

	  	
});


