/* INICIO VALIDATE */

/*
==================================================================
LTrim(string) : Returns a copy of a string without leading spaces.
==================================================================
*/
function LTrim(str)
/*
  PURPOSE: Remove leading blanks from our string.
  IN: str - the string we want to LTrim
*/
{
  var whitespace = new String(" \t\n\r");

  var s = new String(str);

  if (whitespace.indexOf(s.charAt(0)) != -1) {
     // We have a string with leading blank(s)...

     var j=0, i = s.length;

     // Iterate from the far left of string until we
     // don't have any more whitespace...
     while (j < i && whitespace.indexOf(s.charAt(j)) != -1)
        j++;

     // Get the substring from the first non-whitespace
     // character to the end of the string...
     s = s.substring(j, i);
  }
  return s;
}

/*
==================================================================
RTrim(string) : Returns a copy of a string without trailing spaces.
==================================================================
*/
function RTrim(str)
/*
  PURPOSE: Remove trailing blanks from our string.
  IN: str - the string we want to RTrim

*/
{
  // We don't want to trip JUST spaces, but also tabs,
  // line feeds, etc.  Add anything else you want to
  // "trim" here in Whitespace
  var whitespace = new String(" \t\n\r");

  var s = new String(str);

  if (whitespace.indexOf(s.charAt(s.length-1)) != -1) {
     // We have a string with trailing blank(s)...

     var i = s.length - 1;       // Get length of string

     // Iterate from the far right of string until we
     // don't have any more whitespace...
     while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)
        i--;


     // Get the substring from the front of the string to
     // where the last non-whitespace character is...
     s = s.substring(0, i+1);
  }

  return s;
}

/*
=============================================================
Trim(string) : Returns a copy of a string without leading or trailing spaces
=============================================================
*/
function Trim(str)
/*
  PURPOSE: Remove trailing and leading blanks from our string.
  IN: str - the string we want to Trim

  RETVAL: A Trimmed string!
*/
{
  return RTrim(LTrim(str));
}


/* Exemplo
function validate()
{


if(Trim(document.frm1.tarea.value)=="")
{
	alert("is null");
}
else
{

	alert("not null");
}
return false;

}
*/

/* FIM VALIDATE */

/* INICIO REMENDAL JAVASCRIPT */
function isArray(a) {
    return isObject(a) && a.constructor == Array;
}
function isBoolean(a) {
    return typeof a == 'boolean';
}
function isEmpty(o) {
    var i, v;
    if (isObject(o)) {
        for (i in o) {
            v = o[i];
            if (isUndefined(v) && isFunction(v)) {
                return false;
            }
        }
    }
    return true;
}
function isFunction(a) {
    return typeof a == 'function';
}
function isNull(a) {
    return typeof a == 'object' && !a;
}
function isNumber(a) {
    return typeof a == 'number' && isFinite(a);
}
function isObject(a) {
    return (a && typeof a == 'object') || isFunction(a);
}
function isString(a) {
    return typeof a == 'string';
}
function isUndefined(a) {
    return typeof a == 'undefined';
}

Function.prototype.method = function (name, func) {
    this.prototype[name] = func;
    return this;
};

Function.method('inherits', function (parent) {
    var d = 0, p = (this.prototype = new parent());
    this.method('uber', function uber(name) {
        var f, r, t = d, v = parent.prototype;
        if (t) {
            while (t) {
                v = v.constructor.prototype;
                t -= 1;
            }
            f = v[name];
        } else {
            f = p[name];
            if (f == this[name]) {
                f = v[name];
            }
        }
        d += 1;
        r = f.apply(this, Array.prototype.slice.apply(arguments, [1]));
        d -= 1;
        return r;
    });
    return this;
});

Function.method('swiss', function (parent) {
    for (var i = 1; i < arguments.length; i += 1) {
        var name = arguments[i];
        this.prototype[name] = parent.prototype[name];
    }
    return this;
});

/* FIM -- REMENDAL JAVASCRIPT */


/* FUNCOES DE MENU */
function globalMouse(td, id, tipo) {
	if(td.className=='globalOn') {
		if(tipo == 'On') {
			td.className='global'+tipo;
		}
	} else {
		td.className='global'+tipo;
	}
}

function menuMouse(td, id, tipo) {
	if(td.className=='menuOn') {
		if(tipo == 'On') {
			td.className='menu'+tipo;
		}
	} else {
		td.className='menu'+tipo;
	}
}

