function fechar_aviso(campo) {

	document.getElementById(campo).style.display = "none";

}

function checa_dados_cadastro(formulario) {

/*

		var erros = "0";

		for (i = 0; i < document.getElementById(formulario).length; i++) {

		if (document.getElementById(formulario)[i].value == "") {

			if (document.getElementById('erro_' + document.getElementById(formulario)[i].name) !== null) {

	            document.getElementById('erro_' + document.getElementById(formulario)[i].name).style.display = "block";

				erros = ++erros;

			}

			if (i == "60") { 

				if (document.getElementById(formulario)[i].value == "dd/mm/yyyy") {

		            document.getElementById('erro_' + document.getElementById(formulario)[i].name).style.display = "none";					

					erros = ++erros;					

				}	

			}

    	}

		else {

		    if (document.getElementById('erro_' + document.getElementById(formulario)[i].name) !== null) {

	            document.getElementById('erro_' + document.getElementById(formulario)[i].name).style.display = "none";

			}

	      }

	    }

		if(erros=="0") { 

			switch(formulario) {

				case "cad_usuario": { document.cad_usuario.submit(); }

				case "cad_usuario2": { document.cad_usuario2.submit(); }

			}

		}

*/		

}

function verificar_formulario_cadastro() {

/*

	var mensagem_de_erro;

	var erros = "0";

	mensagem_de_erro = "";

	if ((document.cad_usuario.form_cadastro.senha.value == "") || (document.form_cadastro.form_cadastro.senha_confirmacao.value == "")) {

		mensagem_de_erro = mensagem_de_erro+"Algum campo de senha est vzio, por favor digite uma senha para concluir o cadastro.";

		erros=erros+1;

	}

	else { 

		if (document.form_cadastro.form_cadastro.senha.value != document.form_cadastro.form_cadastro.senha_confirmacao.value) { 

			mensagem_de_erro = "As senhas digitadas no conferem. Digite novamente";

			erros=erros+1;

		}

	}

	if(erros!=0) { 

		document.form_cadastro.form_cadastro.senha.value = ""; 

		document.form_cadastro.form_cadastro.senha_confirmacao.value = ""; 

		alert(mensagem_de_erro); 

	} else { document.form_cadastro.submit(); }

*/

}

function campo_login(acao) { 

	if(acao=="mostrar") { document.getElementById('campo_login').innerHTML = "<form name=\"login_usuario\" method=\"post\" action=\"\"><table width=\"94\" height=\"106\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td width=\"109\" height=\"20\"><div align=\"center\"><div align=\"center\" style=\"color:#FFFF00; font-size:12px; font-weight:bold; font-family:Arial\"><div align=\"left\">Email:</div></div></div></td></tr><tr><td height=\"20\"><div align=\"center\"><input type=\"text\" style=\"height: 12px; width:80px; font-size:10px;\" name=\"login_usuario_email\" /></div></td></tr><tr><td height=\"20\"><div align=\"left\"><span style=\"color:#FFFF00; font-size:12px; font-weight:bold; font-family:Arial\">Senha:</span></div></td></tr><tr><td><div align=\"center\"><div align=\"center\"><input name=\"login_usuario_senha\" type=\"password\" style=\"height: 12px; width:80px;\" /></div></div></td></tr><tr><td><div align=\"center\" style=\"font-size:6px;\">&nbsp;</div></td></tr><tr><td><div align=\"center\"><input type=\"submit\" name=\"Submit\" value=\"Login\" style=\"width:60; height:20; font-size:10px;\" /></div></td></tr><tr><td><div align=\"center\" style=\"font-size:6px;\">&nbsp;</div></td></tr><tr><td><div align=\"center\"><a href=\"?secao=cadastro\" style=\"color:#FFFF00; font-family:Arial; font-size:10px; font-weight:bold;\">CADASTRAR</a><a href=\"?secao=cadastro\"></a></div></td></tr><tr><td><div align=\"center\"><a href=\"?acao=lembrar_senha\" style=\"color:#FFFF00; font-family:Arial; font-size:10px; font-weight:bold;\">LEMBRAR SENHA</a></div></td></tr><tr><td><div align=\"center\"><a href=\"javascript:campo_login('ocultar')\" style=\"color:#FFFF00; font-family:Arial; font-size:10px; font-weight:bold;\">OCULTAR</a></div></td></tr></table><input name=action type=hidden id=action value=\"login_usuario\"></form>";

	

	}

	if(acao=="ocultar") { 

	document.getElementById('campo_login').innerHTML ="<strong><font color=#999999 style=area_de_login_texto2><a href=javascript:campo_login('mostrar')>LOGIN</a></font></strong>";

	}

}

