/*
<table border="0" cellpadding="0" cellspacing="0" class="ESMenuTable">
  <tr>
    <td>
	<div id="MYID">
        <table border="0" cellspacing="0" cellpadding="0" width="100%">
          <tr>
			<td><img src="images/spacer.gif" alt="" width="8" height="8" border="0"></td>
            <td><a href="something.html" class="MenuLevel1">fsfsdfsg webvwe gg weg weg</a></td>
            <td><img src="images/spacer.gif" alt="" width="12" height="8" border="0"></td>
          </tr>
        </table>
	</div>
	</td>
  </tr>
</table>
*/


function ESHorizontalMenu (Label, Position)
{
	var SBM = new StandardBlockMenu ("", "", Position, Label);

	SBM.Make = function ()
	{
		var S = "", ItemLink, SM, ItemID;
		var ID = this.Data.ID + Math.round(10000000000 * Math.random ());
		this.Data.SubMenuID = ID;
		S += "<div id='" + ID + "' style='visibility: hidden; position: absolute;  z-index: " + this.Data.Level + ";'>";
		S += "<table border='0' cellspacing='0' cellpadding='0'>";
		S += "<tr>";
		for (var L = this.Data.SubMenu.length, i = 0; i < L; i++)
		{
			SM = this.Data.SubMenu[i];

			ItemID = (ID + "_" + i);
			SM.ItemID = ItemID;
			SM.ClassName = "HorizontalMenu";

			ItemLink = (SM.MM.ItemLink == null) ? "#" : SM.MM.ItemLink;
			S += "<td><div id='" + ItemID + "' class='" + SM.ClassName + "'>";

			S += "<table border='0' cellspacing='0' cellpadding='0'>";
			S +=
				"<tr>" +
					"<td width='8'><img src='images/spacer.gif' alt='' width='8' height='8' border='0'></td>" +
					"<td nowrap>" +
						"<a href='" + ItemLink + "'>" +
						SM.MM.Title +
						"</a>" +
					"</td>" +
					"<td width='15'><img src='images/spacer.gif' alt='' width='15' height='8' border='0'></td>" +
				"</tr>";
			S += "</table></div></td>";
			//S += "<td width='20'><img src='images/spacer.gif' alt='' width='20' height='8' border='0'></td>";

		}

		S += "</tr>";
		S += "</table></div>";
		document.write (S);
	}

	SBM.Highlight = function ()
	{

		for (var i = 0, SM; i < this.Data.SubMenu.length; i++)
		{
			SM = this.Data.SubMenu[i];
			if (SM.IsOpen)
			{
				SM.ItemCBE.ele.className = SM.ClassName + "Highlighted";
			}
		}


		//this.Data.ItemCBE.ele.className = this.Data.ClassName + "Highlighted";
		//if (this.Data.Preselected && this.Preselect)
		//{
		//	this.Preselect ();
		//}

	}


	return SBM;


}


