
/* Include JS Files */

document.write('<scr'+'ipt type="text/javascript" src="/plugins/jquery.corner.js"></scr'+'ipt>');
document.write('<scr'+'ipt type="text/javascript" src="/plugins/jquery.cycle.js"></scr'+'ipt>');
document.write('<scr'+'ipt type="text/javascript" src="/plugins/jquery.easing.js"></scr'+'ipt>');
document.write('<scr'+'ipt type="text/javascript" src="/plugins/jquery.scroll-follow.js"></scr'+'ipt>');
document.write('<scr'+'ipt type="text/javascript" src="/plugins/jquery.tooltip.js"></scr'+'ipt>');
document.write('<scr'+'ipt type="text/javascript" src="/plugins/jquery.pngFix.pack.js"></scr'+'ipt>');
document.write('<scr'+'ipt type="text/javascript" src="/plugins/jquery.leanmodal.js"></scr'+'ipt>');



/* Jquery Setup */

$(document).ready(function() {			


	// IE transparency fix

	 $(document).pngFix();


	// Modal

	$("a[rel*=showModal]").leanModal({
		top : 200, 
		overlay : 0.4
	});


	// Close button:
		
	$(".close").click(function () {
		$(this).parent().fadeTo(400, 0, function () {
			$(this).slideUp(400);
		});
		return false;
	});


	// Cycle Function

	$("#cycle-partners").cycle({
		fx: 'scrollDown',
		random: true,
		speed: 1500,
		timeout: 3000
	});

	$("#cycle-slideshow-710, #cycle-slideshow-465").cycle({
		fx: 'fade',
		random: true,
		speed: 1500,
		timeout: 5000
	});

	$("#cycle-pictogram").cycle({
		fx: 'fade',
		random: false,
		speed: 2500,
		timeout: 5000
	});


	// Dropdown menu

	$("ul.dropdown ul").css('display', 'none');

	$("ul.dropdown > li").hover(
		function()
		{
			$('ul', this).fadeIn(400);
		},
 
		function()
		{
			$('ul', this).fadeOut(400);			
		}
	);


	// Tabs Function

	$(".tabsContent").hide();

	var 	containers = $(".tabsContent").hide(),
    		showContainer = $(location.hash||".tabsContent:first").show(),
    		tabs = $("ul.tabsMenu-col-2 li, ul.tabsMenu-col-3 li"),
    		tab = tabs.eq(containers.index(showContainer)).addClass("tabsActive").show();

	tabs.click(function() {
		tabs.removeClass("tabsActive");
    		$(this).addClass("tabsActive");
    		containers.hide();
    		var activeTab = $("a:first", this).attr("href");
    		$(activeTab).show();
    		return false;
	});


	


	// Toggle FAQ

	$(".list-faq-container").hide(); 
	$(".list-faq-container-open").show();

	$("div.trigger").toggle(function(){
		$(this).next(".list-faq-container, .list-faq-container-open").show();
		$(this).addClass("active");
		}, function () {
		$(this).next(".list-faq-container, .list-faq-container-open").hide();
		$(this).removeClass("active");
	});


	// Scroll to the top

	$("a.top").click(function(){
		$('html, body').animate({scrollTop: '0px'}, 1000);
		return false;
	});

	$(".rounded, .grid-41-navbar, grid-41p").corner("7px");


	// Scroll Follow

	$("#scroll-follow").scrollFollow({
		offset: 25,
	});


	// Tooltip

	$('.tooltip').tipsy({
		gravity: 's',
		opacity: 0.85,
		fade: true
	});


	// Mervärde

	$('#slide-content-wrapper').cycle({ 
	    	fx: 'scrollVert',
		speed: 1000,
		rev: true,
		timeout: 7000,
		pager:'#slide-content-pager div',
		pagerAnchorBuilder: function(index, el) {
			return '<a href="#"></a>';
		}
	});

});
