// JavaScript Document
var t=0
var i=1;
var time=6000;	
var speed=500; 
var move=980;

function sh(){
	var picNum=$('.picBox .pic').length;
		function sw(){
			$("#t"+i).fadeIn(800);
		}
		function hi(){
			$("#t"+i).fadeOut(800);
		}
	if(i<picNum){
		hi();
		i=i+1;
		sw();
	}else if(i=picNum){
		hi();
		$("#t1").fadeIn(800);
		i=1;
	}
	setTimeout("sh()",time);
}	
function d(){   
		var s=parseInt($("#pro").width());
		document.getElementById("end").innerHTML=$("#pro div").last().html();
		$("#copy").css({"display": "none"});
		t=t-move; 
		if(t>-s){
			$("#pro").animate({left: t}, speed); 
		}else {
			$("#copy").css({left: "0px",display: "block"});
			$("#copy").animate({left: -move+"px"}, speed); 
			$("#pro").css({left: move+"px"});
			$("#pro").animate({left: "0px"}, speed); 
			t=0;
		}
		setTimeout("d()",time);
	
}
$(function (){
	setTimeout("d()",time);
	setTimeout("sh()",time);
	var n=0;
	var ra=$("#rList .a");
	var rb=$("#rList .rb div");
	var chat=$("#map .chatBox");
	var mapDic=$("#map a");
	var f=0;
	ra.hover(
		function(){
		n=$(this).index();
		$(rb[n]).animate({left: "0px"}, speed);
		},
		function(){
		n=$(this).index();
		$(rb[n]).animate({left: "218px"}, speed);
		}
	)
	mapDic.hover(
		function(){
			f=$(this).index();
			for(var d=0; d<mapDic.length; d++){
				if(d==f){
					$(chat[f]).css("display","block");
				}else{
					$(chat[d]).css("display","none");
				}
			}
		},
		function(){
			f=$(this).index();
			$(chat[f]).css("display","none");
		}
	)
});



