/* nieyong wrote to insert the question into cookie*/
/*get html tag*/
function v( id ){
	return document.getElementById( id );
}

function vi( id ){
	return v( id ).innerHTML.replace(/(^\s*)|(\s*$)/g,"");
}

function vv( id ){
	return v( id ).value.replace(/(^\s*)|(\s*$)/g,"");
}
/*cookie handle*/
//设置cookies值
function setcookie(name,value){
	document.cookie=name+"="+value;
}
function setcookie2( name, value ){
	document.cookie = name + "=" + escape( value ) + ";";
}
//取得cookies值
function getcookie( name ){
	　var strArg=name+"=";
	　var nArgLen=strArg.length;
	  //获取cookie的长度
	　var nCookieLen=document.cookie.length;
	　var nEnd;
	　var i=0;
	　var j;
	while (i<nCookieLen){
		　j=i+nArgLen;
		　if (document.cookie.substring(i,j)==strArg){
			　nEnd=document.cookie.indexOf (";",j);
			　if (nEnd==-1) nEnd=document.cookie.length;
				 return document.cookie.substring(j,nEnd);
		  }
	　i=document.cookie.indexOf(" ",i)+1;
	　if (i==0) break;
	}
	　return '';
}

function BASEisNotNum(theNum){
//判断是否为数字
    if (BASEtrim(theNum)=="")
        return true;
    for(var i=0;i<theNum.length;i++){
        oneNum=theNum.substring(i,i+1);
        if (oneNum<"0" || oneNum>"9")
          return true;
    }
    return false;
}

function BASEisNotInt(theInt){
//判断是否为整数
    theInt=BASEtrim(theInt);
    if ((theInt.length>1 && theInt.substring(0,1)=="0") || BASEisNotNum(theInt)){
        return true;
    }
    return false;
}

function BASEisNotFloat(theFloat){
//判断是否为浮点数
    len=theFloat.length;
    dotNum=0;
    if (len==0)
        return true;
    for(var i=0;i<len;i++){
        oneNum=theFloat.substring(i,i+1);
        if (oneNum==".")
            dotNum++;
        if ( ((oneNum<"0" || oneNum>"9") && oneNum!=".") || dotNum>1)
          return true;
    }
    if (len>1 && theFloat.substring(0,1)=="0"){
        if (theFloat.substring(1,2)!=".")
            return true;
    }
    return false;
}

/*检测是否是数字*/
function isdigit(s){
var r,re;
re = /\d*/i; //\d表示数字,*表示匹配多个数字
r = s.match(re);
return (r==s)?1:0;
}


//定义敏感字符串数组var arrT = new Array(); // 存储Text
var htmlStrs = new Array();
htmlStrs[0]="<script";
htmlStrs[1]="<iframe";