jQuery(document).ready(function($){

$.fn.animateFrames = function() {


// to turn on the slide show, uncomment the following lines and remove the slideshowFrame01 call below it
for (var i = 4; i < 9; i++) {
    var x, timer;
    x = i % 4;
    timer = (i-4)*7000;
    switch (x)
    {
        case 0 :
            setTimeout(function(){$().slideshowFrame01();}, timer);
            break;
        case 1 :
            setTimeout(function(){$().slideshowFrame02();}, timer);
            break;
        case 2 :
            setTimeout(function(){$().slideshowFrame03();}, timer);
            break;
        case 3 :
            setTimeout(function(){$().slideshowFrame04();}, timer);
            break;
        default :
            setTimeout(function(){$().slideshowFrame01();}, timer);
    }    
}

//$().slideshowFrame01();

};


$().animateFrames();


$("a:contains('View First Banner')").click(function(){
   $().slideshowHideAll();
   $("#banner01").fadeIn(4000);
   $("#caption01").animate({ height: 52 }, "slow");
   $(this).blur();
   $(this).css({ backgroundPosition: 'bottom center' });  
});

$("a:contains('View Second Banner')").click(function(){
   $().slideshowHideAll();
   $("#banner02").fadeIn(4000);
   $("#caption02").animate({ height: 52 }, "slow");
   $(this).blur();
   $(this).css({ backgroundPosition: 'bottom center' });  
});

$("a:contains('View Third Banner')").click(function(){
   $().slideshowHideAll();
   $("#banner03").fadeIn(4000);
   $("#caption03").animate({ height: 52 }, "slow");
   $(this).blur();
   $(this).css({ backgroundPosition: 'bottom center' });  
});

$("a:contains('View Fourth Banner')").click(function(){
   $().slideshowHideAll();
   $("#banner04").fadeIn(4000);
   $("#caption04").animate({ height: 52 }, "slow");
   $(this).blur();
   $(this).css({ backgroundPosition: 'bottom center' });  
});


});
