var basePath = basePath || '../';

$(document).ready(function(){

	$('a.external').click(function(){return !window.open($(this).attr("href"))});

	$('.photogallery .section li a').prettyPhoto({overlay_gallery: false});

	$('.hp #signpost a').hover(function(){
		var $img=$(this).find('img');
		$img.attr('src',$img.attr('src').substr(0,$img.attr('src').length-4)+'_on.png');
	},function(){
		var $img=$(this).find('img');
		$img.attr('src',$img.attr('src').substr(0,$img.attr('src').length-7)+'.png');
	});

	$('.hp #signpost img').each(function(){
		var $cacheImage = document.createElement('img');
		$cacheImage.src = $(this).attr('src').substr(0,$(this).attr('src').length-4)+'_on.png';
	});

});

$.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()){
				return false;
			};
		});
	});
};

