<!-- 
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 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=/img/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=/img/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 Get_List(a,b,c,d,e,f,g){
    var theHttpRequest = getHttpObject();
    theHttpRequest.onreadystatechange = function() {
        processAJAX();
    };
    theHttpRequest.open("GET",web_url+"inc/show_ListAjax.asp?a="+a+"&b="+b+"&c="+c+"&d="+d+"&e="+e+"&f="+f+"&g="+escape(g), true);
    theHttpRequest.send(null);
    function processAJAX() {
        if (theHttpRequest.readyState == 4) {
            if (theHttpRequest.status == 200) {
                document.getElementById("HxListID").innerHTML = unescape(theHttpRequest.responseText);
            } else {
                document.getElementById("HxListID").innerHTML = msg_err;
            }
        }
    }
}
function Get_Lists(a,b,c,d,e){
    var theHttpRequest = getHttpObject();
    theHttpRequest.onreadystatechange = function() {
        processAJAX();
    };
    theHttpRequest.open("GET",web_url+"inc/show_ListsAjax.asp?a="+a+"&b="+b+"&c="+c+"&d="+escape(d), true);
    theHttpRequest.send(null);
    function processAJAX() {
        if (theHttpRequest.readyState == 4) {
            if (theHttpRequest.status == 200) {
                document.getElementById("HxListID").innerHTML = unescape(theHttpRequest.responseText);
            } else {
                document.getElementById("HxListID").innerHTML = msg_err;
            }
        }
    }
}
function doClick_body(id,ck,a){
    createXMLHttpRequest();		  
    XMLHttpReq.open("GET",web_url+"inc/cmsbody_ajax.asp?a="+a+"&id="+id+"&ck="+ck,true);
    XMLHttpReq.onreadystatechange=function(){
        if(XMLHttpReq.readyState==4){
            if(XMLHttpReq.status==200){
                var msg=unescape(XMLHttpReq.responseText);
                document.getElementById("ShowBody").innerHTML=msg;
            } else{
                window.alert(msg_err);	
            }
        }
    }
    XMLHttpReq.send(null); 
}
function gobodyPage(id,page,a){
    createXMLHttpRequest();		  
    XMLHttpReq.open("GET",web_url+"inc/cmsbody_ajax.asp?a="+a+"&id="+id+"&page="+page,true);
    XMLHttpReq.onreadystatechange=function(){
        if(XMLHttpReq.readyState==4){
            if(XMLHttpReq.status==200){
                var msg=unescape(XMLHttpReq.responseText);
                document.getElementById("ShowBody").innerHTML=msg;
            } else{
                window.alert(msg_err);	
            }
        }
    }
    XMLHttpReq.send(null);
}
function comm_body(id,a,page){
    OpenClose("commBody",page);
    var xmlhttp = createXMLHttps();
    xmlhttp.open("GET",web_url+"inc/cmscomm_ajax.asp?id="+id+"&a="+a+"&page="+page,true);
    xmlhttp.onreadystatechange=function(){
        if(xmlhttp.readyState==4){
            if(xmlhttp.status==200){
                var msg=unescape(xmlhttp.responseText);
                document.getElementById("commBody").innerHTML=msg;
            } else{
                 window.alert(msg_err);	
            }
        }
    }
    xmlhttp.send(null); 
}
function checkForms(){
    if(getObjValues("uname")==""||getObjValues("txtcomment")==""){
	alert("昵称和评论内容不能为空！");return false;
    }
    if(getObjValues("uname").length>20){
	alert("昵称不能大于20字！");return false;
    }
    if(getObjValues("txtcomment").length>100){
	alert("评论内容不能大于100字！");return false;
    }
    if(getObjValues("sCode")==""){
	alert("请输入验证码！");return false;
    }
    return true;
}
function comm_put(id,a){
    if(checkForms()){
        createXMLHttpRequest();
       	XMLHttpReq.open("POST",web_url+"inc/cmscomm_ajax.asp?id="+id+"&a="+a,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_100"){
		        window.alert("非法操作！");
	            } else if(msg == "Err_101"){
		        window.alert("你发表的内容中包含系统禁止字符！");
	            } else if(msg == "Err_102"){
		        window.alert("请输入正确的验证码！");
	            } else{
                        document.getElementById("commBody").innerHTML=msg;
                    }
                 } else{
                    window.alert(msg_err);	
                 }
             }
         }
         var strA = "uname ="+ escape(getObjValues("uname"));
         strA += "&txtcomment ="+ escape(getObjValues("txtcomment"));
         strA += "&scode ="+ escape(getObjValues("sCode"));
         strA += "&do =add";
         XMLHttpReq.send(strA);
    }
}
function Correlation(id){
    createXMLHttpRequest();		  
    XMLHttpReq.open("GET","../HxAsk/Correlation.asp?id="+id,true);
    XMLHttpReq.onreadystatechange=function(){
        if(XMLHttpReq.readyState==4){
            if(XMLHttpReq.status==200){
                var msg=unescape(XMLHttpReq.responseText);
                document.getElementById("Correlationword").innerHTML=msg;
                
            } else{
                window.alert(msg_err);	
            }
        }
    }
    XMLHttpReq.send(null); 
}
function getuser(id){
    createXMLHttpRequest();		  
    XMLHttpReq.onreadystatechange= pMessage;
    XMLHttpReq.open("GET","UserWord.asp?t="+id,true);
    XMLHttpReq.send(null);
}
function goPage(id,page){
    createXMLHttpRequest();		  
    XMLHttpReq.onreadystatechange= pMessage;
    XMLHttpReq.open("GET","UserWord.asp?t="+id+"&page="+page,true);
    XMLHttpReq.send(null);
}
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 ask_put(s){
    document.Hxask.content.value=s.content.value;
     Hxask.submit();
}
function disQstate(s){
    switch(s){
        case 0: var op="<img src='../img/wd/icn_time.gif' alt='待解决问题' />";
        break;
        case 1: var op="<img src='../img/wd/icn_ok.gif' alt='已解决问题' />";
        break; 
        case 2: var op="<img src='../img/wd/icn_close.gif' alt='无满意回答，问题已关闭' />"; 
        break;
        case 3: var op="<img src='../img/wd/icn_vote.gif' alt='投票中的问题' />"; 
        break;
        case 4: var op="<img src='../img/wd/icn_close.gif' alt='过期问题，问题已关闭' />"; 
        break;
        case 5: var op="<img src='../img/wd/icn_del.gif' alt='问题已删除' />"; 
        break;
        default: var op="未知";
    }
    document.write(op);
}
function showAskUser(id){
    createXMLHttpRequest();		  
    XMLHttpReq.open("GET",web_url+"HxAsk/User_Ajax.asp?id="+id,true);
    XMLHttpReq.onreadystatechange=function(){
        if(XMLHttpReq.readyState==4){
            if(XMLHttpReq.status==200){
                var msg=unescape(XMLHttpReq.responseText);
                document.getElementById("Ask"+id+"_menu").innerHTML=msg;
                
            } else{
                window.alert(msg_err);	
            }
        }
    }
    XMLHttpReq.send(null); 
}
function getcount(){
    createXMLHttpRequest();		  
    XMLHttpReq.onreadystatechange= cMessage;
    XMLHttpReq.open("GET",web_url+"counts/cmsonline.asp",true);
    XMLHttpReq.send(null);
}
function getcountPage(page){
    createXMLHttpRequest();		  
    XMLHttpReq.onreadystatechange= cMessage;
    XMLHttpReq.open("GET",web_url+"counts/cmsonline.asp?page="+page,true);
    XMLHttpReq.send(null);
}
function cMessage() {	       
    if (XMLHttpReq.readyState==4){
	 if(XMLHttpReq.status==200){
	     var msg=unescape(XMLHttpReq.responseText);
	     document.getElementById("countword").innerHTML =msg;
	 } else {
	     window.alert(msg_err);
	 }
     }
}
function showonline(id,t)
{
GETAjax(web_url+"counts/cmsonline_Ajax.asp?id="+id,"showonline_"+t);
return false;
}
function showDiary(id,t){
    createXMLHttpRequest();		  
    XMLHttpReq.open("GET",web_url+"inc/Diary_Ajax.asp?id="+id,true);
    XMLHttpReq.onreadystatechange=function(){
        if(XMLHttpReq.readyState==4){
            if(XMLHttpReq.status==200){
                var msg=unescape(XMLHttpReq.responseText);
                document.getElementById("Diaryinformation"+t+"_menu").innerHTML=msg;
                
            } else{
                window.alert(msg_err);	
            }
        }
    }
    XMLHttpReq.send(null); 
}
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("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 cart_body(id,a){
    createXMLHttpRequest();		  
    XMLHttpReq.open("GET","shop_ajax.asp?id="+id+"&a="+a,true);
    XMLHttpReq.onreadystatechange=function(){
        if(XMLHttpReq.readyState==4){
            if(XMLHttpReq.status==200){
                var msg=unescape(XMLHttpReq.responseText);
                if (msg == "0") {
                        window.alert("请注册或登陆后购买商品！");OpenDiv(300,180);Loginput();
	        } else if(msg == "Err"){
		        window.alert("购物车内有不同于此类别的商品，请清空您的购物车后购买此商品。谢谢！");
	        } else if(msg == "Err1"){
		        window.alert("您的购物车已有此商品！");
	        } else {
                    document.getElementById("cartBody").innerHTML=msg;
                }
            } else{
                window.alert(msg_err);	
            }
        }
    }
    XMLHttpReq.send(null); 
}
function cart_edit(id,a){
    createXMLHttpRequest();
    var tnum = getObjValues("cart_"+id);		  
    XMLHttpReq.open("GET","shop_ajax.asp?id="+id+"&t="+tnum+"&a="+a,true);
    XMLHttpReq.onreadystatechange=function(){
        if(XMLHttpReq.readyState==4){
            if(XMLHttpReq.status==200){
                var msg=unescape(XMLHttpReq.responseText);
                if (msg == "0") {
                        window.alert("请注册或登陆后更改数量！");OpenDiv(300,180);Loginput();
	        } else {
                    document.getElementById("cartBody").innerHTML=msg;
                }
            } else{
                window.alert(msg_err);	
            }
        }
    }
    XMLHttpReq.send(null); 
}
function cash_body(){
    createXMLHttpRequest();		  
    XMLHttpReq.open("POST","shop_ajax_cash.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);
                document.getElementById("cashBody").innerHTML=msg;
            } else{
                window.alert(msg_err);	
            }
        }
    }
    var wb_num = getObjValues("wb_num");
    var hg_id = getObjValues("hg_id");
    if (hg_id=="") hg_id = 0;
    if (wb_num=="") wb_num = 0;
    var strA = "to_name ="+ escape(getObjValues("to_name"));
    strA += "&to_adds ="+ escape(getObjValues("to_adds"));
    strA += "&email ="+ escape(getObjValues("email"));
    strA += "&tel ="+ escape(getObjValues("tel"));
    strA += "&sendtype ="+ escape(getObjValues("sendtype"));
    strA += "&postcode ="+ escape(getObjValues("postcode"));
    strA += "&paymenttype ="+ escape(getObjValues("paymenttype"));
    strA += "&totalcash ="+ escape(getObjValues("totalcash"));
    strA += "&other ="+ escape(getObjValues("other"));
    strA += "&fei ="+ escape(getObjValues("fei"));
    strA += "&summoney ="+ escape(getObjValues("summoney"));
    strA += "&totaljf ="+ escape(getObjValues("totaljf"));
    strA += "&fapiao ="+ escape(getObjValues("fapiao"));
    strA += "&wb_num ="+ wb_num;
    strA += "&hg_id ="+ hg_id;
    strA += "&isCard ="+ escape(getObjValues("isCard"));
    XMLHttpReq.send(strA);
}
function Checksave(){ 
        if(document.form1.to_name.value.length == 0){
           alert("收货人姓名不能为空。");document.form1.to_name.focus();return false;
        }else if(document.form1.tel.value.length == 0){
           alert("联系电话不能为空。");document.form1.tel.focus();return false;
        }else if(document.form1.to_adds.value.length == 0){
           alert("收货人地址不能为空。");document.form1.to_adds.focus();return false;
        }else if(document.form1.email.value.length > 0 && !document.form1.email.value.match( /^.+@.+$/ ) ){
	   alert("EMAIL输入错误！请重新输入");document.form1.email.focus();return false;
	}else if (document.form1.postcode.value.length !=6){
	   alert("请输入正确的邮政编码，长度为6位数字。");document.form1.postcode.focus();return false;
	}
        return true;
}
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("您尚未登陆！");OpenDiv(300,180);Loginput();return false;
        }else{
          return true;
        }
}

