/*menu.js*/
	startList = function() {
		if (document.all && document.getElementById) {
			navRoot = document.getElementById("submenu");
			for (i=0; i<navRoot.childNodes.length; i++) {
				node = navRoot.childNodes[i];
				if (node.nodeName=="LI") {
					node.onmouseover = function() {
						this.className+=" over";
				  }
				  node.onmouseout = function() {
						this.className=this.className.replace
						(" over" , "");
					}
				}
			}
		}
	}
/*menu.js*/


var cropping = false;
var key_f1 = 112;
var key_esc = 27;

var flg_conteudo_improprio = false;
var txt_conteudo_improprio = "";
var txt_conteudo_improprio_menor = "";
txt_conteudo_improprio += '\r\n	<div class="pergunta">';
txt_conteudo_improprio += '\r\n		Cara usuária, a página a seguir tem conteúdo de sexualidade e de teor sexual, sendo restrito a menores de 18 anos.<br />Você realmente quer acessar esta página?<br /><br />';
txt_conteudo_improprio += '\r\n	</div>';
txt_conteudo_improprio += '\r\n	<div class="botoes">';
txt_conteudo_improprio += '\r\n		<div class="can">';
txt_conteudo_improprio += '\r\n			<button class="botao" onclick="conteudoImproprioResposta(true);">Sim, quero acessar</button>';
txt_conteudo_improprio += '\r\n		</div>';
txt_conteudo_improprio += '\r\n		<div class="pro">';
txt_conteudo_improprio += '\r\n			<button class="botao" onclick="conteudoImproprioResposta(false);">Não quero acessar</button>';
txt_conteudo_improprio += '\r\n		</div>';
txt_conteudo_improprio += '\r\n	</div>';

txt_conteudo_improprio_menor += '\r\n	<div class="pergunta">';
txt_conteudo_improprio_menor += '\r\n		Cara usuária, a página a seguir tem conteúdo de sexualidade e de teor sexual, sendo restrito a menores de 18 anos.<br /><br />';
txt_conteudo_improprio_menor += '\r\n		<button class="botao" onclick="conteudo_improprio_cancela();">Ir para área pessoal</button>';
txt_conteudo_improprio_menor += '\r\n	</div>';

function avisa_conteudo_improprio () {
	flg_conteudo_improprio = true;
	bodyAlpha_open("janela-conteudo-improprio" , txt_conteudo_improprio);
}

function avisa_conteudo_improprio_menor () {
	flg_conteudo_improprio = true;
	bodyAlpha_open("janela-conteudo-improprio" , txt_conteudo_improprio_menor);
}

old_onload = window.onload;

function new_onload () {
	if (typeof(old_onload) != "undefined" && old_onload !== undefined && old_onload != "undefined" && old_onload !== null) {
		old_onload();
	}
	avisa_conteudo_improprio_novo();
}
//window.onload = new_onload;

function conteudo_improprio_resposta (resposta) {
	var resp = ((resposta === undefined || resposta === null) ? false : resposta);
	var acao = "adulto_" + (resp !== false ? "libera" : "bloqueia");
	url_improprio = URL_SITE + "frame-conteudo-adulto-libera.php?acao=" + acao;
	document.getElementById("server").src = url_improprio;
}

function conteudo_improprio_cancela () {
	url = "http://vilamulher.terra.com.br/vilamulher/area-pessoal/";
	location.href = url;
}

function mudacompartilhe(id,parama,paramb) {
	var jobj = document.getElementById(id);
	if (jobj.className == parama) {
		jobj.className = paramb;
	}	else {
		jobj.className = parama;
	}
}

function isset (obj) {
	return (obj != undefined && obj !== null);
}

function cropper_cancela_forcado () {
	/*
		forca o cancelamento do cropper, excluindo a imagem do servidor
		usar para caso a usuária resolva fechar a janela do navegador com o cropper aberto
		ficará no "onunload" da janela, porém verifica antes se o cropper está rodando
	*/
	cropping = (cropping != undefined && cropping !== null ? cropping : false);
	if (cropping) {
		cropper_bt_cancelar ();
		return true;
	}
	return false;
}

//document.onhelp = function() {return(false);}
//window.onhelp = function() {return(false);}

function key_press (event) {
	if (navigator.appName == "Microsoft Internet Explorer") {
		var key_pressed = event.keyCode;
		//key_f1 = DOM_VK_F1;
		//key_esc = DOM_VK_ESC;
		key_f1 = 112;
		key_esc = 27;
	}
	else {
		var key_pressed = event.keyCode;
		key_f1 = 112;
		key_esc = 27;
	}
	return key_pressed;
}

function key_press_esc (event) {
	if (flg_conteudo_improprio) {
		return false;
	}
	cropping = (cropping != undefined && cropping !== null ? cropping : false);
	if (key_press (event) == key_esc) {
		if (!cropper_cancela_forcado()) {
			bodyAlpha_close();
		}
	}
}

function key_press_f1 (event) {
	if (key_press (event) == key_f1) {
		event.returnValue = false;
		event.cancelBubble = true;
		new_help();
		return false;
	}
}

function new_help () {
	alert("vamos te ajudar");
}

function bodyAlpha_close (fade) {
	/*
		fade == true | terá um FADE-IN na abertura no fundo;
		fade == null , undefined , false | não terá fade
	*/

	var combos = document.getElementsByTagName("select");
	for (var i in combos) {
		if(typeof combos[i] == "object") {
			combos[i].style.display = "block";
		}
	}

	fade = ((fade == null || fade == undefined) ? false : fade);
	if (!fade) {
		document.getElementById("body-alpha-janela").innerHTML = "";
		document.getElementById("body-alpha-janela").className = "zeropx";
		document.getElementById("body-alpha").style.display = "none";
	}
}

function bodyAlpha_open (classe , texto , fade) {
	/*
		fade == true | terá um FADE-IN na abertura no fundo;
		fade == null , undefined , false | não terá fade
	*/

	var combos = document.getElementsByTagName("select");
	for (var i in combos) {
		if(typeof combos[i] == "object") {
			combos[i].style.display = "none";
		}
	}

	fade = ((fade == null || fade == undefined) ? false : fade);
	classe = (classe == "" ? "zeropx" : classe);
	if (!fade) {
		document.getElementById("body-alpha").style.display = "block";
		document.getElementById("body-alpha-janela").className = classe;
		document.getElementById("body-alpha-janela").innerHTML = texto;
	} else {
	}
	document.getElementById("body-alpha").focus();
}

function str_replace (str_sai , str_entra , str_texto) {
	if (str_texto.indexOf(str_sai) >= 0) {
		str_flag = true;
	} else {
		str_flag = false;
	}
	while (str_flag) {
		str_texto = str_texto.replace(str_sai , str_entra);
		if (str_texto.indexOf(str_sai) == -1) {
			str_flag = false;
		}
	}
	return str_texto;
}

function trim (texto) {
	var tirar = new Array();
	tirar[0] = "T";
	tirar[9] = "T";
	tirar[10] = "T";
	tirar[11] = "T";
	tirar[13] = "T";
	tirar[32] = "T";
	if (texto != "") {
		flag = true;
		while (flag) {
			if (tirar[texto.charCodeAt(0)] == "T") {
				texto = texto.substr(1);
			} else {
				flag = false;
			}
		}
		flag = true;
		while (flag) {
			if (tirar[texto.charCodeAt(texto.length - 1)] == "T") {
				texto = texto.substr(0 , (texto.length - 1));
			} else {
				flag = false;
			}
		}
	}
	return texto;
}

