document.write("<div id=menuPageDiv style='display:none;position:absolute'></div>")

// global page variables and settings

    if (document.all) {
  	resultsXML_MNU= new ActiveXObject("Microsoft.XMLDOM");  // contains xml for menu
  	cas_MNU= new ActiveXObject("Microsoft.XMLDOM");  // contains xsl for menu
    }
    else if (document.getElementById) {
    }
    else if (document.layers) {

      // Nav 4.x code fork...
    }
    else {

      // other browsers

    }










// variable containing last ID of folder that was clicked        
        var folderID 
        var mainmenuTop_MNU  // position from top
        var mainmenuLeft_MNU // position from right

// settings
	var parent_MNU             
	var table_MNU             
  	var table_parent_MNU     
	var obj_attach_MNU
	var horizontal_scew_MNU
	var vertical_scew_MNU
	var connection_string_MNU
        var xmlfile_MNU
        var position_MNU
        var dataIS_MNU
        var closeobj_MNU

        var mnuHeight_MNU  // heigth of menu
        var first_objmain_MNU
        var lstOBJmenuItm_MNU
        var loadedCheck_MNU

        first_objmain_MNU=400




       function build_cascadeXSL_MNU() {
          var loadXSLcascade  // xsl variable which contains text version of menu xsl
	  loadXSLcascade='<menuTBL>' +
			'<div xmlns:xsl="http://www.w3.org/TR/WD-xsl" onmousemove="window.event.cancelBubble=true" class="box"  id="mnuTBL1_MNU" parent="" style="">' +
			'<div onmouseout="closeout_MNU()"  onmouseover="window.clearTimeout(erasetble_MNU)"  class="box" id="boxContent"><xsl:attribute name="style"><xsl:value-of select="//MENUFOLDER/@groupmenu" /></xsl:attribute>' +		        
                        '<table  cellpadding="0" cellspacing="0" width="71"><tr><td nowrap="true" width="100%">' + 
                        '<div onmouseover="performcasadecheck_MNU(this.parentElement.children(1).children(0).rows(0).cells(0).children(0),false);" onmouseout="try{clearInterval(clearINV);}catch(e){}" style="display:none;cursor:hand" width="100%" align="center"><span><xsl:attribute name="style">color:<xsl:value-of select="//MENUFOLDER/@talloff" /></xsl:attribute><xsl:attribute name="off"><xsl:value-of select="//MENUFOLDER/@talloff" /></xsl:attribute><xsl:attribute name="on"><xsl:value-of select="//MENUFOLDER/@tallon" /></xsl:attribute><font face="webdings" size="2">5</font></span></div>' + 
                        '<div style=";overflow:hidden; WIDTH: 100%;">' +
                        '<table width="100%"  cellpadding="0" cellspacing="0" >' +
			'<xsl:for-each  select="//MENUFOLDER[@parent=2]">' +



			'<tr>' +
			'<xsl:if test="@hasChildren[.=' + "'" + '1' + "'" + ']"><xsl:attribute name="onmouseover">childmenu_MNU(<xsl:value-of select="@child" />,this)</xsl:attribute></xsl:if>' +
			'<xsl:if test="@hasChildren[.!=' + "'" + '1' + "'" + ']"><xsl:attribute name="onmouseover">clearMnu_MNU(this)</xsl:attribute></xsl:if>' +
                        '<td width="100%">' +

			'<table  width="100%" border="0"  onmouseover="performcasadecheck_MNU(this,true)"  cellpadding="0" cellspacing="2"><xsl:attribute name="onclick"></xsl:attribute><xsl:attribute name="class"><xsl:value-of select="@class"/></xsl:attribute><xsl:attribute name="style"><xsl:value-of select="@styleon" /></xsl:attribute>' +
			'<tr>' +
			'<td width="100%" nowrap="true"><span  style="width:3;"></span><xsl:value-of select="@folder" />&#160;&#160;&#160;</td>' +
			'<td  width="1%" valign="center" align="right"><xsl:attribute name="style">font-family:webdings;font-size:8;color:<xsl:value-of select="@cascadeon"/></xsl:attribute>&#160;&#160;&#160;<xsl:if test="@hasChildren[.=' + "'" + '1' + "'" + ']"><b>4</b></xsl:if></td>' +
			'<td></td>' +
			'</tr>' +
			'</table>' +

			'<table  width="100%" border="0"  onmouseover=""  cellpadding="0" cellspacing="2"><xsl:attribute name="onmousemove"></xsl:attribute><xsl:attribute name="style"><xsl:value-of select="@styleoff" />;display:none</xsl:attribute><xsl:attribute name="class"><xsl:value-of select="@classout"/></xsl:attribute><xsl:attribute name="onclick">initFolderName_MNU(<xsl:value-of select="@child" />);try{<xsl:value-of select="@javascriptaction"/>}catch (e) {alert("Error in your onclick!")};erase_MNU()</xsl:attribute>' +
			'<tr>' +
			'<td width="100%" nowrap="true"><span  style="width:3;"></span><xsl:value-of select="@folder" />&#160;&#160;&#160;</td>' +
			'<td  width="1%" valign="center" align="right"><xsl:attribute name="style">font-family:webdings;font-size:8;color:<xsl:value-of select="@cascadeoff"/></xsl:attribute>&#160;&#160;&#160;<xsl:if test="@hasChildren[.=' + "'" + '1' + "'" + ']"><b>4</b></xsl:if></td>' +
			'<td></td>' +
			'</tr>' +
			'</table>' +


                        '</td>' +
                        '</tr>' +




			'</xsl:for-each>' +
			'</table>' +
                        '</div>' +
                        '<div onmouseover="performcasadecheck_MNU(this.parentElement.children(1).children(0).rows(0).cells(0).children(0),false);"  onmouseout="try{clearInterval(clearINV);}catch(e){}" style="display:none;cursor:hand" width="100%" align="center"><span><xsl:attribute name="style">Filter: fliph;color:<xsl:value-of select="//MENUFOLDER/@tallon" /></xsl:attribute><xsl:attribute name="off"><xsl:value-of select="//MENUFOLDER/@talloff" /></xsl:attribute><xsl:attribute name="on"><xsl:value-of select="//MENUFOLDER/@tallon" /></xsl:attribute><font face="webdings" size="2">6</font></span></div>' +
                        '</td><td></td></tr></table>' +
                        '</div>' +
                        '</div>' +
                        '</menuTBL>'
        return loadXSLcascade
   } 




          function build_cascadeXSLNetscape_MNU() {
                  var netscapexsl
                  var netscapexsl
	    netscapexsl='<div  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" onmousemove="window.event.cancelBubble=true" class="box"  id="mnuTBL1_MNU" parent=""   style="">' +
			'<div onmouseout="closeout_MNU()"  onmouseover="window.clearTimeout(erasetble_MNU)"  class="box" id="boxContent">' +	        
                        '<table  cellpadding="0" cellspacing="0" width=""><tr><td nowrap="true" width="*">' +
                        '<div onmouseover="performcasadecheck_MNU(this.parentNode.childNodes.item(1).childNodes.item(0).rows.item(0).cells.item(0).childNodes.item(0),false);scrollMenu_MNU(this,-1)" onmouseout="try{clearInterval(clearINV);}catch(e){}" style="display:none;cursor:hand;width:100%"  align="center"><span style=";height:1;width:10"><font color="gray" face="webdings" size="2">5</font></span></div>' +
                        '<div style="scroll:yes;overflow:hidden; WIDTH: 100%; scrollTop:50">' +
                        '<table border="0" width="100%"  cellpadding="0" cellspacing="0" ><xsl:attribute name="style"><xsl:value-of select="//MENUFOLDER/@groupmenu" /></xsl:attribute>' +
			'<xsl:for-each select="//MENUFOLDER[@parent=2]">' +


			'<tr>' +
			'<xsl:if test="@hasChildren[.=' + "'" + '1' + "'" + ']"><xsl:attribute name="onmouseover">childmenu_MNU(<xsl:value-of select="@child" />,this)</xsl:attribute></xsl:if>' +
			'<xsl:if test="@hasChildren[.!=' + "'" + '1' + "'" + ']"><xsl:attribute name="onmouseover">clearMnu_MNU(this)</xsl:attribute></xsl:if>' +
                        '<td width="100%">' +

			'<table  width="100%" border="0"  onmouseover="performcasadecheck_MNU(this,false)"  cellpadding="0" cellspacing="2"><xsl:attribute name="onclick"></xsl:attribute><xsl:attribute name="class">"<xsl:value-of select="@class"/>"</xsl:attribute><xsl:attribute name="style"><xsl:value-of select="@styleon" /></xsl:attribute>' +
			'<tr>' +
			'<td width="100%" nowrap="true"><span  style="width:3;"></span><xsl:value-of select="@folder" />&#160;&#160;&#160;</td>' +
			'<td  width="1%" valign="center" align="right"><xsl:attribute name="style">"font-family:webdings;font-size:8;color:<xsl:value-of select="@cascadeon"/>"</xsl:attribute>&#160;&#160;&#160;<xsl:if test="@hasChildren[.=' + "'" + '1' + "'" + ']"><b>4</b></xsl:if></td>' +
			'<td></td>' +
			'</tr>' +
			'</table>' +

			'<table  width="100%" border="0"  onmouseover=""  cellpadding="0" cellspacing="2"><xsl:attribute name="onmousemove"></xsl:attribute><xsl:attribute name="style"><xsl:value-of select="@styleoff" />;display:none</xsl:attribute><xsl:attribute name="class">"<xsl:value-of select="@classout"/>"</xsl:attribute><xsl:attribute name="onclick">"initFolderName_MNU(<xsl:value-of select="@child" />);<xsl:value-of select="@javascriptaction"/>;erase_MNU()"</xsl:attribute>' +
			'<tr>' +
			'<td width="100%" nowrap="true"><span  style="width:3;"></span><xsl:value-of select="@folder" />&#160;&#160;&#160;</td>' +
			'<td  width="1%" valign="center" align="right"><xsl:attribute name="style">"font-family:webdings;font-size:8;color:<xsl:value-of select="@cascadeoff"/>"</xsl:attribute>&#160;&#160;&#160;<xsl:if test="@hasChildren[.=' + "'" + '1' + "'" + ']"><b>4</b></xsl:if></td>' +
			'<td></td>' +
			'</tr>' +
			'</table>' +


                        '</td>' +
                        '</tr>' +


			'</xsl:for-each>' +
			'</table>' +
                        '</div>' +
                        '<div onmouseover="performcasadecheck_MNU(this.parentNode.childNodes.item(1).childNodes.item(0).rows.item(0).cells.item(0).childNodes.item(0),false);scrollMenu_MNU(this,1)"  onmouseout="try{clearInterval(clearINV);}catch(e){}" style="display:none;cursor:hand" width="100%" align="center"><span style="Filter: flipH;height:1;width:10"><font color="black" face="webdings" size="2">6</font></span></div>' +
                        '</td><td bgcolor="yellow"></td></tr></table>' +
                        '</div>' +
                        '</div>' 
                     return netscapexsl
          }




    function clearMnu_MNU(obj) {

       obj.parentNode.parentNode.parentNode.parentNode.parentNode.cells.item(1).innerHTML=""
    }



  // checks to see if menu is over max scroll heigth, if so it scrolls
  function initscrollMenu_MNU(obj,objheigth) {

    if(obj.childNodes.item(0).childNodes.item(0).rows.item(0).cells.item(0).childNodes.item(1).childNodes.item(0).offsetHeight<objheigth)
     {

     }
     else
     {

           if (document.all) {
                           obj.childNodes.item(0).childNodes.item(0).rows.item(0).cells.item(0).childNodes.item(0).style.display=""
                           obj.childNodes.item(0).childNodes.item(0).rows.item(0).cells.item(0).childNodes.item(1).style.height=objheigth
                           obj.childNodes.item(0).childNodes.item(0).rows.item(0).cells.item(0).childNodes.item(2).style.display=""   

            }
           else if (document.getElementById) {

           }
            else if (document.layers) {

             // Nav 4.x code fork...
           }
          else {

          // other browsers

         }
     } 
  }
  
  // controls menu scrolling
  function scrollMenu_MNU(obj,dir) {
    obj.parentNode.parentNode.cells.item(1).innerHTML=""
    if(obj.childNodes.item(0).childNodes.item(0).parentNode.on==obj.childNodes.item(0).childNodes.item(0).parentNode.style.color) {
       lstOBJmenuItm_MNU=obj
       if(dir==1) {

         clearINV=setInterval("scrollMenuTimerP_MNU()", 9);

       }
       else
       {

         clearINV=setInterval("scrollMenuTimerM_MNU()", 9);       
       }
   
    }
  }



  // timer function to scroll menu forward
  function scrollMenuTimerP_MNU() {
     var i
     i=lstOBJmenuItm_MNU.offsetParent.children(1).scrollTop=lstOBJmenuItm_MNU.offsetParent.children(1).scrollTop
     lstOBJmenuItm_MNU.offsetParent.children(1).scrollTop=lstOBJmenuItm_MNU.offsetParent.children(1).scrollTop+2
     lstOBJmenuItm_MNU.offsetParent.children(0).children(0).style.color= lstOBJmenuItm_MNU.offsetParent.children(0).children(0).on
     if(i==lstOBJmenuItm_MNU.offsetParent.children(1).scrollTop) {       
        lstOBJmenuItm_MNU.offsetParent.children(2).children(0).style.color=lstOBJmenuItm_MNU.offsetParent.children(0).children(0).off
    }
  }

  // timer function to scroll menu forward
  function scrollMenuTimerM_MNU() {

     lstOBJmenuItm_MNU.offsetParent.children(1).scrollTop=lstOBJmenuItm_MNU.offsetParent.children(1).scrollTop-2
     lstOBJmenuItm_MNU.offsetParent.children(2).children(0).style.color=lstOBJmenuItm_MNU.offsetParent.children(2).children(0).on
     if(lstOBJmenuItm_MNU.offsetParent.children(1).scrollTop<!0) {
       lstOBJmenuItm_MNU.offsetParent.children(0).children(0).style.color=lstOBJmenuItm_MNU.offsetParent.children(0).children(0).off

     }
  }


  // moves the folder id of last click folder to folderID
  function initFolderName_MNU (obj) {
              folderID=obj
  }











      var erasetble_MNU
      function erase_MNU() {
            document.getElementById("menuPageDiv").innerHTML=""
            document.getElementById("menuPageDiv").style.display="none"
      }







     //  var closeobj_MNU
     // mouseout event for folder, set innerHTML to nothing
     function closeout_MNU(){
          window.clearTimeout(erasetble_MNU)
          erasetble_MNU=setTimeout('erase_MNU()',1100)
     }

   // initializes the classname for the menu on a mouseover
   function performcasadecheck_MNU(trOBJ,chk) {

      try {



    if (document.all) {
       for (i=0;i<trOBJ.parentNode.parentNode.parentNode.rows.length;i++) {

          	trOBJ.parentNode.parentNode.parentNode.rows.item(i).childNodes.item(0).childNodes.item(0).style.display=""
         	trOBJ.parentNode.parentNode.parentNode.rows.item(i).childNodes.item(0).childNodes.item(1).style.display="none"
       }
             if(chk) {
		trOBJ.parentNode.childNodes.item(1).style.display=""
                trOBJ.parentNode.childNodes.item(1).height=trOBJ.offsetHeight
		trOBJ.style.display="none"
             }

    }
    else if (document.getElementById) {

    }
    else if (document.layers) {

      // Nav 4.x code fork...
    }
    else {

      // other browsers

    }

      }
      catch(e){
      }     
   
    }



    function Xmlfile_menu_MNU(obj,objpos,parentid,hor,ver,filehdr) { 


	 if(obj_attach_MNU==obj){
		if(document.getElementById("menuPageDiv").style.display!="none")
                   {

                     if(document.getElementById("menuPageDiv").innerHTML.length==1248)
                       { 
                          document.getElementById("menuPageDiv").innerHTML="" 
                       }
                       else
                       { 
                          return
                       }

                   }
	  }

          document.getElementById("menuPageDiv").innerHTML=""
          document.getElementById("menuPageDiv").style.display="none"
          obj_attach_MNU=obj

          parent_MNU=parentid 
          horizontal_scew_MNU=hor
          vertical_scew_MNU=ver
          xmlfile_MNU=filehdr  
          position_MNU=objpos


          BuildCascadingMenu_MNU(3)
   
    }


    function DataIsland_menu_MNU(obj,objpos,parentid,hor,ver,dataIS) {
          obj_attach_MNU=obj
          parent_MNU=parentid 
          horizontal_scew_MNU=hor
          vertical_scew_MNU=ver 
          position_MNU=objpos 
          dataIS_MNU=dataIS


          build_cascadeXSL_MNU()
          BuildCascadingMenu_MNU(1)
    }


    // function to build menu by building xml file from a sql2000 menu table.
    function sqlTbl_menu_MNU(obj,tbl,parent,objpos,hor,ver,cn) {
       obj_attach_MNU=obj
       parent_MNU=parent
       horizontal_scew_MNU=hor
       vertical_scew_MNU=ver
       position_MNU=objpos  
          


       if(tbl==""){
          table_MNU="menu"
       }
       else
       {
          table_MNU=tbl
       }
 
       if(cn==""){
          connection_string_MNU=""
       }
       else
       {
          connection_string_MNU=cn
       }

       BuildCascadingMenu_MNU(2)
    }



    // this is the top level menu, this is what the client calls to build the menu	
     function BuildCascadingMenu_MNU(objtype) {
      try {
         window.clearTimeout(erasetble_MNU)
      }
      catch(e){
      }

            mnuHeight_MNU=document.body.clientHeight*first_objmain_MNU-40
            if(mnuHeight_MNU<100) {  mnuHeight_MNU=100  }
            if(isNaN(horizontal_scew_MNU)){ 
              alert("horizontal_scew must be an integer!")
              return
            }
            if(isNaN(parent_MNU)){ 
              alert("parent must be an integer!  Please check menu table for valid parent!")
              return
            }
            if(isNaN(vertical_scew_MNU)){ 
              alert("vertical_scew must be an integer!")
              return
            }

            if(typeof obj_attach_MNU == 'undefined') {
               alert("obj_attach_MNU is not set.  Check to see if the object you have assigned to exists, if it exists try setting obj_attach_MNU in some event such as onclick or mouseover event, guessing the object "
                   + "had time to load yet when it is being set.")
              return
            }
            if(typeof obj_attach_MNU!="object") {
              alert("obj_attach_MNU must be assign to a valid object: td, input, tr, etc...")
              return
            }

              try {
          //    closeout_MNU(mnuTBL1_MNU)
              }
              catch(e){
              }


          try {


            // type dataIsland
            if(objtype==1){
             //  alert(MyDataIsle.xml)
               if(dataIS_MNU.xml=="") {
                   alert("DataIsland not a valid XML Document.")
                   return
                } 
                

              	if (document.all) {
                        cas_MNU.loadXML(build_cascadeXSL_MNU()) 
                	resultsXML_MNU.loadXML(dataIS_MNU.xml)
              	}
              	else if (document.getElementById) {
 
              	}
              	else if (document.layers) {
                   // Nav 4.x code fork...
             	}
             	else {
                  // other browsers
             	}


                BuildComplete_MNU()
            }
            // end dataIsland //////////////////////////////

            // type SQL Server 2000
            if(objtype==2){

             BuildCascadingMenuS_MNU()
             BuildComplete_MNU()
            }

            if(objtype==3){
              loadedCheck_MNU=0
              if (document.all) {
                resultsXML_MNU.async = false;
                resultsXML_MNU.load(xmlfile_MNU)

                if(resultsXML_MNU.xml=="") {
                   alert("XML file not found or is an invalid XML Document.")
                   return
                }
                cas_MNU.loadXML(build_cascadeXSL_MNU()) 
                DoLoaded_MNU()
              }
              else if (document.getElementById) { 
              }
              else if (document.layers) {
                   // Nav 4.x code fork...
             }
             else {
                  // other browsers
             }

             }
}





      catch(e){
              }
      }

