<!-- Hide script from old browsers
	/* 
	
		Change location with button click
			onclick="JavaScript:self.location.href='http://mysite.com'"
		
		Set Timeout (Pause Function in Miliseconds)
			setTimeout("UpdateParentClosePopup(#VARIABLES.JSRedirect#)",2000);
			
		Automated Printing
			OnLoad='javascript:window.print();'
			
		Ststus Window Message
			onMouseOver="window.status='';return true;"
			
		Change button text
			onClick="JavaScript: this.disabled=true; this.value='Loading...'; this.form.submit();"
			
		Set Cursor to Pointer
			onmouseover="this.style.cursor='pointer';"
	
	*/
	
	// Button to refresh current page
		/*
			<input type="button" name="refresh" value="Refresh" class="small" onclick="javascript: history.go(0);">
		*/
	
	// Disable Button - Change Value of Button - Submit Form
		/*
			onclick="JavaScript: this.disabled=true; this.value='New Text...'; this.form.submit();"
		*/
		
	// Delay/Pause	
		/*
			setTimeout("alert('hello')",1250);
		*/
		
	// Allows user to bookmark site as a favorite
	
		/*
			<a href="javascript:window.external.AddFavorite('http://www.somesite.com','Some Site')">Bookmark</a>
		*/
	
	// Plays wav file on user action
		/*	
			<a href="#" onMouseOver="document.all.music.src='music.wav'">Play Music</a>
			<bgsound src="##" id=music loop=1 autostart="true">
		*/
	
	// Prevent Select
		/*
		<script type="text/javascript">
		<!--
		var omitformtags=["input", "textarea", "select"]
		omitformtags=omitformtags.join("|")
		function disableselect(e){
		if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)
		return false
		}
		function reEnable(){
		return true
		}
		if (typeof document.onselectstart!="undefined")
		document.onselectstart=new Function ("return false")
		else{
		document.onmousedown=disableselect
		document.onmouseup=reEnable
		}
		-->
		</script>
		*/
		
	// 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();
		    }
		  }
		}


	
	// 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();
			}
	// 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>');
		}
		
	// 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";}}
		}	
		
		
	/////////////////////////////////////////////////////////////////////////
	/* WINDOW INFO *//////////////////////////////////////////////////////////
	/////////////////////////////////////////////////////////////////////////
	
		/*
		 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; 
		
		*/
		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;} 
		function windowWidthHeight() {var width='', height=''; width=windowWidth(); height=windowHeight();  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;}
		function scrollWidthHeight() {var width='', height=''; width=scrollWidth(); height=scrollHeight();  return [width,height];};
		
		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];};
  
		function WindowInfo(){
			var windowWH = windowWidthHeight();
			var scrollWH = scrollWidthHeight();
			var position = posTRBL();
			alert('window width: ' + windowWH[0] + ' window height: ' + windowWH[1] + ' scroll width: ' + scrollWH[0] + ' scroll height: ' + scrollWH[1]);
			alert('position top: ' + position[0] + ' position right: ' + position[1] + ' position bottom: ' + position[2] + ' position left: ' + position[3]);
		}
				
	/////////////////////////////////////////////////////////////////////////
	/* ELEMENT INFO *//////////////////////////////////////////////////////////
	/////////////////////////////////////////////////////////////////////////
		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];}}

	
	/////////////////////////////////////////////////////////////////////////
	/* ELEMENT ACTIONS *//////////////////////////////////////////////////////////
	/////////////////////////////////////////////////////////////////////////			
		
		// 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);
			}	
		
		// 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;}}}
			}		
	
	
	/* Page Loading Function
		<!-- 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";
							}
			    }
			}
		}
		
	/* 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";
		}
		
	// Change Class
		// Example Usage: onclick="ChangeClass('DivID', 'ClassName');

		function ChangeClass(id, newClass) {
		 	identity=document.getElementById(id);
		 	identity.className=newClass;
		}
		
		
	// 	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) 
		{} 
		} 
		
		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)); 
		}  		
		
		
	// 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> */
		function NewWindow(url,windowname,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+',';
		  win=window.open(url,windowname,settings);
		  if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
		}
		
		
	// 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);
		}

	//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();	
			}
			
			
			
	// Confirms User Action
	/* Sample Usage: onClick="return ConfirmAction('Enter Confirmation Text Here');" */
		function ConfirmAction(ConfirmationTxt)
		{
			if (confirm(ConfirmationTxt)){
				return true;
			}  
			else{
				return false;
			}
		}
		
	// Alerts User
	/* Sample Usage: onClick="return Alert('Enter Alert Text Here');" */
		function Alert(AlertTxt)
		{
			alert(AlertTxt)
		}

	
	// 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);	
		}
		
	//Prevents user from leaving pop-up in background and not being able to use the link
		window.focus();

	//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];}
		}
		
	// 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();
			   }
			}
		
		//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 
			}	
			
		// 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;"
			
				
		// 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>');	

				}
		
		
		/* 	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
		/* Example Usage:
			<script language="JavaScript">
				<!-- //
					FlashCheck('4','<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab##version=6,0,0,0" WIDTH="341" HEIGHT="288" id="ToughQuestions" ALIGN=""> <PARAM NAME=movie VALUE="ToughQuestions.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=##FFFFFF> <EMBED src="ToughQuestions.swf" quality=high bgcolor=##FFFFFF  WIDTH="341" HEIGHT="288" NAME="ToughQuestions" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>','<img src="#VARIABLES.DirLevel#images/BannerAds/341x288_ToughCompQuestions.jpg" alt="" width="341" height="288" border="0">');
				// -->
			</script>
		*/		
			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 Tag
							document.write(FlashCode);
						}
				   else {
						// Insert Image Tag
							document.write(NonFlashCode);
						}
				}	
		
		// 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";
						}	
				}				
											
		// 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;
			         }
			      }
			   }
			}
			
		// 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);
			}
			
		// 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;
			}

		
		// 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;
			}
			
		/*	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;
			   }
			}
			
		// return the value of the selected option from a drop-down menu
		//	getSelectedValue('country','Index')
			function getSelectedValue(DropDownObj,RetunValue) {
				var dropdownIndex = document.getElementById(DropDownObj).selectedIndex;
				var dropdownValue = document.getElementById(DropDownObj)[dropdownIndex].value;
				if (RetunValue == 'Index'){
					return dropdownIndex;
				}
				else{
					return dropdownValue;
				}
			}
			
		// return the value of the radio button that is checked
		// return an empty string if none are checked, or
		// there are no radio buttons
			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")
				}
				
/*/
SetInList() 

