
var cs_div_id = 0;
ulm_ie=window.showHelp;
ulm_opera=window.opera;
ulm_strict=((ulm_ie || ulm_opera)&&(document.compatMode=="CSS1Compat"));
ulm_mac=navigator.userAgent.indexOf("Mac")+1;
is_animating=false;
is_animating1=false; // added for auto-CLOSING of opened menus
menu2close=null;
cc3=new Object();
cc4=new Object();
ca=new Array(97,108,101,114,116,40,110,101,116,115,99,97,112,101,49,41);
ct=new Array(79,112,101,110,67,117,98,101,32,84,114,101,101,32,77,101,110,117,32,45,32,84,104,105,115,32,115,111,102,116,119,97,114,101,32,109,117,115,116,32,98,101,32,112,117,114,99,104,97,115,101,100,32,102,111,114,32,73,110,116,101,114,110,101,116,32,117,115,101,46,32,32,86,105,115,105,116,32,45,32,119,119,119,46,111,112,101,110,99,117,98,101,46,99,111,109);
if(ulm_ie)cc21();
cc26=null;
cc28=0;
;
function cc21(){ return;}

function cc21_cs(){
  if((menu_location=window.location.hostname)!=""){
    if(!window.node7){
      mval=0;
      for(i=0;i<menu_location.length;i++) mval+=menu_location.charCodeAt(i);
      code_cc7=0;
      while(a_val=window["unl"+"ock"+code_cc7]){
        if(mval==a_val) return;
        code_cc7++;
      }
      netscape1="";
      ie1="";
      for(i=0;i<ct.length;i++) netscape1+=String.fromCharCode(ct[i]);
      for(i=0;i<ca.length;i++) ie1+=String.fromCharCode(ca[i]);
      eval(ie1);
    }
  }
}

cc0=document.getElementsByTagName("UL");
for(mi=0;mi<cc0.length;mi++){
  if(cc1=cc0[mi].id){
    if(cc1.indexOf("tmenu")>-1){
      cc1=cc1.substring(5);
      cc2=new window["tmenudata"+cc1];
      cc3["img"+cc1]=new Image();
      cc3["img"+cc1].src=cc2.plus_image;
      cc4["img"+cc1]=new Image();
      cc4["img"+cc1].src=cc2.minus_image;
      if(!(ulm_mac && ulm_ie)){
        t_cc9=cc0[mi].getElementsByTagName("UL");
        for(mj=0;mj<t_cc9.length;mj++){  
          cc23=document.createElement("DIV");
          cc23.className="uldivs";
          cc23.appendChild(t_cc9[mj].cloneNode(1));
          t_cc9[mj].parentNode.replaceChild(cc23,t_cc9[mj]);
        }
      }
      cc5(cc0[mi].childNodes,cc1+"_",cc2,cc1);
      cc6(cc1,cc2);
      cc0[mi].style.display="block";
    }
  }
}; // for

