<!--
//==================================================================================
// FILE: func.js
// DESC: Javascript functions
// AUTH: 13/05/2005 RPN Creation
// MODS: 
//==================================================================================


//==================================================================================
// FUNC: renderDropDowns
// AUTH: 13/05/2005 RPN
// DESC: Draw relevant drop downs depeding according to parameter
// ARGS: form name, and change value
// MODS: 
//==================================================================================
function renderDropDowns(dropDownName)
{
    if (dropDownName != '')
    {
        // Set dropDownName div to visible,
        document.getElementById(dropDownName).style.visibility = 'visible';

        // Set all other dropdowns to hidden 
        if (dropDownName != 'moveItDropDown')
        {
            document.getElementById('moveItDropDown').style.visibility = 'hidden';
        }
        if (dropDownName != 'sortItDropDown')
        {
            document.getElementById('sortItDropDown').style.visibility = 'hidden';
        }
        if (dropDownName != 'aboutUsDropDown')
        {
            document.getElementById('aboutUsDropDown').style.visibility = 'hidden';
        }
    }
    else
    {
        // else if dropDownName is blank, hide all dropdowns
        document.getElementById('moveItDropDown').style.visibility = 'hidden';
        document.getElementById('sortItDropDown').style.visibility = 'hidden';
        document.getElementById('aboutUsDropDown').style.visibility = 'hidden';
    }
}



//==================================================================================
// FUNC: hideDropDown
// AUTH: 13/05/2005 RPN
// DESC: hides relevant drop down
// ARGS: form name, and change value
// MODS: 
//==================================================================================
function hideDropDown(dropDownName)
{
    document.getElementById(dropDownName).style.visibility = 'hidden';
}




//==================================================================================
// FUNC: showVehicle
// AUTH: 25/05/2005 RPN
// DESC: Show relevant div according to parameter
// ARGS: vehicle number to show
// MODS: 
//==================================================================================
function showVehicle(vehicleNo)
{
    // Hide all divs
    document.getElementById('vehicle1').style.display = 'none';
    document.getElementById('vehicle2').style.display = 'none';
    document.getElementById('vehicle3').style.display = 'none';
    document.getElementById('vehicle4').style.display = 'none';
    document.getElementById('vehicle5').style.display = 'none';
    document.getElementById('vehicle6').style.display = 'none';
    document.getElementById('vehicle7').style.display = 'none';

    // Show specific div that has been clicked upon
    switch (vehicleNo)
    {
        case 1:
            document.getElementById('vehicle1').style.display = 'inline';
            break;
        case 2:
            document.getElementById('vehicle2').style.display = 'inline';
            break;  
        case 3:
            document.getElementById('vehicle3').style.display = 'inline';
            break;
        case 4:
            document.getElementById('vehicle4').style.display = 'inline';
            break;  
        case 5:
            document.getElementById('vehicle5').style.display = 'inline';
            break;
        case 6:
            document.getElementById('vehicle6').style.display = 'inline';
            break;  
        case 7:
            document.getElementById('vehicle7').style.display = 'inline';
            break;
    }
}



//==================================================================================
// FUNC: showMap
// AUTH: 26/05/2005 RPN
// DESC: shows the map popup
// ARGS: none
// RETN: 
// MODS: 
//==================================================================================
function showMap()
{
    // If window win is already open it needs to be shut and reopened or resized and focused
    window.open("/map.php","popupMap","width=750,height=520,scrollbars=no,resizable=no");
    
    document.getElementById(popupMap).focus();
    return false;
}




//==================================================================================
// FUNC: confirmDelete
// AUTH: 14/12/2004 RPN
// DESC: checks to see if user wants to delete a row
// ARGS: none
// RETN: true / false
// MODS: 
//==================================================================================
function confirmDelete()
{
    result = confirm("Are you sure you want to delete?");
    return result;
}




//-->

