
var TopMenuButtonActive = "";
var ButtonActive = "";
var BackgroundActive = "";

function TopMenuMoveIn(Id)
{
	if (TopMenuButtonActive == Id)
	  return;
		
  var Obj = document.getElementById(Id);
	//Obj.style.background = "#C0C0C0";
  //Obj.style.background = "#006699";
	Obj.style.background = "#BBDDDD";
	Obj.style.color = "#FFFFFF";
	//Obj.style.cursor = "hand";
/*	
  Id.style.background="#006699";
	Id.style.color = "#FFFFFF";
  description.innerHTML=html;
*/
}

function TopMenuMoveOut(Id)
{	
	if (TopMenuButtonActive == Id)
	  return;

  var Obj = document.getElementById(Id);
  //Obj.style.background = "#4578A3";
	//Obj.style.background = "#F5F5E5";
	//Obj.style.background = "#778899";
	//Obj.style.background = "#95A7BC";
	//Obj.style.background = "#003366";
	Obj.style.color = "#FFFF80";
	Obj.style.color = "#000000";
/*
  which.style.background="#BBDDDD";
	which.style.color = "#0000CC";
*/
}

function TopMenuTextMoveIn(Id)
{
	if (TopMenuButtonActive == Id)
	  return;
		
  var Obj = document.getElementById(Id);
	Obj.style.color = "#990033";
	Obj.style.background = "#999999";
/*	
  Id.style.background="#006699";
	Id.style.color = "#FFFFFF";
*/
}

function TopMenuTextMoveOut(Id)
{	
	if (TopMenuButtonActive == Id)
	  return;

  var Obj = document.getElementById(Id);
	//Obj.style.color = "#FFFF80";
	Obj.style.color = "#000000";
	Obj.style.background = "#EFEFEF";
/*
  which.style.background="#BBDDDD";
	which.style.color = "#0000CC";
*/
}

function MoveIn(Id,html)
{
	if (ButtonActive == Id)
	  return;
		
  var Obj = document.getElementById(Id);
	//Obj.style.background = "#C0C0C0";
  //Obj.style.background = "#006699";
	//Obj.style.background = "#BBDDDD";
	Obj.style.backgroundImage = "url(http://www.publicmemo.com/Images/Background/BlueBar.jpg)";
	Obj.style.color = "#FFFFFF";
	//Obj.style.cursor = "hand";
/*	
  Id.style.background="#006699";
	Id.style.color = "#FFFFFF";
  description.innerHTML=html;
*/
}

function MoveOut(Id)
{	
	if (ButtonActive == Id)
	  return;

  var Obj = document.getElementById(Id);
  //Obj.style.background = "#4578A3";
	//Obj.style.background = "#F5F5E5";
	//Obj.style.background = "#778899";
	//Obj.style.color = "#FFFF80";
	//Obj.style.background = "#E6ECEE";
	//Obj.style.background = "#003366";
	Obj.style.color = "#000000";
	//bckground image setting didn't work
	Obj.style.backgroundImage = "url(http://www.publicmemo.com/Images/Background/LeftBlueFade2.jpg)";
/*
  which.style.background="#BBDDDD";
	which.style.color = "#0000CC";
  description.innerHTML='&nbsp;';
*/
}

function ClickIt(Id)
{
  if ((ButtonActive != Id) && (ButtonActive != ""))
	{
	  var Obj = document.getElementById(ButtonActive);
    //Obj.style.background = "#4578A3";
	  //Obj.style.color = "#FFFF80";
    //Obj.style.background = "#778899";
  	//Obj.style.background = "#E6ECEE";
		//Obj.style.background = "#003366";
	  Obj.style.backgroundImage = "url(http://www.publicmemo.com/Images/Background/LeftBlueFade2.jpg)";
	  Obj.style.color = "#FFFFFF";
	}
  ButtonActive = Id;
	
  var Obj = document.getElementById(Id);
  //Obj.style.background = "#663366";
	Obj.style.backgroundImage = "url(http://www.publicmemo.com/Images/Background/RedBar.jpg)";
	Obj.style.color = "#FFFFFF";
	
}

