	function horizontal() { 
		var navItems = document.getElementById("nav").getElementsByTagName("li"); 
		
		for (var i=0; i< navItems.length; i++) { 
			if((navItems[i].className == "menuvertical") || (navItems[i].className == "submenu")) { 
				if(navItems[i].getElementsByTagName('ul')[0] != null) { 
					navItems[i].onmouseover=function() {this.getElementsByTagName('ul')[0].style.display="block";this.style.backgroundColor = "#f9f9f9";} 
					navItems[i].onmouseout=function() {this.getElementsByTagName('ul')[0].style.display="none";this.style.backgroundColor = "#FFFFFF";} 
				} 
			} 
		} 
	} 
window.onload = horizontal;

	function ajuda(type) {
		if(type=='edit') { alert('Edita o imóvel selecionado.'); }
		else if(type=='del') { alert('Deleta a imagem seleciona.'); }
	}
	
	function confirmExclusao() {     
		if(confirm("Tem certeza que deseja excluir essa foto?")) {
			return true;
		} else {
			return false;
		}	
	}  
	
	function popup(url,width,height) {
		var left   = (screen.width  - width)/2;
		var top    = (screen.height - height)/5;
		var params = 'width='+width+', height='+height+', top='+top+', left='+left+', directories=no, location=no, menubar=no, resizable=no, scrollbars=no, status=no, toolbar=no';
		
		newwin=window.open(url,'', params);
		if (window.focus) {newwin.focus()}
		return false;
	}
	
	function validar(form){
		var id = Array("nome", "email", "assunto", "mensagem");
		var descricao = Array("Nome", "E-mail", "Assunto", "Mensagem");
		var msg = "Porfavor preencha os sequintes campos:\n";
		
		var mensagem = msg.length;
		
		for (var i = 0; i < id.length; i++){
			var obj = form.elements[id[i]];
			if (obj){
				switch(obj.type){
				case "text":
				case "textarea":
					if (obj.value == "" || obj.value == null) { msg += " - " + descricao[i] + "\n"; }
					break;
				default:
				}
			}
		}

		if (msg.length == mensagem){
			return true;
		} else {
			alert(msg);
			return false;
		}
	}