/*******************
 * Utility funcitons
 *******************/

/* Setup where the images are stored */
if (atEDNA(document.URL.split("?")[0]) == true ) {
	/* If we are on EDNA then we are storing them in the edn/2006 directory */
	var image_location = "edn/2006"
} else {
	/* If we are on Edison.com we store them in the remote directory */
	var image_location = "/remote"
};
 
 /* Sort Functions */
function EIX_Menu_CustomSort_Top(a, b) {
	/* Is A greater than B */
	if (parseInt(EIX_Menu[a][7]) < parseInt(EIX_Menu[b][7])) {
		/* A is less than b */
		return -1;
	}
	if (parseInt(EIX_Menu[a][7]) > parseInt(EIX_Menu[b][7])) {
		/* A is greater than b */
		return 1;
	}
  if (parseInt(EIX_Menu[a][7]) == parseInt(EIX_Menu[b][7])) {
		/* They are equal */
		return 0;
	}
}

/* Swap class c1 with class c2 for Object o */
function EIXMenu_swapclass(o,c1,c2){
	var cn=o.className
	o.className=!EIXMenu_check(o,c1)?cn.replace(c2,c1):cn.replace(c1,c2);
}
/* Add class C to Object O */
function EIXMenu_addclass(o,c){
	if(!EIXMenu_check(o,c)){o.className+=o.className==''?c:' '+c;}
}
/* Remove Class C from Object O */
function EIXMenu_killclass(o,c){ 
	return o.className=o.className.replace(new RegExp("^"+c+"\\b\\s*|\\s*\\b"+c+"\\b",'g'),''); 
}
/* Check to see if Object O has Class C */
function EIXMenu_check(o,c){
 	return new RegExp('\\b'+c+'\\b').test(o.className);
}

/* Standard Left and Right String Functions */
function left(str, n){
	return Left(str, n);
}
function Left(str, n){
	if (n <= 0)
	    return "";
	else if (n > String(str).length)
	    return str;
	else
	    return String(str).substring(0,n);
}
function right(str, n){
	return Right(str, n);
}
function Right(str, n){
    if (n <= 0)
       return "";
    else if (n > String(str).length)
       return str;
    else {
       var iLen = String(str).length;
       return String(str).substring(iLen, iLen - n);
    }
}

function EIXMenuExpandAll(){
	/* Expand all the menu */
	d=getElementsByClassName("Closed")
	for (i=0; i<d.length; i++){
		EIXMenu_swapclass(d[i],"Closed","Opened");
		/* Insert code to do the actual collapse */
		d[i].childNodes[1].style.display="block";
		d[i].childNodes[1].style.visibility="visible";
		img=d[i].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0]
		img.src = baseHref + image_location + "/images/opened-final.gif";
	}
}
function EIXMenuCollapseAll (){
	/* Collapse all the menu */
	d=getElementsByClassName("Opened");
	for (i=0; i<d.length; i++){
		EIXMenu_swapclass(d[i],"Opened","Closed");
		/* Insert code to do the actual collapse */
		d[i].childNodes[1].style.display="none";
		d[i].childNodes[1].style.visibility="hidden";
		img=d[i].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0]
		img.src = baseHref + image_location + "/images/closed-final.gif";
	}
}

/* Guru 12/3/07 */
function EIXMenuExpand(obj){
	/* Expand [obj] menu */
	d=obj.getElementsByTagName("li");
	for (i=0; i<d.length; i++){
	    if ( d[i].className=="Closed" )
	    {
		EIXMenu_swapclass(d[i],"Closed","Opened");
		/* Insert code to do the actual collapse */
		d[i].childNodes[1].style.display="block";
		d[i].childNodes[1].style.visibility="visible";
		img=d[i].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0]
		img.src = baseHref + image_location + "/images/opened-final.gif";
	    }
	}
}


