$(document).ready(function(){
 
	$("a.fbg").fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	600, 
		'speedOut'		:	200, 
		'overlayShow'	:	true,
		'overlayColor'	:	'#000',
		'overlayOpacity':   0.5
		
	});
	
	$( "#newsy" ).tabs();
	$( "#rekord" ).accordion({
			icons: false,
			autoHeight: false
	});
	
	$("img[imgfade='true']").fadeTo('fast', 0.3);
	
	$("img[imgfade='true']").mouseover(function() {
	    $(this).fadeTo('slow', 1);
 	}).mouseout(function(){
    	$(this).fadeTo('slow', 0.3);
 	});
	
	$("#menu div[class!='active']").mouseover(function() {
	    $(this).addClass("over");
 	}).mouseout(function(){
    	$(this).removeClass("over");
 	});
	
	$("#slider").easySlider({
				auto: true, 
				continuous: true,
				prevText: 	'',
				nextText: 	'',
				speed: 800,
				pause: 5000
	});
	
	
		
	$("#menu").delegate("a", "click", function (event) { 
		
		if ($(this).attr("href")==undefined || $(this).attr("href")==""){
			event.preventDefault();			
			if ($(this).attr("tbLink")!=undefined)	goToLink($(this).attr("tbLink"));
			else $("#menu").jstree("toggle_node", this);
		}
		else goToLink($(this).attr("href"));	
	});
	
	function goToLink(url){
		window.location = url
	}
	
}); 
