// JavaScript Document
// Cambio la funcionalidad de los link segun funcion
function addEvent( obj, type, fn ) {
	if ( obj.attachEvent ) 
	{
		obj['e'+type+fn] = fn;
		obj[type+fn] = function(){obj['e'+type+fn]( window.event );}
		obj.attachEvent( 'on'+type, obj[type+fn] );
	} 
	else
		obj.addEventListener( type, fn, false );
}

function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}
addEvent(window, 'load', externalLinks);

function popUp(url,name,ancho,alto)
{
	var propiedades = "toolbar=0,location=0,directories=0,status=0,menubar=no,scrollbars=1,top=50,left=50,resizable=1,width="+ancho+",height="+alto;
	window.open(url,name,propiedades);	
}

function fotos(a, altor, img, texto)
{
	
	if(altor > 360)
	{
		alto = altor;	
	}else{ alto = 360; }
	
	if(document.getElementById('f1'))
	{
		document.getElementById('f1').style.backgroundImage = 'url(img/flecha-on.jpg)';
	}
	if(document.getElementById('f2'))
	{
		document.getElementById('f2').style.backgroundImage = 'url(img/flecha-on.jpg)';
	}
	if(document.getElementById('f3'))
	{
		document.getElementById('f3').style.backgroundImage = 'url(img/flecha-on.jpg)';
	}
	if(document.getElementById('f4'))
	{
		document.getElementById('f4').style.backgroundImage = 'url(img/flecha-on.jpg)';
	}
	document.getElementById(a).style.backgroundImage = 'url(img/flecha-off.jpg)';
	document.getElementById('imagenbig').style.backgroundImage = 'url('+img+')';
	document.getElementById('imagenbig').style.height = alto+'px';
	document.getElementById('descImg').innerHTML = texto;
}