var velocidadfoto = 10;
var velocidadtiempo = 5;
var esprincipal =  false;
var selecionada;
function abrir(){
	window.open(seleccionada, '_blank');
}
function aclara(url,objeto, velo_foto, velo_time, ancho, alto) {
	velot = velo_time;
	velof = velo_foto;
	al=alto;
	an=ancho;
	dir=url;
	obj = objeto;
	if(navigator.appName == "Netscape") {
		cambiafoto(url, objeto, ancho, alto);
	}
	else {
		if(window.restaurando) clearInterval(restaurando);
			aclarando=setInterval("aclara2(obj, dir, velof, an, al)", velot);
		}
}

function cambiafoto(direccion, objeto, ancho, alto) {
	obj=objeto;
	obj.src=direccion;
	obj.width=ancho;
	obj.height=alto;
	seleccionada=direccion;
}

function aclara2(cur2, direccion,velo, ancho, alto) {
	if(cur2.filters.alpha.opacity>0) cur2.filters.alpha.opacity-=velo
	else {
		if(window.aclarando) clearInterval(aclarando);
		cambiafoto(direccion, cur2, ancho, alto);
	}
}

function restaura(obj, velo_foto, velo_time) {
	velot = velo_time;
	velof = velo_foto;
	objeto=obj;
	restaurando=setInterval("restaura2(objeto,velof)", velot);
}

function restauranormal(objeto,velo_foto, velo_time) {
	velot = velo_time;
	velof = velo_foto;
		obj=objeto;
		restaurando=setInterval("restauranormal2(obj,velof)", velot);
}



function restaura2(cur2, velo) {
		velof = velo;
	if(cur2.filters.alpha.opacity < 100) cur2.filters.alpha.opacity+=velof
	else if(window.restaurando) {
			clearInterval(restaurando);
		cur2.filters.alpha.opacity=100

	}
	
}

function restauranormal2(cur1, velo) {
	if(cur1.filters.alpha.opacity < 100) cur1.filters.alpha.opacity+=velo;
	else if(window.restaurando) clearInterval(restaurando);
}

function high(which2) {
	theobject=which2;
	highlighting=setInterval("highlightit(theobject)",20);
}

function low(which2) {
	clearInterval(highlighting);
	which2.filters.alpha.opacity=55;
}
function highlightit(cur2) {
	if(cur2.filters.alpha.opacity<100)
		cur2.filters.alpha.opacity+=5
	else if(window.highlighting)
		clearInterval(highlighting)
}

	function abrir_ventana(url, ancho, alto){
		//var ventana;
		//ventana=window.open("","ventana","");
		//ventana.close();
		var myLeft = (screen.width-ancho)/2;
		var myTop = (screen.height-alto)/2;
			ventana=window.open(url,'ventana','width='+ancho+',height='+alto+', scrollbars=YES, resizable=NO, left='+myLeft+', top=',+myTop+', location=no,directories=no,status=no,toolbar=no,menubar=no');
			ventana.resizeTo(ancho,alto+20)
			ventana.focus();

	}




