/*!
* SundaHus.Web.Public.Frontpage.js
* http://www.sundahus.se/
*/
$(function(){var e=Modernizr.touch||(navigator.userAgent.toLowerCase().search("windows phone os 7")>-1);var i={HoverDelayTime:25,EventLogDelayTime:1000,SloganInitDelay:550};var c=$("#FrontPageTopBannerWrapper");var f=$(".mainWrapper .mainSlogan",c);var g=$(".mainWrapper .desc",c);var h=$(".block",g);var d=$(".thumbsWrapper ul li",c);var b=d.filter(":first");g.hide();f.hide();setTimeout(function(){f.fadeIn("slow")},i.SloganInitDelay);function a(j){var k=$(j);k.data("hover",true);setTimeout(function(){if(k.data("hover")){g.hide().css("left",(k.index()*315)+"px").show();f.hide();if(k.is(".active")){return false}else{h.html(k.find(".block").html())}d.removeClass("active");k.addClass("active");var l=k.find("h2").text();if(l){setTimeout(function(){if(k.data("hover")){_gaq.push(["_trackEvent","Frontpage","Show",l])}},i.EventLogDelayTime)}}},i.HoverDelayTime);return false}d.click(function(){var k=$(this);if(e&&!k.is(".active")){a(this);return false}else{var j=k.find("a").attr("href");if(j){window.location=j}}});if(!e){d.hover(function(){a(this)},function(){$(this).data("hover",false)});c.mouseleave(function(){g.fadeOut("fast");f.fadeIn("slow");d.removeClass("active")})}if($.browser.msie&&$.browser.version.substr(0,1)<7){f.remove()}$("#ReferencesWrapper .refItems").shuffle().carouFredSel({width:940,height:40,scroll:{fx:"crossfade",duration:1500},auto:{pauseDuration:7000,delay:-5000},items:{start:"auto"}})});
