<!-- 
var web_url="/";
var msg_err="您请求的页面出现异常错误";
function killErr(){return true;
} 
window.onerror=killErr;
function errpic(thepic){
    thepic.src=web_url+"images/nopic.gif" 
}
function setHomePageUtil(url){
	if(document.all){
		document.body.style.behavior="url(#default#homepage)";
		document.body.setHomePage(url);
	}else{
		alert("浏览器不支持，请手动设置为首页");
	}
	return false;
}
function Trim(){
	return this.replace(/\s+$|^\s+/g,"");
}
String.prototype.Trim=Trim;

function getObjValues(id){
    if(getObjects(id).value!=undefined)
    return getObjects(id).value.Trim();
    else
    return "";
}
function getObjects(id) { 	
    if (document.getElementById) { 
       return document.getElementById(id); 
    } else if (document.all) { 
       return document.all[id]; 
    } else if (document.layers) { 
       return document.layers[id]; 
    } 
}

function $(id) {
	return document.getElementById(id);
}

function createXMLHttps(){
       var ret = null;
       try {
           ret = new ActiveXObject('Msxml2.XMLHTTP');
       } catch (e) {
           try {
               ret = new ActiveXObject('Microsoft.XMLHTTP');
           }
           catch (ee) {
               ret = null;
           }
       }
       if (!ret && typeof XMLHttpRequest != 'undefined')
           ret = new XMLHttpRequest();
       return ret;
}

function createXMLHttpRequest(){
       if (window.XMLHttpRequest) {
           XMLHttpReq=new XMLHttpRequest();
       }else if (window.ActiveXObject) {
           try {
	         XMLHttpReq=new ActiveXObject("Msxml2.XMLHTTP");
	       } catch (e) {
                 try{
	             XMLHttpReq=new ActiveXObject("Micrsost.XMLHTTP");
	       } catch(e){
           }
       }
       }
}
var cache = new Array();
function getHttpObject(){
       var objType = false;
       try {
           objType = new ActiveXObject('Msxml2.XMLHTTP');
       } catch(e) {
           try {
               objType = new ActiveXObject('Microsoft.XMLHTTP');
           } catch(e) {
               objType = new XMLHttpRequest();
           }
       }
       return objType;
}
function GETAjax(URL,DIVID,TIDTXT){
       var DIVID=document.getElementById(DIVID);
       if(DIVID){
           DIVID.innerHTML = '<img border=0 src=/images/loading.gif>'
	   var xmlhttp = createXMLHttps();
	   xmlhttp.open("GET",URL,true);
	   xmlhttp.onreadystatechange = function(){
		if (xmlhttp.readyState == 4 && xmlhttp.status == 200){
		    DIVID.innerHTML = unescape(xmlhttp.responseText);
            if (TIDTXT != null) {document.getElementById("tidtxt").innerHTML=TIDTXT;}
		}
	   }
	xmlhttp.send(null);
       }
}
function POSTAjax(URL,data,DIVID){
       var DIVID=document.getElementById(DIVID);
       if(DIVID){
           DIVID.innerHTML = '<img border=0 src=/images/loading.gif>'
	   var xmlhttp = createXMLHttps();
	   xmlhttp.open("POST",URL,true);
           xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	   xmlhttp.onreadystatechange = function(){
		if (xmlhttp.readyState == 4 && xmlhttp.status == 200){
		    DIVID.innerHTML = unescape(xmlhttp.responseText);
		}
	   }
	xmlhttp.send(data);
       }
}

function pMessage() {	       
    if (XMLHttpReq.readyState==4){
	 if(XMLHttpReq.status==200){
	     var msg=XMLHttpReq.responseText;
	     document.getElementById("userword").innerHTML =msg;
	 } else {
	     window.alert(msg_err);
	 }
     }
}
var surl=location.href;
var ilen=surl.length;
if(surl.charAt(ilen-1)=='#'){
    surl=surl.substring(0, ilen-1);
    location.href=surl;
}

function showMsnUser(uid,t,d){
    OpenDiv(320,230);
    createXMLHttpRequest();		  
    XMLHttpReq.open("GET",web_url+"user/User_MsnAjax.asp?uid="+uid+"&ttt="+t+"&ddd="+d,true);
    XMLHttpReq.onreadystatechange=function(){
        if(XMLHttpReq.readyState==4){
            if(XMLHttpReq.status==200){				
                var msg=unescape(XMLHttpReq.responseText);
                document.getElementById("addfriend").innerHTML=msg;			
            } else{
                window.alert(msg_err);	
            }
        }
    }
    XMLHttpReq.send(null); 
}

