DD_roundies.addRule('.side-box, .home-news-box, .content-box, .content-img', '6px', true);
DD_roundies.addRule('.side-box h2, .content-box h2, .content-box .inner, .top-news-box', '5px', true);

Cufon.replace('#main-menu ul li a', { fontSize: '17px', textShadow: '#000 0 -1px 0 ' });
Cufon.replace('.side-box h2, .content-box h2, .top-news-box .inner h2.tag', { textShadow: '#fff 0 1px 0' });

$.fn.inputDefaultText = function(options)
{  
	options = $.extend({
		text: 'Hledaný výraz'
	}, options);
	
	return this
		.val(options.text)
		.bind('focus', function(){ if(this.value == options.text) this.value = ''; })
		.bind('blur', function(){ if(this.value == '') this.value = options.text; });
};

$(document).ready(function()
{	
	$('a.external').click(function(){return !window.open($(this).attr("href"))});
	$('#q').inputDefaultText({ text: 'Vyhledávání' });
	
	$('.att-images a').kfBox({ 
		pageSpan: 4
	});

	// rotator
	$.fn.cycle && $('.bnr').cycle({
		fx: 'fade',
		pause: 1,
		speed: 1000,
		timeout: 4000
		}
	);	

	// flash player
	$('.flash-player').each(function(){
 		$(this).flash(
          {
               src: BASE_HREF + 'flash/player.swf',
               width: 400,
               height: 300,
               wmode : "opaque",
               flashvars: {file: $(this).find('a').attr('href'), searchbar: 'false', autostart: 'false', frontcolor: '0x666666', image: $(this).find('img').attr('src')}
          }
     	);
     	// nebudeme zobrazovat alt
     	$(this).find('.alt').css("display","none");
	});	
	$('.flash-banner-360x100').each(function(){
 		$(this).flash(
          {
               src: $(this).find('a').attr('href'),
               width: 360,
               height: 100,
               wmode : "opaque",
               flashvars: {}
          }
     	);
     	// nebudeme zobrazovat alt
     	$(this).find('.alt').css("display","none");
	});	
	$('.flash-banner-360x50').each(function(){
 		$(this).flash(
          {
               src: $(this).find('a').attr('href'),
               width: 360,
               height: 50,
               wmode : "opaque",
               flashvars: {}
          }
     	);
     	// nebudeme zobrazovat alt
     	$(this).find('.alt').css("display","none");
	});	
	$('.flash-banner-728x90').each(function(){
 		$(this).flash(
          {
               src: $(this).find('a').attr('href'),
               width: 728,
               height: 90,
               wmode : "opaque",
               flashvars: {}
          }
     	);
     	// nebudeme zobrazovat alt
     	$(this).find('.alt').css("display","none");
	});	
	// $('#nl-email').inputDefaultText({ text: '@'});
	
	/* Main menu hovering */
	var activeItem = $('#main-menu>ul>li.active');
	var activeTimeout = null;	
	$('#main-menu>ul>li:not(.active)')
		.find('.submenu').hide().end()
		.bind('mouseenter', function(){
			clearTimeout(activeTimeout);			 
			$('.submenu', this).show();
			$('.submenu', activeItem).hide();
	 	})
	 	.bind('mouseleave', function(){
	 		$('.submenu', activeItem).show();
			$('.submenu', this).hide();
		});
});

