

$(document).ready(function (){
	var formZoekenStandaard = document.getElementById('formZoeken').value;
	$('#formZoeken').focus(function(){
		if(this.value == formZoekenStandaard){ this.value = ''; }
	}).blur(function(){
		if(this.value == ''){ this.value = formZoekenStandaard; }
	});
});

function ToonMelding(Pagina){
	$('#DivAlertBoxAchtergrond').css({ height : $(document).height(), width : $(document).width() });
	$('#DivAlertBoxAchtergrond').fadeIn(200);
	
	var NieuweBreedteDiv = 600;
	var NieuweHoogteDiv = 200;
	
	var TopPos = ($(window).scrollTop() + 60);
	
	TopPositie = TopPos+'px';
	document.getElementById('DivAlertBoxContent').style.top = TopPositie;
	
	var LinkerPositie = (($(document).width() - NieuweBreedteDiv)/2);
	LinkerPositie = LinkerPositie+'px';
	document.getElementById('DivAlertBoxContent').style.left = LinkerPositie;
	
	LaadMeldingInDiv(Pagina, 'DivAlertBoxContent');
}

function LaadMeldingInDiv(option) {
	var urls = option;
	$.get(option, function(data){
		document.getElementById('DivAlertBoxContent').innerHTML = data;
		$('#DivAlertBoxAchtergrond').css({ backgroundColor: '#000', opacity: '0.7' }).fadeIn(200);
		FontReplaceAlert();
		$('#DivAlertBoxContent').fadeIn(300,function(){
			$('img[src$=.png]').ifixpng();
		});	
	});
}

function MeldingSluiten(Pagina){
	$('#DivAlertBoxContent').fadeOut(200);
	$('#DivAlertBoxAchtergrond').fadeOut(200);
}

function AanmeldenNieuwsbrief(){
	if(document.getElementById('EmailAdresNieuwsbrief').value == ''){
		document.getElementById('EmailAdresNieuwsbrief').style.backgroundColor = '#cc0000';
	} else {
		if(document.getElementById('NieuwsbriefAanmelden').checked == true){
			var AanAfmelden = '1';
		} else {
			var AanAfmelden = '2';
		}
		$.post('nieuwsbrief.php', { 'Email': document.getElementById('EmailAdresNieuwsbrief').value, 'GroepID' : document.getElementById('NieuwsbriefGebruikersGroepID').value, 'AanAfmelden' : AanAfmelden }, function(data){
			document.getElementById('DivNieuwsbrief').innerHTML = data;
		});
	}
}

var SwitchOpenOfDicht = '2';
function Switch(){
	if(SwitchOpenOfDicht == '2'){
		var Offset = $('.SwitchPlatform').offset();
		var OffsetTop = (Offset.top + 28);
		
		$('#SwitchContainer').css({ top : OffsetTop, left : Offset.left });
		$('#SwitchContainer').fadeIn(200);
		SwitchOpenOfDicht = '1';
	} else {
		$('#SwitchContainer').fadeOut(200);
		SwitchOpenOfDicht = '2';
	}
}

function ViewMap(){
	$('#SelectCountryBG').css({ height : $(document).height(), width : $(document).width() });
	$('#SelectCountryBG').fadeIn(200);
	
	var Offset = $('.Container').offset();

	$('#SelectCountry').css({ top : ($(window).scrollTop() + 60), left : Offset.left });
	$('#SelectCountry').fadeIn(300);
}

function SelectYourCountry(){
	$('#SelectCountryBG').css({ height : $(document).height(), width : $(document).width() });
	$('#SelectCountryBG').fadeIn(200);
	
	var Offset = $('.Container').offset();

	$('#SelectCountry').css({ top : ($(window).scrollTop() + 60), left : Offset.left });
	$('#SelectCountry').fadeIn(300);
}

function SelectedCountry(ISAID){
	$.post('selectcountry.php', { 'ISAID': ISAID }, function(data){
		document.getElementById('SCSelect').innerHTML = data;
	});
}
function ShowArea(ID){
	$('.AdresGebied').css({ 'display':'none' });
	$('#Gebied'+ID).css({ 'display':'block' });
	$('#DivAlertBoxAchtergrond').css({ height : $(document).height(), width : $(document).width() });
}
function SluitSC(){
	$('#SelectCountry').fadeOut(200);
	$('#SelectCountryBG').fadeOut(300);
}
function FontReplace(){
	Cufon.replace('h1', { fontFamily: 'Helvetica' });
	Cufon.replace('h2', { fontFamily: 'Helvetica' });
	Cufon.replace('.WhiteHeader', { fontFamily: 'Helvetica' });
	Cufon.replace('.TopNav li a', { fontFamily: 'Helvetica' });
	Cufon.replace('#LandSelect', { fontFamily: 'Helvetica' });
	Cufon.replace('.Header', { fontFamily: 'Helvetica' });
}
function FontReplaceAlert(){
	Cufon.replace('#DivPDInhoud .Header', { fontFamily: 'Helvetica' });
}
function FilterJobs(){
	var Locatie = document.getElementById('FilterLocation').value;
	var PartFulltime = document.getElementById('FilterPartFulltime').value;
	
	window.location.href = window.location.protocol + "//" + window.location.host + "" + window.location.pathname+'?FilterLocation='+Locatie+'&FilterPartFulltime='+PartFulltime;
}


