$(document).ready(function() {
// 	$('input:checkbox:not([safari])').checkbox();
// 	$('input[safari]:checkbox').checkbox({cls:'jquery-safari-checkbox'});
// 	$('input:radio').checkbox();
// 	$('a.code').each(function() {
// 		$(this).click(function(){
// 			eval($(this).text());
// 			return false;
// 		})
// 	});
	
	// OBSLUHA PRO radio //
	$('.radio').checkBox();

	// OBSLUHA fotogalerie //
	$("#ss_zobrazit_galerii").click(function(){
		$(this).slideUp("fast");
	  $("#ss_skryt_galerii").slideDown("fast");
	  $("#fotogal_article_2").slideDown("slow");
	});

	$("#ss_skryt_galerii").click(function(){
		$(this).slideUp("fast");
	  $("#ss_zobrazit_galerii").slideDown("fast");
	  $("#fotogal_article_2").slideUp("slow");
	});
	

    setInterval( "slideHeader()", 5000 );
    setInterval( "slideSlogan()", 5000 );
    setInterval( "slideSlogan_2()", 5000 );

});

displayForm = function (elementId)
{
	var content = [];
	$('#' + elementId + ' input').each(function(){
		var el = $(this);
		if ( (el.attr('type').toLowerCase() == 'radio'))
		{
			if ( this.checked )
				content.push([
					'"', el.attr('name'), '": ',
					'value="', ( this.value ), '"',
					( this.disabled ? ', disabled' : '' )
				].join(''));
		}
		else
			content.push([
				'"', el.attr('name'), '": ',
				( this.checked ? 'checked' : 'not checked' ),
				( this.disabled ? ', disabled' : '' )
			].join(''));
	});
	alert(content.join('\n'));
}

changeStyle = function(skin)
{
	jQuery('#myform :checkbox').checkbox((skin ? {cls: skin} : {}));
}

function slideHeader() {
    var $active = $('#header_img IMG.active');

    if ( $active.length == 0 ) $active = $('#header_img IMG:last');

    var $next =  $active.next().length ? $active.next()
        : $('#header_img IMG:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}


function slideSlogan() {
    var $active = $('#header_slog div.active');

    if ( $active.length == 0 ) $active = $('#header_slog div:last');

    var $next =  $active.next().length ? $active.next()
        : $('#header_slog div:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

function slideSlogan_2() {
    var $active = $('#header_slog_2 div.active');

    if ( $active.length == 0 ) $active = $('#header_slog_2 div:last');

    var $next =  $active.next().length ? $active.next()
        : $('#header_slog_2 div:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}