function ESMenuL1 (Title, ItemLink, Position, Label)
{
	var SBM = new StandardBlockMenu (Title, ItemLink, Position, Label);

	SBM.Make = function ()
	{
		var S = "", ItemLink, SM, ItemID;
		var ID = this.Data.ID + Math.round(10000000000 * Math.random ());
		this.Data.SubMenuID = ID;
		S += "<div id='" + ID + "' style='visibility: hidden; position: absolute;  z-index: " + this.Data.Level + ";'>";
		S += "<table border='0' cellspacing='0' cellpadding='0'  class='ESMenuTable'>";
		S += "<tr><td width='8'><img src='images/spacer.gif' alt='' width='8' height='8' border='0'></td></tr>";

		S += "<tr><td>";
		for (var L = this.Data.SubMenu.length, i = 0; i < L; i++)
		{
			SM = this.Data.SubMenu[i];

			ItemID = (ID + "_" + i);
			SM.ItemID = ItemID;
			SM.ClassName = "MenuLevel1";

			ItemLink = (SM.MM.ItemLink == null) ? "#" : SM.MM.ItemLink;
			S += "<div id='" + ItemID + "' class='" + SM.ClassName + "'>";
			S += "<table border='0' cellspacing='0' cellpadding='0' width='100%'>";
			S +=
				"<tr>" +
					"<td width='8'><img src='images/spacer.gif' alt='' width='8' height='8' border='0'></td>" +
					"<td nowrap>" +
						"<a href='" + ItemLink + "'>" + SM.MM.Title +
						"</a>" +
					"</td>" +
					"<td width='12'><img src='images/spacer.gif' alt='' width='12' height='8' border='0'></td>" +
				"</tr>";
			S += "</table></div>";

		}

		S += "</td></tr>";
		S += "</table></div>";
		document.write (S);
	}

	SBM.Render = function ()
	{
		var MomSubMenu = this.Data.ItemCBE;
		switch (this.Position)
		{
			case G6_RIGHT:
				this.Data.SubMenuCBE.moveTo
				(
					this.Data.ItemCBE.pageX () + this.Data.ItemCBE.width (),
					MomSubMenu.pageY ()
				);
			break;
			case G6_LEFT:
				this.Data.SubMenuCBE.moveTo
				(
					this.Data.ItemCBE.pageX () - this.Data.SubMenuCBE.width (),
					MomSubMenu.pageY ()
				);
			break;
			case G6_TOP:
				this.Data.SubMenuCBE.moveTo
				(
					MomSubMenu.pageX (),
					this.Data.ItemCBE.pageY () - this.Data.SubMenuCBE.height ()
				);
			break;
			case G6_BOTTOM:
				this.Data.SubMenuCBE.moveTo
				(
					MomSubMenu.pageX (),
					this.Data.ItemCBE.pageY () + this.Data.ItemCBE.height ()
				);
			break;
		}

		this.Highlight ();

	}


	return SBM;
}

function ESMenuL2 (Title, ItemLink, Position)
{
	var SBM = new StandardBlockMenu (Title, ItemLink, Position);

	SBM.Make = function ()
	{
		var S = "", ItemLink, SM, ItemID;
		var ID = this.Data.ID + Math.round(10000000000 * Math.random ());
		this.Data.SubMenuID = ID;
		S += "<div id='" + ID + "' style='visibility: hidden; position: absolute;  z-index: " + this.Data.Level + ";'>";
		S += "<table border='0' cellspacing='0' cellpadding='0'>";
		S += "<tr><td width='8'><img src='images/spacer.gif' alt='' width='8' height='8' border='0'></td></tr>";
		S += "<tr><td>";

		S += "<table border='0' cellspacing='0' cellpadding='0'  class='ESMenuTable'>";
		S += "<tr><td>";
		for (var L = this.Data.SubMenu.length, i = 0; i < L; i++)
		{
			SM = this.Data.SubMenu[i];

			ItemID = (ID + "_" + i);
			SM.ItemID = ItemID;
			SM.ClassName = "MenuLevel2";

			ItemLink = (SM.MM.ItemLink == null) ? "#" : SM.MM.ItemLink;
			S += "<div id='" + ItemID + "' class='" + SM.ClassName + "'>";
			S += "<table border='0' cellspacing='0' cellpadding='0' width='100%'>";
			S +=
				"<tr>" +
					"<td width='8'><img src='images/spacer.gif' alt='' width='8' height='8' border='0'></td>" +
					"<td nowrap>" +
						"<a href='" + ItemLink + "'>" + SM.MM.Title +
						"</a>" +
					"</td>" +
					"<td width='12'><img src='images/spacer.gif' alt='' width='12' height='8' border='0'></td>" +
				"</tr>";
			S += "</table></div>";

		}
		S += "</td></tr></table>";

		S += "</td></tr>";
		S += "</table></div>";
		document.write (S);
	}



	return SBM;
}



