﻿/*************************************************/
/* jQuery Marqeee Plugin v0.9
/* © Fenomen multimedia, www.fmm.cz
/*************************************************/
(function($) {
  $.fn.marqueee = function() {
      return this.each(function() {
          var x=0;
          var $this = $(this);
  		  $this.css({'overflow': 'hidden'});
		  $this.contents().wrap('<div id="marqueeeIn" />');
          $('#marqueeeIn').css('position', 'absolute');
          $('#marqueeeIn').css('white-space', 'nowrap');
		  var from  = $this.width();
		  $('#marqueeeIn').css('left', from+'px');
		  //var limit = ($('#marqueeeIn').width()-$this.width())*-1;
		  var limit = ($('#marqueeeIn').width())*-1;
		  function animace() {
		      jQuery.fx.interval = 70;
			  $('#marqueeeIn').animate(
            	{left: limit },
				{duration: 60000, 
				 step: function( now, fx ){ },
				 complete: function() {$('#marqueeeIn').css('left', from+'px'); animace();}
              }
			);
          }
		  animace();
      }); 
   }; 
})(jQuery);
/*
if (parseInt($('#marqueeeIn').css('left')) == 0){ alert("nula"); }
*/