function show_message(uid,t,d){
    Open_Div(320,230);
    createXMLHttpRequest();		  
    XMLHttpReq.open("GET",web_url+"user/User_MsnAjax.asp?uid="+uid+"&ttt="+t+"&ddd="+d,true);
    XMLHttpReq.onreadystatechange=function(){
        if(XMLHttpReq.readyState==4){
            if(XMLHttpReq.status==200){				
                var msg=unescape(XMLHttpReq.responseText);
                document.getElementById("MsnUserput").innerHTML=msg;			
            } else{
                window.alert(msg_err);	
            }
        }
    }
    XMLHttpReq.send(null); 
}

function showMsnput(uid,t){
    createXMLHttpRequest();		  
    XMLHttpReq.open("POST",web_url+"user/User_MsnAjax.asp?uid="+uid+"&sid=ok&ttt="+t,true);
    XMLHttpReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
    XMLHttpReq.onreadystatechange=function(){
        if(XMLHttpReq.readyState==4){
            if(XMLHttpReq.status==200){
                var msg=unescape(XMLHttpReq.responseText);
                    window.alert(msg);
		    CloseDiv();
	    } else{
                window.alert(msg_err);	
            }
        }
    }
    var strA = "touser ="+ escape(getObjValues("touser"));
    strA += "&title ="+ escape(getObjValues("title"));
    strA += "&message ="+ escape(getObjValues("message"));
    strA += "&friends ="+ escape(getObjValues("friends"));
    XMLHttpReq.send(strA);
}
function showUserUser(id){
    createXMLHttpRequest();		  
    XMLHttpReq.open("GET",web_url+"user/User_Ajax.asp?id="+id,true);
    XMLHttpReq.onreadystatechange=function(){
        if(XMLHttpReq.readyState==4){
            if(XMLHttpReq.status==200){
                var msg=unescape(XMLHttpReq.responseText);
                document.getElementById("User"+id+"_menu").innerHTML=msg;
                
            } else{
                window.alert(msg_err);	
            }
        }
    }
    XMLHttpReq.send(null); 
}

function showVisitorStr(tid,aid){
    var theHttpRequest = getHttpObject();
    theHttpRequest.onreadystatechange = function() {
        processAJAX();
    };
    theHttpRequest.open("GET",web_url+"user/user_VisitorStr.asp?tid="+tid+"&aid="+aid, true);
    theHttpRequest.send(null);
    function processAJAX() {
        if (theHttpRequest.readyState == 4) {
            if (theHttpRequest.status == 200) {
                document.getElementById("StrVisitor").innerHTML = unescape(theHttpRequest.responseText);
            } else {
                document.getElementById("StrVisitor").innerHTML = msg_err;
            }
        }
    }
}

function getPosition() {
      var top    = document.documentElement.scrollTop;
      var left   = document.documentElement.scrollLeft;
      var height = document.documentElement.clientHeight;
      var width  = document.documentElement.clientWidth;
      return {top:top,left:left,height:height,width:width};
}

function OpenDiv(ow,oh){
    var width  = ow;  //弹出框的宽度
    var height = oh;  //弹出框的高度
    var obj= document.getElementById("UserMsnDiv");
    obj.style.display  = "block";
    obj.style.position = "absolute";
    obj.style.zindex   = "999";
    obj.style.width    = width + "px";
    obj.style.height   = height + "px";
    var Position = getPosition();
    leftadd = (Position.width-width)/2;
    topadd  = (Position.height-height)/2;
    obj.style.top  = (Position.top  + topadd)  + "px";
    obj.style.left = (Position.left + leftadd) + "px";
    window.onscroll = function (){
        var Position   = getPosition();
        obj.style.top  = (Position.top  + topadd)  +"px";
        obj.style.left = (Position.left + leftadd) +"px";
    };
}
function CloseDiv(){
    document.getElementById("UserMsnDiv").style.display = "none";
}
function hideLoginbar() {
	window.parent.document.getElementById("Loginbarframe").style.display="none";
}
function showLoginbar() {
	document.getElementById("Loginbarframe").style.display = "block";
}
function getCookie(sName){
	var sSearch=sName+"=";
	var acookie=window.document.cookie+";"
	acookie=acookie.replace(/\&/g,';');
	if(acookie.length>0){
		var iOffset=acookie.indexOf(sSearch);
		if(iOffset!=-1){
			iOffset+=sSearch.length;
			var iEnd=acookie.indexOf(";",iOffset);
			if(iEnd==-1){iEnd=acookie.length;}
			var s=acookie.substring(iOffset,iEnd);
			return s;			
		}
	}
	return null;
}
function CodeCookie(str){
　     var strRtn="";
　     for (var i=str.length-1;i>=0;i--){
　　     strRtn+=str.charCodeAt(i);
　　     if (i) strRtn+="a"; 
　     }
　     return strRtn;
}
function DecodeCookie(str){
　     var strArr;
　     var strRtn="";
　     strArr=str.split("a");
　     for (var i=strArr.length-1;i>=0;i--) 
　     strRtn+=String.fromCharCode(eval(strArr[i]));
　     return strRtn;
}

