	// DOC READY  
		function OnDocReady(){
			jQuery.jQueryRandom = 0;
			jQuery.extend(jQuery.expr[":"], {
			    random: function (a, i, m, r) {
			        if (i == 0) {
			            jQuery.jQueryRandom = Math.floor(Math.random() * r.length)
			        };
			        return i == jQuery.jQueryRandom;
			    }
			});
			
			// Determine if banner exists	
				if($('a.BannerAd').length > 0){
					// Banner Exists
						rotateBanner();
						window.setInterval(function(){rotateBanner();}, 5000); 
				}
		}
		
	// Rotate Banner Ad
		function rotateBanner(){
			// Get all banner ads
				var $BannerAds = $('a.BannerAd');
			// hide all banner ads
				$BannerAds.hide();
		
			$('a.BannerAd:random').show();
			
		}

	/////////////////////////////////////////////////////////////////////////
	/* SCRIPTS THAT RUN AUTOMATICALLY *//////////////////////////////////////
	/////////////////////////////////////////////////////////////////////////		
	
		// Remove Unwanted Link Border Outlines - Simple
			if(document.all){
				for(var i in document.links){
					document.links[i].onfocus = document.links[i].blur;	
				}
			}	
			
		// Remove Unwanted Link Border Outlines - Advanced
			/*
			var runOnLoad = new Array();
			window.onload = function() {
				for(var i = 0; i < runOnLoad.length; i++) runOnLoad[i]() 
			}
			if(document.getElementsByTagName)
			for(var i in a = document.getElementsByTagName('a')) {
				a[i].onmousedown = function() { 
					this.blur();                 // most browsers 
					this.hideFocus = true;       // internet explorer
					this.style.outline = 'none'; // mozilla
				}   
				a[i].onmouseout = a[i].onmouseup = function() { 
					this.blur();                 // most browsers 
					this.hideFocus = false;      // internet explorer    
					this.style.outline = null;   // mozilla 
				}
			}
			*/
	/////////////////////////////////////////////////////////////////////////
	/* ADD EVENT LISTENERS/HANDLERS */////////////////////////////////////
	/////////////////////////////////////////////////////////////////////////	
		/*
			Event Handlers:

		    * onAbort - The user aborts the loading of an image
		    * onBlur - form element loses focus or when a window or frame loses focus.
		    * onChange - select, text, or textarea field loses focus and its value has been modified.
		    * onClick - object on a form is clicked.
			* onContextMenu - user right-clicks an object.
		    * onDblClick - user double-clicks a form element or a link.
		    * onDragDrop - user drops an object (e.g. file) onto the browser window.
		    * onError - loading of a document or image causes an error.
		    * onFocus - window, frame, frameset or form element receives focus.
		    * onKeyDown - user depresses a key.
		    * onKeyPress - user presses or holds down a key.
		    * onKeyUp - user releases a key.
		    * onLoad - browser finishes loading a window or all of the frames within a frameset.
		    * onMouseDown - user depresses a mouse button.
		    * onMouseMove - user moves the cursor.
		    * onMouseOut - cursor leaves an area or link.
		    * onMouseOver - cursor moves over an object or area.
		    * onMouseUp - user releases a mouse button.
		    * onMove - user or script moves a window or frame.
		    * onReset - user resets a form.
		    * onResize - user or script resizes a window or frame.
		    * onSelect - user selects some of the text within a text or textarea field.
		    * onSubmit - user submits a form.
		    * onUnload - user exits a document. 
		*/
		/*
		<script language="JavaScript">
			var AddEvent = AddEventListener(window,"onload",intitFunction);
			if(AddEvent == false){
				window.onload = intitFunction;
			}
			function intitFunction(){
				alert('Works!');
			}
		</script>
		*/
		function AddEventListener(elemObj,eventName,funcName){	
			var eventNameLen=String(eventName).length;
			var eventNameMinusOn=Right(eventName, eventNameLen-2);
			var EventAdded;
			if(typeof window.addEventListener != 'undefined'){
				// gecko, safari, konqueror and standard
					elemObj.addEventListener(eventNameMinusOn, funcName, false);
					EventAdded = true;
			}
			else if(typeof document.addEventListener != 'undefined'){
				// opera 7
					document.addEventListener(eventNameMinusOn, funcName, false);
					EventAdded = true;
			}
			else if(typeof window.attachEvent != 'undefined'){
				// win/ie
					elemObj.attachEvent(eventName, funcName);
					EventAdded = true;
			}
			// remove this condition to degrade older browsers
			else{
				// mac/ie5 and anything else that gets this far
					EventAdded = false;
			}
			return EventAdded;
		}
		
		
		function addGenericEvent(source, trigger, func) {
			if (source.addEventListener)
				source.addEventListener(trigger,func,false);
			else if (source.attachEvent)
				source.attachEvent("on"+trigger,func);
		}
		
	/////////////////////////////////////////////////////////////////////////
	/* ONLOAD FUNCTIONS *///////////////////////////////////////////////////
	/////////////////////////////////////////////////////////////////////////		
	
	
		// AddOnloadFunction
			/*
				This script is an encapsulated onload function that doesn't interfere with other window.onload or <body onload> functions on the same page. 
				The script works in all modern browsers (with javascript enabled). 
			
				<script type="text/javascript">
					AddOnloadFunction(generic);
					AddOnloadFunction(testfunc);
				</script>
			*/
			function AddOnloadFunction(FunctionName){
				//setup onload function
				if(typeof window.addEventListener != 'undefined')
				{
					//.. gecko, safari, konqueror and standard
					window.addEventListener('load', FunctionName, false);
				}
				else if(typeof document.addEventListener != 'undefined')
				{
					//.. opera 7
					document.addEventListener('load', FunctionName, false);
				}
				else if(typeof window.attachEvent != 'undefined')
				{
					//.. win/ie
					window.attachEvent('onload', FunctionName);
				}
				
				//** remove this condition to degrade older browsers
				else
				{
					//.. mac/ie5 and anything else that gets this far
					
					//if there's an existing onload function
					if(typeof window.onload == 'function')
					{
						//store it
						var existing = onload;
						
						//add new onload handler
						window.onload = function()
						{
							//call existing onload function
							existing();
							
							//call generic onload function
							FunctionName;
						};
					}
					else
					{
						//setup onload function
						window.onload = FunctionName;
					}
				}
			}	
			
			
			
		// Onload Event Handler	
			/*
				SAMPLE USAGE:
				addLoadEvent(nameOfSomeFunctionToRunOnPageLoad);
				
				or
				
				addLoadEvent(function() {more code to run on page load });		
			*/
			
			function addLoadEvent(func) {
			  var oldonload = window.onload;
			  if (typeof window.onload != 'function') {
			    window.onload = func;
			  } else {
			    window.onload = function() {
			      if (oldonload) {
			        oldonload();
			      }
			      func();
			    }
			  }
			}	
	//////////////////////////////////////////////////////////////////////////////////////////		
	
	/////////////////////////////////////////////////////////////////////////
	/* GENERAL FUNCTIONS *///////////////////////////////////////////////////
	/////////////////////////////////////////////////////////////////////////		
		
		// Get Object
			/*
				Example Use: getObj("ObjID")
			*/
			function getObj(objID){
				Obj = document.getElementById(objID);
				return Obj;
			}
			
		// Function Exists
			/* 
				// Test for function
					if(functionExists('MyFunction')){
						// EXISTS - EXECUTE FUNCTION
							MyFunction();
					}
			*/
			function functionExists(functionName){
				var exists=false;
				eval("if (typeof " + functionName + " == 'function') {exists=true;} else {exists=false;}");
				return exists;
			}
		
		
		// Move to Bookmark on Same Page
			/*
				Example Use: gotoBookmark('MyBookMark');
			*/
			function gotoBookmark(bookmark){
				var hashValue = '#' + bookmark;
				if(location.hash!=hashValue){
					location.hash=hashValue;
				}
			}
		
		
		// Generate Unique ID
			function CreateUUID() {
				var UUID = new Date;
				UUID = UUID.getTime();
				UUID = encodeURIComponent(UUID);
				//alert(UUID);
				return UUID;
			}
		
		
		
		// Alerts User
			/* Sample Usage: onClick="return Alert('Enter Alert Text Here');" */
				function Alert(AlertTxt){
					alert(AlertTxt)
				}	
			
			
			
		// SafeEmail
			/*
				Prevents machines from grabbing e-mail addresses from website
				<script language="JavaScript">SafeEmail('John_Smith','SomeSite.com','Subject Line','Link Text');</script>
			*/
			function SafeEmail(EmailName,DomainName,SubjectLine,VisibleLink){
				if (VisibleLink=="")
				{VisibleLink = EmailName + '@' + DomainName};
				document.write('<a href=mailto:' + EmailName + '@' + DomainName + '?Subject=' + SubjectLine + '>' + VisibleLink + '</a>');
			}	
			
			
			
		// PageQuery
			/* Parses the Querystring */
				function PageQuery(q) { 
					if(q.length > 1) this.q = q.substring(1, q.length); 
					else this.q = null; 
					this.keyValuePairs = new Array(); 
					if(q) { 
					for(var i=0; i < this.q.split("&").length; i++) { 
					this.keyValuePairs[i] = this.q.split("&")[i]; 
					} 
					} 
					this.getKeyValuePairs = function() { return this.keyValuePairs; } 
					this.getValue = function(s) { 
					for(var j=0; j < this.keyValuePairs.length; j++) { 
					if(this.keyValuePairs[j].split("=")[0] == s) 
					return this.keyValuePairs[j].split("=")[1]; 
					} 
					return false; 
					} 
					this.getParameters = function() { 
					var a = new Array(this.getLength()); 
					for(var j=0; j < this.keyValuePairs.length; j++) { 
					a[j] = this.keyValuePairs[j].split("=")[0]; 
					} 
					return a; 
					} 
					this.getLength = function() { return this.keyValuePairs.length; } 
					} 
					function queryString(key){ 
					var page = new PageQuery(window.location.search); 
					return unescape(page.getValue(key)); 
				}  		
				
				
				
		// set the image over and down name convention	
			function P7_setMM2(){ //v2.0 by PVII
			 document.p7TabOver="_over";
			 document.p7TabDown="_down";
			 var dt=false;if(document.getElementsByTagName){dt=true;}if(document.P7TabBar){return;}
			 var i,k=-1,g,x,gg,tl,ts,ti,tm,tt,tsn,tu,el,args=P7_setMM2.arguments;
			 P7TabProp=new Array();for(i=0;i<args.length;i++){P7TabProp[i]=args[i];}
			 P7TabIM=new Array();P7TabSB=new Array();if(dt){tm=document.getElementsByTagName("IMG");
			 }else{tm=document.images;}tm=document.images;tt=new Array();tt=tt.concat(tm);
			 if(document.layers){for(i=0;i<document.layers.length;i++){ti=document.layers[i].document.images;
			 if(ti){tt=tt.concat(ti);}for(x=0;x<document.layers[i].document.layers.length;x++){
			 ti=document.layers[i].document.layers[x].document.images;if(ti){tt=tt.concat(ti);}}}tm=tt;}
			 for(i=0;i<tm.length;i++){tl=tm[i].name; if(dt&&!tl){tl=tm[i].id;}
			 if(tl.indexOf("p7TBim")==0){ts=tl.replace("p7TBim","");
			 tsn="p7TBsub"+ts;k++;P7TabIM[k]=tl;if((g=MM_findObj(tsn))!=null){P7TabSB[k]=tsn;
			 gg=(document.layers)?g:g.style;gg.visibility="hidden";}else{P7TabSB[k]='N';}}}
			 document.P7_TBswapd=new Array();document.P7_TBswapo=new Array();for(i=0;i<P7TabIM.length;i++){
			 g=MM_findObj(P7TabIM[i]);gg=g.src;g.p7TBim=g.src;tu=gg.lastIndexOf(".");
			 g.p7TBimo=gg.substring(0,tu)+document.p7TabOver+gg.substring(tu,gg.length);
			 g.p7TBimd=gg.substring(0,tu)+document.p7TabDown+gg.substring(tu,gg.length);
			 if(P7TabProp[2]>1){document.P7_TBswapo[i]=new Image();document.P7_TBswapo[i].src=g.p7TBimo;}
			 if(P7TabProp[2]>0){if(P7TabProp[2]==3){g.p7TBimd=g.p7TBimo;}document.P7_TBswapd[i]=new Image();
			 document.P7_TBswapd[i].src=g.p7TBimd;}}if((g=MM_findObj('P7TabH'))!=null){gg=(document.layers)?g:g.style;
			 gg.visibility="hidden";}if(dt&&P7TabProp[3]!='none'&&!window.opera){
			 g=document.getElementsByTagName("A");for(i=0;i<g.length;i++){if(g[i].hasChildNodes()){el=g[i].firstChild;
			 while (el){if(el.nodeType==3){gg=el.nodeValue;if(P7TabProp[3]==gg.replace("\n","")){
			 g[i].className=P7TabProp[4];break;}}el=el.firstChild;}}}}document.P7TabBar=true;
			}
			
			
			
		// trigger layer	
			function P7_trigMM2(bu){ //v2.0 by PVII
			 if(!document.P7TabBar){return;}var i,g,d,dB=-1,tF=false,sF=false;
			 for(i=0;i<P7TabSB.length;i++){sF=false;if((g=MM_findObj(P7TabSB[i]))!=null){g=MM_findObj(P7TabSB[i]);
			 gg=(document.layers)?g:g.style;sF=true;}d=MM_findObj(P7TabIM[i]);if(P7TabIM[i]==P7TabProp[0]){
			 dB=i;}if(P7TabIM[i]==bu){tF=true;if(sF){gg.visibility="visible";}if(P7TabProp[2]>0){
			 if(i==dB){d.src=d.p7TBimd;}else if (P7TabProp[2]>1){d.src=d.p7TBimo;}}if((g=MM_findObj('P7TabH'))!=null){
			 gg=(document.layers)?g:g.style;gg.visibility="visible";}}else{if(sF){gg.visibility="hidden";}
			 if(P7TabProp[2]>0){d.src=d.p7TBim;}}}if(!tF){if(dB>-1){d=MM_findObj(P7TabIM[dB]);
			 if((g=MM_findObj(P7TabSB[dB]))!=null&&P7TabProp[1]==0){gg=(document.layers)?g:g.style;
			 gg.visibility="visible";}if(P7TabProp[2]>0){d.src=d.p7TBimd;}}
			 if((g=MM_findObj('P7TabH'))!=null){gg=(document.layers)?g:g.style;gg.visibility="hidden";}}
			}	
	//////////////////////////////////////////////////////////////////////////////////////////	

	/////////////////////////////////////////////////////////////////////////
	/* NUMERIC FUNCTIONS *///////////////////////////////////////////////////
	/////////////////////////////////////////////////////////////////////////	
		
		// IsNumeric
			function isNumeric(value){
				var anum=/(^\d+$)|(^\d+\.\d+$)/;
				if (anum.test(value)){
					return true;
				}
				return false;
    		}
			
		// Rounding
			Math._round = Math.round;
			Math.round = function(num,dec){
				if (typeof(dec) == "undefined") dec = 0; else dec = Math.floor( dec );
				if (isNaN(num + dec) || dec < 0 || dec > 12) return Math._round( num );
				var n = Math.pow( 10, dec );
				return Math._round( num * n ) / n;
			}
			
		// Square
			function square(num){
	    		return num * num;
			}

		
	//////////////////////////////////////////////////////////////////////////////////////////	
	
	
	/////////////////////////////////////////////////////////////////////////
	/* ARRAY FUNCTIONS *///////////////////////////////////////////////////
	/////////////////////////////////////////////////////////////////////////			
	
		// Convert Array to Object Literal
			/*
				Purpose: tests for a value in a JavaScript array
				Example Usage: 
					if( name in ArrayToObjectLiteral(['bobby', 'sue','smith']) ) { ... }
					or
					if( name in ArrayToObjectLiteral(arrayName) ) { ... }
			*/		
			function ArrayToObjectLiteral(Array){
				var ObjectLiteral = {};
				for(var i=0;i<Array.length;i++){
					ObjectLiteral[Array[i]]='';
				}
				return ObjectLiteral;
			}
			
			
	
	
	//////////////////////////////////////////////////////////////////////////////////////////	

	
	/////////////////////////////////////////////////////////////////////////
	/* STRING FUNCTIONS *///////////////////////////////////////////////////
	/////////////////////////////////////////////////////////////////////////			
		
		// TRIM FUNCTIONS
			// Trim
				function trim(stringToTrim) {
					return stringToTrim.replace(/^\s+|\s+$/g,"");
				}
			// LTrim
				function ltrim(stringToTrim) {
					return stringToTrim.replace(/^\s+/,"");
				}
			// RTrim
				function rtrim(stringToTrim) {
					return stringToTrim.replace(/\s+$/,"");
				}
			
		// STRIP WHITE-SPACE
			function StripWhiteSpace(stringToTrim) {
				var StrippedString;
			  	StrippedString = stringToTrim.replace(/^\s*/, "").replace(/\s*$/, ""); 
			  	StrippedString = StrippedString.replace(/\s{2,}/, " "); 
			  	return StrippedString;
			}
			
		// LEFT & RIGHT FUNCTIONS	
			// Left
				function Left(str, n){
					if (n <= 0)
					    return "";
					else if (n > String(str).length)
					    return str;
					else
					    return String(str).substring(0,n);
				}
			// Right
				function Right(str, n){
				    if (n <= 0)
				       return "";
				    else if (n > String(str).length)
				       return str;
				    else {
				       var iLen = String(str).length;
				       return String(str).substring(iLen, iLen - n);
				    }
				}	
	
	//////////////////////////////////////////////////////////////////////////////////////////			
		
		
		
	/////////////////////////////////////////////////////////////////////////
	/* ONLOAD FUNCTIONS *///////////////////////////////////////////////////
	/////////////////////////////////////////////////////////////////////////		
	
	
		// AddOnloadFunction
			/*
				This script is an encapsulated onload function that doesn't interfere with other window.onload or <body onload> functions on the same page. 
				The script works in all modern browsers (with javascript enabled). 
			
				<script type="text/javascript">
					AddOnloadFunction(generic);
					AddOnloadFunction(testfunc);
				</script>
			*/
			function AddOnloadFunction(FunctionName){
				//setup onload function
				if(typeof window.addEventListener != 'undefined')
				{
					//.. gecko, safari, konqueror and standard
					window.addEventListener('load', FunctionName, false);
				}
				else if(typeof document.addEventListener != 'undefined')
				{
					//.. opera 7
					document.addEventListener('load', FunctionName, false);
				}
				else if(typeof window.attachEvent != 'undefined')
				{
					//.. win/ie
					window.attachEvent('onload', FunctionName);
				}
				
				//** remove this condition to degrade older browsers
				else
				{
					//.. mac/ie5 and anything else that gets this far
					
					//if there's an existing onload function
					if(typeof window.onload == 'function')
					{
						//store it
						var existing = onload;
						
						//add new onload handler
						window.onload = function()
						{
							//call existing onload function
							existing();
							
							//call generic onload function
							FunctionName;
						};
					}
					else
					{
						//setup onload function
						window.onload = FunctionName;
					}
				}
			}	
			
			
			
		// Onload Event Handler	
			/*
				SAMPLE USAGE:
				addLoadEvent(nameOfSomeFunctionToRunOnPageLoad);
				
				or
				
				addLoadEvent(function() {more code to run on page load });		
			*/
			
			function addLoadEvent(func) {
			  var oldonload = window.onload;
			  if (typeof window.onload != 'function') {
			    window.onload = func;
			  } else {
			    window.onload = function() {
			      if (oldonload) {
			        oldonload();
			      }
			      func();
			    }
			  }
			}	
	//////////////////////////////////////////////////////////////////////////////////////////		

	
			
	/////////////////////////////////////////////////////////////////////////
	/* Window Onload Manager (WOM) v1.0 *////////////////////////////////////
	/////////////////////////////////////////////////////////////////////////		
	
		/*************************************************************
		 * Author: Justin Barlow - www.netlobo.com
		 *
		 * Description:
		 * The WOM library of functions allows you to easily call
		 * multiple javascript functions when your page loads.
		 *
		 * Usage:
		 * Add functions to WOM using the womAdd() function. Pass the
		 * name of your functions (with or without parameters) into
		 * womAdd(). Then call womOn() like this:
		 *     womAdd('hideDiv()');
		 *     womAdd('changeBg("menuopts","#CCCCCC")');
		 *     womOn();
		 * WOM will now run when your page loads and run all of the
		 * functions you have added using womAdd()
		 *************************************************************/
		
		/*************************************************************
		 * The womOn() function will set the window.onload function to
		 * be womGo() which will run all of your window.onload
		 * functions.
		 *************************************************************/
		function womOn(){
			window.onload = womGo;
		}
		
		/*************************************************************
		 * The womGo() function loops through the woms array and
		 * runs each function in the array.
		 *************************************************************/
		function womGo(){
			for(var i = 0;i < woms.length;i++)
				eval(woms[i]);
		}
		
		/*************************************************************
		 * The womAdd() function will add another function to the woms
		 * array to be run when the page loads.
		 *************************************************************/
		function womAdd(func){
			woms[woms.length] = func;
		}
		
		/*************************************************************
		 * The woms array holds all of the functions you wish to run
		 * when the page loads.
		 *************************************************************/
		var woms = new Array();		
	//////////////////////////////////////////////////////////////////////////////////////////		

		
	
	/////////////////////////////////////////////////////////////////////////
	/* WINDOW INFO */////////////////////////////////////////////////////////
	/////////////////////////////////////////////////////////////////////////
	
		//Prevents user from leaving pop-up in background and not being able to use the link
			//window.focus();
		
		/*
		 if you want to add an extra column to the right of your page if the page is over a certain width (say 800 pixels) then you include the code 
		 for that column in an if statement that tests the page width like this:
		
			if (windowWidth() > 800) {
				// code for extra column goes here
			}
		
		If you want to test if a given object has moved outside of the browser window we might use code like this:
			if (obj.left < posLeft() ||
			obj.right > posRight() ||
			obj.top < posTop() ||
			obj.bottom > posBottom()) {
			// not fully visible on screen
			}
		
		Another thing you may want to do is to place an object in a particular position in the window independently of the scroll position of the page. 
		Let's say we want the object to be down 50 pixels and across 100 pixels from the top left corner of the window. Here's code to do this.
			obj.top = posTop() + 50;
			obj.left = posLeft() + 100; 
		
		*/
		
			
		/* 	windowWidthHeight
			Window width/height indicate the current viewable window size
			
			EXAMPLE USE: 
			// Determine window width/height
				var WinWidthHeight = windowWidthHeight();
				var WinWidth = WinWidthHeight[0];
				var WinHeight = WinWidthHeight[1];
		*/
			function windowWidthHeight() {var width='', height=''; width=windowWidth(); height=windowHeight();  return [width,height];};
			function windowWidth() {return window.innerWidth != null? window.innerWidth : document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body != null ? document.body.clientWidth : null;} 
			function windowHeight() {return  window.innerHeight != null? window.innerHeight : document.documentElement && document.documentElement.clientHeight ?  document.documentElement.clientHeight : document.body != null? document.body.clientHeight : null;} 

		/* 	scrollWidthHeight
			Scroll width/height indicate the current position the user has scrolled to
			
			EXAMPLE USE: 
			// Determine scroll width/height
				var WinScrollWidthHeight = scrollWidthHeight();
				var WinScrollWidth = WinScrollWidthHeight[0];
				var WinScrollHeight = WinScrollWidthHeight[1];
		*/
			function scrollWidthHeight() {var width='', height=''; width=scrollWidth(); height=scrollHeight();  return [width,height];};
			function scrollWidth() {var w = window.pageXOffset || document.body.scrollLeft || document.documentElement.scrollLeft;return w ? w : 0;}
			function scrollHeight() {var h = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop; return h ? h : 0;}

		
		/* 	posTRBL
			Position coordinates indicate the current viewable screen area
			
			EXAMPLE USE: 
			// Determine current viewable screen area
				var WinPosition = posTRBL();
				var WinPositionTop = WinPosition[0];
				var WinPositionRight = WinPosition[1];
				var WinPositionBottom = WinPosition[2];
				var WinPositionLeft = WinPosition[3];
		*/
		// 
			function posTop() {return typeof window.pageYOffset != 'undefined' ?  window.pageYOffset : document.documentElement && document.documentElement.posTop ? document.documentElement.posTop : document.body.posTop ? document.body.posTop : 0;} 
			function posRight() {return posLeft()+windowWidth();} 
			function posBottom() {return posTop()+windowHeight();}
			function posLeft() {return typeof window.pageXOffset != 'undefined' ? window.pageXOffset :document.documentElement && document.documentElement.posLeft ? document.documentElement.posLeft : document.body.posLeft ? document.body.posLeft : 0;} 
			function posTRBL() {var top = '', right = '', bottom = '', left = ''; top = posTop(); right = posRight(); bottom = posBottom(); left = posLeft();  return [top,right,bottom,left];};
  
		/* 	WindowInfo
			Get window width/height; window scroll width/height; window position;
			
			EXAMPLE USE: 
			// Get Window Info
				var WinInfo = WindowInfo();
				var WinWidth = WinInfo[0];
				var WinHeight = WinInfo[1];
				var WinScrollWidth = WinInfo[2];
				var WinScrollHeight = WinInfo[3];
				var WinPositionTop = WinInfo[4];
				var WinPositionRight = WinInfo[5];
				var WinPositionBottom = WinInfo[6];
				var WinPositionLeft = WinInfo[7];
		*/
		
		function WindowInfo(){
			// Window width/height
				var WinWidthHeight = windowWidthHeight();
				var WinWidth = WinWidthHeight[0];
				var WinHeight = WinWidthHeight[1];
			// Scroll width/height
				var WinScrollWidthHeight = scrollWidthHeight();
				var WinScrollWidth = WinScrollWidthHeight[0];
				var WinScrollHeight = WinScrollWidthHeight[1];
			// Window Position
				var WinPosition = posTRBL();
				var WinPositionTop = WinPosition[0];
				var WinPositionRight = WinPosition[1];
				var WinPositionBottom = WinPosition[2];
				var WinPositionLeft = WinPosition[3];
			return [WinWidth,WinHeight,WinScrollWidth,WinScrollHeight,WinPositionTop,WinPositionRight,WinPositionBottom,WinPositionLeft];

		}
	//////////////////////////////////////////////////////////////////////////////////////////
	
	/////////////////////////////////////////////////////////////////////////
	/* DOCUMENT INFO *///////////////////////////////////////////////////////
	/////////////////////////////////////////////////////////////////////////
		/* 	DocumentInfo
			Get document width/height;
			
			EXAMPLE USE: 
			// Get Document Info
				var DocInfo = DocumentInfo();
				var DocWidth = DocInfo[0];
				var DocHeight = DocInfo[1];
		*/
		
		function DocumentInfo(){
			// Document width/height
				var DocWidthHeight = documentWidthHeight();
				var DocWidth = DocWidthHeight[0];
				var DocHeight = DocWidthHeight[1];
			return [DocWidth,DocHeight];
		}
		
		
		function documentWidthHeight() {
		    var D = document;
			var DocWidth;
			var DocHeight;
			DocWidth =  Math.max(
		        Math.max(D.body.scrollWidth, D.documentElement.scrollWidth),
		        Math.max(D.body.offsetWidth, D.documentElement.offsetHWidth),
		        Math.max(D.body.clientWidth, D.documentElement.clientWidth)
		    );
			DocHeight =  Math.max(
		        Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
		        Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
		        Math.max(D.body.clientHeight, D.documentElement.clientHeight)
		    );
			return [DocWidth,DocHeight];
		}
		
	
	//////////////////////////////////////////////////////////////////////////////////////////
	
	
	/////////////////////////////////////////////////////////////////////////
	/* GET MOUSE POSITION *//////////////////////////////////////////////////
	/////////////////////////////////////////////////////////////////////////
	
		var MouseX = 0;
		var MouseY = 0;
		function getMousePosition(e) { 
			if (e && e.clientX && typeof(window.scrollY) == 'number') { 
				// Moz
					MouseX = e.clientX + window.scrollX;
					MouseY = e.clientY + window.scrollY;
			}
			else if (window.event) { 
				// IE
					if (document.documentElement){  
						// Explorer 6 Strict
							MouseX = window.event.clientX + document.documentElement.scrollLeft - 4;
							MouseY = window.event.clientY + document.documentElement.scrollTop - 4;
					}
					else if (document.body){
						// all other Explorers
							MouseX=window.event.clientX+document.body.scrollLeft-4;
							MouseY=window.event.clientY+document.body.scrollTop-4;
					}
			}
		}
		
		/*
		document.onmousemove = mouseMove;
		
		function mouseMove(ev){
			ev           = ev || window.event;
			var mousePos = mouseCoords(ev);
		}
		
		function mouseCoords(ev){
			if(ev.pageX || ev.pageY){
				return {x:ev.pageX, y:ev.pageY};
			}
			return {
				x:ev.clientX + document.body.scrollLeft - document.body.clientLeft,
				y:ev.clientY + document.body.scrollTop  - document.body.clientTop
			};
		}

		*/
	//////////////////////////////////////////////////////////////////////////////////////////	
	
	
	/////////////////////////////////////////////////////////////////////////
	/* GET PAGE BOUNDARIES RELATIVE TO MOUSE POSITION *//////////////////////
	/////////////////////////////////////////////////////////////////////////
		var DistanceRightEdge = 0;
		var DistanceBottom = 0;
		function getPageBoundariesRelToMousePos(){
			if (window.innerWidth) {
				DistanceRightEdge = window.innerWidth-(MouseX - window.scrollX);
				DistanceBottom = window.innerHeight-(MouseY - window.scrollY);
			} 
			else if (document.body.clientWidth) {
				DistanceRightEdge = document.body.clientWidth-MouseX;
				DistanceBottom = document.body.clientHeight-MouseY;
			}
		}	
		
	//////////////////////////////////////////////////////////////////////////////////////////	
	
	


			
	/////////////////////////////////////////////////////////////////////////
	/* BROWSER DETECTION IDENTIFICATION */////////////////////////////////////
	/////////////////////////////////////////////////////////////////////////				
		// Browser Identifier/Detection
			function IdentifyBrowser (){
				var nVer = navigator.appVersion;
				var nAgt = navigator.userAgent;
				var browserName  = navigator.appName;
				var fullVersion  = ''+parseFloat(navigator.appVersion); 
				var majorVersion = parseInt(navigator.appVersion,10);
				var nameOffset,verOffset,ix;
				
				// In MSIE, the true version is after "MSIE" in userAgent
				if ((verOffset=nAgt.indexOf("MSIE"))!=-1) {
				 browserName = "Microsoft Internet Explorer";
				 fullVersion = nAgt.substring(verOffset+5);
				}
				// In Opera, the true version is after "Opera" 
				else if ((verOffset=nAgt.indexOf("Opera"))!=-1) {
				 browserName = "Opera";
				 fullVersion = nAgt.substring(verOffset+6);
				}
				// In Chrome, the true version is after "Chrome" 
				else if ((verOffset=nAgt.indexOf("Chrome"))!=-1) {
				 browserName = "Chrome";
				 fullVersion = nAgt.substring(verOffset+7);
				}
				// In Safari, the true version is after "Safari" 
				else if ((verOffset=nAgt.indexOf("Safari"))!=-1) {
				 browserName = "Safari";
				 fullVersion = nAgt.substring(verOffset+7);
				}
				// In Firefox, the true version is after "Firefox" 
				else if ((verOffset=nAgt.indexOf("Firefox"))!=-1) {
				 browserName = "Firefox";
				 fullVersion = nAgt.substring(verOffset+8);
				}
				// In most other browsers, "name/version" is at the end of userAgent 
				else if ( (nameOffset=nAgt.lastIndexOf(' ')+1) < (verOffset=nAgt.lastIndexOf('/')) ) 
				{
				 browserName = nAgt.substring(nameOffset,verOffset);
				 fullVersion = nAgt.substring(verOffset+1);
				 if (browserName.toLowerCase()==browserName.toUpperCase()) {
				  browserName = navigator.appName;
				 }
				}
				// trim the fullVersion string at semicolon/space if present
				if ((ix=fullVersion.indexOf(";"))!=-1) fullVersion=fullVersion.substring(0,ix);
				if ((ix=fullVersion.indexOf(" "))!=-1) fullVersion=fullVersion.substring(0,ix);
				
				majorVersion = parseInt(''+fullVersion,10);
				if (isNaN(majorVersion)) {
				 fullVersion  = ''+parseFloat(navigator.appVersion); 
				 majorVersion = parseInt(navigator.appVersion,10);
				}
				
				return (browserName + '|' + majorVersion);
				
				//document.write('Browser name  = '+browserName+'<br>');
				//document.write('Full version  = '+fullVersion+'<br>');
				//document.write('Major version = '+majorVersion+'<br>');
				//document.write('navigator.appName = '+navigator.appName+'<br>');
				//document.write('navigator.userAgent = '+navigator.userAgent+'<br>');	
			}
			
			
				
		// Detect iPhone
			function detectiPhone(){
				if ((navigator.userAgent.indexOf('iPhone') != -1) ||  (navigator.userAgent.indexOf('iPod') != -1)) {  
					// iPhone or iPod
						return true;
				}  
				else{
					return false;
				}
			}		
				
				
		/* 	PLUGIN DETECTOR */
			/*	
				This script detects the following:
					Flash
					Windows Media Player
					Java
					Shockwave
					RealPlayer
					QuickTime
					Acrobat Reader
					SVG Viewer
					
				Example Usage:
				 	
					<script language="JavaScript">
						PluginDetector();
						if (pluginlist.indexOf("Flash")!=-1){
							alert('You have flash installed');
						}
						else{
							alert('You DO NOT have flash installed');
						}
					</script>
			*/
		function PluginDetector(){
			var agt=navigator.userAgent.toLowerCase();
			var ie  = (agt.indexOf("msie") != -1);
			var ns  = (navigator.appName.indexOf("Netscape") != -1);
			var win = ((agt.indexOf("win")!=-1) || (agt.indexOf("32bit")!=-1));
			var mac = (agt.indexOf("mac")!=-1);
			
			if (ie && win) {	pluginlist = detectIE("Adobe.SVGCtl","SVG Viewer") + detectIE("SWCtl.SWCtl.1","Shockwave Director") + detectIE("ShockwaveFlash.ShockwaveFlash.1","Shockwave Flash") + detectIE("rmocx.RealPlayer G2 Control.1","RealPlayer") + detectIE("QuickTimeCheckObject.QuickTimeCheck.1","QuickTime") + detectIE("MediaPlayer.MediaPlayer.1","Windows Media Player") + detectIE("PDF.PdfCtrl.5","Acrobat Reader"); }
			if (ns || !win) {
					nse = ""; for (var i=0;i<navigator.mimeTypes.length;i++) nse += navigator.mimeTypes[i].type.toLowerCase();
					pluginlist = detectNS("image/svg-xml","SVG Viewer") + detectNS("application/x-director","Shockwave Director") + detectNS("application/x-shockwave-flash","Shockwave Flash") + detectNS("audio/x-pn-realaudio-plugin","RealPlayer") + detectNS("video/quicktime","QuickTime") + detectNS("application/x-mplayer2","Windows Media Player") + detectNS("application/pdf","Acrobat Reader");
			}
			
			function detectIE(ClassID,name) { result = false; document.write('<SCRIPT LANGUAGE=VBScript>\n on error resume next \n result = IsObject(CreateObject("' + ClassID + '"))</SCRIPT>\n'); if (result) return name+','; else return ''; }
			function detectNS(ClassID,name) { n = ""; if (nse.indexOf(ClassID) != -1) if (navigator.mimeTypes[ClassID].enabledPlugin != null) n = name+","; return n; }
			
			pluginlist += navigator.javaEnabled() ? "Java," : "";
			if (pluginlist.length > 0) pluginlist = pluginlist.substring(0,pluginlist.length-1);
		}				
		
		
		// Check for Flash and write browser plugin appropriate code
			function FlashCheck(FlashVer,FlashCode,NonFlashCode){
				if ((navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.indexOf("Mac") == -1 && navigator.appVersion.indexOf("3.1") == -1) || (navigator.plugins && navigator.plugins["Shockwave Flash"]) || navigator.plugins["Shockwave Flash" + FlashVer]){
					// Insert Flash Object
						document.write(FlashCode);
				}
			   else {
					// Insert Image/Non-Flash Code
						document.write(NonFlashCode);
				}
			}
				
	//////////////////////////////////////////////////////////////////////////////////////////					
	
	
	
	/////////////////////////////////////////////////////////////////////////
	/* WINDOW FUNCTIONS *////////////////////////////////////////////////////
	/////////////////////////////////////////////////////////////////////////		
	
	// 	Minimize Browser Window
		function Minimize() {
			window.innerWidth = 100;
			window.innerHeight = 100;
			window.screenX = screen.width;
			window.screenY = screen.height;
			alwaysLowered = true;
		}
		
		
		
	// 	Maximize Browser Window	
		function Maximize() {
			window.innerWidth = screen.width;
			window.innerHeight = screen.height;
			window.screenX = 0;
			window.screenY = 0;
			alwaysLowered = false;
		}		
	
	
	
	// Close Parent Window	
		/*	
			Sample Usage: 
			<cfparam name="ATTRIBUTES.CloseParent" default="">
			<cfif ATTRIBUTES.CloseParent EQ "Yes">
				<cfset VARIABLES.AdditionalBodyTags='onload="closeParent();"'>
			</cfif>
		*/
		function closeParent(){ 
			try{ 
				var q = queryString("CloseParent"); 
				if( q=="Yes" ){ 
					var op = window.opener; 
					op.opener = self; 
					op.close(); 
				} 
			} 
			catch(er){} 
		} 
	
	
	
	//Update Parent Window and Close Pop-up Window
		/* Sample Usage: onClick="return UpdateParentClosePopup('Enter Redirect URL Here');" */
		function UpdateParentClosePopup(RedirectURL){
			opener.location.href=RedirectURL;
			close();	
		}
		
		
		
	// Opens Custom Pop-Up Window in Center of User's Screen
	/*  To implement this JavaScript, simply cut/paste the following code into your form and enter the desired values for the stated variables 
	    <a href="JavaScript:NewWindow('url','windowname','w','h','scroll','resizable','location','status','menubar','toolbar');">Text or Image Link</a> 
		# url= the url of the page that will fill the window.
		# windowname = the name of the window. This you need. We are going to use commands intended to alter the window the script is opening. In order 
		  for the JavaScript to know what item it is dealing with, the item has to have a name. So we give it one. I went with newwindow. But it could have just as easily been zork, or woohaa, or raspberry.
		# config = denotes that what follows configures the window. (This command really isn't required, but it's a good idea to use just to keep things straight)
		# height = 100 denotes the height of the window in pixels.
		# width = 400 denotes the width of the window in pixels.
		# toolbar = no denotes if there will be a toolbar on the newly opened window. Set this to yes if you want one - no if you don't.
		  The toolbar is the line of buttons at the top of the browser window that contains the BACK, FORWARD, STOP, RELOAD, etc.
		# menubar = no denotes if there will be a menubar. Set this to yes if you want one - no if you don't.
		  The menubar is the line of items above labeled FILE, EDIT, VIEW, GO, etc.
		# scrollbars=no denotes if there will be scrollbars or not. Ditto with the yes and no deal. I wouldn't make a new window that would need scrollbars anyway. I think it kills the effect.
		# resizable=no denotes if the user can change the size of the window by dragging or not.
		# location=no denotes if there will be a location bar on the newly opened window. Use yes and no again.
		  The location bar is the space at the top of the browser window where the page URL is displayed.
		# directories=no denotes if there will be a directories bar on the new window. Use yes and no.
		  This is the bar at the top of the browser window that has the bookmarks and such.
		# status=no denotes if there will be a status bar. Use yes and no.
		  The status bar is the area at the very bottom of the browser screen that tells you "Document Done". 
	*/
		function NewWindow(url,windowname,w,h,scroll,resizable,location,status,menubar,toolbar){
		  var winWidth = (screen.width-w)/2;
		  var winHeight = (screen.height-h)/2;
		  var settings  ='height='+h+',';
		      settings +='width='+w+',';
		      settings +='top='+winHeight+',';
		      settings +='left='+winWidth+',';
		      settings +='scrollbars='+scroll+',';
		      settings +='resizable='+resizable+',';
		      settings +='location='+location+',';
		      settings +='status='+status+',';
		      settings +='menubar='+menubar+',';
		      settings +='toolbar='+toolbar+',';
		  var win = window.open(url,windowname,settings);
		  if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
		}
	//////////////////////////////////////////////////////////////////////////////////////////				
		
		

	/////////////////////////////////////////////////////////////////////////
	/* Pop Under *///////////////////////////////////////////////////////////
	/////////////////////////////////////////////////////////////////////////	
		/*
			LaunchPopUnder(URL,width,height,OncePerSession)
			
			URL					URL of pop under
			width				Width of pop under
			height				Height of pop under
			OncePerSession		Determines whehter pop under will be displayed once or mulitple times per session
								Specifying 1 will cause it to load only once per session.
								Putting 0 will cause the Popunder to load every time page is loaded.
		
		*/
		
		function LaunchPopUnder(URL,width,height,OncePerSession) {
			// Specify Pop Under Window Parameters
				var winParameters = 'scrollbars=no,resizable=yes,toolbar=no,menubar=no,status=no,location=yes,left=85,top=20,height=' +  height + ',width=' + width;
			// Determine if pop under to be loaded once per session
				if (OncePerSession==0){
					loadPopUnder(URL,width,height,winParameters)
				}
				else{
					determineLoadPopUnder(URL,width,height,winParameters)
				}
		}
		
		function loadPopUnder(URL,width,height,winParameters){
			win2=window.open(URL,"pu",winParameters);
			try {
				win2.blur();
				window.focus();
			} 
			catch(e) {}
		}
		
		function determineLoadPopUnder(URL,width,height,winParameters){
			if (getPopUnderCookie('popunder')==''){
				loadPopUnder(URL,width,height,winParameters);
				document.cookie="popunder=yes";
			}
		}
			
		function getPopUnderCookie(Name){
			var search = Name + "="
			var returnvalue = "";
			if (document.cookie.length > 0) {
				offset = document.cookie.indexOf(search)
				if (offset != -1) {
		 			offset += search.length
		 			end = document.cookie.indexOf(";", offset);
					if (end == -1){
		    			end = document.cookie.length;
		    			returnvalue=unescape(document.cookie.substring(offset, end));
					}
		 		}
			}
			return returnvalue;
		}		
	//////////////////////////////////////////////////////////////////////////////////////////		

				
				
	/////////////////////////////////////////////////////////////////////////
	/* ELEMENT INFO *////////////////////////////////////////////////////////
	/////////////////////////////////////////////////////////////////////////
		/* 	elementPos
			Get position of element
			
			EXAMPLE USE: 
			// Get Element Position
				var ElementPos = elementPos('ElementID');
				var ElementPosLeft = ElementPos[0];
				var ElementPosTop = ElementPos[1];
				
		*/
		function elementPos(elementID) {var obj = document.getElementById(elementID); var curleft = 0; var curtop = 0; if (obj.offsetParent) {do {curleft += obj.offsetLeft; curtop += obj.offsetTop;} while (obj = obj.offsetParent);return [curleft,curtop];}}

		/* 	elementDimensions
			Get dimensions of element
			
			EXAMPLE USE: 
			// Get Element Dimensions
				var ElementDimensions = elementDimensions('ElementID');
				var ElementWidth = ElementDimensions[0];
				var ElementHeight = ElementDimensions[1];
				
		*/
		function elementDimensions(elementID) {
			var obj = document.getElementById(elementID);
			var objWidth = obj.offsetWidth;
			var objHeight = obj.offsetHeight;
			return [objWidth,objHeight];
		}
	//////////////////////////////////////////////////////////////////////////////////////////		
		
		
		
	/////////////////////////////////////////////////////////////////////////
	/* ELEMENT FUNCTIONS */////////////////////////////////////////////////////
	/////////////////////////////////////////////////////////////////////////			
		
		// Create Element
			/*
				CreateElement("MyElement","div","class,MyClass|style,width:250px;","body","Tag||ID","0");
			*/
			function CreateElement(ElementID,TagName,ElementAttributes,AppendToElement,GetElementMethod,NodePosition){
				 // Check to see if element already exists
					 var ElementObj = document.getElementById(ElementID);
					 if (ElementObj) { 
					 	// Element Already Exists
			     			return;
			   		 }
					 else{
					 	// Element Does NOT Exist
							// Create Element
								var NewElement=document.createElement(TagName);
							// Determine if Element ID Provided
								if(ElementID.length > 0){
									// Element ID Provided
										NewElement.setAttribute("id", ElementID);
								}
							// Determine if Element Attributes Provided
								if(ElementAttributes.length > 0){
									// Attributes Provided
										var Attribute;
						 				var AttributeName;
										var AttributeValue;
										var Position;
										var Attributes = ElementAttributes.split("|");
										for(var i=0; i < Attributes.length; i++){
											Attribute = Attributes[i];
											Position = Attribute.indexOf(",");
											AttributeName=Attribute.substr(0,Position);
											AttributeValue=Attribute.substr(Position + 1,Attribute.length);
											NewElement.setAttribute(AttributeName, AttributeValue);
										}
								}
							// Determine if New Element Should Be Appended to EXisting Element
								if(AppendToElement.length > 0){
									// APPEND ELEMENT
										// Determine Method of Identifying Append To Object
											var AppendToElementObj;
											if(GetElementMethod=="Tag"){
												// Get Element By Tag Name
													// Determine Node Position
														if(NodePosition){
															NodePosition = parseInt(NodePosition);
															if(NodePosition < 0){NodePosition=0};
														}
														else{
															NodePosition = 0;
														}
													AppendToElementObj=document.getElementsByTagName(AppendToElement)[NodePosition];
											}
											else{
												// Get Element By ID
													AppendToElementObj=document.getElementById(AppendToElement);
											}
										// Append Element
											AppendToElementObj.appendChild(NewElement);
								}
							
					 }
			}
			
		// Remove Element
			function RemoveElement(ElemID){
				var ElementToRemove = document.getElementById(ElemID);
				if (ElementToRemove) {
				    ElementToRemove.parentNode.removeChild(ElementToRemove);
				}
			}	
			
		// Copy Element
			function CopyElement(ElemID){
				var ElementToCopy = document.getElementById(ElemID);
				if (ElementToCopy) {
				    return ElementToCopy.cloneNode(true);
				}
			}
			
		// Append Element
			function AppendElement(AppendElementID,AppendToElement,GetElementMethod,NodePosition){
				var AppendElementObj = document.getElementById(AppendElementID).cloneNode(true);
				// Determine Method of Identifying Append To Object
					var AppendToElementObj;
					if(GetElementMethod=="Tag"){
						// Get Element By Tag Name
							// Determine Node Position
								if(NodePosition){
									NodePosition = parseInt(NodePosition);
									if(NodePosition < 0){NodePosition=0};
								}
								else{
									NodePosition = 0;
								}
							AppendToElementObj=document.getElementsByTagName(AppendToElement)[NodePosition];
					}
					else{
						// Get Element By ID
							AppendToElementObj=document.getElementById(AppendToElement);
					}
				// Append Element
					AppendToElementObj.appendChild(AppendElementObj);
			}
			
		// Move Element
			function MoveElement(MoveElemID,MoveToElemID,GetElementMethod,NodePosition){
				// Append Element	
					AppendElement(MoveElemID,MoveToElemID,GetElementMethod,NodePosition)
				// Remove Element
					RemoveElement(MoveElemID);
			}		
			
		// Add Attribute
			function AddAttribute(Element, AttName, AttVal){
				Element.setAttribute(AttName, AttVal);
			}			
		
		function whichElement(e){
			var targ;
			if (!e)
			  {
			  var e=window.event;
			  }
			if (e.target)
			  {
			  targ=e.target;
			  }
			else if (e.srcElement)
			  {
			  targ=e.srcElement;
			  }
			if (targ.nodeType==3) // defeat Safari bug
			  {
			  targ = targ.parentNode;
			  }
			var tname;
			tname=targ.tagName;
			alert("You clicked on a " + tname + " element.");
		}
		
		// Scroll to Location of HTML Element
			function scrollToElement(elementID) {
				var ObjPosition = elementPos(elementID);
				var X = ObjPosition[0];
				var Y = ObjPosition[1];
				// Move User to Y Coordinate
					window.scrollTo(0,Y);
			}	
			
		// Scroll within an Object
			function scrollObject(ObjectID,position){
				var Obj = document.getElementById(ObjectID);
				if(position=="top"){
					// Scroll to Top
						Obj.scrollTop=0;
				}
				else{
					// Scroll to Bottom
						Obj.scrollTop=Obj.scrollHeight;
				}
			}
		
		// Snap DHTML Layer to HTML Object
			/* 
				P7_Snap('ElementIDToSnapTo','ElementIDOFElementToBeSnapped',0,0); 
			*/
			function P7_Snap() { //v2.63 by PVII
			 var x,y,ox,bx,oy,p,tx,a,b,k,d,da,e,el,tw,q0,xx,yy,w1,pa='px',args=P7_Snap.arguments;a=parseInt(a);
			 if(document.layers||window.opera){pa='';}for(k=0;k<(args.length);k+=4){
			 if((g=MM_findObj(args[k]))!=null){if((el=MM_findObj(args[k+1]))!=null){
			 a=parseInt(args[k+2]);b=parseInt(args[k+3]);x=0;y=0;ox=0;oy=0;p="";tx=1;
			 da="document.all['"+args[k]+"']";if(document.getElementById){
			 d="document.getElementsByName('"+args[k]+"')[0]";if(!eval(d)){
			 d="document.getElementById('"+args[k]+"')";if(!eval(d)){d=da;}}
			 }else if(document.all){d=da;}if(document.all||document.getElementById){while(tx==1){
			 p+=".offsetParent";if(eval(d+p)){x+=parseInt(eval(d+p+".offsetLeft"));y+=parseInt(eval(d+p+".offsetTop"));
			 }else{tx=0;}}ox=parseInt(g.offsetLeft);oy=parseInt(g.offsetTop);tw=x+ox+y+oy;
			 if(tw==0||(navigator.appVersion.indexOf("MSIE 4")>-1&&navigator.appVersion.indexOf("Mac")>-1)){
			  ox=0;oy=0;if(g.style.left){x=parseInt(g.style.left);y=parseInt(g.style.top);}else{
			  w1=parseInt(el.style.width);bx=(a<0)?-5-w1:-10;a=(Math.abs(a)<1000)?0:a;b=(Math.abs(b)<1000)?0:b;
			  x=document.body.scrollLeft+event.clientX+bx;y=document.body.scrollTop+event.clientY;}}
			 }else if(document.layers){x=g.x;y=g.y;q0=document.layers,dd="";for(var s=0;s<q0.length;s++){
			  dd='document.'+q0[s].name;if(eval(dd+'.document.'+args[k])){x+=eval(dd+'.left');y+=eval(dd+'.top');
			  break;}}}e=(document.layers)?el:el.style;xx=parseInt(x+ox+a),yy=parseInt(y+oy+b);
			 if(navigator.appVersion.indexOf("MSIE 5")>-1 && navigator.appVersion.indexOf("Mac")>-1){
			  xx+=parseInt(document.body.leftMargin);yy+=parseInt(document.body.topMargin);}
			 e.left=xx+pa;e.top=yy+pa;}}}
			}	
			
		// Get Elements By Class	
			/*
			   	1. Supply a class name as a string.
   				2. (optional) Supply a node. This can be obtained by getElementById, or simply by just throwing in “document” (it will be document if don’t supply a node)). It’s mainly useful if you know your parent and you don’t want to loop through the entire D.O.M.
  			 	3. (optional) Limit your results by adding a tagName. Very useful when you’re toggling checkboxes and etcetera. You could just supply “input“. Or, if you’re like me, and you said Good Bye to IE5, you can use the “*” asterisk as a catch-all (meaning ‘any element).
			
				EXAMPLE USAGE: 		var NodeToSearchIn = document.getElementById('MyDiv');
									var MyElements = getElementsByClass('ElementClassName',NodeToSearchIn,'HTMLTagToSearchFor i.e. table, tr, td');
									// Loop over returned elements
										for(i=0; i<MyElements.length; i++){
											// hide every element with class 'ElementClassName'
												MyElements[i].style.display = 'none';
										}
							
			*/
			
			function getElementsByClass(searchClass, domNode, tagName) {
				if (domNode == null) domNode = document;
				if (tagName == null) tagName = '*';
				var classElements = new Array();
				var tags = domNode.getElementsByTagName(tagName);
				var tcl = " "+searchClass+" ";
				for(i=0,j=0; i<tags.length; i++) {
					var test = " " + tags[i].className + " ";
					if (test.indexOf(tcl) != -1)
						classElements[j++] = tags[i];
				}
				return classElements;
			}
	//////////////////////////////////////////////////////////////////////////////////////////
			

	/////////////////////////////////////////////////////////////////////////
	/* PAGE LOADER */////////////////////////////////////////////////////////
	/////////////////////////////////////////////////////////////////////////	
	
	/*
		<!-- THREE STEPS TO INSTALL PRELOAD PAGE:
		  1.  Copy the coding into the HEAD of your HTML document
		  2.  Add the onLoad event handler into the BODY tag
		  3.  Put the last coding into the BODY of your HTML document  -->

		  STEP ONE: Paste this code into the HEAD of your HTML document
			<SCRIPT LANGUAGE="JavaScript">
			<!-- Original:  Kevin Eskew -->
			
			<!-- This script and many more are available free online at -->
			<!-- The JavaScript Source!! http://javascript.internet.com -->
			
			<!-- Begin
				function PageLoader() {
				if (document.getElementById) {  // DOM3 = IE5, NS6 document.getElementById('PageLoadingMsg').style.visibility = 'hidden'; } else { if (document.layers) {  // Netscape 4 document.PageLoadingMsg.visibility = 'hidden'; } else {  // IE 4 document.all.PageLoadingMsg.style.visibility = 'hidden';
				      }
				   }
				}
			//  End -->
			</script>

		<!-- STEP TWO: Insert the onLoad event handler into your BODY tag (If using the 'AdditionalBodyTags' variable, set the var using the following: <cfset VARIABLES.AdditionalBodyTags='OnLoad="PageLoader();"'>   -->
			<BODY OnLoad="PageLoader()">

		<!-- STEP THREE: Copy this code into the BODY of your HTML document  -->
			<div id="PageLoadingMsg" style="position: absolute; left:5px; top:5px;
			background-color: #FFFFCC; layer-background-color: #FFFFCC; height: 100%; width: 100%;"> 
			
			<table width=100%><tr><td>Page loading ... Please wait.</td></tr></table></div> 
	*/
		function PageLoader() 
		{
			// Preload image used in loading message
				Image1= new Image(32,32) //width,height
				Image1.src = "#VARIABLES.DirLevel#images/ProcessingWheel.gif"
			
			if (document.getElementById) 
			{  	
				// DOM3 = IE5, NS6
					var DivObj = document.getElementById('PageLoader');
					var DivObj2 = document.getElementById('PageContent');
					// Determine if page loading message is already being displayed
						if(DivObj.style.display != "block")
						{
							DivObj.style.display = "block";
							DivObj2.style.display = "none";
						}
						else
						{
							DivObj.style.display = "none";
							DivObj2.style.display = "block";
						}
			}
			else 
			{
				if (document.layers) 
				{  
					// Netscape 4
						var DivObj = 'document.PageLoader';
						var DivObj2 = 'document.PageContent';
						// Determine if page loading message is already being displayed
							if(DivObj.style.display != "block")
							{
								DivObj.style.display = "block";
								DivObj2.style.display = "none";
							}
							else
							{
								DivObj.style.display = "none";
								DivObj2.style.display = "block";
							}
				}
				else 
				{  
					// IE 4
						var DivObj = 'document.PageLoader';
						var DivObj2 = 'document.PageContent';
						// Determine if page loading message is already being displayed
							if(DivObj.style.display != "block")
							{
								DivObj.style.display = "block";
								DivObj2.style.display = "none";
							}
							else
							{
								DivObj.style.display = "none";
								DivObj2.style.display = "block";
							}
			    }
			}
		}
	//////////////////////////////////////////////////////////////////////////////////////////	

		
	/////////////////////////////////////////////////////////////////////////
	/* LAYER MANAGEMENT *////////////////////////////////////////////////////
	/////////////////////////////////////////////////////////////////////////			
		/* LayerMngmnt Function 
			<!-- TWo STEPS TO INSTALL LayerMngmnt:
			  1.  Copy the coding into the HEAD of your HTML document
			  2.  Add the onClick event handler into the submit button  -->
	
			  STEP ONE: Paste this code into the HEAD of your HTML document
				<SCRIPT LANGUAGE="JavaScript">
				<!-- Original:  Kevin Eskew -->
				
				<!-- Begin
					function LayerMngmnt(LayerName,VisibiltyStatus) {
					if (document.getElementById) // DOM3 = IE5, NS6	{ document.getElementById(LayerName).style.visibility = VisibiltyStatus;}else {if (document.layers) // Netscape 4{ document.LayerName.visibility = VisibiltyStatus;}else // IE 4 { document.all.LayerName.style.visibility = VisibiltyStatus;
				      	  }
				       }		
					}	
				//  End -->
				</script>
	
			<!-- STEP TWO: Insert the onLoad event handler into your BODY tag (If using the 'AdditionalBodyTags' variable, set the var using the following: <cfset VARIABLES.AdditionalBodyTags='OnLoad="PageLoader();"'>   -->
				<input type="button" name="submit" value="Submit" onclick="JavaScript: LayerMngmnt('LayerName','VisibiltyStatus');">
		
		*/	
			
		// Layer Management: Make layer visible or hidden	
			function LayerMngmnt(LayerName,VisibiltyStatus) 
			{
				if (document.getElementById) // DOM3 = IE5, NS6
					{  
						document.getElementById(LayerName).style.visibility = VisibiltyStatus;
					}
				else 
					{
						if (document.layers) // Netscape 4
							{  
								document.LayerName.visibility = VisibiltyStatus;
							}
						else // IE 4
							{  
								document.all.LayerName.style.visibility = VisibiltyStatus;
				      		}
				    }		
			}	
			
		// Expand or Contract Objects	
			function ExpandContract(obj)
			{
			// Display/Hide Object	
				var el = document.getElementById(obj);
				if(el.style.display != "block")
				{
					el.style.display = "block";
				}
				else
				{
					el.style.display = "none";
				}
			}
			
		// Expand Objects	
			function Expand(obj)
			{
			// Display Object	
				var el = document.getElementById(obj);
				el.style.display = "block";
			}
			
		// Contract Objects	
			function Contract(obj)
			{
			// Hide Object	
				var el = document.getElementById(obj);
				el.style.display = "none";
			}
			
		// Show/Hide Objects
			function ShowHideObjects(ShowObj,HideObj)
			{
				var ShowObject = document.getElementById(ShowObj);
				var HideObject = document.getElementById(HideObj);
				ShowObject.style.display = "block";
				HideObject.style.display = "none";
			}
	//////////////////////////////////////////////////////////////////////////////////////////		
		
		
		
	/////////////////////////////////////////////////////////////////////////
	/* CLASS FUNCTIONS */////////////////////////////////////////////////////
	/////////////////////////////////////////////////////////////////////////		
			
		// Change Class
			// Example Usage: onclick="ChangeClass('DivID', 'ClassName');
	
			function ChangeClass(id, newClass) {
			 	identity=document.getElementById(id);
			 	identity.className=newClass;
			}
			
			
			
		// Change Class Element
			/* 	EXMAPLE USAGE: ChangeClassElement('.thisClass','color','red');  This JavaScript function will dynamically change the style information for any CSS class in a Web Page. 
				Applying this function to a class will cause all items calling on the class to change to the updated style value. This function works even if there are multiple stylesheets referenced in the document.
			*/
			function ChangeClassElement(Class,element,value) {
				var cssRules;
				if (document.all) {
					cssRules = 'rules';
				}
				else if (document.getElementById) {
					cssRules = 'cssRules';
				}
				var added = false;
				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 == Class) {
							if(document.styleSheets[S][cssRules][R].style[element]){
								document.styleSheets[S][cssRules][R].style[element] = value;
								added=true;
								break;
							}
						}
					}
					if(!added){
						if(document.styleSheets[S].insertRule){
							document.styleSheets[S].insertRule(Class+' { '+element+': '+value+'; }',document.styleSheets[S][cssRules].length);
						} 
						else if (document.styleSheets[S].addRule) {
							document.styleSheets[S].addRule(Class,element+': '+value+';');
						}
					}
				}
			}
			
	
			
		// HasClassName
			/* 
				Description : returns boolean indicating whether the object has the class name (built with the understanding that there may be multiple classes)
				Arguments:
					objElement - element to manipulate
					strClass   - class name to check for
			*/
			function HasClassName(objElement, strClass){
				// if there is a class
					if ( objElement.className ){
						// the classes are just a space separated list, so first get the list
							var arrList = objElement.className.split(' ');
						// get uppercase class for comparison purposes
							var strClassUpper = strClass.toUpperCase();
						// find all instances and remove them
							for ( var i = 0; i < arrList.length; i++ ){
								// if class found
									if ( arrList[i].toUpperCase() == strClassUpper ){
										// we found it
											return true;
									}
							}
					}
					// if we got here then the class name is not there
						return false;
			}
	
			
	   
		// AddClassName
			/* 
				Description : adds a class to the class attribute of a DOM element (built with the understanding that there may be multiple classes)
				Arguments:
					objElement - element to manipulate
					strClass   - class name to add
			*/
			function AddClassName(objElement, strClass, blnMayAlreadyExist){
				// if there is a class
					if ( objElement.className ){
						// the classes are just a space separated list, so first get the list
							var arrList = objElement.className.split(' ');
						// if the new class name may already exist in list
							if ( blnMayAlreadyExist ){
								// get uppercase class for comparison purposes
									var strClassUpper = strClass.toUpperCase();
								// find all instances and remove them
									for ( var i = 0; i < arrList.length; i++ ){
										// if class found
											if ( arrList[i].toUpperCase() == strClassUpper ){
												// remove array item
													arrList.splice(i, 1);
												// decrement loop counter as we have adjusted the array's contents
													i--;
											}
									}
							}
						// add the new class to end of list
							arrList[arrList.length] = strClass;
						// add the new class to beginning of list
							//arrList.splice(0, 0, strClass);
						// assign modified class name attribute
							objElement.className = arrList.join(' ');
					}
					else{
						// if there was no class assign modified class name attribute      
								objElement.className = strClass;
					}
			}
	
			
			
		// RemoveClassName
			/* 
				Description : removes a class from the class attribute of a DOM element (built with the understanding that there may be multiple classes)
				Arguments:
					objElement - element to manipulate
					strClass   - class name to remove
			*/
			function RemoveClassName(objElement, strClass){
				// determine if object has a class
					if ( objElement.className ){
						// CLASS 
							// the classes are just a space separated list, so first get the list
								var arrList = objElement.className.split(' ');
							// get uppercase class for comparison purposes
								var strClassUpper = strClass.toUpperCase();
							// find all instances and remove them
								for ( var i = 0; i < arrList.length; i++ ){
									// if class found
										if ( arrList[i].toUpperCase() == strClassUpper ){
											// remove array item
												arrList.splice(i, 1);
											// decrement loop counter as we have adjusted the array's contents
												i--;
										}
								}
							// assign modified class name attribute
								objElement.className = arrList.join(' ');
					}
					else{
						// NO CLASS 
							// if there was no class there is nothing to remove
					}
					
			}
			
			
			
		// RemoveAllClasses
			/* 
				Description : removes all classes of a DOM element
				Arguments:
					objElement - element to manipulate
			*/
			function RemoveAllClasses(objElement){
				// determine if object has a class
					if ( objElement.className ){
						// CLASS 
							// the classes are just a space separated list, so first get the list
								var arrList = objElement.className.split(' ');
							// find all classes and remove them
								for ( var i = 0; i < arrList.length; i++ ){
									// remove array item
										arrList.splice(i, 1);
									// decrement loop counter as we have adjusted the array's contents
										i--;
								}
							// assign modified class name attribute
								objElement.className = arrList.join(' ');
					}
					else{
						// NO CLASS 
							// if there was no class there is nothing to remove
					}
					
			}
			
			
			
		// ReportAllClasses
			/* 
				Description : reports all classes of a DOM element
				Arguments:
					objElement - element to manipulate
			*/
			function ReportAllClasses(objElement){
				var classes='';
				// determine if object has a class
					if ( objElement.className ){
						// CLASS 
							// the classes are just a space separated list, so first get the list
								var arrList = objElement.className.split(' ');
							// find all classes and add them to list
								for ( var i = 0; i < arrList.length; i++ ){
									// Add to Class List
										var classes = arrList[i] + " | " + classes; 
								}
					}
					else{
						// NO CLASS 	
					}
					alert(classes);
			}
	//////////////////////////////////////////////////////////////////////////////////////////
		

	
	/////////////////////////////////////////////////////////////////////////
	/* IMAGE FUNCTIONS */////////////////////////////////////////////////////
	/////////////////////////////////////////////////////////////////////////	
		
		//Preload Images
			function MM_prePageLoader() { //v3.0
			  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
			    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
			    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
			}
	
		//Restore images
			function MM_swapImgRestore() { //v3.0
			  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
			}
	
		//Find Document Images and put into array
			function MM_findObj(n, d) { //v4.0
			  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
			    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
			  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
			  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
			  if(!x && document.getElementById) x=document.getElementById(n); return x;
			}	
	
		//Swap images
			// onmouseover="MM_swapImage('NameIDImgElementToReplace','null','#VARIABLES.DirLevel#images/ImageName.gif'); "onmouseout="MM_swapImgRestore();"
			
			/*
				Parameter 1: NAME or ID of an IMG element, form control, or layer that will have it's image replaced.
				Parameter 2: Does nothing (in v3.0 of the function) - there is no reason what-so-ever for it to be there. You could pass anything to it (null,rather than '', is probably the most efficient). The purpose might change in the future.
				Parameter 3: URL (absolute or relative) that points to the new image to be displayed.
				Repeats...
				Parameter 4:
				Parameter 5:
				Parameter 6:
			*/
	
			function MM_swapImage() { //v3.0
			  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
			   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
			}

	//////////////////////////////////////////////////////////////////////////////////////////	
	

		
	/////////////////////////////////////////////////////////////////////////
	/* COOKIES */////////////////////////////////////////////////////////////
	/////////////////////////////////////////////////////////////////////////		
		
		// Checks to see if COOKIES are enabled on user's browser
			/* Example Usage:	
				<script language="JavaScript">
					<!-- //
						CookieCheck();
					// -->
				</script>
			*/		
			function CookieCheck(){				
				var cookieName = 'testCookie' + (new Date().getTime());
				document.cookie = cookieName + '=cookieValue';
				var cookiesEnabled = document.cookie.indexOf(cookieName) != -1;
				
				if (cookiesEnabled){  
					alert("Cookies are enabled");
					}
				else{  
					alert("Cookies are NOT enabled");
					//window.location.href="#VARIABLES.DirLevel##VARIABLES.SELF#?FuseAction=CustomErrorDisplay.CookiesDisabled";
					}	
			}	

		// Set Cookie	
			/*
			   name - name of the cookie
			   value - value of the cookie
			   [expires] - expiration date of the cookie
			     (defaults to end of current session)
			   [path] - path for which the cookie is valid
			     (defaults to path of calling document)
			   [domain] - domain for which the cookie is valid
			     (defaults to domain of calling document)
			   [secure] - Boolean value indicating if the cookie transmission requires
			     a secure transmission
			   * an argument defaults when it is assigned null as a placeholder
			   * a null placeholder is not required for trailing omitted arguments
			*/
			
			function setCookie(name, value, expires, path, domain, secure) {
			  var curCookie = name + "=" + escape(value) +
			      ((expires) ? "; expires=" + expires.toGMTString() : "") +
			      ((path) ? "; path=" + path : "") +
			      ((domain) ? "; domain=" + domain : "") +
			      ((secure) ? "; secure" : "");
			  document.cookie = curCookie;
			}
			
			
		// Get Cookie		
			/*
			  name - name of the desired cookie
			  return string containing value of specified cookie or null
			  if cookie does not exist
			*/
			
			function getCookie(name) {
			  var dc = document.cookie;
			  var prefix = name + "=";
			  var begin = dc.indexOf("; " + prefix);
			  if (begin == -1) {
			    begin = dc.indexOf(prefix);
			    if (begin != 0) return null;
			  } else
			    begin += 2;
			  var end = document.cookie.indexOf(";", begin);
			  if (end == -1)
			    end = dc.length;
			  return unescape(dc.substring(begin + prefix.length, end));
			}
			
			
		// Delete Cookie	
			/*
			   name - name of the cookie
			   [path] - path of the cookie (must be same as path used to create cookie)
			   [domain] - domain of the cookie (must be same as domain used to
			     create cookie)
			   path and domain default if assigned null or omitted if no explicit
			     argument proceeds
			*/
			
			function deleteCookie(name, path, domain) {
			  if (getCookie(name)) {
			    document.cookie = name + "=" +
			    ((path) ? "; path=" + path : "") +
			    ((domain) ? "; domain=" + domain : "") +
			    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
			  }
			}
			
	//////////////////////////////////////////////////////////////////////////////////////////				
			
		
		
	/////////////////////////////////////////////////////////////////////////
	/* LIST FUNCTIONS *//////////////////////////////////////////////////////
	/////////////////////////////////////////////////////////////////////////			
		// List Length
			function ListLen(list,delim){
				var ListLen=0;
				var delimsFound = 0;
				if (trim(list).length > 0){
					// list contains at least one element
						ListLen++;
					// determine number of delimiters in list
						var myArray = list.toLowerCase().split('');
						for (i=0;i<myArray.length;i++){
							if (myArray[i] == delim){
								delimsFound++;
							}
						}
					// add delimiter count to current list element count
						ListLen=ListLen + delimsFound;
				}
				return ListLen;
			}
		
		
		// GetInList
			/*	PARAMETERS: 
			  	list 	= 	string containing the actual list
				index 	= 	the index to be set
				delim 	= 	the delimiter used to create the list
			  
			  	PURPOSE:
				To extract an entry from a list.
			  
			  	COMMENTS:
				Use index to specify which item in the list.  Also, delim must match whatever the delimeter is.  
				Returns false if the index is not found or the value if it was, or the original value if it's not a list.
			*/		

			function GetInList (list, index, delim){
				var flag = false, curr = 0;
				var posStart = "", posStop = "";
				// first, look for at least one occurance of the delimeter
				// if we can't find one, then just return the original
				if(list.indexOf(delim) == -1) return list;
			
				// alright, let's go through the string one character at a time
				for(x=0; x<list.length; x++){
					/*	We process if we find a delimeter, or we already found a delimeter before and reached the end of the string.*/
					if( (list.substr(x, 1) == delim) || (flag && (x == (list.length - 1))) ){
						// increment the current index if we need to
							if(index > 0){ curr++;}
						// are we looking for the end or begining of the index?
							if(flag){
								/* Record the index for extraction later.  Remember, we want the char before the delim, so we're done with this cycle. But, we don't do this for the last index because there is not delimeter for us to track, so we add one. */
								if(x == (list.length - 1))
									posStop = x + 1;
								else
									posStop = x;
								break;
							}
							else{
								// did we find a match?
								if(curr == index){
									/* We are on the index the caller wants.  So we record this for extraction later. */
									/* flag indicates we found the start */
									flag = true;
									/*
										Now, here's the tricky part.  If we're not on the first index (0) we want posStart to be one greater than the
										current iteration to pass up the delimeter; however, if we are on the first index, we want posStart to be the
										beginning and posStop to be what posStart was supposed to be.
									*/
									if(curr == 0){	
										//zero
											posStart = 0;
											posStop  = x;
										// we have the data we need
											break;
									}
									else{
										// non-zero
											posStart = x + 1;
									}
								}
							}
					}
				}
			
				// if we made it here w/o flag being set, then we didn't find the index
					if(!flag)
						return false;
					else{	
						// we have what we need to extract the index
						// return the data back to the caller
							return list.substring(posStart, posStop);
					}
			}

			
			
		// SetInList
			/*	PARAMETERS: 
				list 	= 	string containing the actual list
				item 	= 	the value to place in the list
				index 	= 	the index to be set
				delim 	= 	the delimiter used to create the list
				insert 	= 	whether or not to insert or replace the item (boolean) 
			  
			  	PURPOSE:
				To replace/add an entry to a list.
			  
			  	COMMENTS:
				Use index to specify which item in the list.  If insert is true then item is inserted, otherwise it item will replace the current index.  
				Also, delim must match whatever the delimeter is.  Returns false if the index is not found.
			*/	

			function SetInList (list, item, index, delim, insert){
				var flag = false, curr = 0;
				var posStart = "", posStop = "";
			
				// if list is empty then we just start a new list
					if((list == null) || (list == "")) return item;
			
				// 	first, look for at least one occurance of the delimeter.  if we can't find one, then there's most likey only a single item in the list, try to append or prepend
					if(list.indexOf(delim) == -1){
						if((index == 0) && insert)  return item + delim + list;
						if((index == 0) && !insert) return item;
					}
			
				// alright, let's go through the string one character at a time
					for(x=0; x<list.length; x++){
						// We process if we find a delimeter, or we already found a delimeter before and reached the end of the string.
							if( (list.substr(x, 1) == delim) || (flag && (x == (list.length - 1))) ){
								// increment the current index if we need to
									if(index > 0) {curr++;}
								// are we looking for the end or begining of the index?
									if(flag){
				
								/*	Record the index for extraction later.  Remember, we want the char before the delim, so we're done with this cycle.
									But, we don't do this for the last index because there is not delimeter for us to track, so we add one. */
									if(x == (list.length - 1))
										posStop = x + 1;
									else
										posStop = x;
									break;
							}
							else{
								// did we find a match?
									if(curr == index){
										// We are on the index the caller wants. So we record this for extraction later.
										// flag indicates we found the start
											flag = true;
					
										/*
											Now, here's the tricky part.  If we're not on the first index (0) we want posStart to be one greater than the
											current iteration to pass up the delimeter; however, if we are on the first index, we want posStart to be the
											beginning and posStop to be what posStart was supposed to be.
										*/
											if(curr == 0){	
												// zero
													posStart = 0;
													posStop  = x;
												// we have the data we need
													break;
											}
											else{
												// non-zero
													posStart = x + 1;
											}
									}
							}
					}
				}
			
			// if we made it here w/o flag being set, then we didn't find the index
				if(!flag)
					return false;
				else{	
					// we have what we need to include the index - return the data back to the caller
						// do we replace or insert?
							if(insert){
								// insert
									return list.substring(0, posStart) + item + delim + list.substring(posStart, list.length);
							}
							else{
								// replace
									return list.substring(0, posStart) + item + list.substring(posStart + (posStop - posStart), list.length);
							}
				}
			}
	
	//////////////////////////////////////////////////////////////////////////////////////////		
	
	
			
		// Covert to Currency Format	
			function formatCurrency(num) {
				num = num.toString().replace(/\$|\,/g,'');
				if(isNaN(num))
				num = "0";
				sign = (num == (num = Math.abs(num)));
				num = Math.floor(num*100+0.50000000001);
				cents = num%100;
				num = Math.floor(num/100).toString();
				if(cents<10)
				cents = "0" + cents;
				for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
				num = num.substring(0,num.length-(4*i+3))+','+
				num.substring(num.length-(4*i+3));
				return (((sign)?'':'-') + '$' + num + '.' + cents);
				}

		// Play sound file
			/*
				<a href="" onmouseover="JavaScript: playSound('BGSoundID','SRC','EmbedName');" class="Link_LTonDrk">Logout</a>
				<BGSOUND id="BGSOUND_ID" LOOP=1 SRC="#VARIABLES.DirLevel#MktgTracker/Sounds/LogOut.wav">
				<EMBED NAME="Bach" SRC="#VARIABLES.DirLevel#MktgTracker/Sounds/LogOut.wav" LOOP=FALSE AUTOSTART=FALSE HIDDEN=TRUE MASTERSOUND>
			*/
			
			ver=parseInt(navigator.appVersion)
			ie4=(ver>3  && navigator.appName!="Netscape")?1:0
			ns4=(ver>3  && navigator.appName=="Netscape")?1:0
			ns3=(ver==3 && navigator.appName=="Netscape")?1:0
			
			function playSound(BGSoundID,SRC,EmbedName) {
			 if (ie4) document.all[BGSoundID].src=SRC;
			 if ((ns4||ns3)
			  && navigator.javaEnabled()
			  && navigator.mimeTypes['audio/x-midi']
			  && self.document.EmbedName.IsReady()
			 )
			 {
			  self.document.EmbedName.play()
			 }
			}
			
			function stopSound() {
			 if (ie4) document.all[BGSoundID].src=SRC;
			 if ((ns4||ns3)
			  && navigator.javaEnabled()
			  && navigator.mimeTypes['audio/x-midi']
			 )
			 {
			  self.document.EmbedName.stop()
			 }
			}
			
		// Play Sound & Redirect
			
			function PlaySoundRedirect(BGSoundID,SRC,EmbedName,RedirectURL) {
				playSound(BGSoundID,SRC,EmbedName);
				redirTime = "1000";
				redirURL = RedirectURL;
				setTimeout("self.location.href = redirURL;",redirTime);
			}

	

	
