$(function() {
	//页签切换
	$("ul.tabs").tabs("> .pane",{event:'mouseover'});
	/*文字滚动开始*/
   var $swap = $('.scrolltxt');		//滚动区域
   var movetotop;		//滚动的变量
   $swap.hover(function() {
			clearInterval(movetotop);		//鼠标进入指定的区域停止动画
			},function() {
				movetotop=setInterval(function() {		//定义一个滚动时间间隔的方法
			   var li_height = $swap.find('li').height();
			   $swap.find('li:first').animate({marginTop:-li_height + 'px'},600,function() {																																	 $swap.find('li:first').css('marginTop',0).appendTo($swap);		//获取到li的高度，向上滚动一个高度，并且用回调函数把css样式调回到原始的初始状态	
																						 });
			   },2000);		//滚动的时间间隔
			}).trigger('mouseleave');		//模拟鼠标离开时的时间，让此动画一开始就执行。
	/*文字滚动结束*/
  $("#KinSlideshow").KinSlideshow({
      moveStyle:"right",
      isHasTitleFont:false,
      isHasTitleBar:false,
			btn:{btn_bgColor:"#666666",btn_bgHoverColor:"#CC0000",btn_fontColor:"#CCCCCC",btn_fontHoverColor:"#000000",btn_fontFamily:"Verdana",btn_borderColor:"#999999",btn_borderHoverColor:"#FF0000",btn_borderWidth:1,btn_bgAlpha:0.7}      
  });
    $('#slider').cycle({
        fx:      'scrollHorz',
        timeout:  0,
        prev:    '#prev',
        next:    '#next',
        pager:   '#pagination',
		speed: 800,
		timeout: 6000, 
		cleartype:  true,
		slideExpr: '.item',
        pagerAnchorBuilder: pagerFactory
    });  
});
function pagerFactory(idx, slide) {
    var s = idx > 3 ? ' style="display:none"' : '';
    return '<li'+s+'><a href="#"  class="nav_button"><span>'+(idx+1)+'</span></a></li>';
};
function selectProTab(showContent, selfObj) {
    var tag = document.getElementById("sub_tab").getElementsByTagName("li");
    var taglength = tag.length;
    for (var i = 0; i < taglength; i++) {
        tag[i].className = "";
    }
    selfObj.className = "liOn";
    for (var j = 0; j < taglength; j++) {
        document.getElementById("subCont" + j).style.display = "none";
    }
    document.getElementById(showContent).style.display = "block";
}

