function Menu(menuTexts,menuLinks){

    if(arguments.length!=2||!menuTexts.length||!
menuLinks.length){return;}

    for(var i=0;i<menuTexts.length;i++){

        if(typeof(menuTexts[i])!='string'||typeof(menuLinks
[i])!='string'){return;}

    }

    this.menuTexts=menuTexts;

    this.menuLinks=menuLinks;

    this.loc=location.href;

    this.d=document.createElement('div');

    this.d.id='dynmenu';

    //this.leftCorner=createLeftCorner;

    this.links=createLinks;

    //this.rightCorner=createRightCorner;

    this.build=buildMenu;

    return this.build();

}

function createLeftCorner(){

    var lc=document.createElement('span');

    lc.className='leftcorner';

    lc.innerHTML='&nbsp;';

    this.d.appendChild(lc);

}

function createRightCorner(){

    var rc=document.createElement('span');

    rc.className='rightcorner';

    rc.innerHTML='&nbsp;';

    this.d.appendChild(rc);

}

function createLinks(){

    for(var i=0;i<this.menuTexts.length;i++){

          var a=document.createElement('a');

          a.appendChild(document.createTextNode
(this.menuTexts[i]));

          a.href=this.menuLinks[i];

          a.title=this.menuTexts[i];

          this.loc.indexOf(a.href,0)!=-1?
a.className='activebutton':a.className=
'regbutton';

          this.d.appendChild(a);

    }

}

function buildMenu(){

    //this.leftCorner();

    this.links();

    //this.rightCorner();

    return this.d;

}

window.onload=function(){

    if(document.body&&document.body.firstChild)
		{
          menuTexts=new Array('Home Page','Windows','Doors','Architectural Woodwork','Analysis / Design / Assessment Svcs','CADS and Specs','Science & Engineering','Contact Us', 'Useful Links');
          menuLinks=new Array('index.html','windows.htm','doors.htm','archwdwrk.htm','analysis.htm','resources.htm','science.htm','contact.htm', 'links.html');
          var menu=new Menu(menuTexts,menuLinks);
         //document.body.insertBefore(menu,document.body.firstChild);
         document.getElementById('dynmenu').insertBefore(menu, document.getElementById('dynmenu').firstChild);

        // document.body.appendChild(dynmenu);

    }

}