function makeMenu(a,b,c,d){
 cel='<tr>'; cels='</tr>'; celt=''; celts=''; al='align=center';
 vl='#ce0f09';tp='style="border-top:1px solid white"';t='colspan=2';
 if(a=='hor'){
  cel=''; cels='<td class=st>|</td>'; celt='<tr>'; celts='</tr>'; 
  al=''; vl='#ce0f09'; tp='';t='';
 }
 tmp='';
 tmpt='<table id=menutab class="tab menu" style=background:'+vl+' cellpadding=0 cellspacing=0 width=127>'
 sub='';
 for(var i=0;i<b.length;i++){
  arr=b[i].length;
  if (arr==3){
  id=b[i][2]+i;
  kt='';
  if((b.length-1)==i) kt='sa';
   if(a=='hor'){
    tmp=tmp + cel + '<td id="'+id+'" class="col padMenu" lowClass="bg padMenu" '+tp+' onmouseover="over(); showAll(\''+b[i][2]+'\',\''+id+'\',\''+a+'\',1); swClass(this)" onmouseout="out(\''+b[i][2]+'\'); swClass(this)" nowrap title="'+b[i][0] +'" onclick="goPage(\''+b[i][1]+'\')" kt='+kt+'>'+b[i][0]+'</td><td><div style=position:absolute>'+makeSubMenu(d,c[i],b[i][2],a,id)+'</div></td><td class=st>|</td>';
   }else{
    tmp=tmp + cel + '<td width=124px id='+id+' class="col padMenu" lowClass="bg padMenu" '+tp+' onmouseover="over(); showAll(\''+b[i][2]+'\',\''+id+'\',\''+a+'\',1); swClass(this,\''+id+'s\')" onmouseout="out(\''+b[i][2]+'\'); swClass(this,\''+id+'s\')" onclick="goPage(\'' + b[i][1] + '\')" nowrap title="'+b[i][0] +'">'+b[i][0]+'</td><td id='+id+'s class=col lowClass=bg onmouseover="over(); showAll(\''+b[i][2]+'\',\''+id+'\',\''+a+'\',0); swClass(this,\''+id+'\')" onmouseout="out(\''+b[i][2]+'\'); swClass(this,\''+id+'\')" '+tp+' onclick="goPage(\''+b[i][1]+'\')"><td><div style=position:absolute>'+ makeSubMenu(d,c[i],b[i][2],a,id) + '</div></td>' + cels;
   }
  }else{
   tmp= tmp + cel + '<td class="padMenu col" lowClass="bg padMenu" '+tp+' nowrap st="'+b[i][1]+'" lowst="" onmouseover=swClass(this) onmouseout=swClass(this) onclick="goPage(\''+b[i][1]+'\')" '+t+'>'+ b[i][0] + '</td>' + cels;
  }//end if
 }//end for
 if(a=='hor'){tmp = tmp.substr(0,tmp.length-12);}
 return tmpt + celt + tmp + celts + '</table>'// + submenu;
}//end function makeMenu

function makeSubMenu(a,b,c,d,e){
 tmp=''; t='';
 st='style="border-top:1px solid white"';
 td='<tr>';tr='<tr><td><img src=/img/blank.gif width=1px height=2px></td></tr>'
 eve='onmouseover="over(); showAll(\''+c+'\',\''+e+'\'); swClass(this,\''+e+'\')" onmouseout="out(\''+c+'\'); swClass(this,\''+e+'\')"';
 if(d=='ver'){
 td='<tr><td width=1px rowspan='+b.length+'><img src=/img/blank.gif width=1px height=1px></td>'; tr='';
 eve='onmouseover="over(); showAll(\''+c+'\',\''+e+'\',\''+d+'\'); swClass(this,\''+e+'\',\''+e+'s\')" onmouseout="out(\''+c+'\'); swClass(this,\''+e+'\',\''+e+'s\')"';
 t='colspan=2';
 }
 tmptab='<table id='+c+' class=tab style=position:absolute;visibility:hidden cellpadding=0 cellspacing=0>'+tr;
 for(i=0;i<b.length;i++){
  arr=b[i].length;
  if(arr==3){
   id=b[i][2]+i;
   tmp = tmp + '<td id='+id+' class="bgMenu menu" lowClass="bgMenus menu" '+st+' onmouseover="over(); showAll(\''+c+'\',\''+e+'\',\''+d+'\',0,\''+b[i][2]+'\'); swClass(this,\''+id+'s\',\''+e+'\',\''+e+'s\')" onmouseout="out(\''+b[i][2]+'\',\''+c+'\'); swClass(this,\''+id+'s\',\''+e+'\',\''+e+'s\')" onclick="goPage(\''+b[i][1]+'\')"  nowrap>'+b[i][0]+'</td><td id='+id+'s class="bg menu" lowClass="bgs"  onmouseover="over(); showAll(\''+c+'\',\''+e+'\',\''+d+'\',0,\''+b[i][2]+'\',1); swClass(this,\''+id+'\')" onmouseout="out(\''+b[i][2]+'\',\''+c+'\'); swClass(this,\''+id+'\')" onclick="goPage(\''+b[i][1]+'\')" '+st+'></td><td><div id=mk  style=position:absolute>'+makeSubMenus(a[i],b[i][2],c,e,id)+'</div></td></tr>'
  }else{
   tmp = tmp + '<td class="bgMenu menu" lowClass="bgMenus menu" st="'+b[i][1]+'" lowst="" '+eve+' onclick="goPage(\''+b[i][1]+'\')" style="border-top:1px solid white" '+t+' nowrap>'+b[i][0]+'</td></tr>';
  } //end if
 }//end for
 if(d=='ver'){tmp = tmp + '<tr><td height=2px></td></tr>'}
 return tmptab + td + tmp + '</table>'
}//end function makeSubMenu

function makeSubMenus(a,b,c,d,e){
 tmps='';
 len=a.length

 tmp='<table id='+b+' class=tab style=position:absolute;top:-9px;left:1px;visibility:hidden cellpadding=0 cellspacing=0>';
 for(var i=0;i<len;i++){
  tmp=tmp+'<tr><td class="bgMenu menu" lowClass="bgMenus menu" onmouseover="over(); swClass(this,\''+d+'\',\''+d+'s\',\''+e+'\',\''+e+'s\')" onmouseout="out(\''+c+'\',\''+b+'\'); swClass(this,\''+d+'\',\''+d+'s\',\''+e+'\',\''+e+'s\')" onclick="goPage(\''+a[i][1]+'\')" style="border-top:1px solid white" nowrap>'+a[i][0]+'</td></tr>'
 }
 return tmp + '</table>'
} //end function

var hideTime;
var wait=500;
var idlast='';
var opctime;
var kind=navigator.appName;
var idlasts='';

function over(){
 if(hideTime!=null) clearTimeout(hideTime);
}

function showAll(a,b,d,e,f,g){
 obj=document.getElementById(a);
 objs=document.getElementById(b);
 if(idlast!=''){
  objss=document.getElementById(idlast);
  objss.style.visibility='hidden';
  if(idlasts!=''){
  objss=document.getElementById(idlasts);
  objss.style.visibility='hidden'
  }
  
 }
 if(e==1) fadeIn(obj,'visible');
 if(f){
  objf=document.getElementById(f);
  if(!g) fadeIn(objf,'visible');
  objf.style.visibility='visible';
  idlasts=f;
  if(kind=='Netscape') objf.style.cssText='position:absolute;top:-9px;left:2px';
 }
 
 obj.style.visibility='visible';
 if(d=='ver'){
  tmp=0;
  tmptop=-9;
  if(kind=='Netscape'){
   tmp=0;
   tmptop=-9;
  }
 }else{
 tmp=-objs.offsetWidth;
 if(objs.getAttribute('kt')=='sa') tmp=-obj.offsetWidth
 tmptop=8;
 if(kind=='Netscape'){
   tmptop=9;
  }
 }
 obj.style.left=tmp+'px';
 obj.style.top =tmptop+'px';
 idlast=a;
 
}

function out(a,b){
 tmp='\''+a+'\'';
 if(b) tmp='\''+a+'\',\''+b+'\'';
 hideTime=setTimeout("hideAll("+tmp+")",wait);
}

function hideAll(a,b){
 obj=document.getElementById(a);
 fadeIn(obj,'hidden');
 obj.style.visibility='hidden';
 if(b){
  obj=document.getElementById(b);
//  fadeIn(obj,'hidden');
  obj.style.visibility='hidden';
 }
}

function fadeIn(a,b){
  if(kind == "Microsoft Internet Explorer"){
   a.style.filter="blendTrans(duration=0.4)";
   a.filters.blendTrans.apply();
   a.style.visibility=b
   a.filters.blendTrans.play();
  }
}


function swClass(a){
 len=arguments.length;
 if(len > 1){
  for(var i=1;i<len;i++){
   tmp=document.getElementById(arguments[i]);
   clss=tmp.className;
   tmp.className=tmp.getAttribute('lowClass');
   tmp.setAttribute('lowClass',clss);
  }
 }
  cls=a.className;
  a.className=a.getAttribute('lowClass');
  a.setAttribute('lowClass',cls);
 
}

function goPage(a){
 location.href=a;
}