﻿
/公共校验方法*/
function getObject(objectId) {
     if(document.getElementById && document.getElementById(objectId)) {
    // W3C DOM
       return document.getElementById(objectId);
     } 
     else if (document.all && document.all(objectId)) {
    // MSIE 4 DOM
       return document.all(objectId);
     } 
     else if (document.layers && document.layers[objectId]) {
    // NN 4 DOM.. note: this won't find nested layers
       return document.layers[objectId];
     } 
     else {
       return false;
    }
} 
function forArrayNote(array){
	if(array!=null){
		for(var i=0;i<array.length;i++){
			if(getObject(array[i]).className=="tdNoteRed")
				return false;
		}			
	}
	//alert('2');
	return true;
}
function writeNote(imgPath,sat,reText){
		// alert(str.toLowerCase()); // = alert("acbd"); 
		// alert(str.toUpperCase()); // = alert("ABCD"); 
	  //alert(imgPath+'images/validator/check_'+sat+'.gif');
		return '<img src="'+imgPath+'images/validator/check_'+sat.toLowerCase()+'.gif" width=16 height=16>&nbsp;'+reText;
	}
function writeN(noteName,reText,imgPath){
	getObject(noteName).className="tdNoteRed";
	getObject(noteName).innerHTML=writeNote(imgPath,'n',reText);
}
function writeY(noteName,imgPath){
	getObject(noteName).className="tdNoteWhite";
	getObject(noteName).innerHTML=writeNote(imgPath,'y','');
}
/*不为空的TEXT校验*/
function noNullText(inputName,noteName,imgPath,reText){
	if(getObject(inputName).value.replace(/^\s+|\s+$/g,'')=='')
		writeN(noteName,reText,imgPath);
	else
		writeY(noteName,imgPath);
}
function noNullInt(inputName,noteName,imgPath,reText) {
	if(isNaN(parseInt(getObject(inputName).value))) {
		writeN(noteName,reText,imgPath);
	}else {
		writeY(noteName,imgPath);
	}
}

function checkCheckBox(checkboxName,noteName,imgPath,reText){
	var obj = document.getElementsByName(checkboxName);
	if(obj!=null&&obj.length>0){
		for(i=0;i<obj.length;i++){
			if (obj[i].checked)		
				return true;
		}
	}
	writeN(noteName,reText,imgPath);
  	return false;
}

/*URL*/
function noteUrl1(inputName,noteName,imgPath,reText){
		if(checkUrl1(getObject(inputName).value))
			writeY(noteName,imgPath);
		else
			writeN(noteName,reText,imgPath);
}


function noteUrl(inputName,noteName,imgPath,reText){
	var str=getObject(inputName).value;
	var Instance = new urlcheck;  
	var urlflag=Instance.check(str);
	if (urlflag==null) urlflag=false;
	if (urlflag)
		writeY(noteName,imgPath);
	else
		writeN(noteName,reText,imgPath);
}
function notePostCode(inputName,noteName,imgPath,reText){
	if(checkPostCode(getObject(inputName).value))
		writeY(noteName,imgPath);
	else
		writeN(noteName,reText,imgPath);
}
/*联系电话必填验证*/
function notePhone(inputName,noteName,imgPath,reText){
		if(checkPhone(getObject(inputName).value))
			writeY(noteName,imgPath);
		else
			writeN(noteName,reText,imgPath);
}
/*联系电话选填验证*/
function noteNullPhone(inputName,noteName,imgPath,reText){
		if(getObject(inputName).value=="")
			writeY(noteName,imgPath);
		else
			notePhone(inputName,noteName,imgPath,reText);
}
/*手机选填验证*/
function noteNullMobile(inputName,noteName,imgPath,reText){
		if(getObject(inputName).value=="")
			writeY(noteName,imgPath);
		else if(checkMobile(getObject(inputName).value))
			writeY(noteName,imgPath);
		else
			writeN(noteName,reText,imgPath);
}

/*手机验证*/
function noteMobile(inputName,noteName,imgPath,reText){
		if(checkMobile(getObject(inputName).value))
			writeY(noteName,imgPath);
		else
			writeN(noteName,reText,imgPath);
}

/*手机必填验证*/
function noteNotNullMobile(inputName,noteName,imgPath,reText,roText){
	if(getObject(inputName).value.replace(/^\s+|\s+$/g,'')=='') {
		writeN(noteName,roText,imgPath);
	}else {
		noteMobile(inputName,noteName,imgPath,reText);
	}
}

