/*
JQUERY fading slide show for slide class containers inside slider class
Author:Jeff Langston 

Based on slide show from 
http://jonraasch.com/blog/a-simple-jquery-slideshow 
*/

//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()",6000);
setTimeout("slideSwitch();",6000);
}

function playSlideshow()
{
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
var SlideSwitchfirst = function(){
	
	var slide = $(".slider .slide:first");
	
	$(".slider").append(slide);
	
	$(".slide").css({"display":"inline"});

	
}
//flashing bml banner slider rotation
function bannerSwitch(){
	var slide = $(".flashingbanner .flashbanner:first");
	
	slide.hide();
	
	$(".flashingbanner").append(slide);
	
	slide.fadeIn("slow");
}
