function abrePopupImagem(url){
	window.open (url,
"Imagem","menubar=0,resizable=1,width=600,height=500,scrollbars=1");
}

function fecharLgBox(divID){
	document.body.removeChild(document.getElementById('layer'));
	document.body.removeChild(document.getElementById(divID));
}

function lgBox(divNome, divHtml, iWidth, iHeight){
	var sHtmlInterno = document.getElementById(divHtml).innerHTML;
	var width = document.documentElement.clientWidth + document.documentElement.scrollLeft;
	var layer = document.createElement('div');
	layer.style.zIndex = 992;
	layer.id = 'layer';
	layer.style.position = 'absolute';
	layer.style.top = '0px';
	layer.style.left = '0px';
	layer.style.height = document.documentElement.scrollHeight + 'px';
	layer.style.width = width + 'px';
	layer.style.backgroundColor = 'black';
	layer.style.opacity = '.6';
	layer.style.filter += ("progid:DXImageTransform.Microsoft.Alpha(opacity=60)");
	document.body.appendChild(layer);

	var div = document.createElement('div');
	div.style.zIndex = 993;
	div.id = divNome;
	div.style.position = (navigator.userAgent.indexOf('MSIE 6') > -1) ? 'absolute' : 'fixed';
	div.style.top = 50+'px';
	if(iWidth && iHeight){
		div.style.width  = iWidth+'px';
		div.style.height  = iHeight+'px';
		div.style.overflow = "auto";
	}else{
		iWidth = 400;
	}
	div.style.left = (width / 2) - (iWidth / 2) + 'px';
	div.innerHTML = sHtmlInterno;
	document.body.appendChild(div);
}

function alteraTipo(onde){
    document.getElementById('txtSenhaAnterior'+onde).style.display = "none";
    document.getElementById('txtSenha'+onde).style.display = "";
}

function mostraDiv(idDiv) {
    document.getElementById(idDiv).style.display="block";
}

function escondeDiv(idDiv) {
    document.getElementById(idDiv).style.display="none"
}


function hasClass(ele,cls) {
  return ele.className.match(new RegExp('(\\s|^)'+cls+'(\\s|$)'));
}

function addClass(ele,cls) {
  if (!this.hasClass(ele,cls)) ele.className += " "+cls;
}
 
function removeClass(ele,cls) {
  if(ele.className != null){
    if (hasClass(ele,cls)) {
      var reg = new RegExp('(\\s|^)'+cls+'(\\s|$)');
      ele.className=ele.className.replace(reg,' ');
    }
  }
}
