 

	//
	//	Global IFrame Resize Code
	//
	
		//
		//	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"]
		
		//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;
	

	//
	//	Global Flash Vars :: Defined by Adobe
	//
	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


	//
	//	Used for highlight functions
	//
	var HL = new Object;
	
	
	//
	//	Global Use for Mouse Positions
	//
	var GetMouseX = 0;
	var GetMouseY = 0;
		
	//
	//	Global for GalaxyNet Menus
	//
	GN_Menu 	 = new Object();		
	GN_Menu.Page = new Object();
	

	//
	//	Global  Used by Drag Drop Functions
	//
	var mouseover = true; 
	var DragDropObject;
	
	
	//
	//	Browser Check
	//
	var IE = (navigator.appVersion.match(/\bMSIE\b/) == 'MSIE');
	
	
	
	//	Get Object Value from an ID
	//
	function GetID(ObjStr) {
		try {
			return document.getElementById(ObjStr);
		} catch(e) {
			return undefined;
		}
	}

	//	Get Object Value from an ID
	//
	function IfVarExists(ObjStr) {
		
		try {
			var t = document.getElementById(ObjStr);
			return true;
		} catch(e) {
			return false;
		}
	}
	
		
	
	//
	//
	//
	var LastWaitDiv;
	var LastModalDiv;
	

	//
	//	Get Object Value from an ID
	//
	function GetNode(ParentObject, ObjStr) {
		
		return ParentObject.getAttributeNode(ObjStr);
		
	}

	


	//_____________________________________________________________________________
	//
	//	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) {
		
		if (Page == '') { return }
		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 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, AllowScroll) {
		if (AllowScroll == undefined){
			AllowScroll = "no";
		}
		WriteHTML(WindowName, '<iframe id="' + IFrameName + '" allowtransparency="true" frameborder="0" style="width:100%; height:100%; z-index:0;" src="' + Src + '" scrolling="' + AllowScroll + '"></iframe>');

	}
	
	//
	//
	//
	function WriteHTML(WindowName, HTML) {
		WindowName.innerHTML = HTML;
	}
	
	
	//
	//
	//
	function AppendHTML(WindowName, HTML) {
		WindowName.innerHTML = WindowName.innerHTML + HTML;
	}
	
	//
	//
	//
	function PrependHTML(WindowName, HTML) {
		WindowName.innerHTML = HTML + WindowName.innerHTML;
	}
	
	//
	//
	//
	function LoadFlashMovieStr(WindowName, SWFFile, Width, Height, Version, Secure, SWFName) {

		if (Width == undefined) {
			Width = '100%';
		}
		if (Height == undefined) {
			Height = '100%';
		}

		if (Version == undefined) {
			Version = '7,0,19,0';
		}
		
		if (Secure == undefined) {
			Secure = 's';
		}
		
		if (SWFName == undefined) {
			SWFName = 'ABC';
		}
		
		var Str = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http' + Secure + '://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + Version + '"';
			Str = Str + '	width="' + Width + '" height="' + Height + '" id="' + SWFName + '">';
			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="http' + Secure + '://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;

	}
	
	//
	//
	//
	function LoadFlashMovie(WindowName, SWFFile, Width, Height, Version, Secure, SWFName) {

		WriteHTML(WindowName, LoadFlashMovieStr(WindowName, SWFFile, Width, Height, Version, Secure, SWFName));
		
	}

	//
	//
	//
	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); 
	}
	
	//
	//
	//
	GetHTTPAJAX = function(WindowName, HTTP, onAJaxSuccess, LoadingMSG, PostText) {
		
		
		if (WindowName==undefined) {
			alert('Developer: Your WindowName ID Object has not been Defined :: ' + window.location.hostname + window.location.pathname + window.location.search + ' :: ' + HTTP);
			return false;
		}
		

		AJaxFailed = function (request) {
			alert('Background Load Error: ' + HTTP + ' [ ' + request.status +' ]');
		}

	
		if (LoadingMSG=='') {
			// Do Nothing
		} else {
			if (typeof(LoadingMSG) != 'string' && eval(LoadingMSG) == undefined) {
				WindowName.innerHTML = 'Loading...';
			} else {
				WindowName.innerHTML = LoadingMSG;
			}
		}
		
		me = 'get';
		ct = undefined;
		
		if (PostText != undefined) {
			me = 'post';
			ct = 'application/x-www-form-urlencoded';
		}
		
		//
		//  Forces NO Caching
		//
		
		if (HTTP.indexOf('?') > -1) {
			HTTP += '&' + String(new Date());
		 } else {
			HTTP += '?' + String(new Date());
		 }

		if (onAJaxSuccess != undefined) {
			new Ajax.Updater(WindowName, HTTP, {asynchronous:true, evalScripts:true, method:me, onFailure:AJaxFailed, onComplete:onAJaxSuccess, parameters:PostText, contentType:ct});
		} else {
			new Ajax.Updater(WindowName, HTTP, {asynchronous:true, evalScripts:true, method:me, onFailure:AJaxFailed, parameters:PostText, contentType:ct});
		}
		
	}
	
	//
	//
	//
	function GetHTTPAJAXNewWindow(Owner, ElementID, ElementType, Style, HTTP, onAJaxSuccess, LoadingMSG) {
		
		GetHTTPAJAX(CreateElement(Owner, ElementID, ElementType, Style), HTTP, onAJaxSuccess, LoadingMSG);
		
	}

	
	
	//
	//
	//
	function ToggleDisplay(ObjID, Set, Style) {
			
		if (typeof(ObjID) == 'string') {
			ObjID = GetID(ObjID);	
		}
		
		if (Style == undefined) {
			Style = '';
		}
		
		if (ObjID.style.display.toUpperCase() == 'NONE') {
			var NSet = Style;
		} else {
			var NSet = 'none';
		}
		
		if (Set == undefined) {
			Set = NSet;	
		}
											
		ObjID.style.display = Set;
	}

	
	//
	//
	//
	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) {
		
		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;
		}
		
		
		
		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);
			
		}
		
		//alert(val);
		return val;
	}
	
	
	//
	// Retrive a specific COOKIE parameter
	// else return all COOKIE parameters
	//
	function getCookieParameterVal(param) {
	
		var val = "";
		var qs = document.cookie;
		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);
		}
		
		//alert(val);
		return unescape(val);
	}
	

	//
	// Read Cookie for Background image. If cookie doesn't exist, use
	// the default image.
	//
	function getBGImageForPage(ImgDivID) {
		
		var theBGImage		= getCookieParameterVal("BGIMAGE");		
		var theBGLoc		= "https://online.travelinc.com/gnr/Images/bg/";
		
		if (theBGImage == '' || theBGImage == 'undefined') {
			// Not defined, use default
			theBGImage	= "GalaxyBG_02.jpg"
			theBGLoc	= "https://online.travelinc.com/gnr/Images/"
		}
		
		theBGImage	= theBGImage.toLowerCase();
		theBGLoc	= theBGLoc.toLowerCase();
		
		if (theBGImage.substring(0,4) == 'http') {
			theBGLoc = '';
		}
		
		// Set image
		var main_image = new Image();
		if (theBGLoc == '') {
			main_image.src = theBGImage;
		} else {
			main_image.src = theBGLoc + theBGImage;
		}
		//alert('.' + theBGLoc + '.' + theBGImage + '.');
		ImgDivID.src = main_image.src;
	}
	
	//
	// This will check the size of the window and return
	// the width and height in a comma delimited value
	// which can then either be used with an Array or
	// GetToken(Str, POS, FindStr) which in this case is
	// GetToken(val, 1, ",") for width or
	// GetToken(val, 2, ",") for height
	//
	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 GetObjectHeight(Obj, OrHeight) {

	if (Obj.style.height!=undefined) {
			
			return Obj.style.height
			
		} else {
		
			return OrHeight;
			
		}
	}

	function GetObjectWidth(Obj, OrWidth) {
		
		if (Obj.style.width!=undefined) {
			
			return Obj.style.width
			
		} else {
		
			return OrWidth;
			
		}


	}
	

	

	
	//=====================================
	// REPLACE STR: Replace Str function
	//=====================================
	function ReplaceStr(Str, FindStr, ReStr) {
	
		var UStr = Str.toUpperCase();
		var u = 0;
		
		FindStr = FindStr.toUpperCase();
		u = 0;
		for (var t=0;t<Str.length;t++) {
			if (u==0) {
				u = UStr.indexOf(FindStr);
			} else {
				u = UStr.indexOf(FindStr, u - FindStr.length);
			}
			if (u == -1) {
				break;
			}
			UStr = UStr.substr(0, u) + ReStr + UStr.substr(u + FindStr.length, UStr.length);
			Str = Str.substr(0, u) + ReStr + Str.substr(u + FindStr.length, Str.length);
			t += ReStr.length;
		}
		return Str;
	}
	
	//===================================
	// This will encode or unencode HTML
	//===================================
	function EUhtml(type, str) {
		if (type == 'E') {
			return escape(str);
		}
		if (type == 'U') {
			return unescape(str);
		}
	}
	
	
	
	//
	//	Target Content
	//	Takes innerHTML Content from one ID to Another ID Tag
	//
	function TargetContent(FromID, ToID, Method) {
		var Str;

		Str = FromID.innerHTML;
		
		if (Method.toUpperCase()==undefined) {
			Method = "APPEND";
		}
		
		if (Method.toUpperCase()=="OVERWRITE") {
			FromID.innerHTML = '';
			try {
				FromID.style.display = 'none';
			} catch(e) {}
			ToID.innerHTML 	 = Str;
		}
		
		if (Method.toUpperCase()=="MOVE") {
			FromID.innerHTML = '';
			ToID.innerHTML 	 = Str;
		}
		
		if (Method.toUpperCase()=="OVERWRITEONLY") {
			ToID.innerHTML 	 = Str;
		}
		
		if (Method.toUpperCase()=="APPEND") {
			FromID.outerHTML = '';
			try {
				FromID.style.display = 'none';
			} catch(e) {}
			ToID.innerHTML 	 = ToID.innerHTML + Str;
		}
		
		if (Method.toUpperCase()=="APPENDOUT") {
			Str = FromID.outerHTML;
			FromID.outerHTML = '';
			try {
				FromID.style.display = 'none';
			} catch(e) {}
			ToID.innerHTML 	 = ToID.innerHTML + Str;
		}
		if (Method.toUpperCase()=="APPENDONLY") {
			ToID.innerHTML 	 = ToID.innerHTML + Str;
		}
		

	}
	
	
	

	function StripCharacter(words,character) {
		//documentation for this script at http://www.shawnolson.net/a/499/
		var spaces = words.length;
		for(var x = 1; x<spaces; ++x){
			words = words.replace(character, "");   
		}
		return words;
	}
	
	

	function ChangeClassValue(theClass,element,value) {
		var cssRules;
		
		if (document.all) {
			cssRules = 'rules';
		} else if (document.getElementById) {
			cssRules = 'cssRules';
		}
		for (var S = 0; S < document.styleSheets.length; S++){
			for (var R = 0; R < document.styleSheets[S][cssRules].length; R++) {
				if (document.styleSheets[S][cssRules][R].selectorText == theClass) {
					document.styleSheets[S][cssRules][R].style[element] = value;
				}
			}
		}	
	}



	function CheckUncheckAll(theElement) {
		var theForm = theElement.form, z = 0;
			for(z=0; z<the.length;z++){
				if(theForm[z].type == 'checkbox' && theForm[z].name != 'checkall') {
					theForm[z].checked = theElement.checked;
				}
			}
	}
	
	
	
	function checkUncheckSome(controller,theElements) {
	
		// theElements is an array of objects designated as a comma separated list of their IDs
		// If an element in theElements is not a checkbox, then it is assumed
		// that the function is recursive for that object and will check/uncheck
		// all checkboxes contained in that element
		
		
		var formElements = theElements.split(',');
		var theController = document.getElementById(controller);
		
		for(var z=0; z<formElements.length;z++){
			theItem = document.getElementById(formElements[z]);
			if(theItem){
				
				if(theItem.type){
					if(theItem.type == 'checkbox' && theItem.id != theController.id){
						theItem.checked = theController.checked;
					}
				} else {
					
					var nextArray = '';
					
					for(var x=0;x <theItem.childNodes.length;x++){
						if(theItem.childNodes[x]){
							if (theItem.childNodes[x].id){
						  		nextArray += theItem.childNodes[x].id+',';
							}
					  	}
					 }
					 
					 checkUncheckSome(controller,nextArray);
				}
			}
		}
	}

	
	
	
	function ChangeImgSize(objectId,newWidth,newHeight) {
		
		imgString = 'theImg = document.getElementById("'+objectId+'")';
		
		eval(imgString);
		
		oldWidth = theImg.width;
		oldHeight = theImg.height;
		
		if(newWidth>0){
			theImg.width = newWidth;
		} 
		if(newHeight>0){
			theImg.height = newHeight;
		} 
	
	}
	
	function changeColor(theObj,newColor){
	  eval('var theObject = document.getElementById("'+theObj+'")');
	  if(theObject.style.backgroundColor==null){theBG='white';}else{theBG=theObject.style.backgroundColor;}
	  if(theObject.style.color==null){theColor='black';}else{theColor=theObject.style.color;}
	  //alert(theObject.style.color+' '+theObject.style.backgroundColor);
      switch(theColor){
	    case newColor:
		  switch(theBG){
			case 'white':
		      theObject.style.color = 'black';
		    break;
			case 'black':
			  theObject.style.color = 'white';
			  break;
			default:
			  theObject.style.color = 'black';
			  break;
		  }
		  break;
	    default:
		  theObject.style.color = newColor;
		  break;
	  }
	}





		
	//
	//
	//	
	function GetMouseCoords(e)	{
		
		alert(2);
		 if (!e) e = window.event; // works on IE, but not NS (we rely on NS passing us the event)

		  if (e)
		  { 
			if (e.pageX || e.pageY)
			{ // this doesn't work on IE6!! (works on FF,Moz,Opera7)
			  GetMouseX = e.pageX;
			  GetMouseY = e.pageY;
			  algor = '[e.pageX]';
			
			  if (e.clientX || e.clientY) algor += ' [e.clientX] '
			}
			else if (e.clientX || e.clientY)
			{ // works on IE6,FF,Moz,Opera7
			  GetMouseX = e.clientX + document.body.scrollLeft;
			  GetMouseY = e.clientY + document.body.scrollTop;
			  algor = '[e.clientX]';
			  if (e.pageX || e.pageY) algor += ' [e.pageX] '
			}  
		  }

	}
	
	
	//
	//
	//
	MoveObjectToMouse = function(DivObj, BottomOffSet) {
			
		xHeightVal 			= GetWindowHeight();
		xDiffVal   			= xHeightVal - GetMouseY;
		DivObj.style.left	= GetMouseX;
		
		if (BottomOffSet==undefined) {
			BottomOffSet = 100;
		}
		
		if (xDiffVal <= BottomOffSet) {
			// This will move the popup div from disappearing off the page
			// The popup will appear above the mouse
			DivObj.style.top				= GetMouseY - BottomOffSet;
			
		} else {
			// The popup will appear below the mouse
			DivObj.style.top				= GetMouseY;
			
		}
		
	
	}
	
	
	
	
	//
	//	Create Sub Window
	//
	CreateSubWindow = function(NewIDName, ParentObject, WindowProperties) {
		/*
			WindowProperties {  // All Optional
			 	WindowStyle:
				WindowClass:
			  	TitleStyle:
				TitleClass:
			  	ContentStyle:
				ContentClass:
				AjaxUrl:
				AjaxOnSuccess:
				AjaxFormValue:
				IFrameUrl:
				IFrameStyle:
				IFrameClass:
				IFrameMaxWidth:
				IFrameMaxHeight:
				IFrameOnSuccess:
				LoadingMessage:
				LoadingStyle:
				LoadingClass:
				TitleContent:
				BodyContent:
				BtnMaximize:
				BtnClose:
				BtnMinimize:
				Width:
				Height:
				Top:
				Left:
				OnWindowClose: Function
				OnWindowCloseOk: Function
			}
		
		*/
	
	
		var StrWinID = "Window" + NewIDName;
		var SubStrWinID = "SubWindow" + NewIDName;
	
		//undefined, {Url:'https://services.travelinc.com/ui/ptp/cf/AJAX_EMailForm.cfm'});
		if (WindowProperties==undefined) {
			WindowProperties = new Object();					
		}
		

		if (WindowProperties.ShadowStyle==undefined) {

			WindowProperties.ShadowStyle = "filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#66DDDDDD', EndColorStr='#99999999');";
		}

		if (WindowProperties.ShadowStyle==undefined) {

			WindowProperties.ShadowStyle = '';
		}


		if (WindowProperties.WindowStyle==undefined) {

			WindowProperties.WindowStyle = "text-align:left; z-index:1000;position:absolute; width:200; ";
			WindowProperties.WindowStyle = WindowProperties.WindowStyle + "font-family:Arial, Helvetica, sans-serif; font-size:12px; padding: 8;";
			WindowProperties.WindowStyle = WindowProperties.WindowStyle + "background-color:#E0ECFF;";
			
			WindowProperties.WindowStyle = WindowProperties.WindowStyle + "border-color:#999999; border-width:1; border-style:solid; ";
			WindowProperties.WindowStyle = WindowProperties.WindowStyle + "border-top-color:#DDDDDD; border-top-width:1; border-top-style:solid; ";
			WindowProperties.WindowStyle = WindowProperties.WindowStyle + "border-left-color:#DDDDDD; border-left-width:1; border-left-style:solid; ";
		}

		if (WindowProperties.WindowClass==undefined) {

			WindowProperties.WindowClass = '';
		}


		if (WindowProperties.TitleContent==undefined) {

			WindowProperties.TitleContent = '';
		}
		
		var TitleHTML  			= '';
		var IFrameHTML 			= '';
		var TitleButtons		= '';
		var StyleMaximizeBtn 	= 'display:none';
		var StyleCloseBtn 	 	= 'display:none';
		var StyleNormalizeBtn 	= 'display:none';
		var StyleMinimizeBtn 	= 'display:none';


		if (WindowProperties.BtnMaximize  == true) {
			StyleMaximizeBtn = 'display:inherit';
		}
		if (WindowProperties.BtnClose  == true) {
			StyleCloseBtn = 'display:inherit';
		}
		if (WindowProperties.BtnNormalize == true) {
			StyleNormalizeBtn = 'display:inherit';
		}
		if (WindowProperties.BtnMinimize == true) {
			StyleMinimizeBtn = 'display:inherit';
		}
		

		if (IE==true) {
			TitleButtons = TitleButtons + '<div id="' + StrWinID + 'Buttons" style="display:inline; position:absolute; white-space:nowrap;"><span id="' + StrWinID + 'btnTable">';
		} else {
			TitleButtons = TitleButtons + '<div id="' + StrWinID + 'Buttons" style="position:absolute; display:table-cell; width:100;"><table id="' + StrWinID + 'btnTable"><tr><td>';
		}
		TitleButtons = TitleButtons + '<img id="' + StrWinID + 'MinimizeBtn" 	src="/UI/Images/Windows/Window_MinimizeBtn.png"   hspace="1" title="Minimize" onclick="' + StrWinID + '.MinimizeWindow()"  		style=" cursor:pointer; ' + StyleMinimizeBtn + '">'
		TitleButtons = TitleButtons + '<img id="' + StrWinID + 'NormalizeBtn" 	src="/UI/Images/Windows/Window_NormalizeBtn.png"  hspace="1" title="Restore Down" onclick="' + StrWinID + '.NormalizeWindow()"  style=" cursor:pointer;'  + StyleNormalizeBtn + '">'
		TitleButtons = TitleButtons + '<img id="' + StrWinID + 'MaximizeBtn" 	src="/UI/Images/Windows/Window_MaximizeBtn.png"   hspace="1" title="Mazimize" onclick="' + StrWinID + '.MaximizeWindow()"  		style=" cursor:pointer; ' + StyleMaximizeBtn + '">'
		TitleButtons = TitleButtons + '<img id="' + StrWinID + 'CloseBtn" 		src="/UI/Images/Windows/Window_CloseBtn.png"      hspace="1" title="Close" onclick="' + StrWinID + '.CloseWindow()" 			style=" cursor:pointer; ' + StyleCloseBtn + '">'
		TitleButtons = TitleButtons + '</td></tr></table></div>';
		

		if (WindowProperties.TitleStyle==undefined) {

			WindowProperties.TitleStyle = "whitespace:nowrap; font-weight:bold; filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#FFC3D9FF', EndColorStr='#FFE0ECFF'); width:200; height:20; padding:4; padding-left:10; ";
			WindowProperties.TitleStyle = WindowProperties.TitleStyle + "background-color:#C3D9FF; ";
			WindowProperties.TitleStyle = WindowProperties.TitleStyle + "border-bottom-width:2; border-bottom-color:#DDDDDD; border-bottom-style:solid;";
		}
		
		if (WindowProperties.TitleClass==undefined) {

			WindowProperties.TitleClass = '';
		}
			
		if (WindowProperties.TitleContent == undefined) {
		
			WindowProperties.TitleContent = '';
		}
		
		
		if (IE==true) {
			TitleHTML = '<div onmousedown="' + StrWinID + '.StartDrag()" id="Title' + NewIDName + '" style="' + WindowProperties.TitleStyle +'; display:inline;" class="' + WindowProperties.TitleClass + '">' +  WindowProperties.TitleContent + TitleButtons + '</div>';
		} else {
			TitleHTML = '<div onmousedown="' + StrWinID + '.StartDrag()" id="Title' + NewIDName + '" style="' + WindowProperties.TitleStyle +';  class="' + WindowProperties.TitleClass + '">' +  WindowProperties.TitleContent +  TitleButtons + '</div>';				
		}
		
		
		//
		//	Content
		//
		if (WindowProperties.ContentStyle==undefined) {

			WindowProperties.ContentStyle = 'background-color:#FFFFFF';
		}
		
		if (WindowProperties.ContentClass==undefined) {

			WindowProperties.ContentClass = '';
		}


		//
		//	IFrame Setup
		//
		if (WindowProperties.IFrameStyle==undefined) {

			WindowProperties.IFrameStyle = 'background-color:#FFFFFF; border:0;';
		}
		
		if (WindowProperties.IFrameClass==undefined) {

			WindowProperties.IFrameClass = '';
		}
		
		if (WindowProperties.IFrameOnSuccess==undefined) {
			WindowProperties.IFrameOnSuccess = function () {};
		}


		if (WindowProperties.AjaxOnSuccess==undefined) {
			WindowProperties.AjaxOnSuccess = function () {};
		}
		
		if (WindowProperties.IFrameUrl != undefined) {
			var VURL = WindowProperties.IFrameUrl.split('?');
			if (VURL.length==1) {
				WindowProperties.IFrameUrl = WindowProperties.IFrameUrl + '?JSWindowID=' + NewIDName;
			} else {
				WindowProperties.IFrameUrl = WindowProperties.IFrameUrl + '&JSWindowID=' + NewIDName;
			}
			
			IFrameHTML = '<iframe width="100%" height="100%" onload="' + StrWinID + '.IFrameOnSuccess(this);" id="IFrame' + NewIDName + '" src="' + WindowProperties.IFrameUrl + '" style="' + WindowProperties.IFrameStyle + '" class="'+ WindowProperties.IFrameClass + '" frameborder="0" allowtransparency="1"></iframe>';
		}
		
		
		
		//
		//	Loading Window Setup
		//	
		if (WindowProperties.LoadingStyle==undefined) {

			WindowProperties.LoadingStyle = 'background-color:#FFFFFF; ';
		}
		
		if (WindowProperties.LoadingClass==undefined) {

			WindowProperties.LoadingClass = '';
		}
		
		if (WindowProperties.LoadingMessage == undefined) {
				WindowProperties.LoadingMessage = '<div style="padding:10; width:200;">Preparing, Please Wait...</div>';
		}



		//
		//	Body Setup
		//
		if (WindowProperties.BodyContent==undefined) {

			WindowProperties.BodyContent = '';
		}


		
		//
		//	HTML STRING :: Build the Window
		//
		var DivHTML = '';
		DivHTML = DivHTML + '	<div id="SubWindow' + NewIDName + '" CONTENTEDITABLE="false"><div CONTENTEDITABLE="false" id="Window' + NewIDName + '"  style="' + WindowProperties.WindowStyle + '" class="' + WindowProperties.WindowClass + '">';
		DivHTML = DivHTML + 		TitleHTML;
		DivHTML = DivHTML + '    	<div id="Content' + NewIDName + '" style="' + WindowProperties.ContentStyle +'" class="' + WindowProperties.ContentClass + '">' + WindowProperties.BodyContent + IFrameHTML + '</div>';
		DivHTML = DivHTML + '		<div id="Loading' + NewIDName + '" style="display:none;position:absolute;z-index:2000;' + WindowProperties.LoadingStyle + '" class="' + WindowProperties.LoadingClass + '"></div>';
		DivHTML = DivHTML + '	</div></div>';
		DivHTML = DivHTML + '<div id="Shadow' + NewIDName + '" style="display:none;position:absolute;z-index:999;' + WindowProperties.ShadowStyle + '" class="' + WindowProperties.ShadowClass + '">&nbsp;</div>';


		//
		//	Add HTML to Browser Object :: This execeutes in the browser
		//
		ParentObject.innerHTML = ParentObject.innerHTML + DivHTML;
		
		
		//
		//	Javascript to handle Window Functions
		//
		var WinDiv = new Object();

		WinDiv = GetID("Window" + NewIDName);
			
		var TitDiv  	= GetID("Title"   + NewIDName);	
		var ShDiv   	= GetID("Shadow"  + NewIDName);
		var ConDiv  	= GetID("Content" + NewIDName);
		var LoadDiv 	= GetID("Loading" + NewIDName);
		var Buttons 	= GetID(StrWinID  + "Buttons");
		var tblButtons 	= GetID(StrWinID  + "btnTable");
		
	
		//
		//	Set Reference to Content Div
		//
		WinDiv.Content = ConDiv;
	
		WinDiv.IFrameOnSuccess = function(IFrame) {
			LoadDiv.style.display = 'none';
			WindowProperties.IFrameOnSuccess(IFrame);
		}


		//
		//	Setup IFrame
		//
		if (WindowProperties.IFrameUrl != undefined) {
			LoadDiv.style.display = 'block';
			LoadDiv.innerHTML	  = WindowProperties.LoadingMessage;
		}


		//
		//	Function Resize
		//
		WinDiv.Resize = function(SizeWidth, SizeHeight) {
			
			if (SizeWidth != undefined) {
				ConDiv.style.width = SizeWidth;
				WinDiv.style.width = SizeWidth;
			}
			
			if (SizeHeight != undefined) {
				ConDiv.style.height = SizeHeight;
				WinDiv.style.height = SizeHeight + TitDiv.offsetHeight;
			}

			WinDiv.style.left  = (GetWindowWidth() / 2) - (WinDiv.offsetWidth  / 2);
			WinDiv.style.top  = (GetWindowHeight() / 2) - (WinDiv.offsetHeight / 2);

			if (WinDiv.offsetLeft < 1) {
				WinDiv.style.left  = 5;
			}

			if (WinDiv.offsetTop < 1) {

				WinDiv.style.top  = 5;
			}
			
			
			
			if (SizeWidth != undefined) {
				WinDiv.onresize(true);
			}
			
			if (SizeHeight != undefined) {
				WinDiv.onresize(true);
			}
		}
		

		//
		//	IE Edit Mode Only
		//	
		WinDiv.onresizeend = function() {

			if (event.x > WinDiv.offsetLeft) {
				var NewWidth = event.x - WinDiv.offsetLeft;
			} else {
				var NewWidth = WinDiv.offsetWidth + (WinDiv.offsetLeft - event.x);
			}
			
			if (event.y > WinDiv.offsetTop) {
				var NewHeight = event.y - WinDiv.offsetTop;
			} else {
				var NewHeight = WinDiv.offsetHeight + (WinDiv.offsetTop - event.y);
			}

			WinDiv.Resize(NewWidth, NewHeight);
			WinDiv.PositionShadow();
		}
		
		
		//
		//	Event Window ONRESIZE
		//
		WinDiv.onresize = function(ManualCall) {

			if (ManualCall == undefined) {
				WinDiv.Resize();
			}
			
			
			WinDiv.PositionShadow();
			
			
			//
			//  Center Loading Message
			//
			LoadDiv.style.left 		= (WinDiv.offsetWidth / 2) - (LoadDiv.offsetWidth / 2);
			LoadDiv.style.top 		= (WinDiv.offsetHeight / 2) - (LoadDiv.offsetHeight / 2);
			
			//
			//	Set Title Properties
			//
			if (TitleHTML != '') {
				if (IE==true) {
					TitDiv.style.width = WindowProperties.Width;
					Buttons.style.left  = WinDiv.offsetWidth - tblButtons.offsetWidth - 20;
				} else {
					TitDiv.style.width = WindowProperties.Width - 15;
					Buttons.style.top   = 10;
					Buttons.style.left  = WindowProperties.Width - (tblButtons.offsetWidth);
					TitDiv.style.height = 15;
				}
			}
			
			
		}
		
		
		
		//
		//	IE Only
		//
		WinDiv.StartDrag =function() {
			//document.execCommand("2D-position",false,true);
			//getID(SubStrWinID).contentEditable=false;

			//StartDragDrop(this, ' + StrWinID + ');

		}

		
		
		//
		//	IE Only :: Event Window ONMOVESTART
		//
		WinDiv.onmovestart = function() {
			ShDiv.style.display = 'none';
		}
		

		//
		//	Event Window ONMOVEEND
		//
		WinDiv.onmoveend = function() {
			WinDiv.PositionShadow();
		}


		//
		//	Function Position Shadow
		//
		WinDiv.PositionShadow = function() {
			ShDiv.style.display = 'none';
			ShDiv.style.left 	= WinDiv.offsetLeft - 3;
			ShDiv.style.top 	= WinDiv.offsetTop - 3;
			ShDiv.style.height 	= WinDiv.offsetHeight + 6;
			ShDiv.style.width 	= WinDiv.offsetWidth + 6;
		}
		
		
		
		//
		//	Function WindowClose
		//
		WinDiv.CloseWindow = function() {

			if (WindowProperties.OnWindowClose != undefined) {
				WindowProperties.OnWindowClose(WinDiv, false);
			}
			
			GetID(SubStrWinID).outerHTML = '';
			
		}


		//
		//	Function CloseWindowOk
		//
		WinDiv.CloseWindowOk = function() {
			if (WindowProperties.OnWindowCloseOk != undefined) {
				WindowProperties.OnWindowCloseOk(WinDiv, true);
			}
			WinDiv.outerHTML = '';
			ShDiv.outerHTML = '';

		}

		


		WinDiv.Resize(WindowProperties.Width, WindowProperties.Height);
		
		
		WinDiv.OnAjaxSuccess = function() {
			WinDiv.PositionShadow();
			WindowProperties.AjaxOnSuccess();
		}
		

		
		
		dv = GetID("Content" + NewIDName);
		
		//
		//	AJAX
		//
		if (WindowProperties.AjaxUrl != undefined) {
			var VURL = WindowProperties.AjaxUrl.split('?');
			if (VURL.length==1) {
				WindowProperties.AjaxUrl = WindowProperties.AjaxUrl + '?JSWindowID=' + NewIDName;
			} else {
				WindowProperties.AjaxUrl = WindowProperties.AjaxUrl + '&JSWindowID=' + NewIDName;
			}
			
			
			GetHTTPAJAX(dv, WindowProperties.AjaxUrl, WinDiv.OnAjaxSuccess, WindowProperties.LoadingMessage, WindowProperties.AjaxFormValues);
		}
		
		
		
		
		
		
		
		return WinDiv;
		
	}
	
	
	
	
	
	DumpObject = function(Obj) {
		var gg = '';
		for (var i in Obj) {
			gg = gg + String(i) + ' | ';
		}
		alert(gg);
		
		return gg;
	}
	
	
	DumpObjectValue = function(Obj, HTML, ExcludeNull, ExcludeObject, ObjectsOnly, ExcludeFunction) {
		var gg = '';

		for (var i in Obj) {
			var Show = true;
			try {
				if (eval('Obj.' + i)!='') {
				
					if (ExcludeNull!=undefined &&  eval('Obj.' + i) == null) {
						Show = false;
					}
					if (ExcludeObject!=undefined && typeof(eval('Obj.' + i)) == 'object') {
						Show = false;
					}
					if (HTML!=undefined && String(i) == 'innerHTML') {
						Show = false;
					}
					if (HTML!=undefined && String(i) == 'outerHTML') {
						Show = false;
					}
				
					if (ObjectsOnly==true && typeof(eval('Obj.' + i)) != 'object') {
						Show = false;
					}
					if (ExcludeFunction==true && typeof(eval('Obj.' + i)) == 'function') {
						Show = false;
					}
					
					if (Show==true) {
						gg = gg + String(i) + '=' + eval('Obj.' + i) + ' | ';
					}
				} 
			} catch(e) {}
		}
		alert(gg);
		
		return gg;
	}
	
	
	MultiSelectToStringList = function(Obj, Field, Delimiter) {

		var gg = '';
		for (var i=0; i< Obj.options.length; i++) {
			gg = gg + Obj.options(i)[Field] + Delimiter;
		}
		
		gg = gg.substring(0, gg.length-1);
		
		return gg;
	}
	
	
	
	PostHTTPTargetForm = function(DivObj, HTTP, PostText, TargetWindow, WindowProperties) {

		if (WindowProperties == undefined) { 
			WindowProperties = '';
		}
		
		var FormText = '';
		
		FormText =FormText + '<form style="display:none" id="FORMW" method="post" target="' + TargetWindow + '" action="' + HTTP + '" >';

		var ObjArray = PostText.split('&');
		
		for (var t=0; t<ObjArray.length;t++) {
			
			ParamAndValue = ObjArray[t].split('=');
			
			FormText = FormText + '<input name="' + ParamAndValue[0] + '" value="' + ParamAndValue[1] + '">';
		}
		
		FormText =FormText + '</form>';
		
		//FormText =FormText + '<script>FORMW.submit();
		//script>';
		
		DivObj.innerHTML  =DivObj.innerHTML + FormText;		
		
		var myWindow=window.open('', TargetWindow, WindowProperties);
		myWindow.document.writeln(FormText);
		
		GetID("FORMW").submit();
		GetID("FORMW").outerHTML = '';
		
	}
	
	
	PrintHTML = function(DivObj, HTML) {

		DivObj.innerHTML = DivObj.innerHTML + '<iframe id="PRINTframe" style="position:absolute; left:-5000"></iframe>';
		PRINTframe.onload = function () {
											PRINTframe.document.body.innerHTML = HTML;
											PRINTframe.focus();
											PRINTframe.print();
										};
					
	}
	
	
	var vClockDiv;
	var vClockStyle;
	
	function StartClock(DivObj)	{
		
		if (DivObj != undefined) {
			vClockDiv = DivObj;
		}
		
		var today=new Date()
		var h=today.getHours()
		var m=today.getMinutes()
		var s=today.getSeconds()
		// add a zero in front of numbers<10
		//m=checkTime(m)
		//s=checkTime(s)
		//DivObj.innerHTML=h+":"+m+":"+s;
		vClockDiv.innerHTML=new Date();
		t=setTimeout('StartClock()',500)
	}
	
	//
	// Prefix 1-9 with a 0
	//
	function checkTime(i) {
		if (i < 10) { i = "0" + i }
		return i
	}
	
	// ************************************
	// This is similar ot he StartClock, only formatted
	// ds = Date Style, options are dfull, dshort, dshorter
	// ts = Time Style, options are t24 or t12
	// by: Jennifer Stephens, 1/31/2008
	// ************************************
	function StartClock2(DivObj, ds, ts)	{
		
		if (DivObj != undefined) {
			vClockDiv = DivObj;
		};
		
		
		if (ds == undefined) {
			vDateStyle = 'dfull';
		} else {
			vDateStyle = ds;
		};
		
		if (ts == undefined) {
			vTimeStyle = 't24';
		} else {
			vTimeStyle = ts;
		};
		
		var vClock = new Date();
		var s=vClock.getSeconds()
		
		vClockDiv.innerHTML = FormatDate(vClock, vDateStyle) + " " + FormatTime(vClock, vTimeStyle);
		t=setTimeout(
					 	function() {
								  		StartClock2(GetID(DivObj), ds, ts, 500);
								   }
					);
	}

	// ************************************
	// Date Properties
	// by: Jennifer Stephens, 1/31/2008
	// ************************************
	function FormatDate(ThisDate, DateStyle) {

		if (DateStyle == undefined) {
			DateStyle = 'dshorter';
		}
		
		wd = ShowDayOfWeekString(ThisDate.getDay());
		mv = ShowMonthAsString(ThisDate.getMonth());
		mn = ThisDate.getMonth() + 1
		mn = checkTime(mn);
		dv = ThisDate.getDate();
		dn = checkTime(dv);
		yv = ThisDate.getFullYear();
		
		if (DateStyle == 'dfull') {
			OutputVal = wd + ", " + mv + " " + ThisDate.getDate() + ", " + ThisDate.getFullYear();
		} else if (DateStyle == 'dshort') {
			OutputVal = wd.substring(0, 3) + ", " + mv.substring(0, 3) + " " + dv + ", " + yv;
		} else if (DateStyle == 'dshorter') {
			wd = ShowDayOfWeekString(ThisDate.getDay());
			OutputVal = mn + "/" + dn + "/" + yv;
		}
			
		
		return OutputVal;
	}
	
	// ************************************
	// Time Properties
	// by: Jennifer Stephens, 1/31/2008
	// ************************************
	function FormatTime(ThisDate, TimeStyle) {

		if (TimeStyle == undefined) {
			TimeStyle = 't24';
		}
		
		hv = checkTime(ThisDate.getHours());
		mv = checkTime(ThisDate.getMinutes());
		sv = checkTime(ThisDate.getSeconds());
		
		if (TimeStyle == 't24') {
			OutputVal = hv + ":" + mv + ":" + sv;
		} else {
			OutputVal = ShowTimeAs12(hv, mv, sv);
		}
		
		return OutputVal;
	}
	
	// ************************************
	// Convert the numeric value of the 
	// weekday to its string representation
	// by: Jennifer Stephens, 1/31/2008
	// ************************************
	function ShowDayOfWeekString(w) {
		if (w == 0) { w = 'Sunday'; } 
		else if (w == 1) { w = 'Monday'; } 
		else if (w == 2) { w = 'Tuesday'; } 
		else if (w == 3) { w = 'Wednesday'; } 
		else if (w == 4) { w = 'Thursday'; } 
		else if (w == 5) { w = 'Friday'; } 
		else if (w == 6) { w = 'Saturday'; }
		
		return w;
	}
	
	// ************************************
	// Convert the numeric value of the
	// month to its string representation
	// by: Jennifer Stephens, 1/31/2008
	// ************************************
	function ShowMonthAsString(m) {
		if (m == 0) { m = 'January'; }
		else if (m == 1) { m = 'February'; }
		else if (m == 2) { m = 'March'; }
		else if (m == 3) { m = 'April'; }
		else if (m == 4) { m = 'May'; }
		else if (m == 5) { m = 'June'; }
		else if (m == 6) { m = 'July'; }
		else if (m == 7) { m = 'August'; }
		else if (m == 8) { m = 'September'; }
		else if (m == 9) { m = 'October'; }
		else if (m == 10) { m = 'November'; }
		else if (m == 11) { m = 'December'; }
		
		return m;
	}
	
	// ************************************
	// This will take the 24 hour and make it 12
	// by: Jennifer Stephens, 1/31/2008
	// ************************************
	function ShowTimeAs12(h, m, s) {
		if (h <= 12) {
			t = 'AM';
		} else {
			t = 'PM';
			h = checkTime(h - 12);
		}
		
		return h + ":" + m + ":" + s + " " + t;
	}
	
	//
	//	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')
		  cels[colno].style.display=stl;
		}
		
	  }
	  
	 
	 
	//
	//	Assign Highlight functions to the Obj
	//
	function AssignHighlightsToObject(Obj, ContID, Color, ToolTip, DefaultColor) {

		HL[ContID+'Color'] = DefaultColor;

		Obj.onmouseover = function () {
								MouseOverHighlight(Obj, ContID, Color, ToolTip);
							}


		Obj.onmouseout = function () {
								MouseOutHighlight(Obj, ContID);
							}


		Obj.onclick  = function () {
								MouseClickHighlight(Obj, ContID);
							}

	}
	  
	  
	//
	//	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 {  
		
			if (Obj.style.backgroundColor == '') {
				HL[ContID+'MO'] = HL[ContID+'Color'];
			} else {
				HL[ContID+'MO'] = Obj.style.backgroundColor;
			}
			Obj.style.backgroundColor = 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 && HL[ContID+'LastSelectColor'] != '') {
			//	Set Back to Selected Color
			if (HL[ContID+'LastSelectColor'].substring(0, 1) != '#') {
				Obj.className = HL[ContID+'LastSelectColor'];
			} else {
				Obj.style.backgroundColor = HL[ContID+'LastSelectColor'];
			}
			return
		}
		
	
		try {
			//	Set Color
			if (HL[ContID+'MO'].substring(0, 1) != '#') {
				Obj.className = HL[ContID+'MO'];
			} else {
				Obj.style.backgroundColor = HL[ContID+'MO'];
			}
		} catch(e) {
			
		}
	}
	
		
	//
	//	SELECTED -- Handles Keeping the Object Highlighted even when MouseOut Occurs
	//
	function MouseClickHighlight(Obj, ContID, Color) {

		if (HL[ContID] != undefined) {
			
			// Reset Color on Previous Clicked Item
			if (HL[ContID+'LastColor'].substring(0, 1) != '#') {
				HL[ContID].className = HL[ContID+'LastColor'];
			} else {
				Obj.style.backgroundColor = 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 -- 
	//
	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) {

		clearInterval(Obj.Interval);
		func(Param1, Param2, Param3, Param4);
	}
	
	
	
	//________________________________________________________________________________
	//
	//	EXECUTE A FUNCTION AFTER MILISECS
	//
	function ExecuteFunctionOnceAfter(func, timing, Param1, Param2, Param3, Param4) {
		var Obj = new Object();
		Obj.func   = func;
		Obj.Param1 = Param1;
		Obj.Param2 = Param2;
		Obj.Param3 = Param3;
		Obj.Param4 = Param4;
		

		var TempFunc = function() {
			ExecuteFunctionOnceAfterCall(Obj.func, Obj, Obj.Param1, Obj.Param2, Obj.Param3, Obj.Param4);
		}
		
		Obj.Interval = setInterval(TempFunc, timing);
		return Obj;
	}
	
	
	//________________________________________________________________________________
	//
	//	EXECUTE A FUNCTION AFTER MILISECS USING THE PASSED IN OBJ
	//
	function ExecuteFunctionOnceAfterUsing(Obj, func, timing, Param1, Param2, Param3, Param4) {
	
		if (Obj != undefined) {
			clearInterval(Obj.Interval);
		} else {
			Obj = new Object();
		}
		

		Obj.func   = func;
		Obj.Param1 = Param1;
		Obj.Param2 = Param2;
		Obj.Param3 = Param3;
		Obj.Param4 = Param4;
		

		var TempFunc = function() {
			ExecuteFunctionOnceAfterCall(Obj.func, Obj, Obj.Param1, Obj.Param2, Obj.Param3, Obj.Param4);
		}

		Obj.Interval = setInterval(TempFunc, timing);
		return Obj;
	}
	
	
	
	
	function DragDropCoordinates() {
		
		if (!DragDropObject) {
			return
		}

		
		if (event.srcElement==DragDropSelect)	{
			mouseover	 =true;
			DragDropLeft =DragDropObject.style.pixelLeft;
			DragDropTop	 =DragDropObject.style.pixelTop;
			DragDropX	 =event.clientX;
			DragDropY	 =event.clientY;
			//DragDropObject.style.filter = "alpha(opacity=20)";
			document.onmousemove=DragObject;
		}
	}
	
	function DragObject() {
		
		if (mouseover&&event.button==1)	{

			DragDropObject.style.pixelLeft	=DragDropLeft+event.clientX-DragDropX
			DragDropObject.style.pixelTop	=DragDropTop+event.clientY-DragDropY
			return false
		}
	}
	
	function StopDragDrop() {
	
		mouseover=false;
		document.onmousedown=function() {};
		//DragDropObject.style.filter = "";
	}

	function StartDragDrop(SelectObject, DragObject) {

		DragDropObject = DragObject;
		DragDropSelect = SelectObject;
		document.onmousedown=DragDropCoordinates;
		document.onmouseup=StopDragDrop;

	}

	
	
	function NumbersOnly(e)	{
		var keynum
		var keychar
		var numcheck
		if(window.event) { // IE	
			keynum = e.keyCode
		} else if(e.which) { // Netscape/Firefox/Opera
			keynum = e.which
		}
		keychar = String.fromCharCode(keynum)
		numcheck = /\d/;
		
		return numcheck.test(keychar)
	}
	
	
	
	function NumberTypes(e)	{
		var keynum
		var keychar
		var numcheck
		if(window.event) { // IE	
			keynum = e.keyCode
		} else if(e.which) { // Netscape/Firefox/Opera
			keynum = e.which
		}
		keychar = String.fromCharCode(keynum);
		
		var validletters = '0123456789%.$\/\\';
		//alert(validletters.indexOf(keychar) + " : " + keychar + " : " + keynum + " : " + e.type);
		return (validletters.indexOf(keychar) > -1)
	}
	
	//
	// This is different from above because this
	// allows for the num key pad to be used
	// where the above thinks the num key pad
	// is a lower case letter.
	// PrevNum is used to determine if someone has pressed the shift key
	//
	
	
	function AlwaysAllowed(e) {
		var keynum
		var RetVal = false;
		
		//which :: Netscape/Firefox/Opera
		//keyCode :: IE
		var keynum = (e.which) ? e.which : e.keyCode
		
		IsAllowed = IsAllowedWith(e);
		
		if (
			keynum == 13 ||		// enter
			keynum == 9 ||		// tab
			keynum == 8 ||		// backspace
			keynum == 46 || 	// delete
			keynum == 16 || 	// shift
			keynum == 17 || 	// ctrl
			keynum == 18 || 	// alt
			keynum == 45 || 	// insert
			keynum == 36 || 	// home
			keynum == 35 || 	// end
			keynum == 33 || 	// page up
			keynum == 34 || 	// page down
			keynum == 27 || 	// esc
			keynum == 20 || 	// caps lock
			keynum == 144 ||	// num lock
			(keynum >= 112 && keynum <= 123) ||	// F1-F12
			(keynum >= 37 && keynum <= 40) ||	// arrow keys
			(keynum == 65 && IsAllowed) ||	// select all CTRL A
			(keynum == 90 && IsAllowed) ||	// undo CTRL Z
			(keynum == 67 && IsAllowed) ||	// copy CTRL C
			(keynum == 86 && IsAllowed) ||	// paste CTRL V
			(keynum == 88 && IsAllowed) 	// cut CTRL X
		) {
			RetVal = true; 
		} else {
			RetVal = false; 
		}

		return RetVal;
		
	}
	
	//
	// These keys return false because they are not allowed to be true
	// when another key is pressed
	//
	function NotAllowedWith(e) {
		
		if (e.shiftKey || e.ctrlKey || e.altKey) {
			return false;
		} else {
			return true;
		}
	}
	
	//
	// These keys return true because they are allowed to be true
	// when another key is pressed
	//
	function IsAllowedWith(e) {
		
		if (e.shiftKey || e.ctrlKey || e.altKey) {
			return true;
		} else {
			return false;
		}
	}
	
	
	function CheckNumericOnly(e) { 
		var keynum
		var RetVal = false;
		
		
		//which :: Netscape/Firefox/Opera
		//keyCode :: IE
		var keynum = (e.which) ? e.which : e.keyCode
		
		IsNotAllowed = NotAllowedWith(e);
			
		// 48 - 57 are the number keys at the top of a keyboard
		// 96 - 105 are the numbers on the numpad
		if (
			((keynum >= 48 && keynum <= 57) && IsNotAllowed) || 
			(keynum >= 96 && keynum <= 105)
		) {
			RetVal = true; 
		} else { 
			RetVal = false; 
		}
		
		if (RetVal == false) {
			RetVal = AlwaysAllowed(e);
		}
		
		return RetVal; 
	}
	
//
	//	Letter, Numbers and Some Punctuation
	//
	function CheckAllowedPunctuation(e) { 
		var keynum
		var RetVal = false;
		
		
		//which :: Netscape/Firefox/Opera
		//keyCode :: IE
		var keynum = (e.which) ? e.which : e.keyCode
		
		var IsAllowed = IsAllowedWith(e);
			
		// 48 - 57 are the number keys at the top of a keyboard
		// 96 - 105 are the numbers on the numpad
		if (
			keynum == 190 || 	// .
			keynum == 188 ||	// , 
			keynum == 189 || 	//	- _	
			//keynum == 222 || 	// '
			(keynum == 57 && IsAllowed) || // (
			(keynum == 48 && IsAllowed)   // )

		) {
			RetVal = true; 
		} else { 
			RetVal = false; 
		}
		
		if (RetVal == false) {
			RetVal =  LettersAndNumberOnly(e);
		}
		
		if (RetVal == false) {
			RetVal = AlwaysAllowed(e);
		}
		
		return RetVal; 
	}
	
	function CheckLettersOnly(e) { 
		var keynum
		var RetVal = false;
		
		
		//which :: Netscape/Firefox/Opera
		//keyCode :: IE
		var keynum = (e.which) ? e.which : e.keyCode
		
			
		// 48 - 57 are the number keys at the top of a keyboard
		// 96 - 105 are the numbers on the numpad
		if (
			keynum >= 65 && keynum <= 90
		) {
			RetVal = true; 
		} else { 
			RetVal = false; 
		} 
		
		if (RetVal == false) {
			RetVal = AlwaysAllowed(e);
		}
		
		return RetVal; 
	}
	
	
	//
	//
	//
	function CheckNumericKeyInfo(e) { 
		var keynum
		var RetVal = false;
		
		
		//which :: Netscape/Firefox/Opera
		//keyCode :: IE
		var keynum = (e.which) ? e.which : e.keyCode
		
		IsNotAllowed = NotAllowedWith(e);
		IsNumericValue = CheckNumericOnly(e);
		
		// 190 is the . on the keyboard
		// 189 is the - on the keyboard
		// 109 is the - on the number pad
		// 110 is the . on the number pad
		
		if (
			IsNumericValue || 
			(keynum == 190 && IsNotAllowed) || 
			(keynum == 189 && IsNotAllowed)  ||
			keynum == 109 || keynum == 110
		) {
			RetVal = true; 
		} else { 
			RetVal = false; 
		} 
		
		if (RetVal == false) {
			RetVal = AlwaysAllowed(e);
		}
		
		return RetVal; 
	}
	
	
	//
	//
	//
	function CheckNumericMinMax(value, minval, maxval, id, allowblank) { 
		var keynum
		var RetVal = false;
		
		//alert(value + ' : ' + minval + ' : ' + maxval);
		
		//
		// Allow blank value
		// 
		if (allowblank && value == '') {
			return true
		}
		
		//
		// Blank value is not allowed
		// Evaluate number provided based on minval and maxval
		//
		if (minval == '' || minval == undefined) {
			RetVal = true;
		} else if (Number(value) < minval) {
			alert('Value provided is less than allowed min of ' + minval);
			if (id != undefined) {
				id.focus();
			}
			return false;
		}
		
		
		if (maxval == '' || maxval == undefined) {
			RetVal = true;
		} else if (Number(value) > maxval) {
			alert('Value provided is greater than allowed max of ' + maxval);
			if (id != undefined) {
				id.focus();
			}
			return false;
		}
		
		return RetVal; 
	}
	
	
	//
	// This allows A-Z, a-z and 0-9 and a space only
	//
	function LettersAndNumberOnly(e) { 
		var keynum
		var RetVal = false;
		
		
		//which :: Netscape/Firefox/Opera
		//keyCode :: IE
		var keynum = (e.which) ? e.which : e.keyCode
		
		IsNotAllowed = NotAllowedWith(e);
		IsNumericValue = CheckNumericOnly(e);
		IsAlphaValue = CheckLettersOnly(e);
		
		// 32 is the space bar on the keyboard

		
		if (
			IsNumericValue ||
			IsAlphaValue ||
			keynum == 32
		) {
			RetVal = true; 
		} else { 
			RetVal = false; 
		} 
		
		if (RetVal == false) {
			RetVal = AlwaysAllowed(e);
		}
		
		return RetVal; 
	} 
	
	
	//
	// This allows A-Z, a-z and 0-9 and a space only and $ and *
	//
	function AllowedClientGroupCode(e) { 
		var keynum
		var RetVal = false;
		
		
		//which :: Netscape/Firefox/Opera
		//keyCode :: IE
		var keynum = (e.which) ? e.which : e.keyCode
		
		IsNotAllowed = NotAllowedWith(e);
		IsNumericValue = CheckNumericOnly(e);
		IsAlphaValue = CheckLettersOnly(e);
		
		// 32 is the space bar on the keyboard

		
		if (
			IsNumericValue ||
			IsAlphaValue ||
			keynum == 32 ||	// space
			keynum == 56 ||	// *
			keynum == 52	// $
		) {
			RetVal = true; 
		} else { 
			RetVal = false; 
		} 
		
		if (RetVal == false) {
			RetVal = AlwaysAllowed(e);
		}
		
		return RetVal; 
	}
	
	//
	// Letters and Numbers only
	//
	function AlphaNumericOnly(e) { 
		var keynum
		var RetVal = false;
		
		
		//which :: Netscape/Firefox/Opera
		//keyCode :: IE
		var keynum = (e.which) ? e.which : e.keyCode
		
		IsNotAllowed = NotAllowedWith(e);
		IsNumericValue = CheckNumericOnly(e);
		IsAlphaValue = CheckLettersOnly(e);
		
		// 190 is the . on the keyboard
		// 189 is the - on the keyboard
		// 109 is the - on the number pad
		// 110 is the . on the number pad
		// 32 is space
		
		//alert(keynum);
		
		if (
			IsNumericValue ||
			IsAlphaValue ||
			(keynum == 190 && IsNotAllowed) || 
			(keynum == 189 && IsNotAllowed) ||
			keynum == 109 || 
			keynum == 110 ||
			keynum == 32
		) {
			RetVal = true; 
		} else { 
			RetVal = false;
		} 
		
		if (RetVal == false) {
			RetVal = AlwaysAllowed(e);
		}
		
		return RetVal; 
	} 

	
	//
	// HTML Color Key codes
	//
	function HexColor(e) {
		var keynum
		var RetVal = false;
		
		
		//which :: Netscape/Firefox/Opera
		//keyCode :: IE
		var keynum = (e.which) ? e.which : e.keyCode
		
		IsNumericValue = CheckNumericOnly(e);
		
		// 65 - 71 are upper case A-F
		
		if(
			IsNumericValue || 
			(keynum >= 65 && keynum <= 70)
		) {
			RetVal = true; 
		} else { 
			RetVal = false;
		} 
		
		if (RetVal == false) {
			RetVal = AlwaysAllowed(e);
		}
		
		
		return RetVal; 
	}

	
	//
	// Old Hex function
	//
	function HexOnly(e)	{
		var keynum
		var keychar
		var numcheck
		
		//which :: Netscape/Firefox/Opera
		//keyCode :: IE
		var keynum = (e.which) ? e.which : e.keyCode
		
		IsNotAllowed = NotAllowedWith(e);
		
		keychar = String.fromCharCode(keynum);
		var validletters = '0123456789ABCDEFabcdef';
		return (validletters.indexOf(keychar) > -1)
	}
	
	//
	//
	//
	function LettersAndNumber(e)	{
		var keynum
		var keychar
		var numcheck
		
		//which :: Netscape/Firefox/Opera
		//keyCode :: IE
		var keynum = (e.which) ? e.which : e.keyCode
		
		IsNotAllowed = NotAllowedWith(e);
		
		keychar = String.fromCharCode(keynum);
		var validletters = '0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ-.*() abcdefghijklmnopqrstuvwxyz';
		return (validletters.indexOf(keychar) > -1)
	}


	function GetPixelPosition(Obj, PosObj) {
		
		//
		//	Recursive Function to Determine Left and Top Actual Position
		//
		
		if (PosObj == undefined) {
			PosObj 			= new Object;
			PosObj.Left 	= 0;
			PosObj.Top 		= 0;
			PosObj.Parents 	= 0;
		}
		
		var blw = 0;
		var btw = 0;
		var plw = 0;
		var ptw = 0;
		
		try {
			if (isNaN(parseInt(Obj.currentStyle.borderTopWidth)) == false) {
				btw = parseInt(Obj.currentStyle.borderTopWidth);
			}
		} catch(e) {}

		try {
			if (isNaN(parseInt(Obj.currentStyle.paddingTop)) == false) {
				ptw = parseInt(Obj.currentStyle.paddingTop);
			}
		} catch(e) {}


		try {
			if (isNaN(parseInt(Obj.currentStyle.borderLeftWidth)) == false) {
				blw = parseInt(Obj.currentStyle.borderLeftWidth);
			}
		} catch(e) {}


		try {
			if (isNaN(parseInt(Obj.currentStyle.paddingLeft)) == false) {
				plw = parseInt(Obj.currentStyle.paddingLeft);
			}
		} catch(e) {}

			
		PosObj.Left 	= PosObj.Left + Obj.offsetLeft + blw + plw;
		PosObj.Top 		= PosObj.Top  + Obj.offsetTop + btw + ptw;

		// Test for Parent
		try {
			var test = Obj.offsetParent.offsetLeft;
	
			// If Still here Parent exist
			if (String(Obj.offsetParent) != null ) {
				PosObj.Parents	= PosObj.Parents + 1;
				PosObj = GetPixelPosition(Obj.offsetParent, PosObj);
			}
		} catch(e) {
		}
		
		return PosObj;
		
	}


	//
	//
	//	
	function ArrayAdd(TheArray, Value) {
		
		TheArray[TheArray.length ] = Value;
		
		return TheArray;
		
	}


	//
	//
	//
	function ArrayRemove(TheArray, Value) {
		
		var t;
		var NA = new Array();
		
		for (t=0;t<TheArray.length; t++) {
			if (TheArray[t] != Value) {
				NA[NA.length] = TheArray[t];
			}
		}
		
		return NA;
		
	}


	//
	//
	//
	function ShowPopup(TargetID, PopupDiv, Content, x, y, w, h)	{
		
		
		if (typeof(Content) == 'object') {
			var c = Content.innerHTML;
		} else {
			var c = Content;
		}
		
		var p		= window.createPopup();
		var pbody	= p.document.body;

		if (w==undefined) { w = 0 };
		if (h==undefined) { h = 0 };
		
		
		PopupDiv.innerHTML = c;		
	  	w  				   = PopupDiv.offsetWidth  + w;
		h  				   = PopupDiv.offsetHeight + h;

		
		var t = '<div style="font-family:arial; font-size:12px;padding:10; background-Color:lightyellow; border:solid #999999 1px; ' + 
					'border-Left:solid #CCCCCC 1px; border-Top:solid #CCCCCC 1px; ' +
					'filter:progid:DXImageTransform.Microsoft.Shadow(color=#BBBBBB, Direction=135, Strength=2); ' +
					'width:' + (w-2) +  ';' + 
					'height:' + (h-2) + 
					'">' + c + '</div>';

		pbody.innerHTML = t;

		p.show(x,y,w,h,TargetID);
		
		return pbody;
	}
	
	
	//
	//
	//
	function CreatePopup(x, y, w, h, Content, RelativeID)	{
		
		if (typeof(Content) == 'object') {
			var c = Content.innerHTML;
		} else {
			var c = Content;
		}
		

		var p		= window.createPopup();
		var pbody	= p.document.body;
		
		pbody.innerHTML = c;
		p.show(x,y,w,h, RelativeID);
		
		return pbody;
	}




	var Div_To_Refresh_Obj = new Object();
	
	RefreshDivAfterScroll = function(DivToRefresh) {
		Div_To_Refresh_Obj = ExecuteFunctionOnceAfterUsing(Div_To_Refresh_Obj,  
															function() { 
																DivToRefresh.style.visibility = 'hidden'; 
																ExecuteFunctionOnceAfter( function() { DivToRefresh.style.visibility = 'visible'; }, 100);
															},
															200);
	}
	
	
	
	
	
	
	LoadStyleSheet = function(DIV, URL) {
		document.body.innerHTML = document.body.innerHTML +  '<link rel=stylesheet href="' + URL + '">';
	}
	
	
	var PleaseWaitCounter;
	PleaseWaitCounter = 0;

	
	ShowFlashPleaseWait = function(ParentObj, FlashFile, Width, Height, LoadOnce) {

		LastWaitDiv = ParentObj;
		
		if (PleaseWaitCounter > 0) {
			if (LoadOnce!=true) {
				PleaseWaitCounter++;
			}
			return false;	
		}
		
		if (PleaseWaitCounter < 0) {
			PleaseWaitCounter = 0;	
		}
				
		PleaseWaitCounter++;
		PleaseWaitDiv = document.createElement('DIV');
		PleaseWaitBG  = document.createElement('DIV');
		
		PleaseWaitDiv.style.position 	= 'absolute';
		PleaseWaitDiv.style.zIndex		= 2000;
		PleaseWaitBG.style.position 	= 'absolute';
		PleaseWaitBG.style.zIndex		= 1999;

		ParentObj.appendChild(PleaseWaitDiv);
		ParentObj.appendChild(PleaseWaitBG);

		var POS = GetPixelPosition(ParentObj);


		if (FlashFile!='') {
			PleaseWaitDiv.style.left		= (GetWindowWidth() / 2) - (Width / 2) - POS.Left;
			PleaseWaitDiv.style.top			= (GetWindowHeight() / 2) - (Height / 2) - POS.Top;
			PleaseWaitDiv.style.height		= Height;
			PleaseWaitDiv.style.width		= Width;
			LoadFlashMovie(PleaseWaitDiv, FlashFile, Width, Height);
		}
		
	
		PleaseWaitBG.style.left			= 0 - POS.Left;
		PleaseWaitBG.style.top			= 0 -  POS.Top;
		PleaseWaitBG.style.height		= 3000;
		PleaseWaitBG.style.width		= 3000;
		PleaseWaitBG.style.backgroundColor = '#FFFFFF';
		PleaseWaitBG.style.filter		= 'alpha (opacity=60)';
		PleaseWaitBG.style.cursor	 	= 'default';
		PleaseWaitBG.onclick			= function () { }
		
		
		return ParentObj;
			
	}
	
	ClearFlashPleaseWait = function(Container, Force) {

		if (Container == undefined || Container.statusText != undefined) {
			Container = LastWaitDiv;
		}

		PleaseWaitCounter--;
		
		if (PleaseWaitCounter < 0) {
			PleaseWaitCounter = 0;	
		}

		
		if (PleaseWaitCounter==0 || Force) {
			try {			
				Container.innerHTML = '';	
				PleaseWaitDiv
			} catch(e) {}
		}
	}
	
	
	
	//
	// This will retreive a information from Coldfusion
	// CFType :: V for value and H for innerHTML
	// CFItem :: D = date
	// CFExtras :: depends on the CFItem
	//
	GetCFValue = function(Div, CFDiv, CFType, CFItem, CFExtras) {
	
		if (CFDiv == undefined) {
			CFDiv = Div;
		}
		
		GetHTTPAJAX(Div, '/UI/GenApps/cf/CFGets.cfm?CallerDiv=' + CFDiv.id + '&DivType=' + CFType + '&GetItem=' + CFItem + '&GetExtras=' + CFExtras, undefined, '');
	
	}
	
	
	