var sina={$:function(objName){if(document.getElementById){return eval('document.getElementById("'+objName+'")')}else{return eval('document.all.'+objName)}},isIE:navigator.appVersion.indexOf("MSIE")!=-1?true:false,addEvent:function(l,i,I){if(l.attachEvent){l.attachEvent("on"+i,I)}else{l.addEventListener(i,I,false)}},delEvent:function(l,i,I){if(l.detachEvent){l.detachEvent("on"+i,I)}else{l.removeEventListener(i,I,false)}},readCookie:function(O){var o="",l=O+"=";if(document.cookie.length>0){var i=document.cookie.indexOf(l);if(i!=-1){i+=l.length;var I=document.cookie.indexOf(";",i);if(I==-1)I=document.cookie.length;o=unescape(document.cookie.substring(i,I))}};return o},writeCookie:function(i,l,o,c){var O="",I="";if(o!=null){O=new Date((new Date).getTime()+o*3600000);O="; expires="+O.toGMTString()};if(c!=null){I=";domain="+c};document.cookie=i+"="+escape(l)+O+I},readStyle:function(I,l){if(I.style[l]){return I.style[l]}else if(I.currentStyle){return I.currentStyle[l]}else if(document.defaultView&&document.defaultView.getComputedStyle){var i=document.defaultView.getComputedStyle(I,null);return i.getPropertyValue(l)}else{return null}}};