function calcula_caracteres(campo_comentario, campo_caracteres_restantes, caracteres) { 

		intCaracteres = caracteres - window.document.getElementById(campo_comentario).value.length; 

		if (intCaracteres > 0) { 

			window.document.getElementById(campo_caracteres_restantes).value = intCaracteres;

			return true; 

		} else { 

			intMensagem = caracteres; 

			window.document.getElementById(campo_caracteres_restantes).value = 0; 

			window.document.getElementById(campo_comentario).value = window.document.getElementById(campo_comentario).value.substr(0,intMensagem);

			return false;

	} 

}

function campo_recado(acao) { 

	if(acao=="mostrar") { 

		document.getElementById('div_especial_perfil_usuario').style.display = "block";

		document.getElementById('div_especial_espaco').innerHTML = "<font class=\"perfil_usuario_campo_especial_titulo\">Deixar Recado:</font><br><br><div align=\"center\"><form id=\"perfil_recado\" name=\"perfil_recado\" method=\"post\" action=\"\"><textarea name=\"perfil_usuario_recado_texto\" id=\"perfil_usuario_recado_texto\" cols=\"60\" rows=\"6\" class=\"perfil_usuario_campo_especial_textarea\" onkeyup=\"javascript:comentario_calcula_caracteres('perfil_usuario_recado_texto', 'comentario_usuario_caracteres_restantes', '600');\"></textarea><br /><table width=\"312\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td width=\"280\">&nbsp;</td><td width=\"32\"><span class=\"style1\"><input name=\"comentario_usuario_caracteres_restantes\" id=\"comentario_usuario_caracteres_restantes\" type=\"text\" style=\"width:34px; height:17; font-family:Arial; color:#000000; font-size:10px; text-align:center;\" value=\"600\" size=\"3\" maxlength=\"3\"></span></td></tr></table><br /><input type=\"button\" name=\"Submit2\" value=\"Cancelar\" onclick=\"javascript:fechar_aviso('div_especial_perfil_usuario');\" style=\"width:60px; height:20px; font-size:12px;\" /><input type=\"submit\" name=\"Submit\" value=\"Enviar\" style=\"width:60px; height:20px; font-size:12px;\" /><input name=\"acao\" type=\"hidden\" id=\"acao\" value=\"postar_recado\" /></form></div>";

		document.getElementById('perfil_usuario_recado_texto').focus();

		document.getElementById('perfil_usuario_recado_texto').focus();

	}

}

function campo_nota(acao) {

	if(acao=="mostrar") { 

		document.getElementById('div_especial_perfil_usuario').style.display = "block";

		document.getElementById('div_especial_espaco').innerHTML = "<font class=\"perfil_usuario_campo_especial_titulo\">Dar Nota:</font><br><br><form name=\"perfil_nota\" method=\"post\" action=\"\"><div align=\"center\"><table width=\"82\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td width=\"41\" class=\"perfil_usuario_campo_especial_texto\">Nota:&nbsp;&nbsp;</td><td width=\"41\"><select name=\"perfil_usuario_nota\" id=\"perfil_usuario_nota\"><option class=\"perfil_usuario_campo_especial_list\" value=\"5\">5</option><option value=\"6\">6</option><option value=\"7\">7</option><option value=\"8\">8</option><option value=\"9\">9</option><option value=\"10\">10</option></select></td></tr></table><input name=\"acao\" type=\"hidden\" id=\"acao\" value=\"postar_nota\"><br><input type=\"button\" name=\"Submit2\" value=\"Cancelar\" onClick=\"javascript:fechar_aviso('div_especial_perfil_usuario');\" style=\"width:60px; height:20px; font-size:12px;\"><input type=\"submit\" name=\"Submit\" value=\"Votar\" style=\"width:60px; height:20px; font-size:12px;\"></div></form>";

		document.perfil_nota.perfil_usuario_nota.focus();

		document.perfil_nota.perfil_usuario_nota.focus();

	}

}

