﻿// JScript 文件
   var setobj,setobj1;
   var xmlHttp;

   function CloseDiv()
   {
      setobj.style.display='none';
      setobj1.style.display='none';
   }

   function ShowCommend(event)
   {
        
        setobj=Obj("light");//页面上某个层的ID
        setobj1=Obj("fade");
        setobj.style.display="block";
        setobj1.style.display="block";
        setobj.style.top=event.clientY+document.body.scrollTop+"px";
        setobj.style.left=event.clientX+document.body.scrollLeft+"px";
        setobj.style.width="380px";
        setobj.style.height="auto";
        setobj1.style.height=document.body.scrollTop+document.body.offsetHeight+"px";
        showCustomer("../ChangeCity.aspx");
    }
   function stateChanged() 
   {
        if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
         {
             setobj.innerHTML=xmlHttp.responseText;
         }
   }
    
    function Obj(objName){
           if(document.getElementById)
                 return eval('document.getElementById("' + objName + '")');
           else if(document.layers) 
                 return eval("document.layers['" + objName +"']");
            else return eval('document.all.' + objName);
    }
    function showCustomer(str)
    {
      
        var url=str;
        xmlHttp=createXMLHttpRequest();
        xmlHttp.open("get",url,true);
        xmlHttp.send(null);
        xmlHttp.onreadystatechange = stateChanged;
    }
    function createXMLHttpRequest()
    {
    var xmlHttpobj;
    try{xmlHttpobj=new XMLHttpRequest();}
    catch(e)
    {
        var versions = ['Microsoft.XMLHTTP', 'MSXML.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.7.0', 'Msxml2.XMLHTTP.6.0', 'Msxml2.XMLHTTP.5.0', 'Msxml2.XMLHTTP.4.0', 'MSXML2.XMLHTTP.3.0', 'MSXML2.XMLHTTP'];
        for(var i=0; i<versions.length; i++)
        {
            try
            {
                xmlHttpobj = new ActiveXObject(versions[i]);
                if(xmlHttpobj){return xmlHttpobj;}
            }catch(e) {}
        }        
    }
    return xmlHttpobj;
}

