var imageDir = "/students/v06/images/saotw/howtouse/";

// MenuImage(image_id, normal_image, active_image, mouseover_image, image_swapped)
var MImages = new Array(
    new MenuImage("_h_home", "home_OFF.gif", "home_ON.gif", "home_ON.gif", 2),
    new MenuImage("_h_myfsa", "myfsa_OFF.gif", "myfsa_ON.gif", "myfsa_ON.gif", 0),
    new MenuImage("_h_wiz", "wizards_OFF.gif", "wizards_ON.gif", "wizards_ON.gif", 0),
    new MenuImage("_h_pub", "publications_OFF.gif", "publications_ON.gif", "publications_ON.gif", 0),
    new MenuImage("_h_close", "button_close_window_OFF.gif", "button_close_window_ON.gif", "button_close_window_ON.gif", 0),
    new MenuImage("_how_home1", "applying_college_OFF.gif", "applying_college_ON.gif", "applying_college_ON.gif", 0),
    new MenuImage("_how_home2", "applying_financial_OFF.gif", "applying_financial_ON.gif", "applying_financial_ON.gif", 0),
    new MenuImage("_how_home3", "repaying_loans_OFF.gif", "repaying_loans_ON.gif", "repaying_loans_ON.gif", 0),
    new MenuImage("_how_wiz1", "college_savings_OFF.gif", "college_savings_ON.gif", "college_savings_ON.gif", 0),
    new MenuImage("_how_wiz2", "fiancial_aid_wiz_OFF.gif", "fiancial_aid_wiz_ON.gif", "fiancial_aid_wiz_ON.gif", 0),
    new MenuImage("_how_wiz3", "college_finder_OFF.gif", "college_finder_ON.gif", "college_finder_ON.gif", 0),
    new MenuImage("_how_wiz4", "student_planner_OFF.gif", "student_planner_ON.gif", "student_planner_ON.gif", 0),
    new MenuImage("_how_wiz5", "myfsa_applications_OFF.gif", "myfsa_applications_ON.gif", "myfsa_applications_ON.gif", 0), 
    new MenuImage("_how_pub1", "publication1_OFF.gif", "publication1_ON.gif", "publication1_ON.gif", 0),
    new MenuImage("_how_pub2", "brochure1_OFF.gif", "brochure1_ON.gif", "brochure1_ON.gif", 0),
    new MenuImage("_how_pub3", "factsheet1_OFF.gif", "factsheet1_ON.gif", "factsheet1_ON.gif", 0),
    new MenuImage("_how_pub4", "publication2_OFF.gif", "publication2_ON.gif", "publication2_ON.gif", 0)
    //new MenuImage("_how_pub5", "brochure2_OFF.gif", "brochure2_ON.gif", "brochure2_ON.gif", 0)
);


// Opens (and optionally closes) a DHTML layer
function openDHTML(id,hideoption)
{
    var obj = document.getElementById(id);
    
    if(obj.style.display == 'block' && hideoption == 1)
    {
        // Hide the block if we're currently displaying it
        obj.style.display = 'none'; 
    }
    else
    { 
        obj.style.display = 'block';
    }

    return;
}


// Closes all the first-children <div>s *with an ID* within the target element
function closeDHTMLGroup(id)
{
    var outer = document.getElementById(id);
    var divs = outer.getElementsByTagName("div");

    for(var i=0; i<divs.length; i++) 
    { 
        // If the div has an ID, and is a first child, then hide it
        if(divs[i].id != '' && divs[i].parentNode.id == id) {
            divs[i].style.display = 'none'; 
        } 
    }

    return;
}


// Resets the selection within a section to it's default state
function resetSelection(id)
{
    closeDHTMLGroup(id);
    document.getElementById(id + '0').style.display = 'block';

    return;
}
