var clear_menu;
var menu_row_count=11;
var menu_row_count_next=21;
var w='195';
w=600;

// update IE4
if(document.all && !document.getElementById){
document.getElementById = function(id){
return document.all[id];}}

// these lines set the nav current section pointer

var ref_last;
function makeMenu(item,ref){
if(ref_last){
ref_last.style.color='#4071A8';
ref_last.style.backgroundColor='#ffe38f';}
ref_last=ref;
ref.style.backgroundColor='#4071A8';
ref.style.color='#ffe38f';
var pointer_id=item.replace(/ /g,'_');
var top=DL_GetElementTop(ref);
var left=DL_GetElementLeft(ref);

if(document.body && typeof document.body.clientHeight!='undefined'){browser_height=document.body.clientHeight}
if(typeof window.innerHeight!='undefined'){browser_height=window.innerHeight;}

resetClearMenu();
var menu_end='';
var menu='<div class="navmenu">\n';
var j=0;var menu_count=0;
for(var i=0;i<menuArray.length;i++){var mA=menuArray[i][0];
if(mA == item.toUpperCase()){
menu_count++;
if(menu_row_count == menu_count){menu +='</div><div class="navmenu">\n';menu_end+='';}
if(menu_row_count_next == menu_count){menu +='</div><div class="navmenu">\n';menu_end+='';}
var h = menuArray[i][2] + '';
h=h.replace(/\/http/g,'http');

menu +='<div class="navitem" id="i'+j+'"><a href="'+h+'" onMouseover="resetClearMenu()" onMouseout="clearMenu()"> &nbsp; '+menuArray[i][1]+'</a></div>\n';
j++;
}
}
menu+='</div>';
menu+=menu_end;

if(! menu_count){menu =''}

var menu_div=document.getElementById('menu');

var offset=left + 168;
var top_=top - 1;

menu_div.innerHTML=menu;

menu_div.style.left=offset+'px';
menu_div.style.top=top_+'px';

setTimeout('jiggleIt()',10);

menu_div.style.width=w + 'px';

// if(menu_last){document.getElementById(menu_last).style.visibility='hidden';}
// menu_last=item.replace(/ /g,'_');
// document.getElementById(menu_last).style.visibility='visible';
}

function jiggleIt(){
var menu_div=document.getElementById('menu');
w++;
menu_div.style.width=w+'px';
}

function clearMenu(){
clear_menu=setTimeout('clearTheMenu()',600);

}

function clearTheMenu(){
var menu_div=document.getElementById('menu');
menu_div.innerHTML='';
ref_last.style.color='#4071A8';
ref_last.style.backgroundColor='#ffe38f';
// document.getElementById(menu_last).style.visibility='hidden';
}

function resetClearMenu(){
clearTimeout(clear_menu);
}

function DL_GetElementLeft(eElement)
{var nLeftPos = eElement.offsetLeft;         
var eParElement = eElement.offsetParent;      
while (eParElement != null){nLeftPos += eParElement.offsetLeft;      
eParElement = eParElement.offsetParent;}
return nLeftPos;                             
}

function DL_GetElementTop(eElement){
var nTopPos = eElement.offsetTop;          
var eParElement = eElement.offsetParent; 
while (eParElement != null){                                         
nTopPos += eParElement.offsetTop;        
eParElement = eParElement.offsetParent;}
return nTopPos;                              
}


