// 08/17/07 - SR



var GrandChildren = new Array();

var Children = new Array();

var Parents = new Array();

ParentSet = false

SetFont = ""

PrintThisPage = ""



IconRow1 = ""

IconRow2 = ""

			

ParentBirthCount = 0;

ChildBirthCount = 0;

GrandChildBirthCount = 0;



ReservedList = "as,break,case,catch,class,const,continue,default,delete,do,else,export,extends,false,finally,for,function,if,import,in,instanceof,is,namespace,new,null,package,private,public,return,super,switch,this,throw,true,try,typeof,use,var,void,while,with,abstract,debugger,enum,goto,implements,interface,native,protected,synchronized,throws,transient,volatile,get,include,set,item,boolean,byte,char,double,final,float,int,long,short,static"



ReservedList = ReservedList.split(",")



QueryStrings = window.location.search



if (QueryStrings.indexOf("=") != -1) {



QueryStrings = QueryStrings.replace("?","")

QueryStrings = QueryStrings.split("&")





LengthValue = QueryStrings.length

for (LoopCount=0;LoopCount<LengthValue;LoopCount++){

	



	TempQVar = QueryStrings[LoopCount]

	TempQVar = TempQVar.split("=")

	

	RestrictedLengthValue = ReservedList.length

	for (RestrictedLoopCount=0;RestrictedLoopCount<RestrictedLengthValue;RestrictedLoopCount++){

		if (TempQVar[0] == ReservedList[RestrictedLoopCount]) {

			TempQVar[0] = TempQVar[0]+"Var"

		}

	}

	

	eval(TempQVar[0] + "='" + TempQVar[1] + "'") 

	TempQVar = null

}



}



// Builds a drop down for a range of dates sent to it, May 1, 2009, slr
function DatedDropDown(TargetField,Pattern,StartingPoint,TotalIters,Optional) {
	
	// Note - since we are trying to make this work with future needs
	// (ie days, months, ...) it initially looks more complicated than it needs to be
	
	// Trap it if we are sent a form field that does not exist
	if (TargetField) {
	
		// First we have to clear the target select box, so we set all of the options to null
		LengthValue = TargetField.length 
		for (LoopCount=0;LoopCount<LengthValue;LoopCount++){ 
	  			TargetField.options[0] = null
		}
		
		// Grab current date to start from
		var StartingDate=new Date()
		var StartingYear=StartingDate.getYear()
		var StartingMonth=StartingDate.getMonth()
		var StartingDate=StartingDate.getDate()
		//var StartingDay=StartingDate.getDay()
		
		// What are we outputting - add patterns as needed
		switch(Pattern) {
			case 'YYYY':
				// We keep the current date if it needs to be selected
				OriginalDateAttribute = StartingYear;
				// This is the variable we will adjust to the starting point (ie + or -)
				TargetDateAttribute = StartingYear;
				break;
			default:
				// Use default data so we don't show the user error alerts by accident
				
				// We keep the current date if it needs to be selected
				OriginalDateAttribute = StartingYear;
				// This is the variable we will adjust to the starting point (ie + or -)
				TargetDateAttribute = StartingYear;
				//Code goes here
		}
		
		// Add 'StartingPoint' to set starting date to first date to show in dropdown 
		// - will bring dates before today, plus will bring them after, 0 will start from now
		TargetDateAttribute += StartingPoint;
		
		
		RovingDate = TargetDateAttribute;
		SelectThis = "";
		SelectedText = "";
		RovingIndex = 0;
		SelectedIndex = 0;
		
		// If optional arguments have been sent
		// We are using | as the delimiter since ' may be used for first entry output
		if (Optional) {
		
			// Split for each argument sent
			Optional = Optional.split("|");
			for (OptionsCount=0;OptionsCount<Optional.length;OptionsCount++){
			
				// Option name vs option value
				ThisOption = Optional[OptionsCount].split("=");
				switch(ThisOption[0].toLowerCase()) {
					case 'firstentry':
						TargetField.options[RovingIndex] = new Option(ThisOption[1],ThisOption[1])
						RovingIndex++;
						break;
					case 'selectedindex':
						SelectedIndex = ThisOption[1];
						break;
					case 'selectedtext':
						if (ThisOption[1].toLowerCase() == "now") {
							SelectedText = OriginalDateAttribute;
						} else {
							SelectedText = ThisOption[1];
						}
						break;
				default:
					//Code goes here
				}
			}
		}
			
				
		// Now loop through for each date
		for (DateCount=0;DateCount<TotalIters;DateCount++){
			
			// If text has been passed through to match against and select
			if (RovingDate == SelectedText) {
				SelectedIndex = RovingIndex;
			}	
					
			TargetField.options[RovingIndex] = new Option(RovingDate,RovingDate);
			
			RovingDate++;
			RovingIndex++;
			SelectThis = "";
		}
		
		// Set the selected index based on either default (0) or arguments passed over
		TargetField.selectedIndex=SelectedIndex;
		
	}
}



