$(document).ready(function()
{
  $('input.submitReplace').each(function()
	{
	  var el = $(this);
	  el.css({position: 'absolute', left: '-10000em'})
		.focus(function() { $(this).after().trigger('focus'); })
		.after('<a class="btn" href="#" onclick="$(this).prev(\'input\').trigger(\'click\'); return false;"><span>' + el.attr('value') + '</span></a>');
	});
	
	$('div.offerBox').mouseover(function()
	{
	  $(this).addClass('offerBox_hover');
	  Cufon.replace('div.offerBox h3, div.offerBox p.price', {fontFamily: 'Dobra'});
	}).mouseout(function()
	{
	  $(this).removeClass('offerBox_hover');
	  Cufon.replace('div.offerBox h3, div.offerBox p.price', {fontFamily: 'Dobra'});
	});
	
	$('div.article').mouseover(function()
	{
	  $(this).addClass('article_hover');
	}).mouseout(function()
	{
	  $(this).removeClass('article_hover');
	});
	
	Cufon.replace('#head strong.fRight', {fontFamily: 'Myriad Pro'});
	Cufon.replace('#cont table.styled thead th, #headSlide h2, #cont h1, #cont h2, #cont h3, #cont h4, #cont strong.title, #cont div.offerBox p.price, #cont span.numBul', {fontFamily: 'Dobra'});
	Cufon.replace('#cont span.numBul',
	{
	  fontFamily: 'Dobra',
	  textShadow: '#A4D342 1px 1px'
	});
	Cufon.now();
	
	var el = $('#headSlide div.scrollable');
  el.css('height', el.height() + 'px');
	$('#headSlide div.scrollable div.items').css('position', 'absolute').children('span.clearFix').remove();
	$('#headSlide div.scrollable').scrollable(
  {
    keyboard: 'static',
    interval: 5000,		
    speed: 600,
    circular: true,
    next: '.headSlide_next',
    prev: '.headSlide_prev'
  }).navigator('#headSlide .slideNavi').autoscroll(
	{
		autoplay: true
	});
	
	$('a.lightbox').colorbox({
		photo: true,
		current: 'Fotografie {current} z {total}',
		previous: 'předchozí',
		next: 'další',
		maxWidth: '90%',
		maxHeight: '90%'
	});
});

if (typeof(Loader) != 'undefined') Loader.load();
