<!--

function fncValidGroupNumber(strGroup) {

	var aryPageCompare = new Array();

//	----------------------------------------------------

//	Enter the group number below.  Use lower case.

//	For each group number, there must be a corresponding

//	page ending with ".htm" and in lower case.  For

//	instance, group H98917 would be put

//	in the table as "h98917" and there must be a page

//	named "h98917.htm."

//	----------------------------------------------------

	

aryPageCompare[0] = "078824";

aryPageCompare[1] = "078825";

aryPageCompare[2] = "078826";

aryPageCompare[3] = "078827";

aryPageCompare[4] = "078828";

aryPageCompare[5] = "078829";

aryPageCompare[6] = "078830";

aryPageCompare[7] = "078831";

aryPageCompare[8] = "078842";

aryPageCompare[9] = "078843";

aryPageCompare[10] = "078848";

aryPageCompare[11] = "078849";

aryPageCompare[12] = "079911";

aryPageCompare[13] = "079912";

aryPageCompare[14] = "079914";

aryPageCompare[15] = "079915";

aryPageCompare[16] = "079918";

aryPageCompare[17] = "079919";

aryPageCompare[18] = "094507";

aryPageCompare[19] = "094508";

aryPageCompare[20] = "094519";

aryPageCompare[21] = "094520";

aryPageCompare[22] = "094527";

aryPageCompare[23] = "094528";

aryPageCompare[24] = "094529";

aryPageCompare[25] = "094530";

aryPageCompare[26] = "094531";

aryPageCompare[27] = "094533";

aryPageCompare[28] = "094534";

aryPageCompare[29] = "094536";

aryPageCompare[30] = "094537";

aryPageCompare[31] = "094538";

aryPageCompare[32] = "094539";

aryPageCompare[33] = "087190";

aryPageCompare[34] = "087191";

aryPageCompare[35] = "094517";

aryPageCompare[36] = "094518";

aryPageCompare[37] = "087193";

aryPageCompare[38] = "078840";

aryPageCompare[39] = "078841";

aryPageCompare[40] = "079900";

aryPageCompare[41] = "083654";

aryPageCompare[42] = "094516";

aryPageCompare[43] = "008067";

aryPageCompare[44] = "079950";

aryPageCompare[45] = "079951";

aryPageCompare[46] = "079952";

aryPageCompare[47] = "079953";

aryPageCompare[48] = "079954";

aryPageCompare[49] = "079955";

aryPageCompare[50] = "079956";

aryPageCompare[51] = "079966";

aryPageCompare[52] = "083638";

aryPageCompare[53] = "083639";

aryPageCompare[54] = "083640";

aryPageCompare[55] = "083641";

aryPageCompare[56] = "083642";

aryPageCompare[57] = "093948";

aryPageCompare[58] = "093949";

aryPageCompare[59] = "094509";

aryPageCompare[60] = "094526";

aryPageCompare[61] = "094515";

aryPageCompare[62] = "079916";

aryPageCompare[63] = "078845";

aryPageCompare[64] = "087190";

aryPageCompare[65] = "087191";

aryPageCompare[66] = "094522";

aryPageCompare[67] = "094535";

aryPageCompare[68] = "bwalsh";

aryPageCompare[69] = "094511";

aryPageCompare[70] = "094514";

aryPageCompare[71] = "094545";

aryPageCompare[72] = "094557";

aryPageCompare[73] = "083736";

aryPageCompare[74] = "094545";

aryPageCompare[75] = "083735";

aryPageCompare[76] = "094543";

aryPageCompare[77] = "079902";

aryPageCompare[78] = "083737";

aryPageCompare[79] = "083738";

aryPageCompare[80] = "079917";

aryPageCompare[81] = "094532";

aryPageCompare[82] = "094546";

aryPageCompare[83] = "094547";

aryPageCompare[84] = "094548";

aryPageCompare[85] = "082852";

aryPageCompare[86] = "082832";

aryPageCompare[87] = "082833";

aryPageCompare[88] = "082831";

aryPageCompare[90] = "082801";

aryPageCompare[91] = "082802";

aryPageCompare[92] = "082803";

aryPageCompare[93] = "082804";

aryPageCompare[94] = "082805";

aryPageCompare[95] = "082806";

aryPageCompare[96] = "082807";

aryPageCompare[97] = "082808";

aryPageCompare[98] = "082809";

aryPageCompare[99] = "082826";

aryPageCompare[100] = "082818";

aryPageCompare[101] = "082819";

aryPageCompare[102] = "082820";

aryPageCompare[103] = "082821";

aryPageCompare[104] = "082822";

aryPageCompare[105] = "082842";

aryPageCompare[106] = "082843";

aryPageCompare[107] = "082850";

aryPageCompare[108] = "082851";

aryPageCompare[109] = "082860";

aryPageCompare[110] = "082836";

aryPageCompare[111] = "082837";

aryPageCompare[112] = "082844";

aryPageCompare[113] = "082845";

aryPageCompare[114] = "082826";

aryPageCompare[115] = "082824";

aryPageCompare[116] = "082823";

aryPageCompare[117] = "082825";

aryPageCompare[118] = "082810";

aryPageCompare[119] = "082811";

aryPageCompare[120] = "082812";

aryPageCompare[121] = "082813";

aryPageCompare[122] = "082825";

aryPageCompare[123] = "082898";

aryPageCompare[124] = "082899";

aryPageCompare[125] = "082901";

aryPageCompare[126] = "082911";

aryPageCompare[127] = "082902";

aryPageCompare[128] = "082903";

aryPageCompare[129] = "028719";

aryPageCompare[130] = "028720";

aryPageCompare[131] = "028721";

aryPageCompare[132] = "028722";

aryPageCompare[133] = "082904";

aryPageCompare[134] = "082905";

aryPageCompare[135] = "082906";

aryPageCompare[136] = "082907";

aryPageCompare[137] = "082908";

aryPageCompare[138] = "082909";

aryPageCompare[139] = "082910";

aryPageCompare[140] = "082831";

aryPageCompare[141] = "077311";

aryPageCompare[142] = "077321";

aryPageCompare[143] = "077325";

aryPageCompare[144] = "077319";

aryPageCompare[145] = "077320";

aryPageCompare[146] = "077322";

aryPageCompare[147] = "077326";

aryPageCompare[148] = "028719";

aryPageCompare[149] = "028720";

aryPageCompare[150] = "028721";

aryPageCompare[151] = "028722";

aryPageCompare[152] = "028734";

aryPageCompare[153] = "077311";

aryPageCompare[154] = "077299";

aryPageCompare[155] = "077301";

aryPageCompare[156] = "077304";

aryPageCompare[157] = "077307";

aryPageCompare[158] = "077309";

aryPageCompare[159] = "077310";

aryPageCompare[160] = "077316";

aryPageCompare[161] = "077317";

aryPageCompare[162] = "077318";

aryPageCompare[163] = "077323";

aryPageCompare[164] = "077324";

aryPageCompare[165] = "077327";

aryPageCompare[166] = "077328";

aryPageCompare[167] = "077295";

aryPageCompare[168] = "077296";

aryPageCompare[169] = "082812";

aryPageCompare[170] = "082813";

aryPageCompare[171] = "082826";

aryPageCompare[171] = "082842";

aryPageCompare[172] = "082843";

aryPageCompare[173] = "077305";

aryPageCompare[174] = "077306";

aryPageCompare[175] = "082850";

aryPageCompare[176] = "082051";

aryPageCompare[177] = "082902";

aryPageCompare[178] = "082903";

aryPageCompare[179] = "082904";

aryPageCompare[180] = "082905";

aryPageCompare[181] = "082906";

aryPageCompare[182] = "082909";

aryPageCompare[183] = "082910";

aryPageCompare[184] = "082907";

aryPageCompare[185] = "082908";

aryPageCompare[186] = "077297";

aryPageCompare[187] = "077298";

aryPageCompare[188] = "082856";

aryPageCompare[189] = "082858";

aryPageCompare[190] = "077308";

//	---- Compare provided string to table ----	

	var tmpGroup = strGroup;

	for (i = 0; i < aryPageCompare.length; i++) {

		if (tmpGroup == aryPageCompare[i]) {

			return (true);

		}

		
	}

//	---- Not found, return false ----

	return (false);

}