function tradutor_tags (texto) {
	texto = str_replace("\r" , "" , texto);
	texto = str_replace("\n" , "<br />" , texto);
	texto = str_replace("[quebrapagina]" , '</p><hr style="border-width: 0px; border-top: 1px DASHED #F00;" /><p>' , texto);

	flag = true;
	while (flag) {
		texto = texto.replace("[comentario]" , "<blockquote>");	texto = texto.replace("[/comentario]" , "</blockquote>");
		texto = texto.replace("[n]" , "<strong>");	texto = texto.replace("[/n]" , "</strong>");
		texto = texto.replace("[i]" , "<i>");			texto = texto.replace("[/i]" , "</i>");
		texto = texto.replace("[s]" , "<u>");			texto = texto.replace("[/s]" , "</u>");

		texto = texto.replace("[s1]" , "<h2>");		texto = texto.replace("[/s1]" , "</h2>");
		texto = texto.replace("[s2]" , "<h3>");		texto = texto.replace("[/s2]" , "</h3>");
		texto = texto.replace("[s3]" , "<h4>");		texto = texto.replace("[/s3]" , "</h4>");
		texto = texto.replace("[s4]" , "<h5>");		texto = texto.replace("[/s4]" , "</h5>");
		texto = texto.replace("[s5]" , "<h6>");		texto = texto.replace("[/s5]" , "</h6>");

		if (texto.indexOf("[n]") == -1 && texto.indexOf("[comentario]") == -1 && texto.indexOf("[i]") == -1 && texto.indexOf("[s]") == -1 && texto.indexOf("[s1]") == -1 && texto.indexOf("[s2]") == -1 && texto.indexOf("[s3]") == -1 && texto.indexOf("[s4]") == -1 && texto.indexOf("[s5]") == -1) {
			flag = false;
		}
	}
	flag = true;
	// converte links
	while (flag) {
		if (texto.indexOf("[link url") >= 0) {
			texto = texto.replace('externo="sim"' , 'target="_blank"');
			texto = texto.replace("externo='sim'" , 'target="_blank"');
			texto = texto.replace('externo="nao"' , '');
			texto = texto.replace("externo='nao'" , '');

			texto = texto.replace("[link url" , "<a href");
			temp = texto.indexOf("[link url");
			temp = texto.indexOf("]" , (temp + 1));
			texto = texto.substr(0 , temp) + ">" + texto.substr(temp + 1);
			texto = texto.replace("[/link]" , "</a>");
		} else if (texto.indexOf("[link url") == -1) {
			flag = false;
		}
	}
	flag = true;
	ini = 0;
	fim = texto.indexOf("<");
	if (fim == -1) {
		fim = texto.length;
	}
	while (flag) {
		temp = texto.substr(ini , (fim - ini));
		flag2 = true;
		while (flag2) {
			temp = temp.replace(String.fromCharCode(32) , "&nbsp;");
			if (temp.indexOf(String.fromCharCode(32)) == -1) {
				flag2 = false;
			}
		}
		texto = texto.substr(0 , ini) + temp + texto.substr(fim , (texto.length - fim));
		ini = texto.indexOf(">" , fim + 1) + 1;
		fim = texto.indexOf("<" , ini + 0);
		if (fim < 0 || fim == texto.length) {
			flag = false;
		}
	}
	texto = "<p>" + texto + "</p>";
	flag = true;
	while (flag) {
		texto = texto.replace("<br /><br />" , "</p>\n<p>");
		if (texto.indexOf("<br /><br />")) {
			flag = false;
		}
	}
	return texto;
}

function function_exists (funcao) {
	if (eval(funcao + " !== null && " + funcao + " != undefined")) {
		return eval('typeof ' + funcao + ' == "function"');
	}
	else {
		return false;
	}
}

function form_validacao (campo , tipo , minimo , maximo) {
	/*
		campo
			- é o ID do campo que será verificado;
		tipo
			- é o tipo do campo que será verificado
			- tipos: (combo, texto , radio , check , multi)
			- tipo multi: combo onde pode selecionar vários usando a tecla ctrl
			- se tipo for radio, deverão ter todos os checks separados por vírgula no atributo campo
			- se tipo for multi, o campo deverá ser preenchido com os ids de todas as opções ("<option>") separadas por vírgula
			- se o tipo for file, você pode usar o campo mínimo para passar as extenções separadas por vírgula

		minimo = usar apenas quando o tipo for check ou multi. é o número mínimo de checkbox preenchidos
		maximo = usar apenas quando o tipo for check ou multi. é o número máximo de checkbox preenchidos
			- se minimo não for preenchido, será setado como dmin (mínimo default) automaticamente
			- se máximo não for preenchido, será setado como dmax (máximo default) automaticamente
			- o campo minimo pode ser usado com conteúdo de regular expression

		a função apresentará um alert() quando um tipo inválido for utilizado
		a função retornará true se validar o campo ou false se não validar.
	*/
	var cont = 0;
	var qtde = 0;
	var dmin = 0;
	var dmax = 9999;
	var retorno = true;
	ext_fl = (minimo != undefined && minimo !== null ? minimo : ""); // ext_fl = extenções de arquivo
	reg_ex = (minimo != undefined && minimo !== null ? minimo : ""); // reg_ex = regular expression
	minimo = (minimo != undefined && minimo !== null ? minimo : dmin);
	maximo = (maximo != undefined && maximo !== null ? maximo : dmax);
	minimo = (isNaN(parseInt(minimo)) ? dmin : parseInt(minimo));
	maximo = (isNaN(parseInt(maximo)) ? dmax : parseInt(maximo));

	switch (tipo) {
		case "texto" :
			oid = trim(campo);
			obj = document.getElementById(oid);
			if (trim(obj.value) == "") {
				retorno = false;
			}
			else if (trim(reg_ex) != "") {
				retorno = reg_ex.test(obj.value);
			}
		break;
		case "combo" :
			oid = trim(campo);
			obj = document.getElementById(oid);
			if (obj.value == 0) {
				retorno = false;
			}
		break;
		case "check" :
			var flag = true;
			while (flag) {
				oid = campo + "_" + cont;
				obj = document.getElementById(oid);
				if (obj != undefined && obj !== null) {
					if (obj.checked == true) {
						qtde++;
					}
				}
				else {
					flag = false;
				}
				cont++;
			}
			if (qtde < minimo || qtde > maximo) {
				retorno = false;
			}
		break;
		case "radio" :
			var campos = new Array ();
			if (campo.indexOf(",") >= 0) {
				campos = campo.split(",");
			}
			else {
				campos[0] = campo;
			}
			for (cont in campos) {
				oid = trim(campos[cont]);
				obj = document.getElementById(oid);
				if (obj.checked == true) {
					qtde++;
				}
			}
			if (qtde == 0) {
				retorno = false;
			}
		break;
		case "multi" :
			var campos = new Array ();
			if (campo.indexOf(",") >= 0) {
				campos = campo.split(",");
			}
			else {
				campos[0] = campo;
			}
			for (cont in campos) {
				oid = trim(campos[cont]);
				obj = document.getElementById(oid);
				if (obj != undefined && obj !== null) {
					if (obj.selected == true) {
						qtde++;
					}
				}
			}
			if (qtde < minimo || qtde > maximo) {
				retorno = false;
			}
		break;
		case "file" :
			if (trim(ext_fl) != "") {
				extencoes = ext_fl.split(",");
			}
			oid = trim(campo);
			obj = document.getElementById(oid);
			if (trim(obj.value) == "") {
				retorno = false;
			}
			if (retorno && extencoes !== null && extencoes != undefined) {
				retorno = false;
				for (xx in extencoes) {
					ext = trim(extencoes[xx]);
					arq = trim(obj.value);
					if (arq.substr(-3).toLowerCase() == ext.toLowerCase()) {
						retorno = true;
					}
				}
			}
		break;
		default:
			alert("tipo inválido");
			retorno = false;
		break;
	}
	return retorno;
}

