//Tabs
var jmvTabs = {
	resetTabContent: function(show) {
		$$('.tabContent').each(function(div,index) {
			$('noBg').removeClass('activeOver');
			if(index==show) {
				$("tab-"+(show+1)).addClass("active");
			} else {
				div.setStyle("display","none");
			}
		});
		if(show==0) {
			$('noBg').addClass('activeOver');
		}
	},
	resetTabs: function() {
		$$(".unTab").each(function(tab,index) {
			tab.removeClass("active");
		});
		$('noBg').removeClass('active');
	},
	initTabs: function() {
		var theObject = this;
		$$(".unTab").each(function(tab,index) {
			tab.addEvent("click",function() {
				theObject.resetTabContent(null);
				var tabId = tab.getProperty("id");
				var tabNum = tabId.split('-');
				$('tabContent'+tabNum[1]).setStyle("display","block");
				theObject.resetTabs();
				tab.addClass("active");
				if(tabNum[1]==1) {
					$('noBg').addClass('activeOver');
				}
			});
		});
		theObject.resetTabContent(0);
		$('tab-1').addEvent('mouseenter',function() {
			$('noBg').addClass('activeOver');
		});
	}
}

