// Menu

(function($) {
$.fn.lavaLamp = function(o) {
    o = $.extend({ fx: "linear", speed: 500}, o || {});

    return this.each(function() {
        var me = $(this), noop = function(){},
            $back = $('<li class="active"><span></span></li>').appendTo(me),
            $li = $("li", this), curr = $("li.sel", this)[0] || $($li[0])[0];

        $li.not(".active").hover(function() {
            move(this);
        }, noop);

        $(this).hover(noop, function() {
            move(curr);
        });
        setCurr(curr);

        function setCurr(el) {
            $back.css({ "left": el.offsetLeft+"px", "width": el.offsetWidth+"px" });
            curr = el;
        };

        function move(el) {
            $back.each(function() {
                $.dequeue(this, "fx"); }
            ).animate({
                width: el.offsetWidth,
                left: el.offsetLeft
            }, o.speed, o.fx);
        };

    });
};
})(jQuery);




$(function() {

	// Fonts

	Cufon.replace('#primary a', {fontFamily: 'ZineSlabDis-XBoldRomanTf' });
	Cufon.replace('h1, h2, #cboxTitle',		{fontFamily: 'ZineSlabDisBlackItalic'   });
	Cufon.replace('#intro h1',  {textShadow: '-1px 2px rgba(0, 0, 0, 0.65)'})
	
	
	// Navigation
	
	$("#primary ul, .global-menu ul").lavaLamp({
		fx: "easeOutBack", 
		speed: 1000
	});
	
	// no border on images
	
	$('a:has(img)').addClass('no-border');
	

});
