// Easy-Slider-Execute Plugin -- to change speed of change between each 'slide', change toggle speed (in miliseconds)(normal speed= 7000)
jQuery.fn.styleCode=function(){return this.each(function(){var SCpre=jQuery(this).find(".entry pre");if(SCpre.data("isStyled")!=true){SCpre.wrap('<div class="codebg"><div class="codetop"></div></div>').data("isStyled",true);}});};jQuery.fn.collapse=function(){return this.each(function(){jQuery(this).stop().animate({opacity:0.0,width:0,marginRight:0,padding:0},350);});};jQuery.fn.expand=function(tbwidth){return this.each(function(){jQuery(this).stop().animate({opacity:1,width:tbwidth,marginRight:'18px',padding:'0 1px'},350);});};$(function(){var cache=[];$.preLoadImages=function(){var args_len=arguments.length;for(var i=args_len;i--;){var cacheImage=document.createElement('img');cacheImage.src=arguments[i];cache.push(cacheImage);}}
$("#focusarea").find('li').hide().end().find('li:first').show();$markers=$("#feature ul.markers");var slides=$("#focusarea").children().length;function showSlide(slideNumber){if(slideNumber<1){slideNumber=slides;}
else if(slideNumber>slides)slideNumber=1;$("#focusarea").find('li:visible').fadeOut('slow').end().find('li:nth-child('+slideNumber+')').fadeIn('slow');$markers.find('a.active').removeClass('active').end().find('li:nth-child('+slideNumber+') a').addClass('active');}
var toggleSpeed=61000,timerId=setTimeout(autoToggle,toggleSpeed);function autoToggle(){var newslide=2+$markers.find('a.active').parent().index();showSlide(newslide);timerId=setTimeout(autoToggle,toggleSpeed);}
$("#focusnext, #focusprev").click(function(e){e.preventDefault();clearTimeout(timerId);var newslide=(2*$(this).hasClass("nextslide"))+$markers.find('a.active').parent().index();showSlide(newslide);});$markers.delegate("a","click",function(e){e.preventDefault();clearTimeout(timerId);showSlide($(this).parent().index()+1);});$("#thumbnails li").mouseenter(function(e){$(this).find('img').stop().animate({opacity:0.8},300).end().find('.viewcasestudy').fadeIn('fast');}).mouseleave(function(e){$(this).find('img').stop().animate({opacity:1.0},150).end().find('.viewcasestudy').fadeOut('fast');});$("#filter a").click(function(e){e.preventDefault();$(this).parent().parent().find('li a').removeClass('active').end().end().end().addClass('active');window.location.hash="/"+$(this).text().replace(' ','-');updateFilter($(this).text().replace(' ','-'));});});
