//=============================================================================
// addOptionsToSelectElement()                                       cph:050622
//=============================================================================
// Purpose: Add one or more OPTIONS to a SELECT control.
// Args   : vSelect  == variant; SELECT control to be populated
//        : aOptions == array; OPTION text and value pairs to be added
// Returns: --
// Example: addOptionsToSelectElement('Degrees',aDegrees)
// Assumes: aOptions has even number of indices and in this order: TEXT,VALUE
// SeeAlso: clearSelectElement();selectAllOptions();selectOption();
//-----------------------------------------------------------------------------
function addOptionsToSelectElement(vSelect,aOptions){var o=getObj(vSelect),oOption,i;
for(i=0;i<aOptions.length;i=i+2){oOption=document.createElement("option");
oOption.value=aOptions[i+1];oOption.text=aOptions[i];o.add(oOption)}}

//=============================================================================
// alternateRowClass() v1.2
//=============================================================================
// Purpose: Alternate the classes of consective rows in a table.
// Args   : vTable  == variant; table obj ref or ID of the table
//          sClass1 == string; css class of normal row
//          sClass2 == string; css class of alternate row
//          iRows   == integer (opt); alternate class every x number of rows
// Returns: --
// Remarks: alternateRowClass() will alternate every row if iRows is not supplied.
// Example: onLoad="alternateRowClass('tblRooms','trStyle1','trStyle2',2)"
//-----------------------------------------------------------------------------
function alternateRowClass(vTable,sClass1,sClass2,iRows){var i,i2,c,oTable,oRows;
if(!iRows)iRows=1;if(oTable=getObj(vTable)){oRows=oTable.rows;for(i=0;i<oRows.length;i+=iRows){
c=(c==sClass1)?sClass2:sClass1;oRows[i].className=c;for(i2=1;i2<iRows;i2++){if(i+i2<oRows.length)oRows[i+i2].className=c}}}}

//=============================================================================
// autofitTextarea() v1.0
//=============================================================================
// Purpose: Automatically adjust the height of a textarea element to match its
//          current content.
// Args   : vObj  == variant; ID string of a textarea or an object reference.
// Returns: --
// SeeAlso: checkTextLength();setTextareaMaxLength();
//-----------------------------------------------------------------------------
function autofitTextarea(vObj){o=getObj(vObj);if(o.clientHeight!=o.scrollHeight)o.style.height=o.scrollHeight;}

//=============================================================================
// changeTab()                                                       cph:050212
//=============================================================================
// Purpose: Select tab and its accompanying view.
// Args   : iTab == integer; number of the tab to be selected
// Returns: --
// Example: changeTab(3)
// Assumes: proper tabStrip structure & naming conventions have been followed.
//-----------------------------------------------------------------------------
function changeTab(iTab){var i,tabsCount=getObj('tabs').getElementsByTagName('li').length;
for(i=1;i<tabsCount+1;i++){getObj('tab'+i).className='';getObj('tab'+i+'Content').style.display='none'}
getObj('tab'+iTab).className='here';getObj('tab'+iTab+'Content').style.display='block'}

//=============================================================================
// checkform() v4.4
//=============================================================================
// Purpose: Validate form data.
// Inputs : f       == variant; form name or form object
//        : e[,...] == string; element name
//        : r[,...] == string; requirements
//        : d[,...] == integer; data type
//        : m[,...] == string; error message
// Returns: Boolean
// Example: checkform('frm','name','#',0,'Name','age','#0_130',1,'Age'[,...n])
// Remarks: args e-m can repeat. For more information refer to
//          /_users/_sharedDocs/checkformReference.doc
//-----------------------------------------------------------------------------
function checkform(){//v4.5
	var args=checkform.arguments,o,bChecked=true,sValue='',sErrHead='The following information is incomplete or contains errors:',sErrMsg='',bErr=false,bReq,bRival,oRex,oCompare,aRexArgs,aMatches,sRex,bDateCompare=false,aDateArgs,oSibling;
	if(args[4].substring(0,4)=='esp:'){sErrHead='La información siguiente es incompleta o contiene errores:';args[4]=args[4].substring(4);}
	for(var i=1;i<args.length;i=i+4){
		if(args[i+1].charAt(0)=='#'){bReq=true;args[i+1]=args[i+1].substring(1);}else{bReq=false;}
		if(args[i+1].charAt(0)=='!'&&args[i+2]==5){bRival=true;args[i+1]=args[i+1].substring(1);}else{bRival=false;}
		o=getObj(args[i].replace(/(\.options)*\[\d+\]/ig,""));sValue=o.value;
		if(o.type=='text'||o.type=='hidden'||o.type=='password'){
			if(bReq&&trim(sValue).length==0)bErr=true;
			if((sValue.length>0)&&(args[i+2]==1)){if(isNaN(sValue/1)||(args[i+1].split('_')[0]==0&&sValue.length<args[i+1].split('_')[0].length)||sValue<args[i+1].split('_')[0]/1||sValue>args[i+1].split('_')[1]/1){bErr=true;}}
			if((sValue.length>0)&&(args[i+2]==2)){oRex=/^[\w\.=-]+@[\w\.-]+\.[a-z]{2,4}$/;if(!oRex.test(sValue))bErr=true;}
			if(sValue.length>0&&args[i+2]==3){if(args[i+1].charAt(0)=='^'){bDateCompare=true;args[i+1]=args[i+1].substring(1);}
				aDateArgs=args[i+1].split("_");switch(aDateArgs[0].toLowerCase()){case "us":sRex="^\([0-9]?[0-9]\)[-\/]\([0-9]?[0-9]\)[-\/]\([0-9]{2}|[12][0-9]{3}\)$#2#1#3";break;case "d/m/yyyy":sRex="^\([0-9]?[0-9]\)\/\([0-9]?[0-9]\)\/\([0-9]{4}\)$#1#2#3";break;case "dd/mm/yyyy":sRex="^\([0-9][0-9]\)\/\([0-9][0-9]\)\/\([0-9]{4}\)$#1#2#3";break;case "m/d/yyyy":sRex="^\([0-9]?[0-9]\)\/\([0-9]?[0-9]\)\/\([0-9]{4}\)$#2#1#3";break;case "mm/dd/yyyy":sRex="^\([0-9][0-9]\)\/\([0-9][0-9]\)\/\([0-9]{4}\)$#2#1#3";break;case "mm/dd/yy":sRex="^\([0-9][0-9]\)\/\([0-9][0-9]\)\/\([0-9]{2}\)$#2#1#3";break;case "d.m.yyyy":sRex="^\([0-9]?[0-9]\)\\.\([0-9]?[0-9]\)\\.\([0-9]{4}\)$#1#2#3";break;case "dd.mm.yyyy":sRex="^\([0-9][0-9]\)\\.\([0-9][0-9]\)\\.\([0-9]{4}\)$#1#2#3";break;case "m.d.yyyy":sRex="^\([0-9]?[0-9]\)\\.\([0-9]?[0-9]\)\\.\([0-9]{4}\)$#2#1#3";break;case "mm.dd.yyyy":sRex="^\([0-9][0-9]\)\\.\([0-9][0-9]\)\\.\([0-9]{4}\)$#2#1#3";break;case "dd-mm-yyyy":sRex="^\([0-9][0-9]\)\\-\([0-9][0-9]\)\\-\([0-9]{4}\)$#1#2#3";break;
				case "mm-dd-yyyy":sRex="^\([0-9][0-9]\)\\-\([0-9][0-9]\)\\-\([0-9]{4}\)$#2#1#3";break;case "mm/yyyy":sRex="^\([0-9][0-9]\)\/\([0-9]{4}\)$#2#3";break;case "mm.yyyy":sRex="^\([0-9][0-9]\)\\.\([0-9]{4}\)$#2#3";break;case "mm-yyyy":sRex="^\([0-9][0-9]\)\\-\([0-9]{4}\)$#2#3";break;default:alert('Development error:\n\nInvalid date format provided to function');}
				aRexArgs=sRex.split("#");aMatches=sValue.match(aRexArgs[0]);
				if(aMatches){var myD=(aMatches[aRexArgs[1]])?aMatches[aRexArgs[1]]:1;var myM=aMatches[aRexArgs[2]]-1;var myY=aMatches[aRexArgs[3]];if(myY.length==2)myY=(myY<30)?'20'+myY:'19'+myY;var myDate=new Date(myY,myM,myD);if(myDate.getFullYear()!=myY||myDate.getDate()!=myD||myDate.getMonth()!=myM){bErr=true;}}else{bErr=true;}
				if(!bErr&&bDateCompare){if(aDateArgs.length<3){alert('Development error:\n\nNot enough arguments supplied to date validation item');bErr=true;}else{var dMin=new Date(aDateArgs[1]);var dMax=new Date(aDateArgs[2]);if(myDate<dMin||myDate>dMax)bErr=true;}}}
			if(sValue.length>0&&args[i+2]==4){switch(args[i+1].toLowerCase()){case "12:00":oRex=/^(0?[0-9]|1[0-2]):[0-5][0-9]$/;break;case "12:00pm":oRex=/^(0?[0-9]|1[0-2]):[0-5][0-9](:[0-5][0-9])? ?(a|p)m$/i;break;case "24:00":oRex=/^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/;break;default:oRex=/^(0?[0-9]|1[0-2]):[0-5][0-9](:[0-5][0-9])? ?(a|p)m$/i;}if(!oRex.test(sValue))bErr=true;}
			if((sValue.length>0&&args[i+2]==5&&!bRival)||(trim(sValue).length==0&&args[i+2]==5&&bRival)){oCompare=getObj(args[i+1].replace(/\[\d+\]/ig,""));if(oCompare.type=='text'||oCompare.type=='hidden'||oCompare.type=='password'){if(oCompare.value.length==0)bErr=true;}else if(oCompare.type=='select-one'||oCompare.type=='select-multiple'){if((oCompare.size==0&&oCompare.selectedIndex/1==0)||(oCompare.size>0&&oCompare.selectedIndex/1==-1)){bErr=true;}}else{if(oCompare.length)oCompare=oCompare[args[i+1].replace(/(.*\[)|(\].*)/ig,"")];if(!oCompare.checked)bErr=true;}}
			if(sValue.length>0&&args[i+2]==6){if(args[i+1].charAt(0)=='<'||args[i+1].charAt(0)=='>'||args[i+1].charAt(0)=='='){sOperator=args[i+1].charAt(0);args[i+1]=args[i+1].substring(1);if(args[i+1].charAt(0)=='='){sOperator+=args[i+1].charAt(0);args[i+1]=args[i+1].substring(1);}}else{sOperator="=";}oCompare=getObj(args[i+1]);if(sOperator=="="&&sValue!=oCompare.value)bErr=true;if(sOperator=="<"&&(isNaN(sValue/1)||sValue/1>=oCompare.value/1))bErr=true;if(sOperator==">"&&(isNaN(sValue/1)||sValue/1<=oCompare.value/1))bErr=true;if(sOperator=="<="&&(isNaN(sValue/1)||sValue/1>oCompare.value/1))bErr=true;if(sOperator==">="&&(isNaN(sValue/1)||sValue/1<oCompare.value/1))bErr=true;}
			if(sValue.length>0&&args[i+2]==7){if(args[i+1]=="(")oRex=/^\((\d{3})\)(\d{3})-(\d{4})$/;if(args[i+1]=="-")oRex=/^((\d{3})-)?(\d{3})-(\d{4})$/;if(args[i+1]==".")oRex=/^((\d{3})\.)?(\d{3})\.(\d{4})$/;if(args[i+1]=="-.")oRex=/^((\d{3})[-\.])?(\d{3})[-\.](\d{4})$/;if(args[i+1]=="/-")oRex=/^\d{3}\/\d{3}\-\d{4}$/;if(!oRex.test(sValue))bErr=true;}
			if(sValue.length>0&&args[i+2]==8){if(sValue.length<args[i+1])bErr=true;}
			if(sValue.length>0&&args[i+2]==9){oRex=/^[\d]{5}(-[\d]{4})?$/;if(!oRex.test(sValue))bErr=true;}
			if(sValue.length>0&&args[i+2]==10){oRex=/^[\d]{3}-[\d]{2}-[\d]{4}$/;if(!oRex.test(sValue))bErr=true;}
			if(sValue.length>0&&args[i+2]==11){oRex=/^-?\d*(\.[\d]{2})?$/;if(!oRex.test(sValue))bErr=true;}
			if(sValue.length>0&&args[i+2]==12){oRex=/^(CR|CV|DR|FC|FN|LC|MH|PB|ST|TJ|TX)(19|20)[\d]{2}-[\d]{6}$/i;if(!oRex.test(sValue))bErr=true;}}
		else if(!o.type&&o.length>0&&o[0].type=='radio'){
			if(args[i+2]==1){var bChecked=false;for(var j=0;j<o.length;j++){bChecked=bChecked||o[j].checked;}if(!bChecked)bErr=true;}
			var myTest=args[i].match(/(.*)\[(\d+)\].*/i);var oCompare=(myTest&&o.length>1)?o[myTest[2]]:o;
			if(args[i+2]==2&&oCompare&&oCompare.checked){oSibling=getObj(args[i+1].replace(/(\.options)*\[\d+\]/ig,""));if((oSibling.type=='text'||oSibling.type=='hidden'||oSibling.type=='password'||oSibling.type=='textarea')&&oSibling.value.length/1==0)bErr=true;if(!oSibling.type&&oSibling.length>0&&oSibling[0].type=='radio'&&!isRadioGroupChecked(oSibling))bErr=true;if((oSibling.type=='select-one'||oSibling.type=='select-multiple')&&((oSibling.size==0&&oSibling.selectedIndex/1==0)||(oSibling.size>0&&oSibling.selectedIndex/1==-1)))bErr=true;}}
		else if(o.type=='checkbox'){
			if(args[i+2]==1&&o.checked==false){bErr=true;}
			if(args[i+2]==2&&o.checked&&getObj(args[i+1]).value.length/1==0){bErr=true}}
		else if(!o.type&&o.length>0&&o[0].type=='checkbox'){
			if(args[i+2]==1){var bChecked=false;for(var j=0;j<o.length;j++){bChecked=bChecked||o[j].checked}if(!bChecked)bErr=true;}
			var myTest=args[i].match(/(.*)\[(\d+)\].*/i);var oCompare=(myTest&&o.length>1)?o[myTest[2]]:o;
			if(args[i+2]==2&&oCompare&&oCompare.checked&&getObj(args[i+1]).value.length/1==0){bErr=true}}
		else if(o.type=='select-one'||o.type=='select-multiple'){
			if(args[i+2]==0&&o.selectedIndex/1==-1){bErr=true}
			if(args[i+2]==1&&o.selectedIndex/1==0){bErr=true};
			var myTest=args[i].match(/(.*)\[(\d+)\].*/i);var iSelIndx=(myTest)?myTest[2]:o;
			if(args[i+2]==2&&(oCompare=getObj(args[i+1]))){if(oCompare.type=='text'||oCompare.type=='hidden'||oCompare.type=='password'||oCompare.type=='textarea'){if((o.selectedIndex/1==iSelIndx||(isNaN(iSelIndx)&&((o.options[0].value.length/1==0&&o.selectedIndex/1>0)||(o.options[0].value.length/1!=0&&o.selectedIndex/1>-1))))&&oCompare.value.length/1==0){bErr=true}}if(oCompare.type=='select-one'||oCompare.type=='select-multiple'){if((o.selectedIndex/1==iSelIndx||(isNaN(iSelIndx)&&((o.options[0].value.length/1==0&&o.selectedIndex/1>0)||(o.options[0].value.length/1!=0&&o.selectedIndex/1>-1))))&&(oCompare.size==0&&oCompare.selectedIndex/1==0)||(oCompare.size>0&&oCompare.selectedIndex/1==-1)){bErr=true}}}}
		else if(o.type=='textarea'){
			if(sValue.length<args[i+1]){bErr=true}}
		if(bErr){sErrMsg+='* '+args[i+3]+'\n';bErr=false}
	}
	if(sErrMsg!=''){alert(sErrHead+'\t\t\t\t\t\n\n'+sErrMsg)};return(sErrMsg=='')
}