// Dynamically Load External JavaScript and CSS Files
	/* 
		REF: http://www.javascriptkit.com/javatutors/loadjavascriptcss.shtml
		
		EXAMPLE USAGE:
		loadjscssfile("MyJSID", "js", "myscript.js") //dynamically load and add this .js file
		loadjscssfile("MyJSID", "javascript.php", "js") //dynamically load "javascript.php" as a JavaScript file
		loadjscssfile("MyCSSID", "css", "mystyle.css") ////dynamically load and add this .css file	

	*/
	function loadjscssfile(fileID, fileType, fileURL){
		 // Check to see if script is already loaded to avoid downloading the script multiple times
			 if ((fileID) && (self.fileID)) { // Already exists
	     		return;
	   		 }
		// Determine file type
			if (fileType == "js"){ 
				// JavaScript file
					var File=document.createElement('script');
					File.setAttribute("id", fileID);
					File.setAttribute("type","text/javascript");
					File.setAttribute("src", fileURL);
			}
			else if (fileType == "css"){ 
				// CSS file
					var File=document.createElement("link");
					File.setAttribute("id", fileID);
					File.setAttribute("rel", "stylesheet");
					File.setAttribute("type", "text/css");
					File.setAttribute("href", fileURL);
			}
		if (typeof File != "undefined")
			document.getElementsByTagName("head")[0].appendChild(File);
	}
	
