///////
//////
	function StatMsg (msg)
	{
		if (msg != "")
		{
			alert (msg);
			window.close ();
		}
	}

	function EmailPopUp(pgName,pgHeader)
	{	
		var strFeatures="toolbar=no,status=no,menubar=no,location=no"
		strFeatures=strFeatures+",scrollbars=no,resizable=no,height=650,width=550"
		
		newWin = window.open("../CorpGiving/EmailToFriend.aspx?from=" + pgName + "&header=" + pgHeader,"TellObj",strFeatures);
		newWin.opener = top;
	}


	function myBrowser()
	{
	  this.dom = document.getElementById?1:0;
	  this.ie4 = (document.all && !this.dom)?1:0;
	  this.ns4 = (document.layers && !this.dom)?1:0;
	  this.ns6 = (this.dom && !document.all)?1:0;
	  this.ie5 = (this.dom && document.all)?1:0;
	  this.ok = this.dom || this.ie4 || this.ns4;
	  this.platform = navigator.platform;
	}
	
	var mybrowser = new myBrowser();

//initialize the class of the navigation item for the page
function initNav(menuItem,subMenu)
{
	//initialize the expandalbe item to be disabled if ie
	if (!mybrowser.ns6 && !mybrowser.ns4)
	{
		var oItem = document.getElementById("CorpGiving");
		if (oItem != null)
			oItem.style.display = "none";
		var oItem = document.getElementById("Governance");
		if (oItem != null)
			oItem.style.display = "none";
		oItem = document.getElementById("CompanyOverview");
		if (oItem != null)
			oItem.style.display = "none";
		oItem = document.getElementById("FinancialInformationSubMenu");
		if (oItem != null)
			oItem.style.display = "none";
		oItem = document.getElementById("Initiatives");
		if (oItem != null)
			oItem.style.display = "none";
		oItem = document.getElementById("ApplyGrant");
		if (oItem != null)
			oItem.style.display = "none";
	}
	//alert ("initNav");
	//alert ("MenuItem = " + menuItem + " SubMenu = "  + subMenu);
	//set the menu item with the active selected class and
	//expand if necessary the corresponding sub tree
	var oMenuItem = document.getElementById(menuItem);
	var oSubMenu = document.getElementById(subMenu);
		if (oMenuItem != null)
		{
				//alert (oMenuItem.className);
			if (oSubMenu != null)
			{
				if (mybrowser.ns6 || mybrowser.ns4)
				{
					//ns6
					//alert ("ns6");
					//oSubMenu.style.display = "inline";
					oSubMenu.style.visibility = "visible";
					oMenuItem.style.visibility = "visible";
					oMenuItem.className = "toolSubLinkActive";
				}
				else
				{
					//ie5
					//alert ("ie6");
					oSubMenu.style.display = "block";
					//oSubMenu.style.display=(oSubMenu.style.display == "none") ? "block" : "none";
					oMenuItem.className = "toolSubLinkActive";
				}
			}
			else
				oMenuItem.className = "toolLinkActive";
		}
}

//ToggleSubMenu provide the expand/callapse items in the menu.
function ToggleSubMenu(subMenu)
{
	//alert ("ToggleSubMenu");
	if (mybrowser.ns6 || mybrowser.ns4)
	{
		//alert ("ns6");
		return;
	}
	var oSubMenu = document.getElementById(subMenu);
	if (oSubMenu != null)
	{
		if (mybrowser.ns6 || mybrowser.ns4)
		{
			//ns6
			//alert ("ns6");
			oSubMenu.style.display = "inline";
			oSubMenu.style.visibility= "visible";
		}
		else
		{
			//ie5
			oSubMenu.style.display=(oSubMenu.style.display == "none") ? "block" : "none";
		}
	}
}

function ResizeContentOverflow(DivName,heightModifier)
{
	var oContDiv = document.getElementById(DivName);
	if (oContDiv != null)
	{
		if (screen.height <= 600)
		{
			oContDiv.style.height = 280 + heightModifier;				
		}		
		else if (screen.height <= 768)
		{
			oContDiv.style.height = 420 + heightModifier;
		}	
		else if (screen.height <= 864)
		{
			oContDiv.style.height =540 + heightModifier;				
			//oContDiv.style.width = 790;	
		}
		else if (screen.height <= 1024)
		{
			oContDiv.style.height = 600 + heightModifier;				
		}
	}
	//oContDiv.style.height = 400;	
	//alert (screen.height + ": " + oContDiv.style.height);
}