var counterMNU
counterMNU=1
function DoLoaded_MNU() {
   try{
     BuildComplete_MNU()  
		if((new XMLSerializer).serializeToString(resultsXML_MNU)=="" && counterMNU<100) {
                   counterMNU+=1
		   BuildCascadingMenu_MNU(3)
		}
    }
     catch(e){

      }
}


function BuildComplete_MNU() {
    CheckforCHild_MNU()

 //   cas_MNU.getElementsByTagName("div").item(0).attributes.item(3).nodeValue="mnuTBL1_MNU"
    if (document.all) {
      cas_MNU.getElementsByTagName("xsl:for-each").item(0).attributes.item(0).nodeValue="//MENUFOLDER[@parent=" + parent_MNU + "]"       
    }
    else if (document.getElementById) {
    }
    else if (document.layers) {

      // Nav 4.x code fork...
    }
    else {

      // other browsers

    }



    var carryVar
    if (document.all) {
             carryVar= resultsXML_MNU.transformNode(cas_MNU) 

    }
    else if (document.getElementById) {

    }
    else if (document.layers) {

      // Nav 4.x code fork...
    }
    else {

      // other browsers

    }
            if(position_MNU==1){
             mainmenuTop_MNU=getoffseta_MNU(obj_attach_MNU,"Top") 
             mainmenuLeft_MNU=getoffseta_MNU(obj_attach_MNU,"Left")
             }
            if(position_MNU==2){
             mainmenuTop_MNU=getoffseta_MNU(obj_attach_MNU,"Top")-obj_attach_MNU.offsetHeight
             mainmenuLeft_MNU=getoffseta_MNU(obj_attach_MNU,"Left")+obj_attach_MNU.offsetWidth
            }


            document.getElementById("menuPageDiv").style.display=""
            document.getElementById("menuPageDiv").style.top = mainmenuTop_MNU + parseInt(vertical_scew_MNU) + obj_attach_MNU.offsetHeight
            document.getElementById("menuPageDiv").style.left = mainmenuLeft_MNU + parseInt(horizontal_scew_MNU) 
            document.getElementById("menuPageDiv").innerHTML= carryVar
            changetoHTML_MNU(document.getElementById("menuPageDiv").childNodes.item(0))




    		if (document.all) {        
                    obj_attach_MNU.attachEvent("onmouseout", closemainout_MNU); 
                    var xheight
                    xheight=0
                    if(getoffseta_MNU(document.getElementById("menuPageDiv").childNodes.item(0),"Top")-document.body.scrollTop+document.getElementById("menuPageDiv").childNodes.item(0).offsetHeight > document.body.clientHeight) {
                         xheight=document.body.clientHeight-(getoffseta_MNU(document.getElementById("menuPageDiv").childNodes.item(0),"Top")-document.body.scrollTop+document.getElementById("menuPageDiv").childNodes.item(0).offsetHeight)-40
                    }
    		}
    		else if (document.getElementById) {
    		}
    		else if (document.layers) {

      		// Nav 4.x code fork...
    		}
    		else {

      		// other browsers

    		}
     }



     function closemainout_MNU() {
          window.clearTimeout(erasetble_MNU)
          erasetble_MNU=setTimeout('erase_MNU()',2100)
    }


     function checkcasc_MNU(obj) {
         for (k=0;k<resultsXML_MNU.getElementsByTagName("MENUFOLDER").length;k++) {
             if(resultsXML_MNU.getElementsByTagName("MENUFOLDER").item(k).attributes.item(0).nodeValue==obj) {
               return true
              }
         }
         return false
     }


     function CheckforCHild_MNU() {
         for (j=0;j<resultsXML_MNU.getElementsByTagName("MENUFOLDER").length;j++)
	 {
          try {
            check=resultsXML_MNU.getElementsByTagName("MENUFOLDER").item(j).attributes.item(1).nodeValue
            if(checkcasc_MNU(check)) 
            {
               resultsXML_MNU.getElementsByTagName("MENUFOLDER").item(j).setAttribute("hasChildren",1) 
            }
            else
            {
               resultsXML_MNU.getElementsByTagName("MENUFOLDER").item(j).setAttribute("hasChildren",0) 
            }

         }
          catch(e){
          }
         }
    }

     // this retrieves the xml and xsl needed to build menu    
     function BuildCascadingMenuS_MNU()  {      
              try {
                var xmltext
                xmltext = '<request storedproc="dbo.cascadeMenu" connectionString="' + ConverttoXML_MNU(connection_string_MNU) + '"><parameters><param>' + parent_MNU + "</param><param>" + ConverttoXML_MNU(table_MNU) + "</param></parameters></request>"    		
                if (document.all) {	
			poster= new ActiveXObject("Microsoft.XMLHTTP"); 

               		xmldom = new ActiveXObject("Microsoft.XMLDOM");
                	xmldom.loadXML(xmltext)
			docSubmit= new ActiveXObject("Microsoft.XMLDOM");

               		var i
               		i=1


                	while (poster.readyState==0) {
			poster.open("post","getmenu.asp?",false)    
             	  	 i=i+1
               		   if(i==10) {
		    		  return
                   	          i=0
                 	    }
                	}

              		poster.send(xmldom)

              		resultsXML_MNU = new ActiveXObject("Microsoft.XMLDOM");
              		resultsXML_MNU.loadXML(poster.responseText)  
                        cas_MNU.loadXML(build_cascadeXSL_MNU())
    		}
    		else if (document.getElementById) {
    		}
    		else if (document.layers) {

      		// Nav 4.x code fork...
    		}
    		else {

      		// other browsers
    		}


              if(resultsXML_MNU.xml.length==0)
               {
                 if(poster.responseText.length>4100) {	
                 alert("Unable to connect to database. Check connection_string variable to see if" +
                    " you have correct connection string.  Also check to see if you have installed the " +
                     "menu table and cascademenu stored procedure.  Once you have all these up and running you " +
                    "may wish to comment out this alert.  There may be times when you cannot establish a connection " +
                    " and you don't want to show this annoying message to end user.")
                   return
                  }
                  else
                  {
                   alert("Error: unable to find getmenu.asp file.  Make sure this file is in the same directory as this page.")
                   return
                  }

               }
	      } 
              catch(e){
              }
         }





   // builds a new childmenu from an existing menu, this is the cascading part
   function childmenu_MNU(parentID,trOBJ){

          try {
          	var slide
          	var slideChild
         	if(trOBJ.cells.item(0).childNodes.item(0).rows.item(0).cells.item(2).innerHTML=="") {
                cas_MNU.getElementsByTagName("div").item(0).attributes.item(4).nodeValue=parentID 


    		if (document.all) {
      			cas_MNU.getElementsByTagName("xsl:for-each").item(0).attributes.item(0).nodeValue="//MENUFOLDER[@parent=" + parentID + "]"       
    		}
    		else if (document.getElementById) {
    		}
   		else if (document.layers) {

      		// Nav 4.x code fork...
    		}
    		else {

      		// other browsers

    		}


		cas_MNU.getElementsByTagName("div").item(1).attributes.item(0).nodeValue=""
            	cas_MNU.getElementsByTagName("div").item(0).attributes.item(3).nodeValue=""
                cas_MNU.getElementsByTagName("div").item(0).attributes.item(5).nodeValue="position:absolute"

    		if (document.all) {
          		trOBJ.parentElement.parentElement.parentElement.parentElement.parentElement.cells(1).innerHTML= resultsXML_MNU.transformNode(cas_MNU.selectSingleNode("//div"))
    		}
   		else if (document.getElementById) {
   		}
    		else if (document.layers) {
      		// Nav 4.x code fork...
    		}
    		else {

      		// other browsers
    		}

                 changetoHTML_MNU(trOBJ.parentNode.parentNode.parentNode.parentNode.parentNode.cells.item(1).childNodes.item(0))

                 try {
                 }
                   catch(e){
                 }




    		if (document.all) {
          		trOBJ.parentElement.parentElement.parentElement.parentElement.parentElement.cells(1).children(0).style.posLeft=trOBJ.parentElement.parentElement.parentElement.parentElement.parentElement.cells(1).children(0).offsetLeft-12
                	slideChild=trOBJ.parentNode.parentNode.parentNode.parentNode.parentNode.cells.item(1).childNodes.item(0).offsetWidth 
			slide=getoffseta_MNU(trOBJ.parentNode.parentNode.parentNode.parentNode.parentNode.cells.item(1).childNodes.item(0),"Left")
                 	if(document.body.clientWidth+document.body.scrollLeft<slideChild+slide)
			{
                        	trOBJ.parentNode.parentNode.parentNode.parentNode.parentNode.cells.item(1).childNodes.item(0).style.left=10-trOBJ.parentNode.parentNode.parentNode.parentNode.parentNode.cells.item(1).childNodes.item(0).offsetWidth
                 	}
    		}
    		else if (document.getElementById) {
 
              	if(document.body.clientWidth+document.body.scrollLeft<slideChild+slide)
		{
              		trOBJ.parentNode.parentNode.parentNode.parentNode.parentNode.cells.item(1).childNodes.item(0).style.left=-trOBJ.parentNode.parentNode.parentNode.parentNode.parentNode.cells.item(1).childNodes.item(0).childNodes.item(0).offsetWidth+5
        	}
   		}
    		else if (document.layers) {

      			// Nav 4.x code fork...
  		}
  	 	else {

    		 	 // other browsers

    		}

               var varHeigth
                 if(trOBJ.parentNode.parentNode.parentNode.parentNode.childNodes.item(0).style.display=="none") {
                   varHeigth=0
                 }
                 else
                 {
                   varHeigth=trOBJ.parentNode.parentNode.parentNode.parentNode.childNodes.item(0).offsetHeight  
                 }


                 trOBJ.parentNode.parentNode.parentNode.parentNode.parentNode.cells.item(1).childNodes.item(0).style.top=trOBJ.offsetTop-trOBJ.parentNode.parentNode.parentNode.scrollTop+varHeigth+3
                 slideChild=trOBJ.parentNode.parentNode.parentNode.parentNode.parentNode.cells.item(1).childNodes.item(0).offsetHeight                
		 slide=getoffseta_MNU(trOBJ,"Top")

                if(document.body.clientHeight+document.body.scrollTop<slideChild+slide-trOBJ.parentNode.parentNode.parentNode.scrollTop) {   
                   var offsetH
                    offsetH=0
                    trOBJ.parentNode.parentNode.parentNode.parentNode.parentNode.cells.item(1).childNodes.item(0).style.top=trOBJ.parentNode.parentNode.parentNode.parentNode.parentNode.cells.item(1).childNodes.item(0).offsetTop - trOBJ.parentNode.parentNode.parentNode.parentNode.parentNode.cells.item(1).childNodes.item(0).offsetHeight+trOBJ.parentNode.parentNode.parentNode.parentNode.childNodes.item(0).offsetHeight+offsetH+15
                    if(getoffseta_MNU(trOBJ.parentNode.parentNode.parentNode.parentNode.parentNode.cells.item(1).childNodes.item(0),"Top")-document.body.scrollTop<=0) {
                    trOBJ.parentNode.parentNode.parentNode.parentNode.parentNode.cells.item(1).childNodes.item(0).style.top=trOBJ.parentNode.parentNode.parentNode.parentNode.parentNode.cells.item(1).childNodes.item(0).offsetTop - getoffseta_MNU(trOBJ.parentNode.parentNode.parentNode.parentNode.parentNode.cells.item(1).childNodes.item(0),"Top")+document.body.scrollTop+5
                  
                }
             }
        }
     }
 catch(e){}


}


