// JScript 文件
function ghbq(td)
{
 var tr = td.parentElement.cells;
  var ob = obody.rows;
  for(var ii=0; ii<tr.length-1; ii++)
  {
    tr[ii].className = (td.cellIndex==ii)?"ooihj":"ooihs";
    ob[ii].style.display = (td.cellIndex==ii)?"block":"none";
  }
}
//AJAX列表控制
var xmlHttp;
 var strAll=new Array();//小类显示//全局数组
 var strAllB=new Array();//存strAll值
//创建XmlHttp对象
function createXMLHttpRequest()
{
 if(window.ActiveXObject)
 {
  xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
 }
 else if(window.XMLHTTPRequest)
 {
  xmlHttp = new XMLHTTPRequest();
 }
}
//改变时所触发的事件
var ddlFla="";
var tx="";

function ddlFl(txt)
{ 
    tx=txt;//复值|方便调用
    var selDrp = document.all.ddlFL;
    createXMLHttpRequest();
    ddlFla= selDrp.options[selDrp.selectedIndex].value;
    var url   = "AJAXddl.aspx?ddlFl="+ddlFla+"&isdo=sel&fd="+Math.random();
    xmlHttp.onreadystatechange = handleStateChange;
    xmlHttp.open("GET",url,true);
    xmlHttp.send(null);
}

