	
    /*
	Cufon.replace('#mainMenu a', {
        textShadow: '1px 1px rgba(255, 255, 255, 0.0)'
    });
    */
    Cufon.replace('h1');


$(document).ready(function(){

		
		var ticker = $("#ticker");
		var biggest = size = 0;
		var elements = ticker.children().filter("li").length;
		ticker.parent().css({"overflow":"hidden"});

		ticker.children().filter("li").each(function() {

		 	$(this).css({"float":"left","marginLeft":"25px"});

			size += $(this).width();

			if($(this).width() > biggest){biggest = $(this).width();}

		});



		while(size < parseInt(ticker.width()+biggest+40)) {

		  	

			ticker.children().filter("li").each(function(e) {

				if(e < elements) {

					ticker.append("<li style='float:left;margin-left:25px;'>"+$(this).html()+"</li>");

					size += parseInt($(this).width()+25);

				}

			});
			
		}

		ticker.css({"overflow":"hidden","width":size*2+"px","list-style":"none"});


		function animator(currentItem) {



		  var distance = currentItem.width();

			duration = (distance) / 0.050;

		  	currentItem.animate({ marginLeft: -distance }, duration, "linear", function() {

			currentItem.appendTo(currentItem.parent()).css("marginLeft", 25);

			animator(currentItem.parent().children(":first"));

		  }); 

		};

		animator(ticker.children(":first"));



		ticker.mouseenter(function() {

		  ticker.children().stop();

		});

		ticker.mouseleave(function() {

		  animator(ticker.children(":first"));

		});

	});
