// JavaScript Document


  // create a custom JavaScript object on the fly to handle the  banner rotation 

  large_banner_object = 
  { 
    // index tracks the current image that is being displayed,  
    // starts at 1 because image 0 is the default image (array index's start from 0) 
    index : 1, 
     
    // an array of images for the header 
    large_banner_images : ["eas_large02.jpg", "eas_large01.jpg", "pvl_large.jpg", "pb_large.jpg", "grizzly_large.jpg", "fusion_large.jpg" ], 
    large_banner_links : ["http://www.eascanada.com/", "http://www.eascanada.com/", "http://www.pvldirect.com/", "https://www.powerbalance.net/", "http://www.grizzlyfitness.com/", "http://www.fusionbodybuilding.com/"],
    // function to increase the index value, and reset it if we are at the end of the array 
    inc_index : function() { 
      this.index++;  
       
      if (this.index == this.large_banner_images.length) { 
        this.index = 0; 
      } 
    }, 
     
    // getting function to return the current index 
    get_index : function() { return this.index; }, 
     
    // function  to fade out, swap the image, increase the index and fade in the image 
    swap : function() { 
      // first fade the image out 
      jQuery("#large-banner-ad").fadeOut(0, function() { 
         
        // change the image 
        jQuery("#large-banner-ad").attr({src: "http://wbffshows.com/wp-content/themes/wbff/images/ads/" +  
          large_banner_object.large_banner_images[large_banner_object.index]}); 
		
        // change the link
        jQuery("#large-banner-link").attr({href: large_banner_object.large_banner_links[large_banner_object.index]}); 
		
        // fade the image back in 
        jQuery("#large-banner-ad").fadeIn(0); 
         
       // increase the index 
       large_banner_object.inc_index(); 
      }); 
    } 
  }; 
 
  // swap the image ever 10 seconds 
  setInterval(large_banner_object.swap, 5000); 
  
  
    // create a custom JavaScript object on the fly to handle the  banner rotation 

  skyscraper_banner_object = 
  { 
    // index tracks the current image that is being displayed,  
    // starts at 1 because image 0 is the default image (array index's start from 0) 
    index : 1, 
     
    // an array of images for the header 
    skyscraper_banner_images : ["left_goliath.jpg", "left_naturessource01.jpg"], 
    skyscraper_banner_links : ["http://www.goliathlabs.com/", "http://www.natures-source.com/"],
    // function to increase the index value, and reset it if we are at the end of the array 
    inc_index : function() { 
      this.index++;  
       
      if (this.index == this.skyscraper_banner_images.length) { 
        this.index = 0; 
      } 
    }, 
     
    // getting function to return the current index 
    get_index : function() { return this.index; }, 
     
    // function  to fade out, swap the image, increase the index and fade in the image 
    swap : function() { 
      // first fade the image out 
      jQuery("#skyscraper-banner-ad").fadeOut(0, function() { 
         
        // change the image 
        jQuery("#skyscraper-banner-ad").attr({src: "http://wbffshows.com/wp-content/themes/wbff/images/ads/" +  
          skyscraper_banner_object.skyscraper_banner_images[skyscraper_banner_object.index]}); 
		
        // change the link
        jQuery("#skyscraper-banner-link").attr({href: skyscraper_banner_object.skyscraper_banner_links[skyscraper_banner_object.index]}); 
		
        // fade the image back in 
        jQuery("#skyscraper-banner-ad").fadeIn(0); 
         
       // increase the index 
       skyscraper_banner_object.inc_index(); 
      }); 
    } 
  }; 
 
  // swap the image ever 10 seconds 
  setInterval(skyscraper_banner_object.swap, 5000);
  
  
    // create a custom JavaScript object on the fly to handle the  banner rotation 

  skyscraper_banner_object02 = 
  { 
    // index tracks the current image that is being displayed,  
    // starts at 1 because image 0 is the default image (array index's start from 0) 
    index : 1, 
     
    // an array of images for the header 
    skyscraper_banner_images02 : ["left_mp.jpg", "left_bud.png"], 
    skyscraper_banner_links02 : ["http://musclepharm.com/", "http://budweiser.com/"],
    // function to increase the index value, and reset it if we are at the end of the array 
    inc_index : function() { 
      this.index++;  
       
      if (this.index == this.skyscraper_banner_images02.length) { 
        this.index = 0; 
      } 
    }, 
     
    // getting function to return the current index 
    get_index : function() { return this.index; }, 
     
    // function  to fade out, swap the image, increase the index and fade in the image 
    swap : function() { 
      // first fade the image out 
      jQuery("#skyscraper-banner-ad02").fadeOut(0, function() { 
         
        // change the image 
        jQuery("#skyscraper-banner-ad02").attr({src: "http://wbffshows.com/wp-content/themes/wbff/images/ads/" +  
          skyscraper_banner_object02.skyscraper_banner_images02[skyscraper_banner_object02.index]}); 
		
        // change the link
        jQuery("#skyscraper-banner-link02").attr({href: skyscraper_banner_object02.skyscraper_banner_links02[skyscraper_banner_object02.index]}); 
		
        // fade the image back in 
        jQuery("#skyscraper-banner-ad02").fadeIn(0); 
         
       // increase the index 
       skyscraper_banner_object02.inc_index(); 
      }); 
    } 
  }; 
 
  // swap the image ever 10 seconds 
  setInterval(skyscraper_banner_object02.swap, 5000);
  
      // create a custom JavaScript object on the fly to handle the  banner rotation 

  square3_banner_object = 
  { 
    // index tracks the current image that is being displayed,  
    // starts at 1 because image 0 is the default image (array index's start from 0) 
    index : 1, 
     
    // an array of images for the header 
    square3_banner_images : ["fusion_sidebar.jpg", "grizzly_sidebar.jpg"], 
    square3_banner_links : ["http://www.fusionbodybuilding.com/", "http://www.grizzlyfitness.com/"],
    // function to increase the index value, and reset it if we are at the end of the array 
    inc_index : function() { 
      this.index++;  
       
      if (this.index == this.square3_banner_images.length) { 
        this.index = 0; 
      } 
    }, 
     
    // getting function to return the current index 
    get_index : function() { return this.index; }, 
     
    // function  to fade out, swap the image, increase the index and fade in the image 
    swap : function() { 
      // first fade the image out 
      jQuery("#square3-banner-ad").fadeOut(0, function() { 
         
        // change the image 
        jQuery("#square3-banner-ad").attr({src: "http://wbffshows.com/wp-content/themes/wbff/images/ads/" +  
          square3_banner_object.square3_banner_images[square3_banner_object.index]}); 
		
        // change the link
        jQuery("#square3-banner-link").attr({href: square3_banner_object.square3_banner_links[square3_banner_object.index]}); 
		
        // fade the image back in 
        jQuery("#square3-banner-ad").fadeIn(0); 
         
       // increase the index 
       square3_banner_object.inc_index(); 
      }); 
    } 
  }; 
 
  // swap the image ever 10 seconds 
  setInterval(square3_banner_object.swap, 5000); 
  
  
  