function fncLinkToGroupPage(theForm) {

	var checkStr = theForm.txtGroupNumber.value.toLowerCase();

//	---- Ensure there is a value provided ----

	if (checkStr == "") {

		alert("Please enter a value for the \"Group Number\" field.");

		theForm.txtGroupNumber.focus();

		return (false);

	}
	if (checkStr == "079916" || checkStr == "082809" || checkStr == "094522" || checkStr == "094535")
	{
		window.open("http://www.companionhealthcare.com","blank");
		return (false);
	}

	if (checkStr == "082831" || checkStr == "077321" || checkStr == "077325" || checkStr == "077319" || checkStr == "077320" || checkStr == "077322" || checkStr == "07326" || checkStr == "077308")
	{
		window.document.location.href = "/ups/bhs/" + checkStr + ".pdf";
		return (false);
	}

	if (checkStr == "028720" || checkStr == "028721" || checkStr == "028722" || checkStr == "028734" || checkStr == "077299" || checkStr == "077301" || checkStr == "077304" || checkStr == "082851")
	{
		window.document.location.href = "/ups/bhs/" + checkStr + ".pdf";
		return (false);
	}

	if (checkStr == "077307" || checkStr == "077310" || checkStr == "077316" || checkStr == "077317" || checkStr == "077318" || checkStr == "077323" || checkStr == "077324")
	{
		window.document.location.href = "/ups/bhs/" + checkStr + ".pdf";
		return (false);
	}

	if (checkStr == "077327" || checkStr == "077328" || checkStr == "077295" || checkStr == "077296" || checkStr == "083813" || checkStr == "082826" || checkStr == "082842" || checkStr == "082813")
	{
		window.document.location.href = "/ups/bhs/" + checkStr + ".pdf";
		return (false);
	}

	if (checkStr == "082843" || checkStr == "077305" || checkStr == "077306" || checkStr == "082850" || checkStr == "082051" || checkStr == "082902" || checkStr == "082903" || checkStr == "077326")
	{
		window.document.location.href = "/ups/bhs/" + checkStr + ".pdf";
		return (false);
	}

	if (checkStr == "082904" || checkStr == "082905" || checkStr == "082906" || checkStr == "082909" || checkStr == "082910" || checkStr == "082907" || checkStr == "082908")
	{
		window.document.location.href = "/ups/bhs/" + checkStr + ".pdf";
		return (false);
	}

	if (checkStr == "077297" || checkStr == "077298" || checkStr == "082856" || checkStr == "082858")
	{
		window.document.location.href = "/ups/bhs/" + checkStr + ".pdf";
		return (false);
	}
//	---- Ensure it is the right length ----	

	if (checkStr.length < 6 || checkStr.length > 9) {

		alert("Please enter between 6 and 9 characters in the \"Group Number\" field.");

		theForm.txtGroupNumber.focus();

		return (false);

	}

//	---- Ensure it has the right characters ----	

	var checkOK = "abcdefghijklmnopqrstuvwxyz0123456789";

	var allValid = true;

	for (i = 0;  i < checkStr.length;  i++) {

		ch = checkStr.charAt(i);

		for (j = 0;  j < checkOK.length;  j++)

			if (ch == checkOK.charAt(j))

			break;

		if (j == checkOK.length) {

			allValid = false;

			break;

		}

	}

	if (!allValid) {

		alert("Please enter only letter and digit characters in the \"Group Number\" field.");

		theForm.txtGroupNumber.focus();

		return (false);

	}

//	---- Compare string provided against the table ----	

//	---- If valid, redirect ----

//	---- Else, ask for valid group ----


	if (fncValidGroupNumber(checkStr)) {

		var path = "/ups/bhs/" + checkStr + ".htm";

		
		window.document.location.href = path;
		
	
		

	} 
	else {

		alert("The group number you entered is not on file.\nPlease check that you have entered it correctly.");
		
		theForm.txtGroupNumber.value = "";
			
		theForm.txtGroupNumber.focus();

		return (false);

	}

//	---- Failsafe fall-through return ----	

	return (false);

}

//-->


