var mnu_selected, smnu_selected;

function mnuLoginShow() {
	
	mnu_selected = true;

	document.getElementById('mnu_adsl').style.backgroundImage = "url('images/mnu_green_bg.gif')";
        document.getElementById('mnu_hosting').style.backgroundImage = "url('images/mnu_green_bg.gif')";

	document.getElementById('mnu_login').style.backgroundImage = "url('images/mnu_green_bg_hover.gif')";

	var mnu = "<table width=100% cellpadding=0 cellspacing=0>";
	mnu += "<tr><td onclick=\"window.open(\'http://www.nexus.co.za/billing\'); mnuPopUp_Hide();\" height=25 width=100% class=mnubtn_td align=left>&nbsp;<img src=images/mnu_cp.png width=20 height=21 align=absmiddle>&nbsp;&nbsp;Customer Control Panel</td></tr>";
	mnu += "<tr><td onclick=\"window.open(\'https://zeus.nexus.co.za:8443'); mnuPopUp_Hide();\" height=25 width=100% class=mnubtn_td align=left>&nbsp;<img src=images/mnu_linux.png width=20 height=20 align=absmiddle>&nbsp;&nbsp;Linux Hosting Panel</td></tr>";
	mnu += "<tr><td onclick=\"window.open(\'https://apollo.nexus.co.za:8443'); mnuPopUp_Hide();\" height=25 width=100% class=mnubtn_td align=left>&nbsp;<img src=images/mnu_win.png width=18 height=18 align=absmiddle>&nbsp;&nbsp;Windows Hosting Panel</td></tr>";
	mnu += "<tr><td onclick=\"window.open(\'http://webmail.nexus.co.za\'); mnuPopUp_Hide();\" height=25 width=100% class=mnubtn_td align=left>&nbsp;<img src=images/mnu_webmail.png width=18 height=18 align=absmiddle>&nbsp;&nbsp;Global Webmail Login</td></tr>";
	mnu += "</table>";

        mnuPopUp_Show(mnu, 'mnu_login');
	
}

function mnuHostingShow() {

        mnu_selected = true;

        document.getElementById('mnu_adsl').style.backgroundImage = "url('images/mnu_green_bg.gif')";
        document.getElementById('mnu_login').style.backgroundImage = "url('images/mnu_green_bg.gif')";

        document.getElementById('mnu_hosting').style.backgroundImage = "url('images/mnu_green_bg_hover.gif')";

        var mnu = "<table width=100% cellpadding=0 cellspacing=0>";
        mnu += "<tr><td onclick=\"top.location=\'hosting.html\'; mnuPopUp_Hide();\" height=25 width=100% class=mnubtn_td align=left>&nbsp;<img src=images/mnu_linux.png width=20 height=20 align=absmiddle>&nbsp;&nbsp;Linux Web Hosting</td></tr>";
        mnu += "<tr><td onclick=\"top.location=\'winhosting.html\'; mnuPopUp_Hide();\" height=25 width=100% class=mnubtn_td align=left>&nbsp;<img src=images/mnu_win.png width=18 height=18 align=absmiddle>&nbsp;&nbsp;Windows Web Hosting</td></tr>";
        mnu += "</table>";

        mnuPopUp_Show(mnu, 'mnu_hosting');

}