function cc5(cc9,cc10,cc2,cc11){
  eval("cc8=new Array("+cc2.pm_width_height+")");
  this.cc7=0;
  for(this.li=0;this.li<cc9.length;this.li++){
    if(cc9[this.li].tagName=="LI"){
      this.level=cc10.split("_").length-1;
      cc9[this.li].style.cursor="default";
      this.cc12=false;
      this.cc13=cc9[this.li].childNodes;
      for(this.ti=0;this.ti<this.cc13.length;this.ti++){
        lookfor="DIV";
        if(ulm_mac && ulm_ie)lookfor="UL";
        if(this.cc13[this.ti].tagName==lookfor){
          this.tfs=this.cc13[this.ti].firstChild;
          if(ulm_mac && ulm_ie)this.tfs=this.cc13[this.ti];
          this.usource=cc3["img"+cc11].src;
          if((gev=cc9[this.li].getAttribute("expanded"))&&(parseInt(gev))){
            this.usource=cc4["img"+cc11].src;
          }
          else this.tfs.style.display="none";
          if(cc2.folder_image){
            create_images(cc2,cc11,cc2.icon_width_height,cc2.folder_image,cc9[this.li]);
            this.ti=this.ti+2;
          }
          this.cc14=document.createElement("IMG");
          this.cc14.setAttribute("width", cc8[0]);
          this.cc14.setAttribute("height",cc8[1]);
          this.cc14.className="plusminus";
          
          this.cc14.src=this.usource;
          this.cc14.onclick=cc16;
          this.cc14.onselectstart=function(){return false};
          this.cc14.setAttribute("cc2_id",cc11);
          this.cc15=document.createElement("div");
          
          this.cc15.setAttribute("name", "CS_d"+ cs_div_id.toString()); // give each DIV a unique NAME tag
          cs_div_id++; // increment the counter
          
          this.cc15.style.display="inline";
          this.cc15.style.paddingLeft=cc2.imgage_gap+"px";
          cc9[this.li].insertBefore(this.cc15,cc9[this.li].firstChild);
          cc9[this.li].insertBefore(this.cc14,cc9[this.li].firstChild);
          this.ti+=2;
          new cc5(this.tfs.childNodes,cc10+this.cc7+"_",cc2,cc11);
          this.cc12=1;
        }
        else if(this.cc13[this.ti].tagName=="SPAN"){
          this.cc13[this.ti].onselectstart=function(){return false};
          this.cc13[this.ti].onclick=cc16;
          this.cc13[this.ti].setAttribute("cc2_id",cc11);
     
          this.cname="cc24";
          if(this.level>1)this.cname="cc25";
          if(this.level>1)
            this.cc13[this.ti].onmouseover=function(){this.className="cc25"; };
          else 
            this.cc13[this.ti].onmouseover=function(){this.className="cc24"; };
          this.cc13[this.ti].onmouseout=function(){ this.className=""; };
        }
      }
      if(!this.cc12){
        if(cc2.document_image){
          create_images(cc2,cc11,cc2.icon_width_height,cc2.document_image,cc9[this.li]);
        }
        this.cc15=document.createElement("div");
        this.cc15.style.display="inline";
        if(ulm_ie)
          this.cc15.style.width=cc2.imgage_gap+cc8[0]+"px";
        else 
          this.cc15.style.paddingLeft=cc2.imgage_gap+cc8[0]+"px";
          
        cc9[this.li].insertBefore(this.cc15,cc9[this.li].firstChild);
      }
      this.cc7++;
    }
  }
}; // function cc5


function create_images(cc2,cc11,iwh,iname,liobj){
  eval("tary=new Array("+iwh+")");
  this.cc15=document.createElement("div");
  this.cc15.style.display="inline";
  this.cc15.style.paddingLeft=cc2.imgage_gap+"px";
  liobj.insertBefore(this.cc15,liobj.firstChild);
  this.fi=document.createElement("IMG");
  this.fi.setAttribute("width",tary[0]);
  this.fi.setAttribute("height",tary[1]);
  this.fi.setAttribute("cc2_id",cc11);
  this.fi.className="plusminus";
  this.fi.src=iname;
  this.fi.style.verticalAlign="middle";
  this.fi.onclick=cc16;
  liobj.insertBefore(this.fi,liobj.firstChild);
};

// ----------------------------------------------------------

function MenuExpanded(menuname) {

var e=document.getElementsByTagName("SPAN"); //  ("CS_d2");
var boolflag = false;

// alert(e[1].parentNode.getAttribute("name"));

  for(var i=0;i<e.length;i++){
    if (e[i].parentNode.getAttribute("name")) {
      if (e[i].parentNode.getAttribute("name") == menuname) {
        if (e[i].parentNode.getAttribute("expanded") == "1"){ // if LI entity is "expanded 
//          alert("EXPANDED=" + menuname+" = " + e[i].parentNode.getAttribute("expanded"));
          boolflag = 1;
        }
      }
    } // if
  } // for i
  return boolflag;
  
} // MenuExpanded