function ScrollPic(scrollContId, arrLeftId, arrRightId, dotListId) {
    this.scrollContId = scrollContId;
    this.arrLeftId = arrLeftId;
    this.arrRightId = arrRightId;
    this.dotListId = dotListId;
    this.dotClassName = "dotItem";
    this.dotOnClassName = "dotItemOn";
    this.dotObjArr = [];
    this.pageWidth = 0;
    this.frameWidth = 0;
    this.speed = 10;
    this.space = 10;
    this.pageIndex = 0;
    this.autoPlay = true;
    this.autoPlayTime = 8;
    var _autoTimeObj, _scrollTimeObj, _state = "ready";
    this.stripDiv = document.createElement("DIV");
    this.listDiv01 = document.createElement("DIV");
    this.listDiv02 = document.createElement("DIV");
    if (!ScrollPic.childs) {
        ScrollPic.childs = []
    };
    this.ID = ScrollPic.childs.length;
    ScrollPic.childs.push(this);
    this.initialize = function() {
        if (!this.scrollContId) {
            throw new Error("必须指定scrollContId.");
            return
        };
        this.scrollContDiv = sina.$(this.scrollContId);
        if (!this.scrollContDiv) {
            throw new Error("scrollContId不是正确的对象.(scrollContId = \"" + this.scrollContId + "\")");
            return
        };
        this.scrollContDiv.style.width = this.frameWidth + "px";
        this.scrollContDiv.style.overflow = "hidden";
        this.listDiv01.innerHTML = this.listDiv02.innerHTML = this.scrollContDiv.innerHTML;
        this.scrollContDiv.innerHTML = "";
        this.scrollContDiv.appendChild(this.stripDiv);
        this.stripDiv.appendChild(this.listDiv01);
        this.stripDiv.appendChild(this.listDiv02);
        this.stripDiv.style.overflow = "hidden";
        this.stripDiv.style.zoom = "1";
        this.stripDiv.style.width = "32766px";
        this.listDiv01.style.cssFloat = "left";
        this.listDiv02.style.cssFloat = "left";
        sina.addEvent(this.scrollContDiv, "mouseover", Function("ScrollPic.childs[" + this.ID + "].stop()"));
        sina.addEvent(this.scrollContDiv, "mouseout", Function("ScrollPic.childs[" + this.ID + "].play()"));
        if (this.arrLeftId) {
            this.arrLeftObj = sina.$(this.arrLeftId);
            if (this.arrLeftObj) {
                sina.addEvent(this.arrLeftObj, "mousedown", Function("ScrollPic.childs[" + this.ID + "].rightMouseDown()"));
                sina.addEvent(this.arrLeftObj, "mouseup", Function("ScrollPic.childs[" + this.ID + "].rightEnd()"));
                sina.addEvent(this.arrLeftObj, "mouseout", Function("ScrollPic.childs[" + this.ID + "].rightEnd()"))
            }
        };
        if (this.arrRightId) {
            this.arrRightObj = sina.$(this.arrRightId);
            if (this.arrRightObj) {
                sina.addEvent(this.arrRightObj, "mousedown", Function("ScrollPic.childs[" + this.ID + "].leftMouseDown()"));
                sina.addEvent(this.arrRightObj, "mouseup", Function("ScrollPic.childs[" + this.ID + "].leftEnd()"));
                sina.addEvent(this.arrRightObj, "mouseout", Function("ScrollPic.childs[" + this.ID + "].leftEnd()"))
            }
        };
        if (this.dotListId) {
            this.dotListObj = sina.$(this.dotListId);
            if (this.dotListObj) {
                var pages = Math.round(this.listDiv01.offsetWidth / this.frameWidth + 0.4),
                i,
                tempObj;
                for (i = 0; i < pages; i++) {
                    tempObj = document.createElement("span");
                    this.dotListObj.appendChild(tempObj);
                    this.dotObjArr.push(tempObj);
                    if (i == this.pageIndex) {
                        tempObj.className = this.dotClassName
                    } else {
                        tempObj.className = this.dotOnClassName
                    };
                    //tempObj.title = "第" + (i + 1) + "页";
                    sina.addEvent(tempObj, "click", Function("ScrollPic.childs[" + this.ID + "].pageTo(" + i + ")"))
                }
            }
        };
        if (this.autoPlay) {
            this.play()
        }
    };
    this.leftMouseDown = function() {
        if (_state != "ready") {
            return
        };
        _state = "floating";
        _scrollTimeObj = setInterval("ScrollPic.childs[" + this.ID + "].moveLeft()", this.speed)
    };
    this.rightMouseDown = function() {
        if (_state != "ready") {
            return
        };
        _state = "floating";
        _scrollTimeObj = setInterval("ScrollPic.childs[" + this.ID + "].moveRight()", this.speed)
    };
    this.moveLeft = function() {
        if (this.scrollContDiv.scrollLeft + this.space >= this.listDiv01.scrollWidth) {
            this.scrollContDiv.scrollLeft = this.scrollContDiv.scrollLeft + this.space - this.listDiv01.scrollWidth
        } else {
            this.scrollContDiv.scrollLeft += this.space
        };
        this.accountPageIndex()
    };
    this.moveRight = function() {
        if (this.scrollContDiv.scrollLeft - this.space <= 0) {
            this.scrollContDiv.scrollLeft = this.listDiv01.scrollWidth + this.scrollContDiv.scrollLeft - this.space
        } else {
            this.scrollContDiv.scrollLeft -= this.space
        };
        this.accountPageIndex()
    };
    this.leftEnd = function() {
        if (_state != "floating") {
            return
        };
        _state = "stoping";
        clearInterval(_scrollTimeObj);
        var fill = this.pageWidth - this.scrollContDiv.scrollLeft % this.pageWidth;
        this.move(fill)
    };
    this.rightEnd = function() {
        if (_state != "floating") {
            return
        };
        _state = "stoping";
        clearInterval(_scrollTimeObj);
        var fill = -this.scrollContDiv.scrollLeft % this.pageWidth;
        this.move(fill)
    };
    this.move = function(num, quick) {
        var thisMove = num / 5;
        if (!quick) {
            if (thisMove > this.space) {
                thisMove = this.space
            };
            if (thisMove < -this.space) {
                thisMove = -this.space
            }
        };
        if (Math.abs(thisMove) < 1 && thisMove != 0) {
            thisMove = thisMove >= 0 ? 1 : -1
        } else {
            thisMove = Math.round(thisMove)
        };
        var temp = this.scrollContDiv.scrollLeft + thisMove;
        if (thisMove > 0) {
            if (this.scrollContDiv.scrollLeft + thisMove >= this.listDiv01.scrollWidth) {
                this.scrollContDiv.scrollLeft = this.scrollContDiv.scrollLeft + thisMove - this.listDiv01.scrollWidth
            } else {
                this.scrollContDiv.scrollLeft += thisMove
            }
        } else {
            if (this.scrollContDiv.scrollLeft - thisMove <= 0) {
                this.scrollContDiv.scrollLeft = this.listDiv01.scrollWidth + this.scrollContDiv.scrollLeft - thisMove
            } else {
                this.scrollContDiv.scrollLeft += thisMove
            }
        };
        num -= thisMove;
        if (Math.abs(num) == 0) {
            _state = "ready";
            if (this.autoPlay) {
                this.play()
            };
            this.accountPageIndex();
            return
        } else {
            this.accountPageIndex();
            setTimeout("ScrollPic.childs[" + this.ID + "].move(" + num + "," + quick + ")", this.speed)
        }
    };
    this.next = function() {
        if (_state != "ready") {
            return
        };
        _state = "stoping";
        this.move(this.pageWidth, true)
    };
    this.play = function() {
        if (!this.autoPlay) {
            return
        };
        clearInterval(_autoTimeObj);
        _autoTimeObj = setInterval("ScrollPic.childs[" + this.ID + "].next()", this.autoPlayTime * 1000)
    };
    this.stop = function() {
        clearInterval(_autoTimeObj)
    };
    this.pageTo = function(num) {
        if (_state != "ready") {
            return
        };
        _state = "stoping";
        var fill = num * this.frameWidth - this.scrollContDiv.scrollLeft;
        this.move(fill, true)
    };
    this.accountPageIndex = function() {
        this.pageIndex = Math.round(this.scrollContDiv.scrollLeft / this.frameWidth);
        if (this.pageIndex > Math.round(this.listDiv01.offsetWidth / this.frameWidth + 0.4) - 1) {
            this.pageIndex = 0
        };
        var i;
        for (i = 0; i < this.dotObjArr.length; i++) {
            if (i == this.pageIndex) {
                this.dotObjArr[i].className = this.dotClassName
            } else {
                this.dotObjArr[i].className = this.dotOnClassName
            }
        }
    }
};