function getchkLogin(){
	if (getCookie("HxName") == ""||getCookie("HxName") ==null){
          alert("您尚未登陆！");Loginput();return false;
        }else{
          return true;
        }
}

function LoginBanner(){
    var str = "";
    if (getCookie("HxName") == ""||getCookie("HxName") ==null){
     str ='<li style="text-align:left;padding:3px;">用户名 ：<input type="text" id="username1" name="username1" class="field" size=15 /></li>'
         +'<li style="text-align:left;padding:3px;">密　码 ：<input type="password" id="password1" name="password1" class="field" size=15 /></li>'
         +'<li style="text-align:left;padding:3px;"><input type="checkbox" name="userhidden1" id="userhidden1" value="1" />隐身登陆'
         +'&nbsp;&nbsp;<input type="checkbox" name="cookieDate1" id="cookieDate1" value="1" />永久登陆&nbsp;&nbsp;'
         +'<input type="hidden" name="slogin" id="slogin" value="ok" />'
         +'<input type="hidden" name="Hx" id="Hx" value="1" />'
         +'<input type=submit value="" class="button_logins" onClick="sendRequest1();"></li>'
         +'<li style="text-align:left;padding:3px;">未注册？请点此<a href="'+web_url+'User/UserReg.asp" target="_blank">注册</a> | <a href="'+web_url+'User/User_password.asp" target="_blank">忘记密码?</a></li>';
	}
	else
	{
	 str = '<li style="text-align:left;padding:3px;">'+getNowStr()+'&nbsp;&nbsp;'+ DecodeCookie(getCookie("HxName"))+'</li>'
		 + '<li style="text-align:left;padding:3px;"><img src="'+web_url+'images/home1.gif">'
		 +' <a href="'+web_url+'User/user_main.asp" target="_parent">会员中心</a>&nbsp;&nbsp;'
		 + '<a href="#" onclick="outlog(1);return false;">退出登陆</a>&nbsp;&nbsp;';
		 +'</li>';
	}
    document.getElementById("login_topbar").innerHTML = str;
}

function outlog(id){
   var xmlhttp = createXMLHttps();
   xmlhttp.open("GET", web_url+"User/check_login.asp?hx66=logout&t="+id,true);
   xmlhttp.onreadystatechange = function(){
	if (xmlhttp.readyState == 4 && xmlhttp.status == 200){
	    var msg=unescape(xmlhttp.responseText);
            if(msg == ""||msg ==null){
                getlogin();
	    }else{
			window.alert("退出登陆！");
			LoginBanner();
			return false;
	    }
	}
    }
    xmlhttp.send(null);  
}

function sendRequest(){
    var s1 = document.getElementsByName("cookieDate"); 
    var s2 = document.getElementsByName("userhidden");
    var ss1 = 0; 
    var ss2 = 0; 
    for( var i = 0; i < s1.length; i++ ) { 
    if ( s1[i].checked ){ ss1 = s1[i].value; } 
    } 
    for( var i = 0; i < s2.length; i++ ) { 
    if ( s2[i].checked ){ ss2 = s2[i].value; } 
    } 
    var strA = "user_name="+escape(getObjValues("username"));
    strA += "&pwd="+escape(getObjValues("password"));
    strA += "&cookieDate="+ss1;
    strA += "&userhidden="+ss2;
    strA += "&slogin="+getObjValues("slogin");
    strA += "&Hx="+getObjValues("Hx");
    var xmlhttp = createXMLHttps();
    xmlhttp.open("POST",web_url+"User/check_login.asp",true);
    xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
    xmlhttp.onreadystatechange = function(){
	if (xmlhttp.readyState == 4 && xmlhttp.status == 200){
	    var msg=unescape(xmlhttp.responseText);
            if(msg == ""||msg ==null){
                getlogin(); 
	    } else if(msg == "1"){
	      	window.alert("登陆成功");
			Loginput();
			window.location.reload();
			window.open (web_url+"User/user_main.asp") 
			return true;
	    } else{
	      	window.alert(msg);
	    }
	}
    }
    xmlhttp.send(strA);
}