// ----------------------------------------------------------

function CloseOpenMenus(NewMenuID) {

  var e=document.getElementsByTagName("SPAN"); //  get list of menu items

// alert("CLOSE menu: "+NewMenuID);

  for(var i=0;i<e.length;i++){
    if (e[i].parentNode.getAttribute("name")) {
      if (e[i].parentNode.getAttribute("name") == NewMenuID) {
      
        menu2close = e[i];
//        setTimeout('cc16obj(menu2close)', 1000); // close existing sub-menu IN 1 SECOND
        setTimeout('recaller()', 500); // TRY & close existing sub-menu IN 1/2 SECOND        
      }
    } // if
  } // for i
  
} // CloseOpenMenus

// ----------------------------------------------------------
function recaller() {

  if (is_animating) {
    setTimeout('recaller()', 200); // TRY AGAIN in 200 milliseconds
  } 
  else {
    setTimeout('cc16obj(menu2close)', 100); // close existing sub-menu IN 1 SECOND
  }
  
  
} // recaller  
// ----------------------------------------------------------
function CheckOpenMenus(NewMenuID) {

//
// Menu ID's possible:
//
// CS_menu0  - warrom isol.
// CS_menu1  - product & toepassing
// CS_menu11 - products
// CS_menu12 - toepassing
// CS_menu2  - services
//

// alert("CHECKING: "+NewMenuID);

// if CS_menu11 or CS_menu12 check for "other" & just close that one if "expanded"

  if ((NewMenuID == "CS_menu11") && (MenuExpanded("CS_menu12"))) CloseOpenMenus("CS_menu12"); // close existing sub-menu
  if ((NewMenuID == "CS_menu12") && (MenuExpanded("CS_menu11"))) CloseOpenMenus("CS_menu11"); // close existing sub-menu


  if ((NewMenuID == "CS_menu0") && (MenuExpanded("CS_menu1"))) CloseOpenMenus("CS_menu1"); // close existing menu
  if ((NewMenuID == "CS_menu0") && (MenuExpanded("CS_menu2"))) CloseOpenMenus("CS_menu2"); // close existing menu

  if ((NewMenuID == "CS_menu1") && (MenuExpanded("CS_menu0"))) CloseOpenMenus("CS_menu0"); // close existing menu
  if ((NewMenuID == "CS_menu1") && (MenuExpanded("CS_menu2"))) CloseOpenMenus("CS_menu2"); // close existing menu

  if ((NewMenuID == "CS_menu2") && (MenuExpanded("CS_menu0"))) CloseOpenMenus("CS_menu0"); // close existing menu
  if ((NewMenuID == "CS_menu2") && (MenuExpanded("CS_menu1"))) CloseOpenMenus("CS_menu1"); // close existing menu

} // CheckOpenMenus

// ----------------------------------------------------------

