   function loadPage()
    {    
        document.getElementById('name').focus();
    }
    
    function printDirections()
    {
        var strURL = location.href;
        var aryURL = strURL.split('?');
        var strNavURL = "printGetDirections.aspx?" + aryURL[1];
        window.open(strNavURL, "", "height=600,width=800,status=no,titlebar=no,toolbar=no,scrollbars=yes");
        //alert(strNavURL);
    }
    
    function printList(queryType)
    {
        var strURL = location.href;
        var aryURL = strURL.split('?');
        var strNavURL = "printCUList.aspx?" + aryURL[1] + "&queryType=" + queryType;
        window.open(strNavURL, "", "height=600,width=800,status=no,titlebar=no,toolbar=no,scrollbars=yes");
    }
    
	function goPageNoMap(state, newLocation, international)
	{
		var page = document.getElementById('page').value;
		if (newLocation=="1")
		{
			var strURL = "searchResults.aspx?new=1" + page;
		}
		else
		{
			var strURL = "searchResults.aspx?address=&city=&state=" + state + "&zip=&international=" + international+"&recordStart=0";
		}
		location.href = strURL;
	}
	
	function goRadiusMap()
	{
	    var strURL = location.href;
        var aryURL = strURL.split('?');
        var strNavURL = "viewRadiusMap.aspx?" + aryURL[1];
        window.open(strNavURL, "", "height=610,width=750,status=no,titlebar=no,toolbar=no,scrollbars=yes");
	}
	
	
	function goEmail(queryType)
	{
		var strURL = location.href;
		var aryURL = strURL.split("?");
		location.href = "emailResults.aspx?" + aryURL[1] + "&queryType=" + queryType;
	}
	
	function selectIntl()
	{
		document.getElementById('address').value = "";
		document.getElementById('city').value = "";
		document.getElementById('state').value = "";
		document.getElementById('zip').value = "";
		if (document.getElementById('international').value == " ")
		{
			location.href="default.aspx";
			return;
		}
		var strURL = "searchResults.aspx?address=&city=&state=&zip=&international=" + document.getElementById('international').value;
		alert("location.href:" + location.href);
		location.href = strURL;
		
	}	
	
	

	
	function goForm()
	{
		var strStreet = document.getElementById('address').value;
		var strCity = document.getElementById('city').value;
		var strState = document.getElementById('state').value;
		var strZip = document.getElementById('zip').value;
		var strIntl = document.getElementById('international').value;
		if (!verifyStartAddress(strStreet, strCity, strState, strZip, strIntl))
		{ 
		   return false;		   
		}
		else{	
		var strURL = "searchResults.aspx?address=" + strStreet + "&city=" + strCity + "&state=" + strState + "&zip=" + strZip + "&international=" + strIntl + "&radius=10&recordStart=0";
        
     //   document.location = strURL;
     //   alert("yo");
        document.getElementById('MainForm').action = strURL;
        document.getElementById('MainForm').__VIEWSTATE.name = 'NOVIEWSTATE';
      //  document.getElementById('MainForm').submit();
        
    //    document.getElementById("MainForm").submit()		
    }
	}
	
	function verifyStartAddress(strStreet, strCity, strState, strZip, strInt)
	{
		// Check to make sure address entered combination is valid
		// Possible to have 16 different combinations - only 5 are not valid
		// no data entered
		if ((strStreet == "") && (strCity == "") && (strState == " ") && (strZip == "") && (strInt == "US"))
		{
			alert("Please enter an address to search.");
			document.getElementById('address').focus();
			return 0;
		}
		// only city entered
		else if ((strStreet == "") && (strCity != "") && (strState == " ") && (strZip == "") && (strInt == "US"))
		{
			alert("Please include at least a state to go with this city.");
			document.getElementById('state').focus();
			return 0;
		}
		// only street entered
		else if ((strStreet != "") && (strCity == "") && (strState == " ") && (strZip == ""))
		{
			alert("Please include a city and state to go with this street address.");
			document.getElementById('city').focus();
			return 0;
		}
                // only street and state entered
		else if ((strStreet != "") && (strCity == "") && (strState != " ") && (strZip == ""))
		{
			alert("Please include a zip code or city to go with this address.");
			document.getElementById('zip').focus();
			return 0;
		}
		// only street and city entered
		else if ((strStreet != "") && (strCity != "") && (strState == " ") && (strZip == ""))
		{
			alert("Please include at least a zip code to go with this address.");
			document.getElementById('zip').focus();
			return 0;
		}
		// all other combinations are valid
		else
			return 1;
	}
	
	
	
	function selectIntl()
	{
		document.getElementById('address').value = "";
		document.getElementById('city').value = "";
		document.getElementById('state').value = "";
		document.getElementById('zip').value = "";
		var somevar = fopen("http://www.cuservicecenter.com/Scripts/counts.asp?State=All&network=ALL&count=locations");
		var somestring = somevar.read();
		if (document.getElementById('international').value == " ")
		{
			location.href="default.aspx";
			return;
		}
		var strURL = "searchResults.aspx?address=&city=&state=&zip=&international=" + document.getElementById('international').value+"&recordStart=0";
		location.href = strURL;
	}
	
	
	function goFormComment()
	{
		var name = document.getElementById('name').value;
	//	var address1 = document.getElementById('address1').value;
	//	var address2 = document.getElementById('address2').value;
	//	var city = document.getElementById('cityComment').value;
	//	var state = document.getElementById('stateComment').value;
	//	var zip = document.getElementById('zipComment').value;
	//	var phone = document.getElementById('phone').value;
		var email = document.getElementById('email').value;
		var comment = document.getElementById('comment').value;
		location.href="processComment.aspx?name=" + name + "&address1=" + ""+ "&address2=" + ""+ "&city=" + ""+ "&state=" + ""+ "&zip=" + ""+ "&phone=" + ""+ "&email=" + email + "&comment=" + comment;
	}
	
	
	function setFocus()
	{
		document.getElementById('name').focus();
	}
	
	function goAll()        // part of the SHOW ALL Button, not used anymore.
	{
		location.href = "partCU.aspx?sortBy=showAll&sw=&page=0";
	}
	
	function goPage()
	{
		// get sortBy Value
		var strURL = location.href;
		var aryArgs = strURL.split('?');
		var strParams = aryArgs[1];
		var aryParams = strParams.split('&');
		// sort by value
		var strParam = aryParams[0];
		var aryParam = strParam.split('=');
		var strSortVal = aryParam[1];	
		// starts with value
		strParam = aryParams[1];
		aryParam = strParam.split('=');
		var strSWVal = aryParam[1];
		var strPage = document.getElementById('page').value;
		var strURL = "partCU.aspx?sortBy=" + strSortVal + "&sw=" + strSWVal + "&page=" + strPage;
		location.href = strURL;
	}
	
	function goSpecific()
	{
		var str = "" + document.getElementById('txtSpecific').value;
		str = str.replace("+", "%2B");
	//	alert(str);
		location.href = "partCU.aspx?sortBy=" + str + "&sw=" + document.getElementById('selStartsWith').value  + "&page=0";
	}
	
	function goDirections()
	{	    
		var strURL = location.href;
		var aryURL = strURL.split('?');
		var aryQS = aryURL[1].split('&');
		var strNewQS = "";
		var oForm = document.getElementById("frmDirections");
		var strText = "<form method=get action=getFinder.aspx id=\"Form\" name=\"Form\">";
		var strOrgURL = location.href.replace("'"," ");		
		strText += "<input type=hidden name=QS id=QS value='" + strOrgURL + "'>";
		strText += "<table width=80% class=mapAddress><tr><td id=ServiceCentersHeader colspan=5>Enter Starting Address</td></tr>";
		strText += "<tr><td class=FormLabel>Street</td><td class=FormLabel>City</td><td class=FormLabel>State</td><td class=FormLabel>Zip</td></tr>";
		strText += "<tr><td><input type=text class=FormText name=startAddress id=startAddress></td>";
		strText += "<td><input type=text class=FormText name=startCity id=startCity></td>";
		strText += "<td><select name=startState id=startState class=FormSelect>";
		strText += "<option Selected='True' Value=' '> </option>";
		strText += "<option Value='AL'>Alabama</option>";
		strText += "<option Value='AK'>Alaska</option>";
		strText += "<option Value='AZ'>Arizona</option>";
		strText += "<option Value='AR'>Arkansas</option>";
		strText += "<option Value='CA'>California</option>";
		strText += "<option Value='CO'>Colorado</option>";
		strText += "<option Value='CT'>Connecticut</option>";
		strText += "<option Value='DC'>DC</option>";
		strText += "<option Value='DE'>Deleware</option>";
		strText += "<option Value='FL'>Florida</option>";
		strText += "<option Value='GA'>Georgia</option>";
		strText += "<option Value='HI'>Hawaii</option>";
		strText += "<option Value='ID'>Idaho</option>";
		strText += "<option Value='IL'>Illinois</option>";
		strText += "<option Value='IN'>Indiana</option>";
		strText += "<option Value='IA'>Iowa</option>";
		strText += "<option Value='KS'>Kansas</option>";
		strText += "<option Value='KY'>Kentucky</option>";
		strText += "<option Value='LA'>Louisiana</option>";
		strText += "<option Value='ME'>Maine</option>";
		strText += "<option Value='MD'>Maryland</option>";
		strText += "<option Value='MA'>Massachusetts</option>";
		strText += "<option Value='MI'>Michigan</option>";
		strText += "<option Value='MN'>Minnesota</option>";
		strText += "<option Value='MS'>Mississippi</option>";
		strText += "<option Value='MO'>Missouri</option>";
		strText += "<option Value='MT'>Montana</option>";
		strText += "<option Value='NE'>Nebraska</option>";
		strText += "<option Value='NV'>Nevada</option>";
		strText += "<option Value='NH'>New Hampshire</option>";
		strText += "<option Value='NJ'>New Jersey</option>";
		strText += "<option Value='NM'>New Mexico</option>";
		strText += "<option Value='NY'>New York</option>";
		strText += "<option Value='NC'>North Carolina</option>";
		strText += "<option Value='ND'>North Dakota</option>";
		strText += "<option Value='OH'>Ohio</option>";
		strText += "<option Value='OK'>Oklahoma</option>";
		strText += "<option Value='OR'>Oregon</option>";
		strText += "<option Value='PA'>Pennsylvania</option>";
		strText += "<option Value='RI'>Rhode Island</option>";
		strText += "<option Value='SC'>South Carolina</option>";
		strText += "<option Value='SD'>South Dakota</option>";
		strText += "<option Value='TN'>Tennessee</option>";
		strText += "<option Value='TX'>Texas</option>";
		strText += "<option Value='UT'>Utah</option>";
		strText += "<option Value='VT'>Vermont</option>";
		strText += "<option Value='VA'>Virginia</option>";
		strText += "<option Value='WA'>Washington</option>";
		strText += "<option Value='WV'>West Virginia</option>";
		strText += "<option Value='WI'>Wisconsin</option>";
		strText += "<option Value='WY'>Wyoming</option>";
		strText += "</select></td>";
		strText += "<td><input type=text class=FormText name=startZip id=startZip size=9></td>";
		strText += "<td><input type=button class=FormButton value=\"Get Directions\" onclick=goFormDir()></td></tr>";
		strText += "</table></form>";		
		oForm.style.display = "";		
		oForm.innerHTML = strText;				
		document.getElementById("startAddress").Focus();			
	}
	
	
	function decideOnForm()
	{
		var strURL = location.href;
		var aryURL = strURL.split('?');
		var nShowStart = 0;
		var aryQS = aryURL[1].split('&');
		for (i = 0; i < aryQS.length; i++)
		{
			if (aryQS[i].indexOf('showStart') > -1)
			{
				var arySS = aryQS[i].split('=');
				if (arySS[1] == '1')
				{
					nShowStart = 1;
				}
			}
		}
		if (nShowStart == 1)
		{
			//alert('nShowStart is true');
			goDirections();
			document.getElementById("frmDirections").style.display='';
		}
		else
		{
			//alert('nShowStart is false');
			document.getElementById("frmDirections").style.display='none';
		}
	}
	
	
	
	function goFormDir()
	{
		var strStreet = document.getElementById('startAddress').value;
		var strCity = document.getElementById('startCity').value;
		var strState = document.getElementById('startState').value;
		var strZip = document.getElementById('startZip').value;
		if (!verifyStartAddress2(strStreet, strCity, strState, strZip))
		{
			return;
		}
		else
		{		
			//alert("got here");
			//document.getElementById('Form').submit();		
			document.Form.submit();
		}
	}
	
	
	function verifyStartAddress2(strStreet, strCity, strState, strZip, strInt)
	{
	    if (strInt==null)        // prevented the javascript warning popup box because it was set to a value, just a bogus value
	    {
	        strInt="US";
	    }
		// Check to make sure address entered combination is valid
		// Possible to have 16 different combinations - only 5 are not valid
		
		// no data entered
		if ((strStreet == "") && (strCity == "") && (strState == " ") && (strZip == "") && (strInt == "US"))
		{
			alert("Please enter an address to search.");
			document.getElementById('startAddress').focus();
			return 0;
		}
		// only city entered
		else if ((strStreet == "") && (strCity != "") && (strState == " ") && (strZip == ""))
		{
			alert("Please include at least a state to go with this city.");
			document.getElementById('strState').focus();
			return 0;
		}
		// only street entered
		else if ((strStreet != "") && (strCity == "") && (strState == " ") && (strZip == ""))
		{
			alert("Please include a city and state to go with this street address.");
			document.getElementById('startCity').focus();
			return 0;
		}
		// only street and city entered
		else if ((strStreet != "") && (strCity != "") && (strState == " ") && (strZip == ""))
		{
			alert("Please include at least a zip code to go with this address.");
			document.getElementById('startZip').focus();
			return 0;
		}
                // only street and state entered
		else if ((strStreet != "") && (strCity == "") && (strState != " ") && (strZip == ""))
		{
			alert("Please include a zip code or city to go with this address.");
			document.getElementById('startzip').focus();
			return 0;
		}
		// all other combinations are valid
		else
			return 1;
	}
	
	
	function myAlert(myString)
	{
	    alert(myString);
	}
	
	
	
	function fSubNavigate (subSection, link, windowName)
	{
		trace ("subNavigate");
		// getURL(_root.siteRoot + "" + subSection + "/" + link, windowName);
		getURL(_root.siteRoot + "/" + link, windowName);
		//getURL(link, windowName);
	} // End of the function
