
/**********************************************
***				Global Variables			***
**********************************************/
//alert("here");
//alert(typeof( window[ 'ThisMenuName' ] ));
if ( typeof( window[ 'ThisMenuName' ] ) == "undefined" ) { //Load once.
	DevRoot = "/Olesen";
	ThisMenuName = "Home.html";
	ThisSubMenuId = "";
	
	//Colors for Text Links
	TopNavOnColor = "#DDDDDD";
	TopNavSelectedColor = "#000000";
	TopNavOffColor = "#FFFFFF";
	
	//Read Page Name.
	//oStageFrame = document.getElementById('StageFrame');
	ThisPage = GetFileNameFromPath(location.href);
	IFrameLoaded = false;
	
	Global_aDivContainer = "";
	Global_aURL = "";
	Global_ix = "";
	
	//Growable Frame Name
	GrowableFrameName = "BodyFrame";

	//List to not include in "wait for load" function
	DontWaitList = "navheaderframe,navframe,fromexchangeframe";
	
}
if(!FindObjById('GlobalDiv')){
	var gDiv = document.createElement('div');
	gDiv.setAttribute("LoadingPages", "");
	gDiv.style.display = 'none';
	gDiv.style.height = '0px';
	gDiv.style.width = '0px';
	var Body = document.getElementsByTagName('body').item(0);

	/*
	var oBody = this;
	if(top.document.body)
		oBody = top.document.body;
	//alert(oBody);
	*/
	if(Body)
		Body.appendChild(gDiv);
	if(document.all.Body)
		document.all.Body.appendChild(gDiv) // IE only

}

/*******	End of Global Variables		*******/


/**********************************************
***			Javascrit File Loader			***
**********************************************/
if (typeof(km_scripts) == 'undefined') var km_scripts = new Object();

km_myclass_import(DevRoot+'/Scripts/BrowserDetect.js');
km_myclass_import(DevRoot+'/Scripts/BrowserLayoutFixes.js');
km_myclass_import(DevRoot+'/Scripts/PngFix.js');
km_myclass_import(DevRoot+'/Scripts/AC_RunActiveContent.js');
km_myclass_import(DevRoot+'/Scripts/689Design.js');
km_myclass_import(DevRoot+'/Scripts/689Nav.js');
km_myclass_import(DevRoot+'/Scripts/Forms.js');
km_myclass_import(DevRoot+'/Scripts/Olesen.js');

/*
inc("../Scripts/BrowserDetect.js");
inc("../Scripts/BrowserLayoutFixes.js");
inc("../Scripts/PngFix.js");
inc("../Scripts/689Design.js");
inc("../Scripts/AC_RunActiveContent.js");
inc("../Scripts/689Nav.js");
inc("../Scripts/Sunset.js");
*/

/******	End of Javascrit File Loader	*******/

//Get the page name.
if(FindObjById(GrowableFrameName))
	ThisPage = GetFileNameFromPath(FindObjById(GrowableFrameName).src);
//alert(ThisPage);


function inc(filename){
	var body = document.getElementsByTagName('body').item(0);
	script = document.createElement('script');
	script.src = filename;
	script.type = 'text/javascript';
	body.appendChild(script)
}


/* several more functions that call functions in the above two files */
function blah (foo)
{
if (isBlank(foo)) return false;
}




function km_myclass_import(jsFile) {
	//alert("km_scripts["+jsFile+"]="+km_scripts[jsFile]);
if (km_scripts[jsFile] != null) return;
var scriptElt = document.createElement('script');
scriptElt.type = 'text/javascript';
scriptElt.src = jsFile;
document.getElementsByTagName('head')[0].appendChild(scriptElt);
km_scripts[jsFile] = jsFile; // or whatever value your prefer
}


function ImportScript(jsFile){


newJS = document.createElement('script');
newJS.type='text/javascript';
newJS.src=jsFile;
document.getElementsByTagName('head')[0].appendChild(newJS);

}


function GetFileNameFromPath(Path){
	var MyArray = Path.split("/");
	if(MyArray[MyArray.length-1].toLowerCase().split("?")[0].length)
		return MyArray[MyArray.length-1].toLowerCase().split("?")[0];
	return "index.html";
}

function FindObjById(id){
	if(document.getElementById(id))
		return document.getElementById(id);
	if(parent.document.getElementById(id))
		return parent.document.getElementById(id);
	if(parent.parent.document.getElementById(id))
		return parent.parent.document.getElementById(id);
	if(top.document.getElementById(id))
		return top.document.getElementById(id);
	if((window.opener) && (window.opener.document.getElementById(id)))
		return window.opener.document.getElementById(id);
	//Check IFrames for Object
	if(top.document.getElementsByTagName('iframe')){
		var oMyIframes = top.document.getElementsByTagName('iframe');
		for(var ix=0; ix < oMyIframes.length; ix++){
			if(top.eval(oMyIframes[ix].id).document.getElementById(id))
				return top.eval(oMyIframes[ix].id).document.getElementById(id);
		}
	}
	return null;
}


//if(navigator.userAgent.toLowerCase().indexOf('msie') != -1){window.attachEvent("onload", RemoveMeFromLoadList);}else{addOnloadEvent(RemoveMeFromLoadList);}