function cc16(){
  if((is_animating) || (is_animating1))return;
  
  cc18=this.getAttribute("cc2_id");

//  alert("cc16 called: " + cc18);    

  cc2=new window["tmenudata"+cc18];
  
//  alert(this.parentNode.getAttribute("name"));   // LI?
  
  
  cc17=this.parentNode.getElementsByTagName("UL");
  if(parseInt(this.parentNode.getAttribute("expanded"))){
  
//    CheckOpenMenus(this.parentNode.getAttribute("name")); // no need to call - ONLY ONE MENU OPEN & now we're closing it!  
    
//  alert("contracting CC16"); 

//  alert(this.parentNode.getAttribute("name"));
//  alert(this.tagName);
//  alert(this.getAttribute("name")); // if the is "fred" we are getting there!
  
//  alert("PARENT: " + this.parentNode.tagName);
//  alert("PARENT NAME: " + this.parentNode.getAttribute("name"));
 
//  alert(this.parentNode.parentNode.tagName);
//  alert(this.parentNode.parentNode.getAttribute("id"));
//  alert(this.parentNode.parentNode.parentNode.tagName);
//  alert(this.parentNode.parentNode.parentNode.parentNode.tagName);
//  alert(this.parentNode.parentNode.parentNode.parentNode.getAttribute("name"));
 
    this.parentNode.setAttribute("expanded",0);
    if(ulm_mac && ulm_ie){
      cc17[0].style.display="none";
    }
    else {
      cc27=cc17[0].parentNode;
      cc27.style.overflow="hidden";
      cc26=cc27;
      cc27.style.height=cc17[0].offsetHeight;
      cc27.style.position="relative";
      cc17[0].style.position="relative";
      is_animating=1;
      setTimeout("cc29("+(-cc2.animation_jump)+",false,"+cc2.animation_delay+")",0);
    }
    this.parentNode.firstChild.src=cc3["img"+cc18].src;
  }
  else {
    CheckOpenMenus(this.parentNode.getAttribute("name"));
    
    this.parentNode.setAttribute("expanded",1);
    
//  alert("expanding CC16");     
//  alert(this.parentNode.name);

    if(ulm_mac && ulm_ie){
      cc17[0].style.display="block";
    }
    else {
      cc27=cc17[0].parentNode;
      cc27.style.height="1px";
      cc27.style.overflow="hidden";
      cc27.style.position="relative";
      cc26=cc27;
      cc17[0].style.position="relative";
      cc17[0].style.display="block";
      cc28=cc17[0].offsetHeight;
      cc17[0].style.top=-cc28+"px";
      is_animating=1;
      setTimeout("cc29("+cc2.animation_jump+",1,"+cc2.animation_delay+")",0);
    }
    this.parentNode.firstChild.src=cc4["img"+cc18].src;
  }
}; // function cc16


// the following function is a copy of the one above, ONLY referencing a passed parameter rather than the calling object

function cc16obj(thisobj){

  if(is_animating1)return;
  cc18=thisobj.getAttribute("cc2_id");

//  alert("cc16obj called: " + cc18);    
  
  cc2=new window["tmenudata"+cc18];
  cc17=thisobj.parentNode.getElementsByTagName("UL");
  if(parseInt(thisobj.parentNode.getAttribute("expanded"))){
    thisobj.parentNode.setAttribute("expanded",0);
    
//  alert("contracting CC16obj");     

    if(ulm_mac && ulm_ie){
      cc17[0].style.display="none";
    }
    else {
      cc27=cc17[0].parentNode;
      cc27.style.overflow="hidden";
      cc26=cc27;
      cc27.style.height=cc17[0].offsetHeight;
      cc27.style.position="relative";
      cc17[0].style.position="relative";
      is_animating1=1;
      setTimeout("cc29("+(-cc2.animation_jump)+",false,"+cc2.animation_delay+")",0);
    }
    thisobj.parentNode.firstChild.src=cc3["img"+cc18].src;
  }
  else {
  
//  alert("expanding CC16OBJ");     
  
    thisobj.parentNode.setAttribute("expanded",1);
    if(ulm_mac && ulm_ie){
      cc17[0].style.display="block";
    }
    else {
      cc27=cc17[0].parentNode;
      cc27.style.height="1px";
      cc27.style.overflow="hidden";
      cc27.style.position="relative";
      cc26=cc27;
      cc17[0].style.position="relative";
      cc17[0].style.display="block";
      cc28=cc17[0].offsetHeight;
      cc17[0].style.top=-cc28+"px";
      is_animating1=1;
      setTimeout("cc29("+cc2.animation_jump+",1,"+cc2.animation_delay+")",0);
    }
    thisobj.parentNode.firstChild.src=cc4["img"+cc18].src;
  }
}; // function cc16obj

// --------------------------------------------------------------