// Dynamically Removes External JavaScript and CSS Files				
	/*
	EXAMPLE USAGE:
	removejscssfile("somescript.js", "js") //remove all occurences of "somescript.js" on page
	removejscssfile("somestyle.css", "css") //remove all occurences "somestyle.css" on page
	*/
	function removejscssfile(filename, filetype){
		var targetelement=(filetype=="js")? "script" : (filetype=="css")? "link" : "none" //determine element type to create nodelist from
		var targetattr=(filetype=="js")? "src" : (filetype=="css")? "href" : "none" //determine corresponding attribute to test for
		var allsuspects=document.getElementsByTagName(targetelement)
		for (var i=allsuspects.length; i>=0; i--){ //search backwards within nodelist for matching elements to remove
			if (allsuspects[i] && allsuspects[i].getAttribute(targetattr)!=null && allsuspects[i].getAttribute(targetattr).indexOf(filename)!=-1)
			allsuspects[i].parentNode.removeChild(allsuspects[i]) //remove element by calling parentNode.removeChild()
		}
	}
	
// Creates JavaScript and CSS Elements
	/* Essentially just a duplicate of loadjscssfile(), but modified to return the newly created element instead of actually adding it to the page */
	function createjscssfile(filename, filetype){
	 if (filetype=="js"){ //if filename is a external JavaScript file
	  var fileref=document.createElement('script')
	  fileref.setAttribute("type","text/javascript")
	  fileref.setAttribute("src", filename)
	 }
	 else if (filetype=="css"){ //if filename is an external CSS file
	  var fileref=document.createElement("link")
	  fileref.setAttribute("rel", "stylesheet")
	  fileref.setAttribute("type", "text/css")
	  fileref.setAttribute("href", filename)
	 }
	 return fileref
	}


