/* functie om hele blokken klikbaar te maken, en hover toevoegen */
$.fn.hoverClick = function( trigger_click )
{
	return this.live("mouseover mouseout click", function( event )
	{
		if (event.type == 'mouseover')
		{
			if($("a", this).length)
			{
				$(this).addClass("hover").css("cursor", "pointer");
				$(this).attr("title", $("a:first", this).attr("title"));
			}
		}
		else if(event.type == 'click' && event.target.nodeName.toUpperCase() != 'A')
		{
			if(trigger_click)
			{
				$("a:first", this).trigger("click");
			}
			else
			{
				var link = $("a:first", this);
				
				if (link.attr("target")) 
				{
					window.open(link.attr("href"), link.attr("target"));
				}
				else 
				{
					window.location = link.attr("href");
				}
			}

			return false;
		}
		else
		{
			$(this).removeClass("hover");
		}
	});
};


$.fn.hoverClass = function( className )
{
	if(!className)
		className = 'hover';
	
	return this.live('mouseover mouseout', function( event )
	{ 
		if (event.type == 'mouseover')
			$(this).addClass(className);
		else
			$(this).removeClass(className);
	});
};


$(function()
{
	
	$("ol#nieuwsoverzicht li").hoverClick();
	
	/* ------------------------- */
	/* Formulier focus op velden */
	/* ------------------------- */
	// Formulier focus op velden
	$(":input").not("input[type=button], input[type=submit], input[type=radio], input[type=checkbox]").focus(function() { $(this).addClass("veldfocus"); });
	$(":input").not("input[type=button], input[type=submit], input[type=radio], input[type=checkbox]").blur(function() { $(this).removeClass("veldfocus"); });


	

	
	$("#fotos .groot img").hover(function(){
		$(this).hover(
			function() { $("#fotos .groot .info").addClass("hover").css("cursor", "pointer");  },
			function() { $("#fotos .groot .info").removeClass("hover").css("cursor", "pointer");  }
		);

	});	
	

	
	
});


function filter_op_categorie(objNaam)
{
	if(objNaam.value == 'alles')
		location = submap + '/16364-referenties/' ;
	else if(objNaam.value != '')
		location = submap + '/16364-referenties/' + objNaam.value;	
	//alert(formulier.categorie.value);
}


function controleer_login(formulier)
{
	if(formulier.gebruikersnaam.value.length < 3 || formulier.wachtwoord.value.length < 3)	
	{
		alert('Vul svp een gebruikersnaam en een wachtwoord in met minimaal 3 karakters.');
		return false;	
	}
	else
	{
		return true;	
	}
}

sIFR.replaceElement(named({ sSelector:"#main h1", sFlashSrc: submap + "/fla/geneva.swf", sColor:"#666666", sBgColor:"#FFFFFF", sWmode:"transparent" }));
sIFR.replaceElement(named({ sSelector:"#blokken h2", sFlashSrc: submap + "/fla/geneva.swf", sColor:"#666666", sBgColor:"#FFFFFF", sWmode:"transparent" }));


/** innerfade */
(function(a){a.fn.innerfade=function(b){return this.each(function(){a.innerfade(this,b)})};a.innerfade=function(b,c){var e={animationtype:"fade",speed:"normal",type:"sequence",timeout:2000,containerheight:"auto",runningclass:"innerfade",children:null};if(c){a.extend(e,c)}if(e.children===null){var g=a(b).children()}else{var g=a(b).children(e.children)}if(g.length>1){a(b).css("position","relative").css("height",e.containerheight).addClass(e.runningclass);for(var d=0;d<g.length;d++){a(g[d]).css("z-index",String(g.length-d)).css("position","absolute").hide()}if(e.type=="sequence"){setTimeout(function(){a.innerfade.next(g,e,1,0)},e.timeout);a(g[0]).show()}else{if(e.type=="random"){var f=Math.floor(Math.random()*(g.length));setTimeout(function(){do{h=Math.floor(Math.random()*(g.length))}while(f==h);a.innerfade.next(g,e,h,f)},e.timeout);a(g[f]).show()}else{if(e.type=="random_start"){e.type="sequence";var h=Math.floor(Math.random()*(g.length));setTimeout(function(){a.innerfade.next(g,e,(h+1)%g.length,h)},e.timeout);a(g[h]).show()}else{alert("Innerfade-Type must either be 'sequence', 'random' or 'random_start'")}}}}};a.innerfade.next=function(d,b,e,c){if(b.animationtype=="slide"){a(d[c]).slideUp(b.speed);a(d[e]).slideDown(b.speed)}else{if(b.animationtype=="fade"){a(d[c]).fadeOut(b.speed);a(d[e]).fadeIn(b.speed,function(){removeFilter(a(this)[0])})}else{alert("Innerfade-animationtype must either be 'slide' or 'fade'")}}if(b.type=="sequence"){if((e+1)<d.length){e=e+1;c=e-1}else{e=0;c=d.length-1}}else{if(b.type=="random"){c=e;while(e==c){e=Math.floor(Math.random()*d.length)}}else{alert("Innerfade-Type must either be 'sequence', 'random' or 'random_start'")}}setTimeout((function(){a.innerfade.next(d,b,e,c)}),b.timeout)}})(jQuery);function removeFilter(a){if(a.style.removeAttribute){a.style.removeAttribute("filter")}};