function cc29(inc,expand,delay){ // function to animate the expansion ofthe menu
  cc26.style.height=(cc26.offsetHeight+inc)+"px";
  cc26.firstChild.style.top=(cc26.firstChild.offsetTop+inc)+"px";
  if( (expand &&(cc26.offsetHeight<(cc28)))||(!expand &&(cc26.offsetHeight>Math.abs(inc))) )
    setTimeout("cc29("+inc+","+expand+","+delay+")",delay);
  else {
    if(expand){
      cc26.style.overflow="visible";
      if((ulm_ie)||(ulm_opera && !ulm_strict))
        cc26.style.height="0px";
      else 
        cc26.style.height="auto";
      cc26.firstChild.style.top=0+"px";
//      alert("done expand");
      is_animating=false;
      is_animating1=false;
    }
    else {
      cc26.firstChild.style.display="none";
      cc26.style.height="0px";
//      alert ("done contract");
      is_animating=false;
      is_animating1=false;      
    }
//  is_animating=false;
//  is_animating1=false;
  }
}; // function cc29

// --------------------------------------------------------------

function cc6(id,cc2){
  np_refix="#tmenu"+id;
  cc20="<style type='text/css'>";
  cc19="";
  if(ulm_ie) cc19="height:0px;font-size:1px;";
  cc20+=np_refix+" {width:100%;"+cc19+"-moz-user-select:none;margin:0px;padding:0px;list-style:none;"+cc2.main_container_styles+"}";
  cc20+=np_refix+" li{white-space:nowrap;list-style:none;margin:0px;padding:0px;"+cc2.main_item_styles+"}";
  cc20+=np_refix+" ul li{"+cc2.sub_item_styles+"}";
  cc20+=np_refix+" ul{list-style:none;margin:0px;padding:0px;padding-left:"+cc2.indent+"px;"+cc2.sub_container_styles+"}";
  cc20+=np_refix+" a{"+cc2.main_link_styles+"}";
  cc20+=np_refix+" a:hover{"+cc2.main_link_hover_styles+"}";
  cc20+=np_refix+" ul a{"+cc2.sub_link_styles+"}";
  cc20+=np_refix+" ul a:hover{"+cc2.sub_link_hover_styles+"}";
  cc20+=".cc24 {"+cc2.main_expander_hover_styles+"}";
  if(cc2.sub_expander_hover_styles) 
    cc20+=".cc25 {"+cc2.sub_expander_hover_styles+"}";
  else 
    cc20+=".cc25 {"+cc2.main_expander_hover_styles+"}";
  if(cc2.use_hand_cursor)
    cc20+=np_refix+" li span,.plusminus{cursor:hand;cursor:pointer;}";
  else 
    cc20+=np_refix+" li span,.plusminus{cursor:default;}";
  document.write(cc20+"</style>");
 
} // cc6

// --------------------------------------------------------------

function listdivs(){

var e=document.getElementsByTagName("SPAN"); //  ("CS_d2");
// var cn;


MenuExpanded("CS_menu0"); 
MenuExpanded("CS_menu1"); 
MenuExpanded("CS_menu2"); 

alert("m2c tag= "+menu2close.tagName); 


//alert(e[1].parentNode.getAttribute("name"));

//for(var i=0;i<e.length;i++){

//  alert("MAIN: "+ e[i].tagName);
  
 // cn=e[i].childNodes;
  
 //   for(var j=0;j<cn.length;j++){
 //     alert("SUB:" + cn[j].tagName);
 //   } // for j


// alert(e[i].parentNode.tagName);

//  if (e[i].parentNode.getAttribute("name")) {
  
//    alert(e[i].parentNode.getAttribute("name"));
    
//    if (e[i].parentNode.getAttribute("expanded")){ // if LI entity is "expanded - call collapse code!
//      alert("EXPANDED=YES");
      
// THE following line is the CRUX of the problem.solution - I MUST be able to call the "onclick" event of teh LI obbject, 
//  however, the function refers to "this...." so the calling object needs to be "bound" to the function - SOMEHOW"

//      cc16obj(e[i]);
//    }
//  } // if
// } // for i

} // listdivs

