$(document).ready(function() {
	newsTicker("#news_scrolling");
});
/*
function newsTicker(pSelector) {
	if ($(pSelector+' > div').length > 1) {
		var ticker = function() {
			var h = $(pSelector+' > div').eq(0).height();
			$(pSelector+' > div').eq(0).animate( {marginTop: -h}, 2000, 'linear', function() {
				$(this).detach();
				$(this).removeAttr('style');
				$(pSelector).append($(this));
				ticker();
			});
		};
		ticker();
	}
}
*/
function newsTicker(pSelector) {
	if ($(pSelector+' > div').length > 1) {
		var ticker = function() {
			var h = $(pSelector+' > div').eq(0).height();
			$(pSelector+' > div').eq(0).animate( {marginTop: -h}, 4000, 'linear', function() {
				$(this).detach().removeAttr('style').appendTo(pSelector);
				//$(this).detach();
				//$(this).removeAttr('style');
				//$(pSelector).append($(this));
				ticker();
			});
		};
		ticker();
	}
}
