function drawDate() {
    var monthNames = new Array("January","February","March","April","May","June","July",
                               "August","September","October","November","December");

    var dt = new Date();
    var y  = dt.getYear();
    if (y < 1000) y +=1900;

    output = '<div id="dateHead"><!--EMPTY--></div>'
            +'<div id="dateMid">'
            +'<h3>'
            + dt.getDate() +" " + monthNames[dt.getMonth()] + " " + y
            +'</h3>'
            +'</div>'
            +'<div id="dateFoot"><!--EMPTY--></div>'

    document.write(output);
}

// launch modeller
function launchModeller(myLink,features) {
    myWindow = window.open(myLink+'?js=1', "modPopUp",features);
    myWindow.focus();
    return false;
}
function closeWindow() {
    window.close();
}

/*
    Key questions popup
*/
var popTimer, menuDelay=200;

function rovKq() {
    // stop timer
    if (popTimer) stopTimer();

    showPop();
}
function rofKq() {
    popTimer=setTimeout("hidePop()",menuDelay)
}

function showPop() {
    myObj=document.getElementById("qHolder");
    if(myObj) myObj.className='show';
}

function hidePop() {
    myObj=document.getElementById("qHolder");
    if(myObj) myObj.className='';
}

function stopTimer() {
	clearTimeout(popTimer)
	popTimer = null;
}

function glossaryClick(myUrl) {
    return true;
}

function logout(myUrl) {
    if (confirm("Are you sure you want to logout?")) {
        window.location = myUrl;
    } else {
        return false;
    }
}

/*
    preload nav
*/
navImages = ['images/mn/active_over.gif',
             'images/mn/contacts_over.gif',
             'images/mn/deferred_over.gif',
             'images/mn/home_over.gif',
             'images/mn/modeller_over.gif',
             'images/mn/pensioner_over.gif',
             'images/mn/scheme_over.gif'];


function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

for(i=0;i<navImages.length;i++) {
    MM_preloadImages(navImages[i]);
}