function edit()
{

//-------------------------
    //strAll数组开始复值
   var txt1="";
   var txt2="";
   var txt3="";
   var txt4="";
   var txt5="";
   var txt6="";
   var strS=0;
   var xaH=0;
   var strZ=new Array();
   strZ=tx.split("$");
   strAll=strZ[1].split("#"); 
   strAllB=strZ[1].split("#");
   
   var gxl=new Array();
   strS=strAll.length;
       document.getElementById("strall").value=tx;
       for(i4=0;i4<strS-1;i4++)
       {
           if(strAll[i4]==1)
           {
             gxl=strAll[i4+1].split(";");
             if(gxl.length==2)//为属性
             {
             txt1+=gxl[1]+"<a href='#' onclick='fd("+i4+")'><font color=red><b>X</b></font></a><br>";    
             }
             else//为配件
             {
             txt1+=tablexl(gxl[1],gxl[2],gxl[3])+"<a href='#' onclick='fd("+i4+")'><font color=red><b>X</b></font></a><br>";  
             strAll[i4+1]=tablexl(gxl[1],gxl[2],gxl[3]);
             } 
             gxl=new Array();
           }
          if(strAll[i4]==2)
           {
             gxl=strAll[i4+1].split(";");   
             if(gxl.length==2)
             {
             txt2+=gxl[1]+"<a href='#' onclick='fd("+i4+")'><font color=red><b>X</b></font></a><br>";    
             }
             else
             {
             txt2+=tablexl(gxl[1],gxl[2],gxl[3])+"<a href='#' onclick='fd("+i4+")'><font color=red><b>X</b></font></a><br>";   
             strAll[i4+1]=tablexl(gxl[1],gxl[2],gxl[3]);
             } 
             gxl=new Array();
           }
           
            if(strAll[i4]==3)
           {
             gxl=strAll[i4+1].split(";");   
             if(gxl.length==2)
             {
             txt3+=gxl[1]+"<a href='#' onclick='fd("+i4+")'><font color=red><b>X</b></font></a><br>";    
             }
             else
             {
             txt3+=tablexl(gxl[1],gxl[2],gxl[3])+"<a href='#' onclick='fd("+i4+")'><font color=red><b>X</b></font></a><br>";   
             strAll[i4+1]=tablexl(gxl[1],gxl[2],gxl[3]);
             } 
             gxl=new Array();
           }
           if(strAll[i4]==4)
           {
             gxl=strAll[i4+1].split(";");   
             if(gxl.length==2)
             {
             txt4+=gxl[1]+"<a href='#' onclick='fd("+i4+")'><font color=red><b>X</b></font></a><br>";    
             }
             else
             {
             txt4+=tablexl(gxl[1],gxl[2],gxl[3])+"<a href='#' onclick='fd("+i4+")'><font color=red><b>X</b></font></a><br>";  
             strAll[i4+1]=tablexl(gxl[1],gxl[2],gxl[3]);
             } 
             gxl=new Array();
           }
           if(strAll[i4]==5)
           {
             gxl=strAll[i4+1].split(";");   
             if(gxl.length==2)
             {
             txt5+=gxl[1]+"<a href='#' onclick='fd("+i4+")'><font color=red><b>X</b></font></a><br>";    
             }
             else
             {
             txt5+=tablexl(gxl[1],gxl[2],gxl[3])+"<a href='#' onclick='fd("+i4+")'><font color=red><b>X</b></font></a><br>";  
             strAll[i4+1]=tablexl(gxl[1],gxl[2],gxl[3]); 
             } 
             gxl=new Array();
           }
          if(strAll[i4]==6)
           {
             gxl=strAll[i4+1].split(";");   
             if(gxl.length==2)
             {
             txt6+=gxl[1]+"<a href='#' onclick='fd("+i4+")'><font color=red><b>X</b></font></a><br>";    
             }
             else
             {
             txt6+=tablexl(gxl[1],gxl[2],gxl[3])+"<a href='#' onclick='fd("+i4+")'><font color=red><b>X</b></font></a><br>";  
             strAll[i4+1]=tablexl(gxl[1],gxl[2],gxl[3]); 
             } 
             gxl=new Array();
           }
        }   
         
         
         if(document.getElementById("xl1")!=null)
          {  
             if(txt1!=""&&txt1!="undefined")
             {    
              document.getElementById("xl1").innerHTML=txt1;
              txt1="";
             }
             else
             {
              document.getElementById("xl1").innerHTML="";
             }
          }
         if(document.getElementById("xl2")!=null)
          {
             if(txt2!=""&&txt2!="undefined")
              {
              document.getElementById("xl2").innerHTML=txt2;
              txt2="";
              }
              else
              {
              document.getElementById("xl2").innerHTML="";
              }
               
          }
          
           if(document.getElementById("xl3")!=null)
          {
             if(txt3!=""&&txt3!="undefined")
              {
              document.getElementById("xl3").innerHTML=txt3;
              txt3="";
              }
              else
              {
              document.getElementById("xl3").innerHTML="";
              }
               
          }
 
            if(document.getElementById("xl4")!=null)
          {
             if(txt4!=""&&txt4!="undefined")
              {
              document.getElementById("xl4").innerHTML=txt4;
              txt4="";
              }
              else
              {
              document.getElementById("xl4").innerHTML="";
              }
               
          }
          
           if(document.getElementById("xl5")!=null)
          {
             if(txt5!=""&&txt5!="undefined")
              {
              document.getElementById("xl5").innerHTML=txt5;
              txt5="";
              }
              else
              {
              document.getElementById("xl5").innerHTML="";
              }
               
          }   
           
           
           if(document.getElementById("xl6")!=null)
          {
             if(txt6!=""&&txt6!="undefined")
              {
              document.getElementById("xl6").innerHTML=txt6;
              txt6="";
              }
              else
              {
              document.getElementById("xl6").innerHTML="";
              }
               
          }   
          
   //句块结束
 
 //-------------------------
}

  var Results="";
  var g1=0;
  var values=0;
function handleStateChange()
{ 
  strAll=new Array();//小类显示
  strAllB=new Array();
  document.getElementById("strall").innerHTML ="";
  if(xmlHttp.readyState == 4)
  {
  if(xmlHttp.status == 200)
   {
      Results = xmlHttp.responseText;
      var mycars = new Array();
      mycars=Results.split("$");
      g1=mycars.length;
      var g2=0;
      var instr="<table width='609' height='50' border='0' cellpadding='0' cellspacing='0' bordercolor='#F4F4F4'>";
      var mycarsXX = new Array();
      for(i=1;i<g1-1;i++)
      {
      var mycarsX = new Array();
      mycarsX=mycars[i].split("|");
      g2=mycarsX.length;
      instr+="<tr>";
          for(i2=0;i2<g2-1;i2++)
           {  
             if(i2%2==0)
              {
               instr+="<td width='150'  style='border-bottom-width: 1px;border-bottom-style: dashed;border-bottom-color: #DDDDDD;'>"+mycarsX[i2]+"</td>";
               mycarsXX=mycarsX[i2+1].split(";");
               b=mycarsXX.length;
               instr+="<td width='500'  style='border-bottom-width: 1px;border-bottom-style: dashed;border-bottom-color: #DDDDDD;'>"
               instr+="<select name='select' id='aa"+i+"' onchange='Fa("+i+")'>";
                  for(XX=0;XX<b-1;XX++)
                  {
                    instr+="<option value='"+mycarsXX[XX]+"'>"+mycarsXX[XX]+"</option>";
       
                  }
               instr+="</select>";
               instr+="<div id='xl"+i+"'></td>"
               }
           } 
      instr+="</tr>"
     }
      instr+="</table>";
     document.getElementById("droplist").innerHTML =instr;
   if(tx!=""&&tx!=null&&tx!="undefined")
   {
    edit();
   }
   }
  }
}


var xlszX = new Array();
var xlszXX = new Array();

function Fa(va)
 { 
  var selDrp2 = document.all["aa"+va];
  var ddlFlaa= selDrp2.options[selDrp2.selectedIndex].value;
  createXMLHttpRequest();
  var url2   = "AJAXddl.aspx?ddlFl="+ddlFlaa+"&isdo=xl&va="+va+"&fd="+Math.random();
  xmlHttp.onreadystatechange = FAXL;
  xmlHttp.open("GET",url2,true);
  xmlHttp.send(null);
 }