function quiver(ele,times){
	for(var i = 0; i < times ;i++){
		$(ele).animate({top:'-15px'},100);
		$(ele).animate({top:'15px'},100);
		$(ele).animate({top:'0px'},100);
	}	
}
$(function(){  
	
	$(".PartFour li").eq(1).css("margin","10px 27px","_margin","10px 13px");
	$(".PartFour li").eq(2).css("marginRight","27px","_marginRight","13px");
	$(".idxMask").css({display:"none",opacity:0});
	$(".Products div.d").hover(function(){
		$(this).find(".idxMask").css({display:"block"}).animate({ opacity:0.3},300).dequeue();
		$(this).find(".idxContent").css({borderBottom:"1px solid #efefef"}).animate({top:"160px"},300).dequeue();
	},function(){
		$(this).find(".idxMask").animate({ opacity:0},300,function(){$(this).css({display:"none"})}).dequeue();
		$(this).find(".idxContent").css({borderBottom:"none"}).animate({top:"200px"},300).dequeue()	;
	})
    /*
	var scrollPic_02 = new ScrollPic();
	scrollPic_02.scrollContId   = "ISL_Cont_1"; 
	scrollPic_02.arrLeftId      = "LeftArr";
	scrollPic_02.arrRightId     = "RightArr"; 
	scrollPic_02.frameWidth     = 1002;
	scrollPic_02.pageWidth      = 166; 
	scrollPic_02.speed          = 10; 
	scrollPic_02.space          = 10; 
	scrollPic_02.autoPlay       = false; 
	scrollPic_02.autoPlayTime   = 3; 
	scrollPic_02.initialize();
    */
	var commentIndex = 0;
	var commentValue = 3;
	var bH1C = new Array();
	var bH3C = new Array();
	var bBH = new Array();
	var banner;
    //var bannerBgColor = ["#F2044D","#7CDCD8","#F7E73A","#D47BF7","#79d179"]; 
	var bannerBgColor = ["#F2044D", "#24a6c8", "#F7E73A", "#D47BF7", "#79d179"];
	var bannerImg = ["/Tpl/Home/viicms/common/images/img/left_01.png","/Tpl/Home/viicms/common/images/img/left_02.png","/Tpl/Home/viicms/common/images/img/left_03.png","/Tpl/Home/viicms/common/images/img/left_04.png","/Tpl/Home/viicms/common/images/img/left_05.png"];//定义左边的图片
	var bannerIcon = ["/Tpl/Home/viicms/common/images/img/right01.png","/Tpl/Home/common/viicms/images/img/right02.png","/Tpl/Home/viicms/common/images/img/right03.png","/Tpl/Home/viicms/common/images/img/right04.png","/Tpl/Home/viicms/common/images/img/right05.png"];

	$(".bannerInner div").each(function (i) {
	    bH1C.push($(this).attr('h1content'));
	    bH3C.push($(this).attr('h3content'));
	    bBH.push($(this).attr('buttonLink'));
	});
	var bannerNowIndex = 0;
	var bannerNumber = $(".bannerInner div").length - 1;
	var bannerAutoPlayHolder;
	function chageTime(){
			var gTid = Math.floor(Math.random()*1000+600);
			return gTid;
		}	
	$(".CButtonRight").click(function(){
		commentIndex++;
		$(this).css({background:"#F8044E"});
		$(".CButtonRight , .CButtonLeft").css({visibility:"visible",background:"#f3f3f3"});
		if(commentIndex == commentValue){
		      $(this).css({visibility:"hidden"});
		}
		for(var j = 0; j < commentIndex ; j++){
			$(".commentContent").eq(j).animate({marginLeft:"-394px",opacity:0},300);
		}
		$(".commentContent").eq(commentIndex).animate({marginLeft:"0px",opacity:1},300);	
	})
	$(".CButtonLeft").click(function(){
		commentIndex--;
		$(this).css({background:"#F8044E"});
		$(".CButtonRight , .CButtonLeft").css({visibility:"visible",background:"#f3f3f3"});
		if(commentIndex == 0){
			$(".CButtonLeft").css({visibility:"hidden"});
		}
        $(".commentContent").eq(commentIndex).animate({marginLeft:"0px",opacity:1},300);		
	})
	function chageState(){var gid=Math.floor(Math.random()*29);switch(gid){case 0:x='easeInQuad';break;case 1:x='easeOutQuad';break;case 2:x='easeInOutQuad';break;case 3:x='easeInCubic';break;case 4:x='easeOutCubic';break;case 5:x='easeInOutCubic';break;case 6:x='easeInQuart';break;case 7:x='easeOutQuart';break;case 8:x='easeInOutQuart';break;case 9:x='easeInQuint';break;case 10:x='easeOutQuint';break;case 11:x='easeInOutQuint';break;case 12:x='easeInSine';break;case 13:x='easeOutSine';break;case 14:x='easeInOutSine';break;case 15:x='easeInExpo';break;case 16:x='easeOutExpo';break;case 17:x='easeInOutExpo';break;case 18:x='easeInCirc';break;case 19:x='easeOutCirc';break;case 20:x='easeInOutCirc';break;case 21:x='easeInElastic';break;case 22:x='easeOutElastic';break;case 23:x='easeInOutElastic';break;case 24:x='easeInBack';break;case 25:x='easeOutBack';break;case 26:x='easeInOutBack';break;case 27:x='easeInBounce';break;case 28:x='easeOutBounce';break;case 29:x='easeInOutBounce';break;}return x;};
	function bannerAutoPlay(){
			bannerNowIndex++;
			if(bannerNowIndex > bannerNumber){bannerNowIndex = 0;}
			changWallPaper();
		}
	function changWallPaper(btnIndex){
			$(".bannerImage  , .bannerSlogan").remove().empty().detach();
			
			if(btnIndex != null){bannerNowIndex = btnIndex;}
	
			$(".Banner").css({background:bannerBgColor[bannerNowIndex]});
			switch(bannerNowIndex){
				case 0:	
					createBanner(0);
					$(".bannerImage").animate({top:"50px",opacity:1},chageTime(),chageState());
					$(".bannerSlogan").animate({top:"200px",right:"0",opacity:1},chageTime(),chageState(),function(){changeTip();});
					break;
				case 1:
					createBanner(1);
					$(".bannerImage").animate({top:"0",opacity:1},chageTime(),chageState());
					$(".bannerSlogan").animate({bottom:"100px",opacity:1},chageTime(),chageState(),function(){changeTip();});
					break;
				case 2:
					createBanner(2);
					$(".bannerImage").animate({right:"330px",opacity:1},chageTime(),chageState());
					$(".bannerSlogan").animate({top:"150px",opacity:1},chageTime(),chageState(),function(){changeTip();});
					break;
				case 3:
					createBanner(3);
					$(".bannerImage").animate({ top: "80px", right: "330px", opacity: 1 }, chageTime(), chageState());
					$(".bannerSlogan").animate({bottom:"100px",opacity:1},chageTime(),chageState(),function(){changeTip();});
					break;
				case 4:
					createBanner(4);
					$(".bannerImage").animate({top:"103px",opacity:1},chageTime(),chageState());
					$(".bannerSlogan").animate({bottom:"100px",opacity:1},chageTime(),chageState(),function(){changeTip();});
					break;
				default:
					break;
			}
			$(".bannerControl li").css({background:"black"});
			$(".bannerControl li").eq(bannerNowIndex).css({background:"#FF009D"});
		}
			function createBanner(i){
			banner = "<img src='"+bannerImg[i]+"' class='bannerImage bannerI"+i+"'  />" +
					"<div class='bannerSlogan bannerS"+i+"'>" +
						"<div class='bAS C'>" +
							"<div class='bannerIcon'>" +
								"<img src='"+bannerIcon[0]+"' /></div>" +
								"<div class='bannerTitle'>"+bH1C[i]+"</div>" + 
								"<div class='bannerDesc'>"+bH3C[i]+"</div>" + 
								"<div class='bannerButton'>" +
									"<a href='http://www.viicms.com/' target='_blank'>ReadMore</a>" +
								"</div></div></div>";
								
			$(".bannerInner").append(banner);
			$(".bannerImage").css("position","absolute");
		}
	
	if(typeof document.body.style.maxHeight === "undefined") {
			window.browserIE6 = true;
	}
	
	if(window.browserIE6){
		$(".bannerInner , .bannerLeftBar , .bannerControl , .bannerRightBar").css({display:"none"});
		$(".Banner").css({background:"url(images/IEBANNER.jpg) no-repeat center"});
	}else{
		changWallPaper();
		bannerAutoPlayHolder = setInterval(bannerAutoPlay,6000);	
		function changeTip(){
			$(".bannerIcon").animate({left:0},500,chageState());
			$(".bannerTitle").animate({top:"20px"},500,chageState());
			$(".bannerDesc").animate({left:"5px"},500,chageState());
			$(".bannerButton").animate({right:"85px"},500,chageState());
		}
		
	
	
		
		$(".bannerControl li").click(function(){
			clearInterval(bannerAutoPlayHolder);
			var blI = $(this).index(); 
			changWallPaper(blI);
			bannerAutoPlayHolder = setInterval(bannerAutoPlay,6000);
		})
		
		
		$(".bannerLeftBar").click(function(){
			clearInterval(bannerAutoPlayHolder);
			bannerNowIndex--;
			if(bannerNowIndex < 0 ){bannerNowIndex = bannerNumber;}
			changWallPaper();
			bannerAutoPlayHolder = setInterval(bannerAutoPlay,6000);
		})
		$(".bannerRightBar").click(function(){
			clearInterval(bannerAutoPlayHolder);
			bannerNowIndex++;
			if(bannerNowIndex > bannerNumber ){bannerNowIndex = 0;}
			changWallPaper();
			bannerAutoPlayHolder = setInterval(bannerAutoPlay,6000);
		});
		 $(".bannerLeftBar , .bannerRightBar").css({opacity:0});
			$(".Banner").hover(function(){
			   $(".bannerLeftBar , .bannerRightBar").animate({opacity:1},200).dequeue();
		 },function(){
			   $(".bannerLeftBar , .bannerRightBar").animate({opacity:0},200).dequeue();
		 })
	}
	
	 
	 if(window.browserIE6 == true){
		$(".PartFour li").hover(function(){
			$(this).css({background:"#F2044D"});
			$(this).find("span").css({color:"white"});
			$(this).find("h3").css({color:"white"});		
		},function(){
			$(this).css({background:"none"});	
			$(this).find("h3").css({color:"#4c4c59"});
			$(this).find("span").css({color:"#787887"});
		});
	}else{
		$(".PartFour li").hover(function(){
		$(this).find(".smallP").animate({width:"229px",left:0},300,'easeOutQuart',function(){
			$(this).parent().parent().find("span , h3").css({color:"#fff"});
			$(this).animate({top:0,height:"100%"},300,'easeOutQuart')
		}).dequeue();
		},function(){
			$(this).find(".smallP").animate({height:"90px"},300,'easeOutQuart',function(){
			$(this).parent().parent().find("h3").css({color:"#4c4c59"}).parent().parent().find("span.w70").css({color:"#787887"});
			$(this).animate({left:"115px",width:"0px",height:"90px",top:"0px"}),300,'easeOutQuart'}).dequeue();	
		});
	}
	$(".Features a").hover(function(){
		var aN = -$(this).index()*66 - 396;
		$(this).find("dt").css({background:"url(/templates/default/img/sprite.jpg) "+aN+"px -152px "});
	},function(){
		var aN = -$(this).index()*66;
		$(this).find("dt").css({background:"url(/templates/default/img/sprite.jpg)  "+aN+"px -152px "});
	});
	$(".CButtonLeft , .CButtonRight , #LeftArr , #RightArr").hover(function(){$(this).css({background:"#F8044E"})},function(){$(this).css({background:"#f3f3f3"});})

	$(".newsTitle span").click(function(){
		var x = $(this).index();
		$(".newsTitle span").css({background:"#EDEDED",borderBottom:"1px solid #D8D8D8"});
		if(x == 0){
			$(".news_part").animate({marginTop:"0",opacity:0},500).dequeue();
		}else if(x == 1){
			$(".news_part").eq(0).animate({marginTop:"-290px",opacity:0},500).dequeue();
		}else{
			$(".news_part").eq(0).animate({marginTop:"-290px",opacity:0},500).dequeue();
			$(".news_part").eq(1).animate({marginTop:"-290px",opacity:0},500).dequeue();
			$(".news_part").eq(2).animate({marginTop:"0",opacity:0},500).dequeue();
		}
		$(this).css({background:"#fff",borderBottom:"none"});
		$(".news_part").eq(x).animate({marginTop:"0",opacity:1},500).dequeue();
	});
	$(".news_part_Content li").hover(function(){
		$(this).find("span.l").animate({textIndent:"50px"},300).dequeue();	
	},function(){
		$(this).find("span.l").animate({textIndent:"30px"},300).dequeue();	
	});
	$(".newsTitle span").eq(0).css({background:"#fff",borderBottom:"none"});
	
	var cooperate = "<span class='box'></span><span class='box'></span><span class='box'></span><span class='box'></span><span class='box'></span><span class='box'></span><span class='box'></span><span class='box'></span><span class='box'></span><span class='box'></span><span class='box'></span>";
	//$("#ISL_Cont_1 div").eq(0).append(cooperate);
	for(var i = 0 ; i < 11 ; i++){
		$(".box").eq(i).css({background:"url(/templates/default/img/sprite.jpg) -"+140*i+"px 0"});
	}
	//$("#ISL_Cont_1 div").eq(1).append(cooperate);
	for(var i = 0 ; i < 11 ; i++){
		$(".box").eq(i).css({background:"url(/templates/default/img/sprite.jpg) -"+140*i+"px 0"});
	}
	quiver($(".Logo"),2);
	$(".Logo").mouseover(function(){
		quiver($(".Logo"),2);
	})
	
	$(".blk_29 , #LeftArr , #RightArr").hover(function(){
			clearInterval(cE);
	},function(){
		cE = setInterval(changeCe,5000);
	})
	function changeCe(){
		$(".cooperateControl #LeftArr").trigger("click");
	}
	
	var cE = setInterval(changeCe,5000);
	
	$(".Products li").hover(function(){
		$(this).find(".proImg2").animate({left:0},300).dequeue();
		$(this).find(".proBelow").animate({top:"195px"},300).dequeue();	
		$(this).find(".proTitle").css({background:"#EC054B",color:"#fff"});
	},function(){
		$(this).find(".proImg2").animate({left:'-320px'},300).dequeue();
		$(this).find(".proBelow").animate({top:"220px"},300).dequeue();	
		$(this).find(".proTitle").css({background:"none",color:"black"});
	});
	$(".proCUp").click(function(){
		var proA = new Array();
		for(var i = 0 ; i < 3 ; i++){
			proA[i] = $(".Products .proRow").eq(0);	
		}
		proA[3] = proA[0];
		$(proA[0]).animate({opacity:0,height:0},400,function(){
			$(proA[3]).appendTo($(".Products"));
			$(".Products .proRow").last().css({height:"252px",opacity:1});
		}).dequeue();	
	});
	$(".proCDown").click(function(){
		var proA = new Array();
		for(var i = 0 ; i < 3 ; i++){
			proA[i] = $(".Products .proRow").eq(0);	
		}
		proA[3] = proA[2];
		$(".Products .proRow").last().css({opacity:0,height:0}).insertBefore($(".Products .proRow").eq(0)).animate({height:'252px',opacity:1},300).dequeue();
		
	})
	
})

