/***********************************************************************/

/*函数名：checkFormatDouble

/*参数：textfield：域值

/*参数：intLength：整数长度

/*参数：decLength：小数长度

/*参数：isNeg：是否允许输入负数

/*功能：  校验double型数据

/*创建者：

/*创建日期：2006/06/23

/***********************************************************************/

function checkFormatDouble(textfield,intLength,decLength,isNeg){

	var textValue = textfield.value;

	var intValue = "";

	var decValue = "";

	if( isNaN(textfield.value) ){

     alert("请输入数值！");

     textfield.select();

     return false;

	}else{

		if(isNaN(intLength)||isNaN(decLength)||(isNeg!="Y"&&isNeg!="N")){

			//默认参数

			intLength = 12;

			decLength = 2;

			isNeg = "Y";

		}

		var i = textValue.indexOf("-");

		var j = textValue.indexOf(".");

		if(i!=-1&&isNeg=="N"){

			alert("不允许输入负数！");

			textfield.select();

			return false;

		}

		//获取整数部分和小数部分

		if(j!=-1){

			if(j>0){

				intValue = textValue.substring(0,j);

			}

			if(j<textValue.length){

				decValue = textValue.substring(j+1,textValue.length);

			}

		}else{

			intValue = textValue;

		}

		if(intValue.length>intLength){

			alert("整数部分超过"+intLength+"位！");

			textfield.select();
			
			return false;

		}

		if(decValue.length>decLength){

			alert("小数部分超过"+decLength+"位！");

			textfield.select();
			
			return false;
		}

	}

	return true;

}