/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

function genMenu(tabs, titles, len)
{
    document.write("<div id='menu'><ul id='nav'>");
    for ( var i=0; i<len ; i++ ) {
        document.write("<li id='"+ tabs[i] +"'><a href='javascript:changeTab(tabs, " + i + ", " + len + ");'>" + titles[i] + "</a></li>");
    }
    document.write("</ul></div>");
}

function genIncludePage(tabs, links, len)
{
    document.write("<div class='contentbox' style='overflow: auto; height:437px; padding: 15px 0 0 20px;'>");
    for ( var i=0; i<len ; i++ ) {
        document.write("<div id='" + tabs[i] + "Div' style='display:none;'>" +
                "<jsp:include page='" + links[i] + "'></jsp:include>" +
            "</div>");
    }
    document.write("<div>");
}

function genFrame(tabs, links, len)
{
    document.write("<div class='contentbox' style='overflow: auto; height:437px; padding: 15px 0 0 20px;'>");
    for ( var i=0; i<len ; i++ ) {
        document.write("<iframe id='" + tabs[i] + "Div' src='" + links[i] + "' height=\"100%\" width=\"732\" frameborder=\"0\" style=\"overflow:auto;\"></iframe>");
    }
    document.write("<div>");
}

function changeTab(tabs, showid, len)
{
    for ( var i=0; i<len ; i++ ) {
        if (i!=showid) {
            hide2(tabs[i] + 'Div');
            getElement(tabs[i]).className = "";
        }
        else {
            show2(tabs[i] + 'Div');
            getElement(tabs[i]).className = "activelink";
        }
    }
}

