﻿// JScript 文件


//检测中文

function checkchinese(str)
{
	for (var i=0;i<str.length;i++)
	{
		if (str.charCodeAt(i)>127)
		{
			return false
		}
	}
	return true
}

//判日期完整性（两个日期）
function checkcomplete(yy1,mm1,dd1,yy2,mm2,dd2) 
{ 
	if((mm1.length!=0||dd1.length!=0)&&yy1.length==0)
	{
		alert("月或日有值时,年不能为空,请输入起始年")
		return false
	}
	if((mm2.length!=0||dd2.length!=0)&&yy2.length==0)
	{
		alert("月或日有值时,年不能为空,请输入终止年")
		return false
	}
	if(dd1.length!=0&&mm1.length==0)
	{
		alert("日有值时,月不能为空,请输入起始月")
		return false
	}
	if(dd2.length!=0&&mm2.length==0)
	{
		alert("日有值时,月不能为空,请输入终止月")
		return false
	}
	return true
 }


//判日期
function checkdate(yy1,mm1,dd1,yy2,mm2,dd2)
{

	if(!checkinteger(yy1) && yy1.length!=0)
	{
		alert("日期不合法")
		return false
	}

	if(yy1.indexOf('.')>0 || yy2.indexOf('.')>0)
	{
		alert("日期不合法")
		return false
	}

	if(mm1.indexOf('.')>0 || mm2.indexOf('.')>0)
	{
		alert("日期不合法")
		return false
	}

	if(dd1.indexOf('.')>0 || dd2.indexOf('.')>0)
	{
		alert("日期不合法")
		return false
	}

	if(yy1.length!=4 && yy1.length!=0)
	{
		alert(" 日期不合法 ")
		return false
	}

	if(!checkinteger(yy2) && yy2.length!=0)
	{
		alert("日期不合法")
		return false
	}

	if(yy2.length!=4 && yy2.length!=0)
	{
		alert(" 日期不合法 ")
		return false
	}

	if(!checkinteger(mm1) && mm1.length!=0)
	{
		alert("日期不合法")
		return false
	}

	if(mm1.length!=2 && mm1.length!=0)
	{
		alert(" 日期不合法 ")
		return false
	}

	if(!checkinteger(mm2) && mm2.length!=0)
	{
		alert("日期不合法")
		return false
	}

	if(mm2.length!=2 && mm2.length!=0)
	{
		alert(" 日期不合法 ")
		return false
	}

	if(!checkinteger(dd1) && dd1.length!=0)
	{
		alert("日期不合法")
		return false
	}
	if(!checkinteger(dd2) && dd2.length!=0)
	{
		alert("日期不合法")
		return false
	}
	
	if(dd1.length!=2 && dd1.length!=0)
	{
		alert(" 日期不合法 ")
		return false
	}

	if(dd2.length!=2 && dd2.length!=0)
	{
		alert(" 日期不合法 ")
		return false
	}

	if(mm1=='00' || mm1=='0')
	{
		alert(" 日期不合法 ")
		return false 
	}
	if(mm2=='00' || mm2=='0')
	{
		alert(" 日期不合法 ")
		return false 
	}
	if(dd1=='00' || dd1=='0')
	{
		alert(" 日期不合法 ")
		return false 
	}
	if(dd2=='00' || dd2=='0')
	{
		alert(" 日期不合法 ")
		return false 
	}

	yy1 = parseInt(yy1,10)
	yy2 = parseInt(yy2,10)
	dd1 = parseInt(dd1,10)
	dd2 = parseInt(dd2,10)
	mm1 = parseInt(mm1,10)
	mm2 = parseInt(mm2,10)
	
	if(!checkmonthlength(mm1,dd1))
	{
		alert("日期不合法")
		return false
	}

	if(!checkmonthlength(mm2,dd2))
	{
		alert("日期不合法")
		return false
	}

	if(mm1=="2"||mm1=="02")
	{
		if(!checkleapmonth(yy1,dd1))
		{
			alert("日期不合法")
			return false
		}
	}
	if(mm2=="2"||mm2=="02")
	{
		if(!checkleapmonth(yy2,dd2))
		{
			alert("日期不合法")
			return false
		}
	}

	if(!checkcomplete(yy1,mm1,dd1,yy2,mm2,dd2))
	{
		return false
	}
	if(yy1.length==0)
	{
		yy1="1900"
	}
	if(yy2.length==0)
	{
		yy2="9999"
	}

	if(mm1.length==0)
	{
		mm1="01"
	}

	if(mm2.length==0)
	{
		mm2="12"
	}
	if(dd1.length==0)
	{
		dd1="01"
	}
	if(dd2.length==0)
	{
		dd2="31"
	}
	var date1
	var date2
	
	date1 = parseInt(yy1)*10000 + parseInt(mm1)*100 + parseInt(dd1)
	date2 = parseInt(yy2)*10000 + parseInt(mm2)*100 + parseInt(dd2)
	
	if(date1>date2)
	{
		alert("日期不合法")
		return false
	}
		return true
}
	

