// JavaScript Document
$(function(){

  // update all z-indexes
	var zIndexNumber = 2000;
	$('div').each(function() {
		$(this).css('zIndex', zIndexNumber);
		zIndexNumber -= 1;
	});
	
  //resolve menu and revolver issue	
 $('#menu_zindex li').hover(function() {
		$('#revolver').hide();
		
	},function() {
		$('#revolver').show();
	});
	
	 $('ul#menu_zindex li ul').hover(function() {
		$('#revolver').hide();
		
	},function() {
		$('#revolver').show();
	});

     /// scrolling brands
	$("#images").scrollingList({SLheight:"90px",SLwidth:"1090px"});
	
	
	//revolver delivery info
	      $("#revolver").children("li:first").addClass("activeItem");
              $(".activeItem").next("li").addClass("nextActive");

             i = 0;
             $.each($("#revolver").children("li"),function(){
                 i++;
                 $(this).attr("id","li"+i);
                 if($(this).hasClass("activeItem")){
                     $(this).show();
                     }
              });


             var myTim=setInterval(autoSlide,3000);


              function autoSlide(){
                 var count = $("#revolver").children().length;
                 if($(".nextActive").attr("id")=="li"+count){
                     var ni = "li1";
                 }else{
                     var ni = $(".nextActive").next("li").attr("id");
                 }
                 $(".activeItem").fadeOut("slow").removeClass("activeItem");
                 
$(".nextActive").fadeIn("slow").removeClass("nextActive").addClass("activeItem");
                 $("#"+ni).addClass("nextActive");


              }


	
});
