﻿

/*
    Arrays that define the names of the sub menu pages and default pages for menu
    items (respectively)
*/
var DefaultContentPages = new Array ('home.htm', 'Products.htm', 'services.htm', 'support.htm');


/*
    Indexes into the SubMenuPages and DefaultContentPages arrays
*/
var IDX_MENU_HOME = 0;
var IDX_MENU_PRODUCTS = 1;
var IDX_MENU_SERVICES = 2;
var IDX_MENU_SUPPORT = 3;
var FOGBUGS_ADDRESS = "203.122.226.226";   // '203.122.226.226' for public access & 'pilot' for inside access
//var FOGBUGS_ADDRESS = "pilot";

/*
    Function:   DoMenuClick
    Parameters: MenuItem - One of the IDX_MENU_XXX constants
    Purpose:    Changes the information displayed in the Navigation and Content
                frames in response to a menu item click.
*/
function DoMenuClick(MenuItem) 
{
   parent.Navigation.location.href = DefaultContentPages[MenuItem]; 
}


/*
    Function:   DoSubMenuClick
    Parameters: ContentPage - The URL of a page to load into the Content frame
    Purpose:    Changes the information displayed in the Content frame in 
                response to a submenu item click.
*/
function DoSubMenuClick(ContentPage)
{
    parent.Content.location.href = ContentPage;
}


/*
    Function:   SetStyle
    Parameters: ID - The 'id' attribute of an element whose CSS class is to be changed
                StyleName - The name of the CSS class to use for the element 
    Purpose:    Changes the CSS class for the element ID to be the one specified
                in StyleName. This function is typically used by the menu and submenu
                items to show/hide their hover highlighting.
*/
function SetStyle(ID, StyleName)
{
    var Element = document.getElementById(ID);
    if (Element)
    { 
        Element.className = StyleName;
    }
}


/*
    Function:   PopupWindow
    Parameters: ID - The 'id' attribute of a 'DIV' element that is our popup window
                Title - The title of the popup window
                ContentPage - The URL of a page to display in the popup window
    Purpose:    Shows/hides the DIV element identified by ID. When showing, it also
                sets the title of the window to Title and loads the URL specified
                by ContentPage into the popup window. 
*/
function PopupWindow(ID, Title, ContentPage)
{
    var obj = document.getElementById(ID);
    if (ContentPage)
    {
        document.getElementById('PopupTitle').firstChild.nodeValue = Title;
        document.getElementById('PopupContents').src = ContentPage;
        obj.style.display = 'block';
    }
    else
    {
        obj.style.display = 'none';
    }
}


function PopupPage(ID, MenuItem) {
    var obj = document.getElementById(ID);
    if (MenuItem) {

        document.getElementById('PopupPageContents').src=MenuItem;
        obj.style.display = 'block';
    }
    else {
        obj.style.display = 'none';
    }
}


function Navigate(ParentForm) {

    if (ParentForm == 'Submit')
        window.open("http://" + FOGBUGS_ADDRESS + "/default.asp?pg=pgPublicEdit", 'new_window')
    else if (ParentForm=='Review')
        window.open("http://" + FOGBUGS_ADDRESS + "/support", 'new_window'); 
}
    
  








  