//判空
function checkempty(str)
{
	if (str.length <= 0)
	{
		return false
	}
	for (var li = 0; li < str.length; li++)
	{
		if (str.charAt(li) != " ")
		{
			return true
		}
	}
	//不合法
	return false
}


//判特殊字符
function checkextrspecialchar(str,allowc)
{
	for (i=0;i<str.length;i++)
	{
		if(! ((str.charCodeAt(i)>=48&&str.charCodeAt(i)<=57)||(str.charCodeAt(i)>=65&&str.charCodeAt(i)<=90)||(str.charCodeAt(i)>=97&&str.charCodeAt(i)<=122)||str.charCodeAt(i)==95||str.charCodeAt(i)>126||allowc.indexOf(str.substr(i,1))>=0))
		{
			return false
		}
	}
	return true
}


//判正整数
function checkinteger(str)
{
	if (isNaN(str)||(str.indexOf("-")>=0)) 
	{
//			alert("该字段仅限输入正整数")
		return false
	}
	return true
}

//判整数
function checkintegerall(str)
{
	if (isNaN(str)) 
	{
//			alert("该字段仅限输入正整数")
		return false
	}
	return true
}



//判润月
function checkleapmonth(yy,dd)
{

	if( yy =='0000')
	{
		return false
	}

	if( yy%4 > 0 && dd > 28)
	{
		return false
	}

	if(dd>29)
	{
		return false
	}

	if( yy%4 == 0 && yy%100 == 0 && yy%400 == 0)
	{
		return true
	}

	if( yy%4 == 0 && yy%100 == 0 && yy%400 > 0 && dd>28)
	{
		return false
	}

	return true
}


//月的合法
function checkmonthlength(mm,dd)
{
	if((mm==4||mm==6||mm==9||mm==11) && dd>30)
	{
		return false;
	}
	else if(dd>31)
	{
		return false;
	}
	if(mm>12)
	{
		return false;
	}
	if(dd>31)
	{
		return false;
	}
	return true
}



//数字型特殊字符
function checknumberspecialchar(str)
{
	for (i=0;i<str.length;i++)
	{
		if(! ((str.charCodeAt(i)>=48&&str.charCodeAt(i)<=57)||(str.charCodeAt(i)>=65&&str.charCodeAt(i)<=90)||(str.charCodeAt(i)>=97&&str.charCodeAt(i)<=122)||str.charCodeAt(i)==95||str.charCodeAt(i)==46||str.charCodeAt(i)>126))
		{
			return false
		}
	}
	return true
}

//判断页码合法性
function checkpagenum(str)
{
	if (str == "")
	{
		return false
	}
	if (isNaN(str))
	{
		return false
	}
	if (parseInt(str) < 0)
	{
			return false
	}
	return true
}


//判小数位数
function checkpointpostion(number,postion)
{
	if(isNaN(number)){
		return false
	}
	if (number.indexOf(".")>0 && postion==0)
	{
		return false;
	}
	if (number.indexOf(".")>=0 && number.indexOf(".") <= number.length - postion - 2)
	{
		return false;
	}
	return true
}

