$(document).ready(function(){
	//Logo
	window.setTimeout(function(){$('.logo_alternative').hide();}, 1000);
	window.setTimeout(function(){$('.logo').show();}, 1000);
	
	
	//Red
	$('.vacancy_background').mouseover(function(){
		$(this).css("background","#ffd8d8");
	});
	$('.vacancy_background').mouseout(function(){
		$(this).css("background","");
	});
	$('.vacancy_background').click(function(){
		var url = $(this).attr("rel-vacancy-url");
		window.location.href = url;
	});
	$('.news_background').mouseover(function(){
		$(this).css("background","#ffd8d8");
	});
	$('.news_background').mouseout(function(){
		$(this).css("background","");
	});
	$('.agenda_background').mouseover(function(){
		$(this).css("background","#ffd8d8");
	});
	$('.agenda_background').mouseout(function(){
		$(this).css("background","");
	});
	$('.news_background').click(function(){
		var url = $(this).attr("rel-news-url");
		window.location.href = url;
	});
	$('.location_background').mouseover(function(){
		$(this).css("background","#ffd8d8");
	});
	$('.location_background').mouseout(function(){
		$(this).css("background","");
	});
	$('.location_background').click(function(){
		var url = $(this).attr("rel-location-url");
		window.location.href = url;
	});
	
	
	//Blue
	$('.vacancy_background_blue').mouseover(function(){
		$(this).css("background","#d5f1ff");
	});
	$('.vacancy_background_blue').mouseout(function(){
		$(this).css("background","");
	});
	$('.vacancy_background_blue').click(function(){
		var url = $(this).attr("rel-vacancy-url");
		window.location.href = url;
	});
	$('.news_background_blue').mouseover(function(){
		$(this).css("background","#d5f1ff");
	});
	$('.news_background_blue').mouseout(function(){
		$(this).css("background","");
	});
	$('.agenda_background_blue').mouseover(function(){
		$(this).css("background","#d5f1ff");
	});
	$('.agenda_background_blue').mouseout(function(){
		$(this).css("background","");
	});
	$('.news_background_blue').click(function(){
		var url = $(this).attr("rel-news-url");
		window.location.href = url;
	});
	$('.location_background_blue').mouseover(function(){
		$(this).css("background","#d5f1ff");
	});
	$('.location_background_blue').mouseout(function(){
		$(this).css("background","");
	});
	$('.location_background_blue').click(function(){
		var url = $(this).attr("rel-location-url");
		window.location.href = url;
	});
	
	
	$('#sq').keyup(function(event) { if(event.keyCode=='13') { $('#sq_btn').click(); } } );
	$('#sq_btn').click(function(){ document.location=$(this).attr('rel-searchurl')+$('#sq').val(); });	
	
	$('.solliciteer_btn').click(function(){
		var url = $(this).attr("rel-vacancy-url");
		window.location.href = url;
	});
	
	$('#img_thumb_1').mouseover(function(){
		var border_color_active = $(this).attr("rel-img-border-color-active");
		var border_color = $(this).attr("rel-img-border-color");
		
		$("#img_box_1").show();
		$("#img_box_2").hide();
		$("#img_box_3").hide();
		
		$('.li_thumb_1').css("border","1px solid #" + border_color_active);
		$('.li_thumb_2').css("border","1px solid #" + border_color);
		$('.li_thumb_3').css("border","1px solid #" + border_color);
	});
	$('#img_thumb_2').mouseover(function(){
		var border_color_active = $(this).attr("rel-img-border-color-active");
		var border_color = $(this).attr("rel-img-border-color");
		
		$("#img_box_1").hide();
		$("#img_box_2").show();
		$("#img_box_3").hide();
		
		$('.li_thumb_2').css("border","1px solid #" + border_color_active);
		$('.li_thumb_1').css("border","1px solid #" + border_color);
		$('.li_thumb_3').css("border","1px solid #" + border_color);
	});
	$('#img_thumb_3').mouseover(function(){
		var border_color_active = $(this).attr("rel-img-border-color-active");
		var border_color = $(this).attr("rel-img-border-color");
		
		$("#img_box_1").hide();
		$("#img_box_2").hide();
		$("#img_box_3").show();
		
		$('.li_thumb_3').css("border","1px solid #" + border_color_active);
		$('.li_thumb_1').css("border","1px solid #" + border_color);
		$('.li_thumb_2').css("border","1px solid #" + border_color);
	});
	
	
	$('.nl_name').focus(function(){
		var content = $(this).val();
		if(content != "Naam"){ $(this).val(content); } else { $(this).val(''); }
	});
	
	$('.nl_name').blur(function(){
		var content = $(this).val();
		if(content != ""){ $(this).val(content); } else { $(this).val('Naam'); }
	});
	
	$('.nl_email').focus(function(){
		var content = $(this).val();
		if(content != "Email"){ $(this).val(content); } else { $(this).val(''); }
	});
	
	$('.nl_email').blur(function(){
		var content = $(this).val();
		if(content != ""){ $(this).val(content); } else { $(this).val('Email'); }
	});
	
	var active_news_link = false;
	$('.news_link').click(function(){
		var related_div = $(this).attr("rel-newsitems-div");
		if(!active_news_link) {
			$('#'+related_div).show();
			active_news_link = true;
		} else {
			$('#'+related_div).hide();
			active_news_link = false;
		}
	});
	
	
	$('img').bind("contextmenu", function(e) {
		e.preventDefault();
	});
});
