var g_xmDoc = new ActiveXObject("Msxml2.DOMDocument");
var g_Kind="";
var g_Id="";
var Strhtm="";
var NodeList=null;

function GetParam(){
 var pos=0;
 var str="";
 str = window.location.href;
 pos = str.indexOf("=");
 if (pos>0) {
   var tmpId=str.substring(pos+1,str.length);
   if (tmpId.indexOf("#"))    {
     var tmpArray=tmpId.split("#");
     g_Id=tmpArray[0];
    }
   else g_Id=tmpId;
   } 
}


function GetRegieByPage(pTop,pSize,pKind){
 var ObjList=null;
 Strhtm="";
 var Res=neworchid.AjaxHomeLib.GetRegieXmlByPage(pTop,pSize,pKind);
 if ((!Res.error) ||(Res.value!=null)){
    g_xmDoc.loadXML(Res.value);
    NodeList= g_xmDoc.getElementsByTagName("li");
    var CurrList=NodeList.item(0).childNodes;
   if (CurrList.length>0){
    for (var i=0;i<CurrList.length;i++){
     var _Did       =CurrList.item(i).getAttribute("Did");
     var _ProdNo    =CurrList.item(i).getAttribute("ProdNo");
     var _PName     =CurrList.item(i).getAttribute("PName");
     var _Image     =CurrList.item(i).getAttribute("ImageName");
     Strhtm+="<div class='box_10_1'><a href=javascript:ShowRegieDetail("+_Did+");>";
     Strhtm+="<img src="+_Image+" width='115' height='105' border='0'></a>";
     Strhtm+="<br><a href=javascript:ShowRegieDetail("+_Did+");>("+_ProdNo+")"+_PName+"</a></div>";
    }
   document.getElementById("DivRegieList").innerHTML=Strhtm;  
   if (g_Id!="")
      ShowRegieDetail(g_Id);
   else {
        g_Id=CurrList.item(0).getAttribute("Did")
        ShowRegieDetail(g_Id);
        }
  }
 }
}



function ShowRegieDetail(pId){
 var Obj=null;
 var Res=neworchid.AjaxHomeLib.GetRegieDetail(pId);
 if ((!Res.error) && (Res.value!=null)){
     Obj=Res.value;
     Strhtm="<div id='divimg' class='imgRegie'></div>"
     Strhtm+="<ul class=ul>";
     Strhtm+="<li>··名&nbsp;&nbsp;称:&nbsp;&nbsp;&nbsp;"+Obj.PName+"</li>";
     Strhtm+="<li>··编&nbsp;&nbsp;号:&nbsp;&nbsp;&nbsp;"+Obj.ProdNo+"</li>";
     Strhtm+="<li>··联 系 人:&nbsp;&nbsp;&nbsp;"+Obj.Contact+"</li>";
     Strhtm+="<li>··联系地址:&nbsp;&nbsp;&nbsp;"+Obj.Address+"</li>";
     Strhtm+="<li>··联系电话:&nbsp;&nbsp;&nbsp;"+Obj.Tel+"</li>";
     Strhtm+="<li>··邮箱地址:&nbsp;&nbsp;&nbsp;"+Obj.eMail+"</li>";
     Strhtm+="<li>··价&nbsp;&nbsp;格:&nbsp;&nbsp;&nbsp;"+Obj.Price+"</li>";
     Strhtm+="<li>··用品介绍:</li>";
     Strhtm+="<li class=box_Text>"+Obj.MDesc+"</li>";
     Strhtm+="</ul>";
     document.getElementById("DivRegieDetail").innerHTML=Strhtm;  
     document.getElementById("divimg").innerHTML="<img src="+Obj.ImageName+" width=400 height=380>"; 
  }
}







