$(function(){
		$(function(){
		 var index = 0;
		 $("#btn span").mouseover(function(){
			index  =  $("#btn span").index(this);
			showImg(index);
		});	
		 $('#ppt').hover(function(){
				  if(MyTime){
					 clearInterval(MyTime);
				  }
		 },function(){
				  MyTime = setInterval(function(){
					showImg(index)
					index++;
					if(index==5){index=0;}
				  } , 5000);
		 });
		 var MyTime = setInterval(function(){
			showImg(index)
			index++;
			if(index==5){index=0;}
		 } , 5000);
		})
		function showImg(i){
			$("#img img").eq(i).stop(true,true).fadeIn().parent().siblings().find("img").hide();
			 $("#btn span").eq(i).addClass("hov").siblings().removeClass("hov");
		}
/*************************************************************/	
	$('#center_list ul li a:lt(2)').css("color","#F5FF5C")
	var tabs = $("#links ul li");
	tabs.each(function(index){
		$(this).mousemove(function(){			
			tabs.removeClass('selected_tabs');
			tabs.eq(index).addClass('selected_tabs');	
			$("#links div").hide();
			$("#links div").eq(index).show();
		});					  
	});
	var hotBtn = $("#rmrl_skill p a");
	hotBtn.each(function(index){
		$(this).mousemove(function(){			
			hotBtn.removeClass('hov_btn');
			hotBtn.eq(index).addClass('hov_btn');	
			$("#rmrl_skill dl").hide();
			$("#rmrl_skill dl").eq(index).show();
		});					  
	});	
		var WF={
		each:function(o,fn){
			for(var i=0,l=o.length;i<l;i++){
				fn.apply(o[i],[i,o[i]]);
			}
		},
		G:function(id){
			return document.getElementById(id);
		}
	};	
	//gdnews silde
	(function(){
	var n = WF.G('gdnews'),b,h,step=33,inter,timer,sta=false,c=false;
	if(n){
		b = n.getElementsByTagName('ul')[0];
		b.innerHTML += b.innerHTML;
		li = b.getElementsByTagName('li');
		if(li.length>4){
			h = b.offsetHeight;
			timer = setTimeout(start,3000);
			n.onmouseover = function(){if(!sta){clearTimeout(timer);c=true}};
			n.onmouseout = function(){if(c){timer = setTimeout(start,1000);c=false;}}
		}
	}
	function start(){
		sta = true;
		inter = setInterval(s,15);
	}
	function s(){
		if(n.scrollTop+step==h){
			n.scrollTop=h/2-step;
		}
		n.scrollTop = n.scrollTop+1;
		if(n.scrollTop%step==0){
			clearInterval(inter);
			sta = false;
			timer = setTimeout(start,3000);
		}
	}
	})();
	/*******************************/
		$('.index_small_warp').cycle({ 
			fx: 'scrollLeft', 
			speed: 800, 
			timeout: 0, 
			next: '#index_pyfs .button'
		});
		
		$('#samll_warp2').cycle({ 
			fx:     'scrollLeft', 
			speed:  800, 
			timeout: 0, 
			next:   '#index_jjby .button'
		});
})
