$(window).load(function(){$(".wa-fg").css("opacity",0.95);$(".entry .wraparound .wa-bar-light").css("opacity",0.15);slider.init();$(".entry").mouseenter(function(){slider.mousein=true;if(!slider.isanimating){$(".entry .wraparound .wa-bar-light").stop();window.clearTimeout(slider.autoloop);var a=$(".entry .wraparound .wa-bar-light").css("top").length;a=Number($(".entry .wraparound .wa-bar-light").css("top").substring(0,a-2));slider.timer=(204-a)/204*slider.autotime}});$(".entry").mouseleave(function(){slider.mousein=false;if(!slider.isanimating){slider.autoloop=window.setTimeout("slider.auto();",slider.timer);$(".entry .wraparound .wa-bar-light").animate({top:"204px"},slider.timer,"linear")}});$(".hero-nav a").click(function(a){switch($(this).parent().attr("id")){case"hero-nav-1":slider.slide(1,true);break;case"hero-nav-2":slider.slide(2,true);break;case"hero-nav-3":slider.slide(3,true);break;case"hero-nav-4":slider.slide(4,true);break;case"hero-nav-5":slider.slide(5,true);break}a.preventDefault()})});var slider={num:-1,curr:0,transtime:750,autoloop:null,autotime:1E4,autorotate:true,mousein:false,timer:0,colors:Array("teal","pink","purple","green","orange"),init:function(){if(!slider.data||!slider.data.length)return false;var a=slider.data;slider.num=a.length;for(var b=0;b<slider.num;b++)if(b!==0){$(".entry #hero-img-holder").append('<img id="hero-'+(b+1)+'" src=" '+a[b].image+'" alt="" />');$(".entry #hero-img-holder #hero-"+(b+1)).css("opacity",0)}$(".entry .wraparound .wa-bar-light").css("top","0px");slider.countdown(slider.autotime)},auto:function(){if(!slider.autorotate)return false;var a=slider.curr+2;if(a>=slider.num+1)a=-1;slider.mousein||slider.slide(a)},slide:function(a,b){if(b){slider.wrapoff(true);$(".entry #hero-img-holder #hero-"+Number(slider.curr+1)).animate({opacity:0},slider.transtime);$(".entry #hero-img-holder #hero-"+a).animate({opacity:1},slider.transtime);slider.curr=a-1}else if(a>0&&!b){slider.wrapoff(true,a);$(".entry #hero-img-holder #hero-"+(a-1)).animate({opacity:0},slider.transtime);$(".entry #hero-img-holder #hero-"+a).animate({opacity:1},slider.transtime);slider.curr++}else{slider.wrapoff(true);$(".entry #hero-img-holder #hero-"+slider.num).animate({opacity:0},slider.transtime);$(".entry #hero-img-holder #hero-1").animate({opacity:1},slider.transtime);slider.curr=0}},textswap:function(a){a||(a=slider.curr+1);switch(a){case 1:$(".entry li").removeClass("active");$(".entry .wraparound").removeClass("teal pink purple green orange lightgreen");$(".entry .wraparound").addClass("lightgreen");$(".entry #hero-nav-1").addClass("active");$(".entry .wa-fg .content h2").html(slider.data[0].title);$(".entry .wa-fg .content #copy").html(slider.data[0].copy);$(".entry #btn-href").attr("href",slider.data[0].link);$('.entry #btn-href').attr('title',slider.data[0].ScreenReaderTitle);break;case 2:$(".entry li").removeClass("active");$(".entry .wraparound").removeClass("teal pink purple green orange lightgreen");$(".entry .wraparound").addClass("blue");$(".entry #hero-nav-2").addClass("active");$(".entry .wa-fg .content h2").html(slider.data[1].title);$(".entry .wa-fg .content #copy").html(slider.data[1].copy);$(".entry #btn-href").attr("href",slider.data[1].link);$('.entry #btn-href').attr('title',slider.data[1].ScreenReaderTitle);break;case 3:$(".entry li").removeClass("active");$(".entry .wraparound").removeClass("teal pink purple green orange lightgreen");$(".entry .wraparound").addClass("teal");$(".entry #hero-nav-3").addClass("active");$(".entry .wa-fg .content h2").html(slider.data[2].title);$(".entry .wa-fg .content #copy").html(slider.data[2].copy);$(".entry #btn-href").attr("href",slider.data[2].link);$('.entry #btn-href').attr('title',slider.data[2].ScreenReaderTitle);break;case 4:$(".entry li").removeClass("active");$(".entry .wraparound").removeClass("teal pink purple green orange lightgreen");$(".entry .wraparound").addClass("green");$(".entry #hero-nav-4").addClass("active");$(".entry .wa-fg .content h2").html(slider.data[3].title);$(".entry .wa-fg .content #copy").html(slider.data[3].copy);$(".entry #btn-href").attr("href",slider.data[3].link);$('.entry #btn-href').attr('title',slider.data[3].ScreenReaderTitle);break;case 5:$(".entry li").removeClass("active");$(".entry .wraparound").removeClass("teal pink purple green orange lightgreen");$(".entry .wraparound").addClass("lightgreen");$(".entry #hero-nav-5").addClass("active");$(".entry .wa-fg .content h2").html(slider.data[4].title);$(".entry .wa-fg .content #copy").html(slider.data[4].copy);$(".entry #btn-href").attr("href",slider.data[4].link);$('.entry #btn-href').attr('title',slider.data[4].ScreenReaderTitle);break}},highlight:function(){},wrapon:function(a){if(!a)return false;$(".entry .wa-fg").width();$(".entry .wraparound .wa-bar-light").css("top","0px");$(".entry .wa-bg").animate({left:"0px",width:"20px"},250);$(".entry .wraparound .wa-bar").delay(400).animate({width:"40px"},250);$(".entry .wraparound .wa-fg").delay(500).animate({left:"0px"},400,slider.countdown)},wrapoff:function(a,b){slider.isanimating=true;$(".entry .wa-fg").width();$(".entry .wa-bg").delay(450).animate({left:"20px",width:"0px"},250,function(){slider.textswap(b);slider.wrapon(a)});$(".entry .wraparound .wa-bar").delay(200).animate({width:"0px"},250);$(".entry .wraparound .wa-fg").animate({left:"-700px"},400)},countdown:function(){if(!slider.mousein){window.clearTimeout(slider.autoloop);slider.autoloop=window.setTimeout("slider.auto();",slider.autotime)}slider.isanimating=false;slider.timer=slider.autotime;slider.mousein||$(".entry .wraparound .wa-bar-light").animate({top:"204px"},slider.autotime,"linear")}};