function atEDNA(URLtoCheck) {
	if (left(URLtoCheck, 21) == "http://ednat.sce.com/" || 
		left(URLtoCheck, 20) == "http://edna.sce.com/" ) {
		return true;
	} else {
		return false;
	}
}
function atResumix(URLtoCheck)  {
	if(left(URLtoCheck, 21) == "https://www2.sce.com/" || 
		left(URLtoCheck, 20) == "http://www2.sce.com/" ||
		left(URLtoCheck, 22) == "https://www2t.sce.com/" || 
		left(URLtoCheck, 21) == "http://www2t.sce.com/"){
		return true;
	}else{
		return false;
	}	
}
function atThomsonDotCom(URLtoCheck)  {
	if(URLtoCheck == "http://ir.edisoninvestor.com/staging/phoenix.zhtml" || 
		URLtoCheck == "http://ir.edisoninvestor.com/phoenix.zhtml" ||
		URLtoCheck == "http://phx.edisoninvestor.com/staging/phoenix.zhtml" ||
		URLtoCheck == "http://phx.edisoninvestor.com/phoenix.zhtml"				
		) {
		return true;
	}else{
		return false;
	}	
}
function NotatEdisondotCom(URLtoCheck) {
	if (left(URLtoCheck, 21) == "http://www.edison.com" ||
		left(URLtoCheck, 21) == "http://www.edison.com" ||
//GS: Guru 8/16/2006
		left(URLtoCheck, 21) == "http://dev.edison.com" ||
		left(URLtoCheck, 17) == "http://edison.com"     ||
//End:
		left(URLtoCheck, 22) == "http://wwwt.edison.com" ) {
		return 1==0;
	} else {
		return 1==1;
	}
}		

		function checkPValue(url1, url2){
			urlOne = getPValue(url1);
			urlTwo = getPValue(url2);
			if(urlOne.toUpperCase() == urlTwo.toUpperCase()){
				return true;
			}else{
				return false;
			}
		}

function getPValue(url){
	var initialValue, thirdLevelSelection, p;
	
	//SPLIT ONE
	initialValue = url.split("?")[1];	
	//SPLIT TWO
	initialValue = initialValue.split("#")[0];
	//SPLIT THREE
	if(initialValue.indexOf("&", 8) > 0 ){
		thirdLevelSelection = initialValue.split("&")[2];
	}
	p = initialValue.split("&")[1];
	//SPLIT FOUR
	p = p.split("=")[1];
	//irol-govBio
	if(p == "irol-govCommittee"){
		thirdLevelSelection = thirdLevelSelection.split("=")[1];
		return thirdLevelSelection;
	}
	p = (p.toLowerCase() == 'irol-secedison') 					? 'irol-sec' 	:p;
	p = (p.toLowerCase() == 'irol-secsoutherncaliforniaedison') ? 'irol-sec' 	:p;
	p = (p.toLowerCase() == 'irol-secedisonmissionenergy') 		? 'irol-sec' 	:p;
	p = (p.toLowerCase() == 'irol-secmidwestgeneration') 		? 'irol-sec' 	:p;
	p = (p.toLowerCase() == 'irol-seceme') 						? 'irol-sec' 	:p;
	p = (p.toLowerCase() == 'irol-secmissionenergy') 			? 'irol-sec' 	:p;

	p = (p.toLowerCase() == 'irol-eventdetails')	? 'irol-calendar'		: p; /* Event Details for Conference calls */
	p = (p.toLowerCase() == 'irol-fundtrading')		? 'irol-fundSnapshot'	: p; 		/* Event Details for Fundamentals     */
	p = (p.toLowerCase() == 'irol-fundbalancea')	? 'irol-fundSnapshot'	: p; 
	p = (p.toLowerCase() == 'irol-fundbalanceq')	? 'irol-fundSnapshot'	: p; 
	p = (p.toLowerCase() == 'irol-fundincomea')		? 'irol-fundSnapshot'	: p;
	p = (p.toLowerCase() == 'irol-fundincomeq')		? 'irol-fundSnapshot'	: p;
	p = (p.toLowerCase() == 'irol-fundcashflowa')	? 'irol-fundSnapshot'	: p;
	p = (p.toLowerCase() == 'irol-fundcashflowq')	? 'irol-fundSnapshot'	: p;
	p = (p.toLowerCase() == 'irol-fundratios')		? 'irol-fundSnapshot'	: p;
	p = (p.toLowerCase() == 'irol-definition')		? 'irol-fundSnapshot'	: p;
	p = (p.toLowerCase() == 'irol-irol-alertslong')	? 'irol-alerts'			: p; 		/* Email Alerts */
	p = (p.toLowerCase() == 'irol-govbio')		? 'irol-govBoard'		: p; 	
	
	return p;	
}

