// google analytics
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-136721-6']);
_gaq.push(['_trackPageview']);
(function() {
  var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

// jquery
var i_max = 0;
$(document).ready(function(){
  // hlavicka
  $("#header-image-over").fadeTo(0, 0.5);
  for (i = 1; i <= i_max; i++) {
    setTimeout( function() {
      $("#header-image-over").animate({ width: "860px" }, 500 );
      $("img.motiv:hidden:first").fadeIn("slow");
      $("#header-image-over").animate({ width: "160px" }, 600 ).animate({ width: "190px" }, 200 ).animate({ width: "175px" }, 100 ).animate({ width: "185px" }, 100 ).animate({ width: "180px" }, 100 );
      }, i * 6000);
  }
  // mailer
  $("#mailer_button").click(function () {
    $("#mailer_button").attr("disabled","disabled");
    $("#mailer_step").attr("value","10");
    $("#mailer_form").submit();
  });
  $("#mailer_button").attr("disabled","");
  // newsletter
  $("#newsletter-box").fadeIn(2000).fadeTo(2000, 1).fadeTo(1000, 0.75);
  setTimeout( function() { $("#newsletter-box a").fadeTo(1000, 0.45); }, 4000);
});