function mnuAdslShow() {

        mnu_selected = true;

        document.getElementById('mnu_hosting').style.backgroundImage = "url('images/mnu_green_bg.gif')";
        document.getElementById('mnu_login').style.backgroundImage = "url('images/mnu_green_bg.gif')";

	document.getElementById('mnu_adsl').style.backgroundImage = "url('images/mnu_green_bg_hover.gif')";

        var mnu = "<table width=100% cellpadding=0 cellspacing=0>";

	mnu += "<tr><td align=left onclick=\"top.location=\'dslexplained.html\'; mnuPopUp_Hide();\" width=100% class=mnubtn_td onmouseover=\"smnuHide();\">&nbsp;<img src=images/mnu_guide.png width=20 height=20 align=absmiddle>&nbsp;&nbsp;Need Help? ADSL Guide</td></tr>";

	mnu += "<tr height=3><td height=3 width=100% align=center background=images/menu/mnu_sep.gif onmouseover=\"smnuHide();\"></td></tr>";

		mnu += "<tr><td align=left onclick=\"top.location=\'bundles.html\'; mnuPopUp_Hide();\" onmouseover=\"smnuHide();\" width=100% class=mnubtn_td>&nbsp;<img src=images/mnu_bundle.png width=20 height=20 align=absmiddle>&nbsp;&nbsp;Bundles (ADSL Line + Data)</td></tr>";

		mnu += "<tr><td align=left onclick=\"top.location=\'prepaid.html\'; mnuPopUp_Hide();\" width=100% class=mnubtn_td onmouseover=\"smnuHide();\">&nbsp;<img src=images/mnu_prepaid.png width=20 height=20 align=absmiddle>&nbsp;&nbsp;Prepaid Data</td></tr>";

		mnu += "<tr><td align=left width=100% class=mnubtn_td id=mnubtn_STU onmouseover=\"smnuSTUShow();\" onmouseout=\"PopUp_Hide();\" nowrap><table cellspacing=0 cellpadding=0 border=0><tr><td width=100%>&nbsp;<img src=images/mnu_cap.png width=20 height=20 align=absmiddle>&nbsp;&nbsp;Monthly Cap</td><td align=right width=20><img align=absmiddle src=images/menu/mnuarrow.gif></td></tr></table></td></tr>";

		mnu += "<tr><td align=left width=100% class=mnubtn_td id=mnubtn_UC onmouseover=\"smnuUCShow();\" onmouseout=\"PopUp_Hide();\" nowrap><table cellspacing=0 cellpadding=0 border=0><tr><td width=100%>&nbsp;<img src=images/mnu_uncapped.png width=20 height=20 align=absmiddle>&nbsp;&nbsp;Uncapped</td><td align=right width=20><img align=absmiddle src=images/menu/mnuarrow.gif></td></tr></table></td></tr>";

	mnu += "<tr height=3><td height=3 width=100% align=center background=images/menu/mnu_sep.gif onmouseover=\"smnuHide();\"></td></tr>";

        mnu += "<tr><td align=left onclick=\"top.location=\'adsllines.html\'; mnuPopUp_Hide();\" onmouseover=\"smnuHide();\" width=100% class=mnubtn_td>&nbsp;<img src=images/mnu_net.png width=20 height=20 align=absmiddle>&nbsp;&nbsp;ADSL Line Rental</td></tr>";

//	mnu += "<tr height=3><td height=3 width=100% align=center background=images/menu/mnu_sep.gif onmouseover=\"smnuHide();\"></td></tr>";

//	mnu += "<tr><td align=left onclick=\"top.location=\'modems.html\'; mnuPopUp_Hide();\" onmouseover=\"smnuHide();\" width=100% class=mnubtn_td>&nbsp;<img src=images/mnu_modem.png width=20 height=20 align=absmiddle>&nbsp;&nbsp;ADSL Modems & Routers</td></tr>";

        mnu += "</table>";

        mnuPopUp_Show(mnu, 'mnu_adsl');

}

