function controlInputNumber() {
	var doms = document.getElementsByTagName("input");
	for (var i = 0; i < doms.length; i++) {
		var number_type = doms[i].getAttribute("number_type");
		if (number_type == "int") {
			doms[i].style.imeMode = "disabled";
			//with (doms[i]) {
			if ("\v" == "v") { //ie
				doms[i].onpaste = function() { return false; };
				doms[i].ondragenter = function() { return false; };
				doms[i].onkeypress = function() {
					if (event.keyCode) {
						if (event.keyCode < 48 || event.keyCode > 57)
							return false;
					}
				};
				doms[i].attachEvent("onblur", function(o) {
					//with (o.srcElement) {
					var d_val = o.srcElement.getAttribute("d_value");
					d_val = (d_val == null ? "" : d_val);
					var min_val = o.srcElement.getAttribute("min_val");
					min_val = (min_val == null ? "" : min_val);
					var max_val = o.srcElement.getAttribute("max_val");
					max_val = (max_val == null ? "" : max_val);
					if (o.srcElement.value == "") {
						o.srcElement.value = d_val;
					} else
						o.srcElement.value = parseInt(o.srcElement.value, 10);
					if (min_val != "" && parseInt(o.srcElement.value == "" ? 0 : o.srcElement.value, 10) < parseInt(min_val, 10))
						o.srcElement.value = min_val;
					if (max_val != "" && parseInt(o.srcElement.value == "" ? 0 : o.srcElement.value, 10) > parseInt(max_val, 10))
						o.srcElement.value = max_val;
					//}
				});
			} else {
			    doms[i].setAttribute("onpaste", "return false");
			    doms[i].setAttribute("ondragenter", "return false");
			    doms[i].addEventListener("keypress", function(e) {
			    	if (e.which != 8 && (e.which < 48 || e.which > 57)) {
			    		e.preventDefault();
			    	}
			    }, false);

			    doms[i].addEventListener("blur", function(o) {
			        //alert(o.target.value);
			        var d_val = o.target.getAttribute("d_value");
			        d_val = (d_val == null ? "" : d_val);
			        var min_val = o.target.getAttribute("min_val");
			        min_val = (min_val == null ? "" : min_val);
			        var max_val = o.target.getAttribute("max_val");
			        max_val = (max_val == null ? "" : max_val);
			        if (o.target.value == "") {
			        	o.target.value = d_val;
			        } else
			        	o.target.value = parseInt(o.target.value, 10);
			        if (min_val != "" && parseInt(o.target.value == "" ? 0 : o.target.value, 10) < parseInt(min_val, 10))
			        	o.target.value = min_val;
			        if (max_val != "" && parseInt(o.target.value == "" ? 0 : o.target.value, 10) > parseInt(max_val, 10))
			        	o.target.value = max_val;
			    }, false);
			}
			//}
		} else if (number_type == "float") {
		    doms[i].style.imeMode = "disabled";
		    if ("\v" == "v") { //ie
		    	with (doms[i]) {
		    		onpaste = function() { return false; };
		    		ondragenter = function() { return false; };
		    		onkeypress = function() {
		    			if (event.keyCode == 46) {
		    				if (!(this.value.indexOf('.') == -1 && this.value != ''))
		    					event.returnValue = false;
		    			} else {
		    				if (event.keyCode < 48 || event.keyCode > 57) {
		    					event.returnValue = false;
		    				} else if (this.value.indexOf('.') != -1 && this.value.split('.')[1].length >= 2 && getCaret(this) >= parseInt(this.value.indexOf('.'), 10) + 1) {
		    					event.returnValue = false;
		    				}
		    			}
		    		};
		    		onblur = function() {
		    			if (this.value.indexOf('.') == 0)
		    				this.value = '0' + this.value;
		    			else if (this.value.indexOf('.') == this.value.length - 1)
		    				this.value = this.value.replace('\\.', '');
		    			if (this.value.indexOf('.') != -1)
		    				this.value = this.value.substring(0, this.value.indexOf('.') + 3);
		    			if (this.value != "")
		    				this.value = parseFloat(this.value);
		    		};
		    	}
		    } else {
		        doms[i].setAttribute("onpaste", "return false");
		        doms[i].setAttribute("ondragenter", "return false");
		        doms[i].addEventListener("keypress", function(e) {
		        	if (e.which == 46) {
		        		if (!(this.value.indexOf('.') == -1 && this.value != ''))
		        			e.preventDefault();
		        	} else {
		        		if (e.which != 8 && (e.which < 48 || e.which > 57))
		        			e.preventDefault();
		        		/*if (this.value.indexOf('.') != -1 && this.value.split('.')[1].length >= 2 && getCaret(this) >= parseInt(this.value.indexOf('.'), 10) + 1)
		        			e.preventDefault();
		        		alert(getCaret(this) >= parseInt(this.value.indexOf('.'), 10) + 1);*/
		        	}
		        }, false);

		        doms[i].addEventListener("blur", function(o) {
		        	if (this.value.indexOf('.') == 0)
		        		this.value = '0' + this.value;
		        	else if (this.value.indexOf('.') == this.value.length - 1)
		        		this.value = this.value.replace('\\.', '');
		        	if (this.value.indexOf('.') != -1)
		        		this.value = this.value.substring(0, this.value.indexOf('.') + 3);
		        	if (this.value != "")
		        		this.value = parseFloat(this.value);
		        }, false);
		    }
		}
	}
}
function getCaret(textbox) {
	var control = document.activeElement;
	textbox.focus();
	var rang = document.selection.createRange();
	rang.setEndPoint("StartToStart", textbox.createTextRange())
	control.focus();
	return rang.text.length;
}
var isdel = true;
function IsSubmitDel() {
	var temp = isdel;
	isdel = true;
	return temp;
}
function ChooseAll(obj) {
	//$(":input[name=chkChooseaudit][type=checkbox]").attr("checked", obj.checked);
	$(":input[name=chkChooseaudit][type=checkbox]").each(function() {
		if ($(this).attr("disabled") != true)
			$(this).attr("checked", obj.checked);
	});
}
function ChooseItemClick(obj) {
	if (obj.checked) {
		if ($(":input[name=chkChooseaudit][type=checkbox]").size() == $(":input[name=chkChooseaudit][type=checkbox][checked]").size())
			$("#chkChooseauditAll").attr("checked", true);
	} else {
		$("#chkChooseauditAll").attr("checked", false);
	}
}
function getCheckedDelIds() {
	var ids = "";
	$(":input[name=chkChooseaudit][type=checkbox][checked]").each(function() {
		if (ids != "")
			ids += ",";
		ids += $(this).val();
	});
	if (ids == "") {
		alert("请选择你要删除的记录!");
		isdel =  false;
	} else {
		$("#hidBatchDelId").val(ids);
		isdel = confirm("您确定要删除选中的记录吗?");
	}
}

