$(document).ready(function()
{
	$("a[rel='lightbox']").colorbox();
	
	$("#tableProblem > a").colorbox({iframe:true,width: "900px", height:"700px", href:"https://www.verzuimsignaal.nl/modules/help/inlogproblemen.php?helponderwerpen_id=83&zoekterm=Inlogproblemen"});
	
	$(".titles").mousemove(function()
	{
		$id = this.id;
		$id = $id.split('_');
		$id = $id[1];
		if (!$('#header_' + $id).is(':visible'))
		{
			$(".headerArrowBlue").attr('src', 'images/arrowBlueEmpty.png');
			$("#image_" + $id).attr('src', 'images/arrowBlue.png');
			$(".header").fadeOut(500);
			$("#header_" + $id).fadeIn(500);
		}
	});
    
    setInterval('changeSpreuk("0", "500")', 5000);
    setInterval('changeSpreuk("1", "500")', 5000);
    setInterval('changeSpreuk("2", "500")', 5000);
    


	$("#faq > dt, #wiki > dt").click(function()
	{
		$(this).next().slideToggle();
		var $img = $(this).children('img'); 
		if ($img.attr('src') == 'images/arrowBlueUp.png')
		{
			$img.attr('src', 'images/arrowBlueDown.png');
		}
		else
		{
			$img.attr('src', 'images/arrowBlueUp.png');
		}
	});

	$('.accordion .head').click(function() {
		$(this).next().toggle('slow');
		return false;
	}).next().hide();
});

function changeSpreuk($id, $miliseconds)
{
    $size = $('#spreuken_' + $id + ' > li').size();
    $activeId = $('#activeId_' + $id).val();
    
    $next = parseInt($activeId) + 1;
    if ($next > $size)
    {
        $next = 1;
    }
    $('#spreuk_' + $id + '_' + $activeId).css('display', 'none');
    $('#spreuk_' + $id + '_' + $next).fadeIn($miliseconds);
    $('#activeId_' + $id).val($next);
    
}


function validate(form)
{
	switch(form.id){
		case	'searchform'	:
		var searchphrase = form.searchphrase.value;
		if(searchphrase == '' || searchphrase == 'uw zoekwoord(en)'){
			alert('Vul s.v.p. een zoekwoord in!');
			return false;
		}
		break;
		case	'formlogin'	:
		var login 		= form.login.value;
		var wachtwoord 	= form.wachtwoord.value;
		if(login == '' || wachtwoord == ''){
			alert('Vul s.v.p. uw gebruikersnaam en/of wachtwoord in!');
			return false;
		}
		break;
	}
}

/*
var win;

function loadPopup(nwUrl,nwName,nwWidth,nwHeight,nwScrolling,nwResizable,nwMenubar,nwToolbar) 

{

	var nwUrl;

	var nwName;

	var nwWidth;

	var nwHeight;

	var nwScrolling;

	var nwResizable;

	var nwMenubar;

	var nwToolbar;

	

	var winleft = (screen.width - nwWidth) / 2;

	var winUp = (screen.height - nwHeight) / 2;

	

	if (win && !win.closed) {

		if (win.name == nwName) {

			win.close();

			win = null;

		} else {

			win = null;	

		}

	}

	win = window.open(nwUrl,nwName,'width='+nwWidth+', height='+nwHeight+', left='+winleft+',top='+winUp+', scroll='+nwScrolling+', resizable='+nwResizable+',toolbar='+nwToolbar+',menubar='+nwMenubar+''); 

}
*/
