$(function(){

    $(".menu-item:not(.current-menu-item)").each(function() {
		var $a = $(this).children("a");
		var $div = $(this).children("div");

		$div.fadeTo(1, 0.4);

		$a.hover(function(){
			$div.stop().fadeTo(400, 1);
		},function(){
			$div.stop().fadeTo(200, 0.4);
		});
    });

	// Tooltips

	$(".tooltip").each(function() {

		var ele = $(this);
		var text = null;

		switch (ele.attr("tagName")) {
			case 'IMG': text = ele.attr("alt"); break;
			case 'A': text = ele.attr("title"); break;
		}
		
		ele.qtip({
			content: text,
			position: {
				corner: {target: 'topRight', tooltip: 'bottomLeft'},
				adjust: {screen: true}
			},
			style: {
				border: {width: 3, radius: 3},
				padding: 7,
				textAlign: 'left',
				tip: true,
				name: "cream"
			}
		});

	});

	$(".roundedCorners").each(function() {

		var ele = $(this);
		ele.corner(ele.metadata().roundedCorners);

	});

});