function in_array (arr , val) {
	retorno = false;
	for (c in arr) {
		if (arr[c] == val) {
			retorno = true;
			break;
		}
	}
	return retorno;
}

//function add_favorito() {
//    var url      = "http://vilamulher.com.br/";
//    var title    = "Vila Mulher: o Portal da Mulher Contemporânea";
//    if (window.sidebar) window.sidebar.addPanel(title, url,"");
//    else if(window.opera && window.print){
//        var mbm = document.createElement('a');
//        mbm.setAttribute('rel','sidebar');
//        mbm.setAttribute('href',url);
//        mbm.setAttribute('title',title);
//        mbm.click();
//    }
//    else if(document.all){window.external.AddFavorite(url, title);}
//}


var expansivo_usando_novo = false;

function expansivo_vai_novo (j_objid , j_top , j_right , j_botton , j_left , j_flag) {
	if (document.getElementById(j_objid) !== null) {
		var obj = document.getElementById(j_objid).style;
		if (obj.clip.left) {
			obj.clip.top = j_top;
			obj.clip.right = j_right;
			obj.clip.bottom = j_botton;
			obj.clip.left = j_left;
		}
		/*
		obj.clip = 'rect(top , right , botton , left)';
		obj.clip = 'rect(0 ' + j_width + ' ' + j_height + ' 0)';
		*/
		obj.clip = 'rect(' + j_top + 'px ' + j_right + 'px ' + j_botton + 'px ' + j_left + 'px)';
		expansivo_usando_novo = false;
	}
}

function expansivo_muda_novo (j_objid , j_top , j_right , j_botton , j_left , j_flag) {
	if (!expansivo_usando_novo) {
		expansivo_usando_novo = true;
		if (j_flag == true) {
			expansivo_vai_novo(j_objid , j_top , j_right , j_botton , j_left , j_flag);
		} else {
			expansivo_vai_novo(j_objid , j_top , j_right , j_botton , j_left , j_flag);
		}
		expansivo_usando_novo = false;
	}
}

function expansivo_muda_timeout_novo (j_objid , j_top , j_right , j_botton , j_left , j_flag) {
	if (j_flag == true) {
		setTimeout("expansivo_vai_novo('" + j_objid + "' , " + j_top + " , " + j_right + " , " + j_botton + " , " + j_left + " , " + j_flag + ")" , 2000);
	} else {
		expansivo_vai_novo(j_objid , j_top , j_right , j_botton , j_left , j_flag);
	}
}
function enviar_lembrete(login) {
	if(login == "") {
		alert("Você deve informar o login ou email para que o lembrete de senha seja mostrado");
	} else {
		window.open("lembrete-senha.php?login_informado="+login,"server");
	}
}


/*cropper.js*/
/* variaveis iniciais do sistema */
	var m_wid = 530;		// largura máxima para a imagem no cropper
	var m_hei = 270;		// altura máxima para a imagem no cropper
	var prp_w = 1;			// largura proporcional do cropper: 3x4 = 3
	var prp_h = 1;			// altura proprocional do cropper: 3x4 = 4
	var cropping = false;
/* variaveis iniciais do sistema - fim */
if (typeof(funcionalidade_codigo) == 'undefined')
	funcionalidade_codigo = null;
function cropper (arquivo , acao) {
	/*
		arquivo = arquivo que processará o cropper
	*/
	if (typeof arquivo != undefined && arquivo !== null) {
		this.arquivo = trim(arquivo);
	}
	if (typeof acao != undefined && acao !== null) {
		this.acao = trim(acao);
	}
}

/* variaveis */
cropper.prototype.acao = "";		// funcao que será executada dentro do arquivo
cropper.prototype.arquivo = "";	// arquivo que processará o cropper
cropper.prototype.img = "";		// nome do arquivo da imagem
cropper.prototype.wid = 0;			// largura proporcional da imagem
cropper.prototype.hei = 0;			// altura proporcional da imagem
cropper.prototype.prp = "1x1";	// proporção do cropper ex.: 3x4
cropper.prototype.prpw = 0;		// largura proporcional do cropper: 3x4 = 3
cropper.prototype.prph = 0;		// altura proprocional do cropper: 3x4 = 4
cropper.prototype.cwid = 0;		// largura inicial do cropper
cropper.prototype.chei = 0;		// altura inicial do cropper
cropper.prototype.owid = 0;		// largura original da imagem
cropper.prototype.ohei = 0;		// altura original da imagem
cropper.prototype.mwid = m_wid;	// largura máxima da imagem no cropper
cropper.prototype.mhei = m_hei;	// altura máxima da imagem no cropper
cropper.prototype.crpt = 0;		// top inicial do cropper
cropper.prototype.crpl = 0;		// left inicial to cropper
/* variaveis - fim */

/* métodos */
cropper.prototype.dimensao_imagem = function () {
	op = this.owid / this.ohei;
	mp = this.mwid / this.mhei;
	if (this.ohei <= this.mhei && this.owid <= this.mwid) {
		this.wid = this.owid;
		this.hei = this.ohei;
	}
	else {
		if (op >= mp || this.wid > this.mwid) {
			// largura
			this.wid = this.mwid;
			this.hei = (this.mwid / this.owid) * this.ohei;
		}
		else {
			// altura
			this.hei = this.mhei;
			this.wid = (this.mhei / this.ohei) * this.owid;
		}
	}
}

cropper.prototype.dimensao_cropper = function () {
	if (this.wid == 0 && this.hei == 0) {
		this.dimensao_imagem();
	}
	tmp = this.prp.split("x");
	prp_w = this.prpw = parseInt(tmp[0]);
	prp_h = this.prph = parseInt(tmp[1]);
	if (this.prpw == this.prph) {
		this.prpw = this.prpw = prp_w = prp_h = 1;
	}
	if (this.prpw == 1 && this.prph == 1) {
		this.cwid = this.chei = (this.wid > this.hei ? ((this.hei / 3) * 2) : ((this.wid / 3) * 2));
	}
	else {
		this.cwid = (this.wid > this.hei ? ((this.hei / 3) * 2) : ((this.wid / 3) * 2));
		this.chei = ((this.cwid / this.prpw) * this.prph);
	}
}

cropper.prototype.posicao_cropper = function () {
	if (this.cwid == 0 || this.hwid == 0) {
		this.dimensao_cropper();
	}
	this.prpl = (this.wid / 2) - (this.cwid / 2);
	this.prpt = (this.hei / 2) - (this.chei / 2);
}