function GalleryPop(redirect,Type) {



// Simple pop up for the colour selector.







if (Type == "P") {



	width = "420"



	height = "610"



} else {



	height = "420"



	width = "610"



}







window.open(redirect,'New','menubar=no,scrollbars=no,toolbars=no,resizable=no,location=no,width='+width+',height='+height)



	}



	

function WriteGallery(ThisGalleryName,AllPictures,GalleryCols) {

	

	if (typeof(GalleryCols) == "undefined") {

		GalleryCols = 3;

	}

	

	AllPictures = AllPictures.split(";")

		

	document.write("<table class=img_table border=0>")

	

	TDCount = 0;

	LengthValue = AllPictures.length;

	for (LoopCount=0;LoopCount<LengthValue;LoopCount++){

		

		

		TDCount = TDCount + 1;

		if (TDCount == 1) {

			document.write("<tr>")

		} 

		

		document.write("<td align=center>");



		ThisImgType = "L";

		ThisImg = AllPictures[LoopCount];

		ThisImg = ThisImg.split(",");

		if (ThisImg.length == 2) {

			ThisImgType = "P";

		}

		

		document.write("<a href=\"javascript:GalleryPop('../../images/photos/" + ThisGalleryName + "_"+ThisImg[0]+"_lg.jpg','" + ThisImgType + "');\"><img src=\"../../images/photos/" + ThisGalleryName + "_"+ThisImg[0]+"_sm.jpg\" alt=\"\" border=\"0\"></a>")

		

		document.write("</td>");

		

		if (TDCount == GalleryCols) {

			document.write("</tr>");

			TDCount = 0;

		} 

		

		

	}

	

	document.write("</table>")



}





function ARpopUp() {

// Simple pop up for the colour selector.



window.open('../annualreport/index.html','New','menubar=no,scrollbars=yes,toolbars=no,resizable=no,location=no,width=740,height=700')



	}

	

function cookieExpire(expire_days) {



	var expire_date = new Date()

	var ms_from_now = expire_days *24*60*60*1000

	expire_date.setTime(expire_date.getTime() + ms_from_now)

	var expire_string = expire_date.toGMTString()



	return "expires=" + expire_string



}



function LoadPageFeature(TargetFeature) {

	

	

	

	OurClearPage =  window.location + " "

	OurClearPage = OurClearPage.replace(window.location.search,"")

	OurClearPage = OurClearPage.replace(" ","")

	

	//alert("Target Feature=" + TargetFeature)

	if (TargetFeature == "?PrintThisPage=true") { 

			window.open(OurClearPage + TargetFeature)

	} else {

		//document.cookie = "; SetFont=;"+cookieExpire(0) + "path=/;";

		document.cookie = "SetFont=" + TargetFeature.replace("?","") + "; " + cookieExpire(365000) + "; path=/;";

		//alert("document.cookie (LoadPageFeature()) ="+document.cookie); // for development - ); // for development - 

		//alert("window.location (LoadPageFeature()) ="+window.location)

		//OurClearPage.split("#")

		//alert(window.location.hash); // for development - 

		window.location.reload(true)

	}

}







