<!--
// global variables
var g_CommonDisplayMsg = "";


// functions
function hideAllDIVs()
{
	var tag_names = "";
    
    for (i=0; i<document.all.length; i++)
        if (document.all(i).tagName == "DIV")
			document.all(i).style.display = "none";
}

function ToggleCheckBox(obj)
{
	var strChecked
		
	strChecked = obj.checked;

	if (strChecked == true)
	{
      obj.value = 'Y';
    }
	else
	{
      obj.value = 'N';
    }
}

//--------------------------------------------------------
// Procedure Name:	OpenMessagePopUp
// Author:		DBKM1
// Arguments:		strURL, strWindowName, intWidth, intHeight, blnCenter
// Description:		Opens popup window
//--------------------------------------------------------
function OpenMessagePopUp(strURL, strWindowName, intWidth, intHeight, blnCenter)
{   
  var wndPopUp;
  var strProperties;
 
  strProperties = 'location=no,scrollbars=yes,menubars=no,toolbar=no,resizable=no,titlebar=no,status=no';

  wndPopUp = openWindow(strURL, strWindowName, intHeight, intWidth, strProperties, blnCenter);

  wndPopUp.focus();
}

//--------------------------------------------------------
// Procedure Name:	OpenPopUpNoTitle
// Author:		DBKM1
// Arguments:		strURL, strWindowName, intWidth, intHeight, blnCenter
// Description:		Opens popup window
//--------------------------------------------------------
function OpenPopUpNoTitle(strURL, strWindowName, intWidth, intHeight, blnCenter)
{   
  var wndPopUp;
  var strProperties;
 
  strProperties = 'location=no,scrollbars=yes,menubars=no,toolbar=no,resizable=yes,titlebar=no,status=yes';

  wndPopUp = openWindow(strURL, strWindowName, intHeight, intWidth, strProperties, blnCenter);

  wndPopUp.title = '';

 wndPopUp.focus();
}

//--------------------------------------------------------
// Procedure Name:	OpenPopUp
// Author:		DBKM1
// Arguments:		strURL, intWidth, intHeight, strCenter
// Description:		Opens popup window
//--------------------------------------------------------
function OpenPopUp(strURL, intWidth, intHeight, strCenter)
{   
  var blnCenter = false;
  var wndPopUp;
  var strProperties;
 
  if (strCenter=='yes')
  {
    blnCenter = true;
  }
 
  strProperties = 'location=no,scrollbars=yes,menubars=no,toolbar=no,resizable=yes';

  wndPopUp = openWindow(strURL, "PopUp", intHeight, intWidth, strProperties, blnCenter);

  wndPopUp.focus();
}


//--------------------------------------------------------
// Procedure Name:	OpenPopUpFlash 
// Author:		DBKM1 / C1W1S
// Arguments:		strURL, intWidth, intHeight, strCenter
// Description:		Opens popup window
//--------------------------------------------------------
function OpenPopUpFlash(strURL, intWidth, intHeight, strCenter)
{   
  var blnCenter = false;
  var wndPopUp;
  var strProperties;
 
  if (strCenter=='yes')
  {
    blnCenter = true;
  }
 
  strProperties = 'location=no,scrollbars=no,menubars=no,toolbar=no,resizable=no';

  wndPopUp = openWindow(strURL, "PopUp", intHeight, intWidth, strProperties, blnCenter);

  wndPopUp.focus();
}

//--------------------------------------------------------
// Procedure Name:	OpenPopUpToolStatus
// Author:		DBPD3
// Arguments:		strURL, intWidth, intHeight, strCenter
// Description:		opensPopUp withToolBar and status bar
//--------------------------------------------------------
function OpenPopUpToolStatus(strURL, intWidth, intHeight, strCenter)
{   
  var blnCenter = false;
  var wndPopUp;
  var strProperties;
 
  if (strCenter=='yes')
  {
    blnCenter = true;
  }
 
  strProperties = 'location=no,scrollbars=yes,menubars=no,toolbar=yes,resizable=yes,status=yes';

  wndPopUp = openWindow(strURL, "PopUp", intHeight, intWidth, strProperties, blnCenter);

  wndPopUp.focus();
}


function setCookie(strCookieName, strValue)
{
	setDomainCookie(strCookieName, strValue);
}

