// Author:Devolux
// Author URI:http://devolux.org/
var $j = jQuery.noConflict();

$j(document).ready(function() {

	luikHeight = $j("#luik2").height();

	$j("#detecthover1 ul").hide();
	$j("#detecthover2 ul").hide();
	$j("#detecthover3 ul").hide();
	$j("#detecthover4 ul").hide();
	
	$j("#gebouw #detecthover1").hoverIntent({sensitivity:3,interval:0,over: luikOmhoog1,timeout:400,out:luikOmlaag1});
	$j("#gebouw #detecthover2").hoverIntent({sensitivity:3,interval:0,over: luikOmhoog2,timeout:400,out:luikOmlaag2});
	$j("#gebouw #detecthover3").hoverIntent({sensitivity:3,interval:0,over: luikOmhoog3,timeout:400,out:luikOmlaag3});
	$j("#gebouw #detecthover4").hoverIntent({sensitivity:3,interval:0,over: luikOmhoog4,timeout:400,out:luikOmlaag4});

	function luikOmhoog1(){ $j("#luik1").animate({backgroundPositionX:"0%", backgroundPositionY:"100%", height:0},600); 
		$j("#detecthover1 ul").fadeIn(600); }
	function luikOmhoog2(){ $j("#luik2").animate({backgroundPositionX:"0%", backgroundPositionY:"100%", height:0},600);
		$j("#detecthover2 ul").fadeIn(600); }
	function luikOmhoog3(){ $j("#luik3").animate({backgroundPositionX:"0%", backgroundPositionY:"100%", height:0},600);
		$j("#detecthover3 ul").fadeIn(600); }
	function luikOmhoog4(){ $j("#luik4").animate({backgroundPositionX:"0%", backgroundPositionY:"100%", height:0},600);
		$j("#detecthover4 ul").fadeIn(600); }

	function luikOmlaag1(){ $j("#detecthover1 ul").hide();
		$j("#luik1").animate({backgroundPositionX:"0%", backgroundPositionY:"100%", height:luikHeight},300) } 
	function luikOmlaag2(){ $j("#detecthover2 ul").hide();
		$j("#luik2").animate({backgroundPositionX:"0%", backgroundPositionY:"100%", height:luikHeight},300)	} 
	function luikOmlaag3(){ $j("#detecthover3 ul").hide();
		$j("#luik3").animate({backgroundPositionX:"0%", backgroundPositionY:"100%", height:luikHeight},300) } 
	function luikOmlaag4(){ $j("#detecthover4 ul").hide();
		$j("#luik4").animate({backgroundPositionX:"0%", backgroundPositionY:"100%", height:luikHeight},300)	} 


//Toggle functions
 $j("#toggle-all").toggle(
                    function(){
                         $j(".excerpt").hide('slow');
			 $j("#toggle").attr("class","show-all");
                    }, function() {
                         $j(".excerpt").show('slow');
			 $j("#toggle").attr("class","hide-all");
                    });

$j(".view-excerpt").click(function (event) {
	event.preventDefault();
      $j(this).parents(".headline").next(".excerpt").toggle("normal");
    });




});

