// JavaScript Document
function ProductDescriptLoad() 
    { 
        var strUri =   window.location.search; 
        var strPassValue= strUri.substring(strUri.indexOf("=")+1);
        var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
        xmlDoc.async ="false";
        xmlDoc.load("../dxmlEN/product"+ strPassValue +".xml"); 
        var products=xmlDoc.selectSingleNode("//NewDataSet").childNodes;  
     
        for(var i=0; i<products.length;i++)
        {            
           var childProductchildProduct = products.item(i).childNodes;
           var productID =childProductchildProduct.item(0).text;
           if(productID == strPassValue)
           {
              var productName=childProductchildProduct.item(1).text;
              var productModel = childProductchildProduct.item(2).text;
              var productPrice = childProductchildProduct.item(3).text;
              var productRecordTime = childProductchildProduct.item(4).text;  
              var productMoneyType=  childProductchildProduct.item(6).text;  
                           
              var addDateArray=productRecordTime.split("-");
              var trueAddData;
              var strYear=addDateArray[0];
              var strMonth=addDateArray[1];
              var strDay=addDateArray[2];  
              
              var addTimeArray = strDay.split(":");
              var strHour=addTimeArray[0].substring(3);
              var strMinute=addTimeArray[1];
              var strSecond= addTimeArray[2].substring(0,2);
              
              trueAddData=strYear+"-"+strHour+"-"+strDay.substring(0,2)+" "+strHour+":"+strMinute+":"+strSecond;              
               
              
              var productDetails = childProductchildProduct.item(9).text;
              var productImage = childProductchildProduct.item(10); 
                                
              //window.alert(productImage.text);             
              var imgProductImage = document.getElementById("ImgProductImage"); 
              
              //window.alert(imgProductImage.src); 
              
              if(productImage == null)
              {
               //  window.alert("aaa");
                 imgProductImage.src = "../images/pic_pro_small.jpg";            
              }
              else
              {               
                 // window.alert("notbbb");
                 imgProductImage.src = "../upload/images/"+productImage.text;
              }  
              
              
              var   spanProductName=document.getElementById("SpanProductName");
              if(spanProductName==null)
              {
              }
              else
              {
                 spanProductName.innerText = productName;
              }
              
              var  spanProductModel = document.getElementById("SpanProductModel");
              if(spanProductModel == null)
              {
              }
              else
              {
                 spanProductModel.innerText = productModel;
              }
              var spanProductPrice = document.getElementById("SpanProductPrice");
              if(spanProductPrice == null)
              {
              }
              else
              {
                if(productMoneyType == 0)
                {
                   spanProductPrice.innerText = productPrice+"RMB";
                }
                else if(productMoneyType == 1)
                {
                  spanProductPrice.innerText = productPrice+"$";
                }
                else if(productMoneyType == 2)
                {
                  spanProductPrice.innerText = productPrice+"";
                } 
              }
              var   spanProductAddDate= document.getElementById("SpanProductRecordDate");
              if(spanProductAddDate == null)
              {}
              else
              {
                  spanProductAddDate.innerText = trueAddData;
              }
             
             
              var divProductDetail = document.getElementById("DIVProductDescript");
              if(divProductDetail == null)
              {}
              else
              {
                  divProductDetail.innerHTML = productDetails;
              }
              break;            
           }
         }  
     }
    

