$(document).ready(function(){

	$('#slideshow1').cycle({speed: 1500 }); 
	$('#slideshowindex').cycle({speed: 1500, before: onBefore }); 
	
	function onBefore(curr,next,opts) {
    var $slide = $(next);
    var w = $slide.outerWidth();
    var h = $slide.outerHeight();
    $slide.css({
        marginLeft: (300 - w) / 2
    });
};
	
	$('.table1').each(function(){
			ConvertRowsToLinks(this.id)
			});

	$('#vraagbox').toggle();

	$('#vraag').click(function () {
		$('#vraagbox').toggle("slow") 
	});
	});     

function ConvertRowsToLinks(xTableId){
	var rows = document.getElementById(xTableId).getElementsByTagName("tr");
	for(i=0;i<rows.length;i++){
		var link = rows[i].getElementsByTagName("a")
		if(link.length == 1){
			rows[i].onclick = new Function("document.location.href=\'" + link[0].href + "\'");
			rows[i].onmouseover = new Function("this.style.backgroundColor='#dddddd'; this.style.cursor='pointer'");
			rows[i].onmouseout = new Function("this.style.backgroundColor=''; this.style.cursor='default'");
		}
	}
}