


function showArticle(id) {
tabNavObjects[0].showTabContent(id);
}




function addOnloadHandler(functionName) {
  if (typeof window.onload == 'function') {
  	var currOnloadHandler = window.onload;
  	window.onload = function() {
  		functionName();
  		oldBeforeUnload();
  	}
  } else {
  	window.onload = functionName;
  }
}



TabNavigation = function (_contentHolderIdBase, _linkIdBase, _selectedIndex) {
  this.contentHolderIdBase = _contentHolderIdBase;
  this.linkIdBase = _linkIdBase;
  if (_selectedIndex) {
    this.selectedIndex = _selectedIndex;
  } else {
    this.selectedIndex = 0;
  }
  this.oldActiveIdx = null;
};

TabNavigation.prototype.init = function () {
  this.showTabContent(this.selectedIndex);
};

TabNavigation.prototype.showTabContent = function (idx) {
  if (idx == this.oldActiveIdx) {
    return;
  }
  var idxStr = String(idx);
  var currContHolderId = this.contentHolderIdBase + idxStr;
  var currLinkId = this.linkIdBase + idxStr;
  document.getElementById(currContHolderId).style.display = "block";
  this.setTabClass(currLinkId, "on");
  this.hideOldActiveContent();
  this.oldActiveIdx = idxStr;
};

TabNavigation.prototype.hideOldActiveContent = function () {
  if (this.oldActiveIdx) {
    var formerAciveContHolderId = this.contentHolderIdBase + this.oldActiveIdx;
    var currLinkId = this.linkIdBase + this.oldActiveIdx;
    document.getElementById(formerAciveContHolderId).style.display = "none";
    this.setTabClass(currLinkId, "off");
  }
};

TabNavigation.prototype.setTabClass = function (id, state) {
  document.getElementById(id).className = state;
};


function toggle(what, what2)
{
	if(!document.getElementById){
		return null;
	}
	
	var toggleWhat = document.getElementById(what);
	if(toggleWhat.style.display != "none"){
		toggleWhat.style.display = "none";
	}else{
		toggleWhat.style.display = "block";
	}
	
	toggleWhat = document.getElementById(what2);
	if(toggleWhat.style.display != "none"){
		toggleWhat.style.display = "none";
	}else{
		toggleWhat.style.display = "block";
	}
	
}




