﻿// JScript 文件
var xmlhttp;

function createRequest() {
  
  try {
    xmlhttp = new XMLHttpRequest();
  } catch (trymicrosoft) {
    try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (othermicrosoft) {
      try {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (failed) {
        xmlhttp = false;
      }
    }
  }

  if (!xmlhttp)
    alert("脚本初始化异常，请检查您的设置或者您的浏览器版本过低,需要升级才能正常访问邦永站点!");
}

//公司新闻
function callback_CorpAffichehire() {
var div_indexAffiche=document.getElementById("div_indexAffiche");
     if (xmlhttp.readyState == 4)
     {
         var response=xmlhttp.responseText;
         //alert( response);
         if(response=="<script>alert('页面加载产生错误，请检查您的设置后重试或与我们联系');</script>")
         {
            document.write("<script>window.open('Error/Err.html','','width=330,height=180');</script>");
            return;   
         }
          if(div_indexAffiche!=null)
           {
             div_indexAffiche.innerHTML=response;
             TradeCase_hire();
           }
     } 
     else
     {
       if(div_indexAffiche!=null)
       {
         div_indexAffiche.innerHTML="正在执行操作,请稍后...";
       }
       else
       {
         alert("页面产生异常，请联系管理员或者反馈问题给我们");
       }
       
     }
   }
   
function CorpAffiche_hire()
{
  
  var url="AsynchronismData/corpAfficheIndex_data.aspx";
  var callback_CorpAffiche=callback_CorpAffichehire;
 // alert(url);
  SendRequest_CorpAffiche(url,callback_CorpAffiche);
}

function SendRequest_CorpAffiche(url,callback_CorpAffiche)
{    
     createRequest();
     xmlhttp.open("GET", url, true);
     xmlhttp.onreadystatechange = callback_CorpAffiche;
     xmlhttp.send(null);
}

//行业案例
function TradeCase_hire()
{
  var url="AsynchronismData/tradeCaseIndex_data.aspx";
  var callback_TradeCase=callback_TradeCasehire;
  SendRequest_TradeCase(url,callback_TradeCase);
}

function SendRequest_TradeCase(url,callback_TradeCase)
{    
     createRequest();
     xmlhttp.open("GET", url, true);
     xmlhttp.onreadystatechange = callback_TradeCase;
     xmlhttp.send(null);
}

function callback_TradeCasehire() {
var div_indexCase=document.getElementById("div_indexCase");
     if (xmlhttp.readyState == 4)
     {
         var response=xmlhttp.responseText;
       //  alert( response);
          if(div_indexCase!=null)
           {
             div_indexCase.innerHTML=response;
             TradeInfo_hire();
           }
     } 
     else
     {
       if(div_indexCase!=null)
       {
         div_indexCase.innerHTML="正在执行操作,请稍后...";
       }
      // else
      //{
       // alert("页面产生异常，请联系管理员或者反馈问题给我们");
       //}
       
     }
   }
   
   
 //行业信息 
   function TradeInfo_hire()
{
  var url="AsynchronismData/tradeInfoIndex_data.aspx";
  var callback_TradeInfo=callback_TradeInfohire;
  SendRequest_TradeInfo(url,callback_TradeInfo);
}

function SendRequest_TradeInfo(url,callback_TradeInfo)
{    
     createRequest();
     xmlhttp.open("GET", url, true);
     xmlhttp.onreadystatechange = callback_TradeInfo;
     xmlhttp.send(null);
}

function callback_TradeInfohire() {
var div_indexInfo=document.getElementById("div_indexInfo");
     if (xmlhttp.readyState == 4)
     {
         var response=xmlhttp.responseText;
         //alert( response);
          if(div_indexInfo!=null)
           {
             div_indexInfo.innerHTML=response;
             //ExcursionDivhire();
           }
     } 
     else
     {
       if(div_indexInfo!=null)
       {
         div_indexInfo.innerHTML="正在执行操作,请稍后...";
       }
       else
       {
         alert("页面产生异常，请联系管理员或者反馈问题给我们");
       }
       
     }
   }