cropper.prototype.tela = function (arq_origem , arq_destino , arq_thumb) {
	/*
		retorna a tela com a imagem para o crop
		largura e altura precisam estar definidas
	*/
	var texto = "";
	if (this.owid == 0) {
		alert("largura não definida");
		return false;
	}
	else if (this.ohei == 0) {
		alert("altura não definida");
		return false;
	}
	else if (this.img == "") {
		alert("imagem não definida");
		return false;
	}
	else {
		this.dimensao_imagem();
		this.dimensao_cropper();
		this.posicao_cropper();
		texto += '<div class="cropper" style="width: ' + this.wid + 'px; height: ' + this.hei + 'px;">';
		texto += '	<img id="crop-imagem" class="cropper_imagem" src="' + this.img + '" border="0" width="' + this.wid + '" height="' + this.hei + '" style="top: 0px; left: 0px; width: ' + this.wid + 'px; height: ' + this.hei + 'px;" />';
		texto += '	<div id="crop-area" class="cropper_area" style="width: ' + this.cwid + 'px; height: ' + this.chei + 'px; top: ' + this.prpt + 'px; left: ' + this.prpl + 'px;" onmousedown="dragger_start(this , ' + this.wid + ' , ' + this.hei + '); resize_flag = false;">';
		texto += '		<div id="cropper-fundo" class="cropper_fundo"></div>';
		texto += '		<div id="cropper-ponteiro-fake" class="cropper_ponteiro_fake"></div>';
		texto += '	</div>';
		texto += '	<div id="crop-corner" style="width: 10px; height: 10px; left: ' + (this.prpl + this.cwid - 5) + 'px; top: ' + (this.prpt + this.chei - 5) + 'px;" class="cropper_ponteiro" onmousedown="dragger_start(this , ' + (this.wid + 5) + ' , ' + (this.hei + 5) + '); resize_flag = true;" onmouseup="resize_flag = false; resize_arruma();"></div>';
		texto += '</div>';
		texto += '<form name="form_cropper" target="server" action="' + this.arquivo + '" method="post">';
		input_tipo = (debug ? "text" : "hidden");

		texto += '	<input type="' + input_tipo + '" name="acao" value="' + this.acao + '" />';					// acao do formulario
		texto += '	<input type="' + input_tipo + '" name="arquivo" value="' + this.arquivo + '" />';			// largura atual da imagem
		texto += '	<input type="' + input_tipo + '" name="arq_origem" value="' + arq_origem + '" />';			// arquivo de origem
		texto += '	<input type="' + input_tipo + '" name="arq_destino" value="' + arq_destino + '" />';		// arquivo de destino
		texto += '	<input type="' + input_tipo + '" name="arq_thumb" value="' + arq_thumb + '" />';				// arquivo de destino
		if (typeof(COD_CADASTRO) != "undefined" && COD_CADASTRO !== null) {
			texto += '	<input type="' + input_tipo + '" name="cod_cadastro" value="' + COD_CADASTRO + '" />';	// codigo de cadastro
		}

		if (typeof(funcionalidade_codigo) !=  "undefined" && funcionalidade_codigo !== null) {
			texto += '	<input type="' + input_tipo + '" name="funcionalidade_codigo" value="' + funcionalidade_codigo + '" />';	// código da funcionalidade
		}
		if (typeof(funcionalidade_tipo) !=  "undefined" && funcionalidade_tipo !== null) {
			texto += '	<input type="' + input_tipo + '" name="funcionalidade_tipo" value="' + funcionalidade_tipo + '" />';		// tipo da funcionalidade
		}
		if (document.getElementById("publicador-texto-codigo") != undefined && document.getElementById("publicador-texto-codigo") !== null) {
			texto += '	<input type="' + input_tipo + '" name="cod_interacao" value="' + document.getElementById("publicador-texto-codigo").value + '" />';						// código da interação
		}

		texto += '	' + (debug ? "<br />wid" : "") + '<input type="' + input_tipo + '" name="wid" value="' + this.wid + '" />';					// largura atual da imagem
		texto += '	' + (debug ? "<br />hei" : "") + '<input type="' + input_tipo + '" name="hei" value="' + this.hei + '" />';					// altura atual da imagem
		texto += '	' + (debug ? "<br />owid" : "") + '<input type="' + input_tipo + '" name="wid_original" value="' + this.owid + '" />';	// largura original da imagem
		texto += '	' + (debug ? "<br />ohei" : "") + '<input type="' + input_tipo + '" name="hei_original" value="' + this.ohei + '" />';	// altura original da imagem
		texto += '	' + (debug ? "<br />cwid" : "") + '<input type="' + input_tipo + '" name="area_wid" value="' + this.cwid + '" />';		// largura da área de cropper
		texto += '	' + (debug ? "<br />chei" : "") + '<input type="' + input_tipo + '" name="area_hei" value="' + this.chei + '" />';		// altura da área de cropper
		texto += '	' + (debug ? "<br />prpt" : "") + '<input type="' + input_tipo + '" name="area_t" value="' + this.prpt + '" />';			// propriedade top da área de cropper
		texto += '	' + (debug ? "<br />prpl" : "") + '<input type="' + input_tipo + '" name="area_l" value="' + this.prpl + '" />';			// propriedade left da área de cropper

		texto += '	<br />';
		texto += '	<button class="botao" onclick="cropper_bt_recortar();">recortar</button>&nbsp;&nbsp;';
		texto += '	<button class="botao" onclick="cropper_bt_cancelar(); return false;">cancelar</button>';
		texto += '</form>';
	}
	return texto;
}

cropper.prototype.tela_preview = function () {
}
/* métodos - fim */

var resize_flag = false;
function resize () {
	/*
		redimensiona o cropper
	*/
	if (resize_flag) {
		ci = document.getElementById("crop-imagem");
		co = document.getElementById("crop-area");
		cc = document.getElementById("crop-corner");
		cif = (ci === null || ci == undefined ? false : true);
		cof = (co === null || co == undefined ? false : true);
		ccf = (cc === null || cc == undefined ? false : true);

		if (cif && cof && ccf) {
			co.style.width = (((parseInt(cc.style.left) - parseInt(co.style.left))) + 5) + "px";
			co.style.height = ((parseInt(co.style.width) / prp_w) * prp_h) + "px";
			if ((parseInt(co.style.top) + parseInt(co.style.height)) > (parseInt(ci.style.top) + parseInt(ci.style.height))) {
				co.style.height = ((parseInt(ci.style.top) + parseInt(ci.style.height)) - parseInt(co.style.top)) + "px";
				co.style.width = ((parseInt(co.style.height) / prp_h) * prp_w) + "px";
			}
		}
	}

	if (document.form_cropper != undefined && document.form_cropper !== null) {
		obj_dragged = document.getElementById("crop-area");
		obj = document.form_cropper;
		if (obj_dragged != undefined && obj_dragged !== null) {
			if (obj.area_wid != undefined && obj.area_wid !== null && obj.area_hei != undefined && obj.area_hei !== null && obj_dragged.className == "cropper_area") {
				obj.area_wid.value = parseInt(obj_dragged.style.width);
				obj.area_hei.value = parseInt(obj_dragged.style.height);
			}
			if (obj.area_t != undefined && obj.area_t !== null && obj.area_l != undefined && obj.area_l !== null && obj_dragged.className == "cropper_area") {
				obj.area_t.value = parseInt(obj_dragged.style.top);
				obj.area_l.value = parseInt(obj_dragged.style.left);
			}
		}
	}

	else {
		resize_arruma ();
	}
}

function resize_arruma () {
	/*
		coloca o quadrado que arrasta para croppear no lugar (canto inferior direito)
	*/
	co = document.getElementById("crop-area");
	cc = document.getElementById("crop-corner");

	cof = (co === null || co == undefined ? false : true);
	ccf = (cc === null || cc == undefined ? false : true);

	if (cof && ccf) {
		cc.style.top = (parseInt(co.style.top) + parseInt(co.style.height) - 5) + "px";
		cc.style.left = (parseInt(co.style.left) + parseInt(co.style.width) - 5) + "px";
	}
}

