// JavaScript Document
// jQuery滚动插件
function scro(obj,type){
   $(obj).diaScroll({direction:type});
}
(function($){
	$.fn.diaScroll = function(opt){
		return this.each(function(){
			 var cfg = $.extend({
							   speed : 100,
                               direction : 'top',
							   listContainer : 'ul',
							   cloneChild : 'li',
							   cloneContainer : 'ul',
							   firstCloneClass : 'clone-first-child'
							   },opt),
			 	 $ctnr = $(cfg.listContainer,this),
				 $clone = $(cfg.cloneChild,$ctnr).clone().appendTo($(cfg.cloneContainer,this)).eq(0).addClass(cfg.firstCloneClass),
				 timer;
				 
			var offset = $ctnr.offset();
			var aniStyle;
			switch(cfg.direction){
				case 'top'  : aniStyle  = { top : '-=1'}; break;
				case 'left' : aniStyle  = { left : '-=1'}; break;				
			}
			var play = function(){
				timer = setInterval(function(){
					if($clone.offset()[cfg.direction] <= offset[cfg.direction])
						$ctnr.offset(offset);
					else
						$ctnr.animate(aniStyle,0);
				},cfg.speed);
			};
			
			var stop = function(){
				clearInterval(timer);
			};
			
			play();
			
			$ctnr.hover(stop,play);

		});
	};
})(jQuery);

function rolls(){
   $('.noticelist').diaScroll({speed:100});
   $('#demo-ul-h').diaScroll({speed:50,direction:'left'});
   $('#demo-ul-h1').diaScroll({speed:50,direction:'left'});
}

function picroll(){
    $(function(){
	$("#KinSlideshow").KinSlideshow({
			moveStyle:"right",
			titleBar:{titleBar_height:40,titleBar_bgColor:"#08355c",titleBar_alpha:0.5},
			titleFont:{TitleFont_size:12,TitleFont_color:"#FFFFFF",TitleFont_weight:"normal"},
			btn:{btn_bgColor:"#FFFFFF",btn_bgHoverColor:"#1072aa",btn_fontColor:"#000000",btn_fontHoverColor:"#FFFFFF",btn_borderColor:"#cccccc",btn_borderHoverColor:"#1188c0",btn_borderWidth:1}
	});
})
}
