
// Función para mostrar la ficha (PopUp)
function fWindowFicha( fichaID ){
	if( Number( fichaID ) ){
		windowFicha = window.open( './html/ficha.php?fichaID=' + fichaID, 'windowFicha', 'width=893,height=580' );
		windowFicha.focus();
	}
}

// Función para abrir formularios (PopUp)
function fWindowFormulario( urlWF, nombreWF, anchoWF, altoWF ){
	windowFormulario = window.open( urlWF, nombreWF, 'width=' + anchoWF + ',height=' + altoWF );
	windowFormulario.focus();
}

// Funcion para mostrar la nota de contacto (ToolTip)
function fMostrarNotaContacto( evt, fichaNombre, fichaServicios, fichaHorario, fichaValor, fichaContacto, fichaUbicacion ){
	if( evt.pageX ){ // Mozilla
		x = evt.pageX + 16;
		y = evt.pageY;
	} else if( evt.clientX ){ // IE
		x = evt.clientX + 16 + document.body.parentNode.scrollLeft;
		y = evt.clientY + document.body.parentNode.scrollTop;
	}

	with( document.getElementById( 'notaContacto' ) ){
		style.left = x + 'px';
		style.top = y + 'px';
		style.display = 'block';
	}
	if( fichaNombre.length > 2 ){
		document.getElementById( 'notaContactoNombre' ).innerHTML = fichaNombre;
		document.getElementById( 'notaContactoNombre' ).style.display = 'block';
	} else {
		document.getElementById( 'notaContactoNombre' ).style.display = 'none';
	}
	if( fichaServicios.length > 2 ){
		document.getElementById( 'notaContactoServicios' ).innerHTML = fichaServicios;
		document.getElementById( 'notaContactoServicios' ).style.display = 'block';
	} else {
		document.getElementById( 'notaContactoServicios' ).style.display = 'none';
	}
	if( fichaHorario.length > 2 ){
		document.getElementById( 'notaContactoHorario' ).innerHTML = fichaHorario;
		document.getElementById( 'notaContactoHorario' ).style.display = 'block';
	} else {
		document.getElementById( 'notaContactoHorario' ).style.display = 'none';
	}
	if( fichaValor.length > 2 ){
		document.getElementById( 'notaContactoValor' ).innerHTML = fichaValor;
		document.getElementById( 'notaContactoValor' ).style.display = 'block';
	} else {
		document.getElementById( 'notaContactoValor' ).style.display = 'none';
	}
	if( fichaContacto.length > 2 ){
		document.getElementById( 'notaContactoContacto' ).innerHTML = fichaContacto;
		document.getElementById( 'notaContactoContacto' ).style.display = 'block';
	} else {
		document.getElementById( 'notaContactoContacto' ).style.display = 'none';
	}
	if( fichaUbicacion.length > 2 ){
		document.getElementById( 'notaContactoUbicacion' ).innerHTML = fichaUbicacion;
		document.getElementById( 'notaContactoUbicacion' ).style.display = 'block';
	} else {
		
		document.getElementById( 'notaContactoUbicacion' ).style.display = 'none';
	}
}

// Función para ocultar la nota (ToolTip)

function fOcultarNotaContacto(){
	document.getElementById( 'notaContacto' ).style.display = 'none';
}