function croppeia (img , wid , hei , prp , arquivo , acao , arq_origem , arq_destino , arq_thumb) {
	/*
		inicia o cropper
		img = imagem que será croppada, url completa
		wid = largura original da imagem
		hei = altura original da imagem
		prp = proporção do crop da imagem. ex.: "1x1"
		arquivo = arquivo que processará o crop
		arq_origem = img = imagem original com caminho completo
		arq_destino = imagem que receberá o crop da imagem original
		arq_thumb = imagem que será salva como thumb
	*/
	crop = new cropper(arquivo , acao);
	crop.owid = wid;
	crop.ohei = hei;
	crop.img = img;
	crop.prp = prp;
	bodyAlpha_open("janela-alert-cropper" , crop.tela(arq_origem , arq_destino , arq_thumb));
	if (crop.arquivo == "") {
		alert("você deve especificar o arquivo que processará o cropper")
		cropper_bt_cancelar();
	}
	document.getElementById("crop-imagem").style.border = "1px SOLID #AAA";
	document.getElementById("crop-area").style.width = (parseInt(document.getElementById("crop-area").style.width) + 1) + "px";
	document.getElementById("body-alpha-janela").style.width = crop.wid + "px";
	cropping = true;
}

function cropper_bt_recortar () {
	document.form_cropper.submit();
}

function cropper_bt_cancelar () {
	cropping = false;
	bodyAlpha_close();
}

window.onunload = cropper_cancela_forcado;
/*cropper.js*/

/*dragger.js*/
var dragged = "";	// objeto que será arrastado
var obj_t = 0;		// top do objeto
var obj_l = 0;		// left do objeto
var cur_t = 0;		// top do cursor
var cur_l = 0;		// left do cursor
var cur_t_a = 0;	// top do cursor antes
var cur_l_a = 0;	// left do cursor antes
var l = 0;			// left mínimo permitido
var r = 0;			// rigth máximo permitido
var t = 0;			// top mínimo permitido
var b = 0;			// bottom mínimo permitido
var uptemp = "";	// onmouseup do body temporário
var outobt = "";	// onmouseout do objeto temporário
var upobt = "";	// onmouseup do objeto temporário

function dragger_start (obj , pr , pb) {
	dragged = obj;

	if (pr != null && pr != undefined) { r = pr; }
	if (pb != null && pb != undefined) { b = pb; }

	obj_t = dragged.style.top;
	obj_l = dragged.style.left;

	uptemp = document.body.onmouseup;
	outobt = dragged.onmouseout;
	upobt = dragged.onmouseup;
	dragged.onmouseup = document.body.onmouseup = dragger_stop;
	//dragged.onmouseout = dragged.onmouseup = document.body.onmouseup = dragger_stop;
	dragger();
}

function dragger_stop () {
	dragged = "";
	obj_t = obj_l = cur_t_a = cur_l_a = cur_t = cur_l = l = r = t = b = 0;
	document.body.onmouseup = uptemp;
	//dragged.onmouseout = outobt;
	dragged.onmouseup = upobt;
}

function dragger_mouse_xy (e) {
	cur_t_a = cur_t;
	cur_l_a = cur_l;
	if (navigator.appName == "Microsoft Internet Explorer") { // grab the x-y pos.s if browser is IE
		cur_l = event.clientX + document.body.scrollLeft;
		cur_t = event.clientY + document.body.scrollTop;
	}
	else {  // grab the x-y pos.s if browser is NS
		cur_l = e.pageX;
		cur_t = e.pageY;
	}
	//alert(cur_t_a + " --- " + cur_t);
}

function dragger () {
	if (dragged != "") {
		nt = (parseInt(obj_t) - (cur_t_a - cur_t));
		nl = (parseInt(obj_l) - (cur_l_a - cur_l));

		ow = parseInt(dragged.style.width);
		oh = parseInt(dragged.style.height);

		nl = (nl < 0 ? 0 : nl);
		nt = (nt < 0 ? 0 : nt);

		if (r > 0) { nl = (nl + (parseInt(dragged.style.width)) > r ? r - (parseInt(dragged.style.width)) : nl); }
		if (b > 0) { nt = (nt + (parseInt(dragged.style.height)) > b ? b - (parseInt(dragged.style.height)) : nt); }


		dragged.style.top = nt + "px";
		dragged.style.left = nl + "px";
		obj_t = parseInt(dragged.style.top);
		obj_l = parseInt(dragged.style.left);
		if (document.form_cropper != undefined && document.form_cropper !== null) {
			obj = document.form_cropper;
			if (obj.area_wid != undefined && obj.area_wid !== null && obj.area_hei != undefined && obj.area_hei !== null && dragged.className == "cropper_area") {
				obj.area_wid.value = parseInt(dragged.style.width);
				obj.area_hei.value = parseInt(dragged.style.height);
			}
			if (obj.area_t != undefined && obj.area_t !== null && obj.area_l != undefined && obj.area_l !== null && dragged.className == "cropper_area") {
				obj.area_t.value = parseInt(dragged.style.top);
				obj.area_l.value = parseInt(dragged.style.left);
			}
		}
	}
}

/*dragger.js*/

/*AC_RunActiveContent.js*/
//v1.7
// Flash Player Version Detection
// Detect Client Browser type
// Copyright 2005-2007 Adobe Systems Incorporated.  All rights reserved.
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;

function ControlVersion()
{
	var version;
	var axo;
	var e;

	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry

	try {
		// version will be set for 7.X or greater players
		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		version = axo.GetVariable("$version");
	} catch (e) {
	}

	if (!version)
	{
		try {
			// version will be set for 6.X players only
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
			
			// installed player is some revision of 6.0
			// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
			// so we have to be careful. 
			
			// default to the first public version
			version = "WIN 6,0,21,0";

			// throws if AllowScripAccess does not exist (introduced in 6.0r47)		
			axo.AllowScriptAccess = "always";

			// safe to call for 6.0r47 or greater
			version = axo.GetVariable("$version");

		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 4.X or 5.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = axo.GetVariable("$version");
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 3.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = "WIN 3,0,18,0";
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 2.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			version = "WIN 2,0,0,11";
		} catch (e) {
			version = -1;
		}
	}
	
	return version;
}

// JavaScript helper required to detect Flash Player PlugIn version information
function GetSwfVer(){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	var flashVer = -1;
	
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			var descArray = flashDescription.split(" ");
			var tempArrayMajor = descArray[2].split(".");			
			var versionMajor = tempArrayMajor[0];
			var versionMinor = tempArrayMajor[1];
			var versionRevision = descArray[3];
			if (versionRevision == "") {
				versionRevision = descArray[4];
			}
			if (versionRevision[0] == "d") {
				versionRevision = versionRevision.substring(1);
			} else if (versionRevision[0] == "r") {
				versionRevision = versionRevision.substring(1);
				if (versionRevision.indexOf("d") > 0) {
					versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
				}
			}
			var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	else if ( isIE && isWin && !isOpera ) {
		flashVer = ControlVersion();
	}	
	return flashVer;
}

// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
	versionStr = GetSwfVer();
	if (versionStr == -1 ) {
		return false;
	} else if (versionStr != 0) {
		if(isIE && isWin && !isOpera) {
			// Given "WIN 2,0,0,11"
			tempArray         = versionStr.split(" "); 	// ["WIN", "2,0,0,11"]
			tempString        = tempArray[1];			// "2,0,0,11"
			versionArray      = tempString.split(",");	// ['2', '0', '0', '11']
		} else {
			versionArray      = versionStr.split(".");
		}
		var versionMajor      = versionArray[0];
		var versionMinor      = versionArray[1];
		var versionRevision   = versionArray[2];

        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
		if (versionMajor > parseFloat(reqMajorVer)) {
			return true;
		} else if (versionMajor == parseFloat(reqMajorVer)) {
			if (versionMinor > parseFloat(reqMinorVer))
				return true;
			else if (versionMinor == parseFloat(reqMinorVer)) {
				if (versionRevision >= parseFloat(reqRevision))
					return true;
			}
		}
		return false;
	}
}

