function Button(x,y,w,h,text,url){
     if(arguments.length!=6){return;}
     // create button <div>
     var button=document.createElement('div');
     // create link
     var lnk=document.createElement('a');
     // get current location
     var loc=location.href;
     // style button <div>
     button.style.position='absolute';
     button.style.left=x+'px';
     button.style.top=y+'px';
     button.style.width=w+'px';
     button.style.height=h+'px';
     button.style.padding='3px 3px 3px 3px';
     button.style.textAlign='left';
     button.style.borderColor='#000';
     button.style.borderStyle='solid';
     button.style.borderWidth='1px';
     // resolve active page and display button differently
     loc.indexOf(url)!=-1?button.style.backgroundColor='#fc0':button.style.backgroundColor='#cccc99';
     // style link
     lnk.style.display='block';
     lnk.style.color='#000';
     lnk.style.fontFamily='Arial';
     lnk.style.fontSize='12px';
     lnk.style.textDecoration='none';
     // assign attributes to link
     lnk.href=url;
     lnk.title=text;
     // change link color on mouseover
     lnk.onmouseover=function(){
                this.style.color='#FF0000';
     }
     // reset link color on mouseout
     lnk.onmouseout=function(){
                this.style.color='#000';
     }
     // insert text link
     lnk.appendChild(document.createTextNode(text));
     // insert link into button <div>
     button.appendChild(lnk);
     return button;
}
function Menu(x,y){
     if(parseInt(x)!=x||parseInt(y)!=y){return;}
     // create menu <div>
     var menudiv=document.createElement('div');
     // create menu buttons
     var bthm=new Button(x,y,140,15,'Home','./welcome.html');
     var btnl=new Button(x,y+25,140,15,'Living Frugally','./New_Living_Frugally.html');
     var btnc=new Button(x,y+50,140,15,'Buying a Car','./buying_a_car.html');
     var btsc=new Button(x,y+75,140,15,'Servicing Your Car','./servicing_a_car.html');
     var btne=new Button(x,y+100,140,15,'Save Energy','./save_on_electric.html');
     var btnf=new Button(x,y+125,140,15,'Save on Food','./saving_on_food.html');
     var btfc=new Button(x,y+150,140,15,'Foreclosure','./foreclosure.html');
     var btnr=new Button(x,y+175,140,15,'Credit Cards','./credit_card.html');
     var btcp=new Button(x,y+200,140,15,'Digital Converter Box','./digital_converter.html');
     var btns=new Button(x,y+225,140,15,'Sheets & Links','./spreadsheets.html');
     var btnm=new Button(x,y+250,140,15,'Contact','mailto:liambean@ca.rr.com?subject=About:SayvMony');
     // insert menu buttons into menu container
     menudiv.appendChild(bthm);
     menudiv.appendChild(btnl);
     menudiv.appendChild(btnc);
     menudiv.appendChild(btsc);
     menudiv.appendChild(btne);
     menudiv.appendChild(btnf);
     menudiv.appendChild(btfc);
     menudiv.appendChild(btnr);
     menudiv.appendChild(btcp);
     menudiv.appendChild(btns);
     menudiv.appendChild(btnm);
     return menudiv;
}
window.onload=function(){
     var menu=new Menu(10,100);
     if(document.body.firstChild){
          document.body.insertBefore(menu,document.body.firstChild);
     }
}