/* Codigo comun para abrir popups i ventanas del sitio */


abreContacto = function() {
	leftX = (screen.availWidth-464)/2
	topY = (screen.availHeight-420)/2
	brand = window.open('../contacto_01.asp', 'nextWin', 'left='+leftX+',top='+topY+',width=464,height=420,toolbar=no,scrollbars=no,resizable=no,status=no').focus()
}

abreLegal = function() {
	if(document.all) he = 460
	else he = 455 
	
	leftX = (screen.availWidth-510)/2
	topY = (screen.availHeight-497)/2
	brand = window.open('../legal_01.html', 'nextWin', 'left='+leftX+',top='+topY+',width=508,height='+he+',toolbar=no,scrollbars=no,resizable=no,status=no').focus()
}

abreAlumni = function() {
	if(document.getElementById("acepto").checked!=true){
		alert("Tiene que aceptar las condiciones legales.");
	}else{
		if(document.getElementById("usuario").value!=""){
			if(document.all) he = 150
			else he = 150
			leftX = (screen.availWidth-300)/2
			topY = (screen.availHeight-150)/2
			alumni = window.open('dimension_05_01.asp?mail=' + document.all.usuario.value, 'nextWin', 'left='+leftX+',top='+topY+',width=300,height='+he+',toolbar=no,scrollbars=no,resizable=no,status=no').focus()
			document.all.usuario.value=""
			document.all.acepto.checked=false
		} else {
			alert("No has introducido el e-mail.");
		}
	}
}

abreLOPD = function() {
	if(document.all) he = 180
	else he = 180 
	
	leftX = (screen.availWidth-510)/2
	topY = (screen.availHeight-497)/2
	brand = window.open('LOPD.html', 'nextWin', 'left='+leftX+',top='+topY+',width=508,height='+he+',toolbar=no,scrollbars=no,resizable=no,status=no').focus()
}

// Codigo que automatiza los rollovers de la pagina
RO = {
	init:	function() {
		var all = document.getElementsByTagName('img');
		var img = new Array()
		for(var i=0; i<all.length; i++) {
				var o = all[i].id;
				if(o.match(/rm/i)) { 
					var str = all[i].src.split(".gif")
					img[i] = new Image()
					img[i].src = str[0] + "r.gif"
					//stp += str[0] + "r.gif"
					all[i].onmouseover = RO.roll
					all[i].onmouseout = RO.out
				}
		}
		
	},
	
	roll: function() {
		var str = this.src.split(".gif")
		//alert(this.src.indexOf(".gif"))
		RO.old = str[0] + ".gif"
		this.src = str[0] + "r.gif"
	}, 
	out: function() {
		this.src = RO.old
	}
}
// funcion global para aņadir eventos al onload de la pagina
RO.addLoadEvent = function(f) { 
		var old = window.onload; 
		if (typeof old != 'function') window.onload = f 
		else { window.onload = function() { old(); f() }} 
} 

RO.addLoadEvent(RO.init)
 