function changetoHTML_MNU(obj) {
var t1




    if (document.all) {
               t1=obj.childNodes.item(0).childNodes.item(0).childNodes.item(0).childNodes.item(0).childNodes.item(0).childNodes.item(1).childNodes.item(0)
                for (var i=0; i < t1.rows.length; i++) {
		t1.rows.item(i).cells.item(0).childNodes.item(0).rows.item(0).cells.item(0).innerHTML= "&nbsp;" + t1.rows.item(i).cells.item(0).childNodes.item(0).rows.item(0).cells.item(0).innerText
		t1.rows.item(i).cells.item(0).childNodes.item(1).rows.item(0).cells.item(0).innerHTML= "&nbsp;" + t1.rows.item(i).cells.item(0).childNodes.item(1).rows.item(0).cells.item(0).innerText
                }
    }
    else if (document.getElementById) {
 

    }
    else if (document.layers) {

      // Nav 4.x code fork...
    }
    else {

      // other browsers

    }






}





// to get the offset
function getoffseta_MNU(obj,offsetType)
{
    /* 
        valid types are "Top","Left","Width","Height"
        all case sensitive
   */
    var i
    var offset;
    var pObj;
    pObj=obj;
    offset=0
    i=0
    while (pObj.tagName!="BODY")
    {
	if (pObj.tagName=="BODY") return offset;
        eval("offset+=pObj.offset" + offsetType);
        pObj=pObj.offsetParent;
        if(i==50) return offset;
    }
    return offset
 
}





// converts special characters of html to xml
function ConverttoXML_MNU(obj) {
  var getxml
  getxml=""
  for (var i=0; i < obj.length; i++) {

	switch (obj.charAt(i)){

		case "&": 
		getxml=getxml + "&#38;";
		break;

		case "'": 
		getxml=getxml + "&#39;";
		break;
		case '"': 
		getxml=getxml + "&#34;";
		break;
		case ">": 
		getxml=getxml + "&#62;";
		break;
		case "<": 
		getxml=getxml + "&#60;";
		break;                

                default : getxml=getxml + obj.charAt(i);
       }
  }
  return getxml
}
