function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
  var str = '';
  if (isIE && isWin && !isOpera)
  {
    str += '<object ';
    for (var i in objAttrs)
    {
      str += i + '="' + objAttrs[i] + '" ';
    }
    str += '>';
    for (var i in params)
    {
      str += '<param name="' + i + '" value="' + params[i] + '" /> ';
    }
    str += '</object>';
  }
  else
  {
    str += '<embed ';
    for (var i in embedAttrs)
    {
      str += i + '="' + embedAttrs[i] + '" ';
    }
    str += '> </embed>';
  }

  document.write(str);
}

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_SW_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblclick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
      case "id":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}

/*AC_RunActiveContent.js*/

/*envia-por-email.js*/
function enviaporemail(j_interacao,j_cod_funcionalidade_cadastro,j_titulo) {
	texto = '<div style="height:360px; overflow: auto;">';
	texto = texto + '<form id="form_envia_email" method="post" action="' + URL_SITE + 'frame-envia-por-email.php" target="server">';		
	texto = texto + '<input name="topo" type="text" style="height:0px;width:0px;border-width:0px;font-size:0px;background-color:transparent;">';
	texto = texto + '<a href="javascript:bodyAlpha_close();" style="float: right;">Fechar</a>';
	texto = texto + '<strong>Enviar: </strong>' + j_titulo+'<br/>';
	texto = texto + '<div id="msg_enviaporemail"></div>';
	texto = texto + '<table width="456" border="0" cellspacing="0" cellpadding="0">';
  texto = texto + '<tr>';
  texto = texto + '<td><strong>Seu nome</strong></td>';
  texto = texto + '<td><strong>Seu e-mail</strong></td>';
  texto = texto + '</tr>';	
  texto = texto + '<tr>';
  texto = texto + '<td><input name="denome" type="text" maxlength="35" size="25" value="' + dados_nome + '" class="tam-med" style="width: 200px;" /></td>';
  texto = texto + '<td><input name="deemail" type="text" maxlength="50" size="33" value="' + dados_mail + '" class="tam-med" style="width: 200px;" /></td>';
  texto = texto + '</tr>';	
//  texto = texto + '<tr><td colspan="2">&nbsp;</td></tr>';
  texto = texto + '<tr>';
  texto = texto + '<td><span><strong>1.Nome do destinat&aacute;rio</strong></span></td>';
  texto = texto + '<td><span><strong>E-mail do destinat&aacute;rio</strong></span></td>';
  texto = texto + '</tr>';
  texto = texto + '<tr>';
  texto = texto + '<td><input  name="paranome1"  type="text"  maxlength="35" size="25" value="" class="tam-med" style="width: 200px;" /></td>';
  texto = texto + '<td><input  name="paraemail1"  type="text"  maxlength="50" size="33" value="" class="tam-med" style="width: 200px;" /></td>';
  texto = texto + '</tr>';
  texto = texto + '<tr>';
  texto = texto + '<td><span><strong>2.Nome do destinat&aacute;rio</strong></span></td>';
  texto = texto + '<td><span><strong>E-mail do destinat&aacute;rio</strong></span></td>'
  texto = texto + '</tr>';
  texto = texto + '<tr>';
  texto = texto + '<td><input  name="paranome2"  type="text"  maxlength="35" size="25" value="" class="tam-med" style="width: 200px;" /></td>';
  texto = texto + '<td><input  name="paraemail2"  type="text"  maxlength="50" size="33" value="" class="tam-med" style="width: 200px;" /></td>';
  texto = texto + '</tr>';
//  texto = texto + '<tr>';
//  texto = texto + '<td><span><strong>3.Nome do destinat&aacute;rio</strong></span></td>';
//  texto = texto + '<td><span><strong>E-mail do destinat&aacute;rio</strong></span></td>';
//  texto = texto + '</tr>';
//  texto = texto + '<tr>';
//  texto = texto + '<td><input  name="paranome3"  type="text"  maxlength="35" size="25" value="" class="tam-med"/></td>';
//  texto = texto + '<td><input  name="paraemail3"  type="text"  maxlength="50" size="33" value="" class="tam-med"/></td>';
//  texto = texto + '</tr>';
  texto = texto + '<tr><td colspan="2"><span><strong>Sua mensagem</strong></span></td></tr>';
  texto = texto + '<tr><td colspan="2"><textarea  name="demensagem" cols="85" rows="3" ></textarea></td></tr>';
  texto = texto + '<tr><td colspan="2" height=5></td></tr>';
  texto = texto + '<tr><td colspan="2"><input type="submit" name="bt_salvar" value="Enviar Mensagem" class="botao" />&nbsp;&nbsp;&nbsp;<input type="button" name="btcanc" value="cancelar" class="botao" OnClick="bodyAlpha_close();" /></td></tr>';
  texto = texto + '<input type="hidden" name="cod_interacao" value="' + j_interacao + '" />';  
  texto = texto + '<input type="hidden" name="cod_funcionalidade_cadastro" value="' + j_cod_funcionalidade_cadastro + '" />';
  texto = texto + '<input type="hidden" name="titulo" value="' + j_titulo + '" />';
	texto = texto + '</table>';
	texto = texto + '</form></div>';	
	bodyAlpha_open("janela-alert" , texto);
}


function enviaporemail_generico(j_url) {
	texto = '<div style="height:360px; overflow: auto;">';
	texto = texto + '<form id="form_envia_email" method="post" action="' + URL_SITE + 'frame-envia-por-email-generico.php" target="server">';		
	//texto = texto + '<input name="topo" type="text" style="height:0px;width:0px;border-width:0px;font-size:0px;background-color:transparent;">';
	texto = texto + '<a href="javascript:bodyAlpha_close();" style="float: right;">Fechar</a>';
	texto = texto + '<strong>Enviar: </strong>' + j_url+'<br/>';
	texto = texto + '<div id="msg_enviaporemail"></div>';
	texto = texto + '<table width="456" border="0" cellspacing="0" cellpadding="0">';
  texto = texto + '<tr>';
  texto = texto + '<td><strong>Seu nome</strong></td>';
  texto = texto + '<td><strong>Seu e-mail</strong></td>';
  texto = texto + '</tr>';	
  texto = texto + '<tr>';
  texto = texto + '<td><input name="denome" type="text" maxlength="35" size="25" value="' + dados_nome + '" class="tam-med" style="width: 200px;" /></td>';
  texto = texto + '<td><input name="deemail" type="text" maxlength="50" size="33" value="' + dados_mail + '" class="tam-med" style="width: 200px;" /></td>';
  texto = texto + '</tr>';	
//  texto = texto + '<tr><td colspan="2">&nbsp;</td></tr>';
  texto = texto + '<tr>';
  texto = texto + '<td><span><strong>1.Nome do destinat&aacute;rio</strong></span></td>';
  texto = texto + '<td><span><strong>E-mail do destinat&aacute;rio</strong></span></td>';
  texto = texto + '</tr>';
  texto = texto + '<tr>';
  texto = texto + '<td><input  name="paranome1"  type="text"  maxlength="35" size="25" value="" class="tam-med" style="width: 200px;" /></td>';
  texto = texto + '<td><input  name="paraemail1"  type="text"  maxlength="50" size="33" value="" class="tam-med" style="width: 200px;" /></td>';
  texto = texto + '</tr>';
  texto = texto + '<tr>';
  texto = texto + '<td><span><strong>2.Nome do destinat&aacute;rio</strong></span></td>';
  texto = texto + '<td><span><strong>E-mail do destinat&aacute;rio</strong></span></td>'
  texto = texto + '</tr>';
  texto = texto + '<tr>';
  texto = texto + '<td><input  name="paranome2"  type="text"  maxlength="35" size="25" value="" class="tam-med" style="width: 200px;" /></td>';
  texto = texto + '<td><input  name="paraemail2"  type="text"  maxlength="50" size="33" value="" class="tam-med" style="width: 200px;" /></td>';
  texto = texto + '</tr>';
//  texto = texto + '<tr>';
//  texto = texto + '<td><span><strong>3.Nome do destinat&aacute;rio</strong></span></td>';
//  texto = texto + '<td><span><strong>E-mail do destinat&aacute;rio</strong></span></td>';
//  texto = texto + '</tr>';
//  texto = texto + '<tr>';
//  texto = texto + '<td><input  name="paranome3"  type="text"  maxlength="35" size="25" value="" class="tam-med"/></td>';
//  texto = texto + '<td><input  name="paraemail3"  type="text"  maxlength="50" size="33" value="" class="tam-med"/></td>';
//  texto = texto + '</tr>';
  texto = texto + '<tr><td colspan="2"><span><strong>Sua mensagem</strong></span></td></tr>';
  texto = texto + '<tr><td colspan="2"><textarea  name="demensagem" cols="85" rows="3" ></textarea></td></tr>';
  texto = texto + '<tr><td colspan="2" height=5></td></tr>';
  texto = texto + '<tr><td colspan="2"><input type="submit" name="bt_salvar" value="Enviar Mensagem" class="botao" />&nbsp;&nbsp;&nbsp;<input type="button" name="btcanc" value="cancelar" class="botao" OnClick="bodyAlpha_close();" /></td></tr>';
  texto = texto + '<input type="hidden" name="url_link" value="' + j_url + '" />';  
	texto = texto + '</table>';
	texto = texto + '</form></div>';	
	bodyAlpha_open("janela-alert" , texto);
}
/*envia-por-email.js*/

