<!-- 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">
		*/
	
	// 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";}}
		}	
		
	// Snap DHTML Layer to HTML Object
		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('PageLoadingMsg');
					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.PageLoadingMsg';
						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 = 'PageLoadingMsg';
						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 or Contract Objects - Plus/Minus Sign
		function ExpandContractObjectPlusMinus(obj,SwapImage,LrgSml)
		{
		// Display/Hide Object	
			var el = document.getElementById(obj);
			if (LrgSml == 'Lrg')
				{
					var ReplaceImg_Plus = '/images/PlusSign.gif';
					var ReplaceImg_Minus = '/images/MinusSign.gif';
				}
			else
				{
					var ReplaceImg_Plus = '/images/PlusSign_Small.gif';
					var ReplaceImg_Minus = '/images/MinusSign_Small.gif';
				}
			if(el.style.display != "block")
			{
				el.style.display = "block";
				MM_swapImage(SwapImage,'',ReplaceImg_Minus,1);
			}
			else
			{
				el.style.display = "none";
				MM_swapImage(SwapImage,'',ReplaceImg_Plus,1);
			}
		}
		
		
	// 	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;"
			
				
		/* 	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;
			}

			
		// 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
			function copyit(theField) {
				var tempval=eval("document."+theField)
				tempval.focus()
				tempval.select()
				therange=tempval.createTextRange()
				therange.execCommand("Copy")
				}
// End hiding script from old browsers -->
//////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
/* 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];
}
	//////////////////////////////////////////////////////////////////////////////////////////

	/////////////////////////////////////////////////////////////////////////
	/* GENERAL FUNCTIONS *///////////////////////////////////////////////////
	/////////////////////////////////////////////////////////////////////////

// Get Object
/*
	Example Use: getObj("ObjID")
*/
function getObj(objID){
	Obj = document.getElementById(objID);
	return Obj;
}

// Generate Unique ID
function CreateUUID() {
	var UUID = new Date;
	UUID = UUID.getTime();
	UUID = encodeURIComponent(UUID);
	//alert(UUID);
	return UUID;
}
	/////////////////////////////////////////////////////////////////////////
	/* 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;
		}
}
/////////////////////////////////////////////////////////////////////////
	/* 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();
			    }
			  }
			}	
	//////////////////////////////////////////////////////////////////////////////////////////		
	
	/////////////////////////////////////////////////////////////////////////
	/* 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;
			}		
			
	//////////////////////////////////////////////////////////////////////////////////////////	