/*---------------------------------jQuery.easing-------------------------------------*/
jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,f,a,h,g){return jQuery.easing[jQuery.easing.def](e,f,a,h,g)},easeInQuad:function(e,f,a,h,g){return h*(f/=g)*f+a},easeOutQuad:function(e,f,a,h,g){return -h*(f/=g)*(f-2)+a},easeInOutQuad:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f+a}return -h/2*((--f)*(f-2)-1)+a},easeInCubic:function(e,f,a,h,g){return h*(f/=g)*f*f+a},easeOutCubic:function(e,f,a,h,g){return h*((f=f/g-1)*f*f+1)+a},easeInOutCubic:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f+a}return h/2*((f-=2)*f*f+2)+a},easeInQuart:function(e,f,a,h,g){return h*(f/=g)*f*f*f+a},easeOutQuart:function(e,f,a,h,g){return -h*((f=f/g-1)*f*f*f-1)+a},easeInOutQuart:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f+a}return -h/2*((f-=2)*f*f*f-2)+a},easeInQuint:function(e,f,a,h,g){return h*(f/=g)*f*f*f*f+a},easeOutQuint:function(e,f,a,h,g){return h*((f=f/g-1)*f*f*f*f+1)+a},easeInOutQuint:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f*f+a}return h/2*((f-=2)*f*f*f*f+2)+a},easeInSine:function(e,f,a,h,g){return -h*Math.cos(f/g*(Math.PI/2))+h+a},easeOutSine:function(e,f,a,h,g){return h*Math.sin(f/g*(Math.PI/2))+a},easeInOutSine:function(e,f,a,h,g){return -h/2*(Math.cos(Math.PI*f/g)-1)+a},easeInExpo:function(e,f,a,h,g){return(f==0)?a:h*Math.pow(2,10*(f/g-1))+a},easeOutExpo:function(e,f,a,h,g){return(f==g)?a+h:h*(-Math.pow(2,-10*f/g)+1)+a},easeInOutExpo:function(e,f,a,h,g){if(f==0){return a}if(f==g){return a+h}if((f/=g/2)<1){return h/2*Math.pow(2,10*(f-1))+a}return h/2*(-Math.pow(2,-10*--f)+2)+a},easeInCirc:function(e,f,a,h,g){return -h*(Math.sqrt(1-(f/=g)*f)-1)+a},easeOutCirc:function(e,f,a,h,g){return h*Math.sqrt(1-(f=f/g-1)*f)+a},easeInOutCirc:function(e,f,a,h,g){if((f/=g/2)<1){return -h/2*(Math.sqrt(1-f*f)-1)+a}return h/2*(Math.sqrt(1-(f-=2)*f)+1)+a},easeInElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return -(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e},easeOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return g*Math.pow(2,-10*h)*Math.sin((h*k-i)*(2*Math.PI)/j)+l+e},easeInOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k/2)==2){return e+l}if(!j){j=k*(0.3*1.5)}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}if(h<1){return -0.5*(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e}return g*Math.pow(2,-10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j)*0.5+l+e},easeInBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*(f/=h)*f*((g+1)*f-g)+a},easeOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*((f=f/h-1)*f*((g+1)*f+g)+1)+a},easeInOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}if((f/=h/2)<1){return i/2*(f*f*(((g*=(1.525))+1)*f-g))+a}return i/2*((f-=2)*f*(((g*=(1.525))+1)*f+g)+2)+a},easeInBounce:function(e,f,a,h,g){return h-jQuery.easing.easeOutBounce(e,g-f,0,h,g)+a},easeOutBounce:function(e,f,a,h,g){if((f/=g)<(1/2.75)){return h*(7.5625*f*f)+a}else{if(f<(2/2.75)){return h*(7.5625*(f-=(1.5/2.75))*f+0.75)+a}else{if(f<(2.5/2.75)){return h*(7.5625*(f-=(2.25/2.75))*f+0.9375)+a}else{return h*(7.5625*(f-=(2.625/2.75))*f+0.984375)+a}}}},easeInOutBounce:function(e,f,a,h,g){if(f<g/2){return jQuery.easing.easeInBounce(e,f*2,0,h,g)*0.5+a}return jQuery.easing.easeOutBounce(e,f*2-g,0,h,g)*0.5+h*0.5+a}});
var sina={$:function(objName){if(document.getElementById){return eval('document.getElementById("'+objName+'")')}else{return eval('document.all.'+objName)}},isIE:navigator.appVersion.indexOf("MSIE")!=-1?true:false,addEvent:function(l,i,I){if(l.attachEvent){l.attachEvent("on"+i,I)}else{l.addEventListener(i,I,false)}},delEvent:function(l,i,I){if(l.detachEvent){l.detachEvent("on"+i,I)}else{l.removeEventListener(i,I,false)}},readCookie:function(O){var o="",l=O+"=";if(document.cookie.length>0){var i=document.cookie.indexOf(l);if(i!=-1){i+=l.length;var I=document.cookie.indexOf(";",i);if(I==-1)I=document.cookie.length;o=unescape(document.cookie.substring(i,I))}};return o},writeCookie:function(i,l,o,c){var O="",I="";if(o!=null){O=new Date((new Date).getTime()+o*3600000);O="; expires="+O.toGMTString()};if(c!=null){I=";domain="+c};document.cookie=i+"="+escape(l)+O+I},readStyle:function(I,l){if(I.style[l]){return I.style[l]}else if(I.currentStyle){return I.currentStyle[l]}else if(document.defaultView&&document.defaultView.getComputedStyle){var i=document.defaultView.getComputedStyle(I,null);return i.getPropertyValue(l)}else{return null}}};