function detectaClick(obj)
{
	if (obj.className == "highlight") obj.className = "par";
	else obj.className = "highlight";
}

function detectaClickAux(obj,obj2)
{
	detectaClick(obj);
	obj2.checked=!obj2.checked;
}



function setRadio(obj,val)
{
	obj = document.getElementById(obj);
	obj.checked=val;
}

/* FUNCOES DE AGUARDAR UM MOMENTO */

function truebody(){
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
}

var contadorMostraAguardeUmMomentoDiv =0;

function MostraAguardeUmMomentoDiv()
{
	contadorMostraAguardeUmMomentoDiv++;
	var ns=(document.layers);
	var ie=(document.all);
	var w3=(document.getElementById && !ie);
	var calunit=ns? "" : "px"
	if (ie)
	{
		documentWidth  =truebody().offsetWidth/2+truebody().scrollLeft-20;
		documentHeight =truebody().offsetHeight/2+truebody().scrollTop-20;
	}else if (ns)
	{
		documentWidth=window.innerWidth/2+window.pageXOffset-20;
		documentHeight=window.innerHeight/2+window.pageYOffset-20;
	}else if (w3)
	{
		documentWidth=self.innerWidth/2+window.pageXOffset-20;
		documentHeight=self.innerHeight/2+window.pageYOffset-20;
	}
	var left = documentWidth-200+calunit;
	var top =documentHeight-200+calunit;
	toggleBox('aguardeUmMomentoDiv',1,left,top);
}


function EscondeAguardeUmMomentoDiv()
{
	contadorMostraAguardeUmMomentoDiv--;
	if(contadorMostraAguardeUmMomentoDiv>0)
		return;
	toggleBox('aguardeUmMomentoDiv',0,false,false);
}

function toggleBox(szDivID, iState,left,top) // 1 visible, 0 hidden
{
    if(document.layers)	   //NN4+
    {
       document.layers[szDivID].visibility = iState ? "show" : "hide";
	   if(left!=false)
		   document.layers[szDivID].left = left;
	   if(top!=false)
		   document.layers[szDivID].left = left;
    }
    else if(document.getElementById)	  //gecko(NN6) + IE 5+
    {
        var obj = document.getElementById(szDivID);
        obj.style.visibility = iState ? "visible" : "hidden";

		if(left!=false)
		   obj.style.left = left;
		if(top!=false)
		   obj.style.left = left;
    }
    else if(document.all)	// IE 4
    {
        document.all[szDivID].style.visibility = iState ? "visible" : "hidden";
		if(left!=false)
		   document.all[szDivID].left = left;
	   if(top!=false)
		   document.all[szDivID].left = left;
    }
}

function popup(url,nome,popupWidth,popupHeight,closeButtonP) // optional parameters: [, statusbar='no']
{
	closeButtonP = (isUndefined(closeButtonP) || isNull(closeButtonP))?false:closeButtonP;
	popupWidth = parseInt(popupWidth);
	popupHeight = parseInt(popupHeight);

	var argv=arguments, wPlus=0, hPlus=0;
	var argc=arguments.length;
	var statusbar=(argc>4) ? argv[4] : 'no';


	if(popupWidth>screen.width-10)
	{
		popupWidth = screen.width-10;
		wPlus = 5;
	}
	if(popupHeight>screen.height-64)
	{
		popupHeight = screen.height-66;
		hPlus = 33;
	}

	var esq = (screen.width/2)-(popupWidth/2)-wPlus;
	var cima = (screen.height/2)-(popupHeight/2)-hPlus;


	if(closeButtonP){
		popupHeight += 25;
		var win  = window.open("",'','width='+popupWidth+',height='+popupHeight+',top='+cima+',left='+esq+',resizable=yes,scrollbars=yes,status='+statusbar);
		if(win){
			var code = "<form><img src="+url+" onclick='window.close()' style='cursor:pointer'>"+
						"<br><br><input type='button' value='Fechar' onclick='javacript:window.close();'></form>";
			win.document.write(code);
		}
	}else{
		var win  = window.open(url,'','width='+popupWidth+',height='+popupHeight+',top='+cima+',left='+esq+',resizable=yes,scrollbars=no,status='+statusbar);
	}
	win.focus();
}