function CheckURL(URLtoCheck) {
	/* Purpose		: 	To check to see if the URLtoCheck is equal to the page we are on.
	/* Input Value : URLtoCheck of {String}  equal to the URL we need to check against the Document.URL  */
	/* Return Value: Boolean of {True | False}  */
	var entireDocumentUrl = document.URL;
	var environmentLocation = document.URL.split("?")[0];
	
	var theUrlToCheck = URLtoCheck;
	var theUrlToCheckThomson = URLtoCheck.split("?")[0];
	
	//Check to see what environment the page is getting served from
	if (atThomsonDotCom(environmentLocation) == true) {
		if (atThomsonDotCom(theUrlToCheckThomson) == true) {
			return checkPValue(theUrlToCheck, entireDocumentUrl);
		}
		else {
			return 1==0;	// False
		}
	}
	//Check to see what environment the page is getting served from
	else if (atResumix(environmentLocation) == true) {
		if(atResumix(theUrlToCheck) == true) {
			return 1==1 /* True */
		} else {
			return 1==0 /* False */
		}
	//Check to see what environment the page is getting served from	
	} else if (atEDNA(environmentLocation) == true) {
		if (atEDNA(theUrlToCheck)) {
			if (document.URL.indexOf("/cpi/insidesce2/") > 0 ) {
				if (theUrlToCheck.indexOf("/cpi/insidesce2/") > 0 ) {
					return true;
				}
			}
			return (theUrlToCheck == entireDocumentUrl);
		}
	} else {
	    //Viral Shah-Covansys, 8/14/2006, Planview workid# OS0003592, 3rd level navigation does not remain selected.
		//return (theUrlToCheck == entireDocumentUrl);  //Previous Code
		return (theUrlToCheck == document.URL.split("?")[0]);
	}
}

function BuildCookieTrail(i){
	if ( NotatEdisondotCom(document.URL.split("?")[0]) ) {
		/* Do Nothing! */
	} else {	
		/* Style up top level of Cookie Trail */
		d=getElementsByClassName("EIXBreadCrumbLocal")[0];
		dChild=getElementsByClassName("EIXBreadCrumbLocal")[0].childNodes[0];
	
		if (document.URL.split("?")[0] == EIX_Menu[i][2]) {
			gt=document.createTextNode(" ");
		} else {
			gt=document.createTextNode(" > ");
		}
		a=document.createElement("a");
		text=document.createTextNode(EIX_Menu[i][1]);
		a.setAttribute("href",EIX_Menu[i][2]);
		a.appendChild(text);
		d.insertBefore(a, dChild);
		d.insertBefore(gt, dChild);
	}

}

function openMenuItem (Item) {
	for (j=1;j<EIX_Menu.length;j++){
		/* Are we at the right item in the menu? */
		if (Item == EIX_Menu[j][0]) {
			var i = j;
		}
	}
	/* Are we at root?  If so we are ok to return true */
	if (i == 1) {
		/* We are at the root of the tree */
		/* If we are at EDNA we don't need a cookietrail */
		if(atEDNA(document.URL)) { /* Do nothing */ } else {
			/* We are going to build and style up the Cookie Trail.*/
			BuildCookieTrail(i);
		}
		return true;
	}
	else {
		/* Check to see if we have a leaf or a branch */
		if (EIX_Menu[i][4] == "") {
			/* We don't have a branch, we have a leaf! */
			/* If we are at EDNA we don't need a cookietrail */
			if(atEDNA(document.URL)) { /* Do nothing */ } else {
				/* We are going to build and style up the Cookie Trail.*/
				BuildCookieTrail(i);
			}
			/* Color the Menu as Active */
			EIX_Menu[i][5].getElementsByTagName('div')[0].className="EIXMenuLevelActive";
			openMenuItem(EIX_Menu[i][3]);
		}
		else{
			/* We have a branch: open it */
			li = EIX_Menu[i][5];
			img = li.getElementsByTagName('img')[0]
			ul = li.childNodes[1]
			img.src=baseHref + image_location + "/images/opened-final.gif";		
			ul.style.display="block";
			ul.style.visibility="visible";

			/* We are going to build and style up the Cookie Trail.*/
			/* If we are at EDNA we don't need a cookietrail */
			if(atEDNA(document.URL)) { /* Do nothing */ } else {
				/* We are going to build and style up the Cookie Trail.*/
				BuildCookieTrail(i);
			}
			/* Color the Menu as Active */
			EIX_Menu[i][5].getElementsByTagName('div')[0].className="EIXMenuLevelActive";			
			openMenuItem(EIX_Menu[i][3]);
			/* Guru 12/3/2007 */
			if (EIX_Menu[i][1] == "Search Jobs")
				EIXMenuExpand(EIX_Menu[i][5]);
			/* end  */
		}
	}
}
	

