var strAux = "";
var opMenuSuper="";

// Goto destino na home principal
document.write("<form name='frmdefault' method='post' action='index.jsp'>");
document.write("<input type='hidden' name='c' value='0'>");
document.write("<input type='hidden' name='d' value='0'>");
document.write("<input type='hidden' name='r' value='0'>");
document.write("<input type='hidden' name='a' value=''>");
document.write("<input type='hidden' name='lgName' value=''>");
document.write("<input type='hidden' name='lgPass' value=''>");
document.write("</form>");

// Goto destino na home principal
function gotod(destino) {
		document.frmdefault.d.value=destino;
		document.frmdefault.a.value='';
		document.frmdefault.c.value=0;
		// Se for webmail
		if (destino==53) {
    		document.frmdefault.lgName.value=document.frmwebmail.lgName.value;
    		document.frmdefault.lgPass.value=document.frmwebmail.lgPass.value;
		}
		
		document.frmdefault.submit()
}

function gotoc(destino,conc) {
		document.frmdefault.d.value=destino;
		document.frmdefault.a.value='';
		document.frmdefault.c.value=conc;
		// Se for webmail
		if (destino==53) {
    		document.frmdefault.lgName.value=document.frmwebmail.lgName.value;
    		document.frmdefault.lgPass.value=document.frmwebmail.lgPass.value;
		}
		if ((destino<10)||(destino >1999)) {
    		document.frmdefault.action='../index.jsp';
		}
		
		document.frmdefault.submit()
}

function gotoa(destino) {
		document.frmdefault.a.value=destino;
		document.frmdefault.c.value=0;
		// Se for webmail
		if (destino==110) {
    		document.frmdefault.lgName.value=document.frmwebmail.lgName.value;
    		document.frmdefault.lgPass.value=document.frmwebmail.lgPass.value;
		}
		document.frmdefault.submit()
}

function MenuVert(item) {
         opMenuSuper=item;
		 if (item==9) {
		   formmenu.action="sair.jsp";
		 } else {
           formmenu.opMenuSuper.value=item;
		 }
         formmenu.submit()
}