function tooglePasta(id, proprio)
{
	var i=1, j;
	var x;
	var chr, tr;

	for(;;)
	{
		if ((x = document.getElementById(id+i)) != null)
		{
			if (x.style.display == 'none')
			{
				if((id.length == 4) && (id.charAt(3) != "c") && ((img = document.getElementById('img'+id.charAt(3)+i)) != null) && (img.src != mais.src))
				{
					j=1;
					for(;;)
					{
						if ((tr = document.getElementById(id+i+"-"+j)) != null)
						{
							tr.style.display = 'inline';
						} else break;
						j++;
					}
				}
				proprio.src = menos.src;
				x.style.display = 'inline';
			}
			else
			{
				if((id.length == 4) && (id.charAt(3) != "c")) {
					j=1;
					chr = id.charAt(3);
					for(;;)
					{
						if ((tr = document.getElementById(id+i+"-"+j)) != null)
						{
							tr.style.display = 'none';
						} else break;
						j++;
					}
				}
				proprio.src = mais.src;
				x.style.display = 'none';
			}

		} else break;
		i++;
	}
}


function limpaSelecao(nomeform,nomeCheckbox){
	trataSelecaoTodos(nomeform,nomeCheckbox,false);
}

function selecionaTodos(nomeform,nomeCheckbox){
	trataSelecaoTodos(nomeform,nomeCheckbox,true);
}

function trataSelecaoTodos(nomeform,nomeCheckbox,valSel){
	var objAr = document.forms[nomeform].elements[nomeCheckbox];
	if(!isArray(objAr.length)){
		objAr.checked = valSel;
	}else{
		for(var i=0; i<objAr.length;i++){
			objAr[i].checked = valSel;
		}
	}
}


function isAnySelected(nomeform,nomeCheckbox){
	var objAr = document.forms[nomeform].elements[nomeCheckbox];
	var res = false;
	if(isUndefined(objAr) || isNull(objAr)){
		return false;
	}else if(!isArray(objAr.length)){
		res = objAr.checked;
	}else{
		for(var i=0; i<objAr.length;i++){
			if(objAr[i].checked){
				res = true;
				break;
			}
		}
	}
	return res;
}

function trataActivacaoBotao(nomeform,nomeCheckbox,nomeBotao){
	document.forms[nomeform].elements[nomeBotao].disabled = !isAnySelected(nomeform,nomeCheckbox);
}




function detalheExtensao(orig,resumo)
{
	this.bloqueado =  false;
	this.dadosOrig = orig;
	this.dadosResumo = resumo;
}


function mostraTudoExtensao(id)
{
	var objTR = document.getElementById(id+"_"+"tr");
	var objTD = document.getElementById(id+"_"+"descricao");

	if(dadosExtensao[id])
	{
		if(!dadosExtensao[id].bloqueado)
		{
			objTR.style.backgroundColor = "#EEEEEE";
			objTD.innerHTML = dadosExtensao[id].dadosOrig;
		}
	}
}

function escondeExtensao(id)
{
	var objTR = document.getElementById(id+"_"+"tr");
	var objTD = document.getElementById(id+"_"+"descricao");

	if(dadosExtensao[id])
	{
		if(!dadosExtensao[id].bloqueado)
		{
			objTR.style.backgroundColor = "#FFFFFF";
			objTD.innerHTML = dadosExtensao[id].dadosResumo;
		}
	}
}

function bloqueiaOuDesbloqueiaExtensao(id)
{
	var objTR = document.getElementById(id+"_"+"tr");
	var objTD = document.getElementById(id+"_"+"descricao");
	if(dadosExtensao[id])
	{
		if(dadosExtensao[id].bloqueado)
		{
			dadosExtensao[id].bloqueado = false;
			objTR.style.backgroundColor = "#DDDDDD";
		}
		else
		{
			dadosExtensao[id].bloqueado = true;
			objTR.style.backgroundColor = "#EEEEEE";
		}
	}
}

var dadosExtensao = new Array();


function iFrameHeight(nomeFrame){
	if(document.getElementById && !(document.all)) {
		if(Trim(document.getElementById(nomeFrame).contentDocument.body.innerHTML) == ''){
			h=0;
		}else{
			h = document.getElementById(nomeFrame).contentDocument.body.offsetHeight + 12;
		}
		document.getElementById(nomeFrame).style.height = h;
	}
	else if(document.all){
		if(Trim(document.frames(nomeFrame).document.body.innerHTML) == ''){
			h=0;
		}else{
			h = document.frames(nomeFrame).document.body.scrollHeight;
		}
		document.all[nomeFrame].style.height = h;
	}
}

