function insipio_setReferer() { 
	var theRefererForm = document.getElementById('insipioRefererForm'); 
	theRefererForm.referer.value = document.location; 
	theRefererForm.submit(); 
}

function formatText(index, panel) {
return index + "";
}

$(function() {

$('.anythingSlider').anythingSlider({
easing: "easeInOutExpo", // Anything other than "linear" or "swing" requires the easing plugin
autoPlay: true, // This turns off the entire FUNCTIONALY, not just if it starts running or not.
delay: 3000, // How long between slide transitions in AutoPlay mode
startStopped: true, // If autoPlay is on, this can force it to start stopped
animationTime: 600, // How long the slide transition takes
hashTags: true, // Should links change the hashtag in the URL?
buildNavigation: true, // If true, builds and list of anchor links to link to each slide
pauseOnHover: true, // If true, and autoPlay is enabled, the show will pause on hover
startText: "Go", // Start text
stopText: "Stop", // Stop text
navigationFormatter: formatText // Details at the top of the file on this use (advanced use)
});

$("#slide-jump").click(function(){ $('.anythingSlider').anythingSlider(6);});

//run the currently selected effect
function runEffect(){
//get effect type from 
var selectedEffect = $('#effectTypes').val();

//most effect types need no options passed by default
var options = {};
//check if it's scale, transfer, or size - they need options explicitly set
if(selectedEffect == 'scale'){ options = {percent: 100}; }
else if(selectedEffect == 'transfer'){ options = { to: "#button", className: 'ui-effects-transfer' }; }
else if(selectedEffect == 'size'){ options = { to: {width: 280,height: 185} }; }

//run the effect
$("#effect").show(selectedEffect,options,500,callback);
};

//callback function to bring a hidden box back
function callback(){
setTimeout(function(){
$("#effect:visible").removeAttr('style').hide().fadeOut();
}, 50000);
};

//set effect from select menu value
$("#button").hover(function() {
runEffect();
return false;
});

$("#effect").hide();


$("ul.menu_body li:even").addClass("alt");


var menu_is_over = false;
var menu_timeout = null;
var menu_is_collapsing = false;
var menu_time_before_collapse = 500;

$('.menyknapp').bind("mouseover",function () { 
	var self = this;
	if(menu_is_collapsing) return;
	$(self).find('ul.menu_body').slideDown('slow');
	menu_is_over = true;
	
	$(self).bind("mouseout",function(){
		clearTimeout(menu_timeout);
		menu_is_over = false;
		menu_timeout = setTimeout(function(){
			if(!menu_is_over){
				menu_is_collapsing = true;
				$(self).find('ul.menu_body').slideUp('slow',function(){
						menu_is_collapsing = false;
				});	
			}
		},menu_time_before_collapse);
							
	});
									
});
});



	$("#kurskatalog").dialog({ autoOpen:false, height: 740, width: 1040, title: 'Kurskatalog', modal: true });
	$(".opendialog").click(function(){ $("#kurskatalog").dialog("open"); });