function ClickIt1(Id)
{
  if ((ButtonActive != Id) && (ButtonActive != ""))
	{
	  var Obj = document.getElementById(ButtonActive);
    Obj.style.background = BackgroundActive;
	  Obj.style.color = "#000000";
	}
	
  ButtonActive = Id;
	BackgroundActive = Obj.style.background;

  var Obj = document.getElementById(Id);
  Obj.style.background = "#663366";
	Obj.style.color = "#FFFFFF";
	
}

function MaxBusinessGoal(event, Id1, Id2)
{
  //document.getElementById(DivBusinessGoal).style.JS_property_reference = "new_CSS_property_value";
  
	var Obj1 = document.getElementById(Id1);
  var Obj2 = document.getElementById(Id2);
  
  //alert("X=" + event.screenX + " Y=" + event.screenY + " width=" + Obj.style.width)
  
  //var ObjectWidth = Obj1.style.width + 10;
  var ObjectWidth = 280;
  //var ObjectHeight = Obj1.style.height + 10;
  var ObjectHeight = 100;
  
	//This will get the coordinates of based on the screen resolution
  //ScreenWidth = screen.width;	
	//This will get the coordinates of based on the browser size
  ScreenWidth = window.document.body.clientWidth;
  //ScreenWidth = document.documentElement.clientWidth;
  //ScreenWidth = window.innerWidth;
  //ScreenWidth = document.body.offsetWidth;
    
  //ScreenHeight = screen.height;
  ScreenHeight = window.document.body.clientHeight;
  //ScreenHeight = document.documentElement.clientHeight;
  //ScreenHeight = window.innerHeight;
  //ScreenHeight = document.body.offsetHeight;
  
	//This will get the coordinates of the mouse click
  //var ThisX = event.clientX;
  //var ThisY = event.clientY;

	//This will get the coordinates of the given element
  //var ThisX = Obj2.offsetWidth;
  //var ThisY = Obj2.offsetHeight;
	var Obj = Obj2;
	var ThisX = ThisY = 0;
	if (Obj.offsetParent) {
		ThisX = Obj.offsetLeft
		ThisY = Obj.offsetTop
		while (Obj = Obj.offsetParent) {
			ThisX += Obj.offsetLeft
			ThisY += Obj.offsetTop
		}
	}
	//To force the box appear just below the text
  ThisY += 15;
	
  if(ThisX + ObjectWidth > ScreenWidth)
    ThisX = ThisX - ObjectWidth;
  	
  if(ThisY + ObjectHeight > ScreenHeight)
    ThisY = ThisY - ObjectHeight;
  	
  Obj1.style.left = ThisX;
  Obj1.style.top = ThisY;
  
  //Obj1.style.left = event.screenX;
  //Obj1.style.top = event.screenY;
  
  Obj1.style.visibility = "visible";

}

function MinBusinessGoal(Id)
{
  var Obj = document.getElementById(Id);
	Obj.style.visibility = "hidden";
	
	//if((Obj.style.visibility == "") || (Obj.style.visibility == "hidden")) 
	//  Obj.style.visibility = "visible";
	//if(Obj.style.visibility == "visible")
  //  Obj.style.visibility = "hidden";
}


function DoClick(Id)
{
  if ((ButtonActive != Id) && (ButtonActive != ""))
	{
	  var Obj = document.getElementById(ButtonActive);
    Obj.style.background = "#4578A3";
	  Obj.style.color = "#FFFF80";
	}
  ButtonActive = Id;
	
  var Obj = document.getElementById(Id);
  Obj.style.background = "#663366";
	Obj.style.color = "#FFFFFF";
	
}

function MaxBox(Id)
{
  var Obj = document.getElementById(Id);
	Obj.style.visibility = "visible";
	
	//if((Obj.style.visibility == "") || (Obj.style.visibility == "hidden")) 
	//  Obj.style.visibility = "visible";
	//if(Obj.style.visibility == "visible")
  //  Obj.style.visibility = "hidden";
}

function MinBox(Id)
{
  var Obj = document.getElementById(Id);
	Obj.style.visibility = "hidden";
	
	//if((Obj.style.visibility == "") || (Obj.style.visibility == "hidden")) 
	//  Obj.style.visibility = "visible";
	//if(Obj.style.visibility == "visible")
  //  Obj.style.visibility = "hidden";
}