/*beta-feedback.js*/
function beta_feedback() {
	div = document.getElementById('beta-feedback-conteudo');
	if (div.className == "ocultar") {
		document.getElementById('server').src = url_site_atual + "frame-beta-feedback.php?mostra_form";
		div.className = "";
	}
	else {
		div.innerHTML = "";
		div.className = "ocultar";
	}
}
/*beta-feedback.js*/

// creates an XMLHttpRequest instance
function createXMLHttpRequestObject() {
	// xmlHttp will store the reference to the XMLHttpRequest object
	var xmlHttp;
	// try to instantiate the native XMLHttpRequest object
	try {
		// create an XMLHttpRequest object
		xmlHttp = new XMLHttpRequest();
	}
	catch(e) {
		// assume IE6 or older
		try {
			xmlHttp = new ActiveXObject("Microsoft.XMLHttp");
		}
		catch(e) { }
	}
	// return the created object or display an error message
	if (!xmlHttp) {
		//alert("Arrume um navegador decente com menos de 50 anos!");
	}
	else 
		return xmlHttp;
}

function atualiza_div(nome_obj_destino, url_request) {
	var obj_destino = document.getElementById(nome_obj_destino);

	var request =  new createXMLHttpRequestObject();
	request.open("GET", url_request, true);
	request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	request.setRequestHeader("Expires", "Mon, 26 Jul 1997 05:00:00 GMT");
	
	request.onreadystatechange = function() {
		if (request.readyState == 4 && request.status == 200) {
			var txt = request.responseText;
			if ( txt != "" ) {
				obj_destino.innerHTML = txt;
			}
		}
	};
	request.send(null);
}

function limpa_div(nome_obj) {
	obj = document.getElementById(nome_obj);
	obj.innerHTML = "";
}

function valida_form_busca(palavra) {
	if (palavra.length == 0) {
		alert('Digite um termo no campo de busca.');
		return false;
	}
	
	return true;
}

function seleciona_aba_busca(aba) {
	var conteudo = document.getElementById('busca_aba_conteudo');
	var pessoas = document.getElementById('busca_aba_pessoas');
	var shopping = document.getElementById('busca_aba_shopping');
	
	switch(aba) {
		case 'conteudo':
			document.formbusca.setAttribute('action', URL_SITE+'busca-resultado.php');
			document.getElementById('buscar').setAttribute('name', 'buscar');
			conteudo.className = 'ativo';
			pessoas.className = 'inativo';
			shopping.className = 'inativo';
			break;
		case 'pessoas':
			document.formbusca.setAttribute('action', URL_SITE+'lista-usuarios.php');
			document.getElementById('buscar').setAttribute('name', 'buscar');
			conteudo.className = 'inativo';
			pessoas.className = 'ativo';
			shopping.className = 'inativo';
			break;
		case 'shopping':
			document.formbusca.setAttribute('action', 'http://busca.buscape.com.br/cprocura');
			document.getElementById('buscar').setAttribute('name', 'produto');
			conteudo.className = 'inativo';
			pessoas.className = 'inativo';
			shopping.className = 'ativo';
			break;
	}
	document.getElementById('tipo_busca').value = aba;
}

function QueryString(parametro) {
var posInt = window.location.href.indexOf('?',0);
var posIgual = window.location.href.indexOf('=',0);

var find = 0;
if (posIgual != -1) {
        var strGets = window.location.href.slice(posInt+1);
        strParam = new Array();
        if (strGets.indexOf("&",0) == -1) {
                find = 1
                strParam[0] = new Array();
                strParam[0] = strGets.split("=");
        return strParam[0][1];
        }else{
                strParamTotais = strGets.split("&");                
                for (var i=0; i<strParamTotais.length; i++) {
                        strParam[i] = new Array();
                        strParam[i] = strParamTotais[i].split("=");
                                if (strParam[i][0] == parametro){
                                        find = 1;
                                        return strParam[i][1];
                                }
                }
                
        }
                if (find == 0) {
                        //alert("O parâmetro '"+parametro+"' não foi localizado!");
                        return "";
                }
}

}

// Funções de comentário
function denuncie_geral(texto_complementar, url_site_atual, url_site, cod_interacao, cod_funcionalidade_cadastro, pagina_atual) {
	if (arguments.length == 0) {
		texto_complementar = '';
	}
	var html = '' +
	'<a href="javascript:bodyAlpha_close();" style="float: right;">Fechar</a>' +
	'<form method="post" action="' + url_site_atual + 'frame-denuncie.php?cod_interacao=' + cod_interacao + '&cod_funcionalidade_cadastro=' + cod_funcionalidade_cadastro + '&url=' + pagina_atual + '" target="server">' +
	'	<p>Você está prestes a denunciar uma violação dos nossos <a href="' + url_site + 'termos-de-uso.php" target="_blank">termos de uso</a></p>' +
	'	<p>Selecione a opção mais apropriada abaixo.</p>' +
	'	<input type="radio" name="motivo" value="nudez" id="motivo_nudez" /><label for="motivo_nudez">Nudez</label><br />' +
	'	<input type="radio" name="motivo" value="spam" id="motivo_spam" /><label for="motivo_spam">Spam</label><br />' +
	'	<input type="radio" name="motivo" value="violencia" id="motivo_violencia" /><label for="motivo_violencia">Incitação ao ódio ou conteúdo violento</label><br />' +
	'	<input type="radio" name="motivo" value="pessoal" id="motivo_pessoal" /><label for="motivo_pessoal">Ataques pessoais contra uma pessoa</label><br />' +
	'	<input type="radio" name="motivo" value="direitos" id="motivo_direitos" /><label for="motivo_direitos">Uso de material protegido por direitos autorais</label><br />' +
	'	<input type="radio" name="motivo" value="outros" id="outros" /><label for="outros">Outros</label><br /><br />' +
	'	<label for="mensagem">Mensagem</label>' +
	'	<textarea name="mensagem" id="mensagem" class="tam-gig" rows="5"></textarea><br />' +
	'	<input type="hidden" name="texto_complementar" value="'+texto_complementar+'" />' +
	'	<button class="botao" type="submit">Enviar</button>' +
	'</form>';

	bodyAlpha_open('janela-alert', html);
}
function comentar() {
	if (!logado) {
		document.getElementById('motivo_login').innerHTML = 'Faça seu login ou cadastre-se para enviar um comentário';
	}
	//location.href = location.href.substring(0, location.href.lastIndexOf('#')) + '#interacao';
	location.hash = 'interacao';
}