function sendRequest1(){
    var s1 = document.getElementsByName("cookieDate1"); 
    var s2 = document.getElementsByName("userhidden1");
    var ss1 = 0; 
    var ss2 = 0; 
    for( var i = 0; i < s1.length; i++ ) { 
    if ( s1[i].checked ){ ss1 = s1[i].value; } 
    } 
    for( var i = 0; i < s2.length; i++ ) { 
    if ( s2[i].checked ){ ss2 = s2[i].value; } 
    } 
    var strA = "user_name="+escape(getObjValues("username1"));
    strA += "&pwd="+escape(getObjValues("password1"));
    strA += "&cookieDate="+ss1;
    strA += "&userhidden="+ss2;
    strA += "&slogin="+getObjValues("slogin");
    strA += "&Hx="+getObjValues("Hx");
    var xmlhttp = createXMLHttps();
    xmlhttp.open("POST",web_url+"User/check_login.asp",true);
    xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
    xmlhttp.onreadystatechange = function(){
	if (xmlhttp.readyState == 4 && xmlhttp.status == 200){
	    var msg=unescape(xmlhttp.responseText);
            if(msg == ""||msg ==null){
                getlogin(); 
	    } else if(msg == "1"){
	      	window.alert("登陆成功");
			Loginput();
			window.location.reload();
			window.open (web_url+"User/user_main.asp") 
			return true;
	    } else{
	      	window.alert(msg);
	    }
	}
    }
    xmlhttp.send(strA);
}

function goutRequest(id){
   var xmlhttp = createXMLHttps();
   xmlhttp.open("POST", web_url+"User/check_login.asp?hx66=logout&t="+id,true);
   xmlhttp.onreadystatechange = function(){
	if (xmlhttp.readyState == 4 && xmlhttp.status == 200){
	    var msg=unescape(xmlhttp.responseText);
            if(msg == ""||msg ==null){
                getlogin();
	    }else{
			window.alert("退出登陆！");
			window.location.reload();
			Loginput();
			return false;
	    }
	}
    }
    xmlhttp.send(null);  
}
function getlogin(){
    GETAjax(web_url+"User/login.asp","loginput");
    return false;
}

function Loginput(){
    var str = "";
	if (getCookie("HxName") == ""||getCookie("HxName") ==null){
        str ='<div class="logput">用户名 ：<input type="text" id="username" name="username" class="field" size=15 />'
        +'&nbsp;&nbsp;密　码 ：<input type="password" id="password" name="password" class="field" size=15 /></div>'
        +'<div class="left"><input type="checkbox" name="userhidden" id="userhidden" value="1" />隐身登陆'
        +'&nbsp;&nbsp;<input type="checkbox" name="cookieDate" id="cookieDate" value="1" />永久登陆'
        +'<input type="hidden" name="slogin" id="slogin" value="ok" />'
        +'<input type="hidden" name="Hx" id="Hx" value="1" />'
        +'&nbsp;&nbsp;<input type=submit value="" class="button_login" onClick="sendRequest();"></div>'
        +'<div class="right">未注册？请点此<a href="'+web_url+'User/UserReg.asp" target="_blank">注册</a> | <a href="'+web_url+'User/User_password.asp" target="_blank">忘记密码?</a></div>';
	}
	else
	 { 
		if (getCookie("blogs") ==2||getCookie("blogs") ==3) {
			str ='<div class="logmain">&nbsp;'
	         +'用户名：'+ DecodeCookie(getCookie("HxName"))+ '，'+getNowStr()+'&nbsp;&nbsp;'
             +'<a href="'+web_url+'User/user_main.asp" target="_blank">会员中心</a>&nbsp;&nbsp;'
		     +'<a href="'+web_url+'blog/blog.asp?u='+getCookie("u_id")+'" target="_blank">我的空间</a>&nbsp;&nbsp;'
			 +'&nbsp;&nbsp;<a href="#" onclick="goutRequest(1);return false;" target="_blank">退出登陆</a>'
             +'</div>';
		}
		 else {
			str ='<div class="logmain">&nbsp;'
	        +'用户名：'+ DecodeCookie(getCookie("HxName"))+ '，'+getNowStr()+'&nbsp;&nbsp;'
            +'<a href="'+web_url+'User/user_main.asp" target="_blank">会员中心</a>&nbsp;&nbsp;'
            +'&nbsp;&nbsp;<a href="#" onclick="goutRequest(1);return false;" target="_blank">退出登陆</a>'
            +'</div>';
		}
	 }
    document.getElementById("MsnUserput").innerHTML=str;
}

