



	// Include The Flash Stuff
//	include('/javascript/FlashFunctions.js');

	//Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:
	//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:
	var iframeids=["WinBody"]

	//	Used for highlight functions
	var HL = new Object;

	//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
	var iframehide="no"
	
	//	Set this onload of Iframe if display is cut off bottom - ERA
	var iFrameExtra=0;
	
	var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
	
	var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers

	var IE = document.all?true:false;

	var TimerIntervalObj = new Object;	
	
	var MouseObj = new Object;	
	MouseObj.x = 0;
	MouseObj.y = 0;
	if (!IE) document.captureEvents(Event.MOUSEMOVE)
	document.onmousemove = GetMouseXY;


	include = function (file) {
		  var script  = document.createElement('script');
		  script.src  = file;
		  script.type = 'text/javascript';
		
		  document.getElementsByTagName('head').item(0).appendChild(script);
	}

	//
	//	Get Mouse XY
	//
	function GetMouseXY(e) {

		if (IE) { // grab the x-y pos.s if browser is IE
			tempX = event.clientX + document.body.scrollLeft;
			tempY = event.clientY + document.body.scrollTop;
		}
		else {  // grab the x-y pos.s if browser is NS
			tempX = e.pageX;
			tempY = e.pageY;
		}  
		if (tempX < 0){tempX = 0;}
		if (tempY < 0){tempY = 0;}  
		
		
		MouseObj.x = tempX;
		MouseObj.y = tempY
		
		return true;
	}



	//_____________________________________________________________________________
	//
	//	TRIM
	//
	function Trim(Str) {

		var l = 0;
		var t = 0;
		var f = 0;

		l = Str.length;
		for (t=Str.length-1; t>=0; t--) {
			if (Str.charAt(t) != " ") {
				l = t+1;
				break;
			}
		}
		f = 0;
		for (t=0; t<=Str.length-1; t++) {
			if (Str.charAt(t) != " ") {
				f = t;
				break;
			}
		}
		return Str.substr(f, l-f);
	}
	
	
	//_____________________________________________________________________________
	//
	//  GET TOKEN: Get a value in a delimited str
	//
	function GetToken(Str, Position, FindStr) {

		var	u 	= 0;
		var c   = 0;
		var s   = 0;
		var e   = 0;
		for (var t=0;t<Str.length;t++) {
			c++;
			u = Str.indexOf(FindStr, u + 1);
			if (u == -1) {	// EOL
				e = Str.length - u;
				if (c < Position) {
					Str = '';
					break;
				}
			} else {
				e = u - s;
			}
			if (c == Position) {
				Str  = Str.substr(s, e);
				break;
			}
			s = u + 1;
		}
		return Str;
	}
	
	
	//_____________________________________________________________________________
	//
	//	Return the Number Of Items in a String Listy
	//
	function ListLen(Str, DelStr) {
		if (Str==undefined) {
			return -1;
		}
		var c = Str.split(DelStr);
		return c.length;
	}


	function ShowPage(Page, Target) {
		iFrameExtra=0;
		if (Target==undefined) {
			Target = 'WinBody';
		}
		window.open(Page, Target); 
	}
	
	
	function ResizeCaller() {
		var dyniframe=new Array()
		
		for (i=0; i<iframeids.length; i++){
			if (document.getElementById)
				resizeIframe(iframeids[i])
				//reveal iframe for lower end browsers? (see var above):
			if ((document.all || document.getElementById) && iframehide=="no"){
				var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
				tempobj.style.display="block"
			}
		}
	}
	
	function ResizeIframe(frameid){
		var currentfr=document.getElementById(frameid)
		if (currentfr && !window.opera){
			currentfr.style.display="block"
			if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) { //ns6 syntax
				currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight+iFrameExtra; 
	
				// Menu BackGround
				var MBG = document.getElementById('BGCell');
				MBG.height = Number(currentfr.height) - 50;
		
				//var MBT = document.getElementById('BGTbl');
				//MBT.height = Number(currentfr.height) - 50;
	
			} else if (currentfr.Document && currentfr.Document.body.scrollHeight) { //ie5+ syntax
				currentfr.height = currentfr.Document.body.scrollHeight;
		
				// Menu BackGround
				var MBG = document.getElementById('BGCell');
				MBG.height = Number(currentfr.height);
		
				var MBT = document.getElementById('BGTbl');
				MBT.height = Number(currentfr.height);
			}
			
			if (currentfr.addEventListener)
				currentfr.addEventListener("load", readjustIframe, false)
			else if (currentfr.attachEvent){
				currentfr.detachEvent("onload", readjustIframe) // Bug fix line
				currentfr.attachEvent("onload", readjustIframe)
			}
	
		}
	}
	
	
	function GetWindowSize() {
		var myWidth = 0, myHeight = 0, val = '';
		if ( typeof( window.innerWidth ) == 'number' ) {
			//Non-IE
			myWidth = window.innerWidth;
			myHeight = window.innerHeight;
		} else if ( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
			//IE 6+ in 'standards compliant mode'
			myWidth = document.documentElement.clientWidth;
			myHeight = document.documentElement.clientHeight;
		} else if ( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
			//IE 4 compatible
			myWidth = document.body.clientWidth;
			myHeight = document.body.clientHeight;
		}
		
		val = myWidth + "," + myHeight;
		return unescape(val);
	}
	
	
	function GetWindowHeight() {
		var myWidth = 0, myHeight = 0, val = '';
		if ( typeof( window.innerWidth ) == 'number' ) {
			//Non-IE
			myWidth = window.innerWidth;
			myHeight = window.innerHeight;
		} else if ( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
			//IE 6+ in 'standards compliant mode'
			myWidth = document.documentElement.clientWidth;
			myHeight = document.documentElement.clientHeight;
		} else if ( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
			//IE 4 compatible
			myWidth = document.body.clientWidth;
			myHeight = document.body.clientHeight;
		}
		
		return unescape(myHeight);
	}

	function GetWindowWidth() {
		var myWidth = 0, myHeight = 0, val = '';
		if ( typeof( window.innerWidth ) == 'number' ) {
			//Non-IE
			myWidth = window.innerWidth;
			myHeight = window.innerHeight;
		} else if ( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
			//IE 6+ in 'standards compliant mode'
			myWidth = document.documentElement.clientWidth;
			myHeight = document.documentElement.clientHeight;
		} else if ( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
			//IE 4 compatible
			myWidth = document.body.clientWidth;
			myHeight = document.body.clientHeight;
		}
		
		return unescape(myWidth);
	}
	
	
	
	function ReadjustIFrame(loadevt) {
		var crossevt=(window.event)? event : loadevt
		var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
		if (iframeroot)
			ResizeIframe(iframeroot.id);
	}
	
	function LoadIFrame(iframeid, url){
		if (document.getElementById)
			document.getElementById(iframeid).src=url
		//iframeid.src=url;
		//alert(url);
	}
	
	
	//
	//	Create an HTML Element
	//
	function CreateElement(Owner, ElementID, ElementType, Style) {
		
		//	If Exists Remove
		if (Owner.getElementById(ElementID) != undefined) {
			if (Owner == document) {
				Owner.body.removeChild(Owner.getElementById(ElementID));
			} else {
				Owner.removeChild(Owner.getElementById(ElementID));
			}
		}

		//	Create New Element
		var NewElement = document.createElement(ElementType); // div, span, table, th, td, tr, etc...
		NewElement.id = ElementID;
		
		//	Add To Owner Object
		if (Owner == document) {
			var NE = Owner.body.appendChild(NewElement);
			var vStyle = Owner.getElementById(ElementID).style;
		} else {
			var NE = Owner.appendChild(NewElement);
			var vStyle = Owner.getElementById(ElementID);
		}

		//	Set Style
		for (t=1; t<=ListLen(Style, ';'); t++) {
			var prop = GetToken(Style, t, ';');
			vStyle[Trim(GetToken(prop, 1, ':'))] = Trim(GetToken(prop, 2, ':'));
		}
		
		//	Return Object
		return NE;
		
	}


	function IFrameDefaultContent() {
		
		var Cont = '<html>';
			Cont = Cont + '<head>';
			Cont = Cont + '<title>GalaxyNet Online - Report View</title>';
			Cont = Cont + '	<script language="JavaScript" src="/javascript/prototype.js"></script>';
			Cont = Cont + '	<script language="JavaScript" src="/javascript/Functions.js"></script>';
			Cont = Cont + '</head>';
			Cont = Cont + '<HTML><body STYLE="background-color:transparent" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0">';
		return Cont;
	}

	//
	//
	//
	function WriteIFrame(WindowName, HTML) {
		
		WindowName.document.write(HTML);
																				   
	}


	
	function CreateIFrame(WindowName, IFrameName, Src) {

		WriteHTML(WindowName, '<iframe id="' + IFrameName + '" allowtransparency="true" frameborder="0" style="width:100%; height:100%; z-index:0;" src="' + Src + '" scrolling="no"></iframe>');

	}
	
	//
	//
	//
	function WriteHTML(WindowName, HTML) {
		WindowName.innerHTML = HTML;
	}
	
	
	//
	//
	//
	function WriteJavaScript(WindowName, HTML) {
		WindowName.innerHTML = '<script language="javascript">' + HTML + '</script>';
	}
	//
	//
	//
	function AppendHTML(WindowName, HTML) {
		WindowName.innerHTML = WindowName.innerHTML + HTML;
	}
	
	//
	//
	//
	function PrependHTML(WindowName, HTML) {
		WindowName.innerHTML = HTML + WindowName.innerHTML;
	}
	
	//
	//
	//
	LoadFlashMovieStr = function (WindowName, SWFFile, Width, Height, Version, Transparent) {
		
		if (Version == undefined) {
			Version = '7,0,19,0';
		}

		if (Transparent == undefined) {
			Transparent = 'transparent';
		}
		
		if (FlashCheck(GetToken(Version, 1, ','), GetToken(Version, 2, ','), GetToken(Version, 3, ','))) {
		
			var Str = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="https://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab#version=' + Version + '"';
				Str = Str + '	width="' + Width + '" height="' + Height + '">';
				Str = Str + '	<param name="movie" value="' + SWFFile + '">';
				Str = Str + '	<param name="quality" value="high">';
				Str = Str + '	<param name="wmode" value="transparent">';
				Str = Str + '	<embed ';
				Str = Str + '		src="' + SWFFile + '" ';
				Str = Str + '		quality="high" ';
				Str = Str + '		pluginspage="https://www.macromedia.com/go/getflashplayer" ';
				Str = Str + '		type="application/x-shockwave-flash" ';
				Str = Str + '		width="' + Width + '" ';
				Str = Str + '		height="' + Height + '" ';
				Str = Str + '		wmode="' + Transparent + '">';
				Str = Str + '	</embed>';
				Str = Str + '</object>';
			
			return Str;
		
		}
	
	}
	
	//
	//
	//
	LoadFlashMovie = function (WindowName, SWFFile, Width, Height, Version, Transparent) {

		WriteHTML(WindowName, LoadFlashMovieStr(WindowName, SWFFile, Width, Height, Version, Transparent));
		
	}

	//
	//
	//
	function LoadPDFStr(PDFile, Width, Height, ID) {
		var Str = '<object classid="clsid:CA8A9780-280D-11CF-A24D-444553540000" width="' + Width + '" height="' + Height + '" id="' + ID +'" >';
			Str = Str + '	<param name="SRC" value="' + PDFile + '">';
			Str = Str + '	<embed  ';
			Str = Str + '		id="' + ID + '" ';
			Str = Str + '		src="' + PDFile + '" ';
			Str = Str + '		width="' + Width + '" ';
			Str = Str + '		height="' + Height + '"';
			Str = Str + '		 >';
			Str = Str + '	</embed>';
			Str = Str + '</object>';
		
		return Str;
	}
	
	
		
	//
	//
	//
	function LoadPDF(WindowName, PDFile, Width, Height, ID) {
		WriteHTML(WindowName, LoadPDFStr(PDFile, Width, Height, ID));
	}


	//
	//
	//
	function LoadXLS(WindowName, File, Width, Height) {
		CreateIFrame(WindowName, 'Excel', File);
		//WriteHTML(WindowName, LoadXLSStr(File, Width, Height));
	}


	//
	//
	//
	function LoadDOC(WindowName, File, Width, Height) {
		CreateIFrame(WindowName, 'Doc', File);
		//WriteHTML(WindowName, LoadXLSStr(File, Width, Height));
	}


	//
	//	Create an HTML Element and Fetch a URL
	//
	function GetHTTPNewWindow(Owner, ElementID, ElementType, Style, HTTP, LoadingMSG ) {
		GetHTTP(CreateElement(Owner, ElementID, ElementType, Style), HTTP, LoadingMSG);
	}
	

	//
	//	Fetch a URL and Insert Content into Window Name
	//	If WindowName = '' Just Return Content
	//
	function GetHTTP(WindowName, HTTP, LoadingMSG, onComplete, Append) {

		var xmlhttp;

		if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
			try {
				xmlhttp = new XMLHttpRequest();
			}	 
			catch (e) {
				alert("Your browser is not supporting XMLHTTPRequest");
				return false;
			}
		} else {
			xmlhttp = (window.XMLHttpRequest)? new XMLHttpRequest(): new ActiveXObject("Microsoft.XMLHTTP");
				//new ActiveXObject("Microsoft.XMLHTTP");
		}
	

		var request = xmlhttp;
		request.open("GET", HTTP); 
		
		request.onreadystatechange = function() {

			if(request.readyState == 1) {
				if (!Append) {
					if (LoadingMSG == undefined) {
						WindowName.innerHTML = 'Loading...';
					} else {
						WindowName.innerHTML = LoadingMSG;
					}
				}
			}
			if(request.readyState == 4) {
				if (request.status == 200) { 

					if (WindowName!='') {
						if (Append==true) {
							AppendHTML(WindowName, request.responseText);
						} else {
							WriteHTML(WindowName, request.responseText);
						}
					}

					if (onComplete!=undefined) {
						onComplete(request.responseText);
					} 
					
					request = undefined;
					
					//} else {
					///	var ret = request.status;
					//	request = undefined
					//	return ret;
					//}
				} else {
					alert('Background Load Error: ' + HTTP + ' [ ' + request.status +' ]');
				}
				request = undefined;
			}
			
		} 
		
		request.send(null); 
	}
	
	
	//
	//
	//
	function IsDefined(Obj)	{
		try {
			eval(Obj);
			return true;
		} catch(err) {
			return false;
		} 
		
	}
 


	
	//
	//
	//
	GetHTTPAJAX =  function (WindowName, HTTP, Params) {

		OnFailed = function (request) {
			alert('Background Load Error: ' + HTTP + ' [ ' + request.status +' ]');
		}
		
		if (IsDefined('Params.onAJaxFail')) {
			OnFailed = Params.onAJaxFail;
		}

		
		try {
			WindowName.innerHTML = Params.LoadingMSG;
		} catch(err) {
			WindowName.innerHTML = 'Loading...';	
		} 
		
	
		try { 
			return new Ajax.Updater(WindowName, HTTP, {asynchronous:true, evalScripts:true, method:'get', onFailure:OnFailed, onComplete:Params.OnSuccess});
		} catch(err) {
			return new Ajax.Updater(WindowName, HTTP, {asynchronous:true, evalScripts:true, method:'get', onFailure:OnFailed});
		}
		
	}



	//
	//
	//
	function PeriodicalHTTPAJAX(WindowName, HTTP, Params) {

		OnFailed = function (request) {
			alert('Background Load Error: ' + HTTP + ' [ ' + request.status +' ]');
		}
		
		if (IsDefined('Params.onAJaxFail')) {
			OnFailed = Params.onAJaxFail;
		}

		if (IsDefined('Params.LoadingMSG')) {
			WindowName.innerHTML = Params.LoadingMSG;			
		} else {
			WindowName.innerHTML = 'Loading...';
		}

		if (IsDefined('Params.OnSuccess')) {
			aj = new Ajax.PeriodicalUpdater(WindowName, HTTP, {asynchronous:true, evalScripts:true, method:'get', onFailure:OnFailed, onComplete:Params.OnSuccess, frequency:Params.Freq});
			return  aj;
		} else {
			aj = new Ajax.PeriodicalUpdater(WindowName, HTTP, {asynchronous:true, evalScripts:true, method:'get', onFailure:OnFailed, frequency:Params.Freq});
			return aj;
		}
		
	}



	//
	//
	//
	function GetHTTPAJAXNewWindow(Owner, ElementID, ElementType, Style, HTTP, onAJaxSuccess, LoadingMSG) {
		
		GetHTTPAJAX(CreateElement(Owner, ElementID, ElementType, Style), HTTP, onAJaxSuccess, LoadingMSG);
		
	}

	
	//
	//
	//
	function GetObject(Name) {
		return document.all? document.all[Name] : document.getElementById(Name);
	}

	//
	//	New Window
	//
	function NewWindow(Url, WindowName, w, h, WindowParams) {
		if (WindowParams==undefined) {
			WindowParams = 'resizable=1,menubar=0,scrollbars=1,toolbar=0';
		}
		cal = window.open(Url, WindowName, WindowParams);
		//cal.window.resizeTo(parent.document.body.clientWidth - 10, parent.document.body.clientHeight - 10);
		if (w!=undefined && h!= undefined) {
			cal.window.resizeTo(w, h);
		}
		cal.window.focus();
		if (cal != null) {
			if (cal.opener == null) {
				cal.opener = self;
			}
		}
		
		//cal.window.moveTo((cal.window.screen.availWidth / 2) - (cal.document.body.clientWidth / 2), (cal.window.screen.availHeight / 2) - (cal.document.body.clientHeight / 2));
	}
	
	//
	//	Resize Window - SELF
	//
	function ResizeThisWindow(w, h, resizable) {
		if (w.indexOf('%') > 0) {
			w = GetToken(w, 1, '%') * 0.01;
			w = self.window.screen.availWidth * w;
		}
		if (h.indexOf('%') > 0) {
			h = GetToken(h, 1, '%') * 0.01;
			h = self.window.screen.availHeight * h;
		}
		if (resizable==undefined) {
			//resizable
		}
		 self.window.resizeTo(w, h);
		 self.window.moveTo((self.window.screen.availWidth / 2) - (w / 2), (self.window.screen.availHeight / 2) - (h / 2));
		 
	}


	//
	//	Show or Hide Tool Bar
	//
	function ShowToolBars(show) {
		alert(window.menubar.visible);
		//self.window.menubar.visible = show;
	}
	
	
	//
	// Retrive a specific URL parameter
	// else return all URL parameters
	//
	function getURLParameterVal(param) {

		var val = "";
		var qs = window.location.search;
		var start = qs.indexOf(param);
		
		if (start != -1) {
			start += param.length + 1;
			var end = qs.indexOf("&", start);
			if (end == -1) {
				end = qs.length
			}
			val = qs.substring(start,end);
		}
		return val;
	}
	
	
	//
	//	Show / Hide Table Column
	//
	
	function ShowTableColumn(tableid, colno, show) {

		var stl;
		
		if (show) 
				stl = ''
		else    stl = 'none';
	
		var tbl  = document.getElementById(tableid);
		var rows = tbl.getElementsByTagName('tr');
	
		for (var row=0; row<rows.length;row++) {
		  var cels = rows[row].getElementsByTagName('td')
		  try {
			  cels[colno].style.display=stl;
		  } catch(err) {
		  }
		}
		
	  }


	
	
	//
	//	HIGHLIGHT -- Handles Mouse Over for a given containter
	//	Pass Color as '#AAAAAAA' or CSS ClassName 
	//
	function MouseOverHighlight(Obj, ContID, Color, ToolTip) {

		//  Save Original Color and Set New Color
		if (Color.substring(0, 1) != '#') {
			HL[ContID+'MO'] = Obj.className; 
			Obj.className   = Color;
		} else {  
			HL[ContID+'MO'] = Obj.bgColor;
			Obj.bgColor     = Color;
		}
		
		ShowToolTip(Obj, ToolTip, true);
		
	}

	//
	//	RESET -- Handles Mouse Over for a given containter
	//
	function MouseOutHighlight(Obj, ContID) {
		
		ShowToolTip(Obj, '', false);
		
		//	If on the already selected item do nothing
		if (HL[ContID] == Obj) {
			//	Set Back to Selected Color
			if (HL[ContID+'LastSelectColor'].substring(0, 1) != '#') {
				Obj.className = HL[ContID+'LastSelectColor'];
			} else {
				Obj.bgColor   = HL[ContID+'LastSelectColor'];
			}
			return
		}
		
	
		//	Set Color
		if (HL[ContID+'MO'].substring(0, 1) != '#') {
			Obj.className = HL[ContID+'MO'];
		} else {
			Obj.bgColor   = HL[ContID+'MO'];
		}
	}
	
		
	//
	//	SELECTED -- Handles Keeping the Object Highlighted even when MouseOut Occurs
	//
	function MouseClickHighlight(Obj, ContID, Color, CanReset, ResetTo) {

		if (HL[ContID] != undefined) {
			
			// Reset Color on Previous Clicked Item
			if (HL[ContID+'LastColor'].substring(0, 1) != '#') {
				HL[ContID].className = HL[ContID+'LastColor'];
			} else {
				HL[ContID].bgColor   = HL[ContID+'LastColor'];
			}
	
		}
	
		//	Remember this Obj so it can be reset when another item is clicked
		HL[ContID] = Obj;
		
		// 	Save Last Class Name
		//	HL[ContID+'MO'] Should Be Set By MouseOver Func
		HL[ContID+'LastColor'] = HL[ContID+'MO'];
		
		//	Set Color IF Defined ELSE we use the color already set by MouseOverHighlight func
		if (Color != undefined) {
			if (Color.substring(0, 1) != '#') {
				Obj.className   = Color;
			} else {  
				Obj.bgColor     = Color;
			}
			
			HL[ContID+'LastSelectColor'] = Color;
		}
		
	}


	//
	//	Create HOVER -- TOOLTIP
	//
	function ShowToolTip(HoverObj, Text, Show, ClassName) {
		
		try {
			
			if (Show && Text != undefined) {
				//	Name a Div Tag appToolTip		
				appToolTip.style.top = MouseObj.y - 60;
				appToolTip.style.left = MouseObj.x;
				
				if (ClassName==undefined) {
					ClassName = 'ToolTip';
				}
				
				appToolTip.className = ClassName;
				WriteHTML(appToolTip, Text);
				appToolTip.style.display = '';
				
			} else {
				appToolTip.style.display = 'none';
			}
			
		}	 
		catch (e) {
			return false;
		}

	}

	
	
	//
	//	SELECTED -- Handles Keeping the Object Highlighted even when MouseOut Occurs
	//
	function ShowDivController(DivObj, ControlID) {

		if (HL[ControlID] != undefined) {
			
			// Reset Previous Div
			HL[ControlID].style.display='none';

		}
	
		//	Remember this Obj so it can be reset when another item is clicked
		HL[ControlID] = DivObj;
		HL[ControlID].style.display='';
		
	}
	
	
	
	//________________________________________________________________________________
	//
	//	EXECUTE A FUNCTION AFTER MILISECS
	//
	function ExecuteFunctionAfter(func, timing, Param1, Param2, Param3, Param4) {
		Obj = new Object();
		Obj.Interval= setInterval(func, timing, Obj, Param1, Param2, Param3, Param4);
		return Obj;
	}
	
	
	
	//________________________________________________________________________________
	//
	//	EXECUTE A FUNCTION AFTER MILISECS
	//
	function ExecuteFunctionOnceAfterCall(func, Obj, Param1, Param2, Param3, Param4) {
		alert(Param1);
		clearInterval(Obj.Interval);
		func(Param1, Param2, Param3, Param4);
	}
	
	
	
	//________________________________________________________________________________
	//
	//	EXECUTE A FUNCTION AFTER MILISECS
	//
	function ExecuteFunctionOnceAfter(func, timing, Param1, Param2, Param3, Param4) {
		Obj = new Object();
		Obj.Interval = setInterval('ExecuteFunctionOnceAfterCall(func, Obj, Param1, Param2, Param3, Param4)', timing);
		return Obj;
	}
	
	
	
	//
	//	Get Object Value from an ID
	//
	function GetID(ObjStr, DefaultValue, Parent) {
		
		if (typeof(ObjStr) == 'object') {
			return 	ObjStr;
		}
		
		try {
			if (Parent != undefined) {
				Obj = Parent.document.getElementById(ObjStr);
			} else {
				Obj = document.getElementById(ObjStr);
			}
			if (Obj == null) {
				Obj = undefined;
			}
			return Obj
		} catch(e) {
			
			return DefaultValue;
		}
	}



