/*
   $(document).ready(function(){
       $("#slider").jFlow({
         controller: ".jFlowControl", // must be class, use . sign
         slideWrapper : "#jFlowSlider", // must be id, use # sign
         slides: "#slides",  // the div where all your sliding divs are nested in
         selectedWrapper: "jFlowSelected",  // just pure text, no sign
         width: "680px",  // this is the width for the content-slider
         height: "350px",  // this is the height for the content-slider
         duration: 400,  // time in miliseconds to transition one slide
         prev: ".jFlowPrev", // must be class, use . sign
         next: ".jFlowNext", // must be class, use . sign
         auto: true  
    });
});
*/

/*** Custom JFlow w/ auto option ***/
$(document).ready(function()
{
   initSlider();
});

$(window).resize(function()
{
   /*
   // Figure out the width of the screen
   var winWidth = $("#container").width() - 375 - 70;
   //alert(winWidth);

   if(winWidth < 580)
   winWidth = 580;
   
   $(".slidingContent").css("width",winWidth+"px");
   */
   
   initSlider();
});

function initSlider()
{
   // Figure out the width of the screen
   var winWidth = $("#container").width() - 375 - 70;
   //alert(winWidth);
   
   if(winWidth < 580)
      winWidth = 580;

   $(".jFlowPrev div").show();   
   $(".jFlowNext div").show();   
   $(".jFlowNext div").css("left",winWidth+"px");

   $("#slider").jFlow(
   {
      controller: ".jFlowControl",
      slideWrapper: "#jFlowSlider",
      slides: "#slides",
      selectedWrapper: "jFlowSelected",
      //width: "580px",
      width: winWidth+"px",
      height: "350px",
      duration:400,
      slideTimer: 8000,
      loopSlides: true,
      //slideTimer: 1000,
      prev: ".jFlowPrev",
      next: ".jFlowNext",
      auto: true
   });
}


/******************************************/
