// footer.js - this file contains create_footer which builds the footer
//             navigaton bar at the bottom of each of our web pages.
//
//             It is implemented in JavaScript so that if we need to
//             change the content, we only need to do that once,
//             and here, rather than on each individual page.
//
//             UniSoft Corporation, 29 January 2010, with some help from
//             the web.
//
//             We use x.className = "value"; etc. rather than
//             x.setAttribute("class", "value"); to accommodate IE7.

var footer_text = new Array("Home", "OCAP", "ETV-EBIF", "TSBroadcaster",
			    "TSDeveloper", "OCAP SFG", "XAV", "More Info");

var footer_links = new Array("/index.html",
                             "/ocap/main.html",
                             "/ocap/ETV.html",
                             "/ocap/TSBroadcaster.html",
                             "/ocap/TSDeveloper.html",
                             "/ocap/OCAP-SFG.html",
                             "/ocap/XAV.html",
                             "/info.html"
);


function create_footer(id3) {
        // get the reference within the body, usually an <a> tag with id.
        var place = document.getElementById(id3);
        // creates a <table> element and a <tbody> element
        var tbl     = document.createElement("table");
        var tblBody = document.createElement("tbody");

        // sets the <table> attributes;
        tbl.className = "navbar4";
        tbl.border  = "0";
        
	// create just one row
        var row = document.createElement("tr");
	row.className = "bluebox";
        
	for (var i = 0; i < 8; i++) {
             // Create each <td> element.
             var cell = document.createElement("td");
             var cellText = document.createTextNode(footer_text[i]);
             cell.className = "navbar1-cell";
             var link = document.createElement("a");
             link.className = "tablinks";
             link.href = footer_links[i];
             link.appendChild(cellText);
             cell.appendChild(link);
             row.appendChild(cell);
             if(i < 7) {
                     cell = document.createElement("td");
		     //cellText = document.createTextNode("");
                     //cell.appendChild(cellText);
                     cell.className = "whitevertical";
                     row.appendChild(cell);
             }
        }
        
	// add the row to the end of the table body
	tblBody.appendChild(row);

	// put the <tbody> in the <table>
        tbl.appendChild(tblBody);
        
        // appends <table> into <body>
        place.appendChild(tbl);
}

