function slideSwitch() {
var $active = $('#slideshow li.active');
if ( $active.length == 0 ) $active = $('#slideshow li:last');
// use this to pull the divs in the order they appear in the markup
var $next = $active.next().length ? $active.next()
: $('#slideshow li:first');
// uncomment below to pull the divs randomly
// var $sibs = $active.siblings();
// var rndNum = Math.floor(Math.random() * $sibs.length );
// var $next = $( $sibs[ rndNum ] );
$active.addClass('last-active');
$next.css({opacity: 0.0})
.addClass('active')
.animate({opacity: 1.0}, 1000, function() {
$active.removeClass('active last-active');
});
}
/*
Footer logo functions
*/
$(function(){
// time between image rotate
var delay = 2000;
// for each list item in
// the rotator ul, generate
// show a random list item
$('#rotator > li').each(function(){
// save images in an array
var $imgArr = $(this).children();
// show a random image
$imgArr.eq(Math.floor(Math.random()*$imgArr.length)).show();
});
// run the changeImage function after every (delay) miliseconds
setInterval(function(){
changeImage();
},delay);
function changeImage(){
// save list items in an array
var $liArr = $('#rotator > li');
// select a random list item
var $currLi = $liArr.eq(Math.floor(Math.random()*$liArr.length));
// get the currently visible image
var $currImg = $('.rotator-image:visible', $currLi);
if ($currImg.next().length == 1) {
var $next = $currImg.next();
} else {
var $next = $('.rotator-image:first', $currLi);
}
$currImg.fadeOut();
$next.fadeIn();
}
});
$(document).ready(function() {
var totalNum = 5;
var rndNum = Math.floor(Math.random() * totalNum);
$("body").css("background-image","url(/site/DefaultSite/filesystem/images/Backgrounds/bg" + rndNum + ".jpg)");
$(function() {
setInterval( "slideSwitch()", 9000 );
});
});
$(function() {
//add toggle functionality to the .hTabHandle class
$('.hTabHandle').toggle(function(){ //when the tab is closed and the handle is clicked
$('#hTab').animate({left:'0px'}, 500); //slide the #hTab back to left:0px postion
$('#toggleLink').toggleClass('close', 'open'); //toggle the class from open to close
$('#toggleLink').html('&nbsp;'); //change the text to 'Close'
},
function(){ //when the tab is opened and the handle is clicked
$('#hTab').animate({left:'-510px'}, 500); //slide the #hTab back to left:-305px postion so it hides the tab again
$('#toggleLink').toggleClass('close', 'open'); //toggle the class from close to open
$('#toggleLink').html('&nbsp;'); //change the text to 'Open'
});
});


