//-------------Validar Form	
	function valida_excluisao()
	{
		return confirm("Desja excluir este item?");
	}
	
	function valida_foto()
	{
		var nome_arq = document.fotos.foto.value;
		var exte = nome_arq.substring(nome_arq.length - 4, nome_arq.length);;
		if (nome_arq == "")
		{
			alert("Você precisa escolher o arquivo para enviar!");
			return false;
		} 
		else if (exte.toLowerCase() != ".jpg")
		{
			alert("Tipo Inválido.\nSomente podem ser adicionados arquivos do tipo JPG.");
			return false;
		}
		else return true;
	}
	
	function valida_anuncio()
	{
		var valor = document.form_eqpto.valor.value;
		if (valor == "" || !doDigits(valor))
		{
			alert("Você precisa escolher um valor válido!");
			return false;
		} 
		else return true;
	}
	
	function doDigits(pStr)
	{
		var reDigits = /^\d+$/;
		if (reDigits.test(pStr)) return true;
		else return false;
	}
	
	function valida_vazio(valor)
	{
		if (valor == "")
		{
			alert("Preencha o campo antes de incluir!");
			return false;
		} 
		else return true;
	}
	
	function ampliar_img(img)
	{
		var topo = (screen.width - 700) / 2;
		var lado = (screen.height - 500) / 2;
		janela = window.open("", "Imagem", "top=" + topo + ", left=" + lado+ ", width=700, height=500, status=NO, scrollbars=NO");
		janela.document.open();
		janela.document.write("<html><head><title>Detalhe</title></head>");
		janela.document.write("<body leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'>");
		janela.document.write("<p align=center><img width=700 height=500 src= '" + img + "'></p></body></html>");
		janela.document.close();
	}
	
	function altera_foto(foto)
	{
		document.foto_maq.src = foto;
	}
	
	function res()
	{
		if (screen.width<=800)
		{
			document.bg_left.width = 0;
			document.bg_right.width = 0;
		}
	}
	
	function valida_contato(total)
	{
		if (total == 1 && document.form_contato.assunto.value == "") 
		{
			alert("Você precisa digitar um assunto!");
			return false;
		} 
		else if (document.form_contato.nome.value == "" )
		{
			alert("Você precisa digitar seu nome!");
			return false;
		} 
		else if (document.form_contato.email.value == "" )
		{
			alert("Você precisa digitar seu e-mail!");
			return false;
		} 
		else return true;
	}
	
	function valida_login()
	{
		
		if (document.form_login.login.value == "" )
		{
			alert("Você precisa digitar o login!");
			return false;
		} 
		else if (document.form_login.senha.value == "" )
		{
			alert("Você precisa digitar a senha!");
			return false;
		} 
		else return true;
	}