//单个日期的完整性
	function checksinglecomplete(yy1,mm1,dd1) 
	{ 
		if((mm1.length!=0||dd1.length!=0)&&yy1.length==0)
		{
			alert("月或日有值时,年不能为空,请输入年")
			return false
		}
		if(dd1.length!=0&&mm1.length==0)
		{
			alert("日有值时,月不能为空,请输入月")
			return false
		}
		return true
	 }


//判断单个日期
	function checksingledate(yy1,mm1,dd1)
	{
		
		if(!checkinteger(yy1) && yy1.length!=0)
		{
			//alert(" 日期不合法 ")
			return false
		}		

	if(yy1.indexOf('.')>0 || mm1.indexOf('.')>0 || dd1.indexOf('.')>0)
	{
		//alert("日期不合法")
		return false
	}

		if(yy1.length!=4 && yy1.length!=0)
		{
			//alert(" 日期不合法 ")
			return false
		}
		

	if(mm1=='00' || mm1=='0')
	{
		//alert(" 日期不合法 ")
		return false 
	}

	if(dd1=='00' || dd1=='0')
	{
		//alert(" 日期不合法 ")
		return false 
	}
    
		if(!checkinteger(mm1) && mm1.length!=0)
		{
			//alert(" 日期不合法 ")
			return false
		}

		if(mm1.length!=2 && mm1.length!=0)
		{
			//alert(" 日期不合法 ")
			return false
		}

		if(parseInt(mm1)>12)
		{
			//alert(" 日期不合法 ")
			return false;
		}
		
		if(!checkinteger(dd1) && dd1.length!=0)
		{
			//alert(" 日期不合法 ")
			return false
		}
		

		if(dd1.length!=2 && dd1.length!=0)
		{
			//alert(" 日期不合法 ")
			return false
		}

		if(!checkmonthlength(mm1,dd1))
		{
			//alert(" 日期不合法 ")
			return false
		}
	
		if(mm1=="2"||mm1=="02")
		{
			if(!checkleapmonth(yy1,dd1))
			{
				//alert(" 日期不合法 ")
				return false
			}
		}
		if(!checksinglecomplete(yy1,mm1,dd1))
		{
			return false
		}	
	return true
	}


//判断为空
function checkspace(str)
{
	if (str.search(" ") != -1)
	{
		return false
	}
	else
	{
		return true
	}
}


//判断特殊字符
function checkspecialchar(str)
{	
	/*for (i=0;i<str.length;i++)
	{
		if(! ((str.charCodeAt(i)>=48&&str.charCodeAt(i)<=57)||(str.charCodeAt(i)>=65&&str.charCodeAt(i)<=90)||(str.charCodeAt(i)>=97&&str.charCodeAt(i)<=122)||str.charCodeAt(i)==95||str.charCodeAt(i)>126))
		{
			return false
		}
	}*/
	if(str.indexOf("'")>=0 || str.indexOf("\"")>=0 || str.indexOf("<")>=0 || str.indexOf(">")>=0)
	{
		return false;
	}
	return true
}


//判断数字特殊字符
function checkspecialnumberchar(str,allowc)
{	
	for (i=0;i<str.length;i++)
	{
		if(! ((str.charCodeAt(i)>=48&&str.charCodeAt(i)<=57)||(str.charCodeAt(i)>=65&&str.charCodeAt(i)<=90)||(str.charCodeAt(i)>=97&&str.charCodeAt(i)<=122)||str.charCodeAt(i)==95||str.charCodeAt(i)==46||str.charCodeAt(i)>126||allowc.indexOf(str.substr(i,1)) != -1))
		{			
			return false
		}
	}	
	return true
}


//返回文本框内容长度判断方法
function checktextfieldlength(txt,len)
{	
	var len1
	len1 = parseInt(len/2)
	var length=0
	for (var i=0;i<txt.length;i++)
	{
		if (txt.charCodeAt(i)>127)
		{
			length=length+2
		}
		else
		{
			length++	
		}
		if (length>len)
		{
//				alert(cname+" 中字符太多, \\ n只能有 "+len1+" 个中文或 "+len+" 个字母 ")
			return false
		}
	}
	return true
}

