<!-- 
var web_url="/";
var msg_err="您请求的页面出现异常错误1";
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/body_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/body_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/comm_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/comm_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/ptxonline.asp",true);
    XMLHttpReq.send(null);
}
function getcountPage(page){
    createXMLHttpRequest();		  
    XMLHttpReq.onreadystatechange= cMessage;
    XMLHttpReq.open("GET",web_url+"counts/ptxonline.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/ptxonline_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 style="width:82px"><a href="#" onclick="OpenDiv(250,150);Loginput();return false;">用户登录</a><span class="minispan">·</span></li>'
	+'<li style="width:82px"><a href="'+web_url+'User/UserReg.asp" target="_blank" >用户注册</a><span>·</span></li>'
	+'<li style="width:82px"><a href="'+web_url+'User/user_password.asp" target="_blank">找回密码</a><span>·</span></li>';
	}
	else
	{
		str = '<li style="width:82px"><a href="'+web_url+'User/user_main.asp" target="_parent">会员中心</a><span>·</span></li>'
			+ '<li style="width:82px"><a href="#" onclick="goutRequest(1);return false;">退出登陆</a><span>·</span></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"))  +"&moni=" +escape(getObjValues("moni"))  +"&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 = "ptxAccountName="+ escape(getObjValues("ptxAccountName"));
    strA += "&ptxQuestion=" + escape(getObjValues("ptxQuestion"));
    strA += "&ptxAnswer=" + escape(getObjValues("ptxAnswer"));
    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"; 
    }
}
function RegInfo2(val){
  $('HJimg').style.display = 'none';
  $('BYimg').style.display = 'none';
  $('YYimg').style.display = 'none';
  $('MZimg').style.display = 'none';
  $('HJM').className = '';
  $('BYM').className = '';
  $('YYM').className = '';
  $('MZM').className = '';
  $(val+'M').className = 'M';
  $(val+'img').style.display = '';
}
function RegInfo3(val){
  $('tanddimg').style.display = 'none';
  $('hjrimg').style.display = 'none';
  $('zjimg').style.display = 'none';
  $('jgimg').style.display = 'none';
  $('tandd').className = '';
  $('hjr').className = '';
  $('zj').className = '';
  $('jg').className = '';
  $(val+'M3').className = 'M3';
  $(val+'img').style.display = '';
}
function isMatch(str1,str2){ 
var index = str1.indexOf(str2); 
if(index==-1) return false; 
return true; 
} 
function ResumeError(){ 
return true; 
} 
window.onerror = ResumeError; 
function doClick(o){ 
o.className="menu_nav_current"; 
var j; 
var id; 
var e; 
for(var i=1;i<=11;i++){ 
  id ="menu_nav"+i; 
  j = document.getElementById(id); 
  e = document.getElementById("menu_sub"+i); 
  if(id != o.id){ 
   j.className="menu_nav_link"; 
   e.style.display = "none"; 
  }else{ 
   e.style.display = "block"; 
  } 
} 
}
function doonMouseOut(o){
o.style.display = "none";}
function NewWindow(urlStr, winName, settings) {
  var win = window.open(urlStr,winName,settings);
  if(win.window.focus)
  {
    win.window.focus();
  }
}
function doClick_up(o){ 
     o.className="up_current"; 
     var j; 
     var id; 
     var e; 
     for(var i=1;i<=5;i++){ 
       id ="up"+i; 
       j = document.getElementById(id); 
       e = document.getElementById("up_con"+i); 
       if(id != o.id){ 
         j.className="up_link"; 
         e.style.display = "none"; 
       }else{ 
        e.style.display = "block"; 
       } 
     } 
     }