function FontAdjust() {

	

	LSContent = 18

	XLSContent = 24

	

	LSTitle = LSContent+8

	XLSTitle = XLSContent+8

	

	LSSubTitle = LSContent+4

	XLSSubTitle = XLSContent+4

	

	SetFont = document.cookie

	//alert("document.cookie= " + document.cookie);

	SetFont = SetFont.replace("SetFont=","")

	SetFont = SetFont.replace("SetFont","")

	//alert("SetFont parsed = " + SetFont);

	

	document.write ("<STYLE TYPE='text/css'>");



eval("document.write (\".icon_XLSFont a {font-size: \"+XLSContent+\"px; color: #ffffff;text-decoration: none;}\");")

eval("document.write (\".icon_LSFont a {font-size: \"+LSContent+\"px; color: #ffffff;text-decoration: none;}\");")

eval("document.write (\".icon_MSFont a {color: #ffffff;text-decoration: none;}\");")





	

	if (SetFont == "LS" || SetFont == "XLS") {

eval("document.write (\".c_column {font-size: \"+"+SetFont+"Content+\"px;}\");")

eval("document.write (\".c_header {font-size: \"+"+SetFont+"Content+\"px;}\");")

eval("document.write (\".c_header2 {font-size: \"+"+SetFont+"Content+\"px;}\");")

eval("document.write (\".c_title {font-size: \"+"+SetFont+"Title+\"px;}\");")

eval("document.write (\".sl_title {font-size: \"+LSContent+\"px;}\");")

eval("document.write (\".basic_table {font-size: \"+"+SetFont+"Content+\"px;}\");")

eval("document.write (\".basic_table td {font-size: \"+"+SetFont+"Content+\"px;}\");")

eval("document.write (\".basic_table a {font-size: \"+"+SetFont+"Content+\"px;}\");")

eval("document.write (\".img_table {font-size: \"+"+SetFont+"Content+\"px;}\");")

eval("document.write (\".img_table td {font-size: \"+"+SetFont+"Content+\"px;}\");")

eval("document.write (\".img_table a {font-size: \"+"+SetFont+"Content+\"px;}\");")

eval("document.write (\".FooterText {font-size: \"+"+SetFont+"Content+\"px;}\");")

eval("document.write (\".FooterText a {font-size: \"+"+SetFont+"Content+\"px;}\");")

eval("document.write (\".sl_table a {font-size: \"+LSContent+\"px;}\");")

eval("document.write (\".c_sub-title {font-size: \"+"+SetFont+"SubTitle+\"px;}\");")

	}

	

	RegularIconRow = '<tr height=2><td></td></tr><tr class=icon_MSFont height=30 bgcolor="EC8000"><td width=44><A HREF="javascript:LoadPageFeature(\'\');"><img src="'+RootFolder+'images/buttons/icon_font.gif" width="34" height="30" hspace="5" alt="R E G U L A R   F O N T" border="0"></a></td><td><A HREF="javascript:LoadPageFeature(\'\');"><font color=ffffff>Regular</font></a></td></tr>'

	SmallerIconRow = '<tr height=2><td></td></tr><tr class=icon_LSFont height=30 bgcolor="EC8000"><td width=44><A HREF="javascript:LoadPageFeature(\'LS\');"><img src="'+RootFolder+'images/buttons/icon_font.gif" width="34" height="30" hspace="5" alt="S M A L L E R   F O N T" border="0"></a></td><td><A HREF="javascript:LoadPageFeature(\'LS\');">Smaller</a></td></tr>'

	LargerIconRow = '<tr height=2><td></td></tr><tr class=icon_LSFont height=30 bgcolor="EC8000"><td width=44><A HREF="javascript:LoadPageFeature(\'\');"><img src="'+RootFolder+'images/buttons/icon_font.gif" width="34" height="30" hspace="5" alt="L A R G E R   F O N T" border="0"></a></td><td><A HREF="javascript:LoadPageFeature(\'LS\');">Larger</a></td></tr>'

	LargestIconRow = '<tr height=2><td></td></tr><tr class=icon_XLSFont height=30 bgcolor="EC8000"><td width=44><A HREF="javascript:LoadPageFeature(\'XLS\');"><img src="'+RootFolder+'images/buttons/icon_font.gif" width="34" height="30" hspace="5" alt="L A R G E S T   F O N T" border="0"></a></td><td><A HREF="javascript:LoadPageFeature(\'XLS\');">Largest</a></td></tr>'

	

	switch(SetFont) {

		case "LS":

			IconRow1 = RegularIconRow;

			IconRow2 = LargestIconRow;

			break;

		case "XLS":

			IconRow1 = RegularIconRow;

			IconRow2 = SmallerIconRow;

			break;

		default:

			IconRow1 = LargerIconRow

			IconRow2 = LargestIconRow

	}

	

	document.write ("</STYLE TYPE='text/css'>");

}

// We figure out the filename to identify which Parent to highlight

ThisFile = document.location + " "



if (ThisFile.indexOf("/") == -1) {

	ThisFile = ThisFile.split("\\")

} else {

	ThisFile = ThisFile.split("/")

}