//用于列表中有初始数据的行，行前没有复选框的合法性验证
//items: 存在的复选框名称的后缀的集合，例如，1'2'3； chkname：复选框名称的前缀； objname：操作对象
function checkMS(items,chkname,objname,formname)
{
	var itemsobj
	itemsobj = eval(formname + "." + items)
	items = itemsobj.value
	if(items!="")
	{
		var ss = new Array()
		ss = items.split("'")
		for(i=0;i<ss.length;i++)
		{	
			var s	
			s = eval(formname + "." + chkname + ss[i])		
			if(s.checked == true)
			{
				return true			
			}
		}
	}
	else
	{
		alert("本页没有可操作的" + objname)		
		return false
	}
	alert("请先选择一条记录")
	return false
}

//用于列表中有初始数据的行，行前没有单选框的合法性验证
//firstrv： 存储第一个单选按钮的值的hidden的名字；raname：单选按钮的名字；objname：操作对象；formname：表单名称
function checkradio(firstrv,raname,objname,formname)
{	
	var firstobj
	firstobj = eval(formname + "." + firstrv)
	var singlera
	singlera = eval(formname + "." + raname)
	if(firstobj.value!="")
	{			
		if(singlera.value==firstobj.value)//只有一个单选按钮
		{		
			if(singlera.checked)
			{
				return true
			}
			else
			{
				alert("请选择一条记录")
				return false
			}
		}
		else//单选按钮组
		{
			for(i=0;i<singlera.length;i++)
			{				
				if(singlera[i].checked)
				{
					return true
				}
			}
			alert("请选择一条记录")
			return false				
		}
	}
	else
	{
		alert("本页没有可操作的" + objname)
		return false
	}
}

//是否由0-9组成
function checknum(str)
{	
	if(str!="")
	{
		for(i=0;i<str.length;i++)
		{
			if(!(str.charCodeAt(i)>=48&&str.charCodeAt(i)<=57))
			{
				return false
			}
		}
	}
	return true
}

