﻿function toggleTab(row) {
	var tab = row.childNodes[1];
	var text;
	var newZIndex;
	var newLeft;
	var blockDisplay;

	if (tab.style.zIndex == 0) {
		text = 'Hide';
		newZIndex = 2;
		newLeft = -42;
		blockDisplay = 'block';
	} else {
		text = 'Show';
		newZIndex = 0;
		newLeft = 0;
		blockDisplay = 'none';
	}

	if (tab.textContent) {
		tab.textContent = text;
	} else {
		tab.innerText = text;
	}
	
	tab.style.zIndex = newZIndex;
	tab.style.backgroundPosition = newLeft + 'px 0px';
	row.nextSibling.style.display = blockDisplay;
}
