var Footer = {
	start: function(){

		var contacto_localizacion=$('contacto_localizacion');
		var footer_left_2=$('footer_left_2');
		var ver_mapa=$('ver_mapa');
		efecto_contacto = new Fx.Morph(footer_left_2, {
			duration: 1000,
			transition: Fx.Transitions.Quad.easeOut
		});
		efecto_scroll = new Fx.Scroll(window, {
			duration: 200
		});
		contacto_localizacion.addEvent('click',function(){
			Footer.ver_contacto(ver_mapa,contacto_localizacion);
		});
		ver_mapa.addEvent('click',function(){
			Footer.ver_mapa(ver_mapa);
		});
	},
	ver_contacto:function(ver_mapa,contacto_localizacion){
		if(contacto_localizacion.getProperty('class')=='mostrar_contacto'){
			contacto_localizacion.setProperty('class','ocultar_contacto');
			efecto_contacto.cancel();
			efecto_contacto.start({'height':'80px'});
			efecto_scroll.toBottom.delay(600, efecto_scroll);
		}else{
			contacto_localizacion.setProperty('class','mostrar_contacto');
			ver_mapa.setProperty('class','mostrar_mapa');
			if(ver_mapa.innerHTML == '<span>[</span> <span>ocultar mapa]</span>'){
				ver_mapa.innerHTML = '<span>[</span> <span>ver mapa]</span>';
			} else {
				ver_mapa.innerHTML = '<span>[</span> <span>see map]</span>';
			}
			efecto_contacto.cancel();
			efecto_contacto.start({'height':'0px'});
		}	
	},
	ver_mapa:function(ver_mapa){
		if(ver_mapa.getProperty('class')=='mostrar_mapa'){
			ver_mapa.setProperty('class','ocultar_mapa');
			if(ver_mapa.innerHTML == '<span>[</span> <span>ver mapa]</span>'){
				ver_mapa.innerHTML = '<span>[</span> <span>ocultar mapa]</span>';
			} else {
				ver_mapa.innerHTML = '<span>[</span> <span>hide map]</span>';
			}
			efecto_contacto.cancel();
			efecto_contacto.start({'height':'235px'});
			efecto_scroll.toBottom.delay(800, efecto_scroll);
		}else{
			ver_mapa.setProperty('class','mostrar_mapa');
			if(ver_mapa.innerHTML == '<span>[</span> <span>ocultar mapa]</span>'){
				ver_mapa.innerHTML = '<span>[</span> <span>ver mapa]</span>';
			} else {
				ver_mapa.innerHTML = '<span>[</span> <span>see map]</span>';
			}
			efecto_contacto.cancel();
			efecto_contacto.start({'height':'80px'});
		}
	}
};
function aviso_legal()
{
	var ventana;
	ventana = window.open("/aviso_legal.php","Babalúvox","status=no,toolbar=no,menubar=no,scrollbars=1, location=no, width=435,height=600");
};
window.addEvent('domready',function(){
	Footer.start();
});