			var ShowCounty = false;

			

			function btnAdd_OnClick()

			{

				if (ShowCounty)

				{

					var objList = document.mainform.yCounty;

					var objTarget = document.mainform.zCounty;	

					var strStop = true

					

					// Loop through list of counties to find the selected item.

					for(var lngCounter = 0; lngCounter < objList.length; lngCounter++)   

					{

						// If the county is selected then add it to the Selected County list.

						if(objList.options[lngCounter].selected)          

						{

							var strSelectedItem = objList.options[lngCounter].text;

							var strSelectedValue =  objList.options[lngCounter].value;

							

							// Loop through the Selected County to be sure the county has not already been added.			

							for (var lngCounter2 = 0; lngCounter2 < objTarget.length; lngCounter2++)

							{		    

								if (strSelectedItem == objTarget.options[lngCounter2].text)

								{

									alert("Already Selected");

									strStop = false;

									break;

								}

							} 

							if (strStop) 

							{

								if ((objTarget.length == 1) && (objTarget.options[0].value == "")){objTarget.options[0] = null;}

								objTarget.options[objTarget.length] = new Option( strSelectedItem, strSelectedValue );

							} 

						}

					}

				}

			}



			function btnAddAll_OnClick()                 

			{

				if (ShowCounty)

				{

					var objList = document.mainform.yCounty;

					var objTarget = document.mainform.zCounty;	



					for(var lngCounter = objTarget.length - 1; lngCounter >= 0; lngCounter--){objTarget.options[lngCounter] = null;} 

					// Add all records from the insurance company list to the selected insurance companies list.

					for(var lngCounter = 0; lngCounter < objList.length; lngCounter++)   

					{

						var strSelectedItem = objList.options[lngCounter].text;

						var strSelectedValue =  objList.options[lngCounter].value;

						objTarget.options[objTarget.length] = new Option(strSelectedItem, strSelectedValue);

					}

				}

			}



			function btnRemove_OnClick()

			{

				var objTarget = document.mainform.zCounty;	

				// Loop through selected county list to find selected items

				for (var lngCounter = 0; lngCounter < objTarget.length; lngCounter++)   

				{

					if(objTarget.options[lngCounter].selected){objTarget.options[lngCounter] = null;}

				}    

				if (objTarget.length == 0){objTarget.options[objTarget.length] = new Option( 'No Counties Selected', '' );}

			} 



			function btnRemoveAll_OnClick()                 

			{

				var objList = document.mainform.zCounty;

				document.mainform.xCountyName.value="";

				document.mainform.xCountyID.value="";

				for (var lngCounter = objList.length - 1; lngCounter >= 0; lngCounter-- ){objList.options[lngCounter] = null;}                   

				objList.options[objList.length] = new Option( 'No Counties Selected', '' );   

			}

				

			function StateCheck()

			{

				if(document.mainform.xState.value == 'MI')

				{

					document.mainform.yCounty.disabled=false;

					document.mainform.zCounty.disabled=false;

					ShowCounty = true;

				}

				else

				{

					btnRemoveAll_OnClick();

					document.mainform.xCountyName.value="";

					document.mainform.xCountyID.value="";

					document.mainform.yCounty.disabled=true;

					document.mainform.zCounty.disabled=true;

					ShowCounty = false;

				}

			}



			function btnSearch()                 

			{

				var objList = document.mainform.zCounty;

				var objTargetName = "";	

				var objTargetID = "";	



				for(var lngCounter = 0; lngCounter < objList.length; lngCounter++)

				{

					objTargetName = objTargetName + objList.options[lngCounter].text + ", ";

					objTargetID = objTargetID + objList.options[lngCounter].value + ",";

				}



				if (String(objTargetID).length > 0)

				{

					objTargetName = String(objTargetName).substring(0, (String(objTargetName).length - 2));

					objTargetID = String(objTargetID).substring(0, (String(objTargetID).length - 1));

				}

				

				document.mainform.xCountyName.value=objTargetName;

				document.mainform.xCountyID.value=objTargetID;

				

				document.mainform.submit();

			}			



			function LoadPage()            

			{

				DisplayFilters()

			}

			

			function DisplayFilters()

			{

				if (document.mainform.xIndustryType.options[document.mainform.xIndustryType.selectedIndex].value == "LO")

				{

					HideThisId("AllOtherFilters");

					ShowThisId("LoanOfficerFilter");

				}

				else

				{

					HideThisId("LoanOfficerFilter");

					ShowThisId("AllOtherFilters");

					if(document.mainform.xState.value == 'MI')

					{

						document.mainform.yCounty.disabled=false;

						document.mainform.zCounty.disabled=false;

						ShowCounty = true;

						if (document.mainform.xCountyID.value.length > 0)

						{

							var str = document.mainform.xCountyName.value;

							var LocalCountyName = new Array();

							LocalCountyName = str.split(", ");

		

							str = document.mainform.xCountyID.value;

							var LocalCountyID = new Array();

							LocalCountyID = str.split(",");

		

							var objTarget = document.mainform.zCounty;

							for(var lngCounter = objTarget.length - 1; lngCounter >= 0; lngCounter--){objTarget.options[lngCounter] = null;} 

							for (var loop = 0; loop <LocalCountyID.length; loop++){objTarget.options[objTarget.length] = new Option(LocalCountyName[loop], LocalCountyID[loop]);}

						}

					}

					document.mainform.xIndustryType.focus();

				}

			}



			function HideThisId(idTag)

			{

				x=document.getElementById(idTag);

				x.style.display = 'none';

			}

			//-->

		

			<!--

			function ShowThisId(idTag)

			{

				x=document.getElementById(idTag);

				x.style.display = '';

			}

			//-->












































