﻿// Tab Collection
var tabs = new Array();

function RegisterTab(tabName) {
	tabs.push(tabName);
}

function ChangeTab(tabName) {
	for (i = 0; i < tabs.length; i++) {
		if (tabs[i].toString().toLowerCase() != tabName.toString().toLowerCase()) {
			HideTab(tabs[i]);
		}
	}

	ShowTab(tabName);
}

function ChangeTabRounded(tab, index) {
	var currenttab = document.getElementById('current');
	currenttab.id = ""

	for (i = 0; i < tabs.length; i++) {
		HideTab(tabs[i]);
	}

	ShowTabRounded(tab, index);
}

function ShowTab(tabName) {
	var tab = document.getElementById(tabName + '_tab');

	if (tab != null) {
		tab.className = 'tabOn';
	}

	var panel = document.getElementById(tabName + '_panel')

	if (panel != null) {
		panel.style.display = 'block';
	}
}

function ShowTabRounded(tab, index) {

	if (tab != null) {
		tab.id = 'current';
	}

	var panel = document.getElementById('tab' + index.toString() + '_panel')

	if (panel != null) {
		panel.style.display = 'block';
	}
}

function HideTab(tabName) {
	var tab = document.getElementById(tabName + '_tab');

	if (tab != null) {
		tab.className = 'tabOff';
	}

	var panel = document.getElementById(tabName + '_panel')

	if (panel != null) {
		panel.style.display = 'none';
	}
}

if (typeof (Sys) !== 'undefined')
	Sys.Application.notifyScriptLoaded();
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();