// Dynamically Replaces External JavaScript and CSS Files				
	/*
	EXAMPLE USAGE:
	replacejscssfile("oldscript.js", "newscript.js", "js") //Replace all occurences of "oldscript.js" with "newscript.js"
	replacejscssfile("oldstyle.css", "newstyle", "css") //Replace all occurences "oldstyle.css" with "newstyle.css"
	*/
	
	function replacejscssfile(oldfilename, newfilename, filetype){
		var targetelement=(filetype=="js")? "script" : (filetype=="css")? "link" : "none" //determine element type to create nodelist using
		var targetattr=(filetype=="js")? "src" : (filetype=="css")? "href" : "none" //determine corresponding attribute to test for
		var allsuspects=document.getElementsByTagName(targetelement)
		for (var i=allsuspects.length; i>=0; i--){ //search backwards within nodelist for matching elements to remove
			if (allsuspects[i] && allsuspects[i].getAttribute(targetattr)!=null && allsuspects[i].getAttribute(targetattr).indexOf(oldfilename)!=-1){
				var newelement=createjscssfile(newfilename, filetype)
				allsuspects[i].parentNode.replaceChild(newelement, allsuspects[i])
			}
		}
	}
	
// Check to see if file is already loaded
	/*
		checkloadjscssfile("myscript.js", "js") //success
		checkloadjscssfile("myscript.js", "js") //redundant file, so file not added
	*/
	
	var filesadded="" //list of files already added
	function checkloadjscssfile(filename, filetype){
		if (filesadded.indexOf("["+filename+"]")==-1){
			loadjscssfile(filename, filetype)
			filesadded+="["+filename+"]" //List of files added in the form "[filename1],[filename2],etc"
		}
		else {
			// alert("file already added!")}
		}
	}
	
	
	
	
	/////////////////////////////////////////////////////////////////////////
	/* FORM FUNCTIONS *//////////////////////////////////////////////////////
	/////////////////////////////////////////////////////////////////////////

		// Confirms User Action
			/* Sample Usage: onClick="return ConfirmAction('Enter Confirmation Text Here');" */
			function ConfirmAction(ConfirmationTxt){
				if (confirm(ConfirmationTxt)){
					return true;
				}  
				else{
					return false;
				}
			}
			
		// JavaScript providing a way in which to provide the end user with a customizable help window
				/*  
				To implement this JavaScript, simply cut/paste the following code into your form and enter the desired values for the stated variables 
				
				Help window w/form input:
					<a onMouseOver="window.status='Click for explanation...';return true;" onMouseOut="window.status='';return true;" href="javascript:HelpInput('FormFieldName???', 'opener.document.FormName???.FieldName???.value', 'HelpMessage???','InputType???','InputSize???','WindowWidth???','WindowHeight???','scroll???','resizable???','location???','status???','menubar???','toolbar???');">Help?</a>
				Help window w/o form input:
					<a onMouseOver="window.status='Click for explanation...';return true;" onMouseOut="window.status='';return true;" href="javascript:HelpNoInput('FormFieldName???','HelpMessage???','WindowWidth???','WindowHeight???','scroll???','resizable???','location???','status???','menubar???','toolbar???');">Help?</a>
		
				::: Example Usage :::
					<form name="FormName" Action="" Method="Post">
						<input type="text" name="FieldName" size="30" value="FieldName">
						<font face="Arial" size="1">
						Help window w/form input:
							<a onMouseOver="window.status='Click for explanation...';return true;" onMouseOut="window.status='';return true;" href="javascript:HelpInput('FieldName', 'opener.document.FormName.FieldName.value', 'Help Message.','text','30','250','400','yes','yes','no','no','no','yes');">Help?</a>
						Help window w/o form input:
							<a onMouseOver="window.status='Click for explanation...';return true;" onMouseOut="window.status='';return true;" href="javascript:HelpNoInput('FieldName','Help Message.','350','500','yes','yes','no','no','no','yes');">Help?</a>
					</form> 
				*/
		
				// Opens custom help window with form input built-in
					function HelpInput(FieldName,FieldLocation,HelpMsg,InputType,Size,w,h,scroll,resizable,location,status,menubar,toolbar){
							  var winl = (screen.width-w)/2;
							  var wint = (screen.height-h)/2;
							  var settings  ='height='+h+',';
							      settings +='width='+w+',';
							      settings +='top='+wint+',';
							      settings +='left='+winl+',';
							      settings +='scrollbars='+scroll+',';
							      settings +='resizable='+resizable+',';
							      settings +='location='+location+',';
							      settings +='status='+status+',';
							      settings +='menubar='+menubar+',';
							      settings +='toolbar='+toolbar+',';
					newwin = window.open('','FieldName',settings);
					if (!newwin.opener) newwin.opener = self;
					with (newwin.document)
					{
					open();
					write('<html><head><title>'+FieldName+'</title></head>');
					write('<body onLoad="document.form.box.focus()"><form name=form><font face="Arial" size="2"><b>'+FieldName+'</b><br>' + HelpMsg + '<br>');
					write('<p>You may enter your ' + FieldName + ' here and it will be copied into the form for you.');
					write('<p><center>' + FieldName + ':<br><input type='+InputType+' name=box size='+Size+' onKeyUp=' + FieldLocation + '=this.value>');
					write('<p><input type="button" border="0" value="Close" onClick=window.close()>');
					write('</center></form></font></body></html>');
					close();
					   }
					}
				
				// Opens custom help window without form input
					function HelpNoInput(FieldName,HelpMsg,w,h,scroll,resizable,location,status,menubar,toolbar){
							  var winl = (screen.width-w)/2;
							  var wint = (screen.height-h)/2;
							  var settings  ='height='+h+',';
							      settings +='width='+w+',';
							      settings +='top='+wint+',';
							      settings +='left='+winl+',';
							      settings +='scrollbars='+scroll+',';
							      settings +='resizable='+resizable+',';
							      settings +='location='+location+',';
							      settings +='status='+status+',';
							      settings +='menubar='+menubar+',';
							      settings +='toolbar='+toolbar+',';
					newwin = window.open('','FieldName',settings);
					if (!newwin.opener) newwin.opener = self;
					with (newwin.document)
					{
					open();
					write('<html><head><title>'+FieldName+'</title></head>');
					write('<body><form><font face="Arial" size="2"><b>'+FieldName+'</b><br>' + HelpMsg + '<br>');
					
					write('<p><center><input type="button" border="0" value="Close" onClick=window.close()>');
					write('</center></form></font></body></html>');
					close();
					   }
					}
		
		
			
		// Drop-Down Link Menu
			/*
				To use, paste this form into your document:
					<form name="form">
						<select name="site" size=1>
							<option value="">Go to....
							<option value="Link???">Menu Text???
						</select>
						<input type=button value="Go!" onClick="javascript:formHandler(this)">
					</form>
			*/	
			function formHandler(form){
				var URL = document.form.site.options[document.form.site.selectedIndex].value;
				window.location.href = URL;
			}		
				
				
						
		// Disables input fields based on user's current input
			//	onClick="document.FormName???.FormField???.disabled=document.FormName???.FormField???.readOnly = !this.checked;"
		
		//Prevents "ENTER" Key From Submitting Form
			/*
				To implement, place this code in your form that you wish to disable the "ENTER" Key:
				
				<SCRIPT LANGUAGE="JavaScript">
					<!-- Begin
						document.onkeypress = onKeyPress;
					//  End -->
				</script>
			
			*/
			function onKeyPress () {
				var keycode;
				if (window.event) keycode = window.event.keyCode;
				else if (e) keycode = e.which;
				else return true;
				if (keycode == 13) {
				alert("Please click on the appropriate button to submit this form.");
				return false
				}
				return true 
			}	
		
		
		
		// Change Button Text / Disable Button / Submit Form
			function ChangeDisableSubmit(BtnObj,BtnText,DisableBtn,Form) 
				{
					if (BtnText=="") {
						BtnObj.value = 'Processing...';
					}
					else {
						BtnObj.value = BtnText;
					}
					if (DisableBtn=1) {
						BtnObj.disabled = true;
					}
					Form.submit();
				}				
			
		// Submit Form Data to Pop-Up
			/* 	
				Add the following to your <FORM> tag:
				ONSUBMIT="SubmitToPopUp(this, 'width=300,height=300,resizable=1,scrollbars=1'); return true;" target="PopUp"
				
			*/
	
			function SubmitToPopUp(FormName,PopUpProperties,PopUpName) {
			  if (!PopUpName)
			    PopUpName = 'formTarget' + (new Date().getTime());
			  	FormName.target = PopUpName;
			  	open ('', PopUpName, PopUpProperties);
			}		
												
		// Places focus on first form field.  Sample Call: <BODY OnLoad="placeFocus();">		
			function placeFocus() {
				if (document.forms.length > 0) {
					var field = document.forms[0];
					for (i = 0; i < field.length; i++) {
						if ((field.elements[i].type == "text") || (field.elements[i].type == "textarea") || (field.elements[i].type.toString().charAt(0) == "s")) {
							document.forms[0].elements[i].focus();
							break;
				        }
				    }
				}
			}
			
		// Places focus on specified form field.  Sample Call: <BODY OnLoad="placeFocus(0,0);">		
			function PlaceFocusFormElement(FormNum,ElementNum) {
				var FormRef = document.forms[FormNum];
				if ((FormRef.elements[ElementNum].type == "text") || (FormRef.elements[ElementNum].type == "password") || (FormRef.elements[ElementNum].type == "textarea") || (FormRef.elements[ElementNum].type.toString().charAt(0) == "s")) {
					document.forms[FormNum].elements[ElementNum].focus();
				}
			}			
			
		// Determines if checkbox is checked or unchecked
			function IsChecked(FormName,CheckBoxName) 
			{
				var Checked="false";
				for (i=0; i<document.FormName.CheckBoxName.length; i++)
				{
					if (document.FormName.CheckBoxName[i].checked==true)
					{
						var Checked="true";
					}
				}
				return Checked;
			}
		
		
		/*	Selects option in select list
			Allows you to set the value of a select tag without having to know its position in the list	
			
			Select_Value_Set('FormName.SelectName', 'Value');
		*/
			function Select_Value_Set(SelectName, Value) {
			  eval('SelectObject = document.' + 
			    SelectName + ';');
			  for(index = 0; 
			    index < SelectObject.length; 
			    index++) {
			   if(SelectObject[index].value == Value)
			     SelectObject.selectedIndex = index;
			   }
			}
		
		//	getSelectedValue('SelectID','Value|Label|Index')
		// 	returns the value, label, or index of the selected option from a drop-down menu
		// 	NOTE: Assumes select element name and ID are the same
			function getSelectedValue(SelectID,RetunValue) {
				// Set Select Obj
					var SelectObj = document.getElementById(SelectID);
					var SelectIndex = SelectObj.selectedIndex;
					var SelectValue = SelectObj[SelectIndex].value;
					var SelectLabel = SelectObj.options[SelectIndex].text;
				// Determine Return Value
					if (RetunValue == 'Value'){
						// VALUE
							return SelectValue;
					}
					else if (RetunValue == 'Label'){
						// LABEL
							return SelectLabel
					}
					else if (RetunValue == 'Index'){
						// INDEX
							return SelectIndex;
					}
					else {
						// VALUE
							return SelectValue;
					}
			}
			
		// Ensure all radio groups have selection
			/*
				Example Usage: areAllRadiosChecked('MyFormName');
				returns true or false
			*/
			function areAllRadiosChecked(FormName){
				var form=eval('document.' + FormName),
					formLength=form.length,
					formFieldType,
					formFieldName,
					radioInputList=new Array(),
					radioInputs=0,
					radioInputsChecked=0,
					i=0;
				for(var i = 0; i < formLength; i++) {
					formFieldType=form[i].type;
					formFieldName=form[i].name;
					if(formFieldType=="radio"){
						if(formFieldName in ArrayToObjectLiteral(radioInputList)==true){
							// Radio Input Already Evaluated
								
						}
						else {
							// Evaluated Radio Input
								radioInputs++;
								// Add to radioInputList
									radioInputList[radioInputList.length+1]=formFieldName;
								radioObj=eval('document.' + FormName + '.' + formFieldName);
								radioLength=radioObj.length;
								radioObjChecked=false;
								for(var ii = 0; ii < radioLength; ii++) {
									if(radioObj[ii].checked) {
										radioObjChecked=true;
									}
								}
								if(radioObjChecked==true){
									radioInputsChecked++;
								}
						}
					}
				}
				return radioInputs == radioInputsChecked
			}
			
		// return the value of the radio button that is checked
		// return an empty string if none are checked, or
		// there are no radio buttons
		// getCheckedValue(document.FormName.RadioObjName);
			function getCheckedValue(radioObj) {
				if(!radioObj)
					return "";
				var radioLength = radioObj.length;
				if(radioLength == undefined)
					if(radioObj.checked)
						return radioObj.value;
					else
						return "";
				for(var i = 0; i < radioLength; i++) {
					if(radioObj[i].checked) {
						return radioObj[i].value;
					}
				}
				return "";
			}
			
		// set the radio button with the given value as being checked
		// do nothing if there are no radio buttons
		// if the given value does not exist, all the radio buttons
		// are reset to unchecked
		// onclick="setCheckedValue(document.forms['radioExampleForm'].elements['number'], '2');
			function setCheckedValue(radioObj, newValue) {
				if(!radioObj)
					return;
				var radioLength = radioObj.length;
				if(radioLength == undefined) {
					radioObj.checked = (radioObj.value == newValue.toString());
					return;
				}
				for(var i = 0; i < radioLength; i++) {
					radioObj[i].checked = false;
					if(radioObj[i].value == newValue.toString()) {
						radioObj[i].checked = true;
					}
				}
			}			

		// Select and Copy
			// EXAMPLE USE: copyit('FormName.FormField');
			function copyit(theField) {
				var tempval=eval("document."+theField)
				tempval.focus()
				tempval.select()
				therange=tempval.createTextRange()
				therange.execCommand("Copy")
				}	
	
	
		// Show Indication/Warning that Value Has Changed
			/*
				EXAMPLE USAGE: CheckValueChanged('#GetSASInfo.MedYrs#',document.JobData.medyrs.value,'alert msg','medyrs');
				Old Value
				New Value
				Alert Message
				Highlight Object
			*/
			function CheckValueChanged(OldVal,NewVal,AlertMsg,HighlightObj){
				var OldVal = OldVal;
				var NewVal = NewVal;
				var AlertMsg = AlertMsg;
				if (OldVal != NewVal){
					// VALUE CHANGED
						// Determine if alert should be shown
							if (AlertMsg.length > 0){
								// SHOW ALERT
									alert(AlertMsg);
							}
						// Determine if form input should be highlighted
							if (HighlightObj.length > 0){
								// HIGHLIGHT INPUT
									var object = document.getElementById(HighlightObj);// indentify html input 
									object.style.background='yellow';// highlight input background
							}
				}
				else{
					// VALUE NOT CHANGED
					
				}
			}	
			
 		
		
		// Default Form Value
			/*
				SAMPLE USAGE:
				<input type="text" name="FormElement" id="FormElement" OnFocus="JavaScript: DefaultFormValue('FormObjID','DeafaultFormValue','OnFocus');" OnBlur="JavaScript: DefaultFormValue('FormObjID','DeafaultFormValue','OnBlur');">
			*/
		
			function DefaultFormValue(FrmObj,DeafaultFormValue,Event,FormFieldType) {
				var FormField = document.getElementById(FrmObj);
				var CurrentFormValue = FormField.value;
				if (Event == 'OnFocus'){
					// OnFocus
						if(CurrentFormValue == DeafaultFormValue){
							if(FormFieldType == "password"){
								FormField.type='password';
							}
							FormField.value='';
							FormField.style.color = '#333';
						}
				}
				
				else if (Event == 'OnBlur') {
					// OnBlur
						if(CurrentFormValue ==''){
							if(FormFieldType == "password"){
								FormField.type='text';
							}
							FormField.value=DeafaultFormValue;
							FormField.style.color = '#959595';
						}
				}
			}
			
			
		// Display an example value or instructions in form field that disappers onFocus
			// NOTE: This requires this function to be called onLoad like so...displayExampleValueInstruction('FormFieldID','Default Value','#666','#335a33');
			function displayExampleValueInstruction(FormObjID,DefaultValue,DefaultColor,UserInputColor){
				var FormObj = document.getElementById(FormObjID);
				FormObj.onfocus=function(){
					if(FormObj.value ==DefaultValue){
						FormObj.value='';
						FormObj.style.color = UserInputColor;
					}
				}
				FormObj.onblur=function(){
					if(FormObj.value ==''){
						FormObj.value=DefaultValue;
						FormObj.style.color = DefaultColor;
					}
				}
			}	
		
		
		// Updates a hidden form variable so when user hits back button, select form input will return to previously selected value
			/*
				EXAMPLE USAGE:
				 <script type="text/javascript">
					window.onload = function() {
						UpdateSelectValueBasedOnHiddenValue('Day','DayOriginal');
					}
				</script>
				 <input type="Hidden" name="DayOriginal" id="DayOriginal" value="#ATTRIBUTES.Day#">
				 <select name="Day" id="Day">
					<option value="1">1</option>   
					<option value="2">2</option>                      
				 </select>
			*/
			function UpdateSelectValueBasedOnHiddenValue(SelectObj,HiddenObj) {
				var HiddenObject = document.getElementById(HiddenObj);
				var HiddenValue = HiddenObject.value;
				var SelectObject = document.getElementById(SelectObj);
				var SelectIndex = document.getElementById(SelectObj).selectedIndex;
				var SelectValue = document.getElementById(SelectObj)[SelectIndex].value;
				
				SelectObject.value=HiddenValue;
			}		
			
			
		// Disable Text Selection
			/*
				EXAMPLE USAGE:
				disableSelection(document.body) //Disable text selection on entire body
				disableSelection(document.getElementById("mydiv")) //Disable text selection on element with id="mydiv"
			*/

			function disableSelection(target){
				if (typeof target.onselectstart!="undefined") //IE route
					target.onselectstart=function(){return false}
				else if (typeof target.style.MozUserSelect!="undefined") //Firefox route
					target.style.MozUserSelect="none"
				else //All other route (ie: Opera)
					target.onmousedown=function(){return false}
				target.style.cursor = "default"
			}

	//////////////////////////////////////////////////////////////////////////////////////////	
	
	
		
	/////////////////////////////////////////////////////////////////////////
	/* FORM VALIDATION */////////////////////////////////////////////////////
	/////////////////////////////////////////////////////////////////////////

		// Text	
			function validateText(fld,errorMsg) {
			    var error = "";
			    if (fld.value.length == 0) {
			        fld.style.background = 'Yellow'; 
			        error = errorMsg + "\n";
			    } else {
			        fld.style.background = 'White';
			    }
			    return error;  
			}
			
		// Radio	
			function validateRadio(fld,errorMsg) {
			    var error="";
				var Checked = 0; // Default
			    for (var i=fld.length-1; i > -1; i--) {
			        if (fld[i].checked) {
						Checked = 1; 
					}
			    }
			    if (Checked == 0) {
					error = errorMsg + "\n";
				}
				return error;
			}
	                  
		// Username	
			function validateUsername(fld) {
			    var error = "";
			    var illegalChars = /\W/; // allow letters, numbers, and underscores
			    if (fld.value == "") {
			        fld.style.background = 'Yellow'; 
			        error = "You didn't enter a username.\n";
			    } else if ((fld.value.length < 5) || (fld.value.length > 15)) {
			        fld.style.background = 'Yellow'; 
			        error = "The username is the wrong length.\n";
			    } else if (illegalChars.test(fld.value)) {
			        fld.style.background = 'Yellow'; 
			        error = "The username contains illegal characters.\n";
			    } else {
			        // Do Nothing
			    }
			    return error;
			}
		
		// Password	
			/* 	var PasswordValidation = validatePassword(Password,6,20,'No','No');
				var PasswordErrors = PasswordValidation[0];
				var PasswordErrorMsg = PasswordValidation[1];
			*/
					
			function validatePassword(Password,minLength,maxLength,LimitToAlphaNumericChars,NumRequired) {
			    if (AllowNonAlphaNumericChars){}else{var AllowNonAlphaNumericChars="Yes";}
				if (NumRequired){}else{var NumRequired="No";}
				var Errors = 0;
				var ErrorMsg = '';
				var illegalChars = /[\W_]/; // allow only letters and numbers
				Password=trim(Password);
				if (Password == "") {
			        Errors = Errors + 1;
					ErrorMsg = ErrorMsg + 'Password not provided.\n';
			    } 
				else if ((Password.length < minLength) || (Password.length > maxLength)) {
			       	Errors = Errors + 1;
					ErrorMsg = ErrorMsg + 'Password must be between ' + minLength + ' and ' + maxLength + ' characters.\n';
			    } 
				else if ((AllowNonAlphaNumericChars=='Yes') && (illegalChars.test(Password))){
					Errors = Errors + 1;
					ErrorMsg = ErrorMsg + 'Password contains illegal characters.\n';
			    } 
				else if ((NumRequired=='Yes') && (!((Password.search(/(a-z)+/)) && (Password.search(/(0-9)+/))))){
			      	Errors = Errors + 1;
					ErrorMsg = ErrorMsg + 'Password must contain at least one numeric character.\n';
			    } 
				return [Errors,ErrorMsg];
			}	

			
		// Email	
			/* 	var EmailValidation = validateEmail('john.doe@acme.com');
				var EmailErrors = EmailValidation[0];
				var EmailErrorMsg = EmailValidation[1];
			*/
			function validateEmail(Email) {
				var Errors = 0;
				var ErrorMsg = '';
				var emailFilter = /^[^@]+@[^@.]+\.[^@]*\w\w$/ ;
			    var illegalChars = /[\(\)\<\>\,\;\:\\\"\[\]]/ ;
				Email=trim(Email);
				if (Email == "") {
			        Errors = Errors + 1;
					ErrorMsg = ErrorMsg + 'Email was not provided.\n';
			    } 
				else if (!emailFilter.test(Email)) {
			       	Errors = Errors + 1;
					ErrorMsg = ErrorMsg + 'Email is invalid.\n';
			    } 
				else if (Email.match(illegalChars)) {
			      	Errors = Errors + 1;
					ErrorMsg = ErrorMsg + 'Email address contains illegal characters.\n';
			    } 
				return [Errors,ErrorMsg];
			}	
			
			
		// Phone	
			function validatePhone(fld,errorMsg) {
			    var error = "";
			    var stripped = fld.value.replace(/[\(\)\.\-\ ]/g, '');    
			
			   if (fld.value == "") {
			        error = "You didn't enter a phone number.\n";
			        fld.style.background = 'Yellow';
			    } else if (isNaN(parseInt(stripped))) {
			        error = "The phone number contains illegal characters.\n";
			        fld.style.background = 'Yellow';
			    } else if (!(stripped.length == 10)) {
			        error = "The phone number is the wrong length. Make sure you included an area code.\n";
			        fld.style.background = 'Yellow';
			    }
			    return error;
			}
			
		// Determine Card Type
			/*	TEST VALUES
				American Express	3400 0000 0000 009
				Carte Blanche		3000 0000 0000 04
				Discover			6011 0000 0000 0004
				Diners Club			3852 0000 0232 37
				enRoute				2014 0000 0000 009
				JCB					2131 0000 0000 0008
				MasterCard			5500 0000 0000 0004
				Solo				6334 0000 0000 0004
				Switch				4903 0100 0000 0009
				Visa				4111 1111 1111 1111
				Laser				6304 1000 0000 0008
			
			
				CARD TYPES            	PREFIX           	WIDTH
				American Express       	34, 37            	15
				Diners Club            	300 to 305, 36    	14
				Carte Blanche          	38                	14
				Discover               	6011              	16
				EnRoute                	2014, 2149        	15
				JCB                    	3                 	16
				JCB                    	2131, 1800        	15
				Master Card            	51 to 55          	16
				Visa                   	4                 	13, 16 
			*/
			function determineCardType(CardNumber){
				var RegExp=/\W/gi;
				CardNumber=CardNumber.replace(RegExp, "");
				var CardNumberCnt = CardNumber.length;
				var CardPrefix1 = Left(CardNumber,1);
				var CardPrefix2 = Left(CardNumber,2);
				var CardPrefix3 = Left(CardNumber,3);
				var CardPrefix4 = Left(CardNumber,4);
				var CardType='unknown';
				if((CardNumberCnt < 14) || (CardNumber != parseInt(CardNumber))){
					// INVALID CARD NUMBER FORMAT - STOP PROCESSING 
				}
				else{
					// VALID CARD NUMBER FORMAT - CONTINUE PROCESSING
						if((CardPrefix2==34) || (CardPrefix2==37)){
							CardType='American Express';
						}
						else if((CardPrefix2==36)){
							CardType='Diners Club';
						}
						else if((CardPrefix2==38)){
							CardType='Carte Blanche';
						}
						else if((CardPrefix2==51) || (CardPrefix2==52) || (CardPrefix2==53) || (CardPrefix2==54) || (CardPrefix2==55)){
							CardType='Master Card';
						}
						else{
							// None of the above - so check the first 4 digits collectively
								if((CardPrefix2==34) || (CardPrefix2==37)){
									CardType='American Express';
								}
								else if((CardPrefix2==36)){
									CardType='Diners Club';
								}
								else if((CardPrefix2==38)){
									CardType='Carte Blanche';
								}
								else if((CardPrefix2==51) || (CardPrefix2==52) || (CardPrefix2==53) || (CardPrefix2==54) || (CardPrefix2==55)){
									CardType='Master Card';
								}
								else{
									// None of the above - so check the first 4 digits collectively
										if((CardPrefix4==2014) || (CardPrefix4==2149)){
											CardType='EnRoute';
										}
										else if((CardPrefix4==2131) || (CardPrefix4==1800)){
											CardType='JCB';
										}
										else if(CardPrefix4==6011){
											CardType='Discover';
										}
										else{
											// None of the above - so check the first 3 digits collectively
												if((CardPrefix3==300) || (CardPrefix3==301) || (CardPrefix3==302) || (CardPrefix3==303) || (CardPrefix3==304) || (CardPrefix3==305)){
													CardType='American Diners Club';
												}
												else{
													// None of the above - so check the first digit
														if(CardPrefix1==3){
															CardType='JCB';
														}
														else if(CardPrefix1==4){
															CardType='Visa';
														}
												}
										}
								}	
						}
				}
				return CardType;
			}		

			
		// Validate Credit Card Number
			/* 	var CardNumValidation = validateCardNumber('#### #### #### ####');
				var CardNumErrors = CardNumValidation[0];
				var CardNumErrorMsg = CardNumValidation[1];
			*/

			function validateCardNumber(CardNumber) {
				var Errors=0;
				var ErrorMsg='';
				var RegExp=/\W/gi;
				CardNumber=CardNumber.replace(RegExp, "");
				// Numeric Value
					if (isNaN(CardNumber)) {
						Errors = Errors + 1;
						ErrorMsg = ErrorMsg + 'Card number is not numeric.\n';
					}
				// Correct Number of Digits	
					if ((CardNumber.length!=14) && (CardNumber.length!=15) && (CardNumber.length!=16)) {
						Errors = Errors + 1;
						ErrorMsg = ErrorMsg + 'Card number is incorrect number of digits.\n';
					}
				// Valid Card Number	
					var cardMath=0;
					for (i=CardNumber.length; i>0; i--) {
						if (i % 2 == 1) {
							var doubled = "" + (parseInt(CardNumber.substring(i - 1, i)) * 2);
							if (doubled.length==2) {doubled = parseInt(doubled.substring(0,1)) + parseInt(doubled.substring(1,2))}
							cardMath += parseInt(doubled);
							}
						else {cardMath += parseInt(CardNumber.substring(i - 1, i))}
						}
					if (cardMath % 10 != 0) {
						Errors = Errors + 1;
						ErrorMsg = ErrorMsg + 'Card number is invalid.\n';
					}
				return [Errors,ErrorMsg];
			}	
	

// Convert Currency to Number	
	function ConvertCurrencyToNumber(value){
		//Default 
			num = 0;
		//Strip Dollar Sign
			value = value.replace(/\$/g,''); 
		// Strip Commas
			temp = new RegExp(",", "g");
			num = value.replace(temp, "");
		num = num.replace('\\', "");
		num = Number(num);
		return num;
	}
	
	
	/////////////////////////////////////////////////////////////////////////
	/* IFRAMES  *////////////////////////////////////////////////////////////
	/////////////////////////////////////////////////////////////////////////	

		// Change source of iframe	
			function changeIframeSrc(id, url) {
			    var el = document.getElementById(id);
			    if (el && el.src) {
			        el.src = url;
			        //return false;
			    }
			    //return true;
			}
		
	//////////////////////////////////////////////////////////////////////////////////////////	


	/////////////////////////////////////////////////////////////////////////
	/* AUTOSIZE IFRAME  *////////////////////////////////////////////////////
	/////////////////////////////////////////////////////////////////////////	
		
		/*
		
			<script type="text/javascript">
				if (window.addEventListener)
					window.addEventListener("load", resizeCaller, false)
				else if (window.attachEvent)
					window.attachEvent("onload", resizeCaller)
				else
					window.onload=resizeCaller
				
				//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=["myframe"]
				
				//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
					var iframehide="yes"
			</script>
			<iframe id="myframe" src="external4.htm" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:visible; width:450px; display:none"></iframe>
		
		*/
		
		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
		
		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);
			// Ensure IFrame width is set to 100%
				currentfr.width='100%';
			// Disable IFrame Scroll Bars
				currentfr.scrolling='no';
			// Disable IFrame Borders
				currentfr.style.border='0';
			if (currentfr && !window.opera){
				currentfr.style.display="block"
				if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight){ //ns6 syntax
					currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight; 
				}
				else if (currentfr.Document && currentfr.document.body.scrollHeight){ //ie5+ syntax
					currentfr.height = currentfr.document.body.scrollHeight;
				}
				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 loadintoIframe(iframeid, url){
			if (document.getElementById){
				document.getElementById(iframeid).src=url
			}
		}
		
	//////////////////////////////////////////////////////////////////////////////////////////		
	

