
	
        var $j = jQuery.noConflict(); 
        
        if($j.browser.msie && parseInt($j.browser.version, 10) == 6) {
            try {
                document.execCommand("BackgroundImageCache", false, true);
            } catch(err) {}
        }

        $j(document).ready(function(){
            $j('#navHead').superfish({
                delay: 750,
                speed: 'normal',
                autoArrows: false,
                dropShadows: false 
            }).find('ul').bgIframe();
            $j('.slideshow').cycle({
				fx: 'fade',
				timeout: 5000,
				pager:  '#nav',
				slideExpr: 'li',
				pause: 1,
				pauseOnPagerHover: 1
		 	});    
            $j('.actionTop, .revealLists, #sparesAccessories .revealAccessories').hide();
			$j('#informationSidebarLeft .nav li:last').addClass("last");
			$j('.reveal').css('visibility','hidden');
            $j('.productListing .item').hover(function() {
                $j(this).addClass('showReveal');
            }, function() {
                $j(this).removeClass('showReveal');
            });

			$j('#utility .account, #basketHead, .pgNumdd').hoverIntent({
				timeout: 500, // number = milliseconds delay before onMouseOut    
			     over:function(){$j(this).addClass('showReveal');},
				 out: function(){$j(this).removeClass('showReveal');}
			});
            $j(".tabs").tabs();
            $j(".tooltip-target").ezpz_tooltip(
				{
					contentPosition: 'aboveStatic',
					stayOnContent: true
				});
            $j(".modalIframe, #productWarning a").fancybox({
                'width'				: '75%',
                'height'			: '75%',
                'autoScale'			: true,
                'transitionIn'		: 'none',
                'transitionOut'		: 'none',
                'type'				: 'iframe'
            });
            $j(".modalSwf").fancybox({
				'width'				: 700,
                'height'			: 550,
                'padding'           : 0,
                'autoScale'     	: true,
                'transitionIn'		: 'none',
                'transitionOut'		: 'none'
            });
			$j(".modalImage").fancybox({
				'titleShow'		    : false
			});
			$j("#login_box_link").fancybox({
				'width'				: 400,
                'height'			: 400,
                'autoScale'			: false
			});
            $j("#terms_conditions_link").fancybox({
				'width'				: 700,
                'height'			: 400,
                'autoScale'			: false
			});			
			$j('#discount-coupon-form').click(function() {
                $j(this).addClass('showReveal');
			});
			$j(".categoriesSubcategories .row1Section .item ul, .same1Row  .recentlyViewed .colContent").equalizeCols();
			$j(".categoriesSubcategories .row2Section .item ul").equalizeCols();
			/*$j(".tabsAccessories.withAccessories .tabContent4,  .tabsAccessories.withAccessories .colContent3").equalizeCols();*/	
			$j('.checkboxLogin').click(function() {
				if ($j('.checkboxLogin').is(':checked')) {
					$j('.actionTop').slideDown("slow");
				} else {
					$j('.actionTop').slideUp("fast");
				}
			});
            
			$j('#selectLists, #allLists').click(function() {
				if ($j('#selectLists').is(':checked')) {
					$j('.revealLists').slideDown("slow");
				} else {
					$j('.revealLists').slideUp("fast");
				}
			});
            
			$j('#allLists').click(function() {
				$j(".revealLists input").attr('checked', 'checked');
            });
            
            if ($j('#selectLists').is(':checked')) {
                $j('.revealLists').slideDown("slow");
            } else {
                $j('.revealLists').slideUp("fast");
            }
			
			$j('#sparesAccessories .revealIt').click(function() {
				$j('#sparesAccessories .revealLink').hide();
			});
			
			$j('#sparesAccessories .revealIt').click(function() {
				$j('#sparesAccessories .revealAccessories').slideDown("slow");
			});
            
            // Close add to cart popup if clicking elsewhere
            $j(document).click(function(e) {
                if (!$j(e.target).parents().andSelf().is('.ajaxCartContent')) {
                    $j('.ajaxcartpro_confirm').fadeOut('slow'); //.css('display', 'none');
                }
                return true;
            });

			$j("#searchBarWrap").hover(function () {
			     $j("#searchBarWrap").addClass("searchHover");
			},function () {
			     $j("#searchBarWrap").removeClass("searchHover");
			});
			$j("#search").focus(function () {
			     $j("#searchBarWrap").addClass("searchFocus");
			});
			$j("#search").blur(function () {
			     $j("#searchBarWrap").removeClass("searchFocus");
			});
			
            /*if (document.getElementById('christmasdays')) {
                var today = new Date();
                var ChristmasDay = new Date("December 25, 2010");
                var timeLeft = (ChristmasDay.getTime() - today.getTime());
                var daysLeft = Math.floor(timeLeft / (24 * 60 * 60 * 1000));
                document.getElementById('christmasdays').innerHTML = daysLeft;
            }*/

		   
			
			$j(function() {$j('.productsListViewWrap .shortDesc').truncate({max_length: 240, more: 'show more', less: 'show less'});});	
  });

