$(document).ready(function() {
	$("a[rel='external']").attr({target: "_blank"});
	$('a.thickbox').nyroModal();


	var k = top.location + 'a';
	if(k.indexOf('kiosek') != -1) {
		$("a[target='_blank']").attr({target: "_self"});
		$("a[rel='external']").attr({target: "_self"});
		$("a[href$='pdf']").removeAttr("href");
		$("a[href^='mailto:']").removeAttr("href");
		$("a[href^='http://www.mapy.cz']").removeAttr("href");
	}

	$('#cycle').cycle({
		fx: "fade",
		timeout: 5000,
		speed: 500,
		fastOnEvent:   0,
		pager:  '#tabs',
		pagerEvent: 'click',
		pause: 1,
	 	pauseOnPagerHover: 1,
		pagerAnchorBuilder: function(idx, slide) {
			return '#tabs li:eq(' + idx + ') a';
		},
		pagerClick: onPagerClick
	});


function onPagerClick(opts) {
	$('#cycle').cycle('stop');
	$('#tabs li a').removeClass('activeSlide');
	$('#tabs li:eq(' + opts + ') a').addClass('activeSlide');
	$('#awards, #sommelier, #buy').css('z-index','0').hide();
	var show = $('#tabs li:eq(' + opts + ') a').attr('href');
	$(show).css('opacity','1').css('z-index','9').show();
};

    $('body').addClass('jsok');

    $('.stamp-awards').hover(
        function(){
          $(this).children('.bubble').fadeIn();
        },
        function(){
          $(this).children('.bubble').hide();
        }
    )
    
    $('.stamp').hover(
        function(){
          $(this).children('.bubble').fadeIn();
        },
        function(){
          $(this).children('.bubble').hide();
        }
    )

});

function showText() {
	document.getElementById('text').style.height='auto';
	document.getElementById('textbutt').style.display='none';
	document.getElementById('dots').style.display='none';
}

function hilight(id) {
	element = document.getElementById(id);
	if (!element.className) {
		element.className = 'hover';
	} else {
		element.className = '';
	}
}