function smnuSTUShow() {

        smnu_selected = true;

        var smnu = "<table width=100% cellpadding=0 cellspacing=0>";
	smnu += "<tr><td onclick=\"top.location=\'lite.html\'; mnuPopUp_Hide();\" onmouseout=\"PopUp_Hide();\" width=100% class=mnubtn_td align=left>&nbsp;<img src=images/mnu_cap.png width=20 height=20 align=absmiddle>&nbsp;&nbsp;Lite</td></tr>";
        smnu += "<tr><td onclick=\"top.location=\'adsl.html\'; mnuPopUp_Hide();\" onmouseout=\"PopUp_Hide();\" width=100% class=mnubtn_td align=left>&nbsp;<img src=images/mnu_cap.png width=20 height=20 align=absmiddle>&nbsp;&nbsp;Standard</td></tr>";
//	smnu += "<tr><td onclick=\"top.location=\'semishaped.html\'; mnuPopUp_Hide();\" onmouseout=\"PopUp_Hide();\" width=100% class=mnubtn_td align=left>&nbsp;<img src=images/mnu_cap.png width=20 height=20 align=absmiddle>&nbsp;&nbsp;Semi-Shaped ADSL</td></tr>";	
	smnu += "<tr><td onclick=\"top.location=\'unshaped.html\'; mnuPopUp_Hide();\" onmouseout=\"PopUp_Hide();\" width=100% class=mnubtn_td align=left>&nbsp;<img src=images/mnu_cap.png width=20 height=20 align=absmiddle>&nbsp;&nbsp;Unshaped</td></tr>";
	smnu += "<tr><td onclick=\"top.location=\'localonly.html\'; mnuPopUp_Hide();\" onmouseout=\"PopUp_Hide();\" width=100% class=mnubtn_td align=left>&nbsp;<img src=images/mnu_cap.png width=20 height=20 align=absmiddle>&nbsp;&nbsp;Local Only</td></tr>";
        smnu += "</table>";

        smnuPopUp_Show(smnu, 'STU');

}

function smnuUCShow() {

        smnu_selected = true;

        var smnu = "<table width=100% cellpadding=0 cellspacing=0>";
	smnu += "<tr><td onclick=\"top.location=\'uncappedhome.html\'; mnuPopUp_Hide();\" onmouseout=\"PopUp_Hide();\" width=100% class=mnubtn_td align=left>&nbsp;<img src=images/mnu_uncapped.png width=20 height=20 align=absmiddle>&nbsp;&nbsp;Home Uncapped</td></tr>";
//	smnu += "<tr><td onclick=\"top.location=\'uncappedexp.html\'; mnuPopUp_Hide();\" onmouseout=\"PopUp_Hide();\" width=100% class=mnubtn_td align=left>&nbsp;<img src=images/mnu_uncapped.png width=20 height=20 align=absmiddle>&nbsp;&nbsp;Standard Uncapped</td></tr>";
        smnu += "<tr><td onclick=\"top.location=\'uncapped.html\'; mnuPopUp_Hide();\" onmouseout=\"PopUp_Hide();\" width=100% class=mnubtn_td align=left>&nbsp;<img src=images/mnu_uncapped.png width=20 height=20 align=absmiddle>&nbsp;&nbsp;Business Uncapped</small></td></tr>";
        smnu += "</table>";

        smnuPopUp_Show(smnu, 'UC');

}

function mnuHide() {  

mnuPopUp_Hide();
smnuPopUp_Hide();

}

function smnuHide() {

smnuPopUp_Hide();
document.getElementById("mnubtn_STU").style.border = '1px solid #FFFFFF';
document.getElementById("mnubtn_STU").style.color = '#626262';
document.getElementById("mnubtn_UC").style.border = '1px solid #FFFFFF';
document.getElementById("mnubtn_UC").style.color = '#626262';

}

function smnuPopUp_Show(body, mnui) {

	smnuHide();

        if(mnui == "STU") {
		smnu_x = 394;
		smnu_y = 233;
	        document.getElementById("mnubtn_STU").style.border = 1 + 'px solid #519f11';
        	document.getElementById("mnubtn_STU").style.color = '#46b030';
	}


        if(mnui == "UC") {
                smnu_x = 394;
                smnu_y = 263;
                document.getElementById("mnubtn_UC").style.border = 1 + 'px solid #519f11';
                document.getElementById("mnubtn_UC").style.color = '#46b030';
        }
	

        var poper = document.getElementById("smnu_popup");
        document.getElementById("smnu_body").innerHTML = body;
        poper.style.top = smnu_y + 'px';
        mySpanDim = getDim(document.getElementById("nexus_menu"));
        poper.style.left = (mySpanDim.x + smnu_x - document.getElementById('smnu_tbl').width) + 'px';
        poper.style.display = "block";


}