//=============================================================================
// checkJS()                                  [nifty concept by 4GuysFromRolla]
//=============================================================================
// Purpose: verifies that javascript and cookies are enabled.
// Args   : --
// Returns: --
// Example: <body onload="checkJS()">
// Assumes: page contains a form, and form has a hidden input named
//          'txtCheckJS' with a default value of 'no'.
//-----------------------------------------------------------------------------
function checkJS(){
	var oHidden=document.getElementById('txtCheckJS');
	if(document.cookie==""){alert("COOKIES need to be enabled!");oHidden.value="no"}
	else{oHidden.value="yes"}
}
document.cookie='cookiesEnabled=1;' //this line purposely outside checkJS()

//=============================================================================
// checkTextLength()                                                 cph:040617
//=============================================================================
// Purpose: alert user if maximum text length is exceeded.
// Args   : vObj == variant; object name or reference
//          iMax == integer; maximum character length
//          sMsg == string; message to display if iMax exceeded
// Example: function frm.name.onkeyup(){checkTextLength(this,12,'Name is too long')}
// Assumes: function will be called using 'onkeyup' event handler.
// Remarks: this function is typically used with textareas, since they
//          lack the maxlength attribute of text inputs.
// SeeAlso: autofitTextarea();setTextareaMaxLength();
//-----------------------------------------------------------------------------
function checkTextLength(vObj,iMax,sMsg){var o=getObj(vObj),l=o.value.length;
	if(l>iMax){alert(sMsg);o.value=o.value.substring(0,iMax)}
}

//=============================================================================
// clearSelectElement()                                              cph:050622
//=============================================================================
// Purpose: Remove all OPTIONS from a SELECT control.
// Args   : vSelect == variant; SELECT control to be cleared
// Returns: --
// Example: clearSelectElement('State') or clearSelectElement(frmUser.State)
// SeeAlso: addOptionsToSelectElement();selectAllOptions();selectOption();
//-----------------------------------------------------------------------------
function clearSelectElement(vSelect){var o=getObj(vSelect);
if(o.type=='select-one'||o.type=='select-multiple'){while(o.length>0){o.remove(0)}}}

//=============================================================================
// createCookie()                                                    cph:050201
//=============================================================================
// Purpose: create a cookie.
// Args   : name  == string; name of the cookie to be created
//        : value == string; value of the cookie
//        : days  == integer; number of days before cookie should expire
// Returns: --
// Example: createCookie('sso','smithb',365)
// SeeAlso: deleteCookie();readCookie();
//-----------------------------------------------------------------------------
function createCookie(name,value,days){if(days){var date=new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));var expires=";expires="+date.toGMTString();}
else expires="";document.cookie=name+"="+value+expires+";path=/";}

//=============================================================================
// createHelpPopupInnerHTML()                                        cph:060601
//=============================================================================
// Purpose: Create an HTML block that will serve as the body of the Help Popup.
// Args   : --
// Returns: --
// SeeAlso: showHelpPopup();
//-----------------------------------------------------------------------------
function createHelpPopupInnerHTML(){
var oText=document.createElement('DIV');oText.id='helpPopupText';oText.style.backgroundColor='#FFFFCC';oText.style.padding='5px';
var oTitle=document.createElement('DIV');oTitle.id='helpPopupTitle';oTitle.style.backgroundColor='green';oTitle.style.color='white';oTitle.style.fontWeight='bold';oTitle.style.padding='2px';
var oHelp=document.createElement('DIV');oHelp.id='helpPopup';oHelp.style.position='absolute';oHelp.style.top='0';oHelp.style.left='0';oHelp.style.zIndex='4';oHelp.style.width='250px';oHelp.style.backgroundColor='#FFFFFF';oHelp.style.border='1px solid black';oHelp.style.font=' 9pt Verdana';
var oHTML=document.createElement('DIV');oHTML.id='helpPopupHTML';oHTML.style.display='none';
oHelp.appendChild(oTitle);oHelp.appendChild(oText);oHTML.appendChild(oHelp);document.body.appendChild(oHTML)}