var G6 = new G6Menu
(
   "TOP", null,
   new G6Menu
   (
       "Top", new ESHorizontalMenu ("MenuLabel", G6_RIGHT),
       new G6Menu
       (
           "aboutus", new ESMenuL1 ("About Us", "aboutus.php", G6_BOTTOM),
           new G6Menu
           (
			   "aboutuspeopleandbios", new ESMenuL2 ("People & Bios", "aboutus-peopleandbios.php", G6_RIGHT)
//               new G6Menu ("aboutuspeopleandbiosstaff", new NullLink ("Links to Staff Bios", "aboutus-peopleandbios-staff.php"))
		   ),
           new G6Menu
           (
			   "aboutusnewsandevents", new ESMenuL2 ("News & Events", "aboutus-newsandevents.php", G6_RIGHT)
//               new G6Menu ("aboutusnewsandeventscurrent", new NullLink ("Current News and Events", "aboutus-newsandevents-current.php"))
		   )
       ),
       new G6Menu
       (
           "citizenship", new ESMenuL1 ("Corporate Citizenship", "citizenship.php", G6_BOTTOM)
       ),
       new G6Menu
       (
           "services", new ESMenuL1 ("Services", "services.php", G6_BOTTOM),
           new G6Menu
           (
               "serviceses", new ESMenuL2 ("Energy Supply & Markets", "services-es.php", G6_RIGHT),
               new G6Menu ("servicesesenergysupplystrategy", new NullLink ("Energy Supply Strategy", "services-es-energysupplystrategy.php")),
               new G6Menu ("servicesesmarketanalysis", new NullLink ("Integrated Market Analysis", "services-es-marketanalysis.php")),
               new G6Menu ("servicesessupplyacquisition", new NullLink ("Supply Acquisition", "services-es-supplyacquisition.php")),
               new G6Menu ("servicesessupplymanagement", new NullLink ("Supply Management", "services-es-supplymanagement.php")),
               new G6Menu ("servicesesriskmanagement", new NullLink ("Risk Management", "services-es-riskmanagement.php")),
               new G6Menu ("servicesespowersales", new NullLink ("Power Sales", "services-es-powersales.php")),
               new G6Menu ("servicesesedrs", new NullLink ("EDRS", "services-es-edrs.php")),
               new G6Menu ("servicesesautohedge", new NullLink ("autoHedge", "services-es-autohedge.php"))
           ),
           new G6Menu
           (
               "servicespd", new ESMenuL2 ("Project Development & Investment", "services-pd.php", G6_RIGHT),
               new G6Menu ("servicespdanalysis", new NullLink ("Opportunity Assessment", "services-pd-analysis.php")),
               new G6Menu ("servicespddecision", new NullLink ("Options Analysis", "services-pd-decision.php")),
               new G6Menu ("servicespdfinancing", new NullLink ("Project Financing", "services-pd-financing.php")),
               new G6Menu ("servicespdimplementation", new NullLink ("Implementation Support", "services-pd-implementation.php")),
               new G6Menu ("servicespdemerging", new NullLink ("Decision & Risk Analysis", "services-pd-emerging.php")),
               new G6Menu ("servicespddevelopment", new NullLink ("Development Support", "services-pd-development.php"))
           ),
/*
           new G6Menu
           (
               "servicesef", new ESMenuL2 ("Energy Facilities", "services-ef.php", G6_RIGHT),
               new G6Menu ("servicesefopportunityassessment", new NullLink ("Opportunity Assessment", "services-ef-opportunityassessment.php")),
               new G6Menu ("servicesefoptionsanalysis", new NullLink ("Options Analysis", "services-ef-optionsanalysis.php")),
               new G6Menu ("servicesefdecisionandriskanalysis", new NullLink ("Decision & Risk Analys", "services-ef-decisionandriskanalysis.php")),
               new G6Menu ("servicesefprojectfinancing", new NullLink ("Project Financing", "services-ef-projectfinancing.php")),
               new G6Menu ("servicesefdevelopmentsupport", new NullLink ("Development Support", "services-ef-developmentsupport.php")),
               new G6Menu ("servicesefimplementationsupport", new NullLink ("Implementation Support", "services-ef-implementationsupport.php"))
           ),
*/
           new G6Menu
           (
               "servicesrs", new ESMenuL2 ("Regulatory Support", "services-rs.php", G6_RIGHT),
               new G6Menu ("servicesrsutilityratecases", new NullLink ("Utility Rate Cases", "services-rs-utilityratecases.php")),
               new G6Menu ("servicesrsdirectaccess", new NullLink ("Direct Access", "services-rs-directaccess.php")),
               new G6Menu ("servicesrstransmissionreconstruction", new NullLink ("Transmission Restructuring", "services-rs-transmissionreconstruction.php")),
               new G6Menu ("servicesrsqfpowersales", new NullLink ("QF Power Sales", "services-rs-qfpowersales.php"))
           ),
           new G6Menu
           (
               "servicessc", new ESMenuL2 ("Sustainability<br>&nbsp;& Climate Strategy", "services-sc.php", G6_RIGHT),
               new G6Menu ("servicesscdevelopment", new NullLink ("Strategy Development", "services-sc-development.php")),
               new G6Menu ("servicesscimplementation", new NullLink ("Strategy Implementation", "services-sc-implementation.php")),
               new G6Menu ("servicesscrenewable", new NullLink ("Renewable Energy", "services-sc-renewable.php"))
//               new G6Menu ("servicesscdecision", new NullLink ("Decision Support", "services-sc-decision.php")),
//               new G6Menu ("servicesscpolicy", new NullLink ("Public Policy Support", "services-sc-policy.php"))
           ),
//           new G6Menu
//           (
//               "servicesmi", new ESMenuL2 ("Market Intelligence", "services-mi.php", G6_RIGHT),
//               new G6Menu ("servicesmimarketresearchandanalysis", new NullLink ("Market Research & Analysis", "services-mi-marketresearchandanalysis.php")),
//               new G6Menu ("servicesmistrategicanalysis", new NullLink ("Strategic Analysis", "services-mi-strategicanalysis.php")),
//               new G6Menu ("servicesmimarkettrends", new NullLink ("Market Trends", "services-mi-markettrends.php")),
//               new G6Menu ("servicesmiforecastanalysis", new NullLink ("Forecast Analysis", "services-mi-forecastanalysis.php")),
//               new G6Menu ("servicesmibenchmarking", new NullLink ("Benchmarking", "services-mi-benchmarking.php"))
//           ),
           new G6Menu
           (
               "servicespp", new ESMenuL2 ("Public Policy", "services-pp.php", G6_RIGHT),
               new G6Menu ("servicespppublicpolicydevelopment", new NullLink ("Public Policy Development", "services-pp-publicpolicydevelopment.php")),
               new G6Menu ("servicesppgovernmentaffairs", new NullLink ("Government Affairs", "services-pp-governmentaffairs.php")),
               new G6Menu ("servicespplobbying", new NullLink ("Lobbying", "services-pp-lobbying.php")),
               new G6Menu ("servicesppregulatorymonitoring", new NullLink ("Regulatory Monitoring", "services-pp-regulatorymonitoring.php")),
               new G6Menu ("servicespppermittingsupport", new NullLink ("Permitting Support", "services-pp-permittingsupport.php")),
               new G6Menu ("servicesppregulatorypolicy", new NullLink ("Regulatory Policy", "services-pp-regulatorypolicy.php"))
//           ),
//           new G6Menu
//           (
//               "servicesah", new ESMenuL2 ("AutoHedge", "services-ah.php", G6_RIGHT),
//               new G6Menu ("servicesahautohedgeoverview", new NullLink ("Overview", "services-ah-autohedgeoverview.php"))
           )
       ),
       new G6Menu
       (
           "library", new ESMenuL1 ("Library", "library.php", G6_BOTTOM),
           new G6Menu ("librarypresentations", new NullLink ("Presentations", "library-presentations.php")),
           new G6Menu ("librarylinks", new NullLink ("Links", "library-links.php"))
//           new G6Menu ("libraryarchives", new NullLink ("Archives", "library-archives.php"))
       ),
       new G6Menu
       (
           "clientlist", new ESMenuL1 ("Client List", "clientlist.php", G6_BOTTOM),
           new G6Menu ("clientlistcasestudies", new NullLink ("Case Studies", "clientlist-casestudies.php")),
           new G6Menu ("clientlistassociations", new NullLink ("Associations", "clientlist-associations.php"))
       ),
       new G6Menu
       (
           "contactus", new ESMenuL1 ("Contact Us", "contactus.php", G6_BOTTOM),
           new G6Menu ("contactuscareerinformation", new NullLink ("Career Information", "contactus-careerinformation.php"))
       )
   )
);