function mostrar(id){
	getById(id).style.display = 'inline';
}

function mostrarBloque(id){
	document.getElementById(id).style.display = 'block';
}

function ocultar(id){
    document.getElementById(id).style.display = 'none';
}

function limpiar(inp){
	if ( inp.value != '' ) inp.value = '';
}

function mostrarOcultar(id){
	if ( document.getElementById(id).style.display == 'inline' )
		ocultar(id);
	else
		mostrar(id);
}

function mostrarOcultarBloque(id) {
	if ( document.getElementById(id).style.display == 'block' )
    	ocultar(id);
	else
    	mostrarBloque(id);
}

function getById(id) {
	return document.getElementById(id);
}

function bar_verFoto() {
	mostrarBloque('bar_foto');
	mostrarBloque('ver_bar_mapa');

	ocultar('bar_mapa');
	ocultar('ver_bar_foto');
}

function bar_verMapa() {
	mostrarBloque('bar_mapa');
	mostrarBloque('ver_bar_foto');

	ocultar('bar_foto');
	ocultar('ver_bar_mapa');
}

/*Control estrellas*/
function controlEstrellas(e) {
	var  aux = e.split('_');

	var tipo = aux[0];
	var  num = aux[1];
	
	for (i = 1; i <=5; i++ ) {
	
		if ( i <= num ) {
			mostrar( tipo + '_' + i + '_c');
			ocultar( tipo + '_' + i + '_g');
		}
		else {
			ocultar( tipo + '_' + i + '_c');
			mostrar( tipo + '_' + i + '_g');
		}
	}
	
	getById('VotoValor' + tipo ).value = num;
	
}

function enviarEnter(e) {
	tecla=(document.all) ? e.keyCode : e.which;
    if (tecla==13)
    	centraDireccion( getById('direccion').value );
}

function enviarEnter2(e) {
	tecla=(document.all) ? e.keyCode : e.which;
    if (tecla==13)
    	getById('buscador_bares').submit();
}