//=============================================================================
// deleteCookie()                                                    cph:050201
//=============================================================================
// Purpose: delete an active cookie.
// Args   : sCookie == string; name of the cookie to be deleted
// Returns: --
// Example: deleteCookie('sso')
// SeeAlso: createCookie();readCookie();
//-----------------------------------------------------------------------------
function deleteCookie(sCookie){if(readCookie(sCookie)){var d=new Date(1900,1,1);
document.cookie=sCookie+"=;expires="+d.toGMTString+";path=/";}}

//=============================================================================
// detour()                                                          cph:060606
//=============================================================================
// Purpose: Display a message and redirect visitor to another URL.
// Args   : sMsg == string; The message to be displayed to the visitor before
//                  being redirected.
//        : sLoc == string; The URL to which the visitor should be redirected.
// Returns: --
// Example: deleteCookie('sso')
// SeeAlso: createCookie();readCookie();
//-----------------------------------------------------------------------------
function detour(sMsg,sLoc){alert(sMsg);window.location=sLoc;}

//=============================================================================
// disableElement()                                                  cph:040000
//=============================================================================
// enableElement()                                                   cph:040000
//=============================================================================
// Purpose: disable/enable one or more HTML elements.
// Args   : n[,...] == variant; object name or reference
// Returns: --
// Example: enableElement('txtName',chkVeteran)
//-----------------------------------------------------------------------------
function disableElement(){var a=disableElement.arguments,i,o;for(i=0;i<a.length;i++){o=getObj(a[i]);o.disabled=true}}
function enableElement(){var a=enableElement.arguments,i,o;for(i=0;i<a.length;i++){o=getObj(a[i]);o.disabled=false}}

