/*
 * 品牌页
 * 上下方向键
 */
function Direction(obj){
	//容器对象
	this.obj = document.getElementById(obj);
	//速度
	this.speed = 8;
	//步进值
	this.step = 3;
	//资源符
	this.resource = null;
	
}
Direction.prototype = {
	up:function(speed){
		var self = this;
		if(speed) this.speed = speed;
		clearInterval(this.resource);
		this.resource = setInterval(function(){
			self.obj.scrollTop += self.step;
		},this.speed);
	},
	down:function(speed){
		var self = this;
		if(speed) this.speed = speed;
		clearInterval(this.resource);
		this.resource = setInterval(function(){
			self.obj.scrollTop -= self.step;
		},this.speed);
	},
	left:function(speed){
		var self = this;
		if(speed) this.speed = speed;
		clearInterval(this.resource);
		this.resource = setInterval(function(){
			self.obj.scrollLeft += self.step;
		},this.speed);
	},
	right:function(speed){
		var self = this;
		if(speed) this.speed = speed;
		clearInterval(this.resource);
		this.resource = setInterval(function(){
			self.obj.scrollLeft -= self.step;
		},this.speed);
	},
	un:function(){
		clearInterval(this.resource);
	}
};

function Show(body,buttonss){
	$('.messshow').remove();
	var win = $('<div class="messshow" style="display:none">'+body+'</div>');
	$('body').append(win);
	if(buttonss == undefined){
		_buttons = {'确定':function(){$(this).dialog('close')}};
	}else{
		_buttons = buttonss;
	}
	win.dialog({
		autoOpen: false,
		resizable: false,
		modal: true,
		buttons: _buttons
	});
	
	win.dialog('open');
}

