/*
 JQUERY fading slide show for slide class containers inside slider class
 Author:Jeff Langston
 */
//advance slide forward with nice cross fade
function slideSwitch(){
    var slide = $(".slider .slide:first");
    slide.hide();
    $(".slider").append(slide);
    slide.fadeIn("slow");
}

//Advance one slide forward rapidily
function slideSwitchfast(){
    var slide = $(".slider .slide:first");
    slide.hide();
    $(".slider").append(slide);
    slide.fadeIn("fast")
}

//to go back a slide in the reverse order
function slideSwitchback(){
    var slide = $(".slider .slide:last");
    slide.show();
    $(".slider").prepend(slide);
    slide.fadeIn("fast")
}

// timer logic for main slideshow 
var t;
var timer_is_on = 0;

function timedCount(){
    t = setTimeout("timedCount()", slidetimeout);
    setTimeout("slideSwitch();", slidetimeout);
}

function playSlideshow(){
    slideSwitch();
    if (!timer_is_on) {
        timer_is_on = 1;
        timedCount();
    }
}

function stopSlideshow(){
    clearTimeout(t);
    timer_is_on = 0;
}

//Pause banner rotation on mouse over
$(".slide").hover(function(stopSlideshow){
}, function(playSlideshow){

});
//to stop the slideshow
function b(){
    clearInterval(playSlideshow);
    clearInterval(playss());
}

//to ensure it starts with first slide in list
function SlideSwitchfirst(){
    var slide = $(".slider .slide:first");
    $(".slider").append(slide);
    $(".slide").css({
        "display": "inline"
    });
}