ThisFileName = ThisFile[ThisFile.length-2] + "/" + ThisFile[ThisFile.length-1]

ThisFileName = ThisFileName.replace(" ","")





function toUNP() {



window.open("https://www.e-comunity.ca/unp/UNPFrontControllerServlet?LANG=en&OPCODE=FormInfo&APP_ID=100053&BRAND=site","","width=560,height=650,resizable=yes,scrollbars=yes,menubar=no,toolbar=no,directories=no,location=no,status=yes");



return;



}



function CSClickReturn () {

var bAgent = window.navigator.userAgent; 

var bAppName = window.navigator.appName;





if ((bAppName.indexOf("Explorer") >= 0) && (bAgent.indexOf("Mozilla/3") >= 0) && (bAgent.indexOf("Mac") >= 0)) { 

return true; // dont follow link

} else {

return false; // dont follow link

}





}





function FindTitle(TargetFileName,DefaultTitle) {



	var SpaceReplace = new RegExp("&nbsp;","g");

	TitleIs = ""

	

	for (ParentCount = 0;ParentCount<Parents.length;ParentCount ++) {

		

		ThisParentLabel = Parents[ParentCount].Label.replace("<br>","")

		ThisParentLabel = ThisParentLabel.replace(SpaceReplace," ")

		

		if (Parents[ParentCount].URL == TargetFileName) {

			TitleIs = ThisParentLabel

		}



	}

	

	for (ChildCount = 0;ChildCount<Children.length;ChildCount++) {

		

		ThisChildLabel = Children[ChildCount].Label.replace("<br>","")

		ThisChildLabel = ThisChildLabel.replace(SpaceReplace," ")

		

		if (Children[ChildCount].URL == TargetFileName) {

			TitleIs = ThisChildLabel

		}



	}



	if (TitleIs == "") {

		

		if ((DefaultTitle == "Untitled") || (DefaultTitle == "Untitled Document") || (DefaultTitle.indexOf("../") != -1) || (DefaultTitle == "") || (DefaultTitle == " ")) {

			DefaultTitle = TargetFileName;

		}

		document.write(DefaultTitle)

	} else {

		document.write(TitleIs)

	}

	

}



function DefaultPopUp(TargetPage,W,H) {



	window.open(TargetPage,'New','width='+W+',height='+H);



}





function AddGrandChild(GrandChildLabel,GrandChildURL) {



	BirthofGrandChildren(GrandChildLabel,GrandChildURL,CurrentChild,CurrentParent);



}



function GrandChild(Label,URL,Child,Parent) {



	this.Label = Label

	this.URL = URL

	this.Child = Child

	this.Parent = Parent

	this.ID = "G"+GrandChildBirthCount

	this.Status = "hidden"

	//this.HasChildren = false

	

	//DevAlert("GrandChild: "+this.Label + "=" + this.ID+";Parent="+this.Parent+";Child="+this.Child); // for development - 



}



function BirthofGrandChildren(LabelG,URLG,ChildG,ParentG) {



eval('GrandChildren['+GrandChildBirthCount+'] = new GrandChild("'+LabelG+'","'+URLG+'","'+ChildG+'","'+ParentG+'")');



GrandChildBirthCount = GrandChildBirthCount + 1;



}











function AddChild(ChildLabel,ChildURL) {



	BirthofChildren(ChildLabel,ChildURL,CurrentParent);



}



//BirthofParents();



function Child(Label,URL,Parent) {



	this.Label = Label

	this.URL = URL

	this.Parent = Parent

	this.ID = "C"+ChildBirthCount

	this.Status = "hidden"

	this.HasChildren = false



	//DevAlert("Child: "+this.Label + "=" + this.ID+";Parent="+this.Parent); // for development - 

	

}



function BirthofChildren(LabelC,URLC,ParentC) {



eval('Children['+ChildBirthCount+'] = new Child("'+LabelC+'","'+URLC+'","'+ParentC+'")');

//[0] = new Child(LabelC,URLC,ParentC);



CurrentChild = "C"+ChildBirthCount

ChildBirthCount = ChildBirthCount + 1;

//CurrentChild = LabelC



}









function Parent(Label,URL) {



	this.Label = Label

	this.URL = URL

	this.ID = "P"+ParentBirthCount

	this.Status = "hidden"

	this.HasChildren = false

	

	//DevAlert("Parent: "+this.Label + "=" + this.ID); // for development - 

		

}







