$(document).ready(function(){
		// navigation functions 
		$(".nav").superfish({
			animation : {opacity:"show",height:"show"}
		});
		
		
		
		//slide show functions
		$("#home-slide-images img").each(function() {
				if($(this).hasClass("hiddenSlideImg")) {
					$(this).removeClass("hiddenSlideImg");
				}
			});

		$('#home-slide-images').cycle({
			fx:'fade', speed: 600, delay: 0, timeout: 6000, pause: 1, next: '#home-slide-images',
			before: function(curr, next, opts) {
				var index = $(this).parent().children().index(this);
				var btn = $("#heroBtn" + parseInt(index +1));
				$(btn).animate({opacity: 1}, "fast");
				$(btn).parent().parent().siblings().each(function() {
					$(this).find("img").each(function() {
						$(this).animate({opacity: 0.5}, "fast");
					});
				});
			},
			pager: ".slideButtons", hoverTimeout: 1,
			pagerAnchorBuilder: function(idx, slide) {
				return $("#heroBtn" + parseInt(idx+1)).parent();
			}
		}).hide();

		$("#slideList").fadeIn("slow");
		$("#home-slide-images").fadeIn("slow");

        //modals
        $('a[@rel*=modal]').lightBox();
       

        //accordian
        SetFeatureAccordian();
         
        
        //tooltip
         $(".tooltip").tooltip({
	        track: true,
	        delay: 0,
	        showURL: false,
	        opacity: .5,
	        fixPNG: false,
	        showBody: " - ",
	        extraClass: "icontooltip",
	        top: 5,
	        left: 15
        });
        //
        SetBannerRollovers();
        
        ButtonRollovers();
        //button rollovers
		
	});
	function ButtonRollovers()
	{
	    //global search
	    $(".jqhover").hover(function () {$(this).fadeTo(1,0.60);},function () {$(this).fadeTo(1,1);});
	    
	}
	function SetFeatureAccordian()
	{
	    jQuery('#features').accordion({
           // active: true,
            header: '.header',
            //event: 'mouseover',
            fillSpace: false,
            autoHeight: false,
            animated: 'easeslide',
            cleartype: 1
         });
	}
	
	function SetBannerRollovers()
	{
	    //add hover for category banners
	    $("#actionBtn1").hover(
			    function () {
				    $(this).fadeTo(.6, 0.90);
			    },
			    function () {
				    $(this).fadeTo(1, 1);
			    }
	    );
	}
	function PrintPage()
	{
	    var da = (document.all) ? 1 : 0;
        var pr = (window.print) ? 1 : 0;
        var mac = (navigator.userAgent.indexOf("Mac") != -1); 

        
          if (pr) { // NS4, IE5
  	        this.focus();
            window.print();
          } else if (da && !mac) { // IE4 (Windows)+
  	        vbPrintPage();
          } 
      
	
	
	}