	function replaceText(target, text)
		{
			if(target)
				{
					//clearText(document.getElementById(target));
					//var newNode =document.createTextNode(text);
					//document.getElementById(target).appendChild(newNode);
					document.getElementById(target).innerHTML=text;
				}
		}
	function clearText(target)
		{
			if(target)
				{
					if(target.childNodes.length)
						{
							for(var i=0; i<target.childNodes.length; i++)
								{
									var childNode = target.childNodes[i];
									target.removeChild(childNode);
								}
						}
				}
		}
	function getText(target)
		{
			var text = "";
			if(target)
				{
					if(target.childNodes.length)
						{
							for(var i=0; i<target.childNodes.length; i++)
								{
									var childNode = target.childNodes[i];
									if(childNode.nodeValue)
										{
											text = text + childNode.nodeValue;
										}
								}
						}
				}
			return text;
		}
		
	function getSpanText(target)
		{
			var text = "";
			if(target)
				{
					if(target.innerHTML.length)
						{
							text = text + target.innerHTML;
						}
				}
			return text;
		}
		
	function goLink(Link)
		{
			var goLink;
			goLink = dissolve_key(Link);
			document.location.href(goLink);
			return true
		}
		
	function axButton(objName, colorTo)
		{
			var aie=document.getElementById(objName);
			aie.style.background=colorTo;
			return true;
		}
		
	function daxButton(objName, changeTo)
		{
			//alert('url(/images/SAFPA/Buttons/Cells/'+changeTo+')');
			var aie=document.getElementById(objName);
			if(changeTo.length!=0)
			{
				if(changeTo.substring(0,1)=='#')
					{
						aie.style.background=changeTo;
					}else{
						aie.style.backgroundImage='url(/images/SAFPA/Buttons/Cells/'+changeTo+')';
					}
			}else{
				aie.style.background='';
			}
			return true;
		}
		
	function c_axButton(objName, colorTo)
		{
			var aie=document.getElementById(objName);
			aie.style.background=colorTo;
			var aim=document.getElementById('b_'+objName);
			var axc=aim.src;
			axc.replace('_off.gif','_on.gif');
			return true;
		}
		
	function c_daxButton(objName, changeTo)
		{
			//alert('url(/images/SAFPA/Buttons/Cells/'+changeTo+')');
			var aie=document.getElementById(objName);
			if(changeTo.length!=0)
			{
				if(changeTo.substring(0,1)=='#')
					{
						aie.style.background=changeTo;
					}else{
						aie.style.backgroundImage='url(/images/SAFPA/Buttons/Cells/'+changeTo+')';
					}
			}else{
				aie.style.background='';
			}
			return true;
		}
		
	function CollapseControl(ChangeControlName, setVisible)
		{
			var i=1;
			var MakeVisible=''; 
			var MakeHidden='none';
			var ControlID = document.getElementById(ChangeControlName);
			var currentState = ControlID.style.display;
			if(currentState != MakeHidden) {ControlID.style.display = MakeHidden;} else {ControlID.style.display = MakeVisible;};
			if(setVisible=='on') {ControlID.style.display = MakeVisible;};
			if(setVisible=='off') {ControlID.style.display = MakeHidden;};
			return true;

		}
		
	function strRev(string)
		{
			var sL=0, rV='';
			if(string.length)
				{
					for(sL=0;sL<=string.length;sL++)
						{
							rV = string.charAt(sL)+rV;
						}
					return rV;
				}else{
					return false;
				}
		}

	function DisEnableControl(FormName, ControlName, Visibility)
		{
			var GetState;
			GetState = document.forms(FormName).elements(ControlName).disabled;
			if (Visibility == "flip")
				{
					if (GetState==true)
						{
							document.forms(FormName).elements(ControlName).disabled = false;
						} else {
							document.forms(FormName).elements(ControlName).disabled = true;
						}
				} else {
					document.forms(FormName).elements(ControlName).disabled = Visibility;
				}
		}
		
	function FP_preloadImgs() 
		{//v1.0
			var d=document,a=arguments; 
			if(!d.FP_imgs) d.FP_imgs=new Array();
			for(var i=0; i<a.length; i++)
				{
					d.FP_imgs[i]=new Image;
					d.FP_imgs[i].src=a[i];
				}
		}
		
	function FP_swapImg() 
		{//v1.0
			var doc=document,args=arguments,elm,n;
			doc.$imgSwaps=new Array(); 
			for(n=2; n<args.length; n+=2) 
			{
				elm=FP_getObjectByID(args[n]); 
				if(elm) 
					{ 
						doc.$imgSwaps[doc.$imgSwaps.length]=elm;
						elm.$src=elm.src; elm.src=args[n+1]; 
					} 
			}
		}
		
	function FP_getObjectByID(id,o) 
		{//v1.0
			var c,el,els,f,m,n; 
			if(!o)o=document; 
			if(o.getElementById) el=o.getElementById(id);
			else if(o.layers) c=o.layers; 
			else if(o.all) el=o.all[id]; 
			if(el) return el;
			if(o.id==id || o.name==id) return o; 
			if(o.childNodes) c=o.childNodes; 
			if(c)
				for(n=0; n<c.length; n++) 
					{ 
						el=FP_getObjectByID(id,c[n]); 
						if(el) return el; 
					}
				f=o.forms; 
			if(f) 
				for(n=0; n<f.length; n++) 
					{ 
						els=f[n].elements;
						for(m=0; m<els.length; m++)
							{ 
								el=FP_getObjectByID(id,els[n]); 
								if(el) return el; 
							} 
					}
			return null;
		}

	function MM_preloadImages() { //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];}}
	}
	
	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;
	}
	
	function MM_findObj(n, d) { //v4.01
	  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 && d.getElementById) x=d.getElementById(n); return x;
	}
	
	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];}
	}

	function SetVisible(visObj, nvisObs, silent)
		{
			var msg = '';
			if(visObj.length==0)
				{
					if(silent=='No')
						{
							return true;
						}else{
							msg += 'You didn\'t specify an object to be made visible\n';
						}
				}else{
					var vObj = document.getElementById(visObj);
					if(!vObj)
						{
							if(silent=='No')
								{
									return true;
								}else{
									msg += 'You specified an object ('+visObj+') I can\'t find\n';
								}
						}else{
							vObj.style.display='';
						}
				}			
			if(nvisObj.length!=0)
				{
					var i;
					var nObjArray = split(nvisObj, ",");
					if(nObjArray.length!=0)
						{
							for (var i = 0; i < nObjArray.length; i++) 
								{
									vObj = document.getElementById(nObjArray[i]);
									if(!vObj)
										{
											if(silent=='No')
												{
													return true;
												}else{
													msg += 'You specified an object ('+nObjArray[i]+') I can\'t find\n';
												}
										}else{
											vObj.style.display='none';
										}
								}
						}
				}
			if(silent=='No')
				{
					alert(msg);
				}
			return true;
		}
		
	function StripNameSpace(NameToStrip)
		{
			//
			//Function: Strips the string provided of spaces.  This is useful if you need to make sure
			//				the user input has no spaces in it.
			//
			//Input:	NameToStrip - the string you want stripped of spaces
			//
			//Output:	String resulting from the NameToStrip with the spaces removed.  If the supplied
			//				string is empty, the routine returns an empty string.
			//
			var i, build;
			build='';
			i=0;
			if(NameToStrip.length==0){return NameToStrip;}
			for (i=0; i<(NameToStrip.length); i++)
				{
					if(NameToStrip.charAt(i)!=' '){build += NameToStrip.charAt(i);}
				}
			return build;
		}
	function deLimit(obj, str, slen, protect)
		{
			//
			//Function: Returns a string to an object at a specified length after optionally screening
			//				it for unwanted information/characters.  I developed this string to strip
			//				out characters from user data that were being used as injection attacks.
			//				Remember, it only works when javascript is enabled, so make sure there's a 
			//				backup screen on the server itself!
			//
			//Input:	obj - the object the routine will put the result string to.  This routine can be
			//				easily modified to just return the corrected string as a variable, but I wanted
			//				it to write the info directly back and save the middle step.
			//			str - the string to be corrected
			//			slen - the length of the string you want returned.  Use -1 if you don't care what length
			//				is returned, otherwise the routine will cut off the string to the first number
			//				of characters specified in slen.  If the resulting string has less that that 
			//				number of characters, then the whole result will be returned (i.e. you ask for only
			//				10 but the result has 8, all 8 will be returned).
			//			protect - boolean (true/false).  Specifies whether you want the string screened for
			//				errant characters or strings.  In the routine below, you can specify which
			//				strings to screen out.
			//
			//Output:	No variable output, but the results are written directly to the object specified
			//			in the obj variable.
			//
			// First the array for protection.  If you have any additional things you want screened out
			// of your data, add them to this list as comma separated values with no spaces between
			var RepBuild = 'url:,https,http,//,www,.com,.net,.org,ftp,:,?,<,>,{,},%,$,(,),*,@,!';
			//this line explodes the protection list into an array for the screener to use
			var repArray = RepBuild.split(",");
			var i = 0;
			var build = str;
			var str_h = str;
			var build1,begin,end;
			
			if(protect=true)
				{
					// If Protect=true, this means you want to screen the string first to strip out
					// anything that might compromise data security (like http:// calls, spurious
					// javascript, php, vbscript, or other characters that might spoof or inject into
					// your own data.  This will also strip out the @ and .com, .net, & .org from e-mail
					// addresses
					if(isNaN(str))
						//This basically states that as long as the value entered is a number,
						//we really don't have to do anything to it since it (as a number) should
						//pose no security risk
						{
							for(i=0; i<repArray.length; i++)
								{
									// This loop is to go through all of the protection items in the repArray
									// created above
									do{
										// Check to see if the next repArray item is in the string to be screened
										begin=build.indexOf(repArray[i]);
										// If it isn't, begin = -1.  If begin = 0, that means the item is there and
										// the very first thing in the string (position zero)
										if(begin!=-1)
											{
												// Since the item is found, locate it in the string and strip it out
												// by taking the piece of the string before it and the string after it
												// and putting them together without that segment.
												build1 = '';
												end=begin+repArray[i].length;
												
												build1 = build.substring(0,begin)
												+build.substring(end,build.length);
												build = build1;
											}
										// Keep going while the item in repArray is still located in the string to be screened
									}while(build.indexOf(repArray[i])!=-1)
								}
						}else{
							build = str;
						}
				}
			if(slen>=0)
				{
					// If a specific length is required, trim the final output to that length
					// and place the result directly into the value area of the object (obj)
					//alert('Build: '+build+'('+build.length+")\n\nslen: "+slen );
					if(build.length!=0)
						{
							if(isNaN(str))
								{
									obj.value = build.substr(build,slen);
								}
						}else{
							obj.value=str;
						}
				}else{
					// Otherwise put the final output directly into the object (obj) value area
					// without trimming.  To specify no trimming, make slen=-1 or any negative value
					obj.value = str;
				}
			return;
		}
		
	function deLimit_e(obj, str, slen, protect)
		{
			//** This is the non-e-mail address destroying version of deLimit above
			//Function: Returns a string to an object at a specified length after optionally screening
			//				it for unwanted information/characters.  I developed this string to strip
			//				out characters from user data that were being used as injection attacks.
			//				Remember, it only works when javascript is enabled, so make sure there's a 
			//				backup screen on the server itself!
			//
			//Input:	obj - the object the routine will put the result string to.  This routine can be
			//				easily modified to just return the corrected string as a variable, but I wanted
			//				it to write the info directly back and save the middle step.
			//			str - the string to be corrected
			//			slen - the length of the string you want returned.  Use -1 if you don't care what length
			//				is returned, otherwise the routine will cut off the string to the first number
			//				of characters specified in slen.  If the resulting string has less that that 
			//				number of characters, then the whole result will be returned (i.e. you as for only
			//				10 but the result has 8, all 8 will be returned).
			//			protect - boolean (true/false).  Specifies whether you want the string screened for
			//				errant characters or strings.  In the routine below, you can specify which
			//				strings to screen out.
			//
			//Output:	No variable output, but the results are written directly to the object specified
			//			in the obj variable.
			//
			// First the array for protection.  If you have any additional things you want screened out
			// of your data, add them to this list as comma separated values with no spaces between
			var RepBuild = 'url:,https,http,//,:,?,<,>,{,},%,$,(,),*,!';
			//this line explodes the protection list into an array for the screener to use
			var repArray = RepBuild.split(",");
			var i = 0;
			var build = str;
			var build1,begin,end;
			if(protect=true)
				{
					// If Protect=true, this means you want to screen the string first to strip out
					// anything that might compromise data security (like http:// calls, spurious
					// javascript, php, vbscript, or other characters that might spoof or inject into
					// your own data.  This will also strip out the @ and .com, .net, & .org from e-mail
					// addresses
					for(i=0; i<repArray.length; i++)
						{
							// This loop is to go through all of the protection items in the repArray
							// created above
							do{
								// Check to see if the next repArray item is in the string to be screened
								begin=build.indexOf(repArray[i]);
								// If it isn't, begin = -1.  If begin = 0, that means the item is there and
								// the very first thing in the string (position zero)
								if(begin!=-1)
									{
										// Since the item is found, locate it in the string and strip it out
										// by taking the piece of the string before it and the string after it
										// and putting them together without that segment.
										build1 = '';
										end=begin+repArray[i].length;
										
										build1 = build.substring(0,begin)
										+build.substring(end,build.length);
										build = build1;
									}
								// Keep going while the item in repArray is still located in the string to be screened
							}while(build.indexOf(repArray[i])!=-1)
						}
				}
			if(slen>=0)
				{
					// If a specific length is required, trim the final output to that length
					// and place the result directly into the value area of the object (obj)
					if(build.length!=0)
						{
							str = build.substr(build,slen);
							obj.value = str;
						}else{
							obj.value='';
						}
				}else{
					// Otherwise put the final output directly into the object (obj) value area
					// without trimming.  To specify no trimming, make slen=-1 or any negative value
					obj.value = build;
				}
			return;
		}
		
	function deLimit_d(obj, str, slen, protect)
		{
			//** This is the non-e-mail address, non-colon (for time) destroying version of deLimit above
			//Function: Returns a string to an object at a specified length after optionally screening
			//				it for unwanted information/characters.  I developed this string to strip
			//				out characters from user data that were being used as injection attacks.
			//				Remember, it only works when javascript is enabled, so make sure there's a 
			//				backup screen on the server itself!
			//
			//Input:	obj - the object the routine will put the result string to.  This routine can be
			//				easily modified to just return the corrected string as a variable, but I wanted
			//				it to write the info directly back and save the middle step.
			//			str - the string to be corrected
			//			slen - the length of the string you want returned.  Use -1 if you don't care what length
			//				is returned, otherwise the routine will cut off the string to the first number
			//				of characters specified in slen.  If the resulting string has less that that 
			//				number of characters, then the whole result will be returned (i.e. you as for only
			//				10 but the result has 8, all 8 will be returned).
			//			protect - boolean (true/false).  Specifies whether you want the string screened for
			//				errant characters or strings.  In the routine below, you can specify which
			//				strings to screen out.
			//
			//Output:	No variable output, but the results are written directly to the object specified
			//			in the obj variable.
			//
			// First the array for protection.  If you have any additional things you want screened out
			// of your data, add them to this list as comma separated values with no spaces between
			var RepBuild = 'url:,https,http,//,?,<,>,{,},%,$,(,),*,!';
			//this line explodes the protection list into an array for the screener to use
			var repArray = RepBuild.split(",");
			var i = 0;
			var build = str;
			var build1,begin,end;
			if(protect=true)
				{
					// If Protect=true, this means you want to screen the string first to strip out
					// anything that might compromise data security (like http:// calls, spurious
					// javascript, php, vbscript, or other characters that might spoof or inject into
					// your own data.  This will also strip out the @ and .com, .net, & .org from e-mail
					// addresses
					for(i=0; i<repArray.length; i++)
						{
							// This loop is to go through all of the protection items in the repArray
							// created above
							do{
								// Check to see if the next repArray item is in the string to be screened
								begin=build.indexOf(repArray[i]);
								// If it isn't, begin = -1.  If begin = 0, that means the item is there and
								// the very first thing in the string (position zero)
								if(begin!=-1)
									{
										// Since the item is found, locate it in the string and strip it out
										// by taking the piece of the string before it and the string after it
										// and putting them together without that segment.
										build1 = '';
										end=begin+repArray[i].length;
										
										build1 = build.substring(0,begin)
										+build.substring(end,build.length);
										build = build1;
									}
								// Keep going while the item in repArray is still located in the string to be screened
							}while(build.indexOf(repArray[i])!=-1)
						}
				}
			if(slen>=0)
				{
					// If a specific length is required, trim the final output to that length
					// and place the result directly into the value area of the object (obj)
					if(build.length!=0)
						{
							str = build.substr(build,slen);
							obj.value = str;
						}else{
							obj.value='';
						}
				}else{
					// Otherwise put the final output directly into the object (obj) value area
					// without trimming.  To specify no trimming, make slen=-1 or any negative value
					obj.value = build;
				}
			return;
		}
		
	function MM_goToURL() 
		{ //v3.0
			var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
			for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
		}
	function MM_validateForm() 
		{ //v4.0
		  if (document.getElementById)
			{
				var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
				for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
				if (val) { nm=val.name; if ((val=val.value)!="") 
					{
						if (test.indexOf('isEmail')!=-1) 
							{ 
								p=val.indexOf('@');
								if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
							} else if (test!='R') { num = parseFloat(val);
						if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
						if (test.indexOf('inRange') != -1) 
							{ p=test.indexOf(':');
								min=test.substring(8,p); max=test.substring(p+1);
						if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
						} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
						} if (errors) alert('The following error(s) occurred:\n'+errors);
						document.MM_returnValue = (errors == '');
			} 
		}

	function getMouseXY(includeScroll) 
		{
			//
			//Function: Returns the X and Y coordinates of the current mouse position in an array
			//
			//Input:	includeScroll - true/false.  If true, the returned coordinates will include
			//				the scrolled area of the screen window.  So if the user has scrolled down
			//				a window, the routine will correctly report where the mouse is in the
			//				window scheme instead of just relative to the physical screen.
			//				** This is only relevant in IE because NS always reports the mouse coords
			//					relative to the scrolled window, not the physical screen
			//
			//Output:	Array:
			//				Note the coordinates are relative to the screen to include the area
			//				of the scroll
			//				array['X'] = X coordinate of the mouse
			//				array['Y'] = Y coordinate of the mouse
			//
			var IE = document.all?true:false;
			if (!IE) document.captureEvents(Event.MOUSEMOVE);
			var tempX = 0;
			var tempY = 0;
			var coord = new Array;
			coord['Y']=0;
			coord['X']=0;
			if (IE) 
				{ 
					// Internet Explorer Browser is the only one where the includeScroll 
					// variable is relevant
					if(includeScroll)
						{
							tempX = event.clientX + document.body.scrollLeft;
							tempY = event.clientY + document.body.scrollTop;
						}else{
							tempX = event.clientX;
							tempY = event.clientY;
						}
					
				} else {  // non-IE
					tempX = document.pageX;
					tempY = document.pageY;
				}  
			
			if (tempX < 0){tempX = 0;}
			if (tempY < 0){tempY = 0;}
			
			// Set the array values the routine will return.  In the lines above, if the values are
			// going to be negative, the routine will zero them out to maintain the mouse coords on
			// the visible screen
			coord['X']=tempX;
			coord['Y']=tempY;
			
			return coord;
		}

var getMProfile = new Array;

getMProfile['Member'] = createMRequest();
getMProfile['Mentor'] = createMRequest();
getMProfile['Category'] = createMRequest();
getMProfile['AllMentor'] = createMRequest();
getMProfile['sendInfo'] = createMRequest();
getMProfile['submitInfo'] = createMRequest();
getMProfile['setAccept'] = createMRequest();
getMProfile['checkName'] = createMRequest();

var layerName = 'infoLayer';
var tableName = 'memberView';

	function setQueryString()
		{
			var queryString = "";
			var frm = document.forms[0];
			var numberOfElements = frm.elements.length;
			for(var i=0; i<numberOfElements; i++)
				{
					queryString += frm.elements[i].name+"="+encodeURIComponent(frm.elements[i].value);
					if(i<numberOfElements-1){queryString += "&";}
				}
			return queryString;
		}

	function placeLayer(layerName, showDuration, xOffset, yOffset)
		{
			//
			//Function: Place a layer or object on the screen.  There is also an optional
			//          element to make the object disappear after a user-determined amount
			//			of time.
			//Input:	layerName - the ID of the object being positioned
			//			showDuration - how long the object should be visible for before disappearing
			//				if showDuration = 0, the object will not vanish
			//			xOffset - how far horizontally from the mouse position you want the object placed 
			//				use negative numbers to place the object horizontally to the right of the mouse
			//				error checking will keep the value at or above zero (on-screen)
			//			yOffset - how far vertically from the mouse position you want the object placed 
			//				use negative numbers to place the object vertically above the mouse
			//				error checking will keep the value at or above zero (on-screen)
			//Output:	None
			//
			if(layerName)
				{
					// If showDuration > 0, this part sets a timer to make the layer/object disappear
					// after the number of seconds specified in showDuration
					if(showDuration>0)
						{
							var timing = setTimeout("showLayer(layerName, 'none', false, 400, 30)", showDuration*1000);
						}
					// Get the mouse coordinates from the getMouseXY routine.  Specify 'true' as the 
					// includeScroll variable to account for the user scrolling in windows.
					var mm = getMouseXY(true);
					var pLayer = document.getElementById(layerName);
					// If offsets are specified in the xOffset and yOffset variables, add them in,
					// but only if the offsets will still keep the object in the visible screen area.
					if(mm['X'] + xOffset < 0){xOffset=0;}
					if(mm['Y'] + yOffset < 0){yOffset=0;}
					pLayer.style.left = mm['X'] + xOffset;
					pLayer.style.top = mm['Y'] + yOffset;
				}
		}
		
	function showLayer(layerName, objectName, visible, xDef, yDef)
		{
			//
			//Function: Make a layer visible and size it to an object (usually a table) within the layer
			//				The layer can be sized to any object within the layer so long as the object
			//				is specified in the tableName variable
			//Input:	layerName - the ID of the layer being positioned and sized
			//			objectName - the ID of the object within the layer being sized.  This is usually a
			//				table to form the borders of the layer, but can be any object within the layer
			//			visible - a boolean (true/false) value for whether you want the object to be visible
			//				or not.  If visible=false, the routine will not bother to size the layer, it will
			//				just make the layer invisible.  You can use this feature to make *ANY* object
			//				invisible by specifying the objects ID in the layerName variable, setting the 
			//				objectName variable to 'none', and visible=false.
			//			xDef - an integer specifying the minimum horizontal size of the layer
			//				Specifying a minumum size of zero is the same as not specifying a minimum size
			//			yDef - an integer specifying the minimum vertical size of the layer
			//				Specifying a minumum size of zero is the same as not specifying a minimum size
			//Output:	true/false - if the object specified in layerName cannot be found or isn't real (maybe
			//				mispelled or something), the routine will report false.  If the routine functions
			//				without a hitch, the routine will report true
			//
			if(visible)
				{
					// Since visible=true, go through the sizing routine
					if(objectName)
						{
							// This is where the table size is determined by getting the clientHeight/Width
							// and adding the border size.  If you are using objects other than a table
							// for sizing dimensions, you can add detection code here to detect the type
							// of object specified in objectName and get the correct dimensions accordingly
							var r = document.getElementById(objectName);
							var rH = r.clientHeight+(r.border*2);
							if(rH<yDef){rH=yDef;}
							var rW = r.clientWidth+(r.border*2);
							if(rW<xDef){rW=xDef;}
						}else{
							// The default size is a 10x10 pixel area unless other defaults are specified
							var rH = 30;
							//if(rH<yDef){rH=yDef;}
							var rW = 400;
							//if(rH<xDef){rH=xDef;}
						}
					if(layerName)
						{
							// If the object specified in layerName actually exists, set the height and width
							document.getElementById(layerName).style.height=2;
							document.getElementById(layerName).style.width=2;
							//document.getElementById(layerName).style.height=rH;
							document.getElementById(layerName).style.width=rW;
						}else{
							// Otherwise return a false value since nothing could be set on a non-accessible
							// or non-existent object
							return false;
						}
					// Make the object visible after sizing
					document.getElementById(layerName).style.display='';
				}else{
					// Make the object invisible since visible=false.  There's no need to size the layer/object
					// since it isn't going to be displayed anyway
					if(layerName)
						{
							document.getElementById(layerName).style.display='none';
						}
				}
			return true;
		}

	function makeLevel(lvlDot)
		{
			if(lvlDot)
				{
					if (isNaN(lvlDot))
						{
							alert('Non-numeric value passed: '+lvlDot);
							return 0;
						}else{
							var i=0;
							var make='';
							for(i=0; i<lvlDot+1;i++)
								{
									make = make+'../';
								}
							return make;
						}
				}else{
					alert('No idea what was passed: '+lvlDot);
					return 0;
				}
		}
						

	function collapseTable(tableName, rowToKeepOpen, optionalControlToHide, optionalControlToShow)
		{
			//
			//Function: Collapse the rows of a table making all, one, or none of the rows visible
			//			By specifying additionally the ID of a control you wish to hide or show, you can make easy
			//			on/off buttons or controls to show/hide aspects of your table.
			//
			//Input:	tableName - the ID of the table containing the rows
			//			rowToKeepOpen - The row you'd like to remain visible, all of the rest are removed from
			//				display.  This variable may have the following values:
			//					integer > 0 --> the row corresponding to that integer is left open i.e. if
			//						row 1 is specified, the first row of the table is left open
			//					0 (zero) --> The table is displayed but the rows are collapsed
			//					none --> The entire table is not displayed
			//					all --> All of the table rows are displayed
			//					'name' --> The row with the ID or Name specified is left open
			//
			//			optionalControlToHide --> This specifies the ID of a control to hide
			//					Set this to 'none' if you don't want to use this feature
			//			optionalControlToShow --> This specifies a control to display
			//					Set this to 'none' if you don't want to use this feature
			//
			//Output:	None
			//
			if(!optionalControlToHide)
				{
					var optionalControlToHide = 'none';
				}
			if(!optionalControlToShow)
				{
					var optionalControlToShow = 'none';
				}
			if(document.getElementById)
				{
					// Start by geting all of the tables on the page
					var tbl = document.getElementsByTagName('table');
					// If there is a table with the name specified in tableName, set
					//the reference points to it
					if(tbl[tableName])
						{
							//alert(rowToKeepOpen);
							// If none of the rows are to remain visible ('none' or zero), make
							// the whole table invisible
							if(rowToKeepOpen=='none')
								{
									tbl[tableName].style.display='none';
								}else{
									tbl[tableName].style.display='';
									// Otherwise, the first element in the table DOM is the TBody element
									tBodyNode = tbl[tableName].childNodes[0];
									// and the number of rows are the number of childNodes under the 
									// TBody element
									tRowCount = tBodyNode.childNodes.length;
									var nextRow;
									var i =0;
									// Loop through all of the rows...
									for(i=0; i<tRowCount; i++)
										{
											nextRow = tBodyNode.childNodes[i];
											// If the rowToKeepOpen variable holds a name instead of a number,
											// this will check for the name and, if equal, will make that row
											// visible.  Otherwise, the row is not displayed.
											if(isNaN(rowToKeepOpen))
												{
													//...or if the rowToKeepOpen=='all'
													if(nextRow.name==rowToKeepOpen || nextRow.id==rowToKeepOpen || rowToKeepOpen=='all')
														{
															nextRow.style.display='';
														}else{
															nextRow.style.display='none';
														}
												}else{
													// Otherwise, keep open the row number specified.  If zero is specified, no rows
													// are displayed.  This routine counts the physical (not zero-indexed) row number
													// so specifying 1 means the first actual row, 2 is the sedonc, 3 the third 
													// and so on.
													// If the row to keep open = 0, all of th rows will be closed but the table will be visible.
													if(rowToKeepOpen==0)
														{
															nextRow.style.display='none';
														}else{
															if(i==(rowToKeepOpen-1) || rowToKeepOpen<1)
																{
																	nextRow.style.display='';
																}else{
																	nextRow.style.display='none';
																}
														}
												}
										}
								}
						}
					if(!optionalControlToHide || optionalControlToHide == 'none')
						{
							//No control to hide was specified so nothing will happen
						}else{
							//This hides the specified control
							ByID(optionalControlToHide).style.visible = 'none';
						}
					if(!optionalControlToShow || optionalControlToShow == 'none')
						{
							//No control to show was specified so nothing will happen
						}else{
							//This causes the specified control to become visible
							ByID(optionalControlToHide).style.visible = '';
						}
				}
		}

	function whichElement(e, report)
		{
			var targ;
			if (!e) 
				{
					var e = window.event;
				}else{
					report = true;
				}
			if (e.target) 
				{
					targ = e.target;
				}else{
					if (e.srcElement) 
						{
							targ = e.srcElement;
						}
				}
			if (targ.nodeType==3) // defeat Safari bug
				{
					targ = targ.parentNode;
				}
			var targetInfo = new Array;
			targetInfo['tagType']=targ.tagName;
			if(targ.id){targetInfo['ID']=targ.id;}else{targetInfo['ID']='None Given';}
			targetInfo['numberOfChildren']=targ.childNodes.length;
			targetInfo['hasChildren']=(targetInfo['numberOfChildren']!=0);
			targetInfo['innerHTML']=targ.innerHTML;
			targetInfo['outerHTML']=targ.outerHTML;
		
			if(report)
				{
					var fullInfo = '';
					fullInfo = fullInfo+'Tag Name: '+targetInfo['tagType']+"\n";
					fullInfo = fullInfo+'ID: '+targetInfo['ID']+"\n";
					fullInfo = fullInfo+'Has Children: '+targetInfo['hasChildren']+"\n";
					fullInfo = fullInfo+'Number of Children: '+targetInfo['numberOfChildren']+"\n";
					fullInfo = fullInfo+'Inner HTML: '+targetInfo['innerHTML']+"\n";
					fullInfo = fullInfo+'Outer HTML: '+targetInfo['outerHTML']+"\n";
					alert(fullInfo);
				}
			return targetInfo;
		}
	function ByID(objName)
		{
			if(objName)
			{
				return document.getElementById(objName);
			}
		}
			
	function mBack(obj, bColor)
		{
			if(bColor && obj)
			{
				var objID;
				objID = ByID(obj);
				if(bColor=='none')
				{
					objID.style.background=''; 
					objID.style.cursor='default';
				}else{
					objID.style.background=bColor; 
					objID.style.cursor='pointer';
				}
			}
		}
		
	function dx(obj)
		{// This routine causes the object to disappear
			if(obj)
				{
					var objID = ByID(obj);
					objID.style.display='none';
				}
		}
		
	function ax(obj)
		{//This routine causes the object to appear
			if(obj)
				{
					var objID = ByID(obj);
					objID.style.display='';
				}
		}	
		
	function createMRequest()
		{
			var mRequest;// = null;
			try 
				{
					mRequest = new XMLHttpRequest();
				} catch (trymicrosoft) 
					{
						try 
							{
								mRequest = new ActiveXObject("Msxml2.XMLHTTP");
							} catch (othermicrosoft)
								{
									try 
										{
											mRequest = new ActiveXObject("Microsoft.XMLHTTP");
										} catch (failed) 
											{
												request = null;
											}
								}
					}
			if(mRequest == null)
				{
					alert("Error creating request object!");
				} else {
					return mRequest;
				}
		}
		
	function checkName(getName, getLevel)
		{
			var lvl = makeLevel(getLevel);
			var url = lvl+"Includes/safpa_include_checkForName.php?CheckName="+getName+"&im="+im+"&gt="+new Date().getTime();
			if(getName.length==0)
				{
					replaceText('userNameResponse', '<span="RedText"><center>Please enter a username for me to check<br>then click the <strong>"Check User Name"</strong> button.</center></span>');
				}else{
					getMProfile['checkName'].open("GET", url, false);
					getMProfile['checkName'].onreadystatechange=checkNameActions;
					getMProfile['checkName'].send();
				}
		}

	function getMInfo(getName, getLevel)
		{
			var lvl = makeLevel(getLevel);
			var url = lvl+"Includes/safpa_include_getMemberProfile.php?GetUserName="+getName+"&gt="+new Date().getTime();
			getMProfile['Member'].open("GET", url, true);
			getMProfile['Member'].onreadystatechange=updateMemberProfile;
			getMProfile['Member'].send();
		}

	function getSupplementorInfo(getName, getLevel)
		{
			var lvl = makeLevel(getLevel);
			var url = lvl+"Includes/safpa_include_getMemberProfile.php?GetUserName="+getName+"&gt="+new Date().getTime();
			getMProfile['Member'].open("GET", url, true);
			getMProfile['Member'].onreadystatechange=updateMemberProfile;
			getMProfile['Member'].send();
		}
	function getAllMentorInfo(getName, getLevel)
		{
			var lvl = makeLevel(getLevel);
			var url = lvl+"Includes/safpa_include_getAllMentorInfo.php?GetUserName="+getName+"&gt="+new Date().getTime();
			getMProfile['AllMentor'].open("GET", url, true);
			getMProfile['AllMentor'].onreadystatechange=updateAllMentorInfo;
			getMProfile['AllMentor'].send();
		}

	function getMentorInfo(getName, getLevel)
		{
			var lvl = makeLevel(getLevel);
			var url = lvl+"Includes/safpa_include_getMentorInfo.php?GetUserName="+getName+"&gt="+new Date().getTime();
			getMProfile['Mentor'].open("GET", url, true);
			getMProfile['Mentor'].onreadystatechange=updateMentorProfile;
			getMProfile['Mentor'].send();
		}

	function updateMentorProfile()
		{
			if(getMProfile['Mentor'].readyState==4)
				{
					if(getMProfile['Mentor'].status==200)
						{
							var rspTxt = getMProfile['Mentor'].responseText;
							if(rspTxt.length!=0) 
								{
									replaceText('memberName', rspTxt);
								}else{
									replaceText('memberName', 'No Mentor Profile information available');
								}
						}else{
							if(getMProfile['Mentor'].status==500)
								{
									replaceText('memberName', 'I\'m sorry, but I encountered error '+getMProfile['Mentor'].status+' trying\nto validate your request.\r\nI don\'t know what this error means.');
								}else{
									replaceText('memberName', 'I\'m sorry, but I encountered error '+getMProfile['Mentor'].status+' trying\nto validate your request.');
								}
						}
				}else{
					replaceText('memberName', 'Loading...');
				}
				showLayer(layerName, tableName, true, 300, 30)
		}
		
	function checkNameActions()
		{
			if(getMProfile['checkName'].readyState==4)
				{
					if(getMProfile['checkName'].status==200)
						{
							var rspTxt = getMProfile['checkName'].responseText;
							if(rspTxt.length!=0) 
								{
									if(rspTxt=='Yes')
										{
											replaceText('userNameResponse', '<span class="RedText"><center>I\'m sorry, but that user name is already taken.<br>Please try another.</center></span>');
											ByID('UserName').focus()
											ByID('userNameResponse').style.backgroundColor="#330000";
											ByID('badName').checked=true;
											return true;
										}else{
											if(rspTxt=='Me')
												{
													replaceText('userNameResponse', '<span class="GreenText"><center>You are currently logged in</center></span>');
													ByID('userNameResponse').style.backgroundColor="#003300";
													ByID('badName').checked=false;
													return true;
												}else{
													replaceText('userNameResponse', '<span class="GreenText"><center>I didn\'t find that user name on file,<br>so it should be available to you</center></span>');
													ByID('userNameResponse').style.backgroundColor="#003300";
													ByID('badName').checked=false;
													return false;
												}
										}
								}else{
									replaceText('userNameResponse', 'I\'m unable to contact the central database to check this name.');
								}
						}else{
							if(getMProfile['checkName'].status==500)
								{
									replaceText('userNameResponse', 'I\'m sorry, but I encountered error '+getMProfile['checkName'].status+' trying\nto validate your request.\r\nI don\'t know what this error means.');
								}else{
									replaceText('userNameResponse', 'I\'m sorry, but I encountered error '+getMProfile['checkName'].status+' trying\nto validate your request.');
								}
						}
				}else{
					replaceText('userNameResponse', 'Checking username...');
				}
				return rspTxt;
		}
		
	function getSendInfo(getLevel, sendAsMentor, mentor, mentoree, category)
		{
			var lvl = makeLevel(getLevel);
			var sam = ByID('sendAsMentor').checked;
			var url = lvl+"Includes/safpa_include_getMentorSend.php?";
			if(sendAsMentor)
				{
					url += "Mentor="+mentor+"&Mentoree="+mentoree;
				}else{
					url += "Mentor="+mentoree+"&Mentoree="+mentor;
				}
			url += "&Category="+category+"&sendAsMentor="+sam+"&gt="+new Date().getTime();
			//alert(sam);
			getMProfile['sendInfo'].open("GET", url, true);
			getMProfile['sendInfo'].onreadystatechange=updateSendInfo;
			getMProfile['sendInfo'].send();
		}

	function getCatInfo(getName, getLevel, mentor, mentoree)
		{
			var lvl = makeLevel(getLevel);
			var url = lvl+"Includes/safpa_include_getMentorCategories.php?";
			url += "GetUserName="+getName;
			url += "&mt="+mentor;
			url += "&me="+mentoree+"&gt="+new Date().getTime();
			getMProfile['Category'].open("GET", url, true);
			getMProfile['Category'].onreadystatechange=updateCategory;
			getMProfile['Category'].send();
		}

	function updateCategory()
		{
			if(getMProfile['Category'].readyState==4)
				{
					if(getMProfile['Category'].status==200)
						{
							var rspTxt = getMProfile['Category'].responseText;
							//alert(rspTxt);
							if(rspTxt.length!=0) 
								{
									replaceText('PotentialMentorCategories', rspTxt);
								}else{
									replaceText('PotentialMentorCategories', 'No information available');
								}
						}else{
							if(getMProfile['Category'].status==500)
								{
									replaceText('PotentialMentorCategories', 'I\'m sorry, but I encountered error '+getMProfile['Category'].status+' trying\nto validate your request.\r\nI don\'t know what this error means.');
								}else{
									replaceText('PotentialMentorCategories', 'I\'m sorry, but I encountered error '+getMProfile['Category'].status+' trying\nto validate your request.');
								}
						}
				}else{
					replaceText('PotentialMentorCategories', 'Loading...');
				}
		}

	function makeSubmitInfo(getLevel)
		{
			var lvl = makeLevel(getLevel);
			var url = lvl+"Includes/safpa_include_sendMentorInfo.php";
			var sendData = setQueryString();
			var contentType = 'application/x-www-form-urlencoded; charset=UTF-8';
			
			getMProfile['submitInfo'].open("post", url, true);
			getMProfile['submitInfo'].onreadystatechange=submitInfo;
			getMProfile['submitInfo'].setRequestHeader('Content-Type', contentType);
			getMProfile['submitInfo'].send(sendData);
		}

	function submitInfo()
		{
			ax('MessageDisplay');
			if(getMProfile['submitInfo'].readyState==4)
				{
					if(getMProfile['submitInfo'].status==200)
						{
							var rspTxt = getMProfile['submitInfo'].responseText;
							//alert(rspTxt);
							if(rspTxt.length!=0) 
								{
									replaceText('Message', rspTxt);
								}else{
									replaceText('Message', 'No information available');
								}
						}else{
							if(getMProfile['submitInfo'].status==500)
								{
									replaceText('Message', 'I\'m sorry, but I encountered error '+getMProfile['submitInfo'].status+' trying\nto validate your request.\r\nI don\'t know what this error means.');
								}else{
									replaceText('Message', 'I\'m sorry, but I encountered error '+getMProfile['submitInfo'].status+' trying\nto validate your request.');
								}
						}
				}else{
					replaceText('Message', 'Sending Request, please wait...'+getMProfile['submitInfo'].readyState);
				}
		}

	function updateAllMentorInfo()
		{
			if(getMProfile['AllMentor'].readyState==4)
				{
					if(getMProfile['AllMentor'].status==200)
						{
							var rspTxt = getMProfile['AllMentor'].responseText;
							//alert(rspTxt);
							if(rspTxt.length!=0) 
								{
									replaceText('FullMentorReport', rspTxt);
									//alert (rspTxt);
								}else{
									replaceText('FullMentorReport', 'No information available');
								}
						}else{
							if(getMProfile['AllMentor'].status==500)
								{
									replaceText('FullMentorReport', 'I\'m sorry, but I encountered error '+getMProfile['AllMentor'].status+' trying\nto validate your request.\r\nI don\'t know what this error means.');
								}else{
									replaceText('FullMentorReport', 'I\'m sorry, but I encountered error '+getMProfile['AllMentor'].status+' trying\nto validate your request.');
								}
						}
				}else{
					replaceText('FullMentorReport', 'Loading...');
				}
		}
		
	function setAcceptance(getLevel, setMentor, member, mID)
		{
			var msg;
			switch(setMentor)
				{
					case "accept":
						msg = 'Are you sure you want to accept this Mentorship?';
					break;
					
					case "decline":
						msg = 'Are you certain you wish to decline this Mentorship?';
					break;
					
					case "delete":
						msg = 'Are you sure you want to delete this Mentorship?';
					break;
					
					case "break":
						msg = 'Are you sure you want to break this Mentorship?';
					break;
				}
			if(confirm(msg))
				{
					var lvl = makeLevel(getLevel);
					var url = lvl+"Includes/safpa_include_setAccept.php";
					var sendData = "setMentor="+setMentor+"&member="+member+"&mID="+mID+"&gt="+new Date().getTime();
					var contentType = 'application/x-www-form-urlencoded; charset=UTF-8';
					
					getMProfile['setAccept'].open("post", url, true);
					getMProfile['setAccept'].onreadystatechange=updateAcceptance;
					getMProfile['setAccept'].setRequestHeader('Content-Type', contentType);
					getMProfile['setAccept'].send(sendData);
				}
		}

	function updateAcceptance()
		{
			//ax('MessageDisplay');
			if(getMProfile['setAccept'].readyState==4)
				{
					if(getMProfile['setAccept'].status==200)
						{
							var rspTxt = getMProfile['setAccept'].responseText;
							if(rspTxt.length!=0) 
								{
									//replaceText('Message', rspTxt);
									replaceText('FullMentorReport', rspTxt);
								}else{
									replaceText('FullMentorReport', 'Mentor Assignment Information');
								}
						}else{
							if(getMProfile['setAccept'].status==500)
								{
									alert('I\'m sorry, but I encountered error '+getMProfile['setAccept'].status+' trying\nto validate your request.\r\nI don\'t know what this error means.');
								}else{
									alert('I\'m sorry, but I encountered error '+getMProfile['setAccept'].status+' trying\nto validate your request.');
								}
						}
				}else{
					var msg = '<center>Mentorship Acceptance: Loading...</center>'
					replaceText('FullMentorReport', msg);
				}
		}

	function updateSendInfo()
		{
			if(getMProfile['sendInfo'].readyState==4)
				{
					if(getMProfile['sendInfo'].status==200)
						{
							var rspTxt = getMProfile['sendInfo'].responseText;
							//alert(rspTxt);
							if(rspTxt.length!=0) 
								{
									var m1, m2, c1, e1, txt1;
									replaceText('sv', rspTxt);
									c1 = ByID('CategoryName').value;
									t1 = ByID('sendAsMentor').checked;
									txt1 = '<input type="checkbox" name="sendAsMentor" id="sendAsMentor" onchange="" ';
									if(t1) 
										{
											m2 = ByID('MentorName').value;
											m1 = ByID('MentoreeName').value;
											e1 = ByID('MentoreeEMail').value;
											txt1 += 'checked="checked"';
											replaceText('RequestTitle', '<center>Mentoree Request</center>');
										}else{
											replaceText('RequestTitle', '<center>Mentor Request</center>');
											m1 = ByID('MentorName').value;
											m2 = ByID('MentoreeName').value;
											e1 = ByID('MentoreeEMail').value;
										}
									txt1 += '/>';
//									alert(txt1);
                                    if(t1)
										{
											txt1 +='Un-check here if you would like to request '+m2+' as a mentor instead';
										}else{
											txt1 +='Check here if you would like to request '+m1+' as a mentoree instead';
										}
									replaceText('sendAsMentorCheck',txt1);
									//alert(c1);
									replaceText('_MentorName', m1);
									replaceText('_MentoreeName', m2);
									replaceText('_CategoryName', c1);
									replaceText('_EMail', e1);
								}else{
									replaceText('RequestTitle', '<center>Mentorship Request: Unable to assign that Category</center>');
								}
						}else{
							if(getMProfile['sendInfo'].status==500)
								{
									alert('I\'m sorry, but I encountered error '+getMProfile['Mentor'].status+' trying\nto validate your request.\r\nI don\'t know what this error means.');
								}else{
									alert('I\'m sorry, but I encountered error '+getMProfile['Mentor'].status+' trying\nto validate your request.');
								}
						}
				}else{
					replaceText('RequestTitle', '<center>Mentorship Request: Loading...</center>');
				}
		}

	function CorrectText(FormName, ControlName, Mode) {
		var CorrectedText = "" + document.forms(FormName).elements(ControlName).value;
		var CountChar; var Convert = "<{[>}]"; 
		var CorrectLength; var i;
		var NextComparison = "";
		// A quote is a quotation mark, followed by any number of
		// non-quotation-mark characters (which we remember), followed
		// by another quotation mark.
		var quote = /['"]/g;
		// Replace the straight quotation marks with "curly quotes,"
		// and leave the contents of the quote (stored in $1) unchanged.
		if (CorrectedText)
			{
				if (Mode=="Normal" || Mode=="HTML")
					{
						for (i=0;i<6;i++)
							{
								NextComparison = Convert.substr(i,1);
								CountChar = CorrectedText.indexOf(NextComparison,0);
								while (CountChar!=-1) 
									{
										CorrectedText = CorrectedText.replace(NextComparison, "");
										if (CorrectedText)
											{
												CountChar = CorrectedText.indexOf(NextComparison,0);
											} else {
												CountChar = -1;
											}
									};
							}
					}
				if (Mode=="Normal" || Mode=="Quote")
					{
						CorrectedText=CorrectedText.replace(quote, "`"); 
					}
				document.forms(FormName).elements(ControlName).value=CorrectedText;	
			}
	}
	
	function CorrectTextByID(IDName, Mode) {
		var TextItem = document.getElementById(IDName);
		var CorrectedText = "" + TextItem.value;
		var CountChar; var Convert = "<{[>}]"; 
		var CorrectLength; var i;
		var NextComparison = "";
		// A quote is a quotation mark, followed by any number of
		// non-quotation-mark characters (which we remember), followed
		// by another quotation mark.
		var quote = /['"]/g;
		// Replace the straight quotation marks with "curly quotes,"
		// and leave the contents of the quote (stored in $1) unchanged.
		if (CorrectedText)
			{
				if (Mode=="Normal" || Mode=="HTML")
					{
						for (i=0;i<6;i++)
							{
								NextComparison = Convert.substr(i,1);
								CountChar = CorrectedText.indexOf(NextComparison,0);
								while (CountChar!=-1) 
									{
										CorrectedText = CorrectedText.replace(NextComparison, "");
										if (CorrectedText)
											{
												CountChar = CorrectedText.indexOf(NextComparison,0);
											} else {
												CountChar = -1;
											}
									};
							}
					}
				if (Mode=="Normal" || Mode=="Quote")
					{
						CorrectedText=CorrectedText.replace(quote, "`"); 
					}
				TextItem.value=CorrectedText;	
			}
	}
	
	function CorrectTextSingleQuoteByID(IDName, Mode) {
		var TextItem = document.getElementById(IDName);
		var CorrectedText = "" + TextItem.value;
		var CountChar; var Convert = "<{[>}]"; 
		var CorrectLength; var i;
		var NextComparison = "";
		// A quote is a quotation mark, followed by any number of
		// non-quotation-mark characters (which we remember), followed
		// by another quotation mark.
		var quote = /[']/g;
		// Replace the straight quotation marks with "curly quotes,"
		// and leave the contents of the quote (stored in $1) unchanged.
		if (CorrectedText)
			{
				if (Mode=="Normal" || Mode=="HTML")
					{
						for (i=0;i<6;i++)
							{
								NextComparison = Convert.substr(i,1);
								CountChar = CorrectedText.indexOf(NextComparison,0);
								while (CountChar!=-1) 
									{
										CorrectedText = CorrectedText.replace(NextComparison, "");
										if (CorrectedText)
											{
												CountChar = CorrectedText.indexOf(NextComparison,0);
											} else {
												CountChar = -1;
											}
									};
							}
					}
				if (Mode=="Normal" || Mode=="Quote")
					{
						CorrectedText=CorrectedText.replace(quote, "`"); 
					}
				TextItem.value=CorrectedText;	
			}
	}
	function cCase(textToChange, caseType, bJustFirst, bStripSpace, bStripNonNumbers)
		{
			var changeTo = ""; var lLength = 0; var changeHold = ""; var charHold = "";
			var bMakeChange = false; var i=0; var lLoop = 0; var sCheck = "";
			//alert(textToChange);
			//If there is anything in the textToChange value, we will process it otherwise skip to the end
			if(textToChange)
				{
					lLength = textToChange.length;
					//alert('Length: ' +lLength);
					//if the length of the text to change is only one character, change that character and send it back
					//avoiding the time tied up in the processing routine
					if(lLength==1 || bJustFirst)
						{
							if (caseType=='lower'){changeTo = textToChange.toLowerCase();}else{changeTo = textToChange.toUpperCase();}
						}else{
							for(i=0;i<lLength+1;i++)
								{
									charHold = textToChange.substr(i,1);
									//alert(textToChange.substr(i,1)+'/'+charHold);
									if(charHold==" " || (i==0 && charHold != " "))
										{
											if((i==0)||(i>0 && !bJustFirst))
												{
													bMakeChange = true;
												}
										}
									if (bMakeChange && charHold != " " && charHold != "")
										{
											if(caseType=='lower')
												{
													charHold = charHold.toLowerCase();
												}else{
													charHold = charHold.toUpperCase();
												}
											bMakeChange = false;
										}
									if(bStripSpace && charHold==" ")
										{
											charHold = "";
										}
									if(bStripNonNumbers && isNaN(charHold))
										{
											//alert(isNaN(charHold));
											if(charHold == "-" && caseType == 'zipcode')
												{
													charHold = "-";
												}else{
													charHold = "";
												}
										}
									//alert(charHold);
									changeTo = changeTo + charHold;
									charHold = "";
								}
						}
				}
			return changeTo;
		}