/*Email必填验证*/
function noteNotNullEmail(inputName,noteName,imgPath,reText,roText) {
	//alert(getObject(inputName).value);
	if(getObject(inputName).value.replace(/^\s+|\s+$/g,'')=='') {
		writeN(noteName,roText,imgPath);
	}else {
		noteEmail(inputName,noteName,imgPath,reText);
	}
}

/*Email验证*/
function noteEmail(inputName,noteName,imgPath,reText){
		if(checkEmail(getObject(inputName).value))
			writeY(noteName,imgPath);
		else
			writeN(noteName,reText,imgPath);
}
/*Emain选填验证*/
function noteNullEmail(inputName,noteName,imgPath,reText){
		if(getObject(inputName).value=="")
			writeY(noteName,imgPath);
		else
			noteEmail(inputName,noteName,imgPath,reText);
}
function noteDate(inputName,noteName,imgPath,reText){
		if(checkDate(getObject(inputName).value))
			writeY(noteName,imgPath);
		else
			writeN(noteName,reText,imgPath);
}

function noteNullDate(inputName,noteName,imgPath,reText){
		if(getObject(inputName).value=="")
			writeY(noteName,imgPath);
		else
			noteDate(inputName,noteName,imgPath,reText);
}


function noteInteger(inputName,noteName,imgPath,reText){
		if(checkIsIntegerNoNull(getObject(inputName).value))
			writeY(noteName,imgPath);
		else
			writeN(noteName,reText,imgPath);
}
/*数字选填验证*/
function noteNullInteger(inputName,noteName,imgPath,reText){
		if(getObject(inputName).value=="")
			writeY(noteName,imgPath);
		else
			noteInteger(inputName,noteName,imgPath,reText);
}
function noteNotNullInteger(inputName,noteName,imgPath,reText,orText){
		if(getObject(inputName).value=="")
			writeN(noteName,reText,imgPath);
		else
		   noteInteger(inputName,noteName,imgPath,orText);
}

function noteNullDouble(inputName,noteName,imgPath,reText){
		if(getObject(inputName).value=="")
			writeY(noteName,imgPath);
		else
			noteDouble(inputName,noteName,imgPath,reText);
}
/*在一定范围内*/
function noteOrInteger(or,inputName,noteName,imgPath,reText,orText){
		var obj = getObject(inputName).value
		if(checkIsIntegerNoNull(obj)){
			var strB = or.substring(0,or.indexOf('-'));
			var strE = or.substring(or.indexOf('-')+1,or.length);
			if(!checkIsIntegerNoNull(strB)||!checkIsIntegerNoNull(strE))
				writeN(noteName,reText,imgPath);
			else if(parseInt(strB)<=parseInt(obj)&&parseInt(obj)<=parseInt(strE))
				writeY(noteName,imgPath);
			else
				writeN(noteName,orText,imgPath);
		}else
			writeN(noteName,reText,imgPath);
}
function noteDouble(inputName,noteName,imgPath,reText){
		if(checkIsDouble(getObject(inputName).value))
			writeY(noteName,imgPath);
		else
			writeN(noteName,reText,imgPath);
}
/*验证机场编号*/
 function notePlaneCode(inputName,noteName,imgPath,reText)   
  {   		
		if(checkIsPlaneCode(getObject(inputName).value))
			writeY(noteName,imgPath);
		else
			writeN(noteName,reText,imgPath);
  }   
/*下拉框必选一样*/
	function noteSelect(inputName,noteName,imgPath,reText){
		if(getObject(inputName).value=="")
			writeN(noteName,reText,imgPath);
		else
			writeY(noteName,imgPath);
	}
/*适用二个文本框的值相同*/
function passWord(inputName,inputName1,noteName,imgPath,reText){
		if(getObject(inputName).value==getObject(inputName1).value)
			writeY(noteName,imgPath);
		else
			writeN(noteName,reText,imgPath);
	}