function EIXMenu_init(ID){

	/* This function initializes the menu by adding all the states for mouse events */
	_ID = document.getElementById(ID);

	/* Return if we can't add read the DOM or create elements in the DOM */
	if(!document.getElementById && !document.createTextNode){return;}

	/* Get the Twist Menu Items */
	d=getElementsByClassName("EIXMenuTwist",_ID);

	/* Not returning the elements correctly? */
	
	/* Return if there is no Menu */
	if (!d){return;}
	/* Loop through each of the items */
	for (i=0;i<d.length;i++){
		div=d[i].parentNode;
		imgs=div.getElementsByTagName('img');
		img=imgs[0];
		a = img.parentNode;
		uls = div.parentNode.getElementsByTagName('ul');
		ul = uls[0];
		/* Check to see if the class of the object is open or closed.  
		If nothing make closed, if open, do not change unless image is clicked. */
		if (EIXMenu_check(div,'Opened')){
			/* Format the Div for an Open Image */
			img.src=baseHref + image_location + "/images/opened-final.gif";		
			ul.style.display="block";
			ul.style.visibility="visible";
		}
		else {
			img.src=baseHref + image_location + "/images/closed-final.gif";
			EIXMenu_addclass(div,'Closed');
			ul.style.display="none";
			ul.style.visibility="hidden";
		}
		/* Add On Click Event to the Image */
		img.onclick=function(){
			/* OnClick Change the status of the ul to be closed */
			/* It should also toggle the src of the image. */	
			a = this.parentNode;
			div = a.parentNode;
			uls = div.parentNode.getElementsByTagName('ul');
			ul = uls[0];
			/* If image is opened then close, if closed then open */
			if (EIXMenu_check(div,"Opened")) {
				/* Closing Div */
				this.src = baseHref + image_location + "/images/closed-final.gif";
				EIXMenu_swapclass(div,"Opened","Closed");
				ul.style.display="none";
				ul.style.visibility="hidden";
			}else{
				/* Opening DIV */
				this.src=baseHref + image_location + "/images/opened-final.gif";
				EIXMenu_swapclass(div,"Closed","Opened");
				ul.style.display="block";
				ul.style.visibility="visible";
			}
		}
		/* Add Mouseover Effect */
		div.onMouseOver=function(){
			EIXMenu_addclass(this,'hover');
		}
	}	
}

function init_menu(_ID) {
	return true;
}

