﻿/*left sort menu delay:10ms*/
(function($) {
    $.fn.hoverForIE6 = function(option) {
        var s = $.extend({ current: "hover", delay: 10}, option || {});
        $.each(this,function() {
            var timer1 = null,timer2 = null,flag = false;
            $(this).bind("mouseover", function() {
                if (flag) {
                    clearTimeout(timer2);
                } else {
                    var _this = $(this);
                    timer1 = setTimeout(function() {
                        _this.addClass(s.current);
                        flag = true;
                    },
                    s.delay);
                }
            }).bind("mouseout", function() {
                if (flag) {
                    var _this = $(this);
                    timer2 = setTimeout(function() {
                        _this.removeClass(s.current);
                        flag = false;
                    },
                    s.delay);
                } else {
                    clearTimeout(timer1);
                }
            })
        })
    }
})(jQuery);


$(function(){	   
	$(".left01 .item").hoverForIE6({delay:150});

/*mid change images delay:5000ms*/
	var $cts = $(".btnList li");
	var icount = 3;			//图片张数
	var autorun;			//定时器
	var numb = 0;			//首张索引
	var ctsdelay = 5000;	//单张延迟
	$cts.each(function(index){
		$(this).click(function(e){
			if(!$(this).is(".current"))
			{
				$(".imgList").stop(true,false).animate({left: -(480*index)}, "fast");
				$cts.filter(".current").removeClass("current");
				$(this).addClass("current");
			}
			numb = index + 1;
			clearTimeout(autorun);
			autorun = setTimeout(autoRun,ctsdelay);
		});
	});

	function autoRun(){
		if(numb == icount) numb = 0;
		$(".btnList li").eq(numb).click();
	}
	$(".btnList li").eq(numb).click();	
	
	
/*	
	$(".item").hover(function(){
		alert($(this).find(".i-col").css("zIndex")+"   and   "+$(""));
		
	},function(){
		alert($(this).find(".i-col").css("zIndex"));	
	});*/
	
});



