function abaAtiva(aba,filtro){
	aba = document.getElementById(aba);
	aba.style.backgroundColor = "#ffff99";
	aba.style.borderTop = "1px solid #000000";
	aba.style.borderRight = "1px solid #000000";
	aba.style.borderLeft = "1px solid #000000";
	
	if(filtro == null)
		aba.style.borderBottom = "1px solid #ffff99";
	else
		aba.style.borderBottom = "1px solid #000000";
	
}

function highlightTableRows(tableId,colunaLink,colInicial,colFinal) {
    var previousClass = null;
    var table = document.getElementById(tableId); 
    var tbody = table.getElementsByTagName("tbody")[0];
    var rows = tbody.getElementsByTagName("tr");
    // add event handlers so rows light up and are clickable
    for (i=0; i < rows.length; i++) {
		
		var corFundo;
		
        rows[i].onmouseover = function() {
			
			corFundo = this.style.backgroundColor;
			
			this.style.backgroundColor = "#FFFF99"; this.style.cursor = "pointer";
				
				for(j=colInicial; j <= colFinal; j++){
					cells = this.getElementsByTagName("td");
					celLink = cells[colunaLink];
					alink = celLink.getElementsByTagName("a")[0];
						
					cells[j].onclick = function(){
						//var cell = celLink;
						if (celLink.getElementsByTagName("a").length > 0) {
							
							if (alink.onclick) {
								call = alink.getAttributeValue("onclick");
								// this will not work for links with onclick handlers that return false
								eval(call);
							} else {
							  location.href = alink.getAttribute("href");
							}
							this.style.cursor="wait";
						}
					}
				}
			};

		rows[i].onmouseout = function() { this.style.backgroundColor = corFundo; };
        /*
		rows[i].onclick = function() {
            var cell = this.getElementsByTagName("td")[colunaLink];
            if (cell.getElementsByTagName("a").length > 0) {
                var link = cell.getElementsByTagName("a")[0];
                if (link.onclick) {
                    call = link.getAttributeValue("onclick");
                    // this will not work for links with onclick handlers that return false
                    eval(call);
                } else {
                  location.href = link.getAttribute("href");
                }
                this.style.cursor="wait";
            }
        }
		*/
    }
}

// Show the document's title on the status bar
window.defaultStatus=document.title;