function add_favorito() {

	document.add_favorito.submit();

}

function del_favorito() {

	document.del_favorito.submit();

}

function favoritos(acao) {

	if (acao == 'mostrar') {

		document.getElementById('nota_link').innerHTML = "<br><iframe src=\"includes/favoritos.php\"  name=\"favoritos\" width=\"120\" height=\"90\" align=\"middle\" frameborder=\"0\" id=\"calendario\"> </iframe><br>";



		document.getElementById('link_favoritos').innerHTML = "<strong><span class=\"secao_perfil_links\" style=\"font-size:14px\"><a href=\"javascript:favoritos('ocultar')\">Ver Favoritos </a></span></strong>";



}

	if (acao == 'ocultar') {

		document.getElementById('nota_link').innerHTML = "";

		document.getElementById('link_favoritos').innerHTML = "<strong><span class=\"secao_perfil_links\" style=\"font-size:14px\"><a href=\"javascript:favoritos('mostrar')\">Ver Favoritos </a></span></strong>";

	}

}

function add_album() {

	document.add_album.submit();

}

function del_album() {

	document.del_album.submit();

}

function agenda(acao,id) {

	if (acao == 'adicionar') {

		document.agenda.agenda_id_evento.value = id;

		document.agenda.acao.value = 'agenda_adicionar';

		document.agenda.submit();

	}

	if (acao == 'remover') {

		document.agenda.agenda_id_evento.value = id;

		document.agenda.acao.value = 'agenda_remover';

		document.agenda.submit();

	}

}

function campo_torpedo(acao) {

	if (acao == 'mostrar') { 

		document.getElementById('campo_torpedo').innerHTML = "<META http-equiv=Content-Type content=\"text/html; charset=iso-8859-1\"><form method=\"post\" action=\"\"><div align=\"center\"><textarea name=\"torpedo_texto\" id=\"torpedo_texto\" cols=\"10\" rows=\"6\" onkeyup=\"javascript:comentario_calcula_caracteres('torpedo_texto', 'torpedo_caracteres_restantes', '81');\" class=\"principal_torpedos_textarea\"></textarea><br><table width=\"113\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td><div align=\"right\"><input name=\"torpedo_caracteres_restantes\" type=\"text\" id=\"torpedo_caracteres_restantes\" value=\"81\" class=\"principal_torpedos_contador\" style=\"width:34px; height:17; font-family:Arial; color:#000000; font-size:10px; text-align:center;\"></div></td></tr> </table><input name=\"Submit\" type=\"submit\" class=\"principal_torpedos_botoes\" value=\"Enviar\"/>&nbsp;&nbsp;<input name=\"Submit2\" type=\"button\" value=\"Cancelar\" onclick=\"javascript:campo_torpedo('ocultar');\"  class=\"principal_torpedos_botoes\"/><input name=\"acao\" type=\"hidden\" id=\"acao\" value=\"postar_torpedo\"></div></form>"; 

		document.getElementById('link_torpedo').innerHTML = "";

		window.document.getElementById('torpedo_texto').focus();

}

	if (acao == 'ocultar') { 

		document.getElementById('campo_torpedo').innerHTML = "<iframe src=\"includes/principal/torpedos.php\"  name=\"torpedo\" width=\"122\" height=\"120\" align=\"middle\" frameborder=\"0\" id=\"torpedo\"> </iframe>"; 

		document.getElementById('link_torpedo').innerHTML = "<div align=\"center\" id=\"main_torpedo_link\"><a href=\"javascript:campo_torpedo('mostrar');\" class=\"link_001\" title=\"Clique aqui para enviar uma mensagem ao site\">Mandar Torpedo</a>";

	}

}