function arts_Login(){
    var str = "";
    if (getCookie("HxName") == ""||getCookie("HxName") ==null){
     str ='<li style="text-align:left;padding:3px;margin-top:10px;color:#ffff00;">登陆您的价值个案 >></li>'
	     +'<li style="text-align:left;padding:3px;color:#ffffff;margin-left:20px;">用户名 ：<input type="text" id="username2" name="username2" class="field" /></li>'
         +'<li style="text-align:left;padding:3px;color:#ffffff;margin-left:20px;">密　码 ：<input type="password" id="password2" name="password2" class="field" /></li>'
         +'<li style="text-align:left;padding:3px;color:#ffffff;margin-left:20px;">'
         +'<input type=submit value="" class="button_logins" onClick="sendRequest2();">'
		 +'&nbsp;&nbsp;<a href="'+web_url+'User/User_password.asp" target="_blank">忘记密码?</a>'
		 +'</li>'
         +'<li style="text-align:left;padding:3px;margin-top:5px;color:#ffff00;">未建立价值个案？请点此申请<a href="'+web_url+'User/UserReg.asp" target="_blank">注册</a> | <a href="'+web_url+'arts/introduction.asp" target="_blank">关于价值个案</a></li>';
	}
	else
	{
	 str = '<li style="text-align:left;padding:3px;margin-top:20px;color:#ffff00;">'+'欢迎加入“艺术家价值个案”'+'</li>'
		 +'<li style="text-align:left;padding:3px;margin-left:20px;color:#ffffff;">'+getNowStr()+'&nbsp;&nbsp;'+ DecodeCookie(getCookie("HxName"))
		 +'</li>'
		 + '<li style="text-align:left;padding:3px;margin-left:20px;color:#ffffff;">'
		 +' <a href="'+web_url+'User/user_main.asp" target="_blank">会员中心</a>&nbsp;&nbsp;'
		 + '<a href="#" onclick="arts_out(1);return false;">退出登陆</a>&nbsp;&nbsp;'
		 +'</li>'
		 + '<li style="text-align:left;padding:3px;margin-top:10px;color:#ffffff;">'
		 +'<img src="/arts/images/fwzn.jpg">  <img src="/arts/images/xssl.jpg">  <a href="/service/default.asp"><img src="/arts/images/kfzx.jpg"></a> '
		 +'</li>';
	}
    document.getElementById("login_arts").innerHTML = str;
}


function arts_out(id){
   var xmlhttp = createXMLHttps();
   xmlhttp.open("GET", web_url+"User/check_login.asp?hx66=logout&t="+id,true);
   xmlhttp.onreadystatechange = function(){
	if (xmlhttp.readyState == 4 && xmlhttp.status == 200){
	    var msg=unescape(xmlhttp.responseText);
            if(msg == ""||msg ==null){
                getlogin();
	    }else{
			window.alert("退出登陆！");
			arts_Login();
			return false;
	    }
	}
    }
    xmlhttp.send(null);  
}

function sendRequest2(){
    var s1 = document.getElementsByName("cookieDate2"); 
    var s2 = document.getElementsByName("userhidden2");
    var ss1 = 0; 
    var ss2 = 0; 
    for( var i = 0; i < s1.length; i++ ) { 
    if ( s1[i].checked ){ ss1 = s1[i].value; } 
    } 
    for( var i = 0; i < s2.length; i++ ) { 
    if ( s2[i].checked ){ ss2 = s2[i].value; } 
    } 
    var strA = "user_name="+escape(getObjValues("username2"));
    strA += "&pwd="+escape(getObjValues("password2"));
    strA += "&cookieDate="+ss1;
    strA += "&userhidden="+ss2;
    strA += "&slogin="+getObjValues("slogin");
    strA += "&Hx="+getObjValues("Hx");
    var xmlhttp = createXMLHttps();
    xmlhttp.open("POST",web_url+"User/check_login.asp",true);
    xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
    xmlhttp.onreadystatechange = function(){
	if (xmlhttp.readyState == 4 && xmlhttp.status == 200){
	    var msg=unescape(xmlhttp.responseText);
            if(msg == ""||msg ==null){
                getlogin(); 
	    } else if(msg == "1"){
	      	window.alert("登陆成功");
			Loginput();
			window.location.reload();
			window.open (web_url+"User/user_main.asp") 
			return true;
	    } else{
	      	window.alert(msg);
	    }
	}
    }
    xmlhttp.send(strA);
}

