/** * This file contains the functionality for the image fader on the home page. * * Author: Pexeto * http://pexeto.com/ */ var divArray = new Array(); var navArray = new Array(); var divNumber=0; var currentImage=0; var selectedImage=0; var waitInterval=4200; //this is the interval between each fade var fadeSpeed=2000; //this is the speed of the fade action var selectFadeSpeed=1000; var timer=-1; $(function(){ getAllDivs(); setFader(); setClickHandlers(); setArrowClickHandlers(); timer = window.setInterval("fade()", waitInterval); setLinks(); }); function setLinks(){ $(".fadeWrapper").click(function(){ var link=$(".fadeHolder").eq(currentImage).find("a").attr("href"); if(link!=null){ location.href=link; } }); $(".fadeWrapper").mouseover(function(){ $(".fadeWrapper").css({cursor:"pointer"}); }); } /** * Gets all the divs that have to be shown in the slider and fills them in an array. */ function getAllDivs(){ $("#sliderNavigation").append(""); //fill the divs in an array $(".fadeHolder").each(function(i){ divArray[i]=$(this); divNumber++; if(i!=0){ $(".navUl").append("
  • "); }else{ $(".navUl").append("
  • "); } navArray[i]=$("ul.navUl li").eq(i); }); } /** * Makes all the images invisible. */ function setFader(){ for(var i=1; i