function login_armazena() {

	window.document.getElementById('login_email').value = window.document.getElementById('campo_email').value;

	window.document.getElementById('login_senha').value = window.document.getElementById('campo_senha').value;

	if (window.event.keyCode == 13) { window.document.form_login.submit(); }

}

function editar_perfil(campo, acao) {

	if (campo == 'im') {

		if (acao == 'armazena') {



			if (window.document.getElementById('editar_perfil_select_im').value == "MSN") { 

				window.document.getElementById('editar_perfil_im_msn').value = window.document.getElementById('editar_perfil_im_address').value; 

				window.document.getElementById('editar_perfil_im_msn_exibicao').value = window.document.getElementById('editar_perfil_select_im_exibicao').selectedIndex;					

			}

			if (window.document.getElementById('editar_perfil_select_im').value == "Yahoo") { 

				window.document.getElementById('editar_perfil_im_yahoo').value = window.document.getElementById('editar_perfil_im_address').value; 

				window.document.getElementById('editar_perfil_im_yahoo_exibicao').value = window.document.getElementById('editar_perfil_select_im_exibicao').selectedIndex;					

			}

			if (window.document.getElementById('editar_perfil_select_im').value == "IRC") { 

				window.document.getElementById('editar_perfil_im_irc').value = window.document.getElementById('editar_perfil_im_address').value;

				window.document.getElementById('editar_perfil_im_irc_exibicao').value = window.document.getElementById('editar_perfil_select_im_exibicao').selectedIndex;					

			}

		}

		if (acao == 'restaura') {

			if (window.document.getElementById('editar_perfil_select_im').value == "MSN") { 

				window.document.getElementById('editar_perfil_im_address').disabled = false;			

				window.document.getElementById('editar_perfil_select_im_exibicao').disabled = false;								

				window.document.getElementById('editar_perfil_im_address').value = window.document.getElementById('editar_perfil_im_msn').value; 

				window.document.getElementById('editar_perfil_select_im_exibicao').selectedIndex = window.document.getElementById('editar_perfil_im_msn_exibicao').value;

			}

			if (window.document.getElementById('editar_perfil_select_im').value == "Yahoo") { 

				window.document.getElementById('editar_perfil_im_address').disabled = false;	

				window.document.getElementById('editar_perfil_select_im_exibicao').disabled = false;								

				window.document.getElementById('editar_perfil_im_address').value = window.document.getElementById('editar_perfil_im_yahoo').value; 

				window.document.getElementById('editar_perfil_select_im_exibicao').selectedIndex = window.document.getElementById('editar_perfil_im_yahoo_exibicao').value;

				}

			if (window.document.getElementById('editar_perfil_select_im').value == "IRC") { 

				window.document.getElementById('editar_perfil_im_address').disabled = false;		

				window.document.getElementById('editar_perfil_select_im_exibicao').disabled = false;								

				window.document.getElementById('editar_perfil_im_address').value = window.document.getElementById('editar_perfil_im_irc').value; 

				window.document.getElementById('editar_perfil_select_im_exibicao').selectedIndex = window.document.getElementById('editar_perfil_im_irc_exibicao').value;

				}

			if (window.document.getElementById('editar_perfil_select_im').value == "") { 		

				window.document.getElementById('editar_perfil_im_address').value = "<< Escolha";			

				window.document.getElementById('editar_perfil_select_im_exibicao').disabled = true;								

				window.document.getElementById('editar_perfil_im_address').disabled = true;

			}			

		}

	}

	

	if (campo == 'site') {

		if (acao == 'armazena') {		

			if(window.document.getElementById('editar_perfil_select_site').value == "Blog") { 

				window.document.getElementById('editar_perfil_site_blog').value = window.document.getElementById('editar_perfil_site_address').value;

				window.document.getElementById('editar_perfil_site_blog_exibicao').value = window.document.getElementById('editar_perfil_select_site_exibicao').selectedIndex;							

			}

			if(window.document.getElementById('editar_perfil_select_site').value == "Flog") { 

				window.document.getElementById('editar_perfil_site_flog').value = window.document.getElementById('editar_perfil_site_address').value; 

				window.document.getElementById('editar_perfil_site_flog_exibicao').value = window.document.getElementById('editar_perfil_select_site_exibicao').selectedIndex;						

			}

			if(window.document.getElementById('editar_perfil_select_site').value == "Orkut") { 	

				window.document.getElementById('editar_perfil_site_orkut').value = window.document.getElementById('editar_perfil_site_address').value;

				window.document.getElementById('editar_perfil_site_orkut_exibicao').value = window.document.getElementById('editar_perfil_select_site_exibicao').selectedIndex;							

			}

		}

		if (acao == 'restaura') {

			if(window.document.getElementById('editar_perfil_select_site').value == "Blog") { 

				window.document.getElementById('editar_perfil_site_address').disabled = false;								

				window.document.getElementById('editar_perfil_select_site_exibicao').disabled = false;											

				window.document.getElementById('editar_perfil_site_address').value = window.document.getElementById('editar_perfil_site_blog').value;

				window.document.getElementById('editar_perfil_select_site_exibicao').selectedIndex = window.document.getElementById('editar_perfil_site_blog_exibicao').value;				

			}

			if(window.document.getElementById('editar_perfil_select_site').value == "Flog") { 

				window.document.getElementById('editar_perfil_select_site_exibicao').disabled = false;											

				window.document.getElementById('editar_perfil_site_address').disabled = false;								

				window.document.getElementById('editar_perfil_site_address').value = window.document.getElementById('editar_perfil_site_flog').value; 

				window.document.getElementById('editar_perfil_select_site_exibicao').selectedIndex = window.document.getElementById('editar_perfil_site_flog_exibicao').value;				

			}

			if(window.document.getElementById('editar_perfil_select_site').value == "Orkut") { 

				window.document.getElementById('editar_perfil_select_site_exibicao').disabled = false;											

				window.document.getElementById('editar_perfil_site_address').disabled = false;								

				window.document.getElementById('editar_perfil_site_address').value = window.document.getElementById('editar_perfil_site_orkut').value; 

				window.document.getElementById('editar_perfil_select_site_exibicao').selectedIndex = window.document.getElementById('editar_perfil_site_orkut_exibicao').value;				

			}

			if (window.document.getElementById('editar_perfil_select_site').value == "") {

				window.document.getElementById('editar_perfil_site_address').value = "<< Escolha";

				window.document.getElementById('editar_perfil_select_site_exibicao').disabled = true;								

				window.document.getElementById('editar_perfil_site_address').disabled = true;

			}						

		}

	}

}

