// position all layers relative to coordinates of main table (Flash version)
function positionAllLayersFlash() {
    positionLayerBGFlash();
    positionLayerContent();
}


// position all layers relative to coordinates of main table (HTML version home page)
function positionAllLayersHTML_home() {
    positionLayerBGImage();
    positionLayerMainMenu();
}


// position all layers relative to coordinates of main table (HTML version content pages)
function positionAllLayersHTML_content() {
    positionLayerMainMenu();
    positionLayerSubnavMenu();
    positionLayerSubsubnavMenu();
    positionLayerContent();
    positionLayerHomeLink();
    positionLayerBGImage();
}


// (1) position background flash layer relative to coordinates of main table
function positionLayerBGFlash() {
    var obj_main_table = document.getElementById("main_table");

    var obj_layer = document.getElementById("layer_bg_flash");

    obj_layer.style.position = "absolute";
    obj_layer.style.left = obj_main_table.offsetLeft + 0;
    obj_layer.style.top = obj_main_table.offsetTop + 0;
}


// (1) position background image layer relative to coordinates of main table
function positionLayerBGImage() {
    var obj_main_table = document.getElementById("main_table");

    var obj_layer = document.getElementById("layer_bg_image");

    obj_layer.style.position = "absolute";
    obj_layer.style.left = obj_main_table.offsetLeft + 0;
    obj_layer.style.top = obj_main_table.offsetTop + 0;

    // show bg image
    obj_layer.style.display = "block";
}


// (2) position home link content layer relative to coordinates of main table
function positionLayerHomeLink() {
    var obj_main_table = document.getElementById("main_table");

    var obj_layer = document.getElementById("layer_homelink");

    obj_layer.style.position = "absolute";
    obj_layer.style.left = obj_main_table.offsetLeft + 15;
    obj_layer.style.top = obj_main_table.offsetTop + 14;
}


// (3) position main menu layer relative to coordinates of main table
function positionLayerMainMenu() {
    var obj_main_table = document.getElementById("main_table");

    var obj_layer = document.getElementById("layer_main_menu");

    obj_layer.style.position = "absolute";
    obj_layer.style.left = obj_main_table.offsetLeft + 400;
    obj_layer.style.top = obj_main_table.offsetTop + 0;
}


// (4) position subnav menu layer relative to coordinates of main table
function positionLayerSubnavMenu() {
    var obj_main_table = document.getElementById("main_table");

    var obj_layer = document.getElementById("layer_subnav_menu");

    obj_layer.style.position = "absolute";
    obj_layer.style.left = obj_main_table.offsetLeft + 75;
    obj_layer.style.top = obj_main_table.offsetTop + 118;
}


// (5) position subsubnav menu layer relative to coordinates of main table
function positionLayerSubsubnavMenu() {
    var obj_main_table = document.getElementById("main_table");

    var obj_layer = document.getElementById("layer_subsubnav_menu");

    obj_layer.style.position = "absolute";
    obj_layer.style.left = obj_main_table.offsetLeft + 85;
    obj_layer.style.top = obj_main_table.offsetTop + 160;
}


// (6) position content layer relative to coordinates of main table
function positionLayerContent() {
    var obj_main_table = document.getElementById("main_table");

    var obj_layer = document.getElementById("layer_content");

    obj_layer.style.position = "absolute";
    obj_layer.style.left = obj_main_table.offsetLeft + 25;
    obj_layer.style.top = obj_main_table.offsetTop + 205;
}


// perform content link navigation depending on the browsing mode
function doContentLink(sec_name) {
    // html
    if (browsing_mode == "html") {
        window.location = "../html/s" + sec_name + ".html";
    }
    // flash
    else if (browsing_mode == "flash") {
        parent.document.istar_web.SetVariable("new_sec", sec_name);
    }
}


// update flash navigation
function updateFlashNav(sec) {
    if (browsing_mode == "flash") {
        parent.document.istar_web.SetVariable("new_sec", sec);
    }
}