var popup = "";
function winPopup() 
{
	winWidth=271; winHeight=139
	winLeft = (screen.width - winWidth) / 2;
	winTop = (screen.height - winHeight) / 2 - 40;
	winMenu = 0;
	winStatus = 0;

	if (!popup || popup.closed){
		popup = window.open("http://company.feedroom.com/countrywide.html", "countrywide", 'width='+ winWidth + ',height=' + winHeight + ',top='+ winTop +',left='+ winLeft +',menubar=0,toolbar=0,location=0,resizable=0,scrollbars=0,screenX='+ winLeft +',screenY='+ winTop +',status=0');
	}else{
		popup.focus();
	}
}		

function PrintContentWindow()
{
	var strName = window.document.location.href;
	strName = strName.substring(strName.lastIndexOf("/")+1,strName.length);
	if (strName.indexOf("Search.aspx") > -1)
		{
			var qstr;
			if (document.forms[0].hdnFAQ.value == "")
			{
				if (document.forms[0].hdnprnt.value == "")
				{
					window.open(strName + "&isPrintable=Yes");
				}
				else
				{
					qstr = document.forms[0].hdnprnt.value;
					window.open("Search.aspx?" + qstr + "&isPrintable=Yes");				
				}
			}
			else
			{
				qstr = document.forms[0].hdnFAQ.value;
				window.open(qstr);
			}
		}
	else if (strName.indexOf("?") > -1) 
		window.open(strName + "&isPrintable=Yes");	
	else if (strName.indexOf("#") > -1)
		window.open (strName.substring(0,strName.indexOf("#")) + "?isPrintable=Yes");
	else		
		window.open(strName + "?isPrintable=Yes");				
}

function initPage(isPrintable,offset,menu,submenu)
{
	//alert ("initPage");
	if (isPrintable == "Yes")
	{
		//alert("isPrintable = Yes");
		var oContent = document.getElementById("ContTable");
		document.body.innerHTML = oContent.innerHTML;
	}
	else
	{
		//ResizeContentOverflow('ContTable',offset);
		initNav(menu,submenu);
		//Init1();
	}
}			

function initTitle(title)
{
	if (title != "")
	{
		/*
		if (title.indexOf("Andrew") > -1 &&
				title.indexOf("Gissinger") > -1)
		{
			window.navigate("DrewBiography.aspx?CtlID=26");
		}
		*/
		document.title = title;
	}
}

function initMsg(msg)
{
	if (msg != "" )
		alert (msg);
		//alert ("Hello");
}

////////////////////////////////Display Dropdown Menu on the edit component////////////
function imgOver(src)
{
	//alert(src.pretitle);
	//alert (window.event.srcElement.src);
	var t = new String(src.pretitle);
	var re = /,/g;
	var t = t.replace(re,String.fromCharCode(13,10));
	src.title=t;
}

function BlinkItem(name)
{
	alert ("BlinkItem");
}

function init1()
{
		//alert ("hello");
		Go();
}

///////////////////////////////////////////////////////////////////////////////
// change the menuItems array with your options and set the urls to link to
//  use addMenuItem("Text to show", "Url To Link To"); to make an item
//  use addMenuItem("Text", Url", "Img To Show"); to make an item with an image
//  use addMenuItem(); to indicate a separator bar
//  you can use html tags in the text, eg, <i>, <b> or <u>
//
// images used should be 16x16 transparent gifs
///////////////////////////////////////////////////////////////////////////////

 menuItems = new Array();
 menuItemNum = 0;