function AddParent(ParentB,URLB) {



eval('Parents['+ParentBirthCount+'] = new Parent("'+ParentB+'","'+URLB+'")');

//Parents[0] = new Parent("ParentOne","about/index.html");

//Parents[1] = new Parent("ParentTwo","about/index.html");



CurrentParent = "P"+ParentBirthCount

ParentBirthCount = ParentBirthCount + 1;





}



FirstX = 0;

LastX = 0;

SecondLastX = 0;







function IDFirstXCoord() {



//alert(StringSample); // for development - 

var vers = navigator.appVersion;

vers = vers.substring(0,1);

// Netscape and IE output the screen width differently



if (navigator.userAgent.indexOf("MSIE") >= 0) {

	//alert(document.body.clientWidth + "x" + document.body.clientHeight);



	TotalWidth = document.body.clientWidth

	// We get the total width -10 to account for scrollbars





	FirstX = ((document.body.clientWidth - 718)/2)

	// We take off 300 for the permanent buttons

	// and half it to get one figure for the title, and one for the href



	LastX = TotalWidth - FirstX



} else if (navigator.userAgent.indexOf("Mozilla") >= 0) {

	// Firefox also outputs a different screen width

	// updated Mar.17, 2009 cy

	TotalWidth = window.outerWidth

	FirstX = ((window.outerWidth - 742)/2)



} else {   

                                         

	//alert(window.outerWidth + "x" + window.outerHeight);

	TotalWidth = window.outerWidth

	FirstX = ((window.outerWidth - 718)/2)

	// See above





}





}



IDFirstXCoord();



// Sets a parent with current highlight

function SetCurrentParent(ParentID,ParentCountValue) {

eval('document.'+DocumentObject+OpenObjBracket+'ParentID'+CloseObjBracket+'.style.background = "#'+ParentBackgroundCurrent+'"');

		eval('document.'+DocumentObject+OpenObjBracket+'ParentID'+CloseObjBracket+'.style.borderLeft = "1px solid #'+ParentBorderLeftCurrent+'"');

	eval('document.'+DocumentObject+OpenObjBracket+'ParentID'+CloseObjBracket+'.style.borderRight = "1px solid #'+ParentBorderRightCurrent+'"');

eval('document.'+DocumentObject+OpenObjBracket+'ParentID'+CloseObjBracket+'.style.borderTop = "1px solid #'+ParentBorderTopCurrent+'"');

eval('document.'+DocumentObject+OpenObjBracket+'ParentID+"_link"'+CloseObjBracket+'.style.color = "#'+ParentTextCurrent+'"');

ParentSet = true

CurrentPagesParent = ParentID

}



function DonateNowMouseOver() {



	eval('document.'+DocumentObject+OpenObjBracket+'"donate_now"'+CloseObjBracket+'.style.backgroundColor = DonateNowBackgroundHighlight');

}



function DonateNowMouseOut() {



	eval('document.'+DocumentObject+OpenObjBracket+'"donate_now"'+CloseObjBracket+'.style.backgroundColor = DonateNowBackground');

}



function TopBarMouseOver(TopBarName) {

	eval('document.'+DocumentObject+OpenObjBracket+'"'+TopBarName+'"'+CloseObjBracket+'.style.color = TopBarTextHighlight');

}



function TopBarMouseOut(TopBarName) {

	eval('document.'+DocumentObject+OpenObjBracket+'"'+TopBarName+'"'+CloseObjBracket+'.style.color = TopBarText');

}



function ParentMouseOver(ParentID,ParentCountValue) {



if (ie4) {

	document.SelectLayer = eval('document.'+DocumentObject+OpenObjBracket+'"VisibleSelect"'+CloseObjBracket)

	document.SelectLayer.style.visibility = "hidden";

	}

	

	eval('document.'+DocumentObject+OpenObjBracket+'ParentID'+CloseObjBracket+'.style.borderTop = "1px solid #'+ParentBorderTopHighlight+'"');

	//alert(eval('document.'+DocumentObject+'(ParentID).id')); // for development - 

	eval('document.'+DocumentObject+OpenObjBracket+'ParentID+"_link"'+CloseObjBracket+'.style.color = "#'+ParentTextHighlight+'"');

	eval('document.'+DocumentObject+OpenObjBracket+'ParentID'+CloseObjBracket+'.style.background = "#'+ParentBackgroundHighlight+'"');

	eval('document.'+DocumentObject+OpenObjBracket+'ParentID'+CloseObjBracket+'.style.borderLeft = "1px solid #'+ParentBorderLeftHighlight+'"');

	eval('document.'+DocumentObject+OpenObjBracket+'ParentID'+CloseObjBracket+'.style.borderRight = "1px solid #'+ParentBorderRightHighlight+'"');

	if (Parents[ParentCountValue].HasChildren == true) {

		eval('document.'+DocumentObject+OpenObjBracket+'ParentID+"_lineage"'+CloseObjBracket+'.style.visibility = VisibilityShown')

	}

	



	

	

	eval("Parents["+ParentCountValue+"].Status = 'visible'");

	



	

}