function evento_foto_campo_comentario(acao) {

	if (acao == 'mostrar') {

		document.getElementById('div_especial_evento').style.display = "block";

		window.document.getElementById('div_especial_evento_espaco').innerHTML = "<div align=\"center\"><font class=\"evento_album_campo_especial_titulo\">Comentar</font> <form id=\"form1\" name=\"form1\" method=\"post\" action=\"\"><textarea name=\"evento_foto_campo_comentario\" cols=\"40\" rows=\"6\" id=\"evento_foto_campo_comentario\" class=\"evento_album_campo_especial_textarea\" onKeyUp=\"javascript:comentario_calcula_caracteres('evento_foto_campo_comentario', 'evento_foto_caracteres_restantes', '320');\"></textarea><br /><table width=\"212\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td width=\"184\">&nbsp;</td><td width=\"28\"><span class=\"style1\" align=\"right\"><input name=\"evento_foto_caracteres_restantes\" type=\"text\" id=\"evento_foto_caracteres_restantes\" style=\"width:24px; height:14; font-family:Arial; color:#000000; font-size:9px; text-align:center;\" value=\"320\" size=\"3\" maxlength=\"3\"></span></td></tr></table><br /><input type=\"button\" name=\"Submit2\" value=\"Cancelar\" onclick=\"javascript:fechar_aviso('div_especial_evento');\"  style=\"width:60px; height:20px; font-size:12px;\" /><input type=\"submit\" name=\"Submit\" value=\"Enviar\" style=\"width:60px; height:20px; font-size:12px;\" /><input name=\"acao\" type=\"hidden\" id=\"acao\" value=\"evento_foto_comentar\" /></form></div>";

	window.document.getElementById('evento_foto_campo_comentario').focus();

	window.document.getElementById('evento_foto_campo_comentario').focus();

	}

}