function validaCamposForm(nomeform,dadosVazio,dadosSelect,dadosInvalido,dadosCheckBox){
	var strVazio = "";
	var strSelect = "";
	var strInvalido = "";
	var strCheckBox = ""

	var objErr = document.getElementById('displayErros');
	if(!isUndefined(objErr) && !isNull(objErr)){
		objErr.style.width = '0px';
		objErr.style.height = '0px';
		objErr.style.overflow = 'hidden';
	}

	objErr = document.getElementById('errosTabela');
	if(!isUndefined(objErr) && !isNull(objErr)){
		objErr.innerHTML = "";
		objErr.style.height = '1px';
	}


	objErr = document.getElementById('mensagemSuccess');
	if(!isUndefined(objErr) && !isNull(objErr)){
		objErr.innerHTML = "";
	}

	if(isArray(dadosVazio)){
		var arKeys = (dadosVazio['Keys']!='')?dadosVazio['Keys'].split(","):(new Array());
		for(var i =0; i<arKeys.length; i++){
			if(isNull(document.forms[nomeform].elements[arKeys[i]]) ||
			   isUndefined(document.forms[nomeform].elements[arKeys[i]]) ||
			   Trim(document.forms[nomeform].elements[arKeys[i]].value) == ''
			){
				if( !isUndefined(dadosVazio['NomeDisplay']) && !isNull(dadosVazio['NomeDisplay']) &&
					isArray(dadosVazio['NomeDisplay']) && !isNull(dadosVazio['NomeDisplay'][arKeys[i]]) &&
					!isUndefined(dadosVazio['NomeDisplay'][arKeys[i]]))
				{
					nomeDisplay = dadosVazio['NomeDisplay'][arKeys[i]];
				}else{
					nomeDisplay = arKeys[i];
				}
				strVazio += nomeDisplay+", ";
			}
		}
		if(strVazio.length>2){
			strVazio= strVazio.substring(0,strVazio.length-2)+".";
		}
	}

	if(isArray(dadosCheckBox)){
		var arKeysCheckBox = (dadosCheckBox['Keys']!='')?dadosCheckBox['Keys'].split(","):(new Array());
		for(var i =0; i<arKeysCheckBox.length; i++){
			if(!isAnySelected(nomeform,arKeysCheckBox[i])){
				if( !isUndefined(dadosCheckBox['NomeDisplay']) && !isNull(dadosCheckBox['NomeDisplay']) &&
					isArray(dadosCheckBox['NomeDisplay']) && !isNull(dadosCheckBox['NomeDisplay'][arKeysCheckBox[i]]) &&
					!isUndefined(dadosCheckBox['NomeDisplay'][arKeysCheckBox[i]]))
				{
					nomeDisplay = dadosCheckBox['NomeDisplay'][arKeysCheckBox[i]];
				}else{
					nomeDisplay = arKeysCheckBox[i];
				}
				strCheckBox += nomeDisplay+", ";
			}
		}
		if(strCheckBox.length>2){
			strCheckBox= strCheckBox.substring(0,strCheckBox.length-2)+".";
		}
	}

	if(isArray(dadosSelect)){
		var arKeysSelect = (dadosSelect['Keys']!='')?dadosSelect['Keys'].split(","):(new Array());
		for(var i =0; i<arKeysSelect.length; i++){
			if( isUndefined(arKeysSelect[i]) || isNull(arKeysSelect[i]) ||
				Trim(document.forms[nomeform].elements[arKeysSelect[i]].value) == '' ||
				Trim(document.forms[nomeform].elements[arKeysSelect[i]].value) == 'NA')
			{
				if( !isUndefined(dadosSelect['NomeDisplay']) && !isNull(dadosSelect['NomeDisplay']) &&
					isArray(dadosSelect['NomeDisplay']) && !isNull(dadosSelect['NomeDisplay'][arKeysSelect[i]]) &&
					!isUndefined(dadosSelect['NomeDisplay'][arKeysSelect[i]]))
				{
					nomeDisplay = dadosSelect['NomeDisplay'][arKeysSelect[i]];
				}else{
					nomeDisplay = arKeysSelect[i];
				}
				strSelect += nomeDisplay+", ";
			}
		}
		if(strSelect.length>2){
			strSelect= strSelect.substring(0,strSelect.length-2)+".";
		}
	}

	if(strVazio != "" || strSelect != "" || strCheckBox != ""){
		var code = '<table id="mensagem" width="60%" height="20" border="0" cellspacing="0" cellpadding="0" style="margin:5;""><tr><td class="error" align="center">';

		if(strVazio != ""){
			code += "- É obrigatório preencher o(s) campo(s): "+strVazio;
		}

		if(strSelect != ""){
			if(code!="")code += "<br>";
			code += "- É obrigatório escolher o(s) campo(s): "+ strSelect;
		}

		if(strCheckBox != ""){
			if(code!="")code += "<br>";
			code += "- É obrigatório escolher pelo menos uma opção do(s) campo(s): "+ strCheckBox;
		}

		code = code + "</td></tr></table>";
		var obj = document.getElementById('errosTD');
		obj.innerHTML = code;
		return false;
	}
	return true;
}



