function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}

function showShadow(segment) {  
  shadowdiv = document.getElementById(segment)
  
  if (shadowdiv == null)
  {
	throw new Error("showShadow failed, could not find div with name: " + segment);
  }
  
  position = findPos(shadowdiv)
  
  shadow = 4
  for (counter = 0; counter < 4; counter++)
  {    
    newdiv = document.createElement('div');
    newdiv.setAttribute('id', segment+"_shadow_"+counter)
    newdiv.style.position = 'absolute'
    newdiv.style.zIndex = 0
    newdiv.style.left = position[0] + 4  + counter
    newdiv.style.top = position[1] + 4  + counter
    newdiv.style.width = shadowdiv.offsetWidth
    newdiv.style.height = shadowdiv.offsetHeight
    newdiv.style.background = '#000'
    newdiv.style.opacity = '0.0'+shadow
    newdiv.style.filter = 'alpha(opacity='+shadow+')'
    newdiv.id = segment+"_shadow_"+counter
    shadow = shadow -1
    document.getElementsByTagName('body')[0].appendChild(newdiv)
  }
}
function showTab(tab) {
/*
 * Check for each tab
 */
  for (counter = 1; counter < 4; counter++)
  {
    tab_element = document.getElementById('tab'+counter)
    if (tab_element)
    {
      tab_element.style.display = 'none'
      tab_image = document.getElementById("tab"+counter+"_image")
      tab_image.src = tab_image.src.replace("on","off")
    }
  }
  tab_active = document.getElementById(tab)
  tab_active.style.display = 'inline'
  tab_active_image =  document.getElementById(tab+"_image")   
  tab_active_image.src = tab_active_image.src.replace("off","on")
/*
 * Adjust Shadows
 */
  column = document.getElementById('column_left')
  for (counter = 0; counter < 4; counter ++)
  {
    shadow = document.getElementById('column_left_shadow_'+counter)
    shadow.style.height = column.offsetHeight
  }
  return false
}