	function hideTagSelect(hidSho){
		var tags = document.getElementsByTagName("select");
		for (i = 0; i < tags.length; i++) {
			if (hidSho) {
				tags[i].style.visibility = 'visible';
			} else {
				tags[i].style.visibility = 'hidden';			
			}
		}
	}
	
	function url(obj){
		var valor = obj.value;
		if (valor != null && valor != "") {
			if(valor.indexOf('http://') == -1) {
				obj.value = "http://" + obj.value;
			}
		}
	}
	
	function checkBoxValue(nomeCampo, obj){
		if (obj.checked == true){
			document.getElementById(nomeCampo).value = 'S';
		} else {
			document.getElementById(nomeCampo).value = 'N';	
		}
		//alert(document.getElementById(nomeCampo).value);
	}
	
	function pegaCookie(obj){
		var email = getCookie("email");
		document.getElementById(obj).value = email;
		if (email != "" && email != null)
			document.getElementById('Salvar').checked = true
	}
	
	function setCookie( name, value ) {
		var expDays = 30;
		var exp = new Date(); 
		exp.setTime(exp.getTime() + (expDays*24*60*60*1000));
		var expires = exp; 
		var bla = name + "=" + escape(value) + "; expires=" + expires.toGMTString();
		document.cookie = bla;
	}
	
	function getCookie( name ) {
		var search = name + "=";
		if (document.cookie.length > 0) { // Existem cookies
				offset = document.cookie.indexOf(search)
				if (offset != -1) { // Existe o cookie "name"
						offset += search.length // inicio do conteudo do cookie
						end = document.cookie.indexOf(";", offset) // fim do conteudo
						if (end == -1) end = document.cookie.length;
						return unescape(document.cookie.substring(offset, end));
				} else {
						return "";
				}
		} else {
				return "";
		}
	}
	
	var MyWindow = null; 
	
	function abrirJanela(theURL,winName,features) { 
	
		// Split features
		var arFeatures = features.split(",");
		var arFeaturesValues = Array();
		
		for (i = 0; i < arFeatures.length; i++){
			var arAux = arFeatures[i].split('=');
			arFeaturesValues[arAux[0]] = arAux[1];
		}
		
		// Abre ou da o focus na janela
		if(MyWindow != null) {   
			if(!MyWindow.closed) {                                  
				MyWindow.close();                               
				MyWindow = window.open(theURL,winName,features);                           
			} else {                             
				MyWindow = window.open(theURL,winName,features);
			}   
		} else {          
			MyWindow = window.open(theURL,winName,features); 
		}
				
		var largura = window.screen.availWidth;
		var altura = window.screen.availHeight;	
		
		var x = (largura - arFeaturesValues['width']) / 2;
		var y = (altura - arFeaturesValues['height']) / 2;
		
		MyWindow.moveTo(x, y);	
	}
	
	function excluiRegistro(id) {	
		if(confirm("Você realmente deseja excluir este registro?\nAo deletar ele outros registros poderão ser afetados!")){
			document.location.href="?action=delete&did="+id;
		}	
	}
	
	function excluiArquivo(id, idPai) {
		if(confirm("Você realmente deseja excluir este arquivo?")){
			document.location.href="?action=deleteArq&didImg="+id+"&id="+idPai;
		}	
	}
	
	function logOut() {	
		if(confirm("Você realmente deseja sair?")){
			document.location.href="?logout";
		}	
	}
	
	function numbersOnly(objeto, evt){
		evt = (evt) ? evt : (window.event) ? window.event : "";
		var value = objeto.value;
		if (evt) {
			var ntecla = (evt.which) ? evt.which : evt.keyCode;
			//alert(ntecla);
			if (ntecla > 47 && ntecla<58 || ntecla==46 || ntecla==44 || ntecla==8 || ntecla==9|| ntecla==37|| ntecla==39) 
				return true;
			else 
				return false;
		}
	}
	
	function lowerCase(obj) {
		obj.value = obj.value.toLowerCase();
	}
	
	/* variável para controle do subMenu */
	var teste = false;
	
	/*
	*	função para ajustar a imagem do lado esquerdo da página
	*/
	function ajustaEsquerda() {
		var wi 	 = ($(window).width() - $("#page").width()) / 2;
		var left = -1000;
		
		left = left + wi;				
		$("#left").css("left", left);
	}
	
	/*
	*	função para abrir/fechar as abas do topo
	*/
	function moveDiv(div) {
		
		var abas  = new Array(3);
		var valor = new Array(3);
		
		abas[0] = "#aba_noticias";
		abas[1] = "#aba_turismo";
		abas[2] = "#aba_eventos";
		
		valor[0] = 270;
		valor[1] = 265;
		valor[2] = 260;
		
		for(i=0;i<3;i++) {
			
			var open_height = $(div+'_content').height() + $(div).height() - 30;
							
			if (abas[i] == div) {
				//$(div).animate({height: open_height}, "slow");
				if ($(div).height() == valor[i]) {
					$(div).animate({height: open_height}, "slow");
				} else {
					$(div).animate({height: valor[i]}, "slow");
				}
			} else {
				$(abas[i]).animate({height: valor[i]}, "slow");
			}
		}
	}
	
	/*
	*	função para ajustar a altura da div do conteúdo
	*/
	function ajustaContent() {
		if ($("#content").height() < $("#right").height()) {
			$("#content").height($("#right").height()+30);
		}		
	}
	
	/*
	*	função para ajustar a altura da div do conteúdo
	*/
	function ajustaContentAdm() {
		if ($("#content").height() < $("#right").height()) {
			$("#content").height($("#right").height()+10+$('#listagem').height());
		}		
	}