function evento_foto_campo_nota(acao) {

	if (acao == 'mostrar') { 

		document.getElementById('div_especial_evento').style.display = "block";

		window.document.getElementById('div_especial_evento_espaco').innerHTML = "<div align=\"center\"><font class=\"evento_album_campo_especial_titulo\">Dar Nota</font><br><form name=\"form1\" method=\"post\" action=\"\"><table width=\"82\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td width=\"41\" class=\"evento_album_campo_especial_texto\">NOTA:&nbsp;&nbsp;</td><td width=\"41\"><select name=\"evento_foto_nota\" id=\"evento_foto_nota\" class=\"evento_album_campo_especial_list\"><option value=\"5\">5</option><option value=\"6\">6</option><option value=\"7\">7</option><option value=\"8\">8</option><option value=\"9\">9</option><option value=\"10\">10</option></select></td></tr></table><input name=\"acao\" type=\"hidden\" id=\"acao\" value=\"evento_foto_votar\"><br><input type=\"button\" name=\"Submit2\" value=\"Cancelar\" style=\"width:60px; height:20px; font-size:12px;\" onclick=\"javascript:fechar_aviso('div_especial_evento');\"><input type=\"submit\" name=\"Submit\" value=\"Votar\" style=\"width:60px; height:20px; font-size:12px;\"></form></div>";

		window.document.getElementById('evento_foto_nota').focus();		

		window.document.getElementById('evento_foto_nota').focus();		

	}

}

function add_album() {

	window.document.add_album.submit();

}

function del_album() {

	window.document.del_album.submit();

}

function addSWF (URL, WIDTH, HEIGHT, TRANSPARENT) {

	document.write (' <object classid="clsid:27CDB6E-AE6D-11cf-96B8-444553540000" ');

	document.write (' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" ');

	document.write (' width="'+ WIDTH +'" height="'+ HEIGHT +'">');

	document.write (' <param name="movie" value="'+ URL +'" />');

	document.write (' <param name="quality" value="high" />');

	if ( TRANSPARENT ) {

		document.write (' <param name="Wmode" value="Transparent" />'); 

	}

		document.write (' <embed src="'+ URL +'" quality="high" ');

	if ( TRANSPARENT ) {

		document.write (' Wmode = "transparent" ');

	}

	document.write (' pluginspage="http://www.macromedia.com/go/getflashplayer" ');

	document.write (' type="application/x-shockwave-flash" width="'+ WIDTH +'" height="'+ HEIGHT +'"></embed> ');

	document.write (' </object>');

}

