var ACCIONES = {
	
	inicializa : function() {
		document.getElementById('accion-imprimir').getElementsByTagName('a')[0].onclick = function() {
			window.print();
			return false;	
		}
		document.getElementById('accion-enviar').getElementsByTagName('a')[0].onclick = function() {
			if (document.getElementById('enviar-amigo').className != 'activo') {
				document.getElementById('enviar-amigo').getElementsByTagName('form')[0].reset();
				document.getElementById('enviar-amigo').style.top = (parseInt(document.documentElement.clientHeight) - 450) + parseInt(document.documentElement.scrollTop) + 'px';
				document.getElementById('enviar-amigo').className = 'activo';
			}
			return false;	
		}
		document.getElementById('enviar-amigo').getElementsByTagName('a')[0].onclick = function() {
			document.getElementById('enviar-amigo').className = '';
			return false;
		}
		var campos = document.getElementById('enviar-amigo').getElementsByTagName('form')[0].elements;
		var valores = new Array();
		for (i=0;i<campos.length;i++) {
			if (campos[i].id != '') {
				campos[i].onfocus = function() {
					valores[i] = this.value;
					this.value = '';
				}
				campos[i].onblur = function() {
					if (this.value == '') {
						this.value = valores[i];
					}
				}
			}
		}
		/*
		document.getElementById('accion-share').getElementsByTagName('a')[0].onclick = function() {
			document.getElementById('accion-share').getElementsByTagName('div')[0].style.display="block";
		}
		
		document.getElementById('accion-share').getElementById('cerrarshare').onclick = function() {
			alert("llego2");
			document.getElementById('accion-share').getElementsByTagName('div')[0].style.display="none";
		}
		*/
		
		
		
		var titulo = document.title;
		var direccion = document.location.href;
		document.getElementById('accion-delicious').getElementsByTagName('a')[0].href +='post?url=' + direccion + '&title=' + titulo;
	}

}




function addLoadEvent(fn) {
    var old = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = fn;
    } else {
        window.onload = function() {
            old();
            fn();
        }
    }
}




addLoadEvent(function() {
	ACCIONES.inicializa();
});
