function TabPane( id ) {
	var tpId;
	this.tpId = id;
	var selectedTab;
	this.selectedTab = '';

	this.switchTab=function switchTab( newTab, index ) {
		 var w = document.getElementById( newTab ); 
		 w.style.display = '';
		 w.style.zIndex = 99;
		 w = document.getElementById( newTab + 'Header' );
		 w.className = 'tabSelHeader';
		 if( this.selectedTab != '' && this.selectedTab != newTab ) {
			 var t = document.getElementById( this.selectedTab );
			 t.style.display = 'none';
			 t.style.zIndex = -99;
			 t = document.getElementById( this.selectedTab + 'Header' );
			 t.className = 'tabHeader';
		}
		this.selectedTab = newTab;
		this.updateTab( index );
	}

	this.updateTab=function updateTab( index ) {
		var http_request;
		if (window.XMLHttpRequest) { // Mozilla, Safari,...
			http_request = new XMLHttpRequest();
		} else if (window.ActiveXObject) { // IE
			http_request = new ActiveXObject("Microsoft.XMLHTTP");
		}
		var url = 'setTab.php?tabId=' + this.tpId + '&tabIndex=' + index;
		http_request.open('GET', url, true);
		http_request.send(null);
	}
}