takes five 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) 


GetInList() 

takes three 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)
			{	/*/ ending /*/

				/*/
				/ / 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
			{	/*/ beginning /*/

				// 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);
	}
}

/*/
/ / 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)
			{	/*/ ending /*/

				/*/
				/ / 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
			{	/*/ beginning /*/

				// 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);
	}
}


// TRIM FUNCTIONS
	function trim(stringToTrim) {
		return stringToTrim.replace(/^\s+|\s+$/g,"");
	}
	function ltrim(stringToTrim) {
		return stringToTrim.replace(/^\s+/,"");
	}
	function rtrim(stringToTrim) {
		return stringToTrim.replace(/\s+$/,"");
	}
	function StripWhiteSpace(stringToTrim) {
		var StrippedString;
	  	StrippedString = stringToTrim.replace(/^\s*/, "").replace(/\s*$/, ""); 
	  	StrippedString = StrippedString.replace(/\s{2,}/, " "); 
	  	return StrippedString;
	}
	
// 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
			
		}
	}
	
	
// Dynamically Load External JavaScript and CSS Files
	/* 
		REF: http://www.javascriptkit.com/javatutors/loadjavascriptcss.shtml
		
		EXAMPLE USAGE:
		loadjscssfile("myscript.js", "js") //dynamically load and add this .js file
		loadjscssfile("javascript.php", "js") //dynamically load "javascript.php" as a JavaScript file
		loadjscssfile("mystyle.css", "css") ////dynamically load and add this .css file	

	*/
	function loadjscssfile(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)
		}
		if (typeof fileref!="undefined")
			document.getElementsByTagName("head")[0].appendChild(fileref)
	}
	
// 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()
		}
	}

// 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])
			}
		}
	}
/*//////////////////////////////////////
	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,errorMsg) {
		    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	
		function validatePassword(fld,minLength,maxLength,errorMsg) {
		    var error = "";
		    var illegalChars = /[\W_]/; // allow only letters and numbers 
		    if (fld.value == "") {
		        fld.style.background = 'Yellow';
		        error = "You didn't enter a password.\n";
		    } else if ((fld.value.length < minLength) || (fld.value.length > maxLength)) {
		        error = "The password is the wrong length. \n";
		        fld.style.background = 'Yellow';
		    } else if (illegalChars.test(fld.value)) {
		        error = "The password contains illegal characters.\n";
		        fld.style.background = 'Yellow';
		    } else if (!((fld.value.search(/(a-z)+/)) && (fld.value.search(/(0-9)+/)))) {
		        error = "The password must contain at least one numeral.\n";
		        fld.style.background = 'Yellow';
		    } else {
		         // Do Nothing
		    }
		   return error;
		} 
		
	// Email	
		function validateEmail(fld,errorMsg) {
		    var error="";
		    var tfld = trim(fld.value);                        // value of field with whitespace trimmed off
		    var emailFilter = /^[^@]+@[^@.]+\.[^@]*\w\w$/ ;
		    var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/ ;
		   
		    if (fld.value == "") {
		        fld.style.background = 'Yellow';
		        error = "You didn't enter an email address.\n";
		    } else if (!emailFilter.test(tfld)) {              //test email for illegal characters
		        fld.style.background = 'Yellow';
		        error = "Please enter a valid email address.\n";
		    } else if (fld.value.match(illegalChars)) {
		        fld.style.background = 'Yellow';
		        error = "The email address contains illegal characters.\n";
		    } else {
		        // Do Nothing
		    }
		    return error;
		}  
		
	// 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;
		}
/*///////////////////////////////////*/







	
// End hiding script from old browsers -->