function Marquee()
{
	this.ID = document.getElementById(arguments[0]);
	if(!this.ID)
	{
		alert("您要设置的\"" + arguments[0] + "\"初始化错误\r\n请检查标签ID设置是否正确!");
		this.ID = -1;
		return;
	}
	this.Direction = this.Width = this.Height = this.DelayTime = this.WaitTime = this.CTL = this.StartID = this.Stop = this.MouseOver = 0;
	this.Step = 1;
	this.Timer = 30;
	this.DirectionArray = {"top":0 , "up":0 , "bottom":1 , "down":1 , "left":2 , "right":3};
	if(typeof arguments[1] == "number" || typeof arguments[1] == "string")this.Direction = arguments[1];
	if(typeof arguments[2] == "number")this.Step = arguments[2];
	if(typeof arguments[3] == "number")this.Width = arguments[3];
	if(typeof arguments[4] == "number")this.Height = arguments[4];
	if(typeof arguments[5] == "number")this.Timer = arguments[5];
	if(typeof arguments[6] == "number")this.DelayTime = arguments[6];
	if(typeof arguments[7] == "number")this.WaitTime = arguments[7];
	if(typeof arguments[8] == "number")this.ScrollStep = arguments[8];
	this.ID.style.overflow = this.ID.style.overflowX = this.ID.style.overflowY = "hidden";
	this.ID.noWrap = true;
	this.IsNotOpera = (navigator.userAgent.toLowerCase().indexOf("opera") == -1);
	if(arguments.length >= 7)this.Start();
}

Marquee.prototype.Start = function()
{
	if(this.ID == -1)return;
	if(this.WaitTime < 800)this.WaitTime = 800;
	if(this.Timer < 20)this.Timer = 20;
	if(this.Width == 0)this.Width = parseInt(this.ID.style.width);
	if(this.Height == 0)this.Height = parseInt(this.ID.style.height);
	if(typeof this.Direction == "string")this.Direction = this.DirectionArray[this.Direction.toString().toLowerCase()];
	this.HalfWidth = Math.round(this.Width / 2);
	this.HalfHeight = Math.round(this.Height / 2);
	this.BakStep = this.Step;
	this.ID.style.width = this.Width + "px";
	this.ID.style.height = this.Height + "px";
	if(typeof this.ScrollStep != "number")this.ScrollStep = this.Direction > 1 ? this.Width : this.Height;
	var templateLeft = "<table cellspacing='0' cellpadding='0' style='border-collapse:collapse;display:inline;'><tr><td noWrap=true style='white-space: nowrap;word-break:keep-all;'>MSCLASS_TEMP_HTML</td><td noWrap=true style='white-space: nowrap;word-break:keep-all;'>MSCLASS_TEMP_HTML</td></tr></table>";
	var templateTop = "<table cellspacing='0' cellpadding='0' style='border-collapse:collapse;'><tr><td>MSCLASS_TEMP_HTML</td></tr><tr><td>MSCLASS_TEMP_HTML</td></tr></table>";
	var msobj = this;
	msobj.tempHTML = msobj.ID.innerHTML;
	if(msobj.Direction <= 1)
	{
		msobj.ID.innerHTML = templateTop.replace(/MSCLASS_TEMP_HTML/g,msobj.ID.innerHTML);
	}
	else
	{
		if(msobj.ScrollStep == 0 && msobj.DelayTime == 0)
		{
			msobj.ID.innerHTML += msobj.ID.innerHTML;
		}
		else
		{
			msobj.ID.innerHTML = templateLeft.replace(/MSCLASS_TEMP_HTML/g,msobj.ID.innerHTML);
		}
	}
	var timer = this.Timer;
	var delaytime = this.DelayTime;
	var waittime = this.WaitTime;
	msobj.StartID = function(){msobj.Scroll()}
	msobj.Continue = function()
				{
					if(msobj.MouseOver == 1)
					{
						setTimeout(msobj.Continue,delaytime);
					}
					else
					{	clearInterval(msobj.TimerID);
						msobj.CTL = msobj.Stop = 0;
						msobj.TimerID = setInterval(msobj.StartID,timer);
					}
				}

	msobj.Pause = function()
			{
				msobj.Stop = 1;
				clearInterval(msobj.TimerID);
				setTimeout(msobj.Continue,delaytime);
			}

	msobj.Begin = function()
		{
			msobj.ClientScroll = msobj.Direction > 1 ? msobj.ID.scrollWidth / 2 : msobj.ID.scrollHeight / 2;
			if((msobj.Direction <= 1 && msobj.ClientScroll <= msobj.Height + msobj.Step) || (msobj.Direction > 1 && msobj.ClientScroll <= msobj.Width + msobj.Step))			{
				msobj.ID.innerHTML = msobj.tempHTML;
				delete(msobj.tempHTML);
				return;
			}
			delete(msobj.tempHTML);
			msobj.TimerID = setInterval(msobj.StartID,timer);
			if(msobj.ScrollStep < 0)return;
			msobj.ID.onmousemove = function(event)
						{
							if(msobj.ScrollStep == 0 && msobj.Direction > 1)
							{
								var event = event || window.event;
								if(window.event)
								{
									if(msobj.IsNotOpera)
									{
										msobj.EventLeft = event.srcElement.id == msobj.ID.id ? event.offsetX - msobj.ID.scrollLeft : event.srcElement.offsetLeft - msobj.ID.scrollLeft + event.offsetX;
									}
									else
									{
										msobj.ScrollStep = null;
										return;
									}
								}
								else
								{
									msobj.EventLeft = event.layerX - msobj.ID.scrollLeft;
								}
								msobj.Direction = msobj.EventLeft > msobj.HalfWidth ? 3 : 2;
								msobj.AbsCenter = Math.abs(msobj.HalfWidth - msobj.EventLeft);
								msobj.Step = Math.round(msobj.AbsCenter * (msobj.BakStep*2) / msobj.HalfWidth);
							}
						}
			msobj.ID.onmouseover = function()
						{
							if(msobj.ScrollStep == 0)return;
							msobj.MouseOver = 1;
							clearInterval(msobj.TimerID);
						}
			msobj.ID.onmouseout = function()
						{
							if(msobj.ScrollStep == 0)
							{
								if(msobj.Step == 0)msobj.Step = 1;
								return;
							}
							msobj.MouseOver = 0;
							if(msobj.Stop == 0)
							{
								clearInterval(msobj.TimerID);
								msobj.TimerID = setInterval(msobj.StartID,timer);
							}
						}
		}
	setTimeout(msobj.Begin,waittime);
}