function EIXMenu_Build (location) {
	/* Build the Parent Menu item for the whole Menu and add it as a child to Location*/
	EIXMenu=document.createElement("div");
	EIXMenu.className="EIXMenu";
	location.appendChild(EIXMenu);
	return location;
}
function EIXMenu_Add_Leaf (name, href){
	/* 
	Output:
	<li>
		<div class="EIXMenuLevel">
			<table><tbody><tr><td class="EIXMenuLinkImgTD">
				<img src="leaf.gif" alt="" border="0" />
			</td><td class="EIXMenuLinkTD">
				<a class="EIXMenuLink" href="">Item 1 Level 3</a>
			</td></tr></tbody></table>
		</div>
	</li>
	 */
	
	/* Add a link/leaf to 'href' with text of 'name'  */
	table=document.createElement("table");
	tbody=document.createElement("tbody");
	tr=document.createElement("tr");
	td1=document.createElement("td");
	td2=document.createElement("td");
	img=document.createElement("img");
	a=document.createElement("a");
	li=document.createElement("li");
	div=document.createElement("div");
	text=document.createTextNode(name);

	td1.appendChild(img);
	td2.appendChild(a);
	tr.appendChild(td1);
	tr.appendChild(td2);
	tbody.appendChild(tr);
	table.appendChild(tbody);
	div.appendChild(table);
	li.appendChild(div)	
	a.appendChild(text);
	img.setAttribute("src", baseHref + image_location + "/images/leaf.gif");
	EIXMenu_addclass(div,"EIXMenuLevel");
	a.setAttribute("href",href);
//Added by Guru on 7/24/2009 for WO#800329221 Link box not word - Start
	td2.onclick = function() { window.location=href; }
	a.setAttribute("href","#");
//Guru - End
	
	EIXMenu_addclass(a,"EIXMenuLink");
	td1.setAttribute("width","1px");
	td2.setAttribute("width","100%");
	table.setAttribute("cellpadding","0");
	table.setAttribute("cellspacing","0");
	table.setAttribute("border","0");
	table.setAttribute("width","100%");
	
	return li;
}
function EIXMenu_Add_Top (name, href){
	/* 
	Output:
	<li>
		<div class="EIXMenuLevel">
			<table><tbody><tr><td class="EIXMenuLinkImgTD">
				<img src="leaf.gif" alt="" border="0" />
			</td><td class="EIXMenuLinkTD">
				<a class="EIXMenuLink" href="">Item 1 Level 3</a>
			</td></tr></tbody></table>
		</div>
	</li>
	 */
	
	/* Add a link/leaf to 'href' with text of 'name'  */
	table=document.createElement("table");
	tbody=document.createElement("tbody");
	tr=document.createElement("tr");
	td2=document.createElement("td");
	a=document.createElement("a");
	li=document.createElement("li");
	div=document.createElement("div");
	text=document.createTextNode(name);

	td2.appendChild(a);
	tr.appendChild(td2);
	tbody.appendChild(tr);
	table.appendChild(tbody);
	div.appendChild(table);
	li.appendChild(div);
	a.appendChild(text);
	EIXMenu_addclass(div,"EIXMenuLevel");
	a.setAttribute("href",href);
//Added by Guru on 7/24/2009 for WO#800329221 Link box not word - Start
	td2.onclick = function() { window.location=href; }
	a.setAttribute("href","#");
//Guru - End
	EIXMenu_addclass(a,"EIXMenuLink");
	td2.setAttribute("width","100%");
	td2.setAttribute("colspan","2");
	table.setAttribute("cellpadding","0");
	table.setAttribute("cellspacing","0");
	table.setAttribute("border","0");
	table.setAttribute("width","100%");
	
	return li;
}

function EIXMenu_Add_Branch (name, href){
	/*
		Output: 
		<li>
			<div class="EIXMenuLevel">
				<table><tbody><tr><td class="EIXMenuLinkImgTD">
					<a class="EIXMenuTwist"><img src="closed-final.gif" alt="" border="0" /></a>
				</td><td class="EIXMenuLinkTD">
					<a class="EIXMenuLink" href="">Item 1 Level 3</a>
				</td></tr></tbody></table>
			</div>
			<ul></ul>
		</li>
	*/

	table=document.createElement("table");
	tbody=document.createElement("tbody");
	tr=document.createElement("tr");
	td1=document.createElement("td");
	td2=document.createElement("td");
	li=document.createElement("li");
	div=document.createElement("div");
	a_img=document.createElement("a");
	a=document.createElement("a");
	img=document.createElement("img");
	text=document.createTextNode(name);
	ul=document.createElement("ul");

	td1.appendChild(a_img);
	td2.appendChild(a);
	tr.appendChild(td1);
	tr.appendChild(td2);
	table.appendChild(tbody);
	tbody.appendChild(tr);
	a.appendChild(text);
	a_img.appendChild(img);
	div.appendChild(table);
	li.appendChild(div);
	li.appendChild(ul);

	EIXMenu_addclass(td1, "EIXMenuLinkImgTD");
	EIXMenu_addclass(td2, "EIXMenuLinkTD");
	EIXMenu_addclass(div, "EIXMenuLevel");
	EIXMenu_addclass(a,"EIXMenuLink");
	EIXMenu_addclass(a_img,"EIXMenuTwist");
	EIXMenu_addclass(table,"EIXMenuTable");

	table.setAttribute("border","0");
	table.setAttribute("width","100%");
	table.setAttribute("cellpadding","0");
	table.setAttribute("cellspacing","0");
	table.setAttribute("border","0");
	td1.setAttribute("width","1px");
	td2.setAttribute("width","100%");
	a.setAttribute("href",href);
//Added by Guru on 7/24/2009 for WO#800329221 Link box not word - Start
	td2.onclick = function() { window.location=href; }
	a.setAttribute("href","#");
//Guru - End

	img.setAttribute("src", baseHref + image_location + "/images/closed-final.gif");
	img.setAttribute("alt","");
	img.setAttribute("border","0");

	return li;
}