//=============================================================================
// formatCase()                                                      cph:060109
//=============================================================================
// Purpose: Apply case (i.e., capitalization) rules to a supplied string.
// Args   : vObj == variant; string, or object name or reference
//          iRul == integer; rule number to be applied
// Returns: --
// Example: function frm.name.onkeyup(){formatCase(this,2)}
// Remarks: Rule 1 = UPPER CASE
//          Rule 2 = Proper Case*
//          Rule 3 = Sentence case
//          Rule 4 = lower case
//
//          *rule 2 will also properly case Scots-Irish names, e.g., McDonald
//-----------------------------------------------------------------------------
function formatCase(vObj,iRul){var obj=getObj(vObj),sRetValue=vObj;if(obj)sRetValue=obj.value;
switch(iRul){case 1:sRetValue=sRetValue.toUpperCase();break;case 2:sRetValue=sRetValue.toLowerCase().replace(/((?:^|[-\s\('"])+(mc)*[a-z])/gi,function(m,s){return s.substring(0,s.length-1)+s.charAt(s.length-1).toUpperCase()}).replace(/(^|[-\s\('"])(mc)/gi,"$1Mc");break;
case 3:sRetValue=sRetValue.charAt(0).toUpperCase()+obj.value.substring(1).toLowerCase();break;case 4:sRetValue=sRetValue.toLowerCase();break;}
if(obj){obj.value=sRetValue;return}return sRetValue;}

//=============================================================================
// getActiveStyleSheet()                                             cph:050000
//=============================================================================
// Purpose: return the title of the active stylesheet.
// Args   : --
// Returns: title|null
// Example: var title=getActiveStyleSheet();
// SeeAlso: getPreferredStyleSheet();setActiveStyleSheet();
//-----------------------------------------------------------------------------
function getActiveStyleSheet(){var i,a;for(i=0;(a=document.getElementsByTagName("link")[i]);i++){
if(a.getAttribute("rel").indexOf("style")!=-1&&a.getAttribute("title")&&!a.disabled)return a.getAttribute("title");}
return null;}

//=============================================================================
// getAge() v1.1                                                     cph:040000
//=============================================================================
// Purpose: calculate number of years elapsed from given date.
// Args   : sDate == string; date from which to calculate
// Returns: integer
// Example: getAge('1/1/1985')
//-----------------------------------------------------------------------------
function getAge(sDate){if(!isDate(sDate)||sDate=='')return '';
var dFrom=getFullDate(sDate),dToday=new Date(),dCompare=new Date();
dCompare.setMonth(dFrom.getMonth());dCompare.setDate(dFrom.getDate());
if(dToday<dCompare)dToday.setFullYear(dToday.getFullYear()-1);
return(dToday.getFullYear()-dFrom.getFullYear())}

//=============================================================================
// getElementPosition()                                              cph:040000
//=============================================================================
// Purpose: get a coordinate of one side of an element.
// Args   : vObj == variant; object name or reference
//        : sRef == string; side to reference {top|right|bottom|left}
// Returns: integer
// Example: getElementPosition('banner','top')
// Assumes: Browser is IE 5.5+  (IE ONLY FUNCTION)
//-----------------------------------------------------------------------------
function getElementPosition(vObj,sRef){
	var obj=getObj(vObj);
	sRef=sRef.substr(0,1).toUpperCase()+sRef.substr(1).toLowerCase();   // Force proper case of sRef
	var iCoord=parseInt(getElementStyle(document.body,'margin'+sRef));  // Initialize at margin size
	if(sRef=='Bottom'){sRef='Top';iCoord+=obj.offsetHeight;}            // Add element height if seeking bottom coord
	if(sRef=='Right'){sRef='Left';iCoord+=obj.offsetWidth;}             // Add element width if seeking right coord
	if(obj.offsetParent){while(obj.offsetParent){
	iCoord+=eval('obj.offset'+sRef)+eval('obj.client'+sRef);obj=obj.offsetParent;}}
	return iCoord;
}

//=============================================================================
// getElementStyle()                                                 cph:040000
//=============================================================================
// Purpose: get element's current style rule.
// Args   : vObj   == variant; object name or reference
//        : sStyle == string; the style property to retrieve
// Returns: variant; the value of the style property
// Example: getElementStyle('banner','padding-top')
// Assumes: Browser is IE 5.5+  (IE ONLY FUNCTION)
//-----------------------------------------------------------------------------
function getElementStyle(vObj,sStyle){var o=getObj(vObj);
	if(o.currentStyle)return o.currentStyle[sStyle];return '';
}

//=============================================================================
// getFullDate()                                                     cph:050810
//=============================================================================
// Purpose: Returns the date with full year converted to standard year rules.
// Args   : sDate  == string; date to be returned.
// Returns: date
// Example: getFullDate('4/16/05') returns "Sat Apr 16 00:00:00 MST 2005"
// Remarks: Year rules are years>30 assume 1900s while years<29 assume year 2000
//-----------------------------------------------------------------------------
function getFullDate(sDate){if(sDate=='')return '';var dtCheck=new Date(sDate);if(isNaN(dtCheck))return '';
	var sDateFormat='';if(/^\s*[789]\d+\s*[,-\/A-Za-z]/.test(sDate))sDateFormat='y/m/d';if(/^\s*(0?[1-9]\s*[-\/]|[1-6][0-9]\s*[-\/]|[A-Za-z]+)/.test(sDate))sDateFormat='m/d/y';if(/^\s*(0?[1-9]\s*[,A-Za-z]|[1-6][0-9]\s*[,A-Za-z])/.test(sDate))sDateFormat='d/m/y';
	sDate=sDate.replace(/[A-Za-z]+/,'/$&/');sDate=sDate.replace(/,/g,'/');sDate=sDate.replace(/-/g,'/');sDate=sDate.replace(/\s/g,'');sDate=sDate.replace(/\/+/g,'/');sDate=sDate.replace(/^\//g,'');sDate=sDate.replace(/\/$/g,'');
	var nMonth,nDate,nYear;var aDateParts=sDate.split('/');switch(sDateFormat){case 'y/m/d': nMonth=aDateParts[1];nDate=aDateParts[2];nYear=aDateParts[0];break;case 'm/d/y': nMonth=aDateParts[0];nDate=aDateParts[1];nYear=aDateParts[2];break;case 'd/m/y': nMonth=aDateParts[1];nDate=aDateParts[0];nYear=aDateParts[2];break;}
	var aMonths=new Array('ja','fe','mar','ap','ma','jun','ju','au','se','oc','no','de');for(var i=0;i<aMonths.length;i++){if(nMonth.search(aMonths[i])>-1){nMonth=i+1;break;}}if(nYear.length==2&&nYear<30)dtCheck.setFullYear(dtCheck.getFullYear()+100);if(nYear.length==2)nYear=(nYear<30)?'20'+nYear:'19'+nYear;
	return dtCheck;
}

//=============================================================================
// getObj()                                                          cph:050101
//=============================================================================
// Purpose: Return argument n as an object.
// Args   : n  == variant; ID string of element or object reference
//         [d] == object; document reference
// Returns: object
// Example: var objName=getObj('txtFirstName');
// Remarks: based on Macromedia's findObj function.
//-----------------------------------------------------------------------------
function getObj(n,d){var p,i,x,t;if(typeof(n)=='object')return n;
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);}
x=d[n];if(x&&!x.nodeName)x=undefined;if(!(x)&&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=getObj(n,d.layers[i].document);if(!x&&d.getElementById)x=d.getElementById(n);return x}

//=============================================================================
// getPreferredStyleSheet()                                          cph:050000
//=============================================================================
// Purpose: return the title of the preferred stylesheet (i.e., the stylesheet
//          without a "REL"ationship attribute of "alternate" assigned to it).
// Args   : --
// Returns: title|null
// Example: var title=getPreferredStyleSheet();
// SeeAlso: getActiveStyleSheet();setActiveStyleSheet();
//-----------------------------------------------------------------------------
function getPreferredStyleSheet(){var i,a;for(i=0;(a=document.getElementsByTagName("link")[i]);i++){
if(a.getAttribute("rel").indexOf("style")!=-1&&a.getAttribute("rel").indexOf("alt")==-1&&a.getAttribute("title"))return a.getAttribute("title");}
return null;}

//=============================================================================
// gotoFirstTabIndex()                                               cph:040000
//=============================================================================
// Purpose: Move focus to first element in tabindex order.
// Args   : --
// Returns: --
// Example: function document.body.onload(){gotoFirstTabIndex()}
// Assumes: an element has been assigned a tabindex value of 1.
//-----------------------------------------------------------------------------
function gotoFirstTabIndex(){var i,i2;
for(i=0;i<document.forms.length;i++){for(i2=0;i2<document.forms[i].elements.length;i2++){
if(document.forms[i].elements[i2].tabIndex==1){document.forms[i].elements[i2].focus();return;}}}}

//=============================================================================
// gotoNextTabIndex()                                                cph:040000
//=============================================================================
// Purpose: Move focus to next element in tabindex order after field is filled.
// Args   : el  == object; object reference of element
//          val == string; value of the element (e.g. this.value)
// Returns: --
// Example: onkeyup="gotoNextTabIndex(this,this.value)"
// Assumes: 1) form elements have been assigned a tabindex value.
//          2) text inputs have been assigned a maxlength value.
//          3) function will be called using the onkeyup event handler.
//-----------------------------------------------------------------------------
function gotoNextTabIndex(el,val){var i,f=el.form;
if(val.length==el.maxLength){nextTab=el.tabIndex+1;for(i=0;i<f.elements.length;i++){if(f.elements[i].tabIndex==nextTab)break;}
if(!f.elements[i].disabled)f.elements[i].focus()}}

//=============================================================================
// hideProcessingPage v1.0
//=============================================================================
// Purpose: Hide/close the "processing" page that displays for long load times.
// Args   :
// Returns:
// Example: function evt_body_onload(){hideProcessingPage()}"
// Assumes: Include file "processingPleaseWait.php" has been loaded into body.
//-----------------------------------------------------------------------------
function hideProcessingPage(){o=getObj('divProcessingPleaseWait');if(o)o.style.display='none'}

//=============================================================================
// hideTextareaCounter() v1.0
//=============================================================================
// Purpose: Hide a pre-defined DIV called "textareaCounter" (which displays
//          the number of characters still allowed to be entered into a TEXTAREA)
//          in a position relative to the TEXTAREA being monitored, and reset the
//          styling of the monitored TEXTAREA.
// Args   : vTextarea - variant. ID (string) of a textarea or its object reference.
// Returns: --
// Example: "hideTextareaCounter('txtComment'" will hide the textareaCounter object.
// Assumes: DIV with ID of "textareaCounter" has been created.
// SeeAlso: autofitTextarea();checkTextLength();setTextareaMaxLength();showTextAreaCounter();
//-----------------------------------------------------------------------------
function hideTextareaCounter(vTextarea){getObj('textareaCounter').style.display='none';
var oT=getObj(vTextarea);oT.style.borderColor='';oT.style.borderStyle='';oT.style.borderWidth='';}

//=============================================================================
// isDate()                                                          cph:050810
//=============================================================================
// Purpose: Determine if date is a valid date.
// Args   : sDate  == string; date to be validated
// Returns: boolean
// Example: isDate('4/16/05')
// Remarks: isDate() will also return TRUE for a zero-length string (i.e., '')
//-----------------------------------------------------------------------------
function isDate(sDate){if(sDate=='')return true;var dtCheck=new Date(sDate);if(isNaN(dtCheck))return false;
	var sDateFormat='';if(/^\s*[789]\d+\s*[,-\/A-Za-z]/.test(sDate))sDateFormat='y/m/d';if(/^\s*(0?[1-9]\s*[-\/]|[1-6][0-9]\s*[-\/]|[A-Za-z]+)/.test(sDate))sDateFormat='m/d/y';if(/^\s*(0?[1-9]\s*[,A-Za-z]|[1-6][0-9]\s*[,A-Za-z])/.test(sDate))sDateFormat='d/m/y';
	sDate=sDate.replace(/[A-Za-z]+/,'/$&/');sDate=sDate.replace(/,/g,'/');sDate=sDate.replace(/-/g,'/');sDate=sDate.replace(/\s/g,'');sDate=sDate.replace(/\/+/g,'/');sDate=sDate.replace(/^\//g,'');sDate=sDate.replace(/\/$/g,'');
	var nMonth,nDate,nYear;var aDateParts=sDate.split('/');switch(sDateFormat){case 'y/m/d': nMonth=aDateParts[1];nDate=aDateParts[2];nYear=aDateParts[0];break;case 'm/d/y': nMonth=aDateParts[0];nDate=aDateParts[1];nYear=aDateParts[2];break;case 'd/m/y': nMonth=aDateParts[1];nDate=aDateParts[0];nYear=aDateParts[2];break;}
	var aMonths=new Array('ja','fe','mar','ap','ma','jun','ju','au','se','oc','no','de');for(var i=0;i<aMonths.length;i++){if(nMonth.search(aMonths[i])>-1){nMonth=i+1;break;}}if(nYear.length==2&&nYear<30)dtCheck.setFullYear(dtCheck.getFullYear()+100);if(nYear.length==2)nYear=(nYear<30)?'20'+nYear:'19'+nYear;
	if(dtCheck.getMonth()+1!=nMonth||dtCheck.getDate()!=nDate||dtCheck.getFullYear()!=nYear)return false;return true;
}

//=============================================================================
// isRadioGroupChecked v1.0                                                    
//=============================================================================
// Purpose: Determine if any radio buttons in the specified group are checked.
// Args   : vObj == variant; ID string of element or object reference
// Returns: boolean
// Example: isRadioGroupChecked('rdoType')
//-----------------------------------------------------------------------------
function isRadioGroupChecked(vObj){var bIsChecked=false,o=getObj(vObj);
for(var i=0;i<o.length;i++){bIsChecked=bIsChecked||o[i].checked}return bIsChecked;}

//=============================================================================
// jumpMenu()                                                        cph:050923
//=============================================================================
// Purpose: Cause Select menu to behave as Dreamweaver's Jump Menu object.
// Args   : targ    == string; name of the window in which to display the jump page
//          selObj  == object; select object reference
//          restore == boolean; determines if jumpMenu should reset after selection
// Returns: --
// Example: <select name="jmCourts" onChange="jumpMenu('parent',this,0)">
// Remarks: Tweaked Macromedia's MM_jumpMenu function.
//          Option's value should be URL to jump to.
//          Empty value will be treated as label (i.e., no jump will occur)
//-----------------------------------------------------------------------------
function jumpMenu(targ,selObj,restore){if(selObj.options[selObj.selectedIndex].value.length>0){
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");if(restore)selObj.selectedIndex=0;}}

//=============================================================================
// maskPhone()                                                       cph:040503
//=============================================================================
// Purpose: Format input as user types using mask ###-###-#### or ###-####
// Args   : obj  == object; form element to be masked.
// Returns: --
// Example: function frm.txtPhone.onkeyup(){maskPhone(this)}
// Remarks: The required format is determined by the maxlength attribute of the
//          input (i.e., maxlength set to 8 uses ###-#### format while maxlength
//          set to 12 uses ###-###-#### format.)
//-----------------------------------------------------------------------------
function maskPhone(el){if(event.keyCode!=8){if(el.maxLength>8){if(el.value.length==3||el.value.length==7)el.value+='-';
if(el.value.length==8&&/^\w{3}-\w{4}$/.test(el.value))el.value=el.value.substr(0,7)+'-'+el.value.substr(7)}
else{if(el.value.length==3)el.value+='-';}}}

//=============================================================================
// maskSSN()                                                         cph:040503
//=============================================================================
// Purpose: Format input as user types using mask ###-##-####
// Args   : obj  == object; form element to be masked.
// Returns: --
// Example: function frm.txtSSN.onkeyup(){maskSSN(this)}
//-----------------------------------------------------------------------------
function maskSSN(el){if(event.keyCode!=8)if(el.value.length==3||el.value.length==6)el.value+='-';}

//=============================================================================
// moveSelector()                                                    cph:040217
//=============================================================================
// Purpose: Move list box selector as user types
// Args   : k == variant; ascii code of key pressed (always use event.keyCode)
//          o == object; select element object ('this' is preferred)
// Returns: --
// Example: onkeypress="return moveSelector(event.keyCode,this)"
//-----------------------------------------------------------------------------
var giTimeoutID=null,gsMatch="",giMilliSeconds=1000; //this line purposely outside of function
function moveSelector(k,o){
var sKey=String.fromCharCode(k),iOptions=o.length-1;gsMatch=gsMatch+sKey;
for(var i=iOptions;i>-1;i--){var sText=o.options[i].text.toLowerCase();
if(sText.substr(0,gsMatch.length)==gsMatch.toLowerCase()){o.options[i].selected=true;}}
clearTimeout(giTimeoutID);giTimeoutID=setTimeout('gsMatch=""',giMilliSeconds);
return false; // to prevent IE from doing its own highlight switching
}

//=============================================================================
// openCenteredWindow()                                              cph:030717
//=============================================================================
// Purpose: Open a browser window which is centered on the screen.
// Args   : sURL   == string; url of the page to display in the window
//          sName  == string; name of the window (used in TARGET attributes)
//          sParms == string; window features (such as menubar,scrollbars,width)
// Example: openCenteredWindow('h.php','h','status=0,height=90');
//-----------------------------------------------------------------------------
function openCenteredWindow(sURL,sName,sParms){var a=sParms.split(','),t,l,h,w,sPos,win;
for(var i=0;i<a.length;i++){if(a[i].indexOf('height')>=0)h=parseInt(a[i].substr(a[i].indexOf('=')+1));
if(a[i].indexOf('width')>=0)w=parseInt(a[i].substr(a[i].indexOf('=')+1));}
l=Math.floor((screen.width-w)/2);t=Math.floor((screen.height-h)/2);sPos="top="+t+",left="+l;
if(sParms)sParms+=","+sPos;win=window.open(sURL,sName,sParms);win.focus();return win}

//=============================================================================
// parseFloatOrZero()                                                cph:060518
//=============================================================================
// Purpose: Parses a string argument and returns a floating point number or 0.
// Args   : s  ==  string that represents the value you want to parse.
// Returns: floating point number or 0 (zero).
// Example: parseFloatOrZero('3.14') returns 3.14
//          parseFloatOrZero('')     returns 0
//-----------------------------------------------------------------------------
function parseFloatOrZero(s){if(parseFloat(s))return parseFloat(s);return 0}

//=============================================================================
// printx()                                                          cph:050000
//=============================================================================
// Purpose: Print a web document through the MeadCo ScriptX plug-in.
// Args   : prompt   == bit; display print dialog box
//          portrait == bit; print in portrait orientation, 0=landscape
//          header   == string; text to display in each page header
//          footer   == string; text to display in each page footer
//          marg|top == float; common margin size | top margin if setting individual margins
//          [right]  == float; right margin
//          [bottom] == float; bottom margin
//          [left]   == float; left margin
// Returns: --
// Example: printx(1,1,'My Header','My Footer',.75)
// Assumes: The ScriptX object has been made available to the web document, via the following
//          line immediately after <body> tag:
//          <object id="objScriptX" viewastext style="display:none" classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814" codebase="/includes/ScriptX.cab#Version=6,2,433,14"></object>
//-----------------------------------------------------------------------------
function printx(){var args=printx.arguments;
if(!objScriptX.object){alert("MeadCo's ScriptX Control is not properly installed!\n\nPrint cancelled.");return;}
if(!(args.length==5||args.length==8)){alert("Development: Invalid number of function arguments - check your code");return;}
//save user's print setup
var p,h,f,t,r,b,l;p=objScriptX.printing.portrait;h=objScriptX.printing.header;f=objScriptX.printing.footer;t=objScriptX.printing.topMargin;r=objScriptX.printing.rightMargin;b=objScriptX.printing.bottomMargin;l=objScriptX.printing.leftMargin;
//modify print setup
objScriptX.printing.portrait=args[1];objScriptX.printing.header=args[2];objScriptX.printing.footer=args[3];objScriptX.printing.topMargin=args[4];objScriptX.printing.rightMargin=(args.length>5)?args[5]:args[4];objScriptX.printing.bottomMargin=(args.length>5)?args[6]:args[4];objScriptX.printing.leftMargin=(args.length>5)?args[7]:args[4];
//print page(with or without print dialog)
objScriptX.printing.Print(args[0]);
//restore user's print setup
objScriptX.printing.portrait=p;objScriptX.printing.header=h;objScriptX.printing.footer=f;objScriptX.printing.topMargin=t;objScriptX.printing.rightMargin=r;objScriptX.printing.bottomMargin=b;objScriptX.printing.leftMargin=l;
}

//=============================================================================
// readCookie()                                                      cph:050201
//=============================================================================
// Purpose: read the contents of a cookie.
// Args   : name  == string; name of the cookie to be read
// Returns: value|null
// Example: var username=readCookie('sso')
// SeeAlso: createCookie();deleteCookie();
//-----------------------------------------------------------------------------
function readCookie(name){var nameEQ=name+"=",ca=document.cookie.split(';');
for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);
if(c.indexOf(nameEQ)==0)return c.substring(nameEQ.length,c.length);}return null;}

//=============================================================================
// RefreshImage()                                                              
//=============================================================================
// Purpose: Refresh (re-read) an image source.
// Args   : objID  == string; the ID of the image to be refreshed.
// Returns: src value|null
// Example: onclick="RefreshImage('imgCaptcha')"
//-----------------------------------------------------------------------------
function RefreshImage(objID)
{
	var objImage = document.images[objID];
	if (objImage == undefined) {
		return;
	}
	var now = new Date();
	objImage.src = objImage.src.split('?')[0] + '?x=' + now.toUTCString();
}

//=============================================================================
// selectAllOptions()                                                cph:040728
//=============================================================================
// Purpose: Select all options in a multiple selection list box.
// Args   : vSelect == variant; SELECT control to be searched
// Returns: --
// Example: onClick="selectAllOptions('days')"
// SeeAlso: addOptionsToSelectElement();clearSelectElement();selectOption();
//-----------------------------------------------------------------------------
function selectAllOptions(vSelect){var s=getObj(vSelect);for(var i=0;i<s.length;i++){s.options[i].selected=true}}

//=============================================================================
// selectOption()                                                    cph:050622
//=============================================================================
// Purpose: Select OPTION of SELECT element that matches sValue.
// Args   : vSelect == variant; SELECT control to be searched
// Returns: --
// Example: selectOption('State','"&rsUser("State")&"');
// Remarks: used primarily in ASP page to dynamically write client-side script.
// SeeAlso: addOptionsToSelectElement();clearSelectElement();selectAllOptions();
//-----------------------------------------------------------------------------
function selectOption(vSelect,sValue){var o=getObj(vSelect),i;for(i=0;i<o.options.length;i++)
{if(o.options[i].value==sValue){o.options[i].selected=true;return}}}

//=============================================================================
// selectOptionByText v1.0
//=============================================================================
// Purpose: Select OPTION of SELECT element where its text (i.e., visible text)
//          matches sText (instead of the matching the element's Value).
// Args   : vSelect == variant; SELECT control to be searched
// Args   : sText   == string; Text of option to be matched
// Returns: --
// Example: selectOptionByText('Employee','"&rs("FullName")&"');
// Remarks: used primarily in ASP page to dynamically write client-side script.
// SeeAlso: addOptionsToSelectElement();clearSelectElement();selectAllOptions();
//-----------------------------------------------------------------------------
function selectOptionByText(vSelect,sText){var o=getObj(vSelect),i;for(i=0;i<o.options.length;i++)
{if(o.options[i].text==sText){o.options[i].selected=true;return}}}

//=============================================================================
// selectRadioButton v1.0                                                    
//=============================================================================
// Purpose: Select one of the buttons of in a radio group.
// Args   : vRadiogroup == variant; ID string of radio group or object reference
//          sValue == string; the value of the radio button to select
// Returns: N/A
// Example: selectRadioButton('rdoDay','Friday')
//-----------------------------------------------------------------------------
function selectRadioButton(vRadioGroup,sValue){var o=getObj(vRadioGroup),i;
for(i=0;i<o.length;i++){o[i].checked=(o[i].value==sValue)}}

//=============================================================================
// setActiveStyleSheet()                                             cph:050000
//=============================================================================
// Purpose: disable all stylesheets but specified stylesheet.
// Args   : title == string; title of stylesheet to be set active
// Returns: --
// Example: setActiveStyleSheet('holidayStyles');
// SeeAlso: getActiveStyleSheet();getPreferredStyleSheet();
//-----------------------------------------------------------------------------
function setActiveStyleSheet(title){var i,a;
for(i=0;(a=document.getElementsByTagName("link")[i]);i++){
if(a.getAttribute("rel").indexOf("style")!=-1&&a.getAttribute("title")){
a.disabled=true;if(a.getAttribute("title")==title)a.disabled=false;}}}

//=============================================================================
// setFormActionToRedirect() v1.0
//=============================================================================
// Purpose: Cause the form to submit data to the same page and supply the form's
//          original action to the ASP engine (via a hidden field) for redirect
//          after database processing.
// Args   : vForm   == variant; form obj ref or ID of the form
//          vHidden == variant; hidden input obj ref or ID of the hidden element
// Returns: --
// Example: setFormActionToRedirect('frmQuery','txtRedirect');
//-----------------------------------------------------------------------------
function setFormActionToRedirect(vForm,vHidden){var oForm=getObj(vForm),oHidden=getObj(vHidden);
oHidden.value=oForm.action;oForm.action=location.pathname}

//=============================================================================
// setTextareaMaxLength() v1.0
//=============================================================================
// Purpose: Limit the number of characters that can input into a textarea field
//          and, if included, update a HTML text element to display the amount
//          of characters reminaing.
// Args   : vTextarea  == variant; ID string of a textarea or an object reference.
//        : iMax       == integer; maximum length of textarea.
//        : vLabel(opt)== variant; ID string of a text element or an object reference.
//                        vLabel must be a text element (i.e., P, DIV, SPAN, etc.)
// Returns: --
// SeeAlso: autofitTextarea();checkTextLength();
//-----------------------------------------------------------------------------
function setTextareaMaxLength(vTextarea,iMax,vLabel){var oT=getObj(vTextarea),l=oT.value.length;
if(vLabel)var oL=getObj(vLabel);if(oL)oL.innerHTML=iMax-l;if(l>iMax)oT.value=oT.value.substring(0,iMax)}

//=============================================================================
// showHelpPopup()                                                   cph:060601
//=============================================================================
// Purpose: Display a popup control which contains a title and help text/HTML.
// Args   : sTitle  == string; Title to display in Title box of popup control.
//        : sText   == string; HTML to display in text portion of popup control.
//        : iWidth  == integer; the desired width of the control (in pixels).
// Returns: --
// Example: showHelpPopup('Birthdate','Use format m/d/yyyy',200)
// Assumes: Browser is IE 5.5+  (IE ONLY FUNCTION)
// SeeAlso: createHelpPopupInnerHTML();
//-----------------------------------------------------------------------------
function showHelpPopup(sTitle,sText,iWidth){
if(!(h=document.all('helpPopupHTML'))){createHelpPopupInnerHTML()}
if(!iWidth)iWidth=250;helpPopup.style.width=iWidth+'px';
helpPopupTitle.innerText=sTitle;helpPopupText.innerHTML=sText;
gObjHelpPopup.document.body.innerHTML=helpPopupHTML.innerHTML;
gObjHelpPopup.show(0,0,iWidth,0);var iHeight=gObjHelpPopup.document.body.scrollHeight;gObjHelpPopup.hide();
gObjHelpPopup.show(0,20,iWidth,iHeight,event.srcElement)}
//Following object intentionally initialized outside of function
if(window.createPopup)var gObjHelpPopup=window.createPopup() //Make help popup global object available to function

//=============================================================================
// toggleDisplay()                                                   cph:041124
//=============================================================================
// Purpose: Toggle the display style of an element between BLOCK and NONE.
// Args   : vObj == variant; ID string or object reference
// Returns: --
// Example: function aHelp.onclick(){toggleDisplay('moreInfo')}
//-----------------------------------------------------------------------------
function toggleDisplay(vObj){var obj=getObj(vObj);obj.style.display=(obj.style.display=='block')?'none':'block';}

//=============================================================================
// trims                                                             cph:030717
//=============================================================================
// Purpose: Remove spaces from text strings.
// Args   : str == str; string to trim
// Returns: trimmed string
// Example: s=trim(frm.name.value)
//-----------------------------------------------------------------------------
function ltrim(str){str=(typeof str=='string')?str.replace(/^\s+/,''):str;return str}        // trim leading spaces
function rtrim(str){str=(typeof str=='string')?str.replace(/\s+$/,''):str;return str}        // trim trailing spaces
function trim(str){str=ltrim(rtrim(str));return str}                                         // trim leading and trailing spaces
function intrim(str){str=(typeof str=='string')?str.replace(/\s+/g,' '):str;return str}      // trim extra spaces (i.e. 2+ spaces)
function fulltrim(str){str=intrim(trim(str));return str}                                     // trim leading, trailing, and extra spaces
function extremetrim(str){str=(typeof str=='string')?str.replace(/\s+/g,''):str;return str}  // trim all spaces







/* RUTHSARIAN_UTILITIES.JS
/*******************************************************************************
*  www.js : 2005.09.01
* -----------------------------------------------------------------------------
*  A group of useful JavaScript utilities that can aid in the development
*  of webpages.
*******************************************************************************/

/* event_attach() takes care of attaching event handlers (functions) to events. 
 * this simplifies the process of attaching multiple handlers to a single event
 *
 * NOTE: the onload stack is executed in a LIFO manner to mimic 
 *       IE's window.attachEvent function. However, Opera also has its own
 *       window.attachEvent function which executes the onload stack in a 
 *       FIFO manner. FIFO is better, but IE has a larger user base, so
 *       LIFO is the way we go.
 */
function event_attach( event , func )
{
	if ( window.attachEvent )
	{
		window.attachEvent( event , func );
	}
	else
	{
		if ( ( typeof( func ) ).toLowerCase() != 'function' )
		{
			return;
		}
		if ( ( typeof( document.event_handlers ) ).toLowerCase() == 'undefined' )
		{
			document.event_handlers = new Array();
		}
		if ( ( typeof( document.event_handlers[ event ] ) ).toLowerCase() == 'undefined' )
		{
			document.event_handlers[ event ] = new Array();
		}
		if ( ( typeof( eval( 'window.' + event ) ) ).toLowerCase() != 'function' )
		{
			eval( 'window.' + event + ' = function () { if ( ( typeof( document.event_handlers[ \'' + event + '\' ] ) ).toLowerCase() != \'undefined\' ) { for ( i = document.event_handlers[ \'' + event + '\' ].length - 1 ; i >= 0  ; i-- ) { document.event_handlers[ \'' + event + '\' ][ i ](); } } } ' );
		}
		document.event_handlers[ event ][ document.event_handlers[ event ].length ] = func;
	}
}

/* Browser Detect  v2.1.6
 * documentation: http://www.dithered.com/javascript/browser_detect/index.html
 * license: http://creativecommons.org/licenses/by/1.0/
 * code by Chris Nott (chris[at]dithered[dot]com)
 *
 * modified to include Dreamcast
 */
function browser_detect() 
{
	var ua			= navigator.userAgent.toLowerCase(); 
	this.isGecko		= (ua.indexOf('gecko') != -1 && ua.indexOf('safari') == -1);
	this.isAppleWebKit	= (ua.indexOf('applewebkit') != -1);
	this.isKonqueror	= (ua.indexOf('konqueror') != -1); 
	this.isSafari		= (ua.indexOf('safari') != - 1);
	this.isOmniweb		= (ua.indexOf('omniweb') != - 1);
	this.isDreamcast	= (ua.indexOf("dreamcast") != -1);
	this.isOpera		= (ua.indexOf('opera') != -1); 
	this.isIcab		= (ua.indexOf('icab') != -1); 
	this.isAol		= (ua.indexOf('aol') != -1); 
	this.isIE		= (ua.indexOf('msie') != -1 && !this.isOpera && (ua.indexOf('webtv') == -1)); 
	this.isMozilla		= (this.isGecko && ua.indexOf('gecko/') + 14 == ua.length);
	this.isFirebird		= (ua.indexOf('firebird/') != -1);
	this.isNS		= ((this.isGecko) ? (ua.indexOf('netscape') != -1) : ((ua.indexOf('mozilla') != -1) && !this.isOpera && !this.isSafari && (ua.indexOf('spoofer') == -1) && (ua.indexOf('compatible') == -1) && (ua.indexOf('webtv') == -1) && (ua.indexOf('hotjava') == -1)));
	this.isIECompatible	= ((ua.indexOf('msie') != -1) && !this.isIE);
	this.isNSCompatible	= ((ua.indexOf('mozilla') != -1) && !this.isNS && !this.isMozilla);
	this.geckoVersion	= ((this.isGecko) ? ua.substring((ua.lastIndexOf('gecko/') + 6), (ua.lastIndexOf('gecko/') + 14)) : -1);
	this.equivalentMozilla	= ((this.isGecko) ? parseFloat(ua.substring(ua.indexOf('rv:') + 3)) : -1);
	this.appleWebKitVersion	= ((this.isAppleWebKit) ? parseFloat(ua.substring(ua.indexOf('applewebkit/') + 12)) : -1);
	this.versionMinor	= parseFloat(navigator.appVersion); 
	if (this.isGecko && !this.isMozilla) {
		this.versionMinor = parseFloat(ua.substring(ua.indexOf('/', ua.indexOf('gecko/') + 6) + 1));
	}
	else if (this.isMozilla) {
		this.versionMinor = parseFloat(ua.substring(ua.indexOf('rv:') + 3));
	}
	else if (this.isIE && this.versionMinor >= 4) {
		this.versionMinor = parseFloat(ua.substring(ua.indexOf('msie ') + 5));
	}
	else if (this.isKonqueror) {
		this.versionMinor = parseFloat(ua.substring(ua.indexOf('konqueror/') + 10));
	}
	else if (this.isSafari) {
		this.versionMinor = parseFloat(ua.substring(ua.lastIndexOf('safari/') + 7));
	}
	else if (this.isOmniweb) {
		this.versionMinor = parseFloat(ua.substring(ua.lastIndexOf('omniweb/') + 8));
	}
	else if (this.isOpera) {
		this.versionMinor = parseFloat(ua.substring(ua.indexOf('opera') + 6));
	}
	else if (this.isIcab) {
		this.versionMinor = parseFloat(ua.substring(ua.indexOf('icab') + 5));
	}
	this.versionMajor	= parseInt(this.versionMinor); 
	this.isDOM1		= (document.getElementById);
	this.isDOM2Event	= (document.addEventListener && document.removeEventListener);
	this.mode		= document.compatMode ? document.compatMode : 'BackCompat';
	this.isWin		= (ua.indexOf('win') != -1);
	this.isWin32		= (this.isWin && (ua.indexOf('95') != -1 || ua.indexOf('98') != -1 || ua.indexOf('nt') != -1 || ua.indexOf('win32') != -1 || ua.indexOf('32bit') != -1 || ua.indexOf('xp') != -1));
	this.isMac		= (ua.indexOf('mac') != -1);
	this.isUnix		= (ua.indexOf('unix') != -1 || ua.indexOf('sunos') != -1 || ua.indexOf('bsd') != -1 || ua.indexOf('x11') != -1)
	this.isLinux		= (ua.indexOf('linux') != -1);
	this.isNS4x		= (this.isNS && this.versionMajor == 4);
	this.isNS40x		= (this.isNS4x && this.versionMinor < 4.5);
	this.isNS47x		= (this.isNS4x && this.versionMinor >= 4.7);
	this.isNS4up		= (this.isNS && this.versionMinor >= 4);
	this.isNS6x		= (this.isNS && this.versionMajor == 6);
	this.isNS6up		= (this.isNS && this.versionMajor >= 6);
	this.isNS7x		= (this.isNS && this.versionMajor == 7);
	this.isNS7up		= (this.isNS && this.versionMajor >= 7);
	this.isIE4x		= (this.isIE && this.versionMajor == 4);
	this.isIE4up		= (this.isIE && this.versionMajor >= 4);
	this.isIE5x		= (this.isIE && this.versionMajor == 5);
	this.isIE55		= (this.isIE && this.versionMinor == 5.5);
	this.isIE5up		= (this.isIE && this.versionMajor >= 5);
	this.isIE6x		= (this.isIE && this.versionMajor == 6);
	this.isIE6up		= (this.isIE && this.versionMajor >= 6);
	this.isIE4xMac		= (this.isIE4x && this.isMac);
}

/* Opacity Displayer, Version 1.0 - http://old.alistapart.com/stories/pngopacity/
 * Copyright Michael Lovitt, 6/2002.
 */
function opacity( strId , strPath , intWidth , intHeight , strClass , strAlt )
{	
	if ( document.pngAlpha )
	{
		document.write( '<div style="height:'+intHeight+'px;width:'+intWidth+'px;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+strPath+'.png\', sizingMethod=\'scale\')" id="'+strId+'" class="'+strClass+'"></div>' );
	}
	else if ( document.pngNormal )
	{
		document.write( '<img src="'+strPath+'.png" width="'+intWidth+'" height="'+intHeight+'" name="'+strId+'" border="0" class="'+strClass+'" alt="'+strAlt+'" />' );
	}
	else if ( document.layers )
	{
		return( '<img src="'+strPath+'.gif" width="'+intWidth+'" height="'+intHeight+'" name="'+strId+'" border="0" class="'+strClass+'" alt="'+strAlt+'" />' );
	}
	else
	{
		document.write( '<img src="'+strPath+'.gif" width="'+intWidth+'" height="'+intHeight+'" name="'+strId+'" border="0" class="'+strClass+'" alt="'+strAlt+'" />' );
	}
	return( '' );
}
function opacity_init()
{
	var browser = new browser_detect();
	document.pngAlpha = false;
	document.pngNormal = false;
	document.strExt = ".gif";

	if ( ( browser.isIE55 || browser.isIE6up ) && browser.isWin32 )
	{
		document.pngAlpha = true;
		document.strExt = ".png";
	}
	else if ( 
			( browser.isGecko ) || 
			( browser.isIE5up && browser.isMac ) || 
			( browser.isOpera && browser.isWin && browser.versionMajor >= 6 ) || 
			( browser.isOpera && browser.isUnix && browser.versionMajor >= 6 ) || 
			( browser.isOpera && browser.isMac && browser.versionMajor >= 5 ) || 
			( browser.isOmniweb && browser.versionMinor >= 3.1 ) || 
			( browser.isIcab && browser.versionMinor >= 1.9 ) || 
			( browser.isWebtv ) || 
			( browser.isDreamcast ) 
		)
	{
		document.pngNormal = true;
		document.strExt = ".png";
	}
}

/* handler for Netscape Navigator clients that screw up the display
 * of CSS pages when reloaded
 */
function NN_reloadPage( init )
{
	if ( init == true ) with ( navigator )
	{
		if ( ( appName == "Netscape" ) && ( parseInt ( appVersion ) == 4 ) )
		{
			document.NN_pgW = innerWidth;
			document.NN_pgH = innerHeight;
			event_attach ( 'onresize' , NN_reloadPage );
		}
	}
	else if ( innerWidth != document.NN_pgW || innerHeight != document.NN_pgH )
	{
		location.reload();
	}
}

/* Min Width v1.1.3 by PVII-www.projectseven.com
 * http://www.projectseven.com/tutorials/css/minwidth/index.htm
 *
 * modified for readability and ability to limit application to
 * IE only so CSS min-width property may be used by compliant
 * browsers.
 *
 * NOTE: horizontal spacing (margins, padding, borders) set in
 *       % values may cause IE to crash when using this script.
 */
function set_min_width( obj_name , min_width , ieOnly )
{
	if ( ( typeof( ieOnly ) ).toLowerCase() == 'undefined' )
	{
		ieOnly = true;
	}
	if ( ieOnly == false || ( document.getElementById && navigator.appVersion.indexOf( "MSIE" ) > -1 && !window.opera ) )
	{
		document.min_width_obj_name = obj_name;
		document.min_width_size = min_width;
		document.resizing = false;
		event_attach( 'onload' , control_min_width );
		event_attach( 'onresize' , control_min_width );
	}
}
function control_min_width()
{
	var cw , w , pl , pr , ml , mr , br , bl , ad , theDiv = document.min_width_obj_name;
	var g = document.getElementById( theDiv );
	w = parseInt(document.min_width_size);
	if ( g && document.body && document.body.clientWidth )
	{
		gs = g.currentStyle;
		cw = parseInt( document.body.clientWidth );
		pl = parseInt( gs.paddingLeft );
		pr = parseInt( gs.paddingRight );
		ml = parseInt( gs.marginLeft );
		mr = parseInt( gs.marginRight );
		bl = parseInt( gs.borderLeftWidth );
		br = parseInt( gs.borderRightWidth );
		ml = ml ? ml : 0;
		mr = mr ? mr : 0;
		pl = pl ? pl : 0;
		pr = pr ? pr : 0;
		bl = bl ? bl : 0;
		br = br ? br : 0;
		ad = pl + pr + ml + mr + bl + br;
		if ( cw <= w )
		{
			w -= ad;
			g.style.width = w + "px";
		}
		else
		{
			g.style.width = "auto";
		}
	}
}

/* Cookie API  v1.0.1
 * documentation: http://www.dithered.com/javascript/cookies/index.html
 * license: http://creativecommons.org/licenses/by/1.0/
 * code (mostly) by Chris Nott (chris[at]dithered[dot]com)
 */
function setCookie( name, value, expires, path, domain, secure )
{
	 var curCookie = name + "=" + escape(value) +
		((expires) ? "; expires=" + expires.toGMTString() : "") +
		((path) ? "; path=" + path : "") +
		((domain) ? "; domain=" + domain : "") +
		((secure) ? "; secure" : "");
	document.cookie = curCookie;
}
function getCookie( name )
{
	var dc = document.cookie;
	var prefix = name + "=";
	var begin = dc.indexOf( "; " + prefix );
	if ( begin == -1 )
	{
		begin = dc.indexOf(prefix);
		if (begin != 0) return null;
	}
	else
	{
		begin += 2;
	}
	var end = document.cookie.indexOf( ";", begin );
	if ( end == -1 )
	{
		end = dc.length;
	}
	return unescape(dc.substring(begin + prefix.length, end));
}
function deleteCookie( name, path, domain )
{
	var value = getCookie( name );
	if ( value != null )
	{
		document.cookie = name + "=" + 
			((path) ? "; path=" + path : "") +
			((domain) ? "; domain=" + domain : "") +
			"; expires=Thu, 01-Jan-70 00:00:01 GMT";
	}
	return value;
}

/* font size functions operate on the body element's
 * style and defines sizes in percentages. because
 * the default font size is set to 0 in the array,
 * the first value in the font_sizes array should
 * _ALWAYS_ be 100.
 *
 *	var font_sizes = new Array( 100, 110, 120 );
 *	var current_font_size = 0;
 *	event_attach( 'onload' , loadFontSize );
 */
function loadFontSize ()
{
	current_font_size = parseInt( '0' + getCookie ( "font_size" ) );
	setFontSize ( current_font_size );
}
function setFontSize( size )
{
	if( size >= 0 && size < font_sizes.length )
	{
		current_font_size = size;
	}
	else if( ++current_font_size >= font_sizes.length )
	{
		current_font_size = 0;
	}
	if ( document.body )
	{
		document.body.style.fontSize = font_sizes[ current_font_size ] + '%';
		setCookie( "font_size" , current_font_size );
	}
}

/* standard trim function to remove leading and trailing 
 * whitespace from a given string
 */
function trim( str )
{
   return str.replace(/^\s*|\s*$/g,"");
}

/* stylesheets should be defined in the HTML via a LINK tag
 * and rel attribute set to "alternate stylesheet". the title
 * attribute is then set in the format of "title : group"
 * this function will disable all but the stylesheet specified
 * by title in the group specified by group.
 *
 * Based on code by Paul Sowden
 * http://www.alistapart.com/articles/alternate/
 */
function setActiveStyleSheet( title , group )
{
	var i, a, b, g, t;
	if ( !title || !group )
	{
		return;
	}
	for ( i = 0; ( a = document.getElementsByTagName( "link" )[ i ] ); i++ ) 
	{
		if ( a.getAttribute( "rel" ).indexOf( "style" ) != -1 && a.getAttribute( "title" ) )
		{
			b = ( a.getAttribute( "title" ) ).split( ":" );
			g = trim( b[ b.length - 1 ] );
			if ( g.toLowerCase() == group.toLowerCase() )
			{
				a.disabled = true;
				t = trim( ( a.getAttribute( "title" ) ).substring( 0, a.getAttribute( "title" ).length - b[ b.length - 1 ].length - 1 ) );
				if( t.toLowerCase() == title.toLowerCase() )
				{
					a.disabled = false;
				}
			}
			setCookie( "style_" + g.toLowerCase() , title );
		}
	}
}
function getPreferredStylesheet ( group )
{
	return ( getCookie ( "style_" + group ) );
}

/* Son of Suckerfish Dropdowns
 * http://www.htmldog.com/articles/suckerfish/dropdowns/
 */
function sfHover ( objID )
{
	var sfEls = document.getElementById( objID ).getElementsByTagName( "LI" );
	for (var i=0; i<sfEls.length; i++)
	{
		sfEls[i].onmouseover = function()
		{
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout = function()
		{
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}

/* RUTHSARIAN_UTILITIES.JS -- END */

/*XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*/

/* ANIMFUNCTIONS.JS 
/* 
Example Javascript Animation Techniques by Hesido.com;
4 different, reusable examples
*/
//if (document.getElementById && document.getElementsByTagName) {
//if (window.addEventListener) window.addEventListener('load', initAnims, false);
//else if (window.attachEvent) window.attachEvent('onload', initAnims);
//}

//function initAnims() {

	//	Init fade animation without memory, single direction
	//	var animElements = document.getElementById("fadercontainer").getElementsByTagName("p");
	//	for(var i=0; i<animElements.length; i++) {
	//		animElements[i].onmouseover = fadeBGCol;
	//		}
	//		
	//	function fadeBGCol() {
	//		doBGFade(this,[255,100,20],[255,204,204],'rgb(255,204,204)',20,20,1);
	//		}

		
	//	Init fade animation with memory, both directions
		//var animElements = document.getElementById("deptNav").getElementsByTagName("li");
		//for(var i=0; i<animElements.length; i++) {
		//	animElements[i].onmouseover = fadeBGColMem;
		//	animElements[i].onmouseout = fadeBGColRestore;
		//	}

		//function fadeBGColMem() {
		//	if (!this.currentbgRGB) this.currentbgRGB = [255,255,255]; //if no mem is set, set it first;
		//	doBGFadeMem(this,this.currentbgRGB,[204,204,204],4,20,1);
		//	}

	//	function fadeBGColRestore() {
	//		if (!this.currentbgRGB) return;	//avoid error if mouseout an element occurs before the mosueover
												//(e.g. the pointer already in the object when onload)
	//		doBGFadeMem(this,this.currentbgRGB,[255,255,255],12,20,1);
	//		}
			
	//	Init size animation with memory, both directions
	//	var animElements = document.getElementById("resizercontainer").getElementsByTagName("p")
	//	for(var i=0; i<animElements.length; i++) {
	//		animElements[i].onmouseover = widthChange;
	//		animElements[i].onmouseout = widthRestore;
	//		}

	//	function widthChange() {
	//		if (!this.currentWidth) this.currentWidth = 150; //if no mem is set, set it first;
	//		doWidthChangeMem(this,this.currentWidth,170,10,10,0.333);
	//		}

	//	function widthRestore() {
	//		if (!this.currentWidth) return;	//avoid error if mouseout an element occurs before the mosueover
	//											//(e.g. the pointer already in the object when onload)
	//		doWidthChangeMem(this,this.currentWidth,150,10,10,0.5);
	//		}
	
	//	Init motion animation
	//	var moveIt = document.getElementById('moveit');
	//	if (moveIt != null) moveIt.onclick = moveToBottom;
	//	
	//	function moveToBottom() {
	//		if (!this.currentPos) this.currentPos = [15,15]; //if no mem is set, set it first;
	//		doPosChangeMem(this,this.currentPos,[Math.floor(Math.random()*230+15),Math.floor(Math.random()*145)+15],20,20,0.5);
	//			//move to a random position for demonstration
	//		}

		
		
	//}

//*******************

function doBGFade(elem,startRGB,endRGB,finalColor,steps,intervals,powr) {
//BG Fader by www.hesido.com
	if (elem.bgFadeInt) window.clearInterval(elem.bgFadeInt);
	var actStep = 0;
	elem.bgFadeInt = window.setInterval(
		function() {
			elem.style.backgroundColor = "rgb("+
				easeInOut(startRGB[0],endRGB[0],steps,actStep,powr)+","+
				easeInOut(startRGB[1],endRGB[1],steps,actStep,powr)+","+
				easeInOut(startRGB[2],endRGB[2],steps,actStep,powr)+")";
			actStep++;
			if (actStep > steps) {
			elem.style.backgroundColor = finalColor;
			window.clearInterval(elem.bgFadeInt);
			}
		}
		,intervals)
}


//*******************

function doBGFadeMem(elem,startRGB,endRGB,steps,intervals,powr) {
//BG Fader with Memory by www.hesido.com
	if (elem.bgFadeMemInt) window.clearInterval(elem.bgFadeMemInt);
	var actStep = 0;
	elem.bgFadeMemInt = window.setInterval(
		function() {
			elem.currentbgRGB = [
				easeInOut(startRGB[0],endRGB[0],steps,actStep,powr),
				easeInOut(startRGB[1],endRGB[1],steps,actStep,powr),
				easeInOut(startRGB[2],endRGB[2],steps,actStep,powr)
				];
			elem.style.backgroundColor = "rgb("+
				elem.currentbgRGB[0]+","+
				elem.currentbgRGB[1]+","+
				elem.currentbgRGB[2]+")";
			actStep++;
			if (actStep > steps) window.clearInterval(elem.bgFadeMemInt);
		}
		,intervals)
}

//*******************

function doWidthChangeMem(elem,startWidth,endWidth,steps,intervals,powr) {
//Width changer with Memory by www.hesido.com
	if (elem.widthChangeMemInt) window.clearInterval(elem.widthChangeMemInt);
	var actStep = 0;
	elem.widthChangeMemInt = window.setInterval(
		function() {
			elem.currentWidth = easeInOut(startWidth,endWidth,steps,actStep,powr);
			elem.style.width = elem.currentWidth+"px";
			actStep++;
			if (actStep > steps) window.clearInterval(elem.widthChangeMemInt);
		}
		,intervals)

}

//*******************

function doPosChangeMem(elem,startPos,endPos,steps,intervals,powr) {
//Position changer with Memory by www.hesido.com
	if (elem.posChangeMemInt) window.clearInterval(elem.posChangeMemInt);
	var actStep = 0;
	elem.posChangeMemInt = window.setInterval(
		function() {
			elem.currentPos = [
				easeInOut(startPos[0],endPos[0],steps,actStep,powr),
				easeInOut(startPos[1],endPos[1],steps,actStep,powr)
				];
			elem.style.left = elem.currentPos[0]+"px";
			elem.style.top = elem.currentPos[1]+"px";
			actStep++;
			if (actStep > steps) window.clearInterval(elem.posChangeMemInt);
		}
		,intervals)

}

//*******************

function easeInOut(minValue,maxValue,totalSteps,actualStep,powr) {
//Generic Animation Step Value Generator By www.hesido.com
	var delta = maxValue - minValue;
	var stepp = minValue+(Math.pow(((1 / totalSteps)*actualStep),powr)*delta);
	return Math.ceil(stepp)
}

/* ANIMFUNCTIONS.JS -- END */

/*XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*/

/* JDTILES.JS

// This script came from  
// Uncle Jim's Javascript Examples 
// JDStiles.com
*/

function selectAll(theField) {
var tempval=eval("document."+theField)
tempval.focus()
tempval.select()
}

//<![CDATA[
var speed = 40; // milliseconds between each step of transition
var steps = 20; // amount to + or - by each step of transition
var fadeToText = "996633"; // color for text to fade to
var fadeToCell = "F6F6E7"; // color for cell to fade to
var origText = "666666"; // original text color
var origCell = "E7E7E7"; // original cell color
var newBorder = "FFFFFF"; // border hover color
var origBorder = "FFFFFF"; // original border color
// 2nd set of colors
var fadeToText2 = "000000"; // color for text to fade to
var fadeToCell2 = "CCCCCC"; // color for cell to fade to
var origText2 = "000000"; // original text color
var origCell2 = "FFFFFF"; // original cell color
var newBorder2 = "000000"; // border hover color
var origBorder2 = "666666"; // original border color

dC21 = new Array(hextodec(origText.substring(0, 2)),hextodec(origText.substring(2, 4)),hextodec(origText.substring(4, 6)));
dC22 = new Array(hextodec(fadeToText.substring(0, 2)),hextodec(fadeToText.substring(2, 4)),hextodec(fadeToText.substring(4, 6)));


function makearray(n) {
  this.length = n;
  for(var i = 1; i <= n; i++)
    this[i] = 0;
  return this;
}
function hex(i) {
  if (i < 0)    return "00";
  else if (i > 255) return "ff";
  else      return "" + hexa[Math.floor(i/16)] + hexa[i%16];
}
function hexnumtodec(hexchar) {
  if (parseInt(hexchar) == hexchar) return Number(hexchar)
  hexchar = hexchar.toUpperCase()
  switch (hexchar) {
    case 'A': return 10; break;
    case 'B': return 11; break;
    case 'C': return 12; break;
    case 'D': return 13; break;
    case 'E': return 14; break;
    case 'F': return 15; break;
  }
}
function hextodec(daHex) {
  var daDec = Number((16 * hexnumtodec(daHex.substring(0,1))) + hexnumtodec(daHex.substring(1,2)))
  return daDec
}

function convert2Dec(hex)
  {
    var rgb = new Array();
    for (var u = 0; u < 3; u++)
      rgb[u] = parseInt(hex.substring(u*2, u*2+2), 16);
    return rgb;
  }

mode = true;

function setColor(r,g,b,what) {
  var hr = hex(r); var hg = hex(g); var hb = hex(b);
  var daColor = "#"+hr+hg+hb
  if(mode){
           daEl.style.backgroundColor = daColor;
           mode = false;
  }
  else{
          if(dC21[0] < dC22[0]) dC21[0] += step;
          if(dC21[0] > dC22[0]) dC21[0] -= step;
          if(dC21[1] < dC22[1]) dC21[1] += step;
          if(dC21[1] > dC22[1]) dC21[1] -= step;
          if(dC21[2] < dC22[2]) dC21[2] += step;
          if(dC21[2] > dC22[2]) dC21[2] -= step;
          dC2B = "RGB(" + dC21[0] + "," + dC21[1] + "," + dC21[2] + ")";
          daEl.style.color = dC2B;
          mode = true;
  }       
  if (daColor == colorend.toLowerCase()) {
    dC21[0] = hextodec(origText.substring(0, 2));
    dC21[1] = hextodec(origText.substring(2, 4));
    dC21[2] = hextodec(origText.substring(4, 6));
    dC2B = "RGB(" + dC22[0] + "," + dC22[1] + "," + dC22[2] + ")";
    daEl.style.color = dC2B;
    clearInterval(iId)
    iId = null
    timerRunning = false
    mode = true
  }
}

function fade(what) {
  i++
  setColor(
    Math.floor(sr * ((step-i)/step) + er * (i/step)),
    Math.floor(sg * ((step-i)/step) + eg * (i/step)),
    Math.floor(sb * ((step-i)/step) + eb * (i/step)),
    what);
}
hexa = new makearray(16);
for(var i = 0; i < 10; i++)
  hexa[i] = i;
hexa[10]="a"; hexa[11]="b"; hexa[12]="c";
hexa[13]="d"; hexa[14]="e"; hexa[15]="f";

var i
var iId = null
var sr, sg, sb
var er, eg, eb
var interval = 1
var step = 16
var colorstart
var colorend
var daEl
var timerRunning = false

function myfade(el,cs,ce,iv,st) {
  daEl = el
  colorstart = cs
  colorend = ce
  interval = iv
  step = st
  i = 0
  if (timerRunning) {
    clearInterval(iId)
    iId = null
  }
  var myRe = /#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})/i
  if (colorstart.match(myRe)) {
    sr = hextodec(RegExp.$1)
    sg = hextodec(RegExp.$2)
    sb = hextodec(RegExp.$3)
  }
  if (colorend.match(myRe)) {
    er = hextodec(RegExp.$1)
    eg = hextodec(RegExp.$2)
    eb = hextodec(RegExp.$3)
  }
  timerRunning = false;
  iId = setInterval("fade()",interval)
  timerRunning = true;
}
function orig(tc){
         dC21[0] = hextodec(origText.substring(0, 2));
         dC21[1] = hextodec(origText.substring(2, 4));
         dC21[2] = hextodec(origText.substring(4, 6));
         tc.style.backgroundColor = "#" + origCell;
         tc.style.borderColor = "#" + origBorder;
         tc.style.color = "#" + origText;
}
function cellover1(tc) {
  orig(tc);
  colorNow = "#" + origCell;
  colorTo = "#" + fadeToCell;
  myfade(tc,colorNow,colorTo,speed,steps)
  tc.style.borderColor = "#" + newBorder;
}
function cellout1(tc) {
  clearInterval(iId)
  tc.style.borderColor = "#" + origBorder;
  orig(tc);
}

function cellover2(tc) {
  orig(tc);
  colorNow = "#" + origCell2;
  colorTo = "#" + fadeToCell2;
  myfade(tc,colorNow,colorTo,speed,steps)
  tc.style.borderColor = "#" + newBorder2;
}
function cellout2(tc) {
  clearInterval(iId)
  tc.style.borderColor = "#" + origBorder2;
  orig2(tc);
}
function orig2(tc){
         dC21[0] = hextodec(origText.substring(0, 2));
         dC21[1] = hextodec(origText.substring(2, 4));
         dC21[2] = hextodec(origText.substring(4, 6));
         tc.style.backgroundColor = "#" + origCell2;
         tc.style.borderColor = "#" + origBorder2;
         tc.style.color = "#" + origText2;
}

/* JDTILES.JS -- END */


function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
