var debug=true;
//history manager 
var historyCallbacks=[];
//array delle funzioni callback delle tables
$(function() {
    function historyMainCallback(hash){
        $.each(historyCallbacks,function (i,f){
           f(hash); 
        });
    }
    $.historyInit(historyMainCallback);
    
    $(".petselect").click(function() {
            $(".petselect").removeClass("shortMenuSelected");        
            $(this).addClass("shortMenuSelected");   
            var id=this.id;
            window.location="/video/"+id+"/";
        }
    );
    $(".petselectall").click(function() {
            $(".petselect").removeClass("shortMenuSelected");        
        }
    );
});

function log(e){
    if (debug){
        try{
            console.log(e);
        }catch(e){
        }
    }
}


//end history manager 

//$(window).load(function() {
    //$("#progressbar").progressbar({value: 0});
    //$("#progressbar").progressbar( 'enable' );

    //$("#tabs").tabs();
    
    //try{
        //$(".date").datepicker({changeYear: true,changeMonth: true,yearRange: '1900:<?=date("Y")?>'});
        //$('.date').datepicker('option','dateFormat','dd/mm/yy');
    //}catch(e){
    //}
    //$('input:password').dPassword({duration: 500});
    
//});

//$("#toursito").before("<span class='sx'>&nbsp;</span>");
//$("#toursito").after("<span class='dx'>&nbsp;</span>");

//$(function() {
	//$(".sortable").sortable();
	//$(".sortable").disableSelection();
//});
//$(function() {
	//$(".draggable").draggable({ containment: 'parent' });
//});

//$(document).ready(function(){
//$('#switcher').themeswitcher();

function checkSearch(){
    return $('#q').val()!='' ;
}
 