var mD=document,TB_ok=false,mto=180,mti=-1,oTd=new Object; oTd=null;
if(navigator.userAgent.indexOf("MSIE")!=-1 && navigator.userAgent.indexOf("Windows")!= -1 && navigator.appVersion.substring(0,1)>3){TB_ok=true;}
if(document.cookie!=''){if(document.cookie.indexOf('usebarmenu')>=0) TB_ok=false; }

function imgStr(img,h,w,t){
 if(h==undefined||h<1)h=16; if(w==undefined||w<1)w=16; if(t==undefined)var t=''; else t=" title='" + t + "' ";
 var st="<img style='vertical-align:middle;' height="+h+" width="+w+" src='images/@.gif' "+t+">";
 return st.replace("@",img);
}

function dM(td,HR){
 clearTimeout(mti); if(td.id.length<14)sE("SELECT");
 if(oTd!=null && oTd.id.substr(0,8)!=td.id.substr(0,8)){cMn();oTd=td;}
 var D=td.id.substr(0,8),i,sT='',tda=new Array();
 var C=D.substr(0,4); 
 if(HR!=true){td.className=C+'1hi';}else {td.className=C+'1dn';}   
 tda=td.id.substr(8).split("_");
 if(oTd!=null){var tdo=new Array(); tdo=oTd.id.split("_");for(i=1;i<tdo.length;i++){sT+="_"+tdo[i]; if(tdo[i]!=tda[i]){mD.getElementById(D+"td"+sT).className=C+'1lo'; if(mD.getElementById(D+"tbl"+sT)!=null)mD.getElementById(D+"tbl"+sT).style.visibility="hidden";}}}
 oTd=td; sT=D+"tbl";
 for(i=1;i<tda.length;i++)sT+="_"+tda[i];
 if(mD.getElementById(sT)!=null){mD.getElementById(sT).style.visibility="visible";hE(sT,"SELECT");}
}

function cMn(){
 if(oTd!=null){
  var sT='',tdo=new Array(),D=oTd.id.substr(0,8); tdo=oTd.id.substr(8).split("_");
  var C=D.substr(0,4);
  for(var i=1;i<tdo.length;i++){
   sT+="_"+tdo[i]; mD.getElementById(D+"td"+sT).className=C+'1lo'; if(mD.getElementById(D+"tbl"+sT)!=null)mD.getElementById(D+"tbl"+sT).style.visibility="hidden";
  }oTd=null;
 }sE("SELECT");
}

function rM(strURL){if(strURL.substr(0,4)=='cmd:'){setTimeout('cMn()',mto); eval( strURL.substr(4));} else location.href=strURL;}

function gC(st,D){
 var tt='',tA=st.split("_");
 if(tA.length>2){tA=tA.slice(0,-1);tt=tA.join("_"); return(mD.getElementById(D+"tbl"+tt).offsetTop+mD.getElementById(D+"td"+st).offsetTop-1)+"px;left:"+(mD.getElementById(D+"tbl"+tt).offsetLeft+mD.getElementById(D+"td"+st).offsetWidth+1)+"px'>";}
 return(mD.getElementById(D).offsetTop+mD.getElementById(D+"td"+st).offsetHeight+1)+"px;left:"+(mD.getElementById(D).offsetLeft+mD.getElementById(D+"td"+st).offsetLeft)+"px'>";
}

function hE(sT,e){
 var o,oL,oT,oP,y,x=5+window.event.srcElement.offsetLeft+window.event.srcElement.offsetParent.offsetLeft;
 y=mD.getElementById(sT).offsetTop+mD.getElementById(sT).offsetHeight;
 for(i=0;i<mD.all.tags(e).length;i++){
  o=mD.all.tags(e)[i];oL=o.offsetLeft;oT=o.offsetTop;oP=o.offsetParent;
  while(oP.tagName.toUpperCase()!="BODY"){oL+=oP.offsetLeft; oT+=oP.offsetTop; oP=oP.offsetParent;}
  oT=oT-y;
  if(x>(oL+o.offsetWidth)||oL>(x+mD.getElementById(sT).offsetWidth));
  else if(oT>mD.getElementById(sT).offsetHeight);
  else o.style.visibility="hidden";
 }
}

function sE(e){for(i=0;i<mD.all.tags(e).length;i++){obj=mD.all.tags(e)[i]; obj.style.visibility="";}}

function OSMenuAdv(HDR,PNL,LNE){
 // following changes made to avoid updating web pages.
 if(document.cookie!=''){if(document.cookie.indexOf('usebarmenu')>=0) TB_ok=false; }

 if(TB_ok==true) TB_ok=(document.all) ? true: false;

 if(!TB_ok){OSMenuBar(HDR,PNL,LNE); return;}  
 if(LNE!='')OSLine('#8f8f8f','#000000'); //OSLine('808080','ffffff');
 var mMi=myMnu;

 var D=mMi['id'],sT,pT=new Array(); var C=D.substr(0,4);
 var q,p=0,j=0,zz,sH="<div style='border:1px solid black; border-color:white buttonshadow buttonshadow white;'><table class="+C+" id="+D+" cellspacing=0 style='POSITION:static;'><tr>";
 while(mMi["td_"+ ++j]!=undefined){
  sH+="<td id="+D+"td_"+j;
  if(mMi["ur_"+j]=='vbar'){
   sH+=">";
  }else{
   sH+=" onmousedown=dM(this,true) onmouseover=dM(this) onmouseout=mti=setTimeout('cMn()',mto) ";
   sH+=(mMi["ur_"+j]!=undefined)?" onclick=rM('"+ mMi["ur_"+j] +"')>":">";
  }
  sH+= mMi["td_"+j]+"</td>";
  if(mMi["td_"+j+"_1"]!=undefined)pT[p++]="_"+j;
 }
 sH+="<td width=100%> &nbsp; </td></tr></table></div>"; mD.write(sH);
 for(q=0;typeof(pT[q])!="undefined";q++){
  sT=pT[q]; sH=""; j=0;
  sH+="<table style='BORDER-BOTTOM:#8F8F8F solid 1px; BORDER-LEFT:#ffffff solid 1px; BORDER-RIGHT:#8F8F8F solid 1px; BORDER-TOP:#ffffff solid 1px;' ";
  sH+=" class="+C+"1 id="+D+"tbl"+sT+" bgcolor=buttonface cellspacing=0 style='top:"+gC(sT,D);
  while(mMi["td"+sT+"_"+ ++j]!=undefined){
   var cHL=""+mMi["td"+sT+"_"+j];
   if(cHL=="<HR>"){
   // sH+='<tr><td colspan=9 style="width:100%; height:1px; background-color:buttonface;"><img height=1px width=150% style="margin-left:20px; border:0px; border-top:1px solid buttonshadow;"></td></tr>';
    sH+='<tr><td colspan=9 style="width:100%; height:1px; background-color:#cccccc;"><img height=1px width=150% style="margin-left:20px; border:0px; border-top:1px solid buttonshadow;"></td></tr>';
   }else{
    if(cHL.substr(0,4)!="<img")zz="<div style='display:inline; height:16px; width:20px; border:0px;'></div>"; else zz='';
    cHL=""; sH+="<tr><td id="+D+"td"+sT+"_"+j+" onmousedown=dM(this,true) onmouseover=dM(this"+cHL+") onmouseout=mti=setTimeout('cMn()',mto) ";
    sH+=(mMi["ur"+sT+"_"+j]!=undefined)?" onclick=rM('"+ mMi["ur"+sT+"_"+j] +"')>":cHL+">";
    sH+=zz+mMi["td"+sT+"_"+j]+"</td></tr>";
   }
   if(mMi["td"+sT+"_"+j+"_1"]!=undefined)pT[p++]=sT+"_"+j;
  }
  sH+="</table>"; mD.write(sH);
 }

//OSLine('b8b8b8','8f8f8f');
if(PNL==''){OSPanel(""," Where Training is Job ONE! We are pleased to welcome new members.");}

 mD.getElementById(D).style.visibility="visible";
}