/*适用单个文本框不为空，并数据没有重复的值*/
function noteUserName(linkurl,inputName,noteName,imgPath,noNull,noAdd){
	noNullText(inputName,noteName,imgPath,noNull);
	var array = new Array(noteName);
	if(forArrayNote(array)){
		var text = openhttp(linkurl+getObject(inputName).value);
		//alert(text);
		if(text=="Y")
			writeY(noteName,imgPath);
		else if(text=="N")
			writeN(noteName,noAdd,imgPath)
	}
}
function noteCodeStr(inputName,noteName,imgPath,nullText,text1,text2){
	var obj = getObject(inputName).value;
	if(obj==""){
		writeN(noteName,nullText,imgPath);
		return;
	}
	if(!checkCode(obj,',')){
		writeN(noteName,text1,imgPath);
		return;
	}		
	var obccs = obj.split(',');
	for(i=0;i<obccs.length;i++){
		if(obccs[i]==""||obccs[i].length>4){
			writeN(noteName,text2,imgPath);
			return;
		}
	}
	writeY(noteName,imgPath);
}
/*非中文CODE验证*/
function noteNoCn(inputName,noteName,imgPath,reText){
		var obj = getObject(inputName).value;
	if(obj!=""){
		if(checkNoCn(obj))
			writeY(noteName,imgPath);
		else
			writeN(noteName,reText,imgPath);
	}
}
function noteNullNoCn(inputName,noteName,imgPath,reText){
		if(getObject(inputName).value=="")
			writeY(noteName,imgPath);
		else
			noteNoCn(inputName,noteName,imgPath,reText);
	}
/*验证权限管理简介字数是不是大于指定的len字*/
function  noteNoNullLength(inputName,noteName,imgPath,noText,reText,len){
   if(getObject(inputName).value=="")
			writeN(noteName,noText,imgPath);
	 else if (getObject(inputName).value.length>len)
	 		writeN(noteName,reText,imgPath);
	 else
	 		writeY(noteName,imgPath);
        
}
function noteCheckBoxNoNull(inputName,noteName,imgPath,reText){
	if(checkCheckBox(inputName))
		writeY(noteName,imgPath);
	else
		writeN(noteName,reText,imgPath);
}

/*IP地址验证*/
function noteIP(inputName,noteName,imgPath,reText){

	var obj = getObject(inputName).value;
	if(isIpAddress(obj))
		writeY(noteName,imgPath);
	else
		writeN(noteName,reText,imgPath);
}




















/*校验电话号码*/
function checkPhone(str){
	//alert(str);
	var exp= /(^[0-9]{3,4}\-[0-9]{3,8}$)|(^[0-9]{3,8}$)|(^\([0-9]{3,4}\)[0-9]{3,8}$)|(^0{0,1}13[0-9]{9})$/;
	var reg = str.match(exp);
	if(reg==null)
        return false;
    else
        return true;
}
//校验邮编
function checkPostCode(str){
	if(str == "")
        return false;
    if(/^\d{6}?$/g.test(str))
    	return true;
    else
    	return false;
}
/*校验EMAIL*/
function checkEmail(str){
	var exp= /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
	var reg = str.match(exp);
    if(reg==null)
        return false;
    else
        return true;
}


/* 判断是否含有中文字符 */
/* 若字符串为空,返回false */
function checkNoCn(str)
{	
	if(str=="")
	    return false;
	for(i=0;i<str.length;i++){
	    var c = str.substr(i,1);
	    
	    var ts = escape(c);
	    if(ts.substring(0,2) == "%u"){
	    	
		return false;
	    }
	}
	
	return true;

}
/**
*校验字符串是否为整型
*返回值：
*如果为空，定义校验不通过，    返回fasle
*如果字串全部为数字，校验通过，返回true
*如果校验不通过，              返回false     参考提示信息：输入域必须为数字！
*/

