// object representing the header...must have constants
// included before this file!!
function Header( index ) {

        // the index of the tab to display
        this.index = index;
        this.constants = new Constants();

        // method to assemble the banner tags
        this.assembleBanner = function() {

                var constants = this.constants;
                // the banner
                var banner = new Banner( this.constants.bannerName );
                // construct the image map(s)
                var imageMap = new ImageMap ("bannerLinks" );
                for (var i=0; i < this.constants.area.length; i++) {
                        imageMap.addArea( this.constants.area[i] );
                } // end for
                // now, add the image map to the banner
                banner.addImageMap( imageMap );

                return banner;
        }
        this.banner = this.assembleBanner();

        this.fetchHTML = function() {

		// change the tab from gray to white
		var title = this.constants.tab[this.index].title;
		//title = title.replace(/_off\.gif/, "_on.gif");
		title = title.replace(/_g\.png/, "_w.png");
		this.constants.tab[this.index].title = title;
		
                var numTabs = this.constants.tab.length;

                var html = '';
                // the table width is the width of the banner image
                html = '<table width="750" border="0" align="center" cellpadding="0" cellspacing="0">\n';
                html += '<tr valign="top">\n';
                html += '<td colspan="' + numTabs + '">\n';
                html += this.banner.fetchHTML() + '\n';
                html += '</td>\n';
                html += '</tr>\n';
                html += '<tr valign="top">\n';
                for ( var i=0; i < numTabs; i++ ) {
                        html += '<td>\n';
                        html += this.constants.tab[i].fetchHTML() + '\n';
                        html += '</td>\n';
                } // end for
                html += '</tr>\n';
                html += '</table>\n';
                return html;
        }


}

function Footer() {

	this.fetchHTML = function() {
		var html = '';
		return html;
	}
}