function cadastro() {

	var erros = "0";

	var Campos_Formulario = new Array();

	Campos_Formulario[0] = "nome";

	Campos_Formulario[1] = "nick";

	Campos_Formulario[2] = "email";	

	Campos_Formulario[3] = "nascimento";

	Campos_Formulario[4] = "cidade";

	Campos_Formulario[5] = "validacao";		



	var Campos_Formulario_id = new Array();

	Campos_Formulario_id[0] = "0";

	Campos_Formulario_id[1] = "1";

	Campos_Formulario_id[2] = "2";

	Campos_Formulario_id[3] = "3";

	Campos_Formulario_id[4] = "8";		

	Campos_Formulario_id[5] = "10";		

		

//		for (i = 0; i < document.getElementById('cad_usuario').length; i++) {

	for (i = 0; i < 6; i++) {

		if (Campos_Formulario[Campos_Formulario_id[i]] != 'undefined') {

			if (document.getElementById('cad_usuario')[Campos_Formulario_id[i]].value == "") {

		        document.getElementById('erro_cad_usuario_'+Campos_Formulario[i]).style.display = "block";

				++erros;

			}

			else {

	        	document.getElementById('erro_cad_usuario_'+Campos_Formulario[i]).style.display = "none";

			}



			if (i == 3) {

				if (window.document.getElementById('cad_usuario')[i].value == "dd/mm/aaaa") {

			        document.getElementById('erro_cad_usuario_'+Campos_Formulario[i]).style.display = "block";

					++erros;			

				} else {

					if (window.document.getElementById('cad_usuario')[i].value != "") {

			        	document.getElementById('erro_cad_usuario_'+Campos_Formulario[i]).style.display = "none";					

					}

				}						

			}

		}

	}

	

	if (erros == 0) { 

		document.cad_usuario.submit(); 

	}

		

	for (x=0;x<document.getElementById('cad_usuario').length;x++) {

//			alert(x+': '+window.document.getElementById('cad_usuario')[x].value);

	}

}

function verificador_editar_perfil() {

	if ((window.document.getElementById('editar_perfil_senha_atual').value != "") || (window.document.getElementById('editar_perfil_nova_senha').value != "") || (window.document.getElementById('editar_perfil_nova_senha_confirmacao').value != "")) {

		if (window.document.getElementById('editar_perfil_senha_atual').value == "")  { window.document.getElementById('erro_editar_perfil_senha_atual').style.display = "block";  }

		else { window.document.getElementById('erro_editar_perfil_senha_atual').style.display = "none"; }

		if (window.document.getElementById('editar_perfil_nova_senha').value == "")  { window.document.getElementById('erro_editar_perfil_nova_senha').style.display = "block"; }

		else { window.document.getElementById('erro_editar_perfil_nova_senha').style.display = "none"; }		

		if (window.document.getElementById('editar_perfil_nova_senha_confirmacao').value == "")  { window.document.getElementById('erro_editar_perfil_nova_senha_confirmacao').style.display = "block"; }				

		else { window.document.getElementById('erro_editar_perfil_nova_senha_confirmacao').style.display = "none"; }		

		if ((window.document.getElementById('editar_perfil_senha_atual').value != "") && (window.document.getElementById('editar_perfil_nova_senha').value != "") && (window.document.getElementById('editar_perfil_nova_senha_confirmacao').value != "")) { 		

			if (window.document.getElementById('editar_perfil_nova_senha').value == window.document.getElementById('editar_perfil_nova_senha_confirmacao').value) { 

				window.document.form_editar_perfil.submit(); 

			}

			else { alert('Erro: As senhas digitadas não são iguais, por favor corrija-as.'); }

		}

	}

	if ((window.document.getElementById('editar_perfil_senha_atual').value == "") && (window.document.getElementById('editar_perfil_nova_senha').value == "") && (window.document.getElementById('editar_perfil_nova_senha_confirmacao').value == "")) {

		window.document.form_editar_perfil.submit(); 	

	}

}
function LoadImg(id) {		
	document.getElementById("carregando_"+id).style.display="none";
	document.getElementById("imagem_"+id).style.display="block";
}
/* CAIXA DE DIÁLOGO MOLDADA */

function pageWidth() {

	return window.innerWidth != null ? window.innerWidth: document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth:document.body != null? document.body.clientWidth:null;

}

