var mnu_selected, smnu_selected;

function mnuLoginShow() {
	
	mnu_selected = true;

	var mnu = "<table width=100% cellpadding=0 cellspacing=0>";
	mnu += "<tr><td onclick=\"window.open(\'http://www.nexus.co.za/billing\'); mnuPopUp_Hide();\" height=20 width=100% class=mnubtn_td align=center>Customer 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=center>Linux 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=center>Windows Panel</td></tr>";
	mnu += "<tr><td onclick=\"window.open(\'http://webmail.nexus.co.za\'); mnuPopUp_Hide();\" height=25 width=100% class=mnubtn_td align=center>Webmail Login</td></tr>";
	mnu += "</table>";

        mnuPopUp_Show(mnu, 'Login');
	
}

function mnuAdslShow() {

        mnu_selected = true;

        var mnu = "<table width=100% cellpadding=0 cellspacing=0>";

	mnu += "<tr><td onclick=\"top.location=\'dslexplained.html\'; mnuPopUp_Hide();\" width=100% class=mnubtn_td align=center onmouseover=\"smnuHide();\">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 height=3 width=100% align=center><div style='padding-top:3px;padding-bottom:2px;' onmouseover=\"smnuHide();\"><b>Data Packages</b></div></td></tr>";

	mnu += "<tr><td onclick=\"top.location=\'prepaid.html\'; mnuPopUp_Hide();\" width=100% class=mnubtn_td align=center onmouseover=\"smnuHide();\">Prepaid</td></tr>";

        mnu += "<tr><td width=100% class=mnubtn_td id=mnubtn_STU align=center onmouseover=\"smnuSTUShow();\" onmouseout=\"PopUp_Hide();\" nowrap><img src=images/menu/mnu_space.gif width=17 height=22 align=absmiddle>Monthly Cap<img src=images/menu/mnu_space.gif width=10 height=22 align=absmiddle><img align=absmiddle src=images/menu/mnuarrow.gif><img src=images/menu/mnu_space.gif width=3 height=22 align=absmiddle></td></tr>";

	mnu += "<tr><td width=100% class=mnubtn_td id=mnubtn_UC align=center onmouseover=\"smnuUCShow();\" onmouseout=\"PopUp_Hide();\"><img src=images/menu/mnu_space.gif width=22 height=22 align=absmiddle>Uncapped<img src=images/menu/mnu_space.gif width=14 height=22 align=absmiddle><img align=absmiddle src=images/menu/mnuarrow.gif><img src=images/menu/mnu_space.gif width=3 height=22 align=absmiddle></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 width=100% align=center><div style='padding-top:3px;padding-bottom:2px;' onmouseover=\"smnuHide();\"><b>Lines & Bundles</b></div></td></tr>";

        mnu += "<tr><td onclick=\"top.location=\'adsllines.html\'; mnuPopUp_Hide();\" onmouseover=\"smnuHide();\" width=100% class=mnubtn_td align=center>Line Rental</td></tr>";

	mnu += "<tr><td onclick=\"top.location=\'bundles.html\'; mnuPopUp_Hide();\" onmouseover=\"smnuHide();\" width=100% class=mnubtn_td align=center>Bundles</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 width=100% align=center><div style='padding-top:3px;padding-bottom:2px;' onmouseover=\"smnuHide();\"><b>Hardware</b></div></td></tr>";

	mnu += "<tr><td onclick=\"top.location=\'modems.html\'; mnuPopUp_Hide();\" onmouseover=\"smnuHide();\" width=100% class=mnubtn_td align=center>Modems & Routers</td></tr>";

        mnu += "</table>";

        mnuPopUp_Show(mnu, 'ADSL');

}