//--------------------------------------------------------
// Procedure Name:	setDomainCookie
// Author:		DKJS1
// Arguments:		Cookie Name
//			Cookie Value
// Description:		Sets the specified Cookie
//--------------------------------------------------------
function setDomainCookie(strCookieName, strValue)
{
	var cookie;
	var strSearchExpr;
	var strRequestingURL;
	var strEnvironment;
	
	strCookieName = strCookieName.toUpperCase();
	
	//-------------------------------------------------------------
	// Regular expression to find all occurrences of "_"
	// the text must be delimited by "/" at the beginning and end
	// the "g" flag is for a global search
	//-------------------------------------------------------------
	strSearchExpr = /_/g;
	strCookieName = strCookieName.replace(strSearchExpr, "");
	
	cookie = strCookieName + '=' + strValue;
	cookie += ';path=/';

	strRequestingURL = location.href.toLowerCase();
	strEnvironment = getCurrentEnvironment(strRequestingURL);
	if (strEnvironment != "localhost")
	   cookie += ';domain=.coloniallife.com';

	document.cookie = cookie;
}

//--------------------------------------------------------
// Procedure Name:	getCookie
// Author:			C1RBB
// Arguments:		Cookie Name
// Description:		returns the specified Cookies' value
//--------------------------------------------------------
function getCookie(strCookieName)
{
	// cookies are separated by semicolons
	var aCookie = document.cookie.split("; ");
  
	var strSearchExpr;
	
	strCookieName = strCookieName.toUpperCase();
	
	//-------------------------------------------------------------
	// Regular expression to find all occurrences of "_"
	// the text must be delimited by "/" at the beginning and end
	// the "g" flag is for a global search
	//-------------------------------------------------------------
	strSearchExpr = /_/g;
	strCookieName = strCookieName.replace(strSearchExpr, "");
	
	for (var i=0; i < aCookie.length; i++)
	{
		// a name/value pair (a crumb) is separated by an equal sign
		var aCrumb = aCookie[i].split("=");
		if (strCookieName == aCrumb[0]) 
		    return unescape(aCrumb[1]);
	}

	// a cookie with the requested name does not exist
	return null;
}


//--------------------------------------------------------
// Procedure Name:	processError
// Author:			C1RBB
// Arguments:		ErrCode, Msg, URL
//					
// Description:		Redirects to error.asp passing the supplied
//					values
//					MUST DEFINE STRPATH IN CALLING ASP!!
//
// Changes:
//	KJS	12/29/2000	Added regular expression search to replace
//					all "\r\n" with "<BR/> in the error string
//-------------------------------------------------------------
function processError(lngRC, strErrMsg, strURL)
{
	var strReplace;
	var strSearchExpr;

	//-------------------------------------------------------------
	// Regular expression to find all occurrences of "/r/n"
	// the text must be delimited by "/" at the beginning and end
	// the "g" flag is for a global search
	//-------------------------------------------------------------
	strSearchExpr = /\r\n/g;
	strReplace = strErrMsg.replace(strSearchExpr, "<BR/>");
	
	document.location.assign (strPath + "/Services/error.asp?code=" + lngRC + "&detail=" + strReplace + "&url=" + strURL );
}

//--------------------------------------------------------
// Procedure Name:	multiSelectAll
// Author:			C1RBB
// Arguments:		objSelect, blnSelect
//					
// Description:		Selects or deselects all values within the
//					given SELECT object
//-------------------------------------------------------------
function multiSelectAll(objSelect, blnSelect)
{
	var intLength = 0;
	var intX;
		
	intLength = objSelect.length
	
	for (x=0; x != intLength; x++)
	{
		objSelect(x).selected = blnSelect;
	}
}

//--------------------------------------------------------
// Procedure Name:	selectAdd
// Author:			C1RBB
// Arguments:		objFromSelect, objToSelect
//					
// Description:		Moves selected item from FromSelect to ToSelect
//-------------------------------------------------------------
function selectAdd(objFromSelect, objToSelect)
{
	var intIndex;
	var oOption;
	var intLength = 0;
	
	intIndex = objFromSelect.selectedIndex;
	intLength = objFromSelect.length
	
	if (intIndex != -1)
	{	
		for (intX = 0; intX != intLength; intX++)
		{
			if (objFromSelect(intX).selected)
			{
				oOption = document.createElement("OPTION");
	
				//Add the item to the ToSelect
				objToSelect.options.add(oOption);
				oOption.text = objFromSelect.options(intX).text;
				oOption.value = objFromSelect.options(intX).value;

				//Remove from the FromSelect
				objFromSelect.options.remove(intX);
				
				intX--;
				intLength = objFromSelect.length
			}
		}
	} else {
		alert("Please select an item.");
	}
}

