$(function(){
	$('.widgets a').click(function(event){
		event.preventDefault();
		
		$('body').append($('<div></div>').addClass('ui-widget-overlay').fadeIn(500).click(closeWidget));
		$('body').append($('<div></div>').addClass('ui-corner-all widget-popup').load(this.href));
		
		$(this).children('div').animate({width:'0px'}, function() { $(this).parent().remove() });
	});
	
	(function(){
		var ma = document.createElement('script'); ma.type = 'text/javascript'; ma.async = true;
		ma.src = document.location.protocol + '//mstats.montage-media.com/ma.js';
		var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ma, s);
	})();
	
	$('.news-ticker > div').each(function(event){ $(this).animate({scrollTop:200}, 80000); });
});

function closeWidget() {
	$('.widget-popup').fadeOut(500, function(){ $(this).remove() });
	$('.ui-widget-overlay').fadeOut(500)
}
