/* BANNER-INTERIOR */
$(document).ready(function(){
						   
	
	var display_timeout = 0;
$("#open-two").hover(function () {
 
		if(display_timeout != 0) {
				clearTimeout(display_timeout);
		}
 
                // save a reference to 'this' so we can use it in timeout function
		var this_element = this;
                display_timeout = setTimeout(function() {
				display_timeout = 0;
				// perform things with this_element here buy referencing it like $(this_element)
				if (!$(this_element).hasClass('magic')) {
			
					$('.banner-expand-two').css("display","block");
					$('#open-two').css("display","none"); 
				}
			}, 1200);
 
	},
		function () {
			if(display_timeout != 0) {
				clearTimeout(display_timeout);
			}
			performRolloutStuff();
		}
);
	
	
	

    $("#close-two").click(function(){
		$(this).toggleClass("focus")											  
		$('.banner-expand-two').css("display","none");
		$('#open-two').css("display","block"); 
});
	
});	

/* TWITTER */
  jQuery(document).ready(function($) {
        $(".tweet").tweet({
          join_text: " | ",
          username: "el_Periodico",
          avatar_size: false,
          count: 5,
          auto_join_text_default: "we said,", 
          auto_join_text_ed: "we",
          auto_join_text_ing: "we were",
          auto_join_text_reply: "we replied",
          auto_join_text_url: "we were checking out",
          loading_text: "Cargando..."
        });
        $("#query").tweet({
          avatar_size: 32,
          count: 4,
          query: "tweet.seaofclouds.com",
          loading_text: "searching twitter..."
        });
        $("#userandquery").tweet({
          count: 3,
          query: "from:seaofclouds&phrase=http",
          loading_text: "searching twitter..."
        });
        $("#fromtwo").tweet({
          avatar_size: 32,
          count: 4,
          query: "from%3Aseaofclouds+OR+from%3Alaughingsquid",
          loading_text: "searching twitter..."
        });
      })    

/* FORM */
$(document).ready(function(){
	$("#prefer").click(function(){
    	$(this).toggleClass("focus")											  
    	$(".forma").toggle(500);
						  });
						   
    $("#cerrar").click(function(){
		$(this).toggleClass("focus")											  
		$(".forma").toggle(500)
});
	   
   
/* TABS */
$(document).ready(function() {
	$('#encuestas > ul').tabs();
	$('#opinion > ul').tabs();
	$('#suplementos > ul').tabs();
	$('#ciencia > ul').tabs();
	$('#cultura > ul').tabs();
	$('#encuesta > ul').tabs();
	$('#obituario > ul').tabs();
	$('#ultima > ul').tabs();
  });
});


/* CALENDAR */  
$(document).ready(function() {

$("#fecha").datepicker({dateFormat: 'yy-mm-dd',
    yearRange: '2004:2011',
	 dayNames: ['Domingo', 'Lunes', 'Martes', 'Miercoles', 'Jueves', 'Viernes', 'Sabado'],
	 dayNamesShort: ['Dom', 'Lun', 'Mar', 'Mir', 'Jue', 'Vie', 'Sab'],
	 dayNamesMin: ['Do','Lu','Ma','Mi','Ju','Vi','Sa'],
	 monthNames: ['Enero','Febrero','Marzo','Abril','Mayo','Junio','Julio','Agosto','Septiembre', 'Octubre','Noviembre','Diciembre'],
	 monthNamesShort: ['Ene','Feb','Mar','Abr','May', 'Jun','Jul','Ago','Sep','Oct','Nov','Dic']	 
   
});

});

/* QUICKLINKS */ 
 $(document).ready( function(){
$('.qlinks').innerfade({animationtype: 'slide', speed: 'slow', timeout: 6500, type: 'sequence', containerheight: '1.5em' }); } );

 
/* POP-UP INTERIOR */   
function pop_ep(theURL,winName,features) { 
window.open(theURL,winName,features);
}

/* CHANGE-FONT INTERIOR */  
function tamFuente (nivel, elem) {
var elemento = document.getElementById(elem)
    elemento.className = "nivel"+nivel;
}

/* BANNER */
$(document).ready(function(){
						   
			
	var reBanner = $.cookie('banner');
	if (reBanner) {
		 $('.banner-expand').css("display","none"); 
	}else	{		
	$('#open').css("display","none"); 
		$('.banner-expand').css("display","block"); 
		setTimeout(function(){ $('.banner-expand').css("display","none"); $('#open').css("display","block"); }, 8000);
		$.cookie('banner', 'banner',{expires:1}); 
	}
	 
	
	
	var display_timeout = 0;
$("#open").hover(function () {
 
		if(display_timeout != 0) {
				clearTimeout(display_timeout);
		}
 
                // save a reference to 'this' so we can use it in timeout function
		var this_element = this;
                display_timeout = setTimeout(function() {
				display_timeout = 0;
				// perform things with this_element here buy referencing it like $(this_element)
				if (!$(this_element).hasClass('magic')) {
			
					$('.banner-expand').css("display","block");
					$('#open').css("display","none"); 
				}
			}, 1200);
 
	},
		function () {
			if(display_timeout != 0) {
				clearTimeout(display_timeout);
			}
			performRolloutStuff();
		}
);
	
	
	

    $("#close").click(function(){
		$(this).toggleClass("focus")											  
		$('.banner-expand').css("display","none");
		$('#open').css("display","block"); 
});
	
});	




/* DROP-DOWN */ 
cssdropdown.startchrome("chromemenu")

/* CIFER */ 
function setpage() {var nTel = document.getElementById('ingreso').value; enviar(nTel); return false;}