// Change Status Bar Message
	function UpdateStatusMsg(StatusMsg) {
	    if (StatusMsg == "") {
	       status = " "
	    } else {
	       status = (StatusMsg)
	    }
	    return true
	}	
// Remove Spaces From String
	function removeSpaces(string) {
	 	return string.split(' ').join('');
	}

	
/////////////////////////////////////////////////////////////////////////
/* URL Encode/Decode *///////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
	
	/*
		Example Usage: 	var EncodedURLParameter=encode(URLParameter);
						var DecodedURLParameter=decode(EncodedURLParameter);

		
		You can use these Javascript functions to encode/decode url parameters. Scripts are fully compatible with UTF-8 encoding. It's useful when you want to transfer data using AJAX technology, 
		or for other operations which involve url parameter manipulation.
		
		If you plan using UTF-8 encoding in your project don't forget to set the page encoding to UTF-8 (Content-Type meta tag).
	*/
 

 
	// Encode URL Parameter
	 	function encode(string) {
			return escape(utf8_encode(string));
		}
 
	// Decode URL Parameter
		function decode(string) {
			return utf8_decode(unescape(string));
		}
 
	// UTF-8 Encode
		function utf8_encode(string) {
			string = string.replace(/\r\n/g,"\n");
			var utftext = "";
			for (var n = 0; n < string.length; n++) {
				var c = string.charCodeAt(n);
				if (c < 128) {
					utftext += String.fromCharCode(c);
				}
				else if((c > 127) && (c < 2048)) {
					utftext += String.fromCharCode((c >> 6) | 192);
					utftext += String.fromCharCode((c & 63) | 128);
				}
				else {
					utftext += String.fromCharCode((c >> 12) | 224);
					utftext += String.fromCharCode(((c >> 6) & 63) | 128);
					utftext += String.fromCharCode((c & 63) | 128);
				}

			}
			return utftext;
		}
 
	// UTF-8 Decoding
	 	function utf8_decode(utftext) {
			var string = "";
			var i = 0;
			var c = c1 = c2 = 0;
			while ( i < utftext.length ) {
				c = utftext.charCodeAt(i);
				if (c < 128) {
					string += String.fromCharCode(c);
					i++;
				}
				else if((c > 191) && (c < 224)) {
					c2 = utftext.charCodeAt(i+1);
					string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
					i += 2;
				}
				else {
					c2 = utftext.charCodeAt(i+1);
					c3 = utftext.charCodeAt(i+2);
					string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
					i += 3;
				}
			}
			return string;
		}
		
