function headerDate()
{
    var now = new Date();

    var months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];

    var date = now.getDate();
    var month = months[now.getMonth()];
    var year = now.getFullYear();

    document.write(date + ' | ' + month + ' | ' + year);
}

function thisYear()
{

    var now = new Date();

    var year = now.getFullYear();

    document.write(year);

}

function showHideSubMenu(sMenuId)
{

    var oMenu = document.getElementById(sMenuId);

    if ( oMenu.style.visibility == "visible" ){

        oMenu.style.visibility = "hidden";
        oMenu.style.display = "none";

    } else {

        oMenu.style.visibility = "visible";
        oMenu.style.display = "block";

    }

}

/**
*
* Update the table passed into the function to stripe the
* rows of the table. Missing out the first row as it's the
* column headings.
*
* Note: The CSS must have a background colour for tr.odd{} & tr.even{}.
*
*/
function stripeTable(tableName){

    var tableObj = document.getElementById(tableName);

    var rows = tableObj.getElementsByTagName("tr");


    var oddRow = true;

    // exclude the first row = 0, column headings.
    for(i=1; i < rows.length; i++){

        if ( oddRow == true ){

            rows[i].className = "odd";

        } else {

            rows[i].className = "even";

        }

        oddRow = (oddRow==true)? false : true;
    }
}


/**
*
* Build up the url required to sort out the columns.
* The page requires two hidden fields with ID's "property" and "type".
*
*/
function buildSortURL(url, property, additionalParameters){

    var returnString = "";

    if ( additionalParameters == true ){
        returnString = url + "&";
    } else {
        returnString = url + "?";
    }

    var type = "asc";

    // current values.
    var currentProperty = document.getElementById("property").value;
    var currentType = document.getElementById("type").value;

    // Build up the url string to send to server.
    if ( property == currentProperty ){

        type = (currentType=="asc"?"desc":"asc");

    }

    returnString += "orderBy=" + property + "&type=" + type;

    document.location.href = returnString;
}

function popitup(url) {

   newwindow=window.open(url,'name','left=100,top=150,height=500,width=800,location=no,status=no,resizable=no');
   if (window.focus) {newwindow.focus()}
   return false;
}

function targetopener(mylink, closeme, closeonly)
{

   if (! (window.focus && window.opener))
   return true;
   window.opener.focus();
   if (! closeonly)
   window.location.href=mylink.href;
   if (closeme)
   window.close();
   return false;
}