/*IP地址格式校验*/
function isIpAddress(str){
        var regex = /^((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?)$/;
		if(regex.test(str))
        return true;
        else return false;
}
function checkIsIntegerNoNull(str)
{
    if(str == "")
        return false;
    //if(/^(-  |\+)?\d+$/.test(str))
    if(/^\d+$/.test(str))
        return true;
    else
        return false;
}
function checkIsDouble(str)
{
    var   intReg   = /^\d+$/;   
    var   doubleReg = /^\-?([1-9]\d*|0)\.\d+$/;
    if(str == "")
        return false;
    if(intReg.test(str)||doubleReg.test(str))
        return true;
    else
        return false;
}
function checkIsPlaneCode(str)
{
    if(str==""||str.length!=4)
    	return false;
    for(i=0;i<str.length;i++){   
      cCheck=str.charAt(i);   
      if   (!IsAlpha(cCheck))   return   false;   
    }   
    return   true;   
}
function checkCode(str,splt){
	if(str=="")
		return false;
	for(var i=0;i<str.length;i++){
		cCheck=str.charAt(i);
		if(!IsAlpha(cCheck)&&cCheck!=splt)   
			return  false;
	}
	return true;
}
function   IsAlpha(cCheck){               
    return   ((('a'<=cCheck)   &&   (cCheck<='z'))   ||   (('A'<=cCheck)   &&   (cCheck<='Z')))               
  }                                                               
     

/*网址*/
function checkUrl(str){
	var re =new RegExp("^[a-zA-z]+://(\\w+(-\\w+)*)(\\.(\\w+(-\\w+)*))*(\\?\\S*)?$");
  if(!re.test(str))
  {
   //alert("输入网址不合法请重新输入！");
   return false;
  }else
  	return true;
}

function urlcheck(){   
 //协议名(注意在这里必须写成小写) => 对应的正则表达式   
 var regex = new Array();  
 regex["ftp"] = "this.ftpurl";  
 regex["file"] = "this.fileurl";  
 regex["http"] = "this.httpurl";   
 regex["https"] = "this.httpurl";   
 regex["gopher"] = "this.gopherurl";   
 regex["news"] = "this.newsurl";  
 regex["nntp"] = "this.nntpurl";   
 regex["telnet"] = "this.telneturl";   
 regex["wais"] = "this.waisurl";  
   
 this.lowalpha = "[a-z]";   
 this.hialpha = "[A-Z]";   
 this.alpha = "(" + this.lowalpha + "|" + this.hialpha + ")";   
 this.digit = "[0-9]";   
 this.safe = "[$.+_-]";   
 this.extra = "[*()\"!,]";   
 this.national = "([{}|\^~`]|\\[|\\])";   
 this.punctuation = "[<>#%\"]";   
 this.reserved = "[?;/:@&=]";   
 this.hex = "(" + this.digit + "|[a-fA-F])";   
 this._escape = "(%" + this.hex + "{2})";   
 this.unreserved = "(" + this.alpha + "|" + this.digit + "|" + this.safe + "|" + this.extra + ")";   
 this.uchar = "(" + this.unreserved + "|" + this._escape + ")";   
 this.xchar = "(" + this.unreserved + "|" + this.reserved + "|" + this._escape + ")";   
 this.digits = "(" + this.digit + "+)";   
 this.urlpath = "(" + this.xchar + "*)";   
 this.password = "((" + this.uchar + "|[?;&=]" + ")*)";   
 this.user = "((" + this.uchar + "|[?;&=]" + ")*)";   
 this.port = this.digits;   
 this.hostnumber = "(" + this.digits + " + " + this.digits + " + " + this.digits + " + " + this.digits + ")";   
 this.alphadigit = "(" + this.alpha + "|" + this.digit + ")";   
 this.toplabel = "(" + this.alpha + "|(" + this.alpha + "(" + this.alphadigit + "|-)*" + this.alphadigit + "))";   
 this.domainlabel = "(" + this.alphadigit + "|(" + this.alphadigit + "(" + this.alphadigit + "|-)*" + this.alphadigit + "))";   
 this.hostname = "((" + this.domainlabel + "\\.)*" + this.toplabel + ")";   
 this.host = "(" + this.hostname + "|" + this.hostnumber + ")";   
 this.hostport = "(" + this.host + "(:" + this.port + ")?)";   
 this.login = "((" + this.user + "(:" + this.password + ")?@)?" + this.hostport + ")";   
 this.ftptype = "[aidAID]";   
 this.fsegment = "((" + this.uchar + "|[?:@&=])*)";   
 this.fpath = "(" + this.fsegment + "(/" + this.fsegment + ")*)";   
 this.ftpurl = "([fF][tT][pP]://" + this.login + "(/" + this.fpath + "(;[tT][yY][pP][eE]=" + this.ftptype + ")?)?)";   
 this.fileurl = "([fF][iI][lL][eE]://(" + this.host + "|[lL][oO][cC][aA][lL][hH][oO][sS][tT])?/" + this.fpath + ")";   
 this._search = "((" + this.uchar + "|[;:@&=])*)";   
 this.hsegment = "((" + this.uchar + "|[;:@&=])*)";   
 this.hpath = "(" + this.hsegment + "(/" + this.hsegment + ")*)";   
 this.httpurl = "([hH][tT][tT][pP][sS]?://" + this.hostport + "(/" + this.hpath + "([?]" + this._search + ")?)?)";   
 this.gopher_string = "(" + this.xchar + "*)";   
 this.selector = "(" + this.xchar + "*)";   
 this.gtype = this.xchar;   
 this.gopherurl = "([gG][oO][pP][hH][eE][rR]://" + this.hostport + "(/(" + this.gtype + "(" + this.selector + "(%09" + this._search + "(%09" + this.gopher_string + ")?)?)?)?)?)";   
 this.article = "((" + this.uchar + "|[;/?:&=])+@" + this.host + ")";   
 this.group = "(" + this.alpha + "(" + this.alpha + "|" + this.digit + "|[-.+_])*)";   
 this.grouppart = "(|" + this.group + "|" + this.article + ")";   
 this.newsurl = "([nN][eE][wW][sS]:" + this.grouppart + ")";   
 this.nntpurl = "([nN][nN][tT][pP]://" + this.hostport + "/" + this.group + "(/" + this.digits + ")?)";   
 this.telneturl = "([tT][eE][lL][nN][eE][tT]://" + this.login + "/?)";   
 this.wpath = "(" + this.uchar + "*)";   
 this.wtype = "(" + this.uchar + "*)";   
 this.database = "(" + this.uchar + "*)";   
 this.waisdoc = "([wW][aA][iI][sS]://" + this.hostport + "/" + this.database + "/" + this.wtype + "/" + this.wpath + ")";   
 this.waisindex = "([wW][aA][iI][sS]://" + this.hostport + "/" + this.database + "[?]" + this._search + ")";   
 this.waisdatabase = "([wW][aA][iI][sS]://" + this.hostport + "/" + this.database + ")";   
 this.waisurl = "(" + this.waisdatabase + "|" + this.waisindex + "|" + this.waisdoc + ")";   
 this.check = function check(url){  

  //var url=getObject(inputName).value;
  var pos = url.indexOf("://", 1); //第一个

  if(pos < 1) return false;  
  
  var posipp = url.split("/");   //分离IP posipp[2]
  
  var ftppu = posipp[2].indexOf("@", 1); //第一个@ ftp://user:password@192.168.0.1 
 if (ftppu>0) 
 {
 var posip = posipp[2].split("@"); //分离IP posip[1]
 posip[0]=posip[1];
 }
 else
 {
 var posip = posipp[2].split(":"); //分离IP posip[0]  
 }

  var prot = url.substr(0,pos);  
  var urlf=url.substr(0,pos+3);    
  var urlfreg="((([fF][tT][pP])|([fF][iI][lL][eE])|([gG][oO][pP][hH][eE][rR])|([nN][eE][wW][sS])|([nN][nN][tT][pP])|([tT][eE][lL][nN][eE][tT])|([wW][aA][iI][sS])|([wW][aA][iI][sS])|([hH][tT][tT][pP][sS]?))://((:\d{1,5}/)|(:\d{1,5})|(/)|()))";
  var exp1=new RegExp(urlfreg);
  var reg=exp1.test(urlf); //标题头测试
	if(reg==false)
        {
        //alert("不是URl头！"+urlf);        
        return false;
        }
    else
        {
        //alert("是URL头");
        //进行下步ip测试
          var   regip   =   /^((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?)$/;   
           if   (regip.test(posip[0]))   
	         {
             //alert("IP成功啦");
             return true;
	           }   

           else        
 	       {
          //alert("不是ip,最后网址测试");   
          eval("regex = " + regex[prot] + ";");
         return url.match("^" + regex + "$");  
 	       }
        }
  }  
} 

/*短时间，形如 (13:04:06) */
      function checkTime(str) 
      { 
        var a = str.match(/^(\d{1,2})(:)?(\d{1,2})\2(\d{1,2})$/); 
        if (a == null) {
        	//alert('输入的参数不是时间格式'); 
        	return false;
        } 
        if (a[1]>24 || a[3]>60 || a[4]>60)        
        { 
          //alert("时间格式不对"); 
          return false;
        }         
        return true; 
      } 
/*短日期，形如 (2003-12-05) */
      function checkDate(str) 
      { 
         var r = str.match(/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/); 
         if(r==null)return false; 
         var d= new Date(r[1], r[3]-1, r[4]); 
         return (d.getFullYear()==r[1]&&(d.getMonth()+1)==r[3]&&d.getDate()==r[4]); 
      } 
/*长时间，形如 (2003-12-05 13:04:06) */
      function checkDateTime(str) 
      { 
        var reg = /^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})$/; 
        var r = str.match(reg); 
        if(r==null)return false; 
        var d= new Date(r[1], r[3]-1,r[4],r[5],r[6],r[7]); 
        return (d.getFullYear()==r[1]&&(d.getMonth()+1)==r[3]&&d.getDate()==r[4]&&d.getHours()==r[5]&&d.getMinutes()==r[6]&&d.getSeconds()==r[7]); 
      }
	function checkMobile(str){
		 //var reg0=/^13\d{5,9}$/;   //130--139。至少7位
		 //var reg1=/^153\d{4,8}$/;  //联通153。至少7位
		 //var reg2=/^159\d{4,8}$/;  //移动159。至少7位
		 var reg0=/^13\d{9}$/;   //130--139。至少7位
		 var reg1=/^153\d{8}$/;  //联通153。至少7位
		 var reg2=/^159\d{8}$/;  //移动159。至少7位
		 var my=false;
		 if (reg0.test(str))my=true;
		 if (reg1.test(str))my=true;
		 if (reg2.test(str))my=true;
		 return my;
	}
	
	/*验证textarea 的输入长度*/