function getCheckedReviewIds() {
	var ids = "";
	var bo = true;
	$(":input[name=chkChooseaudit][type=checkbox][checked]").each(function() {
		if (ids != "")
			ids += ",";
		ids += $(this).val();
	});
	if (ids == "") {
		alert("请选择你要审核的记录!");
		bo = false;
	} else {
	    $("#hidBatchReviewId").val(ids);
		bo = confirm("您确定要审核选中的记录吗?");
	}
	return bo;
}

function setRowItem(obj) {
	var ix = obj.getAttribute("ix");
	var itemRow = $(":input[name*=hidItemObj][type=hidden][value=" + ix + "]").eq(0).parent().parent().get(0);
	var _flag = obj.getAttribute("flag");
	if (obj.src.indexOf("folder_close") != -1) {
		if (_flag == "1") {
			obj.src = "images/folder_open.gif";
		} else if(_flag == "2") {
		    obj.src = "../images/folder_open.gif";
		} else {
			obj.src = "../../images/folder_open.gif";
		}
		itemRow.style.display = "";
		loadTableItemData(ix, obj);
	} else {
	    if (_flag == "1") {
	    	obj.src = "images/folder_close.gif";
	    } else if (_flag == "2") {
	        obj.src = "../images/folder_close.gif";
	    } else {
		    obj.src = "../../images/folder_close.gif";
	    }
		itemRow.style.display = "none";
	}
}
var itemDataObj = null;
function loadTableItemData(ix, obj) {
	try {
		var itemRow = $(":input[name*=hidItemObj][type=hidden][value=" + ix + "]").eq(0).parent().parent().get(0);
		var itemCol = $(":input[name*=hidItemObj][type=hidden][value=" + ix + "]").eq(0).parent().parent().children().eq(1).get(0);
		var serarchKey = "";
		var skObj = $(obj).parent().find(":input[name*=serarchKey]").eq(0);
		if (skObj) {
			searchKey = skObj.val();
		}
		if ($.trim(itemCol.innerHTML) == "") {
			if (itemDataObj == null) {
				alert("请指定数据格式!");
			} else {
			    var _flag = obj.getAttribute("flag");
			    var tempP = "../../";
			    if (_flag == "1")
			    	tempP = "";
			    else if (_flag == "2")
			    	tempP = "../";
			    var imgStr = "<img src=\"" + tempP + "images/loading2.gif\" />";
				itemCol.innerHTML = imgStr;
				var _html = "";
				_html += "<table cellpadding=\"0\" cellspacing=\"1\" width=\"100%\" class=\"_data_table\">";
				_html += "<tr class=\"_data_table_th\">";
				var _height = "";
				if (itemDataObj.height) {
					_height = "height:" + itemDataObj.height + ";";
				}
				for (var i = 0; i < itemDataObj.cols.length; i++) {
					var o = itemDataObj.cols[i];
					var _width = "";
					if (o.width) {
						_width = "width:" + o.width + ";";
					}
					var align = "text-align:center;";
					if (o.align) {
						align = "text-align:" + o.align + ";";
					}
					_html += "<td style=\"" + _width + _height + align + "\"><nobr>" + o.title + "</nobr></td>";
				}
				_html += "</tr>";
				$.ajax({
					type: "get",
					dataType: "html",
					url: itemDataObj.url,
					data: "isGetItemData=1&searchKey=" + escape(searchKey) + "&rand=" + new Date().getTime(),
					success: function(data) {
						if ($.trim(data) == "") {
							itemCol.innerHTML = "没有数据!";
						} else {
							//alert(data);
							var arr = eval(data);
							for (var j = 0; j < arr.length; j++) {
								_html += "<tr onmouseover=\"this.style.background='#F3FBCA'\" onmouseout=\"this.style.background='#E4F6F9';\" class=\"_data_table_tr\">";
								for (var i = 0; i < itemDataObj.cols.length; i++) {
									var o = itemDataObj.cols[i];
									var _width = "";
									if (o.width) {
										_width = "width:" + o.width + ";";
									}
									var align = "text-align:center;";
									if (o.align) {
										align = "text-align:" + o.align + ";";
									}
									var tempStr = toGBK(eval("arr[" + j + "]." + o.column));
									if (o.formatStr) {
										var o1 = arr[j];
										o1.ix = ix;
										tempStr = o.formatStr(o1, toGBK(eval("arr[" + j + "]." + o.column)));
									}
									_html += "<td style=\"" + _width + _height + align + "\"><nobr>" + tempStr + "</nobr></td>";
								}
								_html += "</tr>";
							}
							_html += "</table>";
							itemCol.innerHTML = _html;
							//$("#testtd").css("width", "30px"); alert($("#testtd").css("width"));
						}
					},
					error: function() {
						alert("对不起，请求中出错!");
						itemRow.style.display = "none";
					}
				});
			}
		}
	} catch (ex) {
		alert(ex.message);
	}
}
function reloadItemData(ix) {
	var itemCol = $(":input[name*=hidItemObj][type=hidden][value=" + ix + "]").eq(0).parent().parent().children().eq(1).get(0);
	itemCol.innerHTML = "";
	var obj = $("img[id*=table_tr_img][ix=" + ix + "]").get(0);
	loadTableItemData(ix,obj);
}
function toGBK(str) {
	str += "";
	var outstr = str;
	if (str.indexOf('\\') != -1) {
		outstr = str.replace(/\\u22/g, "\"").replace(/\\ud/g, "\r").replace(/\\ua/g, "\n");
	}
	return outstr;
}


