$(document).ready(function(){
	
	// bind mouseovers to items

	$(".hov").mouseover(function(){
		$(this).children("div.leesverder").css('background-color','#94b7a5');
		$(this).children("div.leesverder").children("a").css('color','#fff');
	});
	
	// bind mouseouts to items
	
	$(".hov").mouseout(function(){
		$(this).children("div.leesverder").css('background-color','#fff');
		$(this).children("div.leesverder").children("a").css('color','#999');
	});
	
	// bind mouseovers to items

	$(".leesverder").mouseover(function(){
		if (!$(this).hasClass('noLink')) {
			$(this).css('background-color', '#94b7a5');
			$(this).children("a").css('color', '#fff');
		}
	});
	
	// bind mouseouts to items
	
	$(".leesverder").mouseout(function(){
		if (!$(this).hasClass('noLink')) {
			$(this).css('background-color', '#fff');
			$(this).children("a").css('color', '#999');
		}
	});
	
	// bind mouseovers to li

	$(".lihov").mouseover(function(){
		$(this).css('background-color','#94b7a5');
		$(this).children("a").css('color','#fff');
		$(this).css('color','#fff');
	});
	
	// bind mouseouts to li
	
	$(".lihov").mouseout(function(){
		$(this).css('background-color','#fff');
		$(this).children("a").css('color','#333')
		$(this).css('color','#000');
	});
	
	// bind clicks to items
	
	$("[class~=hov]").click(function(){
		
		var link = $(this).children("div.leesverder").children("a").attr("href");
		
		// set it for '.item'
		
		window.location = link;
		
		$(this).children().click(function(){
			
			// and for all children of '.item' so that you can also click on <p>, <h1> etcetera
			
			window.location = link;
			
		});
		
	});
	
	// bind clicks to items
	
	$(".leesverder, .lihov").click(function(){
		
		if(!$(this).hasClass('noLink')){
			var link = $(this).children("a").attr("href");window.location = link;$(this).children().click(function(){window.location = link;});
		}
		
	});
	
	// add hand to items
	$(".leesverder, .lihov, [class~=hov]").each(function(){
		if(!$(this).hasClass('noLink')){
			$(this).css("cursor","pointer");
		}
	});
	
	$("[class~=hov]").children().css("cursor","pointer");
	
	// bind swap to icons

	$(".printer").mouseout(function(){
		$(this).attr('src','img/icons/printer_o.png');
	});

	$(".printer").mouseover(function(){
		$(this).attr('src','img/icons/printer.png');
	});

	$(".arrow").mouseout(function(){
		$(this).attr('src','img/icons/right_arrow_o.png');
	});

	$(".arrow").mouseover(function(){
		$(this).attr('src','img/icons/right_arrow.png');
	});
	
	// add mouseover color to tr
	

	// bind mouseovers to items

	$("tr").mouseover(function(){
		$(this).children("td").css('background-color','#d0e6db');
	});
	
	// bind mouseouts to items
	
	$("tr").mouseout(function(){
		$(this).children("td").css('background-color','#fff');
	});
	
	// bind clicks to articles
	
	$("table.overzicht tr").click(function(){
		
		var link = $(this).children("td.acts").children("a.arrow_a").attr("href");
		
		if(link!=undefined){
		
			window.location = link;
		
			$(this).children().click(function(){
			
				window.location = link;
			
			});
			
		}
		
	});
	
	$("table.overzicht td").css("cursor","pointer");
	$("table.overzicht td").children().css("cursor","pointer");
	
	// text box coloring
	$("input[type=text]").focus(function(){
		
		$(this).css('border','1px solid #5c9578');
		
	});
	
	$("input[type=text]").blur(function(){
		
		$(this).css('border','1px solid #444');
		
	});
	
	$(".themeclick").click(function(){
		cid = $(this).attr('id');
		cid = "#theme_"+cid;
		
		$(cid).toggle(200);
		
	});
	
	$(".themesub").toggle();
	
});

