
var IE = document.all?true:false;
if (!IE) {
	document.captureEvents(Event.MOUSEMOVE)
	//document.onmousemove = getMouseXY;
}
var tempX = 0;
var tempY = 0;

function coordenadas(evento,valor) {
	document.getElementById('top').innerHTML = evento.x+"º "+parseInt(evento.x/2)+"' N - "+evento.y+"º "+parseInt(evento.y/2)+"' W";
	if (!valor)
		document.getElementById('top').innerHTML = "43º 33' N - 05º 40' W";
}

function getMouseXY(e) {
	if (IE) { // grab the x-y pos.s if browser is IE
		tempX = event.x; //event.clientX + document.body.scrollLeft;
		tempY = event.y; //event.clientY + document.body.scrollTop;
	} else {  // grab the x-y pos.s if browser is NS
		tempX = e.pageX;
		tempY = e.pageY;
	}  
	if (tempX < 0){ tempX = 0; }
	if (tempY < 0){ tempY = 0; }
	document.getElementById('top').innerHTML = tempX+"º "+parseInt(tempX/2)+"' N - "+tempY+"º "+parseInt(tempY/2)+"' W";
	return true;
}

function abrefoto(idfoto, ruta, titulo)
	{
		var pos;
		if (window.pageYOffset) pos = window.pageYOffset
			else if (document.documentElement && document.documentElement.scrollTop) pos = document.documentElement.scrollTop
				else if (document.body) pos = document.body.scrollTop
		pos = eval(pos+120);
		if (titulo=='') titulo = '&nbsp;';
		document.getElementById('cabecera_ampliada').innerHTML = titulo;
		document.getElementById('foto_ampliada').innerHTML='<a href="javascript:cierrafoto()" title="cerrar foto"><img src="/'+ ruta +'/fotos/zoom/'+idfoto+'"  alt="cerrar foto" /></a>';
		document.getElementById('foto_zoom').style.top=pos+'px';
		document.getElementById('foto_zoom').style.visibility='visible';	
	}
	
function cierrafoto()
	{
		document.getElementById('foto_zoom').style.visibility='hidden';
	}

function cargafoto(){
	var arrayparam=location.search.replace(/^./,"").split(/&/);
	nomfoto=arrayparam[0];
	document.write('<img src="./fotos/zoom/'+nomfoto+'" alt="" />');
}

function abreventana(url) {
	var ventana = window.open('http://' + url);
	ventana.focus();
	return false;
}

function abreventana2(url) {
	var ventana = window.open(url);
	ventana.focus();
	return false;
}

function popup(url) {
	var texto = ' <a href="#" onclick="abreventana(\'' + url + '\')" title="visitar web"><img src="/images/popup.gif" alt="abrir en nueva ventana" /></a> ';
	return texto;
}

function pintaImprime(ruta, idioma) {
	if (idioma == 'esp') { var titulo = 'imprimir p&aacute;gina'; var alt = titulo + ' (tecla acceso 1)'; }
	else {var titulo = 'print page'; var alt = titulo + ' (accesskey 1)';  }
	document.write('<div class="imprimir"><img src="'+ruta+'images/imprimir.gif" alt="'+alt+'" /> <a href="#" onclick="window.print()" accesskey="1" title="'+alt+'">'+titulo+'</a></div>');
}


