        if (jQuery.cookie('montcada_estilo')!=null) {
            cssValor=jQuery.cookie('montcada_estilo');
            jQuery.cookie('montcada_estilo', cssValor, {expires: 365 });
        }
        function carga(url, id, e) {
            jQuery(e).parent().parent().children().removeClass("activo");
            jQuery(e).parent().addClass("activo");
            jQuery(id).html("<p style= \"text-align: center; margin: 20px 0 0 0;\"><img src=\"css/img/bigrotation2.gif\"/></p>");
            jQuery(id).load(url+" #c");
            return false;
        }
                
        function cargaMedia(id, e) {
            v_player=jQuery('#player_video').html();
            jQuery('#player_video').html(v_player);

            a_player=jQuery('#player_audio').html();
            jQuery('#player_audio').html(a_player);

            jQuery(e).parent().parent().children().removeClass("activo");
            jQuery(e).parent().addClass("activo");
            jQuery('.media_tab').hide();
            jQuery(id).show();
            return false;
        }          
        function d2(s) {
            if (s<10) {
                return '0'+s;
            } else {
                return s;
            }
        }
        function formatoHora() {
            d=new Date();
            return d2(d.getDate())+"/"+d2(d.getMonth()+1)+"/"+d.getFullYear()+" | "+d2(d.getHours())+":"+d2(d.getMinutes())+":"+d2(d.getSeconds());
        }
        function ponHora() { 
            jQuery("#fechahora").html(formatoHora());
            setTimeout("ponHora()", 1000);
        }
        function switchStylestyle(styleName) {
            jQuery.cookie('montcada_estilo', styleName, {expires: 365 });
            jQuery('link[@rel*=style][@title]').each(function(i)
            {
                this.disabled = true;
                if (this.getAttribute('title') == styleName) this.disabled = false;
            });
            return false;
        }  
        function cambiaVideo(a) {
            titulo=jQuery(a).parent().children().children(".vtitulo").text();
            url=a.href;
            videoxml=jQuery(a).parent().children().children(".vxml").text();
            jQuery('#media_video h2').html(titulo);
            jQuery('#player_video').html('<embed id="vplayer" name="vplayer" src="mediaplayer.swf" width="300" height="220" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="usefullscreen=false&displayheight=240&file='+videoxml+'"></embed>');
        }        
        function cambiaAudio(a) {
            titulo=jQuery(a).parent().children().children(".vtitulo").text();
            url=a.href;
            audioxml=jQuery(a).parent().children().children(".vxml").text();
            jQuery('#media_audio h2').html(titulo);
            jQuery('#player_audio').html('<embed id="aplayer" name="aplayer" src="mediaplayer.swf" width="300" height="220" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="file='+audioxml+'"></embed>');
        }
