$(document).ready(function(){

	$('form.reg input[name="license"]').change(function(){
		var $submit = $(this).closest('form').find('input[type=submit]');

		if ($(this).is(':checked'))
			$submit.removeAttr('disabled');
		else
			$submit.attr('disabled', 'disabled');
	});
	
	
	$('.post-compact .entry-content object').mousedown(function(){
		
		location.href=$(this).closest('a').attr('href');
		return false;
		
	});
	
	$('#sidebar .search input[type="text"]').focus(function(){
		
		if ($(this).attr('value') == 'Hledej...') 
			$(this).attr('value', '');
		
	});
	
	
	if (/MSIE ((5\\.5)|6)/.test(navigator.userAgent) && navigator.platform == "Win32") {

		$('.nav-main > li > a').addClass('level1');

		$('.nav-main > li')
			.addClass('level1')
			.mouseover(function(){
			 	$(this).children('ul').css('left', '0');
				// $('#container2').css('zIndex','-1');
			}).mouseout(function(){
				$(this).children('ul').css('left', '-10000px');
				// $('#container2').css('zIndex','auto');
			});

	} // /MSIE
	
	
	$('div.toggleable')
		.hide()
		.each(function(){
			$(this).prev('h2').addClass('switch off');
		});
	
	$('h2.switch').click(function(){
		
		$(this)
			.toggleClass('off')
			.next('div.toggleable').slideToggle();
		
	});
	
	
});