/*
if (navigator.userAgent.indexOf("Firefox/3.5")!=-1){
	alert('firefox3.5');	
}else{
	alert('firefox general');	
}*/

var EXTERNO = {

	inicio : function() {
		if(document.getElementById('footer')){
			var enlacesExternos = document.getElementById('footer').getElementsByTagName('a');
			for(var i=0;i<enlacesExternos.length;i++){
				if(enlacesExternos[i].className == 'enlaceExterno'){
					enlacesExternos[i].onclick = function(){
						window.open(this.href,"ventana1","width=800,height=600,scrollbars=YES")
						return false;
					}				
				}
			}
		}	
		if(document.getElementById('aceptoCondiciones')){
			document.getElementById('aceptoCondiciones').onclick = function(){
		 		window.open(this.href+"?popup","ventana1","width=800,height=600,scrollbars=YES")
				return false;
			}	
		}
		if((document.getElementById('capaDeCondiciones'))&&(window.location.href.indexOf('popup') != -1)){
	 		var lascapas = document.getElementById('content').getElementsByTagName('div');
	 		for(var i=0;i<lascapas.length;i++){
	 			if(lascapas[i].className == 'cuestiones'){
	 				document.getElementById('content').style.width = '45em';
	 				document.getElementById('content').style.overflow = 'hidden';
	 				document.getElementById('content').style.margin = '1.5em 0 0 1.5em';
	 			}
	 		}
	 	}	
	}
	
}


function addLoadEvent(fn) {
    var old = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = fn;
    } else {
        window.onload = function() {
            old();
            fn();
        }
    }
}

addLoadEvent(function() {
	EXTERNO.inicio();
});
