$(document).ready(function(){
	$(".toplink").click(function(){ $("html, body").animate({scrollTop:0}, "slow"); return false; }); //scroll animated if clicked .toplink
	$("#search #fsearchsite").addClass("notfilled").attr("value", "Zoek in deze site"); //Voeg trefwoord waarde toe aan zoek veld
	$("#search #fsearchsite").focus(function(){ if($(this).attr("value") == "Zoek in deze site"){   //Zoek waarde default show
			$(this).attr("value", ""); $(this).removeClass("notfilled");
		} 
	}).blur(function(){ if($(this).attr("value") == ""){ //Zoek waarde default hide
			$(this).attr("value", "Zoek in deze site"); $(this).addClass("notfilled"); 
		} 
	}); 
	$("#nav ul li a").hover(function(){
		var thisClass = $(this).attr("class");
		$(this).parent().parent().parent().addClass(thisClass);
	},function(){
		var thisClass = $(this).attr("class");
		$(this).parent().parent().parent().removeClass(thisClass);
	});
	/* checks for aanmeldform */
	$(".aanmeldform .bereikbaarcheck label:first-child").append(" <span class=\"req\">verplicht</span>");
	$("input[name='bereikbaar']").change( function() { // Als radio wijzigt, geef dan label verplicht
		$(".telefooncheck label .req, .emailcheck label .req").remove();
		if($(this).val() == "telefoon"){  $(".aanmeldform .telefooncheck label").append(" <span class=\"req\">verplicht</span>"); }
		if($(this).val() == "email"){  $(".aanmeldform .emailcheck label").append(" <span class=\"req\">verplicht</span>"); }
	});
	
	function handle_polls()
	{
		$("#pollform").submit(function()
		{
			if (!$(".choise:checked", this).val()) // alert als niks ingevuld
			{
				alert("Maak eerst een keuze");
				return false;
			}
			else // stand inladen
			{
				this.pid = $("#pollval").val();
				$(this).load('/includes/inc_poll.php?pollid=' + this.pid + '&poll_'+ this.pid + '=' + $(".choise:checked", this).val());
				return false;
			}
		});
	}
	
	
handle_polls();	
	
	
	
});



