//=======================================================================================================
//-------------------------------------------------------------------------------------------------------
//	Custom Javascript functions
//-------------------------------------------------------------------------------------------------------
//=======================================================================================================
//-------------------------------------------------------------------------------------------------------
//	JAuery hide empty menus
//-------------------------------------------------------------------------------------------------------
$(function(){

	$(document.body).ready
	(
		function(){$(this).find('ul.m2').HideEmpty();}
	);
});

jQuery.fn.HideEmpty = function() {
  return this.each(function(){
	var itemcount	= $(this).find('li').length;
	if( !itemcount || itemcount == 0 )
	  {
		$(this).css( "visibility", "hidden" );
		$(this).parent().find("a:first").removeClass("showsub");
	  }
  });
};

$(document).ready(function() 
    { 
        $("table.sortable").tablesorter(); 
    } 
); 



function toTimestamp(year,month,day,hour,minute,second){
 var datum = new Date(Date.UTC(year,month-1,day,hour,minute,second));
 return datum.getTime()/1000;
}