function mnuPopUp_Show(body, mnui) {

        if(mnui == "mnu_login") mnu_x = 683;
	if(mnui == "mnu_hosting") mnu_x = 369;
        if(mnui == "mnu_adsl") mnu_x = 207;

        var poper = document.getElementById("mnu_popup");
        document.getElementById("mnu_body").innerHTML = body;
	poper.style.top = 137 + 'px';
	mySpanDim = getDim(document.getElementById(mnui));
	
	var myx = mySpanDim.x - 1;
	poper.style.left = myx + 'px';	
	poper.style.display = "block";

}

function smnuPopUp_Hide() { document.getElementById("smnu_popup").style.display = 'none'; }
function smnuHide_() { document.getElementById("smnu_popup").style.display = 'none'; }

function mnuPopUp_Hide() { 
	if(mnu_selected==false) { 
		document.getElementById("mnu_popup").style.display = 'none';
		document.getElementById("smnu_popup").style.display = 'none'; 
	} 
}
function mnuHide_() { 
	document.getElementById("mnu_popup").style.display = 'none';
	document.getElementById("smnu_popup").style.display = 'none'; 
	document.getElementById('mnu_adsl').style.backgroundImage = "url('images/mnu_green_bg.gif')";
	document.getElementById('mnu_hosting').style.backgroundImage = "url('images/mnu_green_bg.gif')";
	document.getElementById('mnu_login').style.backgroundImage = "url('images/mnu_green_bg.gif')";
}

function getDim(el){
        for (var lx=0,ly=0;el!=null;
                lx+=el.offsetLeft,ly+=el.offsetTop,el=el.offsetParent);
        return {x:lx,y:ly}
}


document.write ("<div style='display:none; position:absolute' id='mnu_popup' onmouseover='mnu_selected=true;' onmouseout='mnu_selected=false;'>");
document.write ("<table id=mnu_tbl border=0 cellspacing=0 cellpadding=0 width=210>");
document.write ("<tr><td background=images/menu/smnu_left.gif width=7><img width=7 src=images/menu/smnu_left.gif></td><td bgcolor=#FFFFFF width=196><table border=0 cellspacing=0 cellpadding=3 style='font-family:tahoma; font-size:10px; color:#818181' width=100%><tr><td width=100% align=center><span id=mnu_body></span></td></tr></table></td><td width=1 background=images/menu/smnu_right.gif><img src=images/menu/smnu_right.gif></td></tr>");
document.write ("<tr><td><img src=images/menu/smnu_blc.gif border=0></td><td background=images/menu/smnu_bottom.gif></td><td><img src=images/menu/smnu_brc.gif></td></tr>");
document.write ("</table></div>");

document.write ("<div style='display:none; position:absolute' id='smnu_popup' onmouseover='smnu_selected=true;' onmouseout='smnu_selected=false;'>");
document.write ("<table id=smnu_tbl border=0 cellspacing=0 cellpadding=0 width=150>");
document.write ("<tr><td colspan=3 background=images/menu/mnu_sides.gif><img src=images/menu/mnu_sides.gif></td></tr>");
document.write ("<tr valign=top><td background=images/menu/smnu_left.gif><img src=images/menu/mnu_space.gif width=2 height=28></td><td bgcolor=#FFFFFF width=198><table border=0 cellspacing=0 cellpadding=3 style='font-family:tahoma; font-size:10px; color:#818181;padding-top:0px;' width=100%><tr><td width=100% align=center><span id=smnu_body></span></td></tr></table></td><td background=images/menu/smnu_right.gif><img src=images/menu/smnu_right.gif></td></tr>");
document.write ("<tr><td><img src=images/menu/smnu_blc.gif border=0></td><td background=images/menu/smnu_bottom.gif></td><td><img src=images/menu/smnu_brc.gif></td></tr>");
document.write ("</table></div>");

document.write ("<div style='display:none;'><img src=images/mnu_linux.png><img src=images/mnu_win.png><img src=images/mnu_net.png><img src=images/mnu_prepaid.png><img src=images/mnu_cap.png><img src=images/mnu_uncapped.png><img src=images/mnu_cp.png><img src=images/mnu_bundle.png><img src=images/mnu_guide.png><img src=images/mnu_modem.png><img src=images/mnu_green_bg.gif><img src=images/mnu_green_bg_hover.gif></div>");

