window._execute=(window.execScript)?window.execScript:window.eval;


//去掉字符串的前后空格
function String.prototype.Trim()
{
  return this.replace(/(^\s*)|(\s*$)/g,"");
}


function DrawImage(ImgD,setWidth,isOpen){
	var image=new Image();
	image.src=ImgD.src;
	if(image.width>setWidth){
		ImgD.width=setWidth;
	}

	if (isOpen==1)
	{
		ImgD.title="在新窗口打开图片";
		ImgD.style.cursor="pointer";
		ImgD.onclick=function(e){window.open(this.src);}
	}

	
}


function createXMLHttpRequest()
    {
        var xmlHttp=false;
        try
        {
            xmlHttp=new ActiveXObject('Msxml2.XMLHTTP');
        }
        catch(e)
        {
            try
            {
                xmlHttp=new ActiveXObject('Microsoft.XMLHTTP');
            }
            catch(e)
            {
                try
                {
                    xmlHttp=new XmlHttpRequest();
                }
                catch(e)
                {
                }
            }
         }
    	return xmlHttp;
    }

/*用于域名查询返回信息*/

function getDomainInfo(formname,errmsg_name){
		//alert("fdfd");
	if (formname.domainName.value.Trim().length==0){
			alert("fdfd");
		errmsg_name.innerHTML ='<font color=red>域名为空！</font>';
		//formname.domainName.focus();
		//return false;
	}
	
	else{

			errmsg_name.innerHTML="<font color=green>处理中...</font>";
			var userName2="&userName="+formname.userName.value;
			var passWD2="&passWD="+formname.passWD.value;
			

			var randDate ="&timeStamp=" + new Date().getTime();


			var xmlHttp = createXMLHttpRequest();
			var randDate ="&timeStamp=" + new Date().getTime();
			xmlHttp.open("get",url+randDate,true);

			xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");

			xmlHttp.onreadystatechange=function()
			{
				
				if(xmlHttp.readyState==4)
				{	
					if(xmlHttp.status==200)
					{
						objName.innerHTML = xmlHttp.responseText;
					}

				}
			}		
			 xmlHttp.send(null);
			 return false;		
		
		}
}



//文本框输入字,字数减少显示
function counttext(maxnum,formName)
{
	//alert(formName.content.value);
	//return false;
	if((window.event.keyCode!=10)&&(window.event.keyCode!=46)&&!(window.event.keyCode >= 33 && window.event.keyCode <=40))
	{
		var cunum=formName.content.value.length;
		restnum=maxnum-cunum;
		formName.textnum.value="字数："+restnum;
		if(formName.content.value.length>=maxnum)
		{
			formName.content.value=formName.content.value.substring(0,maxnum);
			formName.textnum.value="字数：0";
			return false;
		}
	}
}