function changeFieldDisplay(_field,_value){
   field = document.all[_field];
   if(field.value == ""){
	   field.value = _value;
   }else{
      if(field.value == _value){
         field.value = "";
      }
   }
}

function abrirConvencao(img, altura, largura){
	if (altura > 450)
		altura = 450;
	
	if (largura > 450)
		largura = 450;
	
	janConvencoes = window.open(img, "Convencao", "HEIGHT=" + altura + ",WIDTH=" + largura + ",MENUBAR=0,SCROLLBARS=0");
}
function mapa_hotel(hotel){
	window.open("./hotel/mapa.php?hotel=" + hotel , "Mapa", "HEIGHT=525,WIDTH=380,MENUBAR=0,SCROLLBARS=0");
}
function abrirCatalogo(hotel){
	window.open("./hotel/galeria/hotel_album.php?hotel=" + hotel , "Catalogo", "HEIGHT=400,WIDTH=400,MENUBAR=0,SCROLLBARS=0");
}
function openPopUp(URL, width, height){  
   window.open(URL,'Title', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width='+width+'px,height='+height+'px');
}
function openPopUpNoResize(URL, width, height){  
   window.open(URL,'Title', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width='+width+'px,height='+height+'px');
}
function somenteMoeda(){
	var tecla = event.keyCode;
	if (somenteNumero() || tecla == 44){
		return true;	
	}else{
		return false;
    }
}
function validaForms(campos){
	a_campo = campos.split(",");
	var i = 0;
	for(i=0; i < a_campo.length; i++){
		if (document.all[a_campo[i]].value.length == ""){
			alert('O campo \''+ document.all[a_campo[i]].id +'\' é obrigatório.');
			document.all[a_campo[i]].focus();
			return false;
		}
	}
	return true;
}