function build_menu(ID) {
	/* EIX_Menu[i][0] = Section_ID
		EIX_Menu[i][1] = Section Name
		EIX_Menu[i][2] = URL
		EIX_Menu[i][3] = Parent
		EIX_Menu[i][4] = Children *
		EIX_Menu[i][5] = Pointer to DOM *
		EIX_Menu[i][6] = Pointer out of DOM *
		EIX_Menu[i][7] = Menu Order
		EIX_Menu[i][8] = i;
		* = Calculated */
	_ID = document.getElementById(ID);

	/* Step 1: Build up the Children */
	for (i=1;i<EIX_Menu.length;i++){
		for (j=1;j<EIX_Menu.length;j++){
			if (EIX_Menu[j][3] == EIX_Menu[i][0]) {
				EIX_Menu[i][4] += ","+j;
			}
		}
		if (EIX_Menu[i][4].charAt(0) == ",") {
			EIX_Menu[i][4] = EIX_Menu[i][4].substring(1,EIX_Menu[i][4].length);
		}
	}

	/* Loop through and build up the leaf and branch nodes */
	for (i=1;i<EIX_Menu.length;i++){
		if (EIX_Menu[i][4].length==0) {
			/* We have no children Build a leaf*/
			EIX_Menu[i][5] = EIXMenu_Add_Leaf(EIX_Menu[i][1], EIX_Menu[i][2]);
		}
		else {
			/* We have children, so build a branch */
			EIX_Menu[i][5] = EIXMenu_Add_Branch(EIX_Menu[i][1], EIX_Menu[i][2]);
			/* And here is where all those other branches and leaves are going to grow */
			EIX_Menu[i][6] = EIX_Menu[i][5].childNodes[1];	
		}
	}
	/* Loop through the Array and build up the Menu in the Page */
	for (i=1;i<EIX_Menu.length;i++){
		/*Step 1. Check to see if the item has children.  */
		if (EIX_Menu[i][4].length!=0) {
			/*Step 2. If Children attach children to parent.*/
			/*Step 2.1 create an array of the children to step through */
			childrenArray = EIX_Menu[i][4].split(",");
			/* Sort the Children */
			childrenArray.sort(EIX_Menu_CustomSort_Top);
			for (l=0; l<childrenArray.length; l++) {
				/* Put them in the DOM */
				EIX_Menu[i][6].appendChild( EIX_Menu[childrenArray[l]][5] );
			}
		}
	}
	
	/* Create the top level items in the menu and class them up */
	/* Drop the Menu into _ID */
	EIXMenu_addclass(_ID, "EIXMenu");
	top_ul=document.createElement("ul");
	
	/* Append Root */
	top_ul.appendChild(EIXMenu_Add_Top(EIX_Menu[1][1], EIX_Menu[1][2]))
	
	/* Loop through the array and set up level 1 ID's */
	childrenArray = EIX_Menu[1][4].split(",");
	/* Sort them first */
	childrenArray.sort(EIX_Menu_CustomSort_Top);
	/* Promote Each Level 1 branch */
	for (i=0; i<childrenArray.length; i++) {
		top_ul.appendChild(EIX_Menu[childrenArray[i]][5])
	}		
	
	/* Append Menu to Page */
	_ID.appendChild(top_ul);

	/* Build up Expand and Collapse All */
	ecp=document.createElement("p");
	ecspan=document.createElement("span");
	eca1=document.createElement("a");
	eca2=document.createElement("a");
	extext1=document.createTextNode("Expand");
	extext2=document.createTextNode("Collapse");
	extext3=document.createTextNode(" | ");
	ecspan.appendChild(extext3);
	eca1.appendChild(extext1);	
	eca2.appendChild(extext2);	
	ecp.appendChild(eca1);
	ecp.appendChild(ecspan);
	ecp.appendChild(eca2);
	EIXMenu_addclass(ecp, "EIXMenuECP");
	eca1.setAttribute("href","javascript:EIXMenuExpandAll()");
	eca2.setAttribute("href","javascript:EIXMenuCollapseAll()");
	_ID.appendChild(ecp);

	
	/* If we are in the investors section we need to add it to the top as well. */
	if (sectionName == "investors"){
		/* Step 1: Make a Copy */
		ecpCopy=ecp.cloneNode(true);

		/* Step 2: Find out where it goes */

		/* If we are at thompson then we need to use their DOM  */
		if (getElementsByClassName("EIXBreadCrumb")[0]) {
			_ID2temp=getElementsByClassName("EIXBreadCrumb")[0].parentNode.parentNode
		}
		else{
			_ID2temp=getElementsByClassName("EIXBreadCrumbLocal")[0].parentNode.parentNode
		}

		/* If we are in IE then */
		if (isIE) {
			_ID2 = _ID2temp.childNodes[0];
		}
		/* If we are in Mozilla then */
		else if (isMoz) {
			_ID2 = _ID2temp.childNodes[1];
		}

		/* Step 3: Finally Add it to the Dom */
		EIXMenu_addclass(_ID2, "EIXMenuECPParent")
		_ID2.appendChild(ecpCopy);
	}
	
	
	/* Get array of objects */
	_IDContent=_ID.getElementsByTagName("*")
	/* Create a new array to store our objects which are using  */
	var d = new Array();
	/* Loop through DocumentContent */
	for(var i=0;i<_IDContent.length;i++){
		/* Does the className = What we want it to, add it to our list */
		if(_IDContent[i].className=="EIXMenuTwist"){
			d[d.length]=_IDContent[i]
		}
	}
	
	/* Loop through each of the items which have the classname we are looking for*/
	for (i=0;i<d.length;i++){
		li=d[i].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
		img=d[i].childNodes[0];
		childMenu = li.childNodes[1];
		/* Check to see if the class of the object is open or closed.  
		If nothing make closed, if open, do not change unless image is clicked. */
		if (EIXMenu_check(li,'Opened')){
			/* Format the Div for an Open Image */
			img.src=baseHref + image_location + "/images/opened-final.gif";		
			childMenu.style.display="block";
			childMenu.style.visibility="visible";
		}
		else {
			img.src=baseHref + image_location + "/images/closed-final.gif";
			EIXMenu_addclass(li,'Closed');
			childMenu.style.display="none";
			childMenu.style.visibility="hidden";
		}
		/* Add On Click Event to the Image */
		img.onclick=function(){
			/* OnClick Change the status of the ul to be closed */
			/* It should also toggle the src of the image. */	
			a = this.parentNode;
			li = a.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
			childMenu = li.childNodes[1];
			/* If image is opened then close, if closed then open */
			if (EIXMenu_check(li,"Opened")) {
				/* Closing Div */
				this.src = baseHref + image_location + "/images/closed-final.gif";
				EIXMenu_swapclass(li,"Opened","Closed");
				childMenu.style.display="none";
				childMenu.style.visibility="hidden";
			}else{
				/* Opening DIV */
				this.src=baseHref + image_location + "/images/opened-final.gif";
				EIXMenu_swapclass(li,"Closed","Opened");
				childMenu.style.display="block";
				childMenu.style.visibility="visible";
			}
		}
	}

	/* Add Mouseover Effect */
	d=getElementsByClassName("EIXMenuLevel");
	for (i=0; i<d.length; i++){
		d[i].onmouseover = function () {
			if (EIXMenu_check(this, "EIXMenuLevel")){
				EIXMenu_swapclass(this,"EIXMenuLevel","EIXMenuLevelHover");
			}else{
				EIXMenu_swapclass(this,"EIXMenuLevelActive","EIXMenuLevelActiveHover");
			}
		}
		d[i].onmouseout = function () {
			if (EIXMenu_check(this, "EIXMenuLevelHover")){
				EIXMenu_swapclass(this,"EIXMenuLevelHover","EIXMenuLevel");
			}else{
				EIXMenu_swapclass(this,"EIXMenuLevelActiveHover", "EIXMenuLevelActive");
			}
		}
		/*
		//Guru 7/14/2009 - Start
		d[i].onclick = function () { 
		   var lk=this.childNodes[0].childNodes[0].childNodes[0].childNodes[1].childNodes[0].href;
  		}
		//Guru - End
		*/
	}
	if (NotatEdisondotCom(document.URL.split("?")[0])) {
		/* Do Nothing! */
	} else {
		/* Prep the Cookie Trail */
		span = document.createElement("span");
		d=getElementsByClassName("EIXBreadCrumbLocal")[0];
		//Guru: 3/9/9 cookie trail is optional for some templates [E-Rec]		
		//d.appendChild(span);
		if (d!=undefined) d.appendChild(span);
	}	
	/* Open up the current pages location */
	for (i=1;i<EIX_Menu.length;i++){
		/* Check to see if this pages url = the page we have in our menu system */
		if (CheckURL(EIX_Menu[i][2])) {
			/* Recurse through the tree and open up the location we are at. */
			openMenuItem(EIX_Menu[i][0]);
			/* Color the Menu as Active */
			EIX_Menu[i][5].getElementsByTagName('div')[0].className="EIXMenuLevelActive";
		}
	}	
	
	if (document.URL.split("?")[0] == EIX_Menu[1][2]) {
		getElementsByClassName("EIXMenuLevel")[0].className = "EIXMenuLevelActive";
	}
	if (NotatEdisondotCom(document.URL.split("?")[0])) {
		if(atEDNA(document.URL) == true) {
			var d=getElementsByClassName("EIXMenuLevel");
			EIXMenu_addclass(d[0],'EIXMenuSectionName');
		}
	} else {
		/* Prep the Cookie Trail */
		span = document.createElement("span");
		d=getElementsByClassName("EIXBreadCrumbLocal")[0];
		//Guru: 3/9/9 cookie trail is optional for some templates [E-Rec]		
		//d.appendChild(span);
		if (d!=undefined) d.appendChild(span);

		if ( document.URL.search(/es_news\.asp/i) > 0 ) {
			d=getElementsByClassName("EIXBreadCrumbLocal")[0];
 		        dChild=getElementsByClassName("EIXBreadCrumbLocal")[0].childNodes[0];
			gt=document.createTextNode(" ");
			a=document.createElement("a");
			text=document.createTextNode("News Releases");
			a.setAttribute("href",baseHref + "pressroom/pr.asp");
			a.appendChild(text);
			d.insertBefore(a, dChild);
			d.insertBefore(gt, dChild);

			d=getElementsByClassName("EIXBreadCrumbLocal")[0];
 		        dChild=getElementsByClassName("EIXBreadCrumbLocal")[0].childNodes[0];
			gt=document.createTextNode(" > ");
			a=document.createElement("a");
			text=document.createTextNode("Press Room");
			a.setAttribute("href",baseHref + "pressroom/default.asp");
			a.appendChild(text);
			d.insertBefore(a, dChild);
			d.insertBefore(gt, dChild);
		}
	
		/* Finalize the Cookie Trail by building last entry*/
		d=getElementsByClassName("EIXBreadCrumbLocal")[0];
		dChild=getElementsByClassName("EIXBreadCrumbLocal")[0].childNodes[0];
		gt=document.createTextNode(" > ");
		a=document.createElement("a");
		text=document.createTextNode("Home");
		a.setAttribute("href",baseHref);
		a.appendChild(text);
		d.insertBefore(a, dChild);
		d.insertBefore(gt, dChild);
	}
}	