/////////////////////////////////////////////////////////////////////////
/* DATE FUNCTIONS *//////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////		
	
	// IsDate
		function isDate(date){
			date = new Date(date);
			if (date != 'Invalid Date'){
				return true;
			}
			else {
				return false;
	  		}
		}
		
		function checkdata(){
			datetocheck=document.getElementById("dateinput").value;
			alert(isDate(datetocheck));
		}
	
	// Get GMT Offset
		function getGMTOffset(){
			curDateTime = new Date();
			var GMTOffset = curDateTime.getTimezoneOffset()/60;
			return GMTOffset;
		}
		
	// Display Current Date (User's System Date)
        function DisplayDate(){
			months = new Array('January','February','March','April','May','June','July','August','September','October','November','December');
	        now = new Date();
	        year = now.getYear();
	        if(year < 100) 
				{ year = year + 2000; } 
			else 
				{ if(year >= 100 && year < 2000) { year = year + 1900; } }
	        document.write(months[now.getMonth()] + " " + now.getDate() + ", " + year);	
		}
	
	
	// DateAdd
		/*
			DESCRIPTION: Adds unit of time to date.
			RETURNS: Date/Time Object
			PARAMETERS:	
				datepart - 	yyyy	=	Year
							m		=	Month
							ww		=	Week
							d		=	Day
				number	 - 	Number of untis of datepart to add to date.  Positive values to get dates in future.  Negative values to get dates in past.
				date	 -	Date/time object
		*/
		function DateAdd(datepart,number,date){
			// Determine if date was passed
				if(date){}
				else{
					// create date
						var date = new Date();
				}
			// Determine if number was passed
				if(number){}
				else{
					// set default number
						var number = 1;
				}
			// Determine DatePart
				switch (datepart){
					case "yyyy":
					  // YEAR
					  	date.setYear(date.getYear() + number);
					case "m":
					  // MONTH
					  	date.setMonth(date.getMonth() + number);
					case "ww":
					  // WEEK
					  	date.setDate(date.getDate() + number);
					 case "d":
					  // DAY
					  	date.setDate(date.getDate() + number);
					default:
					  // DAY
					  	date.setDate(date.getDate() + number);
				}
			return date;
		}
	
	// 	Fix Date
		// date - any instance of the Date object
		// * hand all instances of the Date object to this function for "repairs"
		
		function fixDate(date) {
		  var base = new Date(0);
		  var skew = base.getTime();
		  if (skew > 0)
		    date.setTime(date.getTime() - skew);
		}

		
	//////////////////////////////////////////////////////////////////////////////////////////		
		
		
	/////////////////////////////////////////////////////////////////////////
	/* CLEAN MS WORD FORMATTING *////////////////////////////////////////////
	/////////////////////////////////////////////////////////////////////////			
		function CleanWordHTML(str){
			str = str.replace(/<o:p>\s*<\/o:p>/g, "") ;
			str = str.replace(/<o:p>.*?<\/o:p>/g, "&nbsp;") ;
			str = str.replace( /\s*mso-[^:]+:[^;"]+;?/gi, "" ) ;
			str = str.replace( /\s*MARGIN: 0cm 0cm 0pt\s*;/gi, "" ) ;
			str = str.replace( /\s*MARGIN: 0cm 0cm 0pt\s*"/gi, "\"" ) ;
			str = str.replace( /\s*TEXT-INDENT: 0cm\s*;/gi, "" ) ;
			str = str.replace( /\s*TEXT-INDENT: 0cm\s*"/gi, "\"" ) ;
			str = str.replace( /\s*TEXT-ALIGN: [^\s;]+;?"/gi, "\"" ) ;
			str = str.replace( /\s*PAGE-BREAK-BEFORE: [^\s;]+;?"/gi, "\"" ) ;
			str = str.replace( /\s*FONT-VARIANT: [^\s;]+;?"/gi, "\"" ) ;
			str = str.replace( /\s*tab-stops:[^;"]*;?/gi, "" ) ;
			str = str.replace( /\s*tab-stops:[^"]*/gi, "" ) ;
			str = str.replace( /\s*face="[^"]*"/gi, "" ) ;
			str = str.replace( /\s*face=[^ >]*/gi, "" ) ;
			str = str.replace( /\s*FONT-FAMILY:[^;"]*;?/gi, "" ) ;
			str = str.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3") ;
			str = str.replace( /<(\w[^>]*) style="([^\"]*)"([^>]*)/gi, "<$1$3" ) ;
			str = str.replace( /\s*style="\s*"/gi, '' ) ;
			str = str.replace( /<SPAN\s*[^>]*>\s*&nbsp;\s*<\/SPAN>/gi, '&nbsp;' ) ;
			str = str.replace( /<SPAN\s*[^>]*><\/SPAN>/gi, '' ) ;
			str = str.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3") ;
			str = str.replace( /<SPAN\s*>(.*?)<\/SPAN>/gi, '$1' ) ;
			str = str.replace( /<FONT\s*>(.*?)<\/FONT>/gi, '$1' ) ;
			str = str.replace(/<\\?\?xml[^>]*>/gi, "") ;
			str = str.replace(/<\/?\w+:[^>]*>/gi, "") ;
			str = str.replace( /<H\d>\s*<\/H\d>/gi, '' ) ;
			str = str.replace( /<H1([^>]*)>/gi, '' ) ;
			str = str.replace( /<H2([^>]*)>/gi, '' ) ;
			str = str.replace( /<H3([^>]*)>/gi, '' ) ;
			str = str.replace( /<H4([^>]*)>/gi, '' ) ;
			str = str.replace( /<H5([^>]*)>/gi, '' ) ;
			str = str.replace( /<H6([^>]*)>/gi, '' ) ;
			str = str.replace( /<\/H\d>/gi, '<br>' ) ; //remove this to take out breaks where Heading tags were
			str = str.replace( /<(U|I|STRIKE)>&nbsp;<\/\1>/g, '&nbsp;' ) ;
			str = str.replace( /<(B|b)>&nbsp;<\/\b|B>/g, '' ) ;
			str = str.replace( /<([^\s>]+)[^>]*>\s*<\/\1>/g, '' ) ;
			str = str.replace( /<([^\s>]+)[^>]*>\s*<\/\1>/g, '' ) ;
			str = str.replace( /<([^\s>]+)[^>]*>\s*<\/\1>/g, '' ) ;
			//some RegEx code for the picky browsers
			var re = new RegExp("(<P)([^>]*>.*?)(<\/P>)","gi") ;
			str = str.replace( re, "<div$2</div>" ) ;
			var re2 = new RegExp("(<font|<FONT)([^*>]*>.*?)(<\/FONT>|<\/font>)","gi") ;
			str = str.replace( re2, "<div$2</div>") ;
			str = str.replace( /size|SIZE = ([\d]{1})/g, '' ) ;
			
			return str ;
		}
	//////////////////////////////////////////////////////////////////////////////////////////	
	
			
	/////////////////////////////////////////////////////////////////////////
	/* AJAX FUNCTIONS *//////////////////////////////////////////////////////
	/////////////////////////////////////////////////////////////////////////	
		// Get/Post Data
			/*
				Example Usage: 
				
					getDataFromServer_Ajax("http://www.myserver.com/mypage.cfm","get","myCallBackFunction");

		
					function myCallBackFunction(Response){
						// Change mouse pointer
							document.body.style.cursor='default';
						alert(unescape(Response));
					}
			*/
			function getDataFromServer_Ajax(PageRequestURL,PageRequestMethod,CallBackFunction) {
				if(CallBackFunction){
					/* Change mouse pointer */
						document.body.style.cursor='wait';
				}
				// Set default PageRequest var to false to indicate that the page request has not yet been made
					var PageRequest = false;
				// Determine if this is a modern browser
					if (window.XMLHttpRequest) {
						// MODERN BROWSER
							PageRequest = new XMLHttpRequest();
					}
					else if (window.ActiveXObject) {
						// OLD BROWSER
							// Determine if IE6
								if (window.ActiveXObject) {
									// IE6 BROWSER
										try {PageRequest = new ActiveXObject("Microsoft.XMLHTTP");}
										catch (ErrorInfo) {return false;}
								}	
					}
					else {
						return false;
					}
				
				// Determine if PageRequest variable was set	
					if (PageRequest) {
						// 	PAGEREQUEST VAR SET
							// Make Page Request
								MakePageRequest(PageRequest,PageRequestURL,PageRequestMethod);
							// When ready state changes...	
								PageRequest.onreadystatechange = function() {
									// Determine ReadyState/Status
										DetermineReadyStateStatus(PageRequest,CallBackFunction);
								}
							// Send the request	
								PageRequest.send(null);
					}
					else {
						// 	PAGEREQUEST VAR NOT SET
							// Run action(s) when unable to make AJAX call
								return false;
					}
			}
				
		// Make Page Request			
			function MakePageRequest(PageRequest,PageRequestURL,PageRequestMethod) {
				// Set Request Vars
					/*
						The first argument to this function can be set to either 'GET' or 'POST'. 
						If you are only pulling additional data from the server, use GET.  Otherwise you should always use ‘POST’.
						
						The second argument is the URL to the filename of the script you’re using on your own server. 
						
						The third argument controls whether the request is asynchronous or synchronous. If set to false, the call is made 
						synchronous and the user’s browser will actually lock up until the response is received, which is not what we want. 
						You will almost always leave this as true.
					*/
					var URL = PageRequestURL;
					var Method = PageRequestMethod;
				// 	Make request
					PageRequest.open(Method,URL,true);
			}
			
		// Determine ReadyState/Status	
			function DetermineReadyStateStatus(PageRequest,CallBackFunction){
				if (PageRequest.readyState == 4) {
					if (PageRequest.status == 200) {
						// Determine the reponse type
							/*
								responseText: 	The response from the server, as a String. 
								responseXML: 	The response from the server, as a Document Object Model, provided that the response was valid XML. 
							*/
							var Response;
							if (PageRequest.ResponseType == 'XML'){
								Response = PageRequest.responseXML;
							}
							else {
								Response = PageRequest.responseText;
							}	
							// Pass Response to Call Back Function
								try {eval(CallBackFunction + '(Response)');}
								catch (ErrorInfo) {}
								
					}
					else if (PageRequest.status == 404) {
						// object.innerHTML = 'Sorry - The requested data was not available.';
						// alert('error404');
					}
					else {
						//object.innerHTML = 'Sorry - there was a problem loading the requested data.';
						// alert('error');
					}
				}	else return;
			}		
			
	//////////////////////////////////////////////////////////////////////////////////////////	
	
	
	/////////////////////////////////////////////////////////////////////////
	/* ONDEMAND JAVASCRIPT FUNCTIONS *///////////////////////////////////////
	/////////////////////////////////////////////////////////////////////////	
		
		/* Get Data/HTML From Server */
			function getDataFromServer_ODJS(ID, ProxyURL, Host, Path, CallBackFunction) {
				/* Change mouse pointer */
					document.body.style.cursor='wait';
				/* Fetch the element pointed to by the id. If it exists, we destroy it so we can create a new one. */
					var ODScript = document.getElementById(ID);
				/* Setup the src attribute of the script tag */
					Host = encodeURIComponent(Host);
					Path = encodeURIComponent(Path);
					var UUID = encodeURIComponent(CreateUUID());
				/* Determine if Proxy URL contains ? */
					if(ProxyURL.indexOf("?") != -1){
						var QueryStringChar="&";
					}
					else{
						var QueryStringChar="?";
					}
					var JSFileURL = ProxyURL + QueryStringChar + "Host=" + Host + "&Path=" + Path + "&UUID=" + UUID;
				/* Load External JavaScript File */
					CheckLoadJSCSSFile_ODJS(ID, "js", JSFileURL, "Replace", CallBackFunction);
			}
		
		/* Dynamically Load External JavaScript and CSS Files */
			function LoadJSCSSFile_ODJS(FileID, FileType, FileURL, FileExistsAction, CallBackFunction){
				 /* Check to see if script is already loaded to avoid downloading the script multiple times */ 
					 if ((FileID) && (self.FileID)) { /* Already exists */
							if (FileExistsAction == 'Replace'){
								ReplaceJSCSSFile_ODJS(FileID, FileURL, FileURL, FileType)
							}
							else if (FileExistsAction == 'Alert'){
								alert("File already added!");
							}
							else{
								/* Do Nothing */
								return;
							}
			   		 }
				/* Determine fiel type */
					if (FileType == "js"){ 
						/* JavaScript file */
							var File=document.createElement('script');
							File.setAttribute("ID", FileID);
							File.setAttribute("type","text/javascript");
							var loaded = false;
							File.setAttribute("src", FileURL);
							File.onreadystatechange= function () {
								if (File.readyState == 'complete') {
									eval(CallBackFunction);
								}
							}
							//File.onload = function(){eval(CallBackFunction)};
							File.onload = File.onreadystatechange = function() {
							    if (!loaded && (!this.readyState || this.readyState == 'complete'
							                                     || this.readyState == 'loaded') ) {
							      loaded = true;
							      eval(CallBackFunction);
							      File.onload = File.onreadystatechange = null;
							    }
							}
					}
					else if (FileType == "css"){ 
						/* CSS file */
							var File=document.createElement("link");
							File.setAttribute("ID", FileID);
							File.setAttribute("rel", "stylesheet");
							File.setAttribute("type", "text/css");
							File.setAttribute("href", FileURL);
					}
				if (typeof File != "undefined"){
					/* Append Element to Head */
						document.getElementsByTagName("head")[0].appendChild(File);
				}
			}
			
		/* Dynamically Removes External JavaScript and CSS Files */			
			function RemoveJSCSSFile_ODJS(filename, FileType){
				var targetelement=(FileType=="js")? "script" : (FileType=="css")? "link" : "none" /* determine element type to create nodelist from */
				var targetattr=(FileType=="js")? "src" : (FileType=="css")? "href" : "none" /* determine corresponding attribute to test for */
				var allsuspects=document.getElementsByTagName(targetelement)
				for (var i=allsuspects.length; i>=0; i--){ /* search backwards within nodelist for matching elements to remove */
					if (allsuspects[i] && allsuspects[i].getAttribute(targetattr)!=null && allsuspects[i].getAttribute(targetattr).indexOf(filename)!=-1)
					allsuspects[i].parentNode.removeChild(allsuspects[i]) /* remove element by calling parentNode.removeChild() */
				}
			}
		
		/* Creates JavaScript and CSS Elements */
			function CreateJSCSSFile_ODJS(FileID, FileType, FileURL, CallBackFunction){
				if (FileType=="js"){ /* if filename is a external JavaScript file */
					var fileref=document.createElement('script');
					fileref.setAttribute("id",FileID);
					fileref.setAttribute("type","text/javascript");
					var loaded = false;
					fileref.setAttribute("src", FileURL);
					fileref.onreadystatechange= function () {
						if (fileref.readyState == 'complete') {
							eval(CallBackFunction);
						}
					}
					fileref.onload = fileref.onreadystatechange = function() {
					    if (!loaded && (!this.readyState || this.readyState == 'complete'
					                                     || this.readyState == 'loaded') ) {
					      loaded = true;
					      eval(CallBackFunction);
					      fileref.onload = fileref.onreadystatechange = null;
					    }
					}
				}
				else if (FileType=="css"){ //if filename is an external CSS file
					var fileref=document.createElement("link");
					fileref.setAttribute("id",FileID);
					fileref.setAttribute("rel", "stylesheet");
					fileref.setAttribute("type", "text/css");
					fileref.setAttribute("href", FileURL);
				}
				return fileref
			}
		
		/* Dynamically Replaces External JavaScript and CSS Files */				
			function ReplaceJSCSSFile_ODJS(FileID, oldFileURL, newFileURL, FileType, CallBackFunction){
				var targetelement=(FileType=="js")? "script" : (FileType=="css")? "link" : "none" /* determine element type to create nodelist using */
				var targetattr="id";
				var allsuspects=document.getElementsByTagName(targetelement)
				for (var i=allsuspects.length; i>=0; i--){ /* search backwards within nodelist for matching elements to remove */
					if (allsuspects[i] && allsuspects[i].getAttribute(targetattr)!=null && allsuspects[i].getAttribute(targetattr).indexOf(FileID)!=-1){
						var newelement=CreateJSCSSFile_ODJS(FileID, FileType, newFileURL, CallBackFunction);
						allsuspects[i].parentNode.replaceChild(newelement, allsuspects[i]);
					}
				}
			}
			
		/* Check to see if file is already loaded */
			var filesAdded="" /* list of files already added */
		 
			function CheckLoadJSCSSFile_ODJS(FileID, FileType, FileURL, FileExistsAction, CallBackFunction){
				var JSCSSFileObj = document.getElementById(FileID);
				if (JSCSSFileObj) {
					/* Already Exists */
						if (FileExistsAction == 'Replace'){
							ReplaceJSCSSFile_ODJS(FileID, FileURL, FileURL, FileType, CallBackFunction)
						}
						else if (FileExistsAction == 'Alert'){
							alert("File already added!");
						}
						else{
							/* Do Nothing */
						}
				}
				else {
					/* FILE DOES NOT EXIST */
						LoadJSCSSFile_ODJS(FileID, FileType, FileURL, FileExistsAction, CallBackFunction);
				}
			}	
	//////////////////////////////////////////////////////////////////////////////////////////							
			
// End hiding script from old browsers -->