//--------------------------------------------------------
// Procedure Name:	selectAddAll
// Author:			C1RBB
// Arguments:		objFromSelect, objToSelect
//					
// Description:		Moves all items from FromSelect to ToSelect
//-------------------------------------------------------------
function selectAddAll(objFromSelect, objToSelect)
{
	var intLength = 0;
	var intX;
	var oOption;

	intLength = objFromSelect.length
	
	for (intX = 0; intX != intLength; intX++)
	{
		//Add the item to the ToSelect
		oOption = document.createElement("OPTION");
		objToSelect.options.add(oOption);
		oOption.text = objFromSelect.options(intX).text;
		oOption.value = objFromSelect.options(intX).value;
	
		//Remove from the FromSelect
		objFromSelect.options.remove(intX);
		
		intX--;
		intLength = objFromSelect.length
	}
	
	
}

//--------------------------------------------------------
// Procedure Name:	daysBetween
// Author:			C1RBB
// Arguments:		strDate
//					
// Description:		Returns the number of days between the
//					date passed in (string) and the current
//					date.
//--------------------------------------------------------
function daysBetween(strDate)
{
	var date = new Date(strDate);
	var now = new Date();
	var diff = date.getTime() - now.getTime();
	var days = Math.floor(diff / (1000 * 60 * 60 * 24)) + 1;
	
	return days;
}

//--------------------------------------------------------
// Procedure Name:	checkNumber
// Author:			C1RBB
// Arguments:		strValue
//					
// Description:		Checks to make sure a number is a number.
//--------------------------------------------------------
function checkNumber(strValue)
{
	var digits="0123456789.";
	var temp;
	var blnOK = true;

	for (var i=0;i < strValue.length; i++)
	{
		temp = strValue.substring(i,i+1)
		if (digits.indexOf(temp) == -1)
		{
			blnOK = false
	    }
	}
	
	return blnOK;
}

//--------------------------------------------------------
// Procedure Name:	roundOff
// Author:			C1RBB
// Arguments:		value, precision
//					
// Description:		Rounds the value supplied to the given
//					precision.
//--------------------------------------------------------
function roundOff(value, precision)
{
    value = "" + value //convert value to string
    precision = parseInt(precision);

    var whole = "" + Math.round(value * Math.pow(10, precision));

    var decPoint = whole.length - precision;

    if(decPoint != 0)
    {
            result = whole.substring(0, decPoint);
            result += ".";
            result += whole.substring(decPoint, whole.length);
    }
    else
    {
            result = whole;
    }
    return result;
}

//--------------------------------------------------------
// Procedure Name:	checkDate
// Author:			C1RBB
// Arguments:		strDate, strType (Display ie "Birth Date")
//					
// Description:		Check date validity.
//--------------------------------------------------------
function checkDate(strDate, strType)
{
	//
	//	Date validation borrowed from INet.
	//
	var datePat = /^(\d{1,2})(\/|-)(\d{1,2})\2(\d{4})$/;
	var matchArray = strDate.match(datePat); // is the format ok?
	var isOK = true;
	var dateValid = 0
	var strMsg = ""

//alert(matchArray);
	
	if (matchArray == null) {
		strMsg += strType + " - Date is not in a valid format.";
		dateValid = -1;
	} else {
		month = matchArray[1]; // parse date into variables
		day = matchArray[3];
		year = matchArray[4];
		if (month < 1 || month > 12)// check month range
		{
			strMsg += strType + " - Month must be between 1 and 12.";
			dateValid = -1;
		}
					
		if (day < 1 || day > 31)
		{
			strMsg += strType + " - Day must be between 1 and 31.\r\n";
			dateValid = -1;
		}
						
		if ((month==4 || month==6 || month==9 || month==11) && day==31)
		{
			strMsg += strType + " - Month "+month+" doesn't have 31 days.\r\n";
			dateValid = -1;
		}
						
		if (month == 2) {// check for february 29th
			var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
			if (day>29 || (day==29 && !isleap))
			{
				strMsg += strType + " - February " + year + " doesn't have " + day + " days.\r\n";
				dateValid = -1;
			}
		}
	}
					
	if (dateValid == 0)
	{
		if (daysBetween(strDate) > 0)
		{
			strMsg += strType + " - Date cannot be in the future\r\n";
		}
	} else {
		isOK = false;
	}
	
	if (strMsg.length >0)
	{
		g_CommonDisplayMsg += strMsg;
	}
	
	return isOK;
}