// Validation

function ValidateEmail(str) {
	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	if (str.indexOf(at)==-1){
	   return false
	}

	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
	   return false
	}

	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
	    return false
	}

	 if (str.indexOf(at,(lat+1))!=-1){
	    return false
	 }

	 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
	    return false
	 }

	 if (str.indexOf(dot,(lat+2))==-1){
	    return false
	 }

	 if (str.indexOf(" ")!=-1){
	    return false
	 }

	 if ((str.lastIndexOf(dot)+1) >=  lstr){
	 	return false;
	 }

	 return true
}

function setPostValue(idHtml,name,value){
	var objAux = document.getElementById(name);
	if(isNull(objAux)){
		var code = "<input type='hidden' id='"+name+"' name='"+name+"' value='"+value+"' />";
		var obj = document.getElementById(idHtml);
		obj.innerHTML += code;
	}else{
		objAux.value = value;
	}
}

function unsetPostValue(name){
	var objAux = document.getElementById(name);
	//alert("obj:"+objAux)
	if(!isNull(objAux)){
		objAux.value = false;
	}
	//alert("val:"+objAux.value);
}


function getPostValue(idHtml,name){
	var objAux = document.getElementById(name);
	if(!isNull(objAux)){
		return objAux.value;
	}
}

function actualizaStyleDisplay(id,disp){
	if(!isUndefined(disp) && !isNull(disp)){
		document.getElementById(id).style.display = disp;
	}else{
		if(document.getElementById(id).style.display == 'none'){
		  	document.getElementById(id).style.display = 'inline';
		}else{
		  	document.getElementById(id).style.display = 'none';
		}
	}
}

keyPressUpload=false;
function actualizaReq_uploadFile(form,elem,val){
	var obj = document.forms[form].elements[elem+'AUX'];

	if(!keyPressUpload){
		obj.value = val;
	}
}

function actualizaReq_uploadFileById(id,val){
	var obj = document.getElementById(id);

	if(!isUndefined(obj) && !isNull(obj) && !keyPressUpload){
		obj.value = val;
	}
}

function implode_js(sep,ar){
  	var str="";
  	for(var i=0; i< ar.length; i++){
	    str += sep+ar[i];
	}
	return str.substr(1,str.length);
}

function init_tinyMCE(weightTiny,heightTiny,onchangeFunc){
  	//return false;
  	weightTiny = (isUndefined(weightTiny) || isNull(weightTiny))?"400px":weightTiny;
	heightTiny = (isUndefined(heightTiny) || isNull(heightTiny))?"100px":heightTiny;

	onchangeFunc = (isUndefined(onchangeFunc) || isNull(onchangeFunc))?"":onchangeFunc;
	tinyMCE.init({
			mode : "textareas",
			theme : "advanced",
			valid_elements : "*[*]",
			height:heightTiny,
			width:weightTiny,
			theme_advanced_buttons1 : "bold,italic,underline,image,forecolor,backcolor,separator,strikethrough,justifyleft,justifycenter,justifyright, justifyfull,bullist,numlist,undo,redo,link,unlink,code,fontsizeselect",
			theme_advanced_buttons2 : "",
			theme_advanced_buttons3 : "",
			theme_advanced_toolbar_location : "top",
			theme_advanced_toolbar_align : "left",
			onchange_callback : onchangeFunc,
			extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]"
		});
}


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;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.x){
		curtop += obj.x;
	}
	return curtop;
}


