function GetCustomer()
{
    if(xmlHttp == null)
        xmlHttp = CreateXMLHttpRequest();
    xmlHttp.open("get","code/GetCustomer.aspx?Rnd=" + getRndParam(), true);
    xmlHttp.send(null);
    xmlHttp.onreadystatechange=function(){
        if(xmlHttp.readyState==4){
             if(xmlHttp.status==200)
             {
                document.getElementById("divCustomer").innerHTML = xmlHttp.responseText;
             }
        }
    }
}
function GetNews(getTop, year)
{
    if(xmlHttp == null)
        xmlHttp = CreateXMLHttpRequest();
    xmlHttp.open("get","code/GetNews.aspx?GetTop=" + getTop + "&Year=" + year + "&Rnd=" + getRndParam(), true);
    xmlHttp.send(null);
    xmlHttp.onreadystatechange=function(){
        if(xmlHttp.readyState==4){
             if(xmlHttp.status==200)
             {
                document.getElementById("divNews").innerHTML = xmlHttp.responseText;
             }
        }
    }
}
function GetNewsView(id)
{
    if(xmlHttp == null)
        xmlHttp = CreateXMLHttpRequest();
    xmlHttp.open("get","code/GetNews_View.aspx?Id=" + id + "&Rnd=" + getRndParam(), true);
    xmlHttp.send(null);
    xmlHttp.onreadystatechange=function(){
        if(xmlHttp.readyState==4){
             if(xmlHttp.status==200)
             {
                document.getElementById("divNews").innerHTML = xmlHttp.responseText;
             }
        }
    }
}
var xmlHttp = null;
function CreateXMLHttpRequest()
{
   // Initialize Mozilla XMLHttpRequest object
   if (window.XMLHttpRequest)
   {
       xmlHttp = new XMLHttpRequest();
   }
   // Initialize for IE/Windows ActiveX version
   else if (window.ActiveXObject)
   {
       try
       {
                xmlHttp = new ActiveXObject("Msxml2.XMLHTTP.3.0");
        } 
       catch (e)
       {
                try
                {
                     xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
                }  
                catch(e)
                {
                     alert('对不起，您的浏览器不支持XMLHttpRequest对像！');
                }
          }   
   }
   return xmlHttp;
}
function getRndParam()
{
    var rnd=  new Date().getTime();
    return rnd;
}
function GetUrlValue(name){ 
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)","i"); 
    var r = window.location.search.substr(1).match(reg); 
    if (r!=null) 
        return unescape(r[2]); 
    return null; 
}
function OpenWindow(url, wndName, width, height)
{
    var left,top,features,wnd;
    if(width == 0 && height==0) {
        features =
        'width=' + width + 'px,' +
        'height=' + height + 'px,' +
        'status=1, scrollbars=1, resizable=1';
        wnd = window.open(url, wndName, features);        wnd.moveTo(0,0) 
        wnd.resizeTo(screen.availWidth,screen.availHeight) 
    }
    else
    {
        left =  Math.ceil((window.screen.availWidth - width) / 2); 
        top =  Math.ceil((window.screen.availHeight - height) / 2);
        if(top >= 30)
            top -= 30;  
        features =
            'width=' + width + 'px,' +
            'height=' + height + 'px,' +
            'left=' + left + 'px,' +
            'top=' + top + 'px,' +
            'status=1, scrollbars=1, resizable=1';
        wnd = window.open(url, wndName, features);
        wnd.focus(); 
    }   
}
function flashObject(file_name,width,height,color){
  document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="' + width + '" height="' + height + '">');
  document.write('<param name="movie" value="' + file_name + '">');
  document.write('<param name="quality" value="high">');
if(color=='')
  document.write('<param name="wmode" value="transparent">');
else
document.write('<param name="bgcolor" value="' + color + '">');
  document.write('<embed src="' + file_name + '" width="' + width + '" height="' + height + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" ></embed>');
  document.write('</object>');
}