var activate = true;
var provid = 'nee';
function ChangeColor(id, color)
{
	document.getElementById(id).style.color = color;
}

function ChangeColorBack(id, color)
{
	document.getElementById(id).style.color = color;
}


function popitup(url, height, width)
{
	newwindow=window.open(url,'name','height='+height+',width='+width+',menubar=yes,status=yes,toolbar=yes,scrollbars=yes');
	if (window.focus) {newwindow.focus()}
	return false;
}


$(document).ready(function()
{
	
	
	(function($){
	$.fn.clearDefault = function(){
	    return this.each(function(){
	        var default_value = $(this).val();
	        $(this).focus(function(){
	            if ($(this).val() == default_value) $(this).val("");
	        });
	        $(this).blur(function(){
	            if ($(this).val() == "") $(this).val(default_value);
	        });
	    });
	};
	})(jQuery);
	$('input.clear-default').clearDefault();
	$("#enqueteform").validate();
	$("#imgmapdiv area").hover(function(){	
		$(".test").removeClass("active");
		$(".test[provincieid='"+$(this).attr("provincieid")+"']").addClass("active");
		$(".provincies img").css("display", "none");
		$(".provincies div."+$(this).attr("id")+" img").css("display", "block");
		$(".provincies div."+$(this).attr("id")+" img").css("margin-top", "-231px");
	});
	$("#imgmapdiv area").mouseout(function(){	
	
		//$(".test").removeClass("active");
		
	});
	
	$("#imgmapdiv area, .provincielist li").click(function(e){	
		if(provid == 'ja')
			e.preventDefault();
			
		$("#imgmapdiv area, .provincielist li").removeClass('active');
		$(this).addClass('active');
		$("#imgmapdiv area[provincieid='5']").addClass('active');
		var provincie = $(this).attr("provincieid");
		$.get('/custom.php?request=returnPlaatsen&provID=' + provincie, function(data1){
			$(".stap3content").html("");
			$(".stap2content").html(data1);
		});		
		
	});
	
	
	$(".stap1enquete").click(function()
	{
		$("li.ui-state-default a[href='#tabs-2']").click();
	});
	
	$(".stap2enquete").click(function()
	{
		$("li.ui-state-default a[href='#tabs-3']").click();
	});
	
	
	$("a.leesmeer").html("<br /><img class='leesmeer' src='/images/siteimages/meer.png' onmouseout=\"this.src = '/images/siteimages/meer.png'\" onmouseover=\"this.src ='/images/siteimages/meer.png'\" alt='lees meer' />");
	$(".cursusoverzicht li").live("click", function() {
		var cursusID = $(this).attr("cursusID");
		$(".cursusoverzicht li").removeClass("active");
		$(".cursusoverzicht li[cursusid='"+cursusID+"']").addClass("active");
		
		$.get('/custom.php?request=returnInformatie&cursusID=' + cursusID, function(data1){
			$(".stap3content").html(data1);
		});
	});
	
	$(".addpollbutton").click(function() {
		
		alert('Let op: Wanneer u een nieuwe poll toevoegt (Opslaan) wordt de oude poll verwijderd.')
	});
		
	
});