function ParentMouseOut(ParentID,ParentCountValue) {

	

	

	

	//CurrentPagesParent = Parents[ParentCount].ID

	if (CurrentPagesParent == Parents[ParentCountValue].ID) {

		ThisParentBorderLeft = ParentBorderLeftCurrent

		ThisParentBorderRight = ParentBorderRightCurrent

		ThisParentBorderTop = ParentBorderTopCurrent

		ThisParentBackground = ParentBackgroundCurrent

		ThisParentText = ParentTextCurrent

		//alert("highlight " + ParentCount); // for development - 

	} else {

		ThisParentBorderLeft = ParentBorderLeft

		ThisParentBorderRight = ParentBorderRight

		ThisParentBorderTop = ParentBorderTop

		ThisParentBackground = ""

		ThisParentText = ParentText

	}

	

	eval("Parents["+ParentCountValue+"].Status = 'hidden'");

	eval('document.'+DocumentObject+OpenObjBracket+'ParentID'+CloseObjBracket+'.style.borderTop = "1px solid #'+ParentBorderTopHighlight+'"');

	eval('document.'+DocumentObject+OpenObjBracket+'ParentID+"_link"'+CloseObjBracket+'.style.color = "#'+ThisParentText+'"');

	

	

	//ParentWipe(ParentID,ParentCountValue)

	setTimeout('ParentWipe("'+ParentID+'",'+ParentCountValue+')', 20)

	//setTimeout('AnimWipe()', 6000)

	



}



function AnimWipe() {



		if (ie4) {

		document.SelectLayer = eval('document.'+DocumentObject+OpenObjBracket+'"VisibleSelect"'+CloseObjBracket)

		document.SelectLayer.style.visibility = "visible";

		}

		



}

function ParentWipe(ParentID,ParentCountValue) {

		

	if (CurrentPagesParent == Parents[ParentCountValue].ID) {

		ThisParentBorderLeft = ParentBorderLeftCurrent

		ThisParentBorderRight = ParentBorderRightCurrent

		ThisParentBorderTop = ParentBorderTopCurrent

		ThisParentBackground = ParentBackgroundCurrent

		ThisParentText = ParentTextCurrent

		//alert("highlight " + ParentCount); // for development - 

	} else {

		ThisParentBorderLeft = ParentBorderLeft

		ThisParentBorderRight = ParentBorderRight

		ThisParentBorderTop = ParentBorderTop

		ThisParentBackground = ParentBackground

		ThisParentText = ParentText

	}

	

	if (eval("Parents["+ParentCountValue+"].Status") != 'visible') {	

	

		if (ie4) {

		document.SelectLayer = eval('document.'+DocumentObject+OpenObjBracket+'"VisibleSelect"'+CloseObjBracket)

		document.SelectLayer.style.visibility = "visible";

		}

		

	

		eval('document.'+DocumentObject+OpenObjBracket+'ParentID'+CloseObjBracket+'.style.background = "#'+ThisParentBackground+'"');

		eval('document.'+DocumentObject+OpenObjBracket+'ParentID'+CloseObjBracket+'.style.borderLeft = "1px solid #'+ThisParentBorderLeft+'"');

	eval('document.'+DocumentObject+OpenObjBracket+'ParentID'+CloseObjBracket+'.style.borderRight = "1px solid #'+ThisParentBorderRight+'"');

		eval('document.'+DocumentObject+OpenObjBracket+'ParentID+"_lineage"'+CloseObjBracket+'.style.visibility = VisibilityHidden')

	}

	

}



/*function displayDropDown(state) {

		dropDownToWorkWith = eval('document.'+DocumentObject +OpenObjBracket+ "functionDropDown"+CloseObjBracket + '.style');

    	dropDownToWorkWith.visibility = state;

}*/



