$(document).ready(function(){


        
		$("a.zoom").fancybox({
			'overlayOpacity'	:	0.7,
			'overlayColor'		:	'#fff'
		});
		$("div.foto a").fancybox({
			'overlayOpacity'	:	0.7,
			'overlayColor'		:	'#fff'
		});
		$('#topMenu .content ul li a').css({
			'width': Math.round(900/($('#topMenu .content ul li a').length)) +'px'
		});


		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"));

		});



	});
	


    $(document).ready(function(){

        $("a.zoom").fancybox({
            'overlayOpacity'    :    0.7,
            'overlayColor'        :    '#fff'
        });
        
        $("a.zoom2").fancybox({
            'overlayOpacity'    :    0.7,
            'overlayColor'        :    '#fff'
        });
        
        
        $("div.foto a").fancybox({
            'overlayOpacity'    :    0.7,
            'overlayColor'        :    '#fff'
        });
        $('#topMenu2 .content ul li a').css({
            'width': Math.round(965/($('#topMenu2 .content ul li a').length)) +'px'
        });


        var ticker = $("#ticker2");
        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"));

        });


    });
    
    
    
	Cufon.replace('h1');

	Cufon.replace('.h1');

	Cufon.replace('#topMenu .content ul li a',{hover:true});
	
	Cufon.replace('.category_name');
