﻿// JScript 文件

//获取对象
function $(e){return document.getElementById(e);}

//去掉首尾空格
String.prototype.trim  = function(){return this.replace(/(^\s*)|(\s*$)/g, "");}

//获取xmlhttprequest对象
function getAjax()
{
    var ajax=false;
    try
    {
        ajax = new ActiveXObject("Msxml2.XMLHTTP"); 
    }
    catch(e)
    {
        try
        {            
            ajax = new ActiveXObject("Microsoft.XMLHTTP"); 
        }
        catch(E)
        {
            ajax = false; 
        }
     }
     if(!ajax && typeof XMLHttpRequest!='undefined')
     {
         ajax = new XMLHttpRequest(); 
     }
     return ajax;
}

//根据地址进行取值操作
function getAjaxValue(url)
{
    var ajax=getAjax();
    ajax.open("post",url,false);
    ajax.send();   
    var result=ajax.responseText;
    return result;
} 

//通过post的方式提交表单
function getPostAjaxValue(url,post)
{
    var ajax = getAjax();
    ajax.open("post",url,false);
    ajax.setRequestHeader("content-type","application/x-www-form-urlencoded");
    ajax.send(post);   
    var result = ajax.responseText;
    return result;
}

//退出登录
function LayOut(){
    var d = new Date(2000,1,1);
    document.cookie="btNetWeiHaiUsedHouse=;expires="+d.toGMTString()+";"+"path=/;"; 
    location.href=domain;
    return false;
}