function ChildMouseOver(ChildID,ChildCountValue) {

	

	if (ie4) {

	document.SelectLayer = eval('document.'+DocumentObject+OpenObjBracket+'"VisibleSelect"'+CloseObjBracket)

	document.SelectLayer.style.visibility = "hidden";

	}

	

	

	// Current Item Highlight

	eval('document.'+DocumentObject+OpenObjBracket+'ChildID'+CloseObjBracket+'.style.background = "#'+ChildBackgroundHighlight+'"');

	eval('document.'+DocumentObject+OpenObjBracket+'ChildID+"_link"'+CloseObjBracket+'.style.color = "#'+ChildTextHighlight+'"');

		

	// Show next drop down

	//eval('document.'+DocumentObject+OpenObjBracket+'ChildID+"_lineage"'+CloseObjBracket+'.style.visibility = VisibilityShown')

	

	eval("Children["+ChildCountValue+"].Status = 'visible'");

	

    //displayDropDown('hidden'); // disappear



	

}



function ChildMouseOut(ChildID,ChildCountValue) {



	eval('document.'+DocumentObject+OpenObjBracket+'ChildID'+CloseObjBracket+'.style.background = "#'+ChildBackground+'"');

	eval('document.'+DocumentObject+OpenObjBracket+'ChildID+"_link"'+CloseObjBracket+'.style.color = "#'+ChildText+'"');

	

	eval("Children["+ChildCountValue+"].Status = 'hidden'");

	

	setTimeout('ChildWipe("'+ChildID+'",'+ChildCountValue+')', 200)



	//displayDropDown('visible'); // appear





	

}



function ChildWipe(ChildID,ChildCountValue) {

		

	

	

	if (eval("Children["+ChildCountValue+"].Status") != 'visible') {	

		// Show next drop down

		eval('document.'+DocumentObject+OpenObjBracket+'ChildID+"_lineage"'+CloseObjBracket+'.style.visibility = VisibilityHidden')

	}

	

}



function GrandChildMouseOver(GrandChildID,GrandChildCountValue) {

	

	if (ie4) {

	document.SelectLayer = eval('document.'+DocumentObject+OpenObjBracket+'"VisibleSelect"'+CloseObjBracket)

	document.SelectLayer.style.visibility = "hidden";

	}

	

	// Current Item Highlight

	eval('document.'+DocumentObject+OpenObjBracket+'GrandChildID'+CloseObjBracket+'.style.background = "#'+GChildBackgroundHighlight+'"');

	eval('document.'+DocumentObject+OpenObjBracket+'GrandChildID+"_link"'+CloseObjBracket+'.style.color = "#'+GChildTextHighlight+'"');

		

	// Show next drop down

	//document.all[GrandChildID+"_lineage"].style.visibility = "visible"

	

	eval("GrandChildren["+GrandChildCountValue+"].Status = 'visible'");

	

}



function GrandChildMouseOut(GrandChildID,GrandChildCountValue) {



	eval('document.'+DocumentObject+OpenObjBracket+'GrandChildID'+CloseObjBracket+'.style.background = "#'+GChildBackground+'"');

	eval('document.'+DocumentObject+OpenObjBracket+'GrandChildID+"_link"'+CloseObjBracket+'.style.color = "#'+GChildText+'"');

	

	//eval("GrandChildren["+GrandChildCountValue+"].Status = 'hidden'");

	

	//setTimeout('GrandChildWipe("'+GrandChildID+'",'+GrandChildCountValue+')', 200)

	

}



function GrandChildWipe(GrandChildID,GrandChildCountValue) {

		

	

	if (eval("GrandChildren["+GrandChildCountValue+"].Status") != 'visible') {	

		// Show next drop down

		eval('document.'+DocumentObject+OpenObjBracket+'ChildID+"_lineage"'+CloseObjBracket+'.style.visibility = VisibilityHidden')

	}

	

}



function TargetOutput(URLtoTest) {

	

	TargetValue = ""



	if (URLtoTest.indexOf(".pdf") != -1) {

		TargetValue = " target=&quot;new&quot; "

	}

	

		if ((URLtoTest.indexOf("http") != -1) && (URLtoTest.indexOf("nygh.on.ca") == -1) && (URLtoTest.indexOf("workopolis") == -1)) {

		TargetValue = " target=&quot;new&quot; "

		

	}

	

	return TargetValue

}