(function($){
		
	$.fn.tabControl = function(settings) {
		settings = $.extend({
			tabSection: '.tabSection',
			tabTitle: '.tabTitle'
		}, settings);
		
		return this.each(function() {
			var $self = $(this),
					$tabSections;
			
			$tabSections = $(settings.tabSection, this);
			$tabSections.not(':first').hide();
			
			
			var $tabs = $(this).find('ul.tabs');
			
			$tabSections.each(function(i) {
				$(settings.tabTitle, this).remove().text();
			});

			$tabs.find('li').each(function(i) {
				var $tab = $(this);				
				$tab.bind('click', function() {
					if($tab.hasClass('active')) { return false; }
					$tab.addClass('active').siblings().removeClass('active');
					$tabSections.hide().filter(':eq(' + i + ')').show();
					return false;
				}).css('outline', 'none');
			});
		});
	};
	
	$.fn.ellipsis = function(enableUpdating){
		var s = document.documentElement.style;
		
		if (!('textOverflow' in s || 'OTextOverflow' in s)) {
			return this.each(function() {
				var el = $(this);
				if(el.css("overflow") == "hidden") {
					var originalText = el.html(),
						text = originalText,
						w = el.width() - 15,
						t = $("#_ellipsis_calc"),
						tWidth = t.length > 0 ? t.width() : 0;
					
					if(t.length < 1) {
						t = $("<span id='_ellipsis_calc'/>").appendTo("body");
					}
					
					t.html(originalText).hide();

					while(text.length > 0 && t.width() > w) {
						text = text.substr(0, text.length - 1);
						t.html(text + "...");
					}
					
					el.html(t.html());
					if(t.length > 0) { t.remove(); }
		       
					if(enableUpdating == true) {
						var oldW = w;
						
						setInterval(function() {
							if(w != oldW) {
								oldW = w;
								el.html(originalText);
								el.ellipsis();
							}
						}, 200);
					}
				}  
			});   
		} else {
			return this;   
		}
	};
	
})(jQuery);

$(document).ready(function(){
	if(typeof marketSummary != 'undefined') { marketSummary.initPage(); }
	$("#belly").css("display", "block");
});

//if (document.addEventListener) {
//	window.addEventListener('DOMContentLoaded', function() {
//		$('.topNews-a').css('display', 'inline');
//	}, false);//Fix FF display issue with regards to typeface setting to display:inline-block
//}
//
			
