function lunbo() {
	var count = $("#playShow li").size(),t = n = 0;
	function showAuto() {
		n = n >= (count - 1) ? 0 : ++n;
		$("#playNum li").eq(n).trigger('click');
	};
	(function() {
		if (count > 1) {
			$("#playNum li").click(function () {
				var i = $(this).text() - 1;n = i;
				if (i >= count) return;
				$("#playNum li").removeClass("on").removeClass("hover");
				switch(i){
					case 0:
					$("#playNum li:eq(0)").addClass("on");$("#playNum li:eq(1)").addClass("hover");break;
					case 1:
					$("#playNum li:eq(0)").addClass("hover");$("#playNum li:eq(1)").addClass("on");$("#playNum li:eq(2)").addClass("hover");break;
					case 2:
					$("#playNum li:eq(1)").addClass("hover");$("#playNum li:eq(2)").addClass("on");$("#playNum li:eq(3)").addClass("hover");break;
					case 3:
					$("#playNum li:eq(2)").addClass("hover");$("#playNum li:eq(3)").addClass("on");$("#playNum li:eq(4)").addClass("hover");break;
					case 4:
					$("#playNum li:eq(3)").addClass("hover");$("#playNum li:eq(4)").addClass("on");break;
				}
				if (i<count){
					var l = i*926;
					$("#playShow").animate({marginLeft: "-"+l+"px"}, 500);
				}else{
					$("#playShow").animate({marginLeft: "0px"}, 800);
				}
				return false;
			});
			t = setInterval(showAuto, 3000);
			$("#banner").hover(function () {
				clearInterval(t)
			}, function () {
				t = setInterval(showAuto, 3000);
			});
		}
	})();
}/*
function scroll(id){
	var self = this;
	this.obj = document.getElementById(id);
	this.content = this.obj.getElementsByTagName('div')[0];
	this.bar = document.createElement('div');
	this.bar.className = 'scrollBar';
	this.bar.style.marginTop = 0;
	this.bar.style.height = (this.obj.offsetHeight < this.content.scrollHeight)?parseInt( this.obj.offsetHeight / this.content.scrollHeight  * this.obj.offsetHeight) + 'px':'0px';
	this.obj.appendChild( this.bar );
	this.bar.y;
	this.srcElement;
	this.marginTop;
	this.bar.onmousedown = function(e){ self.mousedown(e); }
}
scroll.prototype = {
	mousedown:function(e){
		var self = this;
		var e = e || window.event;
		self.bar.y = e.clientY;
		self.bar.t = parseInt( self.bar.style.marginTop );
		document.onmousemove = function(e){ self.mousemove(e); }
		stopDefault(e);
	},
	mousemove:function(e){
		var e = e || window.event;
		this.marginTop = this.bar.t + ( e.clientY - this.bar.y );
		if( this.marginTop < 0 ) {
			this.marginTop = 0;
		}
		if( this.marginTop > this.obj.clientHeight - this.bar.offsetHeight ){
			this.marginTop = this.obj.clientHeight - this.bar.offsetHeight;
		}
		this.bar.style.marginTop = this.marginTop + 'px';
		this.content.scrollTop = ( this.content.scrollHeight - this.obj.offsetHeight ) * parseInt( this.marginTop ) / ( this.obj.clientHeight - this.bar.clientHeight );
		document.onmouseup = function(e){ document.onmousemove = null; }
		stopDefault(e);
	}
}*/

function scroll(id, s){
	var self = this;
	this.obj = document.getElementById(id);
	this.content = this.obj.getElementsByTagName('div')[0];
	this.bar = document.getElementById(s);
	this.box = this.bar.getElementsByTagName('div')[0];
	//this.bar.className = 'scrollBar';
	this.bar.style.marginTop = 0;
	this.height = (this.obj.offsetHeight < this.content.scrollHeight)?parseInt( this.obj.offsetHeight / this.content.scrollHeight  * this.obj.offsetHeight):0;
	this.bar.style.height = this.height+'px';
	this.box.style.height = (this.height -10) + 'px';
	this.height?this.bar.style.display="block":this.bar.style.display="hidden";
	this.bar.y;
	this.srcElement;
	this.marginTop;
	this.bar.onmousedown = function(e){ self.mousedown(e); }
}
scroll.prototype = {
	mousedown:function(e){
		var self = this;
		var e = e || window.event;
		self.bar.y = e.clientY;
		self.bar.t = parseInt( self.bar.style.marginTop );
		document.onmousemove = function(e){ self.mousemove(e); }
		stopDefault(e);
	},
	mousemove:function(e){
		var e = e || window.event;
		this.marginTop = this.bar.t + ( e.clientY - this.bar.y );
		if( this.marginTop < 0 ) {
			this.marginTop = 0;
		}
		if( this.marginTop > this.obj.clientHeight - this.bar.offsetHeight ){
			this.marginTop = this.obj.clientHeight - this.bar.offsetHeight;
		}
		this.bar.style.marginTop = this.marginTop + 'px';
		this.content.scrollTop = ( this.content.scrollHeight - this.obj.offsetHeight ) * parseInt( this.marginTop ) / ( this.obj.clientHeight - this.bar.clientHeight );
		document.onmouseup = function(e){ document.onmousemove = null; }
		stopDefault(e);
	}
}
function stopDefault( e ) {
	if ( e && e.preventDefault )
		e.preventDefault();
	else
		window.event.returnValue = false;
	return false;
}
