clickColor = 'gray'
mOverColor = '#cccccc'
outColor = 'white'

function doSwap(currentTab)
{
	saveColor = currentTab.style.backgroundColor
	currentTab.style.cursor = "hand"
	currentTab.style.backgroundColor = mOverColor
	currentTab.isSelected = true 
}

function createTab(tabId,xPos,yPos,tabText,tabAction) {
	document.write('<span id="tab_' + tabId + '" style="position:absolute top:' + yPos +' left:' + xPos +' background-color:' + outColor + '">')
	document.write('<table cellspacing="0" cellpadding="0">')
	document.write('<tr valign="bottom" ')
	if (tabAction)  { document.write('onClick="this.style.backgroundColor=clickColor;  ' + tabAction + '" onMouseOver="doSwap(this)" onMouseOut="this.style.backgroundColor=saveColor"') } else { /* document.write('onMouseOver="this.style.cursor=\'arrow\'"')  */ }
	document.write('>')
	document.write('<td><img src="images/leftCornerTransparent.gif" alt="" border="0"></td>')
	document.write('<td style="border-top:1px solid black">')
	document.write('<span id="tab' + tabId + '" class="tabDisplayText">')
	document.write(tabText.toUpperCase())
	document.write('</span>')
	document.write('</td>')
	document.write('<td><img src="images/rightCornerTransparent.gif" alt="" border="0"></td>')
	document.write('</tr>')
	document.write('</table>')
	document.write('</span>') }
		
function redirectTo(targetURL) { document.location.href = targetURL; }

idHelper = 0

function idTables(which) {
	firstTable = which.firstChild.firstChild.firstChild
	midTable = firstTable.nextSibling
	lastTable = midTable.nextSibling }

function highlightButton(which) {
	idTables(which)	
	firstTable.style.backgroundImage = 'url(images/buttonLeftHighlight.gif)'
	midTable.style.backgroundImage = 'url(images/buttonMiddleHighlight.gif)'
	lastTable.style.backgroundImage = 'url(images/buttonRightHighlight.gif)' }

function restoreButton(which) {
	idTables(which)	
	firstTable.style.backgroundImage = 'url(images/buttonLeft.gif)'
	midTable.style.backgroundImage = 'url(images/buttonMiddle.gif)'
	lastTable.style.backgroundImage = 'url(images/buttonRight.gif)' }

function createButton(buttonText,hRef,xPos,yPos,buttonId) {
	hRef = (!hRef) ?  '#' : hRef
	buttonId = (!buttonId) ? 'button' + ( idHelper++) : buttonId
	buttonText = (!buttonText) ? buttonId : buttonText
	with (document) {
		write('<table id="' + buttonId + '"  class="buttonContainer" width="1" cellpadding="0" cellspacing="0" border="0" onMouseOver="highlightButton(this)" onMouseOut="restoreButton(this)"><tr>')
		write('<td id="buttonLeft" style="background-image:url(images/buttonLeft.gif); background-repeat:no-repeat; width:4px; height:18px; " nowrap>&nbsp;</td>')
		write('<td id="buttonMiddle" style="background-image:url(images/buttonMiddle.gif); background-repeat:repeat-x; font:normal 9px Verdana; padding-left:3px; padding-right:2px;" nowrap><a href="' + hRef +'">' + buttonText + '</a></td>')
		write('<td id="buttonRight" style="background-image:url(images/buttonRight.gif); background-repeat:no-repeat; width:6px;" nowrap>&nbsp;&nbsp;</td></tr></table>') } }
		
with (document) {
write('<style>')
write('	.buttonContainer { margin-top:4px; cursor:expression(ie ? "hand" : "pointer"); }')
write(' .buttonContainer td { padding:0px; }')
write('	.buttonContainer a { text-decoration:none; color:black; }')
write('</style>') }