$(document).ready(function(){

	//Examples of how to assign the ColorBox event to elements
	$("a[rel='lightbox']").colorbox({transition:"none", opacity: 0.7});
	$("a[rel='lightbox_print']").colorbox({width:800,transition:"none", opacity: 0.7});
	$(".html, .width1024").colorbox({width:1024, height:"90%", iframe:true, opacity: 0.7, transition:"none"});
	$(".width900").colorbox({width:900, height:"90%", iframe:true, opacity: 0.7, transition:"none"});
	$(".width960").colorbox({width:960, height:"90%", iframe:true, opacity: 0.7, transition:"none"});
  
  $(".scroll-efect").addClass("scroll-bg");
  
		$("#scroller").simplyScroll({
			autoMode: 'loop',
			pauseOnHover: false,
			frameRate: 30,
			speed: 1
		});
  
  // najetí myší
  $("tr").mouseover(function(){
    $(this).addClass("over");
  });
   
  // odjetí myši
  $("tr").mouseout(function(){
    $(this).removeClass("over");}
  );
  
  $('.titmenu a').bt({
    padding: 5,
    width: 200,
    spikeLength: 10,
    spikeGirth: 5,
    cornerRadius: 0,
    fill: 'rgba(82,214,229, 1)',
    strokeWidth: 1,
    strokeStyle: '#000',
    positions: ['right', 'left', 'bottom'],
    cssStyles: {color: '#000', fontWeight: 'bold', fontSize: '80%'}
  });

  $('.menutop a').bt({
    padding: 5,
    width: 200,
    spikeLength: 10,
    spikeGirth: 5,
    cornerRadius: 0,
    fill: 'rgba(82,214,229, 1)',
    strokeWidth: 1,
    strokeStyle: '#000',
    positions: ['bottom'],
    cssStyles: {color: '#000', fontWeight: 'bold', fontSize: '80%'}
  });
  
  $('#first a').bt({
    padding: 5,
    width: 75,
    spikeLength: 10,
    spikeGirth: 5,
    cornerRadius: 0,
    fill: 'rgba(82,214,229, 1)',
    strokeWidth: 1,
    strokeStyle: '#000',
    positions: ['bottom'],
    cssStyles: {color: '#000', fontWeight: 'bold', fontSize: '80%'}
  });

	$('.holder').roundabout({
		easing: 'easeInOutBack',
		duration: 2000,
		tilt: -4
	});

  var msie6 = $.browser == 'msie' && $.browser.version < 7;
  
  if (!msie6) {
    var prvek = '#obs .left .speedkontakt';
    var top = $( prvek ).offset().top - parseFloat($( prvek ).css('margin-top').replace(/auto/, 0));
    $(window).scroll(function (event) {
      // what the y position of the scroll is
      var y = $(this).scrollTop();
      
      // whether that's below the form
      if (y >= top) {
        // if so, ad the fixed class
        $( prvek ).addClass('fixed');
      } else {
        // otherwise remove it
        $( prvek ).removeClass('fixed');
      }
    });
    
    var prvek2 = '#obs .left .poznamka';
    var topoz = $( prvek2 ).offset().top - parseFloat($( prvek2 ).css('margin-top').replace(/auto/, 0)) - 209;
    $(window).scroll(function (event) {
      // what the y position of the scroll is
      var ypoz = $(this).scrollTop();
      
      // whether that's below the form
      if (ypoz >= topoz) {
        // if so, ad the fixed class
        $( prvek2 ).addClass('fixedpozn');
      } else {
        // otherwise remove it
        $( prvek2 ).removeClass('fixedpozn');
      }
    });
  }



 });
