function toggleTab(which,tabs){
	// define constants
	var imgBase = '/web/ShowBinary/SCSRepository/assets/images/personal/sharedImages/';
	var bImg1 = imgBase + 'tab_LAC.gif';
	var bImg2 = imgBase + 'tab_LIN.gif';
	var bImg3 = imgBase + 'tab_LAC_RIN.gif';
	var bImg4 = imgBase + 'tab_LIN_RIN.gif';
	var bImg5 = imgBase + 'tab_LIN_RAC.gif';
	var bImg6 = imgBase + 'tab_RAC.gif';
	var bImg7 = imgBase + 'tab_RIN.gif';
	// declare variables
	var tabCur,tabCurNo,B1Src,B2Src;
	// establish object ref
	var tab = document.getElementById('tab' + which);
	// check that tab is currently inactive
	if(tab.className=='tab-inactive')
	{
		for(i=1; i<=tabs; i++)
		{
			tabCur = document.getElementById('tab' + i);
			// find the currently active tab
			if(tabCur.className=='tab-active')
			{
				tabCurNo = i;
				// select deactivared border images
	        	switch(i)
	        	{
	        		case 1: b1Src = bImg2; b2Src = bImg4; break;
	        		case tabs: b1Src = bImg4; b2Src = bImg7; break;
	        		default: b1Src = bImg4; b2Src = bImg4;
	        	}
			}
		}
     	// select activated border images
     	switch(which)
     	{
     		case 1: b3Src = bImg1; b4Src = bImg3; break;
     		case tabs: b3Src = bImg5; b4Src = bImg6; break;
     		default: b3Src = bImg5; b4Src = bImg3;
     	}
		// deactivate the currently active tab
		tabCur = document.getElementById('tab' + tabCurNo)
		tabCur.className='tab-inactive';
		tabCur.firstChild.style.textDecoration='underline';
		document.getElementById('tab' + tabCurNo + '-C').className = 'tab-content-inactive';
		document.getElementById('tab-border-' + tabCurNo).src = b1Src;
		document.getElementById('tab-border-' + (tabCurNo+1)).src = b2Src;
		// activate the selected tab
		tab.className='tab-active';
		tab.firstChild.style.textDecoration='none';
		document.getElementById('tab' + which + '-C').className='tab-content-active';
		document.getElementById('tab-border-' + which).src = b3Src;
		document.getElementById('tab-border-' + (which+1)).src = b4Src;
	}
}
// Preload tab border images
var imageObj = new Image();
var imgBase = '/web/ShowBinary/SCSRepository/assets/images/personal/sharedImages/';
images = new Array();
images[1]=imgBase + 'tab_LAC.gif';
images[2]=imgBase + 'tab_LIN.gif';
images[3]=imgBase + 'tab_LAC_RIN.gif';
images[4]=imgBase + 'tab_LIN_RIN.gif';
images[5]=imgBase + 'tab_LIN_RAC.gif';
images[6]=imgBase + 'tab_RAC.gif';
images[7]=imgBase + 'tab_RIN.gif';
for(i=0; i< images.length ; i++){
   imageObj.src=images[i];
}