
/*
	widgets.js
	
	This script activates when the document loading is completed.  It
	looks at every raw widget that was loaded into the widgets column
	and applies css, gradient, and vertical 	positioning to each one.
	
*/

$().ready(function() {

	var n = 0;
	$("div.widget").each(function(i) {
		var W = $(this).find("#widget-content").width();
		$(this).find("").css({ width : W+30 });
		$(this).find("#TM,#MM,#BM").css({ width : W });
		$(this).find("#widget-gradient").css({ width : W + 6 });
		$(this).find("#widget-content").css({ display: 'block', width : W + 6 });
		var H = $(this).find("#widget-content").height();
		$(this).css({ top : n });
		$(this).find("#ML,#MM,#MR").css({ height : H });
		$(this).find("#widget-gradient").css({ height : H + 7 });
		$(this).find("#widget-gradient").gradient({
			from: 'FFFFFF',
			to: 'EEEEEE',
			direction: 'horizontal'
		});
		n = n + H + 24;
		$(this).fadeIn(1000);
	});
	$("#sidebar").css({ 'height' : n + 10 });
	
});