//--------------------------------------------------------
// Procedure Name:	trim
// Author:			C1RBB
// Arguments:		strValue
//					
// Description:		Trims spaces from string
//--------------------------------------------------------
function trim(strValue)
{
	while (strValue.substring(strValue.length-1,strValue.length) == ' ')
			strValue = strValue.substring(0, strValue.length-1);
			
	return strValue;
}

//--------------------------------------------------------
// Procedure Name:	openWindow
// Author:			C1RBB
// Arguments:		strURL, strName, intHeight, intWidth, strFeatures, blnCenter
//					
// Description:		Opens and optionally centers a new window
//--------------------------------------------------------
function openWindow(strURL, strName, intHeight, intWidth, strFeatures, blnCenter)
{
	var intTop = 0;
	var intLeft = 0;
	
	intLeft = (window.screen.width / 2) - (intWidth / 2);
	intTop = (window.screen.height / 2) - (intHeight / 2);
	
	strFeatures = "height=" + intHeight + ",width=" + intWidth + "," + strFeatures;
	
	if (blnCenter)
		strFeatures += ", top=" + intTop + ", left=" + intLeft;
		
	return window.open(strURL, strName, strFeatures, true);
}


//--------------------------------------------------------
// Procedure Name:	OpenPrintFriendlyWindow
// Author:		DBKM1
// Arguments:		strSessionVarName, strXSLTFile, strOrientation, intWidth, intHeight, blnCenter
//					
// Description:		Opens and optionally centers the printer friendly window
//--------------------------------------------------------
function OpenPrintFriendlyWindow(strAudience, strSessionVarName, strXSLTFile, strOrientation, intWidth, intHeight, blnCenter)
{

	var wndPop="";
	var strParms="";
	var strServices="";
	var strXSLT="";

	strSessionVarName = trim(strSessionVarName);
        strXSLTFile = trim(strXSLTFile);
        strOrientation = trim(strOrientation);
        strAudience = trim(strAudience);
	strAudience = strAudience.toLowerCase();

	if ((strSessionVarName.length > 0) && (strXSLTFile.length > 0) && (strOrientation.length >0) && (strAudience.length >0))
	{
		strServices = '/Services/Applications/PrintFriendly/PrintFriendly.asp?session=' + strSessionVarName + '&xslt=' + escape(strXSLTFile) + '&orientation=' +  strOrientation

		strParms= 'location=no,scrollbars=yes,menubar=no,toolbar=no,resizable=yes,status=yes';
		wndPop = openWindow(strServices,"PFWindow",intHeight,intWidth, strParms, blnCenter);
		wndPop.focus();		
	}
	else
	{
		alert('The printer friendly window could not be opened because required values were not provided.  Please contact Colonial.');
	}
}


function isValidEmailAddress(strEmailAddress)
{
	if (window.RegExp)
	{
		var reg1str = "(@.*@)|(\\.\\.)|(@\\.)|(\\.@)|(^\\.)";
		var reg2str = "^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,4}|[0-9]{1,4})(\\]?)$";
		var reg1 = new RegExp(reg1str);
		var reg2 = new RegExp(reg2str);
		if (!reg1.test(strEmailAddress) && reg2.test(strEmailAddress))
		{
			return true;
		}
		return false;
	}
	else
	{
		if(strEmailAddress.indexOf("@") >= 0)
		{
			return true;
		}
 		return false;
	}
}

function isValidZip(strZipCode) 
{
	var valid = "0123456789-";
	var hyphencount = 0;

	if (strZipCode.length!=5 && strZipCode.length!=10) 
	{
		g_CommonDisplayMsg = "Please enter your 5 digit or 5 digit+4 zip code.";
		return false;
	}
	for (var i=0; i < strZipCode.length; i++) 
	{
		temp = "" + strZipCode.substring(i, i+1);
		if (temp == "-") hyphencount++;
		if (valid.indexOf(temp) == "-1") 
		{
			g_CommonDisplayMsg = "There are invalid characters in your zip code.  You may only use '" + valid +"'";
			return false;
		}
		if ((hyphencount > 1) || ((strZipCode.length==10) && "" + strZipCode.charAt(5)!="-")) 
		{
			g_CommonDisplayMsg = "The hyphen character should be used with a properly formatted 5 digit+four zip code, like '12345-6789'.";
			return false;
		}
	}
	return true;
}


function itContains(strValue, strCheck)
{
	var intTemp;
	var blnValid = true;

	for (var i=0;i < strValue.length; i++)
	{
		intTemp = strValue.substring(i,i+1)
		if (strCheck.indexOf(intTemp) == -1)
		{
			blnValid = false
	    }
	}
	return blnValid;
}