function relevar_geral(cod_funcionalidade_cadastro, cod_interacao, cod_comentario, url_site_atual) {
	if (!logado) {
		mostra_form_login('Faça seu login ou cadastre-se para votar em um comentário');
		//document.getElementById('motivo_login').innerHTML = 'Faça seu login ou cadastre-se para votar em um comentário';
		location.href = location.href.substring(0, location.href.lastIndexOf('#')) + '#interacao';
	} else {
		document.getElementById('server').src = url_site_atual + 'frame-publicador.php?cod_funcionalidade_cadastro=' + cod_funcionalidade_cadastro + '&cod_interacao=' + cod_interacao + '&cod_comentario=' + cod_comentario + '&acao=releva_comentario';
	}
}

function responder_geral(cod_funcionalidade_cadastro, cod_interacao, cod_comentario, cod_form, sem_cadastro) {
	if (sem_cadastro) {
		document.getElementById('div_resposta_sem_cadastro_'+cod_form).style.display = 'block';
		document.getElementById('div_resposta_sem_cadastro_check_'+cod_form).style.display = 'block';
		document.getElementById('div_resposta_sem_cadastro_check_2_'+cod_form).style.display = 'block';
		document.getElementById('form_resposta_'+cod_form).style.display = 'block';
		document.getElementById('recaptcha_image_'+cod_form).src = url_site_atual + 'securimage_show.php?sid=' + Math.random();
		document.getElementById('aviso_resposta_sem_cadastro_'+cod_form).style.display = 'block';
		document.getElementById('recaptcha_response_field_'+cod_form).disabled = false;
	} else {
		document.getElementById('form_resposta_'+cod_form).style.display = 'block';
	}
}

function valida_form_resposta(form) {
	if (trim(form.descricao.value) == '') {
		alert('digite a mensagem da resposta');
		form.descricao.focus();
		return false;
	}
	if (!logado) {
		if (trim(form.nome.value) == '') {
			alert('o campo nome é obrigatório');
			form.nome.focus();
			return false;
		}
		if (trim(form.email.value) == '') {
			alert('o campo e-mail é obrigatório');
			form.email.focus();
			return false;
		}
		if (trim(form.recaptcha_response_field.value) == '') {
			alert('digite as palavras que aparecem na imagem separadas por um espaço');
			form.recaptcha_response_field.focus();
			return false;
		}
		if (!form.termo.checked) {
			alert('É preciso aceitar os termos de uso antes de postar');
			form.termo.focus();
			return false;
		}
	}
	return true;
}

function on_off_respostas(num, div) {
	var div_resp = document.getElementById('respostas_' + num);
	var form_resp = document.getElementById('form_resposta_' + num);
	if (div_resp.style.display == 'none') {
		div_resp.style.display = 'block';
		div.className = 'ativo';
	} else {
		div_resp.style.display = 'none';
		div.className = 'inativo';
		form_resp.style.display = 'none';
	}
}

function mostra_form_login_geral(motivo_login, id_form, id_form2) {
	if (motivo_login != undefined) {
		alert(motivo_login);
	}
	if (id_form != undefined) {
		document.getElementById('form_login').id_form.value = id_form;
	}
	document.getElementById('form_login').style.display = "block";
	document.getElementById(id_form2).style.display = "none";
}

function mostra_form_comentario_geral(sem_cadastro, id_form) {
	document.getElementById('form_login').style.display = "none";
	var form_comentario = document.getElementById(id_form);
	form_comentario.style.display = "block"
	if (sem_cadastro) {
		document.getElementById('div_comentario_sem_cadastro').style.display = "block";
		document.getElementById('div_comentario_sem_cadastro_check').style.display = "block";
		document.getElementById('div_comentario_sem_cadastro_check_2').style.display = "block";
		document.getElementById('aviso_comentario_sem_cadastro').style.display = "block";
		document.getElementById('div_recaptcha_comentario').style.display = "block";
	}
}

function valida_form_comentario (form) {
	if (trim(form.titulo.value) == "") {
		alert('o campo título é obrigatório');
		form.titulo.focus();
		return false;
	}
	else if (trim(form.mensagem.value) == "") {
		alert('o campo mensagem é obrigatório');
		form.mensagem.focus();
		return false;
	}
	if (!logado) {
		if (trim(form.nome.value) == "") {
			alert('o campo nome é obrigatório');
			form.nome.focus();
			return false;
		}
		if (trim(form.email.value) == "") {
			alert('o campo e-mail é obrigatório');
			form.email.focus();
			return false;
		}
		if (trim(form.recaptcha_response_field.value) == "") {
			alert('digite as palavras que aparecem na imagem separadas por um espaço');
			form.recaptcha_response_field.focus();
			return false;
		}
		if (!form.termo.checked) {
			alert('É preciso aceitar os termos de uso antes de postar');
			form.termo.focus();
			return false;
		}
	}
	var texto = "<h1>aguarde</h1>";
	return true;
}

function deveSeLogarLogin() {
	document.getElementById("deve-se-logar-login").style.display = "block";
}

function interacaoLogado_geral(id_form) {
	document.getElementById("deve-se-logar").style.display = "none";
	//oid = "<?= strtolower(str_replace(" " , "-" , str_ireplace("enviar comentário" , "envia-comentario" , $txt_tit_comentar))); ?>";
	obj = document.getElementById(id_form);
	obj.style.display = "block";
}

// FIM - funções comentário

$(function(){
	$("#gal-img-tudo").fadeIn();
	$("#gal-img-tudo .foto").animate({opacity: 0.6}, 'fast');
	$('.abre-fecha').hide();
	
	//$('<div id="gal-img-tela" ><img src="http://imagem.vilamulher.terra.com.br/interacao/thumb/50/novidades-nas-havaianas-50-126-thumb-570.jpg" /></div><div id="gal-img-descricao">Descrição da foto 1</div>')
	//.insertAfter('#gal-img');
	$('#gal-img-tudo .foto').click(function(event) {
		event.preventDefault();
		$('#gal-img-tela img').remove();
		$('<img />')
		.attr('src', $(this).attr('rel'))
		.css('opacity', '0.3')
		.appendTo('#gal-img-tela')
		.animate({opacity: 1 }, 1000);
		$('#gal-img-descricao')
		.html($(this).attr('alt'));
		$('#gal-img img')
		.animate({opacity: 0.6}, 'fast')
		.removeClass('foto-ativa');
		$(this)
		.stop().animate({opacity: 1}, 'fast')
		.addClass('foto-ativa');
	});
	$('.foto-ativa').animate({opacity: 1 }, 1000);
	// mouseover
	$("#gal-img img").hover(function () {
		$(this).stop().animate({opacity: 1 }, 'fast');
	},
	// mouseout
	function () {
	if ($(this).attr('class') != "foto foto-ativa")
		$(this).stop().animate({opacity: 0.6 }, 'fast');
	});
});