function MenuSuper(item) {
    strAux = "";
//    strAux += "<Table class='fMenu' width='100%' align='center' border=2 frame='vsides'>";
//    strAux += "<TR><TD>";
    if(item=="1") {
//        strAux += "    <th align='center' bgcolor='blue' width='10%' ><A href='JavaScript:MenuVert(1)' class='lMenu'>IPTU</a></th>";
        strAux += "    <input type='button' class='btnMnuVertB' onClick='JavaScript:MenuVert(1)' value='IPTU'>";
    } else {
//        strAux += "    <th align='center' bgcolor='red' width='10%' ><A href='JavaScript:MenuVert(1)' class='lMenu'>IPTU</a></th>";
        strAux += "    <input type='button' class='btnMnuVertR' onClick='JavaScript:MenuVert(1)' value='IPTU'>";
    }
    if(item=="2") {
//        strAux += "    <th align='center' bgcolor='blue' width='10%' ><A href='JavaScript:MenuVert(2)' class='lMenu'>ISS-Empresa</a></th>";
        strAux += "    <input type='button' class='btnMnuVertB' onClick='JavaScript:MenuVert(2)' value='ISS-Empresa'>";
    } else {
//        strAux += "    <th align='center' bgcolor='red' width='10%' ><A href='JavaScript:MenuVert(2)' class='lMenu'>ISS-Empresa</a></th>";
        strAux += "    <input type='button' class='btnMnuVertR' onClick='JavaScript:MenuVert(2)' value='ISS-Empresa'>";
    }
    if(item=="3") {
//        strAux += "    <th align='center' bgcolor='blue' width='10%' ><A href='JavaScript:MenuVert(3)' class='lMenu'>ISS-Autônomo</a></th>";
        strAux += "    <input type='button' class='btnMnuVertB' onClick='JavaScript:MenuVert(3)' value='ISS-Autônomo'>";
    } else {
//        strAux += "    <th align='center' bgcolor='red' width='10%' ><A href='JavaScript:MenuVert(3)' class='lMenu'>ISS-Autônomo</a></th>";
        strAux += "    <input type='button' class='btnMnuVertR' onClick='JavaScript:MenuVert(3)' value='ISS-Autônomo'>";
    }
    if(item=="4") {
//        strAux += "    <th align='center' bgcolor='blue' width='10%' ><A href='JavaScript:MenuVert(4)' class='lMenu'>Taxas</a></th>";
        strAux += "    <input type='button' class='btnMnuVertB' onClick='JavaScript:MenuVert(4)' value='Taxas'>";
    } else {
//        strAux += "    <th align='center' bgcolor='red' width='10%' ><A href='JavaScript:MenuVert(4)' class='lMenu'>Taxas</a></th>";
        strAux += "    <input type='button' class='btnMnuVertR' onClick='JavaScript:MenuVert(4)' value='Taxas'>";
    }
    if(item=="5") {
//        strAux += "    <th align='center' bgcolor='blue' width='10%' ><A href='JavaScript:MenuVert(5)' class='lMenu'>Atendimento</a></th>";
        strAux += "    <input type='button' class='btnMnuVertB' onClick='JavaScript:MenuVert(5)' value='Atendimento'>";
    } else {
//        strAux += "    <th align='center' bgcolor='red' width='10%' ><A href='JavaScript:MenuVert(5)' class='lMenu'>Atendimento</a></th>";
        strAux += "    <input type='button' class='btnMnuVertR' onClick='JavaScript:MenuVert(5)' value='Atendimento'>";
    }
    if(item=="6") {
//        strAux += "    <th align='center' bgcolor='blue' width='10%' ><A href='JavaScript:MenuVert(8)' class='lMenu'>Tabelas</a></th>";
        strAux += "    <input type='button' class='btnMnuVertB' onClick='JavaScript:MenuVert(6)' value='Tabelas'>";
    } else {
//        strAux += "    <th align='center' bgcolor='red' width='10%' ><A href='JavaScript:MenuVert(8)' class='lMenu'>Tabelas</a></th>";
        strAux += "    <input type='button' class='btnMnuVertR' onClick='JavaScript:MenuVert(6)' value='Tabelas'>";
    }
    if(item=="7") {
//        strAux += "    <th align='center' bgcolor='blue' width='10%' ><A href='JavaScript:MenuVert(6)' class='lMenu'>Utilitários</a></th>";
        strAux += "    <input type='button' class='btnMnuVertB' onClick='JavaScript:MenuVert(7)' value='Utilitários'>";
    } else {
//        strAux += "    <th align='center' bgcolor='red' width='10%' ><A href='JavaScript:MenuVert(6)' class='lMenu'>Utilitários</a></th>";
        strAux += "    <input type='button' class='btnMnuVertR' onClick='JavaScript:MenuVert(7)' value='Utilitários'>";
    }
    if(item=="8") {
//        strAux += "    <th align='center' bgcolor='blue' width='10%' ><A href='JavaScript:MenuVert(7)' class='lMenu'>Downloads</a></th>";
        strAux += "    <input type='button' class='btnMnuVertB' onClick='JavaScript:MenuVert(8)' value='Downloads'>";
    } else {
//        strAux += "    <th align='center' bgcolor='red' width='10%' ><A href='JavaScript:MenuVert(7)' class='lMenu'>Downloads</a></th>";
        strAux += "    <input type='button' class='btnMnuVertR' onClick='JavaScript:MenuVert(8)' value='Downloads'>";
    }
    if(item=="9") {
//        strAux += "    <th align='center' bgcolor='blue' width='10%' ><A href='sair.jsp' class='lMenu'>Sair</a></th>";
        strAux += "    <input type='button' class='btnMnuVertB' onClick='JavaScript:MenuVert(9)' value='Sair'>";
    } else {
//        strAux += "    <th align='center' bgcolor='red' width='10%' ><A href='sair.jsp' class='lMenu'>Sair</a></th>";
        strAux += "    <input type='button' class='btnMnuVertR' onClick='JavaScript:MenuVert(9)' value='Sair'>";
    }
//    strAux += "</TD></TR>";
//    strAux += "</Table>";

    menuSuper.innerHTML = strAux;
    strAux = "";
}

function addMenuO(item,opcao) {
         strAux = "<table border='0' cellspacing='0'><tr><td class='fMenuVert'><a class='vMenu' href='JavaScript:openMenu("+item+")'>"+opcao+" &gt;&gt; </a>"
}

function addMenuC(item,opcao) {
         strAux = "<table border='1' cellspacing='0' bordercolor='red'><tr><td bgcolor='red' class='fMenuVert'>"
         strAux += "<a class='lMenu' href='JavaScript:closeMenu("+item+")'>"+opcao+" &lt;&lt; </a>"
         strAux += "</td></tr>"
         strAux += "<tr><td class='fSubMenuVert'>"
}

function addSubMenu(acao,opcao) {
         strAux += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class='vSubMenu' href='"+acao+"'>"+opcao+"</a><br>"
}

function setMenu(item) {
    strAux += "</td></tr></table>"
    switch ( item ) {
           case 1: menu1.innerHTML = strAux;
                   break;
           case 2: menu2.innerHTML = strAux;
                   break;
           case 3: menu3.innerHTML = strAux;
                   break;
           case 4: menu4.innerHTML = strAux;
                   break;
           case 5: menu5.innerHTML = strAux;
                   break;
    }
    strAux = "";
}

function setCorpo(acao) {
    corpo.innerHTML = "<IFRAME src='"+acao+"' width=300 height=290 left=80 screenX=80 top=50 screenY=50 scrolling='auto' frameborder='0'></IFrame>";
}

function MenuSair() {
    strAux = "    <input type='button' class='btnMnuVertR' onClick='JavaScript:MenuVert(9)' value='Sair'>";
    menuSuper.innerHTML = strAux;
    strAux = "";
}

function linkRealce() {
    if (window.event.srcElement.tagName == "A" ) {
        window.event.srcElement.style.color = "#CC3333";
    }
}

function linkNormal() {
    if (window.event.srcElement.tagName == "A" ) {
        window.event.srcElement.style.color = "#FF6600";
    }
}
