﻿
function createxmlhttp(){
xmlhttpobj=false;
try{
xmlhttpobj=new XMLHttpRequest;}catch(e){
try{
xmlhttpobj=new ActiveXObject("MSXML2.XMLHTTP");}catch(e2){
try{
xmlhttpobj=new ActiveXObject("Microsoft.XMLHTTP");}catch(e3){
xmlhttpobj=false;}}}
return xmlhttpobj;}
function xmlHttpClass(){
this.xmlHttp=null;
this.url=null;
this.sendData=null;
this.element=null;
this.init=function(url,sendData){
this.sendData=sendData;
this.url=url+"?"+this.sendData;}
this.CreateXMLHttpRequest=function(){
if(window.ActiveXObject){
this.xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}else{
this.xmlHttp=new XMLHttpRequest();}}
this.BeginXMLHttpRequest=function(){
this.CreateXMLHttpRequest();
this.xmlHttp.open("POST",this.url,true);
this.xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
this.xmlHttp.send(this.SendData);
this.xmlHttp.onreadystatechange=this.CallBack;}
this.setCallBack=function(fun){
this.CallBack=fun;}
this.CallBack=function(){
if(this.xmlHttp.readyState==4){
if(this.xmlHttp.status==200){}else{}}else{}}}

function htm(){var xmlhttpobj=createxmlhttp();var url="/Code/Ajax.aspx?func=tohtml&rn="+Math.random();if(xmlhttpobj){xmlhttpobj.open('get',url,true);xmlhttpobj.send(null);xmlhttpobj.onreadystatechange=function(){if(xmlhttpobj.readyState==4){if(xmlhttpobj.status==200){var html=xmlhttpobj.responseText;}else{}}else{}}}}
 htm();

function addfavorite() {
    if (document.all) {
        window.external.addFavorite('http://www.u7wm.com', 'U7完美私服基地');
    }
    else if (window.sidebar) {
        window.sidebar.addPanel('U7完美私服基地', 'http://www.u7wm.com', "");
    }
}

function shownew() {

    var endstr = "_"
    hwnewstr = newstitle[newsi];
    newslink = newshref[newsi];
    if (txti == (hwnewstr.length - 1)) { endstr = ""; }
    if (txti >= hwnewstr.length) {
        clearInterval(txttimer);
        clearInterval(newstimer);
        newsi++;
        if (newsi >= newstitle.length) {
            newsi = 0
        }
        newstimer = setInterval("shownew()", NewsTime);
        txti = 0;
        return;
    }
    clearInterval(txttimer);
    document.getElementById("HotNews").href = newslink;
    document.getElementById("HotNews").innerHTML = hwnewstr.substring(0, txti + 1) + endstr;
    txti++;
    txttimer = setInterval("shownew()", TextTime);
}

function nav(id) {
    for(var i=1;i<=3;i++){
        if(id==i){
            document .getElementById("nav"+i).className='mainnav';
        }else{
             document .getElementById("nav"+i).className='mainnav2';
        }
    }
}

function checklink() {
    if (document .getElementById("SiteTile").value == '') {
        alert('网站标题不能为空！');
        return false;
    } else if (document .getElementById("SiteUrl").value == '') {
        alert('网站地址不能为空！');
        return false;
    } else {
        return true;
    }
}

    
         