//包含年，月，日，时，分和秒的起止日期的合法性验证
function checkfulldate(yy1,mm1,dd1,hh1,min1,ss1,yy2,mm2,dd2,hh2,min2,ss2)
{
	if(!(checkinteger(hh1)&&checkinteger(hh2)&&checkinteger(min1)&&checkinteger(min2)&&checkinteger(ss1)&&checkinteger(ss2)))
	{
		alert("时间不合法")
		return false
	}
	if(!(checknum(hh1)&&checknum(hh2)&&checknum(min1)&&checknum(min2)&&checknum(ss1)&&checknum(ss2)))
	{
		alert("时间不合法")
		return false
	}
	if(!checkinteger(yy1) && yy1.length!=0)
	{
		alert("日期不合法")
		return false
	}
	if(!checkinteger(hh1) && hh1.length!=0)
	{
		alert("小时不合法")
		return false
	}
	if(!checkinteger(hh2) && hh2.length!=0)
	{
		alert("小时不合法")
		return false
	}
	if(!checkinteger(min1) && min1.length!=0)
	{
		alert("分钟不合法")
		return false
	}
	if(!checkinteger(min2) && min2.length!=0)
	{
		alert("分钟不合法")
		return false
	}
	if(!checkinteger(ss1) && ss1.length!=0)
	{
		alert("秒不合法")
		return false
	}
	if(!checkinteger(ss2) && ss2.length!=0)
	{
		alert("秒不合法")
		return false
	}
	if(yy1.indexOf('.')>0 || yy2.indexOf('.')>0)
	{
		alert("日期不合法")
		return false
	}
	if(mm1.indexOf('.')>0 || mm2.indexOf('.')>0)
	{
		alert("日期不合法")
		return false
	}
	if(dd1.indexOf('.')>0 || dd2.indexOf('.')>0)
	{
		alert("日期不合法")
		return false
	}
		if(yy1.length!=4 && yy1.length!=0)
		{
			alert(" 日期不合法 ")
			return false
		}
	if(!checkinteger(yy2) && yy2.length!=0)
	{
		alert("日期不合法")
		return false
	}
		if(yy2.length!=4 && yy2.length!=0)
		{
			alert(" 日期不合法 ")
			return false
		}
	if(!checkinteger(mm1) && mm1.length!=0)
	{
		alert("日期不合法")
		return false
	}
		if(mm1.length!=2 && mm1.length!=0)
		{
			alert(" 日期不合法 ")
			return false
		}
	if(!checkinteger(mm2) && mm2.length!=0)
	{
		alert("日期不合法")
		return false
	}
		if(mm2.length!=2 && mm2.length!=0)
		{
			alert(" 日期不合法 ")
			return false
		}
	if(!checkinteger(dd1) && dd1.length!=0)
	{
		alert("日期不合法")
		return false
	}
	if(hh1.length==1||hh2.length==1||min1.length==1||min2.length==1||ss1.length==1||ss2.length==1)
	{
		alert("时间不合法")
		return false
	}
	if(parseInt(hh1)>24 || parseInt(hh2)>24)
	{
		alert("小时不合法")
		return false
	}
	if(parseInt(min1)>59 || parseInt(min2)>59)
	{
		alert("分钟不合法")
		return false
	}
	if(parseInt(ss1)>59 || parseInt(ss2)>59)
	{
		alert("秒不合法")
		return false
	}
	if(!checkinteger(dd2) && dd2.length!=0)
	{
		alert("日期不合法")
		return false
	}
	
		if(dd1.length!=2 && dd1.length!=0)
		{
			alert(" 日期不合法 ")
			return false
		}
		if(dd2.length!=2 && dd2.length!=0)
		{
			alert(" 日期不合法 ")
			return false
		}
	if(mm1=='00' || mm1=='0')
	{
		alert(" 日期不合法 ")
		return false 
	}
	if(mm2=='00' || mm2=='0')
	{
		alert(" 日期不合法 ")
		return false 
	}
	if(dd1=='00' || dd1=='0')
	{
		alert(" 日期不合法 ")
		return false 
	}
	if(dd2=='00' || dd2=='0')
	{
		alert(" 日期不合法 ")
		return false 
	}
	yy1 = parseInt(yy1,10)
	yy2 = parseInt(yy2,10)
	dd1 = parseInt(dd1,10)
	dd2 = parseInt(dd2,10)
	mm1 = parseInt(mm1,10)
	mm2 = parseInt(mm2,10)
	hh1 = parseInt(hh1,10)
	hh2 = parseInt(hh2,10)
	min1 = parseInt(min1,10)
	min2 = parseInt(min2,10)
	if(!checkmonthlength(mm1,dd1))
	{
		alert("日期不合法")
		return false
	}

	if(!checkmonthlength(mm2,dd2))
	{
		alert("日期不合法")
		return false
	}

	if(mm1=="2"||mm1=="02")
	{
		if(!checkleapmonth(yy1,dd1))
		{
			alert("日期不合法")
			return false
		}
	}
	if(mm2=="2"||mm2=="02")
	{
		if(!checkleapmonth(yy2,dd2))
		{
			alert("日期不合法")
			return false
		}
	}


	if(!checkcomplete(yy1,mm1,dd1,yy2,mm2,dd2))
	{
		return false
	}
	if(yy1.length==0)
	{
		yy1="1900"
	}
	if(yy2.length==0)
	{
		yy2="9999"
	}

	if(mm1.length==0)
	{
		mm1="01"
	}
	if(mm2.length==0)
	{
		mm2="12"
	}
	if(dd1.length==0)
	{
		dd1="01"
	}
	if(dd2.length==0)
	{
		dd2="31"
	}
	if(hh1.length==0)
	{
		hh1="00"
	}
	if(hh2.length==0)
	{
		hh2="23"
	}
	if(min1.length==0)
	{
		min1="00"
	}
	if(min2.length==0)
	{
		min2="59"
	}
	if(ss1.length==0)
	{
		ss1="00"
	}
	if(ss2.length==0)
	{
		ss2="59"
	}
	var date1
	var date2
	
	date1 = parseInt(yy1)*12*365*24*60*60 + parseInt(mm1)*365*24*60*60 + parseInt(dd1)*24*60*60 + parseInt(hh1)*60*60 + parseInt(min1)*60 + parseInt(ss1)
	date2 = parseInt(yy2)*12*365*24*60*60 + parseInt(mm2)*365*24*60*60 + parseInt(dd2)*24*60*60 + parseInt(hh2)*60*60 + parseInt(min2)*60 + parseInt(ss2)
	
	if(date1>date2)
	{
		alert("日期不合法")
		return false
	}
		return true
}