//var urlBio = "";
	//function addMenuItems(bioUrl,
	
 function addMenuItem(text, url, img){
  if(img) menuItems[menuItemNum] = new Array(text, url, img);
  else if(text) menuItems[menuItemNum] = new Array(text, url);
  else menuItems[menuItemNum] = new Array();
  menuItemNum++;
 }

 menuWidth = 105; //menu width
 menuHeight = 25; //50; //176; //menu height
 menuDelay = 50; //delay before menu appears
 menuSpeed = 5;	//8; //speed which menu appears (lower=faster)
 menuOffset = 2; //offset of menu from mouse pointer
 ///////////////////////////////////////////////////////////////////////////////
 // do not edit the code below, it is required for the menu to work correctly
 ///////////////////////////////////////////////////////////////////////////////


 if(window.navigator.appName == "Microsoft Internet Explorer" && window.navigator.appVersion.substring(window.navigator.appVersion.indexOf("MSIE") + 5, window.navigator.appVersion.indexOf("MSIE") + 8) >= 5.5)
  isIe = 1;
 else
  isIe = 0;

 var delta = 5; 
 var iTimer;
function ViewLocation (Location)
{
		FloorLoc.style.visibility = "hidden";
	FloorPlan.filters(0).opacity = 0;
	menuPopup.hide();
	var arrLoc = new String(Location).split(",")
	if (arrLoc.length== 2)
	{
		FloorLoc.style.left = arrLoc[0];
		FloorLoc.style.top = arrLoc[1];
	}
	FloorPlan.style.visibility = "visible";
	iTimer = setInterval ("PhaseInLocation()",10);
}

function PhaseInLocation()
{
	FloorPlan.filters(0).opacity += delta;
	if (FloorPlan.filters(0).opacity == 85)
	{
		clearInterval(iTimer);
		FloorLoc.style.visibility = "visible";
	}
}

