function d_obj(id){
	var o;
	if (document.all) o = document.all(id);
	else if (document.getElementById) o = document.getElementById(id); 
	else if (document.layers) o = document.layers[id];
	if (o) return(o);
	return(null);
}

var cookie_portada='portada_web';
function abrir_portada(){
	var a=getCookie("Reload");
	if(a!='1'){
		var v=getCookie(cookie_portada);
		//alert('portada_web: '+v);
		if(v!='true'){
			//alert('muestro portada');
			var o=d_obj('portada');
			//alert(o.style);
			if(o && o.style && o.style.display) {
				//alert('muestro block');
				o.style.display='block';
			}
		}
	}else{
	    var expdate = new Date (); 
    	expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 365 * 0));  
		setCookie("Reload",'0',expdate);
	}
}
function cerrar_portada(a){
    var expdate = new Date (); 
    expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 365));  
	//alert('marcado: '+document.forms.f_recodatorio.m_portada.checked);
	if(a=='true'){
		setCookie(cookie_portada,'true',expdate);
	}else{
		setCookie(cookie_portada,'false',expdate);
	}
	var o=d_obj('portada');
	if(o && o.style && o.style.display) o.style.display='none';
	return false;
}
function mostrar_portada(a){
    var expdate = new Date (); 
    expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 365));  
	setCookie(cookie_portada,'true',expdate);
	var o=d_obj('portada');
	if(o && o.style && o.style.display) o.style.display='block';
}
function cerrarPortada(a){
		//alert(a);
		cerrar_portada(a);
}
function onload_principal(){
	//alert('onload_principal');
	if(location.search=='?mostrar'){
		mostrar_portada();
	}
	if(location.search=='' && location.hash==''){
		abrir_portada();
	}
}


