$(document).ready(function(){
	
	$('a').click(function(){
		$(this).blur();
	});
	
	$('.vesti-hover, .vesti-right-hover, .vesti-rest-hover, .vesti-hover-pregled, .vesti-hover-plugin').css('cursor','pointer');
	
	$('.vesti-hover').hover(
		function(){
			$(this).css('background-color','#eeeded');
			$(this).css('border-color','#c9c9c9');
		},
		function(){
			$(this).css('background-color','#f6f6f6');
			$(this).css('border-color','#f6f6f6');
		}
	);
	
	$('.vesti-hover-pregled, .vesti-hover-plugin').hover(
		function(){
			$(this).css('background-color','#eeeded');
			$(this).css('border-color','#c9c9c9');
			$(this).css('border-top', '1px solid #c9c9c9');
		},
		function(){
			$(this).css('background-color','#f6f6f6');
			$(this).css('border-color','#f6f6f6');
			$(this).css('border-top', '1px dotted #c9c9c9');
		}
	);
	
	$('.vesti-right-hover').hover(
		function(){
			$(this).css('background-color','#eeeded');
			$(this).css('border-color','#c9c9c9');
		},
		function(){
			$(this).css('background-color','#f6f6f6');
			$(this).css('border-color','#f6f6f6');
		}
	);
	
	$('.vesti-rest-hover').hover(
		function(){
			$(this).css('background-color','#fefefe');
			$(this).css('border-color','#d4d4d4');
		},
		function(){
			$(this).css('background-color','#ffffff');
			$(this).css('border-color','#ffffff');
		}
	);
	
	$('.vesti-hover, .vesti-right-hover, .vesti-rest-hover, .vesti-hover-plugin').click(
		function(){
			var id = $(this).attr("rel");
			window.location = "http://"+document.location.host+"/vesti/pregled/id/"+id;						  
		});
	
	$('.vesti-hover-pregled').click(function(){
			var id = $(this).attr("rel");
			window.location = "http://"+document.location.host+"/vesti/pregled/id/"+id;								 
		});
	
	$('.newYear').hide();
	$('.newYear:first').show();
	
	jQuery.fn.fadeToggle = function(speed, easing, callback) {
		return this.animate({opacity: 'toggle'}, speed, easing, callback);
	};
	
	
	
	$('.newYearTitle').click(function () {
		if($(this).parent().find('.newYear').css('display') == 'none'){
			$('.newYear').hide();
			$(this).parent().find('.newYear').fadeToggle();	
		}
    });

});
