$(function(){
  var i=1,turnbigpic,turnsmallpic
  $.fn.turnimg=function(i,time){
	var j=1,px=-312,bigstr;
	this.each(function()
	{ 
	  if(i==j)
	  {
		if($(this).html()==""){}
		$(".foucebox .scrollimg").animate({top:px*i+312+"px"},time);
	  }
	  j++
	});
	j=1
	$('.foucebox .tiggerbox a').each(function()
	{ 
	  if(i==j)
	  {
		$('.foucebox .tiggerbox a').attr("class","");
		$(this).attr("class","on");
	  }
	  j++
	});
  }
  $.fn.fnturnpic=function()
  {
	if(i<12){i++;}else{i=1;}
	$(this).turnimg(i,300)
  }
  $(".foucebox .tiggerbox a").mouseover(function()
  {
	clearTimeout(turnsmallpic);
	clearTimeout(turnbigpic);
	i=$(this).attr("id");
	turnsmallpic=setTimeout("$('.foucebox .scrollimg').turnimg("+i+",300)",100)
  });
  $(".foucebox .tiggerbox a").mouseout(function()
  {
	clearTimeout(turnbigpic);
	turnbigpic=setInterval("$('.foucebox .scrollimg').fnturnpic()",3000);
  });
  turnbigpic=setInterval("$('.foucebox .scrollimg').fnturnpic()",3000);
  $(".box_sync h2").mouseover(function()
  {
	var rel
	$(".box_sync h2").attr("class","")
	$(this).attr("class","on")
	rel=$(this).attr("rel")
	if(rel==1)
	{
	  $("#ranklist1").show();
	  $("#ranklist2").hide();
    }
	else
	{
	  $("#ranklist1").hide();
	  $("#ranklist2").show();
    }
  });
});