$(document).ready(function(){
    var STATIC_URL = $('meta[name="static_url"]').attr('content');

    /*ie6 = false;
     version = navigator.appVersion;
     num_version = version.match(/(\d)/g);
     if ( $.browser.msie) {
     if ( num_version[2] < 7){
     var url_pixel = MEDIA_URL + 'jscripts/jquery/ifixpng/pixel.gif';
     $.ifixpng(url_pixel);
     $('img[src$=.png]').ifixpng();
     $('input[src$=.png]').ifixpng();
     big_frame_url = MEDIA_URL + 'jscripts/jquery/bgiframe_2.1.1/jquery.bgiframe.min.js'
     var bigframe = $("<script>").attr("type", "text/javascript").attr("src", big_frame_url);
     $("head").append(bigframe);
     ie6 = true;
     }
     }*/
    //$('h1').click(function(){
        //window.location = '/';
    //});
    
    $('input, textarea').focus(function(){
        $(this).select();
    })

    $("#menu_principal li a").hover(function(){
        $(this).parent().addClass('hover');
    }, function(){
        $(this).parent().removeClass('hover');
    });
    
    /*if($.fn.fancybox){
     $('a.fancy').fancybox({
     frameHeight:1000,
     padding:'5px'
     });
     }*/
    
    if ($.fn.media) {
       $.fn.media.defaults.mp3Player = STATIC_URL + 'mediaplayer/player.swf';
       $('a.media.mp3').media({
           width: 300,
           height: 20
       });
    }
    
    $('a.nuevaVentana').click(function(){
        window.open(this.href);
        return false;
    });

    //SCROLLABLE
    $("#destacados").scrollable({circular:true});
    //var api_scrollable = $("#destacados").data("scrollable");
    //api_scrollable.next();

    //$("#destacados").each(function(index){
        //$(this).scrollable({circular:true});
        //var num_items = $(this).children("ul").children("li").length;
        //if (num_items > 1){
            //$(this).scrollable({circular:false});
            //$(this).children("ul.fotos").hover(function(){
                //$(this).parents('.scrollable').find('a.browse').fadeIn();
            //}, function(){
                //$(this).parents('.scrollable').find('a.browse').fadeOut();
            //});
        //}
    //});

    var otable = $('.datatable').dataTable({
        "bJQueryUI": true,
        "sPaginationType": "full_numbers",
        "bInfo": false,
        "bAutoWidth": true,
        "oLanguage":{
            "sProcessing":   "Procesando...",
            "sLengthMenu":   "Mostrar _MENU_ registros",
            "sZeroRecords":  "No se encontraron resultados",
            "sInfo":         "Mostrando desde _START_ hasta _END_ de _TOTAL_ registros",
            "sInfoEmpty":    "Mostrando desde 0 hasta 0 de 0 registros",
            "sInfoFiltered": "(filtrado de _MAX_ registros en total)",
            "sInfoPostFix":  "",
            "sSearch":       "Buscar:",
            "sUrl":          "",
            "oPaginate": {
                "sFirst":    "Primero",
                "sPrevious": "Anterior",
                "sNext":     "Siguiente",
                "sLast":     "Último"
            }
        }
    });
});