function PopupMenu()
{
 if(isIe){
  menuContent = "<table id='rightMenu' width='0' height='0' cellspacing='0' cellpadding='0' style='font-family:arial;font-size:7;color:menutext;'>";
  menuContent += " <tr height='1'>";
  menuContent += " <td style='background:threedlightshadow' colspan='4'></td>";
  menuContent += " <td style='background:threeddarkshadow'></td></tr>";
  menuContent += " <tr height='1'><td style='background:threedlightshadow'></td>";
  menuContent += " <td style='background:threedhighlight' colspan='2'></td>";
  menuContent += " <td style='background:threedshadow'></td>";
  menuContent += " <td style='background:threeddarkshadow'></td></tr>";
  menuContent += " <tr height='10'><td style='background:threedlightshadow'></td>";
  menuContent += " <td style='background:threedhighlight'></td>";
  menuContent += " <td style='background:threedface'>";
  menuContent += " <table cellspacing='0' cellpadding='0' nowrap style='font-family:arial;font-size:11;cursor:default;'>";
  for(m=0;m<menuItems.length;m++){
   if(menuItems[m][0] && menuItems[m][2])
   {
			menuContent += "<tr height='17' onMouseOver=\"this.style.background='highlight';this.style.color='highlighttext';\"";
			menuContent += " onMouseOut=\"this.style.background='threedface';this.style.color='menutext';\"";
			//menuContent += " onClick=\"window.navigate('" + location.href + menuItems[m][1] + "');\""; 
			//menuContent += " onClick=\"window.navigate('" + GetPageURL() + menuItems[m][1] + "');\""; 
			menuContent += " onClick=\"parent.ActivateEvent('" + menuItems[m][1] + "');\""; 
			menuContent += " <td style='background:threedface' width='1' nowrap></td>";
			menuContent += " <td width='21' nowrap><img src='" + menuItems[m][2] + "'></td>";
			menuContent += " <td nowrap>" + menuItems[m][0] + "</td><td width='21' nowrap></td>";
			menuContent += " <td style='background:threedface' width='1' nowrap></td></tr>";
		}
   else if(menuItems[m][0])
   {
			menuContent += " <tr height='17'";
			menuContent += " onMouseOver=\"this.style.background='highlight';this.style.color='highlighttext';\"" ;
			menuContent += " onMouseOut=\"this.style.background='threedface';this.style.color='menutext';\"" ;
			if (menuItems[m][0] == "help")
			{
				menuContent += " onClick=\"parent.window.open('../help/ACHelp.htm');\""; 
			}
			else if (menuItems[m][0] == "EditPie")
			{
				menuContent += " onClick=\"parent.window.open('../Charts/EditPie.aspx?id=" + menuItems[m][1] + "');\""; 
			}
			else if (menuItems[m][0] == "EditBar")
			{
				menuContent += " onClick=\"parent.window.open('../Charts/EditBar.aspx?id=" + menuItems[m][1] + "');\""; 
			}
			else
			{
				menuContent += " onClick=\"parent.ActivateEvent('" + menuItems[m][1] + "');\""; 
			}
			menuContent += "> <td style='background:threedface' width='1' nowrap></td>";
			menuContent += " <td width='3' nowrap></td>";
			menuContent += " <td width='3' nowrap></td><td nowrap>" + menuItems[m][0] + "</td>";
			menuContent += " <td width='21' nowrap></td>";
			menuContent += " <td style='background:threedface' width='1' nowrap></td></tr>";
		}
		else
		{
			menuContent += " <tr><td colspan=5 height=4></td></tr>";
			menuContent += " <tr><td colspan=5><table cellspacing=0></td></tr>";
			menuContent += " <tr><td width=2 height=1></td>";
			menuContent += " <td width='0' height='1' style='background:threedshadow'></td>";
			menuContent += " <td width='2' height='1'></td></tr>";
			menuContent += " <tr><td width='2' height='1'></td>";
			menuContent += " <td width='100%' height='1' style='background:threedhighlight'></td>";
			menuContent += " <td width='2' height='1'></td></tr>";
			menuContent += " </table></td></tr><tr><td colspan='5' height='3'></td></tr>";
		}
  }
  menuContent += " </table></td>";
  menuContent += " <td style='background:threedshadow'></td>";
  menuContent += " <td style='background:threeddarkshadow'></td></tr>";
  menuContent += " <tr height='1'><td style='background:threedlightshadow'></td>";
  menuContent += " <td style='background:threedhighlight'></td>";
  menuContent += " <td style='background:threedface'></td>";
  menuContent += " <td style='background:threedshadow'></td>";
  menuContent += " <td style='background:threeddarkshadow'></td></tr>";
  menuContent += " <tr height='1'><td style='background:threedlightshadow'></td>";
  menuContent += " <td style='background:threedshadow' colspan='3'></td>";
  menuContent += " <td style='background:threeddarkshadow'></td></tr>";
  menuContent += " <tr height='1'><td style='background:threeddarkshadow' colspan='5'></td></tr></table>";

  menuPopup = window.createPopup();
  menuPopup.document.body.innerHTML = menuContent;
 }
}

 function showMenu(strMenuCont){
 //";" separate the items, ":" separate the text from the URL.
 if (strMenuCont == "")
	return true;
 menuItems = new Array();
 menuItemNum = 0;
  menuXPos = event.clientX + menuOffset;
  menuYPos = event.clientY + menuOffset;

	var arrMenu = new String(strMenuCont).split(";")
	//build the menu from strMenuCont dynamically
	for (var i = 0,j=0; i < arrMenu.length; i++)
	{
		var arrItem = arrMenu[i].split(":");
		addMenuItem(arrItem[0],arrItem[1]);
		if (arrItem[0] != "")
			j++;
	}
	menuHeight = 18 * j
  menuXIncrement = menuWidth / menuSpeed;
  menuYIncrement = menuHeight / menuSpeed;


	PopupMenu();
  menuTimer = setTimeout("openMenu(0,0)", menuDelay);

  return false;
 }


 function openMenu(height, width){
  iHeight = height;
  iWidth = width;

  menuPopup.show(menuXPos, menuYPos, iWidth, iHeight, document.body);

  if(iHeight < menuHeight)
   menuTimer = setTimeout("openMenu(iHeight + menuYIncrement, 120)", 1);		//iWidth + menuXIncrement)", 1);
  else
   clearTimeout(menuTimer);
 }

function ActivateEvent(ObjID)
{
//alert ("ActivateEvent:" + ObjID);
	var obj = document.getElementById(ObjID);
	if (obj != null)
		obj.click();
}

 function GetPageURL()
 {
	var indx = location.href.indexOf("?");
	if (indx > -1)
	{
		return location.href.substr(0,indx);	//return the left of '?'
	}
	else
		return location.href;
 }
///////////////////////////////////////////////////////////////////////////////

