
$(document).ready(function(){
	// Search input - on click clear value "hledej" and add class with another text color
	$('#search_string').click(function(){
		$(this).val('');
		$('#search').addClass("search_color");
	});

	// To switch directions up/down and left/right just place a "-" in front of the top/left attribute
	// Caption Sliding (Partially Hidden to Visible)
	$('.contact .item.caption').hover(function(){
		$(".cover", this).stop().animate({top:'80px'},{queue:false,duration:160});
	}, function() {
		$(".cover", this).stop().animate({top:'155px'},{queue:false,duration:160});
	});

	// Confirmation while deleting item
	$(document).ready(function(){
		$(".delete").click(function(event){
			if ( ! confirm("Do you really want to delete this item?")) {
				event.preventDefault();
			}
		});
	});

	// Tooltip on hover
	$(document).ready(function(){
        $(".tooltip").easyTooltip();
	});

	// Open links in new tab for elements with class "new_tab"
	$(".new_tab").click(function() {
		window.open(this.href);
		return false;
	});

	// Better hover effect for latest publications on index
	$('.latest_publications .item').hover(function() {
		$('.number_1 span', this).css('background-position', '-49px 0px');
		$('.number_2 span', this).css('background-position', '-76px 0px');
		$('.number_3 span', this).css('background-position', '-69px 0px');
		$('h3 a', this).css('color', '#404040');
	}, function(){
		$('.number_1 span', this).css('background-position', '0px 0px');
		$('.number_2 span', this).css('background-position', '0px 0px');
		$('.number_3 span', this).css('background-position', '0px 0px');
		$('h3 a', this).css('color', '#ed7d2b');
	});
	
});

