/*We work with Prototype too :) */
jQuery.noConflict();

/*Initializing the left menu*/
jQuery(document).ready(
	function(){
	//When mouse rolls over
	jQuery("div#nav-left li").mouseover(function()
	{
		var id = jQuery(this).attr('id');

		jQuery("#div"+id).css({ backgroundImage:'url(/squelettes/img/left-meny-'+id+'.gif)'});

		var n = jQuery('div#nav-left li#'+id+' p').length;
		if ( n == 0) {return true;}
		if ( n == 1) { n = 2;} else { n = n+1;}
		jQuery(this).stop().animate({height:(n*34)+'px'},{queue:false, duration:600})//, easing: 'easeOutBounce'})
	}
	);

	//When mouse is removed
	jQuery("div#nav-left li").mouseout(function()
	{
		var id = jQuery(this).attr('id');
		jQuery("#div"+id).css({ backgroundImage:'url(/squelettes/img/left-meny-'+id+'.jpg)'});
		jQuery(this).stop().animate({height:'34px'},{queue:false, duration:600, easing: 'easeOutBounce'})
	}
	);

});


jQuery(document).ready(
	function() {
		jQuery("div.txt-left img").each (
			function () {
				var source = jQuery(this).attr("src");
				jQuery(this).before("<a href=\" "+source+" \" rel=\"lightbox\"><img src=\" "+source+" \"></a>");
				jQuery(this).remove();

			}
		);

	}
);

/*Top Menu*/
jQuery(document).ready(function(){
    jQuery('.topmenu ul li').hover(
        function() {
            //jQuery(this).addClass("active");
            jQuery(this).find('ul').slideDown();
        },
        function() {
            //jQuery(this).removeClass("active");        
            jQuery(this).find('ul').slideUp('fast');
        }
    );
});

