//---------menu—p---------//


function getLayerStyleObj(layerID)
{
	var obj = document;
	
	if(document.getElementById){
		// Netscape6 & Internet Explorer5.x
		obj = obj.getElementById(layerID)
	}else{
		if( document.all ){
			// Internet Explorer4.x
			obj = obj.all(layerID);
		}
	}
	return obj;
}

function setLayerBGColor(layerID, newBGColor)
{
	if(IE5 || IE4)
	{		
		layerStyleObj = getLayerStyleObj(layerID);
		return layerStyleObj.style.backgroundColor = newBGColor;
	}
}
function setLayerColor(layerID, newTextColor)
{
	if(IE5 || IE4)
	{		
		layerStyleObj = getLayerStyleObj(layerID);
		return layerStyleObj.style.color = newTextColor;
	}
}

function onSMenu(srcID, srcTextID)
{
	setLayerBGColor(srcID, "#FFFFFF");
	setLayerColor(srcTextID, "#CC0033");
}

function offSMenu(srcID, srcTextID)
{
	if( ('SM_' + pageOnNow) != srcID ) {
		setLayerBGColor(srcID, "#FFFFFF");
		setLayerColor(srcTextID, "#3333AA");
	}
}



function showSubSideMenu( srcHPID, srcSMID ) {
	var x,y;
	y = getTopLAYER( srcHPID );
	ShowHideLAYER( srcSMID, 'show' );
	//alert(y);
}


function GetAbsolutePosition( srcImg )
{

  var rd = { x:0, y:0 };

	image = document.images[srcImg];

  if( document.layers )
  {
    // Netscape we can just read the attributes directly
    rd.x = image.x;
    rd.y = image.y - 12;  // for some reason we need to subtract 12 from the actual
                          // value to get the text aligned correctly
  }
  else
  {
    // start with the image's coordinates and walk through it's ancestory of
    // elements (tables, div's, spans, etc...) until we're at the top. Along
    // the way we add in each element's coordinates to get the final answer
    do
    {
      rd.x += image.offsetLeft;
      rd.y += image.offsetTop;
      image = image.offsetParent;
    }  while( image );
  }

  return( rd )

}


function getImageWidth(srcImg)
{
	return document.images[srcImg].offsetWidth;
}

function getImageHeight(srcImg)
{
	return document.images[srcImg].offsetHeight;
}


function getBrowserHeight()
{
	return document.body.offsetHeight;
}


function linkTo(srcURL)
{
	/*
	if(srcURL.indexOf("?") < 0)
	{
		srcURL += "?";
		
	}
	else
	{
		srcURL += "&";
	}
	
	srcURL += "RandomNumber=" + Math.random();
	*/

	window.location.href = srcURL;
}

function linkToNewWin(srcURL)
{
	window.open(srcURL);
}


function showSubMenu(srcLayerID, srcImg)
{
	var subMenuHeight;
	var browserHeight;
	
	var subMenuLinkTop;
	
	var subMenuLeft;
	var subMenuTop;
	
	subMenuHeight = getHeightLAYER(srcLayerID);
	browserHeight = getBrowserHeight();

	subMenuLinkTop = GetAbsolutePosition(srcImg).y;

	subMenuLeft = GetAbsolutePosition(srcImg).x + document.images[srcImg].offsetWidth;

	if(subMenuLinkTop + subMenuHeight <= browserHeight + document.body.scrollTop)
	{
		subMenuTop = subMenuLinkTop;
	}
	else
	{
		subMenuTop = subMenuLinkTop - (subMenuLinkTop + subMenuHeight - browserHeight) - 20 + document.body.scrollTop;
	}

	moveToLAYER(srcLayerID, subMenuLeft - 102, subMenuTop + 20);
	ShowHideLAYER(srcLayerID,'show');
}

function hideSubMenu(srcLayerID)
{
	ShowHideLAYER(srcLayerID,'hide');
}





function logOut( ) {
	document.logoutForm.submit();
	//return false;
}