function isWholeNumber(strValue)
{
	return itContains(strValue, "0123456789");
}

function isAlphaNumeric(strValue)
{

	return itContains(strValue, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789");
}

function isAlpha(strValue)
{

	return itContains(strValue, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
}

function validLoginId(strValue)
{

	return itContains(strValue, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789/ ");
}

function validPassword(strValue)
{

	return itContains(strValue, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789/ ");
}


function getProtocol()
{

	var strNodes;
	var strProtocol;

	//Who called us
	strRequestingURL = location.href.toLowerCase();

	// Split the URL into an array to see what the protocol is
	strNodes = strRequestingURL.split(":");

	//Assume we use https
	strProtocol = "https://";

	if (strNodes.length >= 0)
	{
		strProtocol = strNodes[0] + "://";
	}

	return strProtocol;

}


function getCurrentEnvironment(strRequestingURL)
{
	var intCount;
	var intPosition;
	var strNodes;
	var strWebEnvironmentToUse;
	var strURL;

	//Who called us
	strURL = trim(strRequestingURL.toLowerCase());

	//Strip off the protocol
	if (strURL.substr(0,7) == "http://")
	{
		strURL = strURL.substr(7);
	}
	else
	{
		if (strURL.substr(0,8) == "https://")
		{
			strURL = strURL.substr(8);
		}
	}

	//Check for localhost
	if (strURL.substr(0,9) == "localhost")
	{
		strWebEnvironmentToUse = "localhost";
	}
	else
	{

	// Split the URL into an array to determine what environment we are in
	strNodes = strURL.split(".");

	//Assume we are in production
	strWebEnvironmentToUse = "";
	
	outerFor:
	
		for (intCount = 0; intCount < strNodes.length; intCount++) {
			switch(strNodes[intCount])
			{
				case "testdevelopment":
					strWebEnvironmentToUse = "development.";
					break outerFor;
				case "testacceptance":
					strWebEnvironmentToUse = "acceptance.";
					break outerFor;
				case "development":
					strWebEnvironmentToUse = "development.";
					break outerFor;
				case "acceptance":
					strWebEnvironmentToUse = "acceptance.";
					break outerFor;
			}		
		}
	}
	return strWebEnvironmentToUse;
}

function getAudience(strRequestingURL)
{
    var strAudience;
	var strNodes;
	var strURL;
    
    strRequestingURL = trim(strRequestingURL);
    
    if (strRequestingURL.length <= 0)
	{
		strRequestingURL = location.href;
	}
	
    //Who called us
	strURL = trim(strRequestingURL.toLowerCase());

	//Strip off the protocol
	if (strURL.substr(0,7) == "http://")
	{
		strURL = strURL.substr(7);
	}
	else
	{
		if (strURL.substr(0,8) == "https://")
		{
			strURL = strURL.substr(8);
		}
	}
	
	// Split the URL into an array to determine what the audience is
	strNodes = strURL.split(".");
	
	strAudience = strNodes[0];
	
    return strAudience;
}

function getWebSite(strAudience, strRequestingURL)
{
	var strSite;
	var strEnvironment;
	var strProtocol;

	strRequestingURL = trim(strRequestingURL);

	if (strRequestingURL.length <= 0)
	{
		strRequestingURL = location.href;
	}
	

	// Get the environment
	strEnvironment = getCurrentEnvironment(strRequestingURL);
	
	switch(strEnvironment)
	{
		case "localhost":
			strSite = "http://localhost";
			break;
		default:
			// Get the protocol
			strProtocol = getProtocol();
			strSite = strProtocol + strAudience + "." + strEnvironment + "coloniallife.com";
			break;
	}		
	return strSite;
}


function getServicesSite(strRequestingURL)
{
	return '/Services';
}


function getServices2Site(strRequestingURL)
{
	return getWebSite('services2', strRequestingURL);
}


function buildParamCookieString(arrNameValues)
{
	var cookieString;
	var intCount;

	cookieString = "";
	for (intCount = 0; intCount < arrNameValues.length; intCount++) {
	   if (intCount > 0)
		cookieString += "&";
	   cookieString += arrNameValues[intCount][0] + ":" + arrNameValues[intCount][1];
	}

	return cookieString;
}


//function setParamCookie(arrNameValues)
//{
//	setDomainCookie("CLAPARAM", buildParamCookieString(arrNameValues));
//}


function setParamCookie(strCookieName, strValue)
{
	var cookieString;
	var arrCookies;
	var cookieNameValuePair;
	var intCount;
	var strParamCookie;
	var bExists;

	cookieString = "";
	strParamCookie = getCookie("CLAPARAM");
	bExists = false;

	if (strParamCookie == null)
	{
	  cookieString += strCookieName + ":" + strValue;
	  setCookie("CLAPARAM", cookieString);
	  return;
	}

	arrCookies = strParamCookie.split("&");
	for (intCount = 0; intCount < arrCookies.length; intCount++) 
	{  
	  cookieNameValuePair = arrCookies[intCount].split(":");
	  if (cookieNameValuePair[0] == strCookieName)
	  {
	     bExists = true;
	     if (intCount > 0)
		cookieString += "&";
	     cookieString += cookieNameValuePair[0] + ":" + strValue;
	  }
	  else
	  {
	     if (intCount > 0)
		cookieString += "&";
	     cookieString += cookieNameValuePair[0] + ":" + cookieNameValuePair[1];
	  }
	}
	if (!bExists)
	  cookieString += "&" + strCookieName + ":" + strValue;	
	setCookie("CLAPARAM", cookieString);
	return;
}


function getParamCookie(Name)
{
	var cookieString;
	var arrCookies;
	var cookieNameValuePair;
	var intCount;
	var Value;

	Value = "";

	cookieString = getCookie("CLAPARAM");
	arrCookies = cookieString.split("&");

	outerFor:
	
	for (intCount = 0; intCount < arrCookies.length; intCount++) {
	   cookieNameValuePair = arrCookies[intCount].split(":");
	   if (cookieNameValuePair[0] == Name)		
		{
		Value = cookieNameValuePair[1];
		break outerFor;
		}
	}

	return Value;
}

function ShowHelpPage(requestingPage)
{   
	var wndPop;
	var parms;

	if (requestingPage.length > 0)
	{
		parms= 'location=no,scrollbars=yes,menubars=no,toolbar=no,resizable=no,status=no';
		wndPop = openWindow('/Services/Applications/Help/HelpPage.asp?Requester=' + requestingPage, "HelpPage", 400, 525, parms, true);
		wndPop.focus();		
	}
	else
	{
		alert('Help is not available for this page because the application did not provide a valid page name.  Please contact Colonial so we can correct the problem.');
	}
}

function highlightTable(tableToBeColored)
{
	var table;
	var rowClass;
	var allTags = new Array();
	var className = tableToBeColored;
	allTables = document.getElementsByTagName("table");

	for (t=0; t<allTables.length; t++)
	{
		if (allTables[t].className==className)
		{
			for (i=0; i < allTables[t].rows.length; i++)
			{
				if (i % 2 != 0)
				{
					rowClass = "";
				}
				else
				{
					rowClass = "Highlight";
				}
				if(rowClass)
				{
					allTables[t].rows[i].className = rowClass;
				}
			}
		}
	}
}

//--------------------------------------------------------
// Adding SOAP Client library
// 8/24/09 - DKJ06
//--------------------------------------------------------

/*****************************************************************************\

 Javascript "SOAP Client" library

 @version: 1.4 - 2005.12.10
 @author: Matteo Casati, Ihar Voitka - http://www.guru4.net/
 @description: (1) SOAPClientParameters.add() method returns 'this' pointer.
               (2) "_getElementsByTagName" method added for xpath queries.
               (3) "_getXmlHttpPrefix" refactored to "_getXmlHttpProgID" (full 
                   ActiveX ProgID).
               
 @version: 1.3 - 2005.12.06
 @author: Matteo Casati - http://www.guru4.net/
 @description: callback function now receives (as second - optional - parameter) 
               the SOAP response too. Thanks to Ihar Voitka.
               
 @version: 1.2 - 2005.12.02
 @author: Matteo Casati - http://www.guru4.net/
 @description: (1) fixed update in v. 1.1 for no string params.
               (2) the "_loadWsdl" method has been updated to fix a bug when 
               the wsdl is cached and the call is sync. Thanks to Linh Hoang.
               
 @version: 1.1 - 2005.11.11
 @author: Matteo Casati - http://www.guru4.net/
 @description: the SOAPClientParameters.toXML method has been updated to allow
               special characters ("<", ">" and "&"). Thanks to Linh Hoang.

 @version: 1.0 - 2005.09.08
 @author: Matteo Casati - http://www.guru4.net/
 @notes: first release.

\*****************************************************************************/

function SOAPClientParameters()
{
	var _pl = new Array();
	this.add = function(name, value) 
	{
		_pl[name] = value; 
		return this; 
	}
	this.toXml = function()
	{
		var xml = "";
		for(var p in _pl)
		{
			if(typeof(_pl[p]) != "function")
				xml += "<" + p + ">" + _pl[p].toString().replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;") + "</" + p + ">";
		}
		return xml;	
	}
}

function SOAPClient() {}

SOAPClient.invoke = function(url, method, parameters, async, callback)
{
	if(async)
		SOAPClient._loadWsdl(url, method, parameters, async, callback);
	else
		return SOAPClient._loadWsdl(url, method, parameters, async, callback);
}

// private: wsdl cache
SOAPClient_cacheWsdl = new Array();

// private: invoke async
SOAPClient._loadWsdl = function(url, method, parameters, async, callback)
{
	// load from cache?
	var wsdl = SOAPClient_cacheWsdl[url];
	if(wsdl + "" != "" && wsdl + "" != "undefined")
		return SOAPClient._sendSoapRequest(url, method, parameters, async, callback, wsdl);
	// get wsdl
	var xmlHttp = SOAPClient._getXmlHttp();
	xmlHttp.open("GET", url + "?wsdl", async);
	if(async) 
	{
		xmlHttp.onreadystatechange = function() 
		{
			if(xmlHttp.readyState == 4)
				SOAPClient._onLoadWsdl(url, method, parameters, async, callback, xmlHttp);
		}
	}
	xmlHttp.send(null);
	if (!async)
		return SOAPClient._onLoadWsdl(url, method, parameters, async, callback, xmlHttp);
}
SOAPClient._onLoadWsdl = function(url, method, parameters, async, callback, req)
{
	var wsdl = req.responseXML;
	SOAPClient_cacheWsdl[url] = wsdl;	// save a copy in cache
	return SOAPClient._sendSoapRequest(url, method, parameters, async, callback, wsdl);
}
SOAPClient._sendSoapRequest = function(url, method, parameters, async, callback, wsdl)
{
	// get namespace
	var ns = (wsdl.documentElement.attributes["targetNamespace"] + "" == "undefined") ? wsdl.documentElement.attributes.getNamedItem("targetNamespace").nodeValue : wsdl.documentElement.attributes["targetNamespace"].value;
	// build SOAP request
	var sr = 
				"<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
				"<soap:Envelope " +
				"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " +
				"xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" " +
				"xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
				"<soap:Body>" +
				"<" + method + " xmlns=\"" + ns + "\">" +
				parameters.toXml() +
				"</" + method + "></soap:Body></soap:Envelope>";
	// send request
	var xmlHttp = SOAPClient._getXmlHttp();
	xmlHttp.open("POST", url, async);
	var soapaction = ((ns.lastIndexOf("/") != ns.length - 1) ? ns + "/" : ns) + method;
	xmlHttp.setRequestHeader("SOAPAction", soapaction);
	xmlHttp.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
	if(async) 
	{
		xmlHttp.onreadystatechange = function() 
		{
			if(xmlHttp.readyState == 4)
				SOAPClient._onSendSoapRequest(method, async, callback, wsdl, xmlHttp);
		}
	}
	xmlHttp.send(sr);
	if (!async)
		return SOAPClient._onSendSoapRequest(method, async, callback, wsdl, xmlHttp);
}
SOAPClient._onSendSoapRequest = function(method, async, callback, wsdl, req)
{
	var o = null;
	var nd = SOAPClient._getElementsByTagName(req.responseXML, method + "Result");
	if(nd.length == 0)
	{
		if(req.responseXML.getElementsByTagName("faultcode").length > 0)
			throw new Error(500, req.responseXML.getElementsByTagName("faultstring")[0].childNodes[0].nodeValue);
	}
	else
		o = SOAPClient._soapresult2object(nd[0], wsdl);
	if(callback)
		callback(o, req.responseXML);
	if(!async)
		return o;		
}

// private: utils
SOAPClient._getElementsByTagName = function(document, tagName)
{
	try
	{
		// trying to get node omitting any namespaces (latest versions of MSXML.XMLDocument)
		document.setProperty("SelectionLanguage", "XPath");

		return document.selectNodes(".//*[local-name()=\""+ tagName +"\"]");
	}
	catch (ex) {}
	// old XML parser support
	return document.getElementsByTagName(tagName);
}

SOAPClient._soapresult2object = function(node, wsdl)
{
	return SOAPClient._node2object(node, wsdl);
}
SOAPClient._node2object = function(node, wsdl)
{
	// null node
	if(node == null)
		return null;
	// text node
	if(node.nodeType == 3 || node.nodeType == 4)
		return SOAPClient._extractValue(node, wsdl);
	// leaf node
	if (node.childNodes.length == 1 && (node.childNodes[0].nodeType == 3 || node.childNodes[0].nodeType == 4))
		return SOAPClient._node2object(node.childNodes[0], wsdl);
	var isarray = SOAPClient._getTypeFromWsdl(node.nodeName, wsdl).toLowerCase().indexOf("arrayof") != -1;
	// object node
	if(!isarray)
	{
		var obj = null;
		if(node.hasChildNodes())
			obj = new Object();
		for(var i = 0; i < node.childNodes.length; i++)
		{
			var p = SOAPClient._node2object(node.childNodes[i], wsdl);
			obj[node.childNodes[i].nodeName] = p;
		}
		return obj;
	}
	// list node
	else
	{
		// create node ref
		var l = new Array();
		for(var i = 0; i < node.childNodes.length; i++)
			l[l.length] = SOAPClient._node2object(node.childNodes[i], wsdl);
		return l;
	}
	return null;
}
SOAPClient._extractValue = function(node, wsdl)
{
	var value = node.nodeValue;
	switch(SOAPClient._getTypeFromWsdl(node.parentNode.nodeName, wsdl).toLowerCase())
	{
		default:
		case "s:string":			
			return (value != null) ? value + "" : "";
		case "s:boolean":
			return value+"" == "true";
		case "s:int":
		case "s:long":
			return (value != null) ? parseInt(value + "", 10) : 0;
		case "s:double":
			return (value != null) ? parseFloat(value + "") : 0;
		case "s:datetime":
			if(value == null)
				return null;
			else
			{
				value = value + "";
				value = value.substring(0, value.lastIndexOf("."));
				value = value.replace(/T/gi," ");
				value = value.replace(/-/gi,"/");
				var d = new Date();
				d.setTime(Date.parse(value));										
				return d;				
			}
	}
}
SOAPClient._getTypeFromWsdl = function(elementname, wsdl)
{
	var ell = wsdl.getElementsByTagName("s:element");	// IE
	if(ell.length == 0)
		ell = wsdl.getElementsByTagName("element");	// MOZ
	for(var i = 0; i < ell.length; i++)
	{
		if(ell[i].attributes["name"] + "" == "undefined")	// IE
		{
			if(ell[i].attributes.getNamedItem("name") != null && ell[i].attributes.getNamedItem("name").nodeValue == elementname && ell[i].attributes.getNamedItem("type") != null) 
				return ell[i].attributes.getNamedItem("type").nodeValue;
		}	
		else // MOZ
		{
			if(ell[i].attributes["name"] != null && ell[i].attributes["name"].value == elementname && ell[i].attributes["type"] != null)
				return ell[i].attributes["type"].value;
		}
	}
	return "";
}
// private: xmlhttp factory
SOAPClient._getXmlHttp = function() 
{
	try
	{
        if(window.XMLHttpRequest) 
        {
            try 
            {
                document.implementation.createDocument('','doc',null);
                var req = new XMLHttpRequest();
            } 
            catch (e) 
            {
                try 
                {
                    new ActiveXObject('Microsoft.XMLDOM');
                    var req = new ActiveXObject(SOAPClient._getXmlHttpProgID());
                } 
                catch (e) {}
            }
            
            // some versions of Moz do not support the readyState property and the onreadystate event so we patch it!
            if(req.readyState == null) 
			{
				req.readyState = 1;
				req.addEventListener("load", 
									function() 
									{
										req.readyState = 4;
										if(typeof req.onreadystatechange == "function")
											req.onreadystatechange();
									},
									false);
			}
			return req;
        } 
        else 
        {
            return new ActiveXObject(SOAPClient._getXmlHttpProgID());
        }  
	}
	catch (ex) {}
	throw new Error("Your browser does not support XmlHttp objects");
}
SOAPClient._getXmlHttpProgID = function()
{
	if(SOAPClient._getXmlHttpProgID.progid)
		return SOAPClient._getXmlHttpProgID.progid;
	var progids = ["Msxml2.XMLHTTP.5.0", "Msxml2.XMLHTTP.4.0", "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP", "Microsoft.XMLHTTP"];
	var o;
	for(var i = 0; i < progids.length; i++)
	{
		try
		{
			o = new ActiveXObject(progids[i]);
			return SOAPClient._getXmlHttpProgID.progid = progids[i];
		}
		catch (ex) {};
	}
	throw new Error("Could not find an installed XML parser");
}

// End -->
