function initmenu()
{
addmenu('m_a','p_a');
addmenu('m_f','p_f');
addmenu('m_g','p_g');
addmenu('m_p','p_p');
addmenu('m_mp','p_mp');
addmenu('m_b','p_b');
}


function addmenu(snm,pmn)
{
newText = document.getElementById(snm);
newElem=document.createElement('div');
newElem.appendChild(newText);
document.getElementById(pmn).appendChild(newElem);
}


function clearmenu()
{
hidemenu('m_a','p1');
hidemenu('m_f','p3');
hidemenu('m_g','p4');
hidemenu('m_p','p5');
hidemenu('m_mp','p6');
hidemenu('m_b','p7');
}

function showmenu(snm,pmn)
{
clearmenu();

nmts=document.getElementById(snm);
nmts.style.display="inline";

pmts=document.getElementById(pmn);
pmts.style.backgroundColor="#e8e8fa";
pmts.style.Color="#000099";
}


function hidemenu(snm,pmn)
{
nmts=document.getElementById(snm);
nmts.style.display="none";

nmts=document.getElementById(pmn);
nmts.style.backgroundColor="transparent";

}


function smartnote()
{
var now = new Date();
var today = now.toString();
var hol = new Array('Dec 25','Dec 26');
var msg = 'off';
 
if (now.getHours()<9 || now.getHours()>17) {msg='(lines open 9am to 5.30pm)' }
if (now.getDay()==0) {msg='(Monday to Saturday)' } 
for (iday in hol) 
{
if (today.search(hol[iday]) != -1  ) { msg='have a good holiday!' }
}
if (msg != 'off') { document.write(msg); }
}


function zoomBox(datain)
{
var newelem;
var currentelem;
var newhtml;

newhtml='<a href="#" onclick="zoomBoxClose(); return false;">&laquo; close</a><br><div class="zoomBoxInner"><a href="#" onclick="zoomBoxClose(); return false"><img src="' + datain + '" border="0" ></a></div>';
currentelem=document.getElementById('zoomBox');

if (currentelem == null )
{
newelem= document.createElement('div');
newelem.setAttribute('id','zoomBox');
document.body.appendChild(newelem);
newelem.innerHTML=newhtml;
}

}


function zoomBoxClose()
{
var closeelem;
closeelem=document.getElementById('zoomBox');
document.body.removeChild(closeelem);
}


function stopDefault(evt) 
{    
if (evt && evt.preventDefault) {     evt.preventDefault();    } 
else {        window.event.returnValue = false;    }
    return false;
}