//快捷键触发事件
function checkkey(e,str)
{
	
}

//打开详情窗口，根据显示分辨率显示
function opendetail(slink,wname)
{
	window.open(slink,wname,"width="+screen.width+",height="+screen.height+",left=0,top=0,fullscreen=0,titlebar=yes,scrollbars=yes,resizable=yes","")
	return true
}

function checkletter(str)
{	
	for (var i=0;i<str.length;i++)
	{
		if((str.charCodeAt(i)>=65&&str.charCodeAt(i)<=90)||(str.charCodeAt(i)>=97&&str.charCodeAt(i)<=122))
		{
			return false
		}
	}
	return true


}
function checktime(timestr)
{ 
		if(timestr=="")
		{
			return true;	
		}
    if(timestr.length!=5)
    {
        return false;
    }
    if(parseInt(timestr.substring(0,2))>23)
    {
        return false;
    }
    if(timestr.substring(2,3)!=":")
    {
        return false;
    }
    if(parseInt(timestr.substring(3,5))>59)
    {
        return false;
    }
    return true;
}
function CheckFormT(formObj,TagName)
{
    //alert(TagName);
    var InputArr=formObj.getElementsByTagName(TagName);
    //alert(InputArr.length); 
	if(InputArr!=null)
	{
		for(var i=0;i<InputArr.length;i++)
		{
		    
			if((InputArr[i].type=="text" || InputArr[i].type=="password" || TagName=="textarea" || TagName=="select") && 
			!InputArr[i].disabled && InputArr[i].style.visibility!="hidden" && 
			InputArr[i].style.display!="none" && InputArr[i].getAttribute("checkflag")=="true")
			{
				if(InputArr[i].getAttribute("isempty")=="false" && !checkempty(InputArr[i].value))
				{

					alert("请输入"+InputArr[i].title);
					try
					{
					    InputArr[i].focus();
					}
					catch(e)
					{}
					return false;
				}
				if(InputArr[i].getAttribute("maxlength")>"0" && InputArr[i].value.length>InputArr[i].getAttribute("maxlength"))
				{

					alert(InputArr[i].title+"只可输入"+InputArr[i].getAttribute("maxlength")+"个字符");
					try
					{
					    InputArr[i].focus();
					}
					catch(e)
					{}
					return false;
				}
				if(InputArr[i].getAttribute("isenglish")=="false" && !checkletter(InputArr[i].value))
				{
					alert(InputArr[i].title+"不允许输入字母");
					try
					{
					    InputArr[i].focus();
					}
					catch(e)
					{}
					return false;
				}
				if(InputArr[i].getAttribute("ischinese")=="false" && !checkchinese(InputArr[i].value))
				{
					alert(InputArr[i].title+"不允许输入中文");
					try
					{
					    InputArr[i].focus();
					}
					catch(e)
					{}
					return false;
				}
				if(InputArr[i].getAttribute("isnumeric")=="true" && !checkintegerall(InputArr[i].value))
				{
					//alert(InputArr[i].getAttribute("isnumeric"))
					alert(InputArr[i].title+"输入的不是正确的数字格式");
					try
					{
					    InputArr[i].focus();
					}
					catch(e)
					{}
					return false;
				}
				if(InputArr[i].getAttribute("declen")!=null && InputArr[i].getAttribute("declen")>0)
				{
					if(!checkpointpostion(InputArr[i].value,InputArr[i].getAttribute("declen")))
					{
						alert(InputArr[i].title+"的小数位数应为"+InputArr[i].getAttribute("declen"))
						try
					    {
					        InputArr[i].focus();
					    }
					    catch(e)
					    {}
						return false;
					}
																					 
				}
				if(InputArr[i].getAttribute("isspecial")=="false" && !checkspecialchar(InputArr[i].value))
				{
					alert(InputArr[i].title+"不能输入特殊字符");
					try
					{
					    InputArr[i].focus();
					}
					catch(e)
					{}
					return false;
				}
				if(InputArr[i].getAttribute("istime")=="true" && !checktime(InputArr[i].value))
				{
					alert(InputArr[i].title+" 请按hh:mm格式输入时间！");
					try
					{
					    InputArr[i].focus();
					}
					catch(e)
					{}
					return false;
				}
				
				
			}
//			if( InputArr[i].type=="radio" && InputArr[i].getAttribute("checkflag")=="true")
//			{
//			    alert("aa");
//			    return false;
//			}
//			alert(InputArr[i].type);
		}
	}
	return true;
}
function CheckFormD(ID) {

    var InputArr = document.getElementById(ID);

    if (InputArr != null) {

        if ((InputArr.type == "text" || InputArr.type == "password" || TagName == "textarea" || TagName == "select") &&
			!InputArr.disabled && InputArr.style.visibility != "hidden" &&
			InputArr.style.display != "none" && InputArr.getAttribute("checkflag") == "true") {
            if (InputArr.getAttribute("isempty") == "false" && !checkempty(InputArr.value)) {

                alert("请输入" + InputArr.title);
                try {
                    InputArr.focus();
                }
                catch (e)
					{ }
                return false;
            }
            if (InputArr.getAttribute("maxlength") > "0" && InputArr.value.length > InputArr.getAttribute("maxlength")) {

                alert(InputArr.title + "只可输入" + InputArr.getAttribute("maxlength") + "个字符");
                try {
                    InputArr.focus();
                }
                catch (e)
					{ }
                return false;
            }
            if (InputArr.getAttribute("isenglish") == "false" && !checkletter(InputArr.value)) {
                alert(InputArr.title + "不允许输入字母");
                try {
                    InputArr.focus();
                }
                catch (e)
					{ }
                return false;
            }
            if (InputArr.getAttribute("ischinese") == "false" && !checkchinese(InputArr.value)) {
                alert(InputArr.title + "不允许输入中文");
                try {
                    InputArr.focus();
                }
                catch (e)
					{ }
                return false;
            }
            if (InputArr.getAttribute("isnumeric") == "true" && !checkintegerall(InputArr.value)) {
                //alert(InputArr.getAttribute("isnumeric"))
                alert(InputArr.title + "输入的不是正确的数字格式");
                try {
                    InputArr.focus();
                }
                catch (e)
					{ }
                return false;
            }
            if (InputArr.getAttribute("declen") != null && InputArr.getAttribute("declen") > 0) {
                if (!checkpointpostion(InputArr.value, InputArr.getAttribute("declen"))) {
                    alert(InputArr.title + "的小数位数应为" + InputArr.getAttribute("declen"))
                    try {
                        InputArr.focus();
                    }
                    catch (e)
					    { }
                    return false;
                }

            }
            if (InputArr.getAttribute("isspecial") == "false" && !checkspecialchar(InputArr.value)) {
                alert(InputArr.title + "不能输入特殊字符");
                try {
                    InputArr.focus();
                }
                catch (e)
					{ }
                return false;
            }
            if (InputArr.getAttribute("istime") == "true" && !checktime(InputArr.value)) {
                alert(InputArr.title + " 请按hh:mm格式输入时间！");
                try {
                    InputArr.focus();
                }
                catch (e)
					{ }
                return false;
            }

            return true;
        }

    }
    return false;
}
function CheckForm(formObj)
{
    //CheckFormT(formObj,"textarea");
	if (CheckFormT(formObj,"input") && CheckFormT(formObj,"textarea") && CheckFormT(formObj,"select"))
	{
	    return true;
	}
	return false;
	/*if(inputName!=null)
	{
		if(!IsEmpty)
		{
			if(!checkempty(inputName.value))
			{
				alert("请输入"+inputName.title);
				return false;
			}
		}
		if(!
	}*/
}



