$(document).ready(function() {
	$('ul.nav li.dropdown').mouseover(function(){
		$(this).addClass('open');
	});
	$('ul.nav li.dropdown').mouseout(function(){
		$(this).removeClass('open');
	});
	
	
	var nav_width = $('.navbar-default ul.navbar-nav').width()/2;
	$('.navbar-default ul.navbar-nav').css({'margin-left':500- nav_width + 'px'}).addClass('centered');
	$('.popover-dismiss').popover({
		placement:'top',
		trigger:'hover'
	});
	var today = new Date();
	var curent_month = today.getUTCMonth();
	var start_year = $('.start-year').data('year');
	var start_year_next = start_year + 1;
	
	var date = new Date("01 January "+start_year+" 00:00");
	var date_ = new Date("01 January "+start_year_next+" 00:00");
	var l = (date_.getTime() -  date.getTime())/365;
	var cur_ms_time= today.getTime() -  date.getTime();
	var width_ = cur_ms_time/(l) ;
	$('.red-timeline').animate(
		{width:width_ + 124 + 'px'}, 
		{
		duration: 2000,
		specialEasing: {
		  width: "linear"
		},
		complete: function() {
		  
		}
	  });
	 $('.report-file-size').each(function(){
		var old_file_size = $(this).html();
		$(this).html(old_file_size/1000);
		
	 });
	 
	 $('.panel-title').click(function(){
	 if($(this).parent().children('div').hasClass('opened_title'))
	 {
		$(this).parent().children('div').removeClass('opened_title');
	 }
	 else{
		$('.panel-heading> div').removeClass('opened_title');
		$(this).parent().children('div').addClass('opened_title');
	 }
		
	 });
	
});


