﻿    var xmlHttp;
    var key;
    var id;
    var inID=1;     

    function pageloading()
        {
            txt_PubPic.innerHTML="<img src='/manage/public/images/Loading_1.gif' /> 数据加载中...";
            //txt_more_info.innerHTML="<img src='/manage/public/images/Loading_1.gif' /> 数据加载中...";                
            //txt_xgtp.innerHTML="<img src='/manage/public/images/Loading_1.gif' /> 数据加载中...";            
            //txt_xgxx.innerHTML="<img src='/manage/public/images/Loading_1.gif' /> 数据加载中...";                
            //txt_xgsp.innerHTML="<img src='/manage/public/images/Loading_1.gif' /> 数据加载中...";            
            //txt_keyinfo.innerHTML="<img src='/manage/public/images/Loading_1.gif' /> 数据加载中...";
        }
        
        
        
    function execute()
        {
            id =location.search.split("=")[1];
            key =location.search.split("=")[2];
            request();
        }
        
        
    function request()
    {       
            if (inID==1)
            {requrl("/AjaxResponse.aspx?cmd=return_View_ViewNumber&id=" + id ); }
            else if (inID==2)
            {requrl("/AjaxResponse.aspx?cmd=ReturnInfoValue&id=4"); }        
            else if (inID==3)
            {requrl("/AjaxResponse.aspx?cmd=return_view_more_info&id=" + id );}  
            else if (inID==4)
            {requrl("/AjaxResponse.aspx?cmd=return_view_comment&id=" + id );}  
    }
    
    
    
    function requrl(openurl)
        { 
            var url=openurl;
            createXML();
            xmlHttp.onreadystatechange = handleStateChange;
            xmlHttp.open("get",url,true);
            xmlHttp.send(null);
        }
    
    
    
    function handleStateChange()
        {
            if (xmlHttp.readyState == 4 )
                {
                    if (xmlHttp.status == 200)
                        {
                            var responseXML=xmlHttp.responseText;
                            
                            if (inID==1)
                            {
                                try
                                {
                                    document.getElementById("View_ViewNumber").innerHTML=responseXML;
                                }
                                catch(e)
                                 {
                                    //有错误，例如无控件
                                 }    
                            }
                            
                            else if (inID==2)
                            {document.getElementById("txt_PubPic").innerHTML=responseXML; }

                            
                            else if (inID==3)
                            {
                                try
                                {
                                     document.getElementById("View_More_Info").innerHTML=responseXML;
                                }
                                catch(e)
                                 {
                                    //有错误，例如无控件
                                 }    
                            }
                            
                            else if (inID==4)
                            {
                                try
                                {
                                     document.getElementById("View_Comment").innerHTML=responseXML;
                                }
                                catch(e)
                                 {
                                    //有错误，例如无控件
                                 }    
                            }

                                                                   
                            if (inID < 5 ) 
                            {
                                inID+=1;
                                request()
                            }

                        }
                }
       }

    
    
    function createXML() {
        if (window.ActiveXObject) {
            xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
        else
            {
                xmlHttp=new XMLHttpRequest();
            }
        }
        
        
    //容错代码            
    function killErrors() {
    return true;
    }

    window.onerror = killErrors;