function GetResult(postBody,messageID){
    var theHttpRequest = getHttpObject();
    theHttpRequest.onreadystatechange = function() {
        processAJAX(messageID);
    };
    theHttpRequest.open("POST", web_url+"User/check_reg.asp", true);
    theHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
    theHttpRequest.send(postBody);
    function processAJAX(messageID){
        if (theHttpRequest.readyState == 4) {
            if (theHttpRequest.status == 200) {
                document.getElementById(messageID).innerHTML = unescape(theHttpRequest.responseText);
                setTimeout("validate();", 500);
                var incoks="<img align='absMiddle' alt='' src='../images/icn_ok.gif' />";
                if (unescape(theHttpRequest.responseText) == incoks) {
                    getObjects("submit").disabled=false;           
                    getObjects("submit").value="提交注册";
                } else {
                    getObjects("submit").disabled=true;           
                    getObjects("submit").value="请将注册信息填写正确和完整";
                }
             } else {
                document.getElementById(messageID).innerHTML="<p>错误信息:&nbsp;" + unescape(theHttpRequest.statusText) +"<\/p>";
             }
         }
    }
}
function validate(inputValue, fieldID, messageID){
    if (fieldID){
        // inputValue = encodeURIComponent(inputValue);
        inputValue =escape(inputValue);
        fieldID = escape(fieldID);
        cache.push("inputValue=" + inputValue + "&fieldID=" + fieldID);
    }
    if (cache.length > 0){
        var cacheEntry = cache.shift();
        GetResult(cacheEntry,messageID);
    }
}
function sendlogin(){
    createXMLHttpRequest();
    XMLHttpReq.open("POST",web_url+"User/check_reg.asp",true);
    XMLHttpReq.onreadystatechange= sprocessAJAX;
    XMLHttpReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
    XMLHttpReq.send("userid=" + escape(getObjValues("userid")) +"&nickname=" +escape(getObjValues("nickid"))  +"&sex=" +escape(getObjValues("sex"))  +"&pwdid=" +escape(getObjValues("pwdid"))+"&spwdid=" +escape(getObjValues("spwdid"))+"&Question=" +escape(getObjValues("Question"))+"&Answers=" +escape(getObjValues("Answers"))+"&sEmail="+escape(getObjValues("sEmail"))+"&source=" + escape(getObjValues("source"))+"&ucode="+escape(getObjValues("ucode")));
}

function sprocessAJAX() {
    if (XMLHttpReq.readyState==4){
	if(XMLHttpReq.status==200){
	    var msg=unescape(XMLHttpReq.responseText);
            var checkok= msg.substring(2,4);
            if (checkok == "成功") {
                document.getElementById("logins").innerHTML =msg;
            } else {
               if(msg == "Err_100"){
		   window.alert("对不起，请输入正确的验证码！");
	       } else if(msg == "Err_101"){
		   window.alert("对不起，请将注册数据填写完整！");
	       } else if(msg == "Err_102"){
		   window.alert("对不起，用户名非法！！");
	       } else if(msg == "Err_103"){
		   window.alert("对不起，密码含有非法字符！");
	       } else if(msg == "Err_104"){
		   window.alert("对不起，两次输入密码不一致！");
	       } else if(msg == "Err_105"){
		   window.alert("对不起，电子邮件格式为空或非法！");
	       } else if(msg == "Err_106"){
		   window.alert("对不起，用户名含有网站禁止注册的字词！");
	       }
            }
         }  else {
	     window.alert(msg_err);
	 }
    }
}
function sendpass(){
    createXMLHttpRequest();
    XMLHttpReq.open("POST",web_url+"user_password_ajax.asp",true);
    XMLHttpReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
    XMLHttpReq.onreadystatechange=function(){
        if(XMLHttpReq.readyState==4){
            if(XMLHttpReq.status==200){
                var msg=unescape(XMLHttpReq.responseText);
                if(msg == "Err_101"){
		    window.alert("请输入您的登陆账号,密码提示问题和密码提示答案！");
	        } else if(msg == "Err_100"){
		    window.alert("无效输入已达到三次！系统锁定您将不能使用本功能！");
	        } else if(msg == "Err_102"){
		    window.alert("输入的密码提示问题或答案不对！");
	        } else if(msg == "Err_103"){
		    window.alert("系统不存在此用户！");
	        } else if(msg == "Err_104"){
		    window.alert("系统启用邮箱验证功能，随机密码已发往您的邮箱，请查收后登陆！");
	        } else{
                    document.getElementById("passwords").innerHTML=msg;
                }
             } else{
                 window.alert(msg_err);	
             }
         }
    }
    var strA = "cmshx_AccountName="+ escape(getObjValues("cmshx_AccountName"));
    strA += "&cmshx_Question=" + escape(getObjValues("cmshx_Question"));
    strA += "&cmshx_Answer=" + escape(getObjValues("cmshx_Answer"));
    XMLHttpReq.send(strA);
}