function findPositionObj(obj){
  	var pos = new Array();
	pos['X'] = findPosX(obj);
	pos['Y'] = findPosY(obj);
	return pos;
}

function only_digit(idObj){
	input = document.getElementById(idObj);
	if(!input.value.match(0-9)){
		input.value = input.value.replace(/[^0-9]*/g,'');
	}
}


/* Inicio Class Menu */
function ClassMenu(linkAux,nomeVar){
	/*
	obj = document.getElementById('divUserMenuAUX');
	alert(obj)
	if(isUndefined(obj) || isNull(obj)){alert("Precisa de declarar uma tag div com ID::divUserMenuAUX para que o menu funcione");}
	*/
	this.nomeVar = nomeVar;
	this.link_onclick = linkAux;
	this.lstMenu = new Array();
	this.opcoesMenu = new Array();
}

ClassMenu.method('add_menu', function (id){
	this.objSelBck=false;
	this.menuActivo = false;
	this.lstMenu[id] = new Array();
	this.opcoesMenu[id] = new Array();
});


ClassMenu.method('add_opcao', function (id,nome,id_menu,urlAux){
	if(!isNull(this.lstMenu[id_menu]) && !isUndefined(this.lstMenu[id_menu])){
		this.opcoesMenu[id_menu][id] = new Array();
		this.opcoesMenu[id_menu][id]['nome'] = nome;
		this.opcoesMenu[id_menu][id]['urlAux'] = urlAux;
	  	this.lstMenu[id_menu].push(id);
	}else{
	  	alert("opção id_menu:"+id_menu+" não existe no menu");
	}
});


ClassMenu.method('get_code_menu', function (id_menu){
	var code="<table id='menu' onmouseover='"+this.nomeVar+".mantemMenuActivo()'>";
	for(var i=0; i < this.lstMenu[id_menu].length; i++){
		var id_opcao = this.lstMenu[id_menu][i];
		code += "<tr class='style2'>"+
					"<td>"+
						"<a class='opcao topMenu' href='"+this.link_onclick+this.opcoesMenu[id_menu][id_opcao]['urlAux']+"'>"+
							this.opcoesMenu[id_menu][id_opcao]['nome']+
						"</a>"+
					"</td>"+
				"</tr>";
	}
	code += "</table>";
	return code;
});

ClassMenu.method('mantemMenuActivo', function (){
	this.menuActivo = true;
	var divObj = document.getElementById('divUserMenu');
	if(isUndefined(divObj) || isNull(divObj))return;

	divObj.style.display = 'inline';
	if(this.objSelBck){this.objSelBck.style.color = 'Maroon';}
});



ClassMenu.method('mostraMenu', function (id,idObjRequest,nomeVar){
	this.menuActivo = true;
	if(this.objSelBck){this.objSelBck.style.color = 'White'}
	ObjRequest = document.getElementById(idObjRequest);
	this.objSelBck = ObjRequest;
	var pos = findPositionObj(ObjRequest);

	var divObjAUX = document.getElementById('divUserMenuAUX');
	if(isUndefined(divObjAUX) || isNull(divObjAUX))return;

	divObjAUX.innerHTML = '<div id="divUserMenu" class="menuBackOffice" onmouseover="'+this.nomeVar+'.mantemMenuActivo()" onmouseout="'+this.nomeVar+'.ocultaMenu();" style="padding:5;-moz-opacity:0;filter:alpha(opacity:75);opacity:10;"></div>';

	var divObj = document.getElementById('divUserMenu');

	divObj.style.display = 'inline';
	divObj.style.left = pos['X'];
	divObj.style.top = parseInt(pos['Y'])+14;
	divObj.innerHTML = this.get_code_menu(id);
	this.objSelBck.style.color = 'Maroon';
});

ClassMenu.method('ocultaMenu', function(){
	var divObj = document.getElementById('divUserMenu');
	if(isUndefined(divObj) || isNull(divObj))return;

	divObj.style.display = 'none';
	if(this.objSelBck){this.objSelBck.style.color = 'White';}
	this.menuActivo = false;
});