$(function() {
	$(".allp li").hover(function() {
		var x = $(this).html();
		$(this).append("<div id='index_pro_inner'>" + x + "</div>");
		$(this).find("#index_pro_inner .index_pro_amplify").click(function(){
			$(this).children('.index_pro_amplify').trigger('click');
		});
		$(this).find("#index_pro_inner img").animate({
			width: "400px",
			height: "240px",
			marginLeft: "-40px",
			marginTop: "-40px"
		}, 600).dequeue();
		$(this).find("#index_pro_inner  .index_pro_ally").animate({
			bottom: 0
		}, 300).dequeue();
		$(this).find(".index_pro_desc").show();
		$(this).find("#index_pro_inner .index_pro_desc").animate({
			height: "100px"
		}, 400).dequeue();

	}, function() {
		$(this).find(".index_pro_desc").hide();
		$(this).find("#index_pro_inner").remove();
	});
})

/*---------------------------------Png透明-------------------------------------*/
function correctPNG() 
{ 
    var arVersion = navigator.appVersion.split("MSIE") 
    var version = parseFloat(arVersion[1]) 
    if ((version >= 5.5) && (document.body.filters)) 
    { 
       for(var j=0; j<document.images.length; j++) 
       { 
          var img = document.images[j] 
          var imgName = img.src.toUpperCase() 

          if (imgName.substring(imgName.length-3, imgName.length) == "PNG") 
          { 
             var imgID = (img.id) ? "id='" + img.id + "' " : "" 
             var imgClass = (img.className) ? "class='" + img.className + "' " : "" 
             var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' " 
             var imgStyle = "display:inline-block;" + img.style.cssText 
             if (img.align == "left") imgStyle = "float:left;" + imgStyle 
             if (img.align == "right") imgStyle = "float:right;" + imgStyle 
             if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle 
             var strNewHTML = "<span " + imgID + imgClass + imgTitle 
             + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";" 
             + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" 
             + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
             img.outerHTML = strNewHTML 
             j = j-1 
          } 
       } 
    }    
} 
if (window.ActiveXObject) {
  var ua = navigator.userAgent.toLowerCase();
  var ie=ua.match(/msie ([\d.]+)/)[1]
  if(ie==6.0){
  	 window.attachEvent("onload", correctPNG);
  }
}
function quiver(ele,times){
	for(var i = 0; i < times ;i++){
		$(ele).animate({top:'-15px'},100);
		$(ele).animate({top:'15px'},100);
		$(ele).animate({top:'0px'},100);
	}	
}
$(function(){
	$(".topTag").css({opacity:0.7}); //标签透明
	$(".contactBelow").animate({opacity:0.6},600); //联系我们背景透明
	$(".Logo").mouseover(function(){ //logo跳动
		quiver($(".Logo"),1);
	})
/*---------------------------------右侧导航的效果-------------------------------------*/	
	$(".ItemUnHovered").hover(function(){
		$(this).find(".dnRightItem").animate({left:0},500,'easeOutBounce').dequeue();	
	},function(){
		$(this).find(".dnRightItem").animate({left:'-203px'},500,'easeInQuint').dequeue();
	});
/*---------------------------------返回顶部-------------------------------------*/
	var sHeight = $(window).height();
	var gotoTopValue = 0;
	$(".gotoTop").click(function(){
		var goTop=setInterval(scrollMove,10);
		function scrollMove(){
			$(document).scrollTop(gotoTopValue / 1.1)
			if(gotoTopValue<1)clearInterval(goTop);
		}
        
	})
    $(window).scroll(function(){
		gotoTopValue = $(window).scrollTop();
		$(".gotoTop").css({top:gotoTopValue+sHeight*0.8})
	    if( gotoTopValue > 200 ){
			$(".gotoTop").css({visibility:"visible"}).dequeue();	
		}else{
			$(".gotoTop").css({visibility:"hidden"});
		}
	})
/*---------------------------------右侧联系QQ-------------------------------------*/
	$(".contactBox").css({display:"block"}).animate({marginTop:"20px"},1200,'easeOutElastic').dequeue();
/*---------------------------------联系我们-------------------------------------*/
	$(".contactLeft").animate({marginLeft:0},800);
	$(".contactRight").animate({marginRight:0},800);
/*---------------------------------footerOrder-------------------------------------*/
	$(".idx_name , .idx_email , .idx_phone , .idx_youWant , .idx_submit").hover(function(){
		$(this).animate({opacity:0.7},200).dequeue();
	},function(){
		$(this).animate({opacity:1},200).dequeue();
	})
/*---------------------------------footerNews-------------------------------------*/	
	$(".footerContent li").hover(function(){
		$(this).find("span").first().animate({textIndent:"20px"},300).parent().find("span").css({color:"#ec054b"}).dequeue();
	},function(){
		$(this).find("span").first().animate({textIndent:"0"},300).parent().find("span").css({color:"#979797"}).dequeue();
	})
/*---------------------------------Contact-------------------------------------*/	
	$(".contactLeft li").not(".sp").hover(function(){
		$(this).css({background:"#EC054B",color:"#fff"});	
	},function(){
		$(this).css({background:"#fff",color:"#666"});	
	});
/*---------------------------------MBX-------------------------------------*/	
	var mbxT = 0;
	$(".mbxMk , .mbxMk2").css({opacity:0.3});
	$(".mbxContent").animate({width:$(window).width()*0.4},1200,'easeOutElastic',function(){
		$(".mbxContent2").animate({width:$(window).width()*0.3},800,'easeOutElastic').dequeue();
	});
	$(".mbxCorner").click(function(){
		var x = mbxT % 2 == 0 ? 0 : $(window).width()*0.4;
		var y = mbxT % 2 == 0 ? "style/weixin/images/mbxLeft.png" : "style/weixin/images/mbxLeft3.png";
		$(".mbxContent").animate({width:x},1200,'easeOutElastic',function(){
			$(".mbx").find("img").attr("src",y);
		});
		mbxT++;
	});
/*---------------------------------info_next-------------------------------------*/	
	$(".info_next").hover(function(){
		$(this).css({background:"#EC054B",color:"#fff"}).find("a").css({color:"#fff"});	
	},function(){
		$(this).css({background:"#e5e5e5",color:"black"}).find("a").css({color:"#EC054B"});	
	})	
})