var sC="";



 function FAXL()
 {
  if(xmlHttp.readyState == 4)
    {
    if(xmlHttp.status == 200)
       {
        var XL = xmlHttp.responseText;
        var xlsz = new Array();
        xlsz=XL.split("|");
         var len=xlsz.length;         
         xlszX=xlsz[0].split("$");
         var strxlsz="";
         var sa=strAll.length;
         var countall=new Array();
         if(xlszX[1]==1)
         {
          //保留xlszXX[0]
            var i=1;
            var strT=new Array();
            strT=xlszX[0].split(";");
            strxlsz=strT[1];
            var aa="";
            if(sa==0)
               {
                strAllB[0]=xlsz[1];//一并复值
                strAllB[1]=xlszX[0];
                strAll[0]=xlsz[1];
                strAll[1]=xlszX[0];
               }
            else
               {
               for(i=0;i<sa;i++)
                  {
                     if(strAll[i]==xlszX[0])
                        {
                        alert("抱歉，不能重复添加数据！");
                        aa="Y";
                        }
                  }
              if(aa!="Y")
                 {
                 strAllB[sa]=xlsz[1];//一并复值
                 strAllB[sa+1]=xlszX[0];
                 strAll[sa]=xlsz[1];
                 strAll[sa+1]=xlszX[0];
                 }
            aa="";
            }
           
        }
        
         else
         {
                    //保留xlszXX[0]
                    xlszXX=xlszX[0].split(";");
                   strxlsz=tablexl(xlszXX[1],xlszXX[2],xlszXX[3]);
                    var countT=0;
                    if(countall.length==0)
                     {
                     countall[0]=xlszXX[3];
                     }
                    //添加到配件价格文本框中
                    document.getElementById("Pcount").value=countall[0];                    
                    var jg1=document.getElementById("sale").value;                   
                    document.getElementById("CountALL").value=parseFloat(jg1)+parseFloat(countall[0]);                        
                    var ddf="";
                     if(sa==0)
                     {
                      strAllB[0]=xlsz[1];//一并复值
                      strAllB[1]=xlszX[0];
                      strAll[0]=xlsz[1];
                      strAll[1]=strxlsz;
                     }
                     else
                     {
                     var ddff=strAll.length;
                        for(i=0;i<ddff;i++)
                         {
                          if(strAll[i]==strxlsz)
                           {
                           alert("抱歉，不能重复添加数据！");
                           ddf="Y";
                           }
                         }
                      if(ddf!="Y")
                      {   
                      strAllB[ddff]=xlsz[1];//一并复值
                      strAllB[ddff+1]=xlszX[0];
                      strAll[ddff]=xlsz[1];
                      strAll[ddff+1]=strxlsz;
                      }
                     }
         }
         
   //写入数组中完成     
   //-------------------------------------------------------------------------     
      
  //写入数据库中数据
         var saT=strAllB.length;
         for(s=0;s<saT;s++)
         {
          sC+=strAllB[s]+"#";
         }
         document.getElementById("strall").value=ddlFla+"$"+sC.replace(/(no#)/g,"").replace(/(##)/g,"#");
         sC="";
         //结束
     
         var ov="";
         var xas=0;
         var ov1="";
         var ov2="";
         var ov3="";
         var ov4="";
         var ov5="";
         var ov6="";
         var gxds=new Array();
         for(i=0;i<saT-1;i++)
         {
           if(strAll[i]==1)
           {
            gxds=new Array;
            gxds=strAll[i+1].split(";");
            if(gxds.length==2)
            {
            ov1+=gxds[1]+"<a href='#' onclick='fd("+i+")'><font color=red><b>X</b></font></a><br>";
            }
            else
            {
            ov1+=strAll[i+1]+"<a href='#' onclick='fd("+i+")'><font color=red><b>X</b></font></a><br>";
            }
            xas=1;
           }
           
            else if(strAll[i]==2)
           {
            gxds=new Array;
            gxds=strAll[i+1].split(";");
            if(gxds.length==2)
            {
              ov2+=gxds[1]+"<a href='#' onclick='fd("+i+")'><font color=red><b>X</b></font></a><br>";
            }
            else
            {
              ov2+=strAll[i+1]+"<a href='#' onclick='fd("+i+")'><font color=red><b>X</b></font></a><br>";
            }
            xas=2;
           }
           else if(strAll[i]==3)
           {
            gxds=new Array;
            gxds=strAll[i+1].split(";");
            if(gxds.length==2)
            {
             ov3+=gxds[1]+"<a href='#' onclick='fd("+i+")'><font color=red><b>X</b></font></a><br>";
            }
            else
            {
            ov3+=strAll[i+1]+"<a href='#' onclick='fd("+i+")'><font color=red><b>X</b></font></a><br>";
            }
            xas=3;
           } 
           else if(strAll[i]==4)
           {
            gxds=new Array;
            gxds=strAll[i+1].split(";");
            if(gxds.length==2)
            {
            ov4+=gxds[1]+"<a href='#' onclick='fd("+i+")'><font color=red><b>X</b></font></a><br>";
            }
            else
            {
            ov4+=strAll[i+1]+"<a href='#' onclick='fd("+i+")'><font color=red><b>X</b></font></a><br>";
            }
            xas=4;
           }
           else if(strAll[i]==5)
           {
            gxds=new Array;
            gxds=strAll[i+1].split(";");
            if(gxds.length==2)
            {
            ov5+=strAll[i+1]+"<a href='#' onclick='fd("+i+")'><font color=red><b>X</b></font></a><br>";
            }
            else
            {
            ov5+=gxds[1]+"<a href='#' onclick='fd("+i+")'><font color=red><b>X</b></font></a><br>";
            }
            xas=5;
           }   
            else if(strAll[i]==6)
           {
            gxds=new Array;
            gxds=strAll[i+1].split(";");
            if(gxds.length==2)
            {
            ov6+=gxds[1]+"<a href='#' onclick='fd("+i+")'><font color=red><b>X</b></font></a><br>";
            }
            else
            {
            ov6+=strAll[i+1]+"<a href='#' onclick='fd("+i+")'><font color=red><b>X</b></font></a><br>";
            }
            xas=6;
           }                 
         }
         
  
        if(xas==1)
        {
        document.getElementById("xl"+xas).innerHTML=ov1;
        ov1="";
        xas=100;
        }
        else if(xas==2)
        {
        document.getElementById("xl"+xas).innerHTML=ov2;
        ov2="";
        xas=100;
        }
        else if(xas==3)
        {
        document.getElementById("xl"+xas).innerHTML=ov3;
        ov3="";
        xas=100;
        }
        else if(xas==4)
        {
        document.getElementById("xl"+xas).innerHTML=ov4;
        ov4="";
        xas=100;
        }
        else if(xas==5)
        {
        document.getElementById("xl"+xas).innerHTML=ov5;
        ov5="";
        xas=100;
        }
        else if(xas==6)
        {
        document.getElementById("xl"+xas).innerHTML=ov6;
        ov6="";
        xas=100;
        }
  //求和
         for(iiT=0;iiT<countall.length-1;iiT++)
         {
          countT=parseFloat(countT)+pareFloat(countall[iit]);
         }
                     
                     
       }
    }


}




function fd(vaa)
{
strAll.splice(vaa,2,"no","no");//清除数据
strAllB.splice(vaa,2,"no","no");//清除数据
FAXLL();//重载数组中数据
}
function FAXLL()
{
var strAllgs=strAll.length;
var co1="";
var co2="";
var co3="";
var co4="";
var co5="";
var co6="";
var xas2=0; 
  //写入数据库中数据
         var saT=strAllB.length;
         sC="";
         for(s=0;s<saT;s++)
         {
          sC+=strAllB[s]+"#";
         }
         document.getElementById("strall").value=ddlFla+"$"+sC.replace(/(no#)/g,"").replace(/(##)/g,"#");
         sC="";
         //结束
         var xx3=new Array();
      for(i=0;i<strAllgs-1;i++)
         {                                
               if(strAll[i]==1)
               {
                  xx3=strAll[i+1].split(";");
                  if(xx3.length==2)
                  {
                  co1+=xx3[1]+"<a href='#' onclick='fd("+i+")'><font color=red><b>X</b></font></a><br>";
                  xas2=1;
                  strAll[i+1]=strAll[i+1];
                  }
                  else
                  {
                  co1+=strAll[i+1]+"<a href='#' onclick='fd("+i+")'><font color=red><b>X</b></font></a><br>";
                  xas2=1;
                  }
                  xx3=new Array();
               }                      
               if(strAll[i]==2)
               {
                  xx3=strAll[i+1].split(";");
                  if(xx3.length==2)
                  {
                  co2+=xx3[1]+"<a href='#' onclick='fd("+i+")'><font color=red><b>X</b></font></a><br>";
                  xas2=2;
                  strAll[i+1]=strAll[i+1];
                  }
                  else
                  {
                  co2+=strAll[i+1]+"<a href='#' onclick='fd("+i+")'><font color=red><b>X</b></font></a><br>";
                  xas2=2;
                  }
                      xx3=new Array();
               }                 
               if(strAll[i]==3)
               {
                  xx3=strAll[i+1].split(";");
                  if(xx3.length==2)
                  {
                  co3+=xx3[1]+"<a href='#' onclick='fd("+i+")'><font color=red><b>X</b></font></a><br>";
                  xas2=3;
                  strAll[i+1]=strAll[i+1];
                  }
                  else
                  {
                  co3+=strAll[i+1]+"<a href='#' onclick='fd("+i+")'><font color=red><b>X</b></font></a><br>";
                  xas2=3;
                  }
                      xx3=new Array();
                }
               if(strAll[i]==4)
               {
                  xx3=strAll[i+1].split(";");
                  if(xx3.length==2)
                  {
                  co4+=xx3[1]+"<a href='#' onclick='fd("+i+")'><font color=red><b>X</b></font></a><br>";
                  xas2=4;
                  strAll[i+1]=strAll[i+1];
                  }
                  else
                  {
                  co4+=strAll[i+1]+"<a href='#' onclick='fd("+i+")'><font color=red><b>X</b></font></a><br>";
                  xas2=4;
                  }
                      xx3=new Array();
                }
                if(strAll[i]==5)
               {
                  xx3=strAll[i+1].split(";");
                  if(xx3.length==2)
                  {
                  co5+=xx3[1]+"<a href='#' onclick='fd("+i+")'><font color=red><b>X</b></font></a><br>";
                  xas2=5;
                  strAll[i+1]=strAll[i+1];
                  }
                  else
                  {
                  co5+=strAll[i+1]+"<a href='#' onclick='fd("+i+")'><font color=red><b>X</b></font></a><br>";
                  xas5=5;
                  }
                      xx3=new Array();
                }
               if(strAll[i]==6)
               {
                  xx3=strAll[i+1].split(";");
                  if(xx3.length==2)
                  {
                  co6+=xx3[1]+"<a href='#' onclick='fd("+i+")'><font color=red><b>X</b></font></a><br>";
                  xas2=6;
                  strAll[i+1]=strAll[i+1];
                  }
                  else
                  {
                  co6+=strAll[i+1]+"<a href='#' onclick='fd("+i+")'><font color=red><b>X</b></font></a><br>";
                  xas2=6;
                  }
                      xx3=new Array();
                }
                
         } 
        if(document.getElementById("xl1")!=null)
        {                
        if(co1!="")
        {
        document.getElementById("xl1").innerHTML=co1;
        co1="";
        }
        else
        {
        document.getElementById("xl1").innerHTML="";
        }
        }    
        
        if(document.getElementById("xl2")!=null)
        {       
        if(co2!=="")
        {
        document.getElementById("xl2").innerHTML=co2;
        co2="";
        }
        else
        {
        document.getElementById("xl2").innerHTML="";
        }
        }  
        
        if(document.getElementById("xl3")!=null)
        {     
        if(co3!="")
        {
        document.getElementById("xl3").innerHTML=co3;
        co3="";
        }  
        else
        {
         document.getElementById("xl3").innerHTML="";
        }  
        } 
        
        if(document.getElementById("xl4")!=null)
        {  
        if(co4!="")
        {
        document.getElementById("xl4").innerHTML=co4;
        co4="";
        }  
        else
        {
         document.getElementById("xl4").innerHTML="";
        }   
        }
         
        if(document.getElementById("xl5")!=null)
        {       
        if(co5!="")
        {
        document.getElementById("xl5").innerHTML=co5;
        co5="";
        }  
        else
        {
         document.getElementById("xl5").innerHTML="";
        }  
        }
        
        if(document.getElementById("xl6")!=null)
        {   
        if(co6!="")
        {
        document.getElementById("xl6").innerHTML=co6;
        co6="";
        }  
        else
        {
         document.getElementById("xl6").innerHTML="";
        }  
        }    
        
        
        
        
           


//删除后显示
}

function saleC()
{
var j1=document.getElementById("sale").value;
var j2=document.getElementById("Pcount").value;
document.getElementById("CountALL").value=parseFloat(j1)+parseFloat(j2);
document.getElementById("CjVipPrice").value=parseFloat(j1)+parseFloat(j2);
document.getElementById("MiddleVIPPrice").value=(parseFloat(j1)+parseFloat(j2))*0.95;
document.getElementById("HiVipPrice").value=(parseFloat(j1)+parseFloat(j2))*0.9;
document.getElementById("VIPPrice").value=(parseFloat(j1)+parseFloat(j2))*0.8;
}

function sprice()
{
var j1=parseFloat(document.getElementById("CountALL").value);
var j2=parseFloat(document.getElementById("Sprice").value);
if(j2<j1)
{
alert("价格设置存在逻辑错误！");
}
document.getElementById("Sprice").focus();
}

function vipjj()
{
var j=document.getElementById("CountALL").value;
document.getElementById("CjVipPrice").value=ForDight(parseFloat(j),2);
document.getElementById("MiddleVIPPrice").value=parseFloat(j)*0.95;
document.getElementById("HiVipPrice").value=parseFloat(j)*0.9;
document.getElementById("VIPPrice").value=parseFloat(j)*0.8;
}
function ISslpic(ispic)
{
if(ispic.checked)
{
document.getElementById('ThumbnailsPic').disabled=false;
}
else
{
document.getElementById('ThumbnailsPic').disabled=true;
}
}
//取小数并四舍五入
function  ForDight(Dight,How)     
{     
Dight  =Math.round (Dight*Math.pow(10,How))/Math.pow(10,How);     
return  Dight;     
}  
//商品分类二级关联
function ddlBig()
{
var ddlbig = document.all.BigProduct;
createXMLHttpRequest();
var ddlbigZ= ddlbig.options[ddlbig.selectedIndex].value;
var url3= "AJAXddl.aspx?ddlFl="+ddlbigZ+"&isdo=er&fd=Math.random()";
xmlHttp.onreadystatechange = ddlBigEr;
xmlHttp.open("GET",url3,true);
xmlHttp.send(null);
}
  //二级分类
function ddlBigEr(aa)
{
var sele2="";
if(aa==""||aa==null)
{
 sele2 = xmlHttp.responseText;
}
else
{
sele2=aa;
}
 var erjj=new Array();
 erjj=sele2.split("-");
 //取出[-]分成后的元素个数
var erjsz=erjj.length;
 //进步细分数组
 var erX=new Array();
 var sele3="<select id=SmlProduct name=SmlProduct onchange='onchange1()'>";
 for(er=0;er<erjsz-1;er++)
 {
   erX=erjj[er].split("+");
   sele3+= "<option value="+erX[0]+">"+erX[1]+"</option>"
   if(er==0)
   {
    document.getElementById("SmallProductId").value=erX[0];
   }
   
 }

 sele3+="</select>"
 aa="";
}
function onchange1()
{
var C1 = document.all.SmlProduct;
var Z1= C1.options[C1.selectedIndex].value;
document.getElementById("SmallProductId").value=Z1;
Z1="";
}
function tablexl(name,stock,price)
{
                    strxlsz ="<table width='421' height='55' border='0' cellpadding='0' cellspacing='0' bordercolor='#E4E4E4'><tr>";
                    strxlsz+="<td height='22' bgcolor='#E1E1E1'><div align='center'>配件名称</div></td>";
                    strxlsz+="<td bgcolor='#E1E1E1'><div align='center'>库存量</div></td>";
                    strxlsz+="<td bgcolor='#E1E1E1'><div align='center'>最少购买</div></td>";
                    strxlsz+="<td bgcolor='#E1E1E1'><div align='center'>最多购买</div></td>";
                    strxlsz+="<td bgcolor='#E1E1E1'><div align='center'>配件价格</div></td>";
                    strxlsz+="</tr>";
                    strxlsz+="<tr>";
                    strxlsz += "<td height='33'><div align='center'><font color=red><b>" +name + "</b></font></div></td>";
                    strxlsz+="<td>";
                    strxlsz+="<div align='center'>";
                    strxlsz+="<input name='textfield2' type='text' value='"+stock+"' size='7' disabled='disabled'/>";
                    strxlsz+="</div>";
                    strxlsz+="</td>";
                    strxlsz+="<td>  ";
                    strxlsz+="<div align='center'>";
                    strxlsz+="<input name='textfield2' type='text' value='0' size='7' disabled='disabled'/>";
                    strxlsz+="</div>";
                    strxlsz+="</td>";
                    strxlsz+="<td>  <div align='center'>";
                    strxlsz+="<input name='textfield2' type='text' value='0' size='7' disabled='disabled'/>";
                    strxlsz+="</div></td>";
                    strxlsz+="<td><div align='center'>";
                    strxlsz+="<input name='textfield2' type='text' value='"+price+"' size='7' disabled='disabled'/>";
                    strxlsz+="</div></td>";
                    strxlsz+="</tr>";
                    strxlsz+="</table>";
                    return strxlsz;
}