function checkTextAreaLength(areaId,maxLength) {
	var area = document.getElementById(areaId);
	if(area.value.length > maxLength) {
		//alert("字数超过了限制");
		writeN(areaId+"note","字数超过了限制",rootUrl);
		area.value = area.value.substr(0,maxLength);
	}
}
	
function beforeOrEqual(startTime,endTime,rootUrl,timeNote,note) {
	var st = getObject(startTime).value;
	var et = getObject(endTime).value;
	if(st != "" && et!="") {
		var ss = st.split("-");
		var ssValue= Date.parse(ss[1]+'-'+ss[2]+'-'+ss[0]);
		
		var se = et.split("-");
		var seValue= Date.parse(se[1]+'-'+se[2]+'-'+se[0]);
		
		if(seValue<ssValue){
			//alert(note);
			writeN(timeNote,note,rootUrl);
			
			return false;
		}
			
	}
	writeY(timeNote,rootUrl);
			
	return true;

	
}	

	var xmlHttp;

function ajaxCheck(_node,requestUrl,reText,url) {
	
	if(getObject(_node).value.replace(/^\s+|\s+$/g,'')==''){
		writeN(_node+'Note','不能为空',url);
		return false;
	}else {
		checkMe(_node,requestUrl,reText,url);
	}		
}
    //检查普通输入信息
    function checkMe(_node,requestUrl,reText,url) {
        //获取节点id
           createXmlHttp();                       //创建XmlHttpRequest对象
            xmlHttp.onreadystatechange = function() {
                if (xmlHttp.readyState == 4) {
                    //调用showInfo方法显示服务器反馈信息
                    showInfo(_node + 'Note', xmlHttp.responseText,reText,url);
                }
            }
            xmlHttp.open("POST", requestUrl, false);
            xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
            xmlHttp.send("checkName=" + encodeURIComponent(_node) + 
                         "&checkValue=" + encodeURIComponent(getObject(_node).value));//发送包含用户输入信息的请求体
    }

    //显示服务器反馈信息
   function showInfo(_infoDivId, text,reText,url) {
        var infoDiv = document.getElementById(_infoDivId);  //获取显示信息的div
        if (text == "Y") {
        	writeY(_infoDivId,url);
        	//infoDiv.innerHTML =  writeNote(url,'Y', "可以使用");
        } else {
        	writeN(_infoDivId,'已被使用',url);
            //infoDiv.innerHTML =  writeNote(url,'N','已被使用!');
        }
    }

    //用于创建XMLHttpRequest对象
   function createXmlHttp() {
        //根据window.XMLHttpRequest对象是否存在使用不同的创建方式
        if (window.XMLHttpRequest) {
           xmlHttp = new XMLHttpRequest();                  //FireFox、Opera等浏览器支持的创建方式
        } else {
           xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");//IE浏览器支持的创建方式
        }
    }	