1 var strgURL = location.pathname; // path of current component
3 // constuctor for the array of objects
4 function tabElement(id, folderName, tabTxt ) {
5 this.id = id; // elementID as needed in html;
6 this.folderName = folderName; // folder name of the component
7 this.tabTxt = tabTxt; // Text displayed as menu on the web
8 this.currentListItem = '<li id="' + this.id + '" class="current"> <a href="../..' + this.folderName + 'index.html"><span>' + this.tabTxt + '</span></a></li>';
9 this.listItem = '<li id="' + this.id + '"> <a href="../..' + this.folderName + 'index.html"><span>' + this.tabTxt + '</span></a></li>';
16 // arr.push( new tabElement( "GEN", "/General/html/", "General"));
19 // called from the header file.
20 function writeComponentTabs() {
21 for ( var i=0; i < arr.length; i++ ) {
22 if (strgURL.search(arr[i].folderName) > 0) { // if this is the current folder
23 document.write(arr[i].currentListItem); // then print and highlight the tab
25 document.write(arr[i].listItem); // else, print the tab