﻿// JScript 文件
var varobj
   function showdiv(aaa,aburl)
    {
    varobj=aaa
        document.getElementById("sdiv").style.display='';
      //  document.getElementById("sdiv").style.backgroundColor="#ffffff"; 
        document.getElementById("sdiv").style.left=-100
        document.getElementById("sdiv").style.top=(aaa.id * aaa.clientHeight)+3 ;
        
        GetChildItem(aaa,aburl)//Get Data
    }
    function closediv(hh)
    {
        document.getElementById("sdiv").style.display='';
        document.getElementById("sdiv").style.display='none';
        
    }
    function showdivdelay()
    {
       // varobj.click()//onmouseover()
         document.getElementById("sdiv").style.display='';
        
    }
    function closedivdelay()
    {
         document.getElementById("sdiv").style.display='none';
    }
    var varXmlHttp,xmlvarc
     function createProducthttp()
      {
        if (window.ActiveXObject)
         {
           try
             {
               varXmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
             }
             catch(e)
             {
               try
                {
                   varXmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
                }
                 catch(e){}
             }
         }else if (window.XMLHttpRequest) 
         {
            varXmlHttp = new XMLHttpRequest();
            if(varXmlHttp.overrideMimeType)
            {
               varXmlHttp.overrideMimeType('text/xml');
             }
         }
      }
      function GetChildItem(obj,varc)
      {
    
        xmlvarc=varc
         var producturl = "../Menu/GetChildMenu.aspx?mid="+obj.tabIndex;
         //alert(producturl)
         //ajax请求
         createProducthttp()
         try
         {
            varXmlHttp.onreadystatechange=FillTb;
            varXmlHttp.open("post",producturl,true);
            varXmlHttp.send(null);
         }catch(ex)
         {
            alert(ex);
            return;
         }
      }
      function FillTb(event)
      {
         if(varXmlHttp.readyState==4)
         {
             if(varXmlHttp.status==200)
             {
               
                var oDoc=new ActiveXObject("MSXML2.DOMDocument");
                var result=varXmlHttp.responseText;
                //alert(result)
                oDoc.loadXML(result);
                var inew = oDoc.getElementsByTagName("Item");
               
   var outstr="<table width=\"180\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"filter:alpha(opacity=90)\" id=\"safasf\">"
    outstr+="<tr>"
    outstr+="<td width=\"7\" height=\"5\" valign=\"bottom\"><img src=\"../images/menu_con01.gif\"  width=\"7\" height=\"5\" /></td>"
    outstr+="<td height=\"5\" valign=\"bottom\" bgcolor=\"#d91977\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\" /></td>"
    outstr+="<td width=\"7\" height=\"5\" valign=\"bottom\"><img src=\"../images/menu_con02.gif\" width=\"7\" height=\"5\" /></td>"
    outstr+="</tr>"
    outstr+="<tr>"
    outstr+="<td width=\"7\" bgcolor=\"#d91977\">&nbsp;</td>"
    outstr+="<td bgcolor=\"#d91977\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"1\">"
    for(var i=0;i<inew.length;i++)
        {
           if(i!=inew.length-1)
             {
                outstr +="<tr><td width=\"18\"><img src=\"/prodimage/btn_image/headbtn"+ inew[i].attributes[0].text +".gif\" width=\"15\" height=\"20\"></td><td style=\"cursor:hand;\" width=\"144\" class=\"subm\"><a href=\"prodList.aspx?cid="+ inew[i].attributes[1].text +"&key=&opcmd="+ xmlvarc +"\">"+ inew[i].text +"</a></td></tr>"
                  outstr +="<tr><td colspan=\"2\" background=\"../images/menu_sep.gif\"><img src=\"../images/spacer.gif\" width=\"1\" height=\"2\"></td> </tr>"
              }
               else
              {
                 outstr +="<tr><td width=\"18\"><img src=\"/prodimage/btn_image/headbtn"+ inew[i].attributes[0].text +".gif\" width=\"15\" height=\"20\"></td><td style=\"cursor:hand;\" width=\"144\" class=\"subm\"><a href=\"prodList.aspx?cid="+ inew[i].attributes[1].text +"&key=&opcmd="+ xmlvarc +"\">"+ inew[i].text +"</a></td></tr>"
                 }
               }

    outstr+="</table></td>"
    outstr+="<td width=\"7\" bgcolor=\"#d91977\">&nbsp;</td>"
    outstr+="</tr>"
    outstr+="<tr>"
    outstr+="<td width=\"7\" valign=\"top\"><img src=\"../images/menu_con03.gif\" width=\"7\" height=\"5\" /></td>"
    outstr+="<td valign=\"top\" bgcolor=\"#d91977\"><img src=\"../images/spacer.gif\" width=\"1\" height=\"1\" /></td>"
    outstr+="<td width=\"7\" valign=\"top\"><img src=\"../images/menu_con04.gif\" width=\"7\" height=\"5\" /></td>"
    outstr+="</tr>"
    outstr+="</table>"
                document.getElementById("sdiv").innerHTML = "";
                document.getElementById("sdiv").innerHTML = outstr
            }
         }
      }
      function LocationUrl(varUrl,jscmd)
      {
        if(jscmd!='')
        {
           window.location.href="prodList.aspx?pid="+varUrl.tabIndex+"&key=&opcmd="+jscmd
        }
         return false;
      }
     function FrontSearch2()
     {
       
      var SetParent = document.getElementById("DropSelect")
      var SetValue = SetParent.options[SetParent.selectedIndex].value
      var SetKey = document.getElementById("user2432").value
      if(SetValue=="0")
      {
        SetValue=""
      } 
       // window.location.href="../product/SearchList.aspx?pid="+ SetValue +"&key="+SetKey
      document.forms[0].target="_self";
      document.forms[0].action="../product/SearchList.aspx?pid="+ SetValue+"&action=s"
      document.forms[0].submit();
      return false
     }
     