
jQuery(document).ready(function($) {

	//Autobox
	$('.autobox').autobox();
	 
	 
	//Limit popular brands on homepage
	var from = 0, step = 5;
	
	function limitList(list) {
	  list
	    .find('li').hide().end()
	    .find('li:lt(' + (from + step) + '):not(li:lt(' + from + '))')
	      .show();
	  from += step;
	}

	limitList($('.Left #SideShopByBrand ul'));

	
	//Init banner cycle
	$('#home_banner').cycle({ 
	    fx:     'fade',
	    speed:  'slow',
	    timeout: 6000,
		 pager: '#nav', 
		 pagerEvent: 'mousedown',
		 pauseOnPagerHover: true 
	});
	
	
	// Fix IE z-index bug
	if ($.browser.msie  && parseInt($.browser.version) == 7) {
		$(function() {
			var zIndexNumber = 1000;
			$('body.home #Container div').each(function() {
				$(this).css('zIndex', zIndexNumber);
				zIndexNumber -= 10;
			});
			$('.SideCategoryListFlyout ul li').each(function() {
				$(this).css('z-index', zIndexNumber);
				zIndexNumber -= 10;
			});
		});
	}
	
	if ($.browser.msie  && parseInt($.browser.version) == 6) {
		$(function() {
			var zIndexNumber = 1000;
			$('body.home #Container div').each(function() {
				$(this).css('zIndex', zIndexNumber);
				zIndexNumber -= 10;
			});
			$('.SideCategoryListFlyout ul li').each(function() {
				$(this).css('z-index', zIndexNumber);
				zIndexNumber -= 10;
			});
		});
	}
	
});



	