Marquee.prototype.Scroll = function()
{
	switch(this.Direction)
	{
		case 0:
			this.CTL += this.Step;
			if(this.CTL >= this.ScrollStep && this.DelayTime > 0)
			{
				this.ID.scrollTop += this.ScrollStep + this.Step - this.CTL;
				this.Pause();
				return;
			}
			else
			{
				if(this.ID.scrollTop >= this.ClientScroll)
				{
					this.ID.scrollTop -= this.ClientScroll;
				}
				this.ID.scrollTop += this.Step;
			}
		break;

		case 1:
			this.CTL += this.Step;
			if(this.CTL >= this.ScrollStep && this.DelayTime > 0)
			{
				this.ID.scrollTop -= this.ScrollStep + this.Step - this.CTL;
				this.Pause();
				return;
			}
			else
			{
				if(this.ID.scrollTop <= 0)
				{
					this.ID.scrollTop += this.ClientScroll;
				}
				this.ID.scrollTop -= this.Step;
			}
		break;

		case 2:
			this.CTL += this.Step;
			if(this.CTL >= this.ScrollStep && this.DelayTime > 0)
			{
				this.ID.scrollLeft += this.ScrollStep + this.Step - this.CTL;
				this.Pause();
				return;
			}
			else
			{
				if(this.ID.scrollLeft >= this.ClientScroll)
				{
					this.ID.scrollLeft -= this.ClientScroll;
				}
				this.ID.scrollLeft += this.Step;
			}
		break;

		case 3:
			this.CTL += this.Step;
			if(this.CTL >= this.ScrollStep && this.DelayTime > 0)
			{
				this.ID.scrollLeft -= this.ScrollStep + this.Step - this.CTL;
				this.Pause();
				return;
			}
			else
			{
				if(this.ID.scrollLeft <= 0)
				{
					this.ID.scrollLeft += this.ClientScroll;
				}
				this.ID.scrollLeft -= this.Step;
			}
		break;
	}
}
function DrawImage(ImgD,width,height){ var flag=false; 
var image=new Image(); 
var iwidth = width; //定义允许图片宽度 
var iheight = height; //定义允许图片高度 
image.src=ImgD.src; 
if(image.width>0 && image.height>0){ 
flag=true; 
if(image.width/image.height>= iwidth/iheight){ 
if(image.width>iwidth){  
ImgD.width=iwidth; 
ImgD.height=(image.height*iwidth)/image.width; 
}else{ 
ImgD.width=image.width;  
ImgD.height=image.height; 
} 
} 
else{ 
if(image.height>iheight){  
ImgD.height=iheight; 
ImgD.width=(image.width*iheight)/image.height;  
}else{ 
ImgD.width=image.width;  
ImgD.height=image.height; 
} 
} 
} 
} 
// -->
