
	// variáveis do 'sniffer'
	var isNav = false, isIE = false;

	function init() {
		//Browser 'sniffer'
		if (document.all) {
			isIE = true;
		} else {
			isNav = true;
		}
	}

	function WM_preloadImages() {

	/*
	WM_preloadImages()
	Loads images into the browser's cache for later use.

	Source: Webmonkey Code Library
	(http://www.hotwired.com/webmonkey/javascript/code_library/)

	Author: Nadav Savio
	Author Email: nadav@wired.com

	Usage: WM_preloadImages('image 1 URL', 'image 2 URL', 'image 3 URL', ...);
	*/

		// Don't bother if there's no document.images
		if (document.images) {
			if (typeof(document.WM) == 'undefined'){
				document.WM = new Object();
			}
			document.WM.loadedImages = new Array();
			// Loop through all the arguments.
			var argLength = WM_preloadImages.arguments.length;
			for(arg=0;arg<argLength;arg++) {
				// For each arg, create a new image.
				document.WM.loadedImages[arg] = new Image();
				// Then set the source of that image to the current argument.
				document.WM.loadedImages[arg].src = WM_preloadImages.arguments[arg];
			}
		}
	}


	function WM_imageSwap(daImage, daSrc){
		var objStr,obj;
		/*
		WM_imageSwap()
		Changes the source of an image.

		Source: Webmonkey Code Library
		(http://www.hotwired.com/webmonkey/javascript/code_library/)

		Author: Shvatz
		Author Email: shvatz@wired.com

		Usage: WM_imageSwap(originalImage, 'newSourceUrl');

		Requires: WM_preloadImages() (optional, but recommended)
		Thanks to Ken Sundermeyer (ksundermeyer@macromedia.com) for his help
		with variables in ie3 for the mac. 
		*/

		// Check to make sure that images are supported in the DOM.
		if(document.images){
			// Check to see whether you are using a name, number, or object
			if (typeof(daImage) == 'string') {
				// This whole objStr nonesense is here solely to gain compatability
				// with ie3 for the mac.
				objStr = 'document.' + daImage;
				obj = eval(objStr);
				obj.src = daSrc;
			} else if ((typeof(daImage) == 'object') && daImage && daImage.src) {
				daImage.src = daSrc;
			}
		}
	}

	function validaNum (campo) {
		var st = '';
		var c;

		for(var i=0; i<campo.value.length; i++){
			c=campo.value.charAt(i);
			if((escape(c)>="0")&&((c)<="9")){
				st += c
			}
		}
		campo.value = st;
	}
	
	function Redireciona(acao) {
		document.form1.action = acao;
		document.form1.submit();
	}

	function RedirecionaImg() {
		//seq_situacao = document.form1.seq_situacao.value;
		selgal 	= document.formImg.selgal.value;
		legenda	= document.formImg.legenda.value;
		
		//alert('anunciar.asp?fl=2&legenda='+legenda);
		document.formImg.action = '../adm_trem/default.asp?act=gal&fl=2&selgal='+selgal+'&legenda='+legenda;	
		document.formImg.submit();
	}

	function abreGaleria (dir) {
		window.open('galeria.asp?dir=' + dir, '_blank','scrollbars=yes,status=no,width=730,height=500,left=' + eval((screen.width/2) - 375) + ',top=' + eval((screen.height/2) - 250) + ',alwaysraised');
	}
	function abreGaleria2 (pag) {
		window.open(pag, '_blank','scrollbars=yes,status=no,width=730,height=500,left=' + eval((screen.width/2) - 375) + ',top=' + eval((screen.height/2) - 250) + ',alwaysraised');
	}

	function abreEnvio (dir,foto) {
		window.open('envia_foto.asp?dir=' + dir + '&foto=' + foto, '_blank','scrollbars=yes,status=no,width=540,height=300,left=' + eval((screen.width/2) - 270) + ',top=' + eval((screen.height/2) - 150) + ',alwaysraised');
	}

	function excluiDep (cod) {
		if (confirm ('Deseja mesmo excluir o depoimento ' + cod + '?')) {location.href='./?act=dep&sub=exc&cod=' + cod;}
	}

	function excluiNot (cod) {
		if (confirm ('Deseja mesmo excluir a notícia ' + cod + '?')) {location.href='./?act=not&sub=exc&cod=' + cod;}
	}

	function excluiRes (cod) {
		if (confirm ('Deseja mesmo excluir a reserva ' + cod + '?')) {location.href='./?act=res&sub=exc&cod=' + cod;}
	}
	function exc(pag){
		if(confirm('Tem certeza que deseja excluir este registro?')){
			document.location.href(pag);
		}
	}

	function validaNot () {
		if (document.noticia.data.value.length == 0) { alert ('Preencha o campo data!'); document.noticia.data.focus(); return (false);}
		if (document.noticia.hora.value.length == 0) { alert ('Preencha o campo hora!'); document.noticia.hora.focus(); return (false);}
		if (document.noticia.titulo.value.length == 0) { alert ('Preencha o campo título!'); document.noticia.titulo.focus(); return (false);}
		if (document.noticia.texto.value.length == 0) { alert ('Escreva o texto!'); document.noticia.texto.focus(); return (false);}

		if (
			(document.noticia.data.value.length != 10) || 
			(document.noticia.data.value.charAt(2) != '/') || 
			(document.noticia.data.value.charAt(5) != '/')
		) { alert ('Data inválida!'); document.noticia.data.focus(); return (false); }

		if (
			(document.noticia.hora.value.length != 5) || 
			(document.noticia.hora.value.charAt(2) != ':')
		) { alert ('Hora inválida!'); document.noticia.hora.focus(); return (false); }


		document.noticia.submit();
	}

	function validaCfg () {
		if (document.config.senha.value != document.config.senha2.value) { alert ('As senhas estão diferentes!'); document.config.senha.focus(); return (false);}
		if (document.config.email.value.length == 0) { alert ('Você precisa especificar o email para mensagens!'); document.config.email.focus(); return (false);}
		if (document.config.emailDep.value.length == 0) { alert ('Você precisa especificar o email para depoimentos!'); document.config.email´Dep.focus(); return (false);}
		if (document.config.emailCompre.value.length == 0) { alert ('Você precisa especificar o email para compras!'); document.config.emailCompre.focus(); return (false);}
		document.config.submit();
	}

	WM_preloadImages('images/menu_1a.gif', 'images/menu_2a.gif', 'images/menu_3a.gif', 'images/menu_4a.gif', 'images/menu_5a.gif', 'images/menu_6a.gif', 'images/menu_7a.gif');
	WM_preloadImages('images/menu_1b.gif', 'images/menu_2b.gif', 'images/menu_3b.gif', 'images/menu_4b.gif', 'images/menu_5b.gif', 'images/menu_6b.gif', 'images/menu_7b.gif');
