jQuery(document).ready(function(){
	
		// Replace HRs with Divs in IE
		// This is necessary becasue IE doesn't let you style the HR element, and we use it extensively on the site.
	  if (jQuery.browser.msie) {
			jQuery("hr").each(function() {
				var hrClass = jQuery(this).attr("class")
				jQuery(this).wrap("<div class='hr " + hrClass +"'></div>");
			});
		}
		
		// Wrap Callout with an inner div
		// This is necessary to create the graphics on the top and bottom of the callout
		jQuery(".callout-center").each(function() {
			jQuery(this).wrapInner("<div class='inner'></div>");
		});
		
		// Add "last" to the last column in the content
		// This removed the right margin on the third or second column
		jQuery(".column-third + .column-third + .column-third").addClass("column-last");
		jQuery(".column-half + .column-half").addClass("column-last");

		// Activate the drop-down nav in the header
		jQuery("#nav-primary > li").each(function(){
		  var curWidth = Math.ceil(jQuery(this).width() + 1);
			jQuery(this).width(curWidth);
			jQuery(this).find("ul").css("width",curWidth);

		});
		jQuery(".nav-primary-sub").parent().addClass("menu");
		jQuery("li.menu").hover(
      function () {
        jQuery(this).children("ul").show();
				jQuery(this).addClass("hover");
      }, 
      function () {
        jQuery(this).children("ul").hide();
				jQuery(this).removeClass("hover");
      }
    );
		
		// Cycle the home tabs
		jQuery('#home-tabs-container') 
		.after('<ul id="home-tabs-selectors">') 
		.cycle({ 
			 	cleartype:  1, 
				timeout: 10000, 
				speed: 1,
		    pager:  '#home-tabs-selectors',
				pagerEvent:   'click',
				pause:         true,
		    pagerAnchorBuilder: function(idx, slide) { 
		        return '<li class="' + jQuery(slide).attr("id") + ' "><a href="#"><span class="wrap">' + jQuery(slide).find("div.tab-text").html() + '</span></a></li>'; 
		    }
		});
		
		// Cycle the cards at the top of the Features/Benefits Page
		jQuery('#benefits-topper-images') 
		.cycle({ 
			 	cleartype:  1,
		    fx:     'fade', 
		    speed:  'fast', 
		    timeout: 2000
		});
		
		// This activates the fade effect on the homepage logos
		// Change the speed to adjust how quickly the "Fade" is, and change the timeout to alter how long each group is visible.
		jQuery('#home-shops').cycle({
			speed: 1500,
			timeout: 5000,
			random: 1,
			height: '225px'
		});
	
});