function smnuSTUShow() {

        smnu_selected = true;

        var smnu = "<table width=100% cellpadding=0 cellspacing=0>";
        smnu += "<tr><td onclick=\"top.location=\'adsl.html\'; mnuPopUp_Hide();\" onmouseout=\"PopUp_Hide();\" width=100% class=mnubtn_td align=center><table style='line-height:11px;padding:3px;' cellspacing=2 cellpadding=0><tr align=center><td>Shaped</td></tr></table></td></tr>";
	smnu += "<tr><td onclick=\"top.location=\'semishaped.html\'; mnuPopUp_Hide();\" onmouseout=\"PopUp_Hide();\" width=100% class=mnubtn_td align=center><table style='line-height:11px;padding:3px;' cellspacing=2 cellpadding=0><tr align=center><td>Semi-Shaped</td></tr></table></td></tr>";	
	smnu += "<tr><td onclick=\"top.location=\'unshaped.html\'; mnuPopUp_Hide();\" onmouseout=\"PopUp_Hide();\" width=100% class=mnubtn_td align=center><table style='line-height:11px;padding:3px;' cellspacing=2 cellpadding=0><tr align=center><td>Unshaped</td></tr></table></td></tr>";
	smnu += "<tr><td onclick=\"top.location=\'localonly.html\'; mnuPopUp_Hide();\" onmouseout=\"PopUp_Hide();\" width=100% class=mnubtn_td align=center><table style='line-height:11px;padding:3px;' cellspacing=2 cellpadding=0><tr align=center><td>Local Only <small>(SAIX)</small></td></tr></table></td></tr>";
	smnu += "<tr><td onclick=\"top.location=\'isdsl.html\'; mnuPopUp_Hide();\" onmouseout=\"PopUp_Hide();\" width=100% class=mnubtn_td align=center><table style='line-height:11px;padding:3px;' cellspacing=2 cellpadding=0><tr align=center><td>Local Only <small>(IS)</small></td></tr></table></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=center>Home <small>(Dynamic IP)</small></td></tr>";
	smnu += "<tr><td onclick=\"top.location=\'uncappedexp.html\'; mnuPopUp_Hide();\" onmouseout=\"PopUp_Hide();\" width=100% class=mnubtn_td align=center>Standard <small>(Dynamic IP)</small></td></tr>";
        smnu += "<tr><td onclick=\"top.location=\'uncapped.html\'; mnuPopUp_Hide();\" onmouseout=\"PopUp_Hide();\" width=100% class=mnubtn_td align=center>Business <small>(Static IP)</small></td></tr>";
        smnu += "</table>";

        smnuPopUp_Show(smnu, 'UC');

}


function mnuHostingShow() {

        mnu_selected = true;

        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=center>Linux Hosting</td></tr>";
	//mnu += "<tr><td height=3 width=100% align=center background=images/menu/mnu_sep.gif></td></tr>";
	mnu += "<tr><td onclick=\"top.location=\'winhosting.html\'; mnuPopUp_Hide();\" height=25 width=100% class=mnubtn_td align=center>Windows Hosting</td></tr>";
        mnu += "</table>";

        mnuPopUp_Show(mnu, 'Hosting');

}

function mnuSupportShow() {

        mnu_selected = true;

        var mnu = "<table width=100% cellpadding=0 cellspacing=0>";
	mnu += "<tr><td onclick=\"window.open(\'http://www.nexus.co.za/livehelp/index.php\'); mnuPopUp_Hide();\" height=25 width=100% class=mnubtn_td align=center>LiveHelp</td></tr>";
	mnu += "<tr><td onclick=\"window.open(\'http://www.nexus.co.za/billing\'); mnuPopUp_Hide();\" height=25 width=100% class=mnubtn_td align=center>Support Ticket</td></tr>";
	mnu += "<tr><td onclick=\"top.location=\'contacts.html\'; mnuPopUp_Hide();\" height=25 width=100% class=mnubtn_td align=center>Contact Us</td></tr>";
        mnu += "</table>";

        mnuPopUp_Show(mnu, 'Support');

}


function mnuHomeShow() {

        mnu_selected = true;

	var mnu = "<table width=100% cellpadding=0 cellspacing=0>";
        mnu += "<tr><td onclick=\"top.location=\'index.html\'; mnuPopUp_Hide();\" width=100% class=mnubtn_td align=center>Main Page</td></tr>";
	mnu += "<tr><td onclick=\"top.location=\'contacts.html\'; mnuPopUp_Hide();\" height=25 width=100% class=mnubtn_td align=center>About Us</td></tr>";
	mnu += "</table>";

        mnuPopUp_Show(mnu, 'Home');

}


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 = 436 + 151;
		smnu_y = 153; //141;
	        document.getElementById("mnubtn_STU").style.border = 1 + 'px solid #519f11';
        	document.getElementById("mnubtn_STU").style.color = '#46b030';
	}


        if(mnui == "UC") {
                smnu_x = 436 + 151;
                smnu_y = 179; //167;
                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 == "Login") mnu_x = 775;
        if(mnui == "Support") mnu_x = 662;
	if(mnui == "Hosting") mnu_x = 549;
        if(mnui == "ADSL") mnu_x = 436;
        if(mnui == "Home") mnu_x = 323;

        var poper = document.getElementById("mnu_popup");
        document.getElementById("mnu_body").innerHTML = body;
	poper.style.top = 94 + 'px';
	mySpanDim = getDim(document.getElementById("nexus_menu"));
	poper.style.left = (mySpanDim.x + mnu_x - document.getElementById('mnu_tbl').width) + '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'; }

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=104>");
document.write ("<tr><td colspan=3><img src=images/menu/mnu_top.gif border=0></td></tr>");
document.write ("<tr><td background=images/menu/mnu_sides.gif><img src=images/menu/mnu_sides.gif></td><td bgcolor=#FFFFFF width=102><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/mnu_sides.gif><img src=images/menu/mnu_sides.gif></td></tr>");
document.write ("<tr><td colspan=3><img src=images/menu/mnu_bottom.gif border=0></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=156>");
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=24></td><td bgcolor=#FFFFFF width=100%><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=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>");