function pageHeight() { 

	return window.innerHeight != null? window.innerHeight: document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight:document.body != null? document.body.clientHeight:null;}function posLeft() {return typeof window.pageXOffset != 'undefined' ? window.pageXOffset:document.documentElement && document.documentElement.scrollLeft? document.documentElement.scrollLeft:document.body.scrollLeft? document.body.scrollLeft:0;}function posTop() {return typeof window.pageYOffset != 'undefined' ? window.pageYOffset:document.documentElement && document.documentElement.scrollTop? document.documentElement.scrollTop: document.body.scrollTop?document.body.scrollTop:0; 

}

	

function $(x){ return document.getElementById(x); }



function scrollFix(){

		var obol=$('ol');

		obol.style.top=posTop()+'px';obol.style.left=posLeft()+'px';

}



function sizeFix(){

	var obol=$('ol');

	obol.style.height = pageHeight()+'px';

	obol.style.width=pageWidth()+'px';

}

function kp(e){

	ky=e?e.which:event.keyCode;

	if(ky==88||ky==120)hm();

	return false

}

function inf(h) { 

	tag = document.getElementsByTagName('select');

	for (i=tag.length-1;i>=0;i--) tag[i].style.visibility=h;

	tag = document.getElementsByTagName('iframe');

	for (i=tag.length-1;i>=0;i--) tag[i].style.visibility=h;

	tag = document.getElementsByTagName('object');

	for(i=tag.length-1;i>=0;i--) tag[i].style.visibility=h;

}



function sm(obl, wd, ht){

	var h='hidden';

	var b='block';

	var p='px';

	var obol=$('ol'); 

	var obbxd = $('mbd');

	obbxd.innerHTML = $(obl).innerHTML;

	obol.style.height=pageHeight()+p;

	obol.style.width=pageWidth()+p;

	obol.style.top=posTop()+p;

	obol.style.left=posLeft()+p;

	obol.style.display=b;

	var tp = posTop()+((pageHeight()-ht)/2)-12;

	var lt = posLeft()+((pageWidth()-wd)/2)-12;

	var obbx = $('mbox');

	obbx.style.top = (tp<0?0:tp)+p;

	obbx.style.left = (lt<0?0:lt)+p;

	obbx.style.width = wd+p;

	obbx.style.height = ht+p;inf(h);

	obbx.style.display = b;

	return false;

}



function hm(){

	var v = 'visible';

	var n = 'none';

	$('ol').style.display = n;

	$('mbox').style.display = n;

	inf(v);

	document.onkeypress = '';

}

function initmb() {

	var ab = 'absolute';

	var n = 'none';

	var obody = document.getElementsByTagName('body')[0];

	var frag = document.createDocumentFragment();

	var obol = document.createElement('div');

	obol.setAttribute('id','ol');

	obol.style.display = n;

	obol.style.position = ab;

	obol.style.top = 0;

	obol.style.left = 0;

	obol.style.zIndex = 998;

	obol.style.width = '100%';

	frag.appendChild(obol);

	var obbx = document.createElement('div');

	obbx.setAttribute('id','mbox');

	obbx.style.display = n;

	obbx.style.position = ab;

	obbx.style.zIndex = 999;

	var obl=document.createElement('span');

	obbx.appendChild(obl);

	var obbxd=document.createElement('div');

	obbxd.setAttribute('id','mbd');

	obl.appendChild(obbxd);

	frag.insertBefore(obbx,obol.nextSibling);

	obody.insertBefore(frag,obody.firstChild);

	window.onscroll = scrollFix; 

	window.onresize = sizeFix;

}

window.onload = initmb;      

function fechar_dialogo() {
	window.document.getElementById("caixa_dialogo").style.display = 'none';
}

function erro_login() {

	window.document.getElementById("caixa_dialogo").innerHTML = 'block';

	window.document.getElementById("caixa_dialogo").style.display = 'block';

}