var basePath = basePath || '../';


$(document).ready(function(){

	$('a.external').click(function(){return !window.open($(this).attr("href"))});

	/*
	$('.references li').bind('mouseenter mouseleave',function(){
		$(this).toggleClass('highlight');
	});
	*/

	$('#reference').overscroll({'showThumbs': true});

	$('a.hover-img').hover(function(){
		var $src=$(this).find('img').attr('src');
		var $ext=$src.substr($src.lastIndexOf('.'));
		var $filename=$src.substr(0,$src.lastIndexOf('.'));
		$(this).find('img').attr('src',$filename+'-hover'+$ext);
	},function(){
		var $src=$(this).find('img').attr('src');
		var $ext=$src.substr($src.lastIndexOf('.'));
		var $filename=$src.substr(0,$src.lastIndexOf('.')-6);
		$(this).find('img').attr('src',$filename+$ext);
	});

	$('.references li').hover(function(){ $(this).stop().animate({ backgroundColor: "#e2debf"}, 250);}, function(){	$(this).stop().animate({ backgroundColor: "#ffffff"}, 3000);	});

});

/*
$(window).load(function(){
});
*/

$.fn.inputDefaultText = function(options)
{
	options = $.extend({
		text: 'Hledany vyraz'
	}, options);
	return this.each(function()
			{
		var $this = $(this);
		if($this.val() == options.text || $this.val() == '') $this.val(options.text);
		$this
			.bind('focus', function(){ if($(this).val() == options.text) $(this).val(''); })
			.bind('blur', function(){ if($(this).val() == '') $(this).val(options.text); });

		$this.closest('form').bind('submit', function(){
			if($this.val() == options.text) $this.val('');
		});
	});
};

