function showCliente (titulo,descricao,logo){
	document.getElementById('showcliente').style.display="block";
	document.getElementById('showcliente_titulo').innerHTML=titulo;
	document.getElementById('showcliente_texto').innerHTML=descricao;
	/*document.getElementById('teste').src="http://localhost/hcom/web/uploads/logos/"+logo;*/
}

function comentario_abrir(id){
	if(document.getElementById(id).style.display=="block"){
		document.getElementById(id).style.display="none"	
	}else{
		document.getElementById(id).style.display="block"
	}
}

function  comentario_submit(form){
	form = eval("document."+form);
	if(form.comentarios_nome.value==""){
		alert("NOME é um campo obrigatório");
		form.comentarios_nome.focus();
		return false;
	}else if(form.comentarios_email.value==""){
		alert("EMAIL é um campo obrigatório. Seu email não será fornecido no site");
		form.comentarios_email.focus();
		return false;
	}else if(form.comentarios_comentario.value==""){
		alert("COMENTÁRIO é um campo obrigatório");
		form.comentarios_comentario.focus();
		return false;
	}else{
		return true;
	}
}

function hiddenCliente(){
	document.getElementById('showcliente').style.display="none";
	/*document.getElementById('teste').src="http://localhost/hcom/web/images/home/logo.jpg";*/
}window.onload=function(){
	    //Cria Array com todas as TAGS HTML
    var allHTMLTags=document.getElementsByTagName("*");
    //Passa por todas as tags usando um FOR
    for (i=0; i<allHTMLTags.length; i++) {
        //Pega todas as tags com a classe passada na função.
        if (allHTMLTags[i].className=="date") {
			
			cont=i;
			while(allHTMLTags[cont].tagName!='INPUT'){
				cont++;
			}
			id=allHTMLTags[cont].id;

			allHTMLTags[i].innerHTML= allHTMLTags[i].innerHTML+'<img id="trigger_'+id+'" src="/site/theme/default/sf_admin/images/date.png" alt="Date"> Formato: dd/mm/aaaa';
			Calendar.setup({
				inputField : ""+id+"",
				ifFormat : "%d/%m/%Y",
				daFormat : "%d/%m/%Y",
				button : "trigger_"+id+""
			});
        }
    }
}
		
function mascaraTexto(evento, mascara){ 

  var tecla=(window.event)?event.keyCode:evento.which;
	/* Mascara */
	if((tecla > 47 && tecla < 58)){
			if (document.all) // Internet Explorer  
		   campo = evento.srcElement;  
		else // Nestcape, Mozzila  
			campo= evento.target;  
			  
		valor = campo.value;  
		tam = valor.length;  
		  
		for(i=0;i<mascara.length;i++){  
		   caracter = mascara.charAt(i); 
	
			  if(caracter!="9")
					if(i<tam & caracter!=valor.charAt(i)) 
						campo.value = valor.substring(0,i) + caracter + valor.substring(i,tam);  
	   }

	/* fim mascara */
	}else{
		if (tecla != 8) {
			return false;
		}else{
			return true;
   		}
	}
}  

