/**
 * ÷ä&#8893;&#10620;úû * @numBoxID &#701;&#62840;&#4676;
 * @downClick &#52554;&#53375;&#3333;ØÙ
 * @upClick &#50378;&#53375;&#3333;ØÙ
 */
function digitalUD(numBoxID, downClick, upClick){
	this.numId = numBoxID;
	this.downs = downClick;
	this.ups = upClick;
	this.showNum = function(curNum, type){
		if(type == 'd'){
			curNum = curNum-1 >= 1 ? curNum-1 : 1 ;
		}else{
			curNum++;
		}
		$("#"+this.numId).val(curNum);
	}
	
	this.addStyle = function(){
		$("#"+this.numId).attr("style", "width:35px;height:26px;line-height:26px;font-size:15px; font-weight:bold; color:#666666;text-align:center;");
		$("#"+this.downs).attr("style", "display:block; width:15px; height:28px; border:#ccc 1px solid; color:#ccc;text-align:center; margin-right:2px;line-height:28px;");
		$("#"+this.ups).attr("style", "display:block; width:15px; height:28px; border:#ccc 1px solid; color:#ccc;text-align:center; margin-left:2px;line-height:28px;");
	}
	this.init = function(){
		var that = this;
		var curNum = $("#"+this.numId).val();
		curNum = isNaN(curNum) ? 0 : curNum ;
		$("#"+this.numId).val(curNum);
		
		$("#"+this.downs).click(function(){
			var curNum = $("#"+that.numId).val();
			that.showNum(parseInt(curNum), "d");
		});
		$("#"+this.ups).click(function(){
			var curNum = $("#"+that.numId).val();
			that.showNum(parseInt(curNum), "u");
		});
		//this.addStyle();
	}
	
	this.init();
}