var TabSelected=1;
var TabLimit=20;

function OpenCloseTab(me){

	TabSelected=me;
	for (i=1;i<=20;i++) {

		if (i!=me) {
			if (document.getElementById('Tab' + i)!=null) document.getElementById('Tab' + i).style.visibility='hidden';
			if (document.getElementById('Tab' + i)!=null) document.getElementById('Tab' + i).style.display='none';
			if (document.getElementById('Tab' + i)!=null) document.getElementById('Tab' + i).style.height='';			
			if (document.getElementById('TabCapBg' + i)!=null) document.getElementById('TabCapBg' + i).style.backgroundImage='url(img_struct/tabBgr.gif)';
			if (document.getElementById('TabCapSX' + i)!=null) document.getElementById('TabCapSX' + i).src='img_struct/tabPartSX.gif';
			if (document.getElementById('TabCapDX' + i)!=null) document.getElementById('TabCapDX' + i).src='img_struct/tabPartDX.gif';
			if (document.getElementById('TabCapBg' + i)!=null) document.getElementById('TabCapBg' + i).style.fontWeight='normal';

		} else {
			
			if (document.getElementById('Tab' + i)!=null) document.getElementById('Tab' + me).style.visibility='visible';
			if (document.getElementById('Tab' + i)!=null) document.getElementById('Tab' + me).style.display='';
			if (document.getElementById('Tab' + i)!=null) document.getElementById('Tab' + me).style.height='auto';
			if (document.getElementById('TabCapBg' + i)!=null) document.getElementById('TabCapBg' + i).style.fontWeight='bold';
			if (document.getElementById('TabCapSX' + i)!=null) document.getElementById('TabCapSX' + i).src='img_struct/tabPartSXOver.gif';
			if (document.getElementById('TabCapDX' + i)!=null) document.getElementById('TabCapDX' + i).src='img_struct/tabPartDXOver.gif';
			if (document.getElementById('TabCapBg' + i)!=null) document.getElementById('TabCapBg' + i).style.backgroundImage='url(img_struct/tabBgrOver.gif)';
			if (document.getElementById('TabCapBg' + i)!=null) document.getElementById('TabCapBg' + i).style.fontColor='#000000';

		}
	}
}
	
function OnTab(i) {
	if (i!=TabSelected) {
		if (document.getElementById('TabCapBg' + i)!=null) document.getElementById('TabCapBg' + i).style.backgroundImage='url(img_struct/tabBgrOn.gif)';		
		if (document.getElementById('TabCapSX' + i)!=null) document.getElementById('TabCapSX' + i).src='img_struct/tabPartSXOn.gif';
		if (document.getElementById('TabCapDX' + i)!=null) document.getElementById('TabCapDX' + i).src='img_struct/tabPartDXOn.gif';
	}
}
	
function OffTab(i) {
	if (i!=TabSelected) {
		if (document.getElementById('TabCapSX' + i)!=null) document.getElementById('TabCapSX' + i).src='img_struct/tabPartSX.gif';
		if (document.getElementById('TabCapDX' + i)!=null) document.getElementById('TabCapDX' + i).src='img_struct/tabPartDX.gif';
		if (document.getElementById('TabCapBg' + i)!=null) document.getElementById('TabCapBg' + i).style.backgroundImage='url(img_struct/tabBgr.gif)';		
	}
}