function LoginBanner(){
    var str = "";
    if (getCookie("HxName") == ""||getCookie("HxName") ==null){
    str ='<li><a href="#" onclick="OpenDiv(250,150);Loginput();return false;">登录</a>&nbsp;&nbsp;</li>'
	+'<li><a href="'+web_url+'User/UserReg.asp" target="_blank" >注册</a>&nbsp;&nbsp;</li>'
	+'<li><a href="'+web_url+'User/user_password.asp" target="_blank">找回密码</a>&nbsp;&nbsp;</li>';
	}
	else
	{
		str = '<li><strong>'+ DecodeCookie(getCookie("HxName"))+ '，</strong>'+getNowStr()+'&nbsp;&nbsp;</li>'
			+ '<li><a href="'+web_url+'HxBLog/BLog.asp?u='+getCookie("uid")+'" target="_parent">我的博客</a>&nbsp;&nbsp;</li>'
			+ '<li><a href="'+web_url+'User/user_main.asp" target="_parent">会员中心</a>&nbsp;&nbsp;</li>'
			+ '<li><a href="#" onclick="goutRequest(1);return false;">退出登陆</a>&nbsp;&nbsp;</li>';
	}
    document.getElementById("login_topbar").innerHTML = str;
}

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 = "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("登陆成功！");
                CloseDiv();LoginBanner();
	    } else{
	      	window.alert(msg);
	    }
	}
    }
    xmlhttp.send(strA);
}
function goutRequest(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{
	      	LoginBanner();
	    }
	}
    }
    xmlhttp.send(null);  
}
function getlogin(){
    GETAjax(web_url+"User/login.asp","Loginbar");
    return false;
}
function Loginput(){
    var str = "";
    str ='<div>用户名 <input type="text" id="username" name="username" size=15 /></div>'
    +'<div>密　码 <input type="password" id="password" name="password" size=15 /></div>'
    +'<div><input type="checkbox" name="userhidden" id="userhidden" value="1" />隐身登陆'
    +'&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" name="cookieDate" id="cookieDate" value="1" />永久登陆</div>'
    +'<div><input type="hidden" name="slogin" id="slogin" value="ok" />'
    +'<input type="hidden" name="Hx" id="Hx" value="1" /></div>'
    +'<div><input type=submit value=" 登 录 " onClick="sendRequest();">'
    +' <input type=button value=" 取 消 " onClick="CloseDiv();"></div>'
    +'<div>未注册？请点此<a href="'+web_url+'User/UserReg.asp" target="_blank" onClick="CloseDiv();">注册</a></div>';
    document.getElementById("MsnUserput").innerHTML=str;
}
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")) +"&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","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 getvote(id){
    GETAjax(web_url+"inc/show_vote.asp?id="+id,"votebar_"+id);
    return false;
}
function putvote(id){
    var item_id = document.getElementsByName("item_id_"+id); 
    var tid =0
    for( var i = 0; i < item_id.length; i++ ) { 
    if ( item_id[i].checked ){tid = item_id[i].value;} 
    } 
    if(tid==0){alert("请选定投票选项！");return false;}
    createXMLHttpRequest();		  
    XMLHttpReq.open("GET",web_url+"inc/show_vote.asp?t=ok&id="+id+"&tid="+tid,true);
    XMLHttpReq.onreadystatechange=function(){
        if(XMLHttpReq.readyState==4){
            if(XMLHttpReq.status==200){
                var msg=unescape(XMLHttpReq.responseText);
                if(msg == "Err_1"){
		    window.alert("非法操作！");
	        } else if(msg == "Err_2"){
		    window.alert("对不起，您已经投过票了，系统设置每个IP只能投一次！");
	        } else{
                    window.alert("投票成功！");document.getElementById("votebar_"+id).innerHTML=msg;
                }
            } else{
                window.alert(msg_err);	
            }
        }
    }
    XMLHttpReq.send(null); 
}
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 popwin(id,path){
      window.open(web_url+"inc/vidplayer.asp?id="+id+"&see="+path,"","height=430,width=480,resizable=no,scrollbars=no,status=no,toolbar=no,menubar=no,location=no");
}
var win = null;
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"; 
    }
}
// -->
