
      // JavaScript Document // EDVENS MEDIA s.r.o. // revize 0.4

      jQuery.noConflict();
      jQuery.easing.easeOutQuart = function (x, t, b, c, d) {
       return -c * ((t=t/d-1)*t*t*t - 1) + b;
      };
      jQuery(document).ready(function() {

        /* jQuery - function: FancyBox (http://fancy.klade.lv/howto)
        ============================================================================*/
        jQuery("p.gallery a").fancybox({
          'zoomSpeedIn':	1000,
          'zoomSpeedOut':	1000,
          'overlayShow':	true
        });
	      jQuery("a.flash").fancybox({
          'frameWidth': 480,
          'frameHeight': 290,
		      'hideOnContentClick': false
	      });

        // lightbox
        // jQuery(".lightbox").lightbox();

        // Animated Scrolling for Same-Page Links
        /*
        function filter(string) {
          return string
            .replace(/^\//,'')
            .replace(/(index|default)\.[a-zA-Z]{3,4}$/,'')
            .replace(/\/$/,'')
        }
        jQuery('a[href*=#]').each(function() {
          if (filter(location.pathname) == filter(this.pathname)
          && location.hostname == this.hostname
  	     && this.hash.replace(/#/,'') ) {
            var $targetId = jQuery(this.hash), $targetAnchor = jQuery('[name=' + this.hash.slice(1) +']');
            var $target = $targetId.length ? $targetId : $targetAnchor.length ? $targetAnchor : false;
            if ($target) {
              var targetOffset = $target.offset().top;
              jQuery(this).click(function() {
                jQuery('html, body').animate({scrollTop: targetOffset}, 400);
  	           return false;
  	         });
            }
          }
        });
        */

    
        // Sending Contact Form over Ajax
        jQuery('#form form').attr({action: "./"});
        jQuery('#form form').attr({method: "post"});
        jQuery('#form input#button').click(function()
        {
          var jmeno   = jQuery("#form input#name").val();
          var email   = jQuery("#form input#mail").val();
          var zprava  = jQuery("#form textarea#message").val();
          if ((jmeno=="")||(email=="")||(zprava=="")) { alert('Je potřeba vyplnit všechna políčka.'); }
          else
          {
            jQuery.ajax({
              type: "POST",
              url: "./",
              data: "jmeno=" + jmeno + "&email=" + email + "&zprava=" + zprava + "&phpmailer=",
              success: function(msg){
                if (msg.substr(0,1)=="1")
                { // uspesne odeslano, proto vymazeme kolonky
                  jQuery("input#name").val("");
                  jQuery("input#mail").val("");
                  jQuery("textarea#message").val("");
                }
                jQuery("#mail-status").text( msg.substr(1) );
              }
            });
          }
          return false;
        });



      });
