/************************************************************************/
/*                          default.js                                 */
/*                                                                      */
/* Generic JavaScript functions for use on the UQ template.             */
/* Version 1.0                                                          */
/* 5th October 2003                                                     */
/*                                                                      */
/************************************************************************/

function parseNavigation(ob) {
toBeBrokenDown = ob.options[ob.selectedIndex].value.split("|");

targetWindow = toBeBrokenDown[0];
targetURL    = toBeBrokenDown[1];

    if (targetWindow!=='') {
    // if a new Window name is specified, then it will
    // open in a new Window.
    window.open(targetURL,targetWindow,'toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1,width=400,height=300');
    // if we open a new window, then we have to re-set
    // the select box to the first option
    // which should have no value
    ob.selectedIndex = 0;
        } else {
    // or else it will open in the current window        
    window.open(targetURL,'_top')
    }
}


// For the Quick links pulldown-menu of the left hand side menu of the site
function changepage(formObject)
{
    var url;
    
    url = formObject.options[formObject.options.selectedIndex].value;

    if(url != "empty")
        {
        window.location = url;
        url = "";
        }
}   


// For the Header Search form
function goto_url(form) 
{

    if (form.search_text.value == "") 
    {
        alert("Please enter some text and then press Search");
        return false;
    }

    var url = form.search_select[form.search_select.selectedIndex].value +
    escape(form.search_text.value);


    // Uncomment this lines if you want the current window to change
    document.location = url;

    // Uncomment this line if you want the search in a new window
    //search_window = window.open(url);

    return false;
}

// For printing articles
function printWindow()
{
 bV = parseInt(navigator.appVersion)
 if (bV >= 4) window.print()
}