function mocMenu(sLay,sLnk,nDelay,nPx,nPy) {
	this.lay	= sLay;
	this.lnk	= sLnk;
	this.delay	= nDelay;
	this.posx	= nPx;
	this.posy	= nPy;
	this.status	= 1;
	var oLnk	= new mocLnk(this.lnk,this.lay);
	var oLay	= new mocLay(this.lay,this.lnk,nPx,nPy,this.delay);
	oLnk.obj.onmouseover = function() { oLay.setStatus(1); }
	oLnk.obj.onmouseout = function() { oLay.setStatus(0); }
	oLay.obj.onmouseout = function() { oLay.setStatus(0); }
	oLay.obj.onmouseover = function() { oLay.setStatus(1); }}
function mocLnk(sLnk,sLay) { 
	this.obj	= document.getElementById(sLnk);
	this.objN	= sLnk;
	this.oLay	= document.getElementById(sLay);
	with(this.oLay.style) {position = "absolute";visibility="hidden";}
	with(this.obj.style) {display="block";}
	this.getPy = function() {
		return findPosY(this.obj);}
	this.getPx = function() {
		return findPosX(this.obj);}}
function mocLay(sLay,sLnk,nPx,nPy,nDelay) {
	this.obj	= document.getElementById(sLay);
	this.objN	= sLay;
	this.oLnk	= document.getElementById(sLnk);
	this.nPx	= nPx;
	this.nPy	= nPy;
	this.timer	= 0;
	this.delay	= nDelay;
	this.getPy = function() {return findPosY(this.obj);}
	this.getPx = function() {return findPosX(this.obj);}
	this.setStatus = function(bVar) {
		this.setPos(); 
		if(bVar) { this.setTimer(0); }
		else { this.setTimer(1); }}
	this.getStatus = function() {
		var tmp = this.obj.style.visibility;
		if(tmp=="hidden") return 0; else return 1;
	}
	this.setPos = function() {
		var py = findPosY(this.oLnk);
		var px = findPosX(this.oLnk);
		with(this.obj.style) { top=eval(py+this.nPy)+"px"; left=eval(px+this.nPx)+"px"; }}
	this.setTimer = function(bVar) {
		var tmp = this.objN.toString(); 
		if(bVar) { this.timer = setTimeout("setHidden('"+this.objN+"')",this.delay) }
		else { if(this.timer) clearTimeout(this.timer);  this.obj.style.visibility = "visible";}}}
function setHidden(sObjName) {document.getElementById(sObjName).style.visibility="hidden";}
function findPosX(obj) {
	var curleft = 0;
	if (obj.offsetParent) {
		while (obj.offsetParent) {
			curleft += obj.offsetLeft;
			obj = obj.offsetParent;}}
	else if (obj.x) curleft += obj.x;
	return curleft;}
function findPosY(obj){	var curtop = 0;
	var printstring = '';
	if (obj.offsetParent) {
		while (obj.offsetParent) {
			curtop += obj.offsetTop;
			obj = obj.offsetParent;}}
	else if (obj.y) curtop += obj.y;
	window.status = printstring;
	return curtop;
}function getObj(name) {
  if (document.getElementById)  {
  	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }else if (document.all) {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }else if (document.layers) {
	this.obj = getObjNN4(document,name);
	this.style = this.obj;}}
function getObjNN4(obj,name) {
	var x = obj.layers;
	var foundLayer;
	for (var i=0;i<x.length;i++) {
		if (x[i].id == name)
			foundLayer = x[i];
		else if (x[i].layers.length)
			var tmp = getObjNN4(x[i],name);
		if (tmp) foundLayer = tmp;
	}return foundLayer;}










function changeImage (strTabelaId, strDivId) {
		
		var arrTbs = document.body.getElementsByTagName("TD");
        for ( i=0; i<arrTbs.length; i++ ) {
            if ( arrTbs[i].id.indexOf("table_open_close_") != -1 ) {
                arrTbs[i].className = "fechado";
            }
        }
        var objTb  = document.getElementById(strTabelaId);
        objTb.className = "tbl_ch";
        
        var arrDivs = document.body.getElementsByTagName("TD");
        for ( i=0; i<arrDivs.length; i++ ) {
            if ( arrDivs[i].id.indexOf("table_tit_item_") != -1 ) {
                arrDivs[i].className = "aba_of";
            }
        }
        var objDiv  = document.getElementById(strDivId);
        objDiv.className = "aba_on";
        
}

function changeImage2 (strTabelaId, strDivId) {
		
		var arrTbs = document.body.getElementsByTagName("TABLE");
        for ( i=0; i<arrTbs.length; i++ ) {
            if ( arrTbs[i].id.indexOf("table_open_close_") != -1 ) {
                arrTbs[i].className = "fechado";
            }
        }
        var objTb  = document.getElementById(strTabelaId);
        objTb.className = "tbl_ch";
        
        var arrDivs = document.body.getElementsByTagName("TABLE");
        for ( i=0; i<arrDivs.length; i++ ) {
            if ( arrDivs[i].id.indexOf("table_tit_item_") != -1 ) {
                arrDivs[i].className = "aba_of";
            }
        }
        var objDiv  = document.getElementById(strDivId);
        objDiv.className = "aba_on";
        
}


function changeBaloes (strTabelaId) {
        var objTb  = document.getElementById(strTabelaId);
 		if (objTb.className  == "balao_dhtml") {
			objTb.className  = "balao_fechado";
		}
		
}

function overBaloes (strTabelaId) {
        var objTb  = document.getElementById(strTabelaId);
 		if (objTb.className  == "balao_fechado") {
			objTb.className  = "balao_dhtml";
		}
		
}