function getLen(str){
   var strLen=0;
   for (var i=0;i<str.length;i++){
      var intCode=str.charCodeAt(i);
      if (intCode>=0&&intCode<=128){
         strLen=strLen+1; 
      }else {
         strLen=strLen+2; 
      }
   }  
   return strLen;
}
function OpenClose(id,page)
{
   if (page >= 0){
   }else{
        var sectionTitleObj = document.getElementById(id);
        if (sectionTitleObj.style.display == "block") {
        document.getElementById(id).style.display = "none";
        document.getElementById(id).innerHTML = "";
        return false;
        }
        if (sectionTitleObj.style.display == 'none' || sectionTitleObj.style.display == '') {
        sectionTitleObj.style.display = "block";
       }
   }
}
function doZoom(size){
	document.getElementById('ShowBody').style.fontSize=size+'px'
}
function tabsss(o,n,onod){
	var m_n = document.getElementById(o).getElementsByTagName(onod);
	for(i=0;i<m_n.length;i++){
	    if((onod=="a")||(onod=="em")){
                m_n[i].parentNode.className=i==n?"cur":"normal";
 			
	    }else{
		m_n[i].className=i==n?"cur":"normal";
 		
	    }
	}
}
function tabss(o,n,onod){
	var m_n = document.getElementById(o).getElementsByTagName(onod);
	for(i=0;i<m_n.length;i++){
	    if((onod=="a")||(onod=="em")){
                m_n[i].parentNode.className=i==n?"ss":"nos";
 			
	    }else{
		m_n[i].className=i==n?"ss":"nos";
 		
	    }
	}
}
function tabs(o,o2,n,onod,o2nod){
	var m_n = document.getElementById(o).getElementsByTagName(onod);
	var c_n = document.getElementById(o2).getElementsByTagName(o2nod);
	for(i=0;i<m_n.length;i++){
	    if((onod=="a")||(onod=="em")){
           m_n[i].parentNode.className=i==n?"ss":"nos";
 		   c_n[i].className=i==n?"dis":"undis";	
	    }else{
		m_n[i].className=i==n?"ss":"nos";
 		c_n[i].className=i==n?"dis":"undis";
		//d_n[i].className=i==n?"dis":"undis";
	    }
	}
}
function getNowStr(){
   var date =  new Date();
	var h = parseInt(date.getHours());
        if(h>6 && h<=12){
		hour = "上午";
	}else if(h>12 && h<18){
		hour = "下午";
	}else if((h>=0 && h<=6) || (h>=18 && h<=24)){
		hour = "晚上";
	}else{
		hour = "";
	}
	return  hour + "好";
}

function HxWindow(mypage,myname,w,h,scroll,resiza){
    LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
    TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
    settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable='+resiza+'resizable'
    win = window.open(mypage,myname,settings)
}
function copyText(obj) 
{
    var rng = document.body.createTextRange();
    rng.moveToElementText(obj);
    rng.scrollIntoView();
    rng.select();rng.execCommand("Copy");
    rng.collapse(false);
}
var img = new Image();
var Imgwidth=648;
function replaceImgp(obj) {
    img.src = obj;
    if(img.width>Imgwidth){
        img.height=img.height/(img.width/Imgwidth);
        img.width=Imgwidth;
    }
    img.src = obj;
    if(img.width>Imgwidth){
        img.height=img.height/(img.width/Imgwidth);
        img.width=Imgwidth;
    }
    document.all.mainpic.width = img.width;
    document.all.mainpic.height = img.height;
    document.all.pichref.href = web_url+"inc/View.asp?url="+obj;
    document.all.mainpic.src = obj;
}

var img = new Image();
function replaceImgs(obj) {
    img.src = obj;
    document.all.mainpic.width = 200;
    document.all.mainpic.height = 200;
    document.all.pichref.href = web_url+"inc/View.asp?url="+obj;
    document.all.mainpic.src = obj;
}
function SearchForm() {
    if (getObjValues('Keyword') == "") {
	alert("\搜索关健字不能为空！");
	document.sinfo.Keyword.focus();
    }
    else {
        return true;
    }
    return false;
}

function opencat(cat){
    if(cat.style.display=="none"){
        cat.style.display="";
    } else {
        cat.style.display="none"; 
    }
}

if (document.getElementById){ //DynamicDrive.com change
document.write('<style type="text/css">\n')
document.write('.submenu{display: none;}\n')
document.write('</style>\n')
}

function open_cat(cat,id){
    if(cat.style.display=="none"){
        cat.style.display="";	
		id = escape(id);
		var xmlhttp = createXMLHttps();
        xmlhttp.open("GET",web_url+"blog/messages.asp?id="+id, true);
        xmlhttp.send();
    }
	else {
        cat.style.display="none"; 
		window.location.reload();
    }
}
if (document.getElementById){ //DynamicDrive.com change
document.write('<style type="text/css">\n')
document.write('.submenu{display: none;}\n')
document.write('</style>\n')
}

function SwitchMenu(obj){
if(document.getElementById){
var el = document.getElementById(obj);
var ar = document.getElementById("masterdiv").getElementsByTagName("span"); //DynamicDrive.com change
   if(el.style.display != "block"){ //DynamicDrive.com change
    for (var i=0; i<ar.length; i++){
     if (ar[i].className=="submenu") //DynamicDrive.com change
     ar[i].style.display = "none";
    }
    el.style.display = "block";
   }else{
    el.style.display = "none";
   }
}
}

function Open_Div(ow,oh){
    var width  = ow;  //弹出框的宽度
    var height = oh;  //弹出框的高度
    var obj    = document.getElementById("UserMsnDiv");
    obj.style.display  = "block";
    obj.style.position = "absolute";
    obj.style.zindex   = "999";
    obj.style.width    = width + "px";
    obj.style.height   = height + "px";
    var Position = getPosition();
    leftadd = (Position.width-width)/2;
    topadd  = (Position.height-height)/6;
    obj.style.top  = (Position.top  + topadd)  + "px";
    obj.style.left = (Position.left + leftadd) + "px";
    window.onscroll = function (){
        var Position   = getPosition();
        obj.style.top  = (Position.top  + topadd)  +"px";
        obj.style.left = (Position.left + leftadd) +"px";
    };
}

function showxq(uid,t){
    Open_Div(320,130);
    createXMLHttpRequest();		  
    XMLHttpReq.open("GET",web_url+"blog/xinqing.asp?uid="+uid+"&ttt="+t,true);
    XMLHttpReq.onreadystatechange=function(){
        if(XMLHttpReq.readyState==4){
            if(XMLHttpReq.status==200){
                var msg=unescape(XMLHttpReq.responseText);
                document.getElementById("addfriend").innerHTML=msg;
            } else{
                window.alert(msg_err);	
            }
        }
    }
    XMLHttpReq.send(null); 
}

function showxqput(uid,t){
    createXMLHttpRequest();		  
    XMLHttpReq.open("POST",web_url+"blog/xinqing.asp?uid="+uid+"&sid=ok&ttt="+t,true);
    XMLHttpReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
    XMLHttpReq.onreadystatechange=function(){
        if(XMLHttpReq.readyState==4){
            if(XMLHttpReq.status==200){
                var msg=unescape(XMLHttpReq.responseText);
                    window.alert(msg);
		    CloseDiv();
			window.location.reload();
	    } else{
                window.alert(msg_err);	
            }
        }
    }
    var strA = "xinqing ="+ escape(getObjValues("xinqing"));
    XMLHttpReq.send(strA);
}

function show_xq(){
    var str = "";
	 {
        str ='DecodeCookie(getCookie("xinqing"))';
	}
    document.getElementById("xinqing").innerHTML=str;
}


function showReply(bid){
    OpenDiv(350,160);
    createXMLHttpRequest();		  
    XMLHttpReq.open("GET",web_url+"blog/syscode_book.asp?bid="+bid+"&action=reply",true);
    XMLHttpReq.onreadystatechange=function(){
        if(XMLHttpReq.readyState==4){
            if(XMLHttpReq.status==200){
                var msg=unescape(XMLHttpReq.responseText);
                document.getElementById("addfriend").innerHTML=msg;
            } else{
                window.alert(msg_err);	
            }
        }
    }
    XMLHttpReq.send(null); 
}

function show_replysave(bid){
    createXMLHttpRequest();		  
    XMLHttpReq.open("POST",web_url+"blog/syscode_book.asp?bid="+bid+"&action=savereply",true);
    XMLHttpReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
    XMLHttpReq.onreadystatechange=function(){
        if(XMLHttpReq.readyState==4){
            if(XMLHttpReq.status==200){
                var msg=unescape(XMLHttpReq.responseText);
                    window.alert(msg);
		    CloseDiv();
	    } else{
                window.alert(msg_err);	
            }
        }
    }
    var strA = "reply_content ="+ escape(getObjValues("reply_content"));
    XMLHttpReq.send(strA);
}

function show_login(){
    OpenDiv(260,230);
    createXMLHttpRequest();		  
    XMLHttpReq.open("GET",web_url+"User/u_login.asp",true);
    XMLHttpReq.onreadystatechange=function(){
        if(XMLHttpReq.readyState==4){
            if(XMLHttpReq.status==200){				
                var msg=unescape(XMLHttpReq.responseText);
                document.getElementById("u_login").innerHTML=msg;			
            } else{
                window.alert(msg_err);	
            }
        }
    }
    XMLHttpReq.send(null); 
}
// -->
