dojo.addOnLoad(function() {

    dojo.require("dojo.fx");

	// user menu special effects
	var userMenu = dojo.byId("topMenu");
	if (userMenu) {

	   	var link = dojo.byId("yellow");
		var drop = dojo.query(".dropDown")[0];
		dojo.connect(drop, "onmouseover", function(){
			dojo.addClass(link, "yellowChildOver");
		});

		dojo.connect(drop, "onmouseout", function(){
			dojo.removeClass(link, "yellowChildOver");
		});

		dojo.query(".dropDown").forEach(function(n) {
		l = n.parentNode;
		var link = dojo.byId("yellow");
		dojo.connect(l, "onmouseenter", function(){
					dojo.style(n, "left", "0");
					dojo.fx.wipeIn({node: n, duration: 220}).play();
				});
		dojo.connect(l, "onmouseleave", function(){
					dojo.style(n, "left", "-999em");
					dojo.style(n, "display", "none");
				});
	    });
    }

    var getOffset = function(){
	var img = dojo.query('.postMeta a img')[0];
	if(typeof img !== 'object') return;
	var imageHeight = img.height;
	/* Featured height - 10px padding-top */
	return (imageHeight - 95) + 'px';
    }

    var featured = dojo.byId('featured');
    featured && dojo.style(featured, 'top', getOffset());

});
