/*
	@ JAVASCRIPTS VÁRIADOS DE VÁRIOS CRIADORES;
*/

function makevisible(cur,which)
{
	strength = (which == 0) ? 1 : 0.6
		if (cur.style.MozOpacity)
		{
			cur.style.MozOpacity = strength
		}
		else if (cur.filters)
		{
			cur.filters.alpha.opacity = strength*100
		}
}

function passwordCheck(pass)
{
	var senha = document.getElementById(pass).value;
	var entrada = 0;
	var resultadoado;

	if(senha.length < 4)
	{
		entrada = entrada - 1;
	}

	if(!senha.match(/[a-z_]/i) || !senha.match(/[0-9]/))
	{
		entrada = entrada - 1;
	}

	if(!senha.match(/\W/))
	{
		entrada = entrada - 1;
	}

	if(senha == '')
	{
		Resultado('pw', 'div_forca_senha', 'Campo en blanco', '#FF0000', 'erro');
	}

	else if(entrada == 0)
	{
		Resultado('pw', 'div_forca_senha', 'Contraseña Segura', 'green', 'acept');
	}
	else if(entrada == -1)
	{
		Resultado('pw', 'div_forca_senha', 'Contraseña Media', 'green', 'acept');
	}
	else if(entrada == -2)
	{
		Resultado('pw', 'div_forca_senha', 'Contraseña Insegura', '#FF0000', 'erro');
	}
	else if(entrada == -3)
	{
		Resultado('pw', 'div_forca_senha', 'Contraseña muy insegura', '#FF0000', 'erro');
	}
}

function janela(url, width, height, janela)
{  
		window.open(url, janela, 'width='+width+', height='+height+', top=50, left=50, scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}

function clearText(thefield)
{
	if (thefield.defaultValue == thefield.value)
	{
		thefield.value = "";
	}
}

function ApenasNumerosAki(e)
{       
	if (window.event)
	{
		tecla = e.keyCode;
	}

	else if (e.which)
	{
		tecla = e.which;
	}

	if ((tecla >= 48 && tecla <= 57) || (tecla == 8))
	{
		return true;
	}else{
		return false;
	}
}

function ApenasLetrasENumeros(e)
{       
	if (window.event)
	{
		tecla = e.keyCode;
	}

	else if (e.which)
	{
		tecla = e.which;
	}

	if ((tecla >= 48 && tecla <= 57) || (tecla == 8 ) || (tecla == 45) || (tecla >= 65 && tecla <= 90) || (tecla >= 97 && tecla <= 122) || (tecla == 95) || (tecla == 127) || (tecla == 255))
	{
		return true;
	}else{
		return false;
	}
}

function Captcha(div)
{
	document.getElementById(div).src='modules_/captcha_img.php?' + Math.random();
}

function Abrir(id,a)
{
	if(document.getElementById(id).style.display == "")
	{
		document.getElementById(id).style.display = "none";
		document.getElementById(a).innerHTML = "[Mostrar]";
	}else{
		document.getElementById(id).style.display = "";
		document.getElementById(a).innerHTML = "[Ocultar]";
	}
}

function Resultado(div, divResultado, mensagem, color, imagem)
{
	document.getElementById(div).style.border = '1px solid '+color;
	document.getElementById(div).style.color = color;
	document.getElementById(divResultado).innerHTML = '<img src="imgs_/icones/'+imagem+'.png" align="absmiddle">&nbsp;<font color="'+color+'">'+mensagem+'</font>';
}

function confirmarN(texto, linkid, div)
{
	var confirmacao = confirm(texto);
	if (confirmacao == true)
	{
		load_wt(''+linkid+'', ''+div+'', 'GET');
	}
}