var clear_menu;
var menu_last;
var left_offset=0;
var top_offset=17;
var item_width='120px';

// update IE4
if(document.all && !document.getElementById){
document.getElementById = function(id){
return document.all[id];}}

// these lines set the nav current section pointer


function makeMenu(item,ref){
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='<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++;
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()">'+menuArray[i][1]+'</a></div>\n';
j++;
}
}
menu+='</div>';

if(! menu_count){menu =''}

var menu_div=document.getElementById('menu');

var offset=left + left_offset;
var top_=top + top_offset;

menu_div.innerHTML=menu;

menu_div.style.left=offset+'px';
menu_div.style.top=top_+'px';

setTimeout('jiggleIt()',10);

menu_div.style.width=item_width;

// 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');
menu_div.style.width=item_width + 1;
}

function clearMenu(){
clear_menu=setTimeout('clearTheMenu()',600);

}

function clearTheMenu(){
var menu_div=document.getElementById('menu');
menu_div.innerHTML='';
// 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;                              
}


function warn(){
var warn='Please note that you are now leaving Genesis Today Inc.’s website.  We appreciate the time you have spent with us and look forward to your next visit!\n\n  If you should have any questions regarding an order you may place with the site you are about to visit, please contact that vendor directly so that they may assist you with your question.  If you need any other information or have any additional questions, please do not hesitate to call us at 1 800 916 6642.';

alert(warn);
}


