jQuery.fn.center = function () {
	this.css("position","absolute");
	this.css("top", ( $(window).height() - this.height() ) / 2+$(window).scrollTop() + "px");
	this.css("left", ( $(window).width() - this.width() ) / 2+$(window).scrollLeft() + "px");
	return this;
}


$(document).ready(function() {
	
 	var sPath = window.location.pathname;
	var sPage = sPath.substring(sPath.indexOf('/') + 1);
	var secciones = sPage.split("/");
	switch(secciones[0]){
		case '2009': case '2010':
					mostrarSubMenu(secciones[0]);
					break;
		default: 	$('#header').height(280);
	}
 });

function mostrarSubMenu(seccion){
	$('#menu'+seccion).show();
	$('#menu_edicion_'+seccion).addClass('active');
}


$(function(){
    $('a[href*=#]').click(function() {
    
    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') 
        && location.hostname == this.hostname) {
        
            var $target = $(this.hash);
            $target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
            
            if ($target.length) {
                var targetOffset = $target.offset().top;
                $('html,body').animate({scrollTop: targetOffset}, 1000);
				return false;
            }
        }
    });
});