﻿$(function() {
	$(".jcarousel-skin-tango").jcarousel({
		vertical: true,
		scroll: 3
	});

	var index = 0;
	var count = FLASH_COUNT;
	//var count = 8;
	$(".imgshow_1 a").click(function(){
		var url = window.location.protocol + "//" + window.location.host + "/";
		if (this.href != url && this.href != url + "#") {
			window.open(this.href);
		}
		return false;
	})
	$(".imgshow_1 .num li").mouseover(function(){
		index  =  $(".imgshow_1 .num li").index(this);
		showImg(index);
	});	
	$('.imgshow_1').hover(function(){
		if(MyTime){
			clearInterval(MyTime);
		}
	},function(){
		MyTime = setInterval(function(){
		showImg(index)
		index++;
		if(index == count){index=0;}
		} , 5000);
	});

	var MyTime = setInterval(function(){
	showImg(index)
	index++;
	if(index == count){index=0;}
	} , 5000);

})
function showImg(i){
	$(".imgshow_1 .list img")
		.eq(i).stop(true,true).fadeIn()
		.parent().siblings().find("img").hide();
	$(".imgshow_1 .imgtit li")
		.eq(i).show()
		.siblings().hide();
	$(".imgshow_1 .num li")
		.eq(i).addClass("on")
		.siblings().removeClass("on");
}
$(function(){
	$('.imgshow_1 .list img:first, .imgshow_1 .imgtit li:first').show();
	$('.imgshow_1 .num li:first').addClass('on');




	var speed = 30; //数字越大速度越慢 
	var demo = document.getElementById("demo"); 
	var demo1 = document.getElementById("demo1"); 
	var demo2 = document.getElementById("demo2"); 
	demo2.innerHTML = demo1.innerHTML; 
	function Marquee() 
	{ 
		if (demo2.offsetWidth - demo.scrollLeft <= 0) 
		{
			demo.scrollLeft-=demo1.offsetWidth 
		}
		else
		{ 
			demo.scrollLeft++; 
		} 
	}
	var MyMar = setInterval(Marquee, speed); 
	demo.onmouseover = function() {clearInterval(MyMar)}; 
	demo.onmouseout = function() {MyMar = setInterval(Marquee, speed)};
})




