	function Localize(str)
	{
		return str;
	}
	
	function ResetForm(strRegion, strCountryCode, sPartnerType)
	{
		strRegion = strRegion.toUpperCase();
		if (strRegion == "NA")
		{
			//show zip & distance fields
			document.getElementById("divzip").style.display="";						
			document.getElementById("divdist").style.display="";						
			if (sPartnerType =="Reseller")
			{
			//reset zip & distance fields
			document.search_partner.zip.value = '';
			document.search_partner.distance.selectedIndex = 0;
			}

			//show state & hide province fields
			document.getElementById("divprovince").style.display="none";
			document.getElementById("divstate").style.display="";

			//reset state & province fields
			document.search_partner.province.selectedIndex = 0;
			document.search_partner.state.selectedIndex = 0;
		}
		else
		{
			//hide zip & distance fields for other regions
			document.getElementById("divzip").style.display="none";						
			document.getElementById("divdist").style.display="none";						
		}
		document.search_partner.p_name.value = '';
		//document.search_partner.partner_type.selectedIndex = 0;
		document.search_partner.country.selectedIndex = 0;
		if(sPartnerType =='Reseller')
		{
		document.search_partner.product_line.selectedIndex =3;
		document.search_partner.level.selectedIndex = 2;
		document.search_partner.enduser_nodecount.value = '';
		}
	}
	
	function NewSearch()
	{
		document.mainform.action = "find_partner.asp";
		document.mainform.method = "post";
		document.mainform.submit();
	}
	
	function checkForm(strRegion, strCountryCode, sPartnerType) 
	{
		strRegion = strRegion.toUpperCase();
		strCountryCode = strCountryCode.toLowerCase();

		var boolvalidForm = true;
		var msg= "_____________________________________________________________\n\n";
		msg += Localize("The form was not submitted because of the following error.\n");
		msg += Localize("Please correct this error and resubmit.\n");
		msg += "_____________________________________________________________\n\n";
		
		var intCounter =0, strErrorMessage='';						
		
		with (document.search_partner) 
		{
			//required field validation for product type field.
			//alert(sPartnerType);
			if (sPartnerType == "Reseller")
			{
			if (product_line.selectedIndex == 0)
			{
					boolvalidForm = false;
					msg += Localize("Product Specialization is required.\n");
					alert(msg);
					product_line.focus();
					return false;
			}		
			
			//required field validatino for partner security alliance level field.
			if (level.selectedIndex < 0)
			{
					boolvalidForm = false;
					msg += Localize("Partner SecurityAlliance Level is required.\n");
					alert(msg);
					level.focus();
					return false;
			}
			}
			
			//required field validation for country fields (region other than NA).
			if (strRegion != "NA")
			{
				if (country.selectedIndex == 0)
				{
					boolvalidForm = false;
					msg += Localize("Country is required.\n");
					alert(msg);
					country.focus();
					return false;
				}
			}

			//required field validation for state/province fields based on the country selected (USA/Canada)
			//this is applicable for NA region only.
			/*if (strRegion == "NA")
			{
				if (country.options.length > 0)	
				{	
					if (country.options[country.selectedIndex].value.toUpperCase() == 'USA')
					{
						if (state.options.length > 1)
						{
							if (state.selectedIndex == 0)
							{
								boolvalidForm = false;
								msg += Localize("State is required.\n");
								alert(msg);
								state.focus();
								return false;
							}
						}
					}
					else if (country.options[country.selectedIndex].value.toUpperCase() == 'CANADA') 
					{
						if (province.options.length > 1)
						{
							if (province.selectedIndex == 0)
							{
								boolvalidForm = false;
								msg += Localize("Province is required.\n");
								alert(msg);
								province.focus();
								return false;
							}
						}
					}
				}
			}*/

			
			if (strRegion == "NA")
			{
				if (sPartnerType == "Reseller"){
				//zipcode validation for US/Canada countries (applicable for NA region alone)
				if (zip.value != "")
				{
					if (!CheckZip(zip.value,sPartnerType))
					{
						boolvalidForm = false;
						if (country.options[country.selectedIndex].value.toUpperCase() == 'USA')
							msg += Localize("US Zip Code is invalid.\n");
						else if (country.options[country.selectedIndex].value.toUpperCase() == 'CANADA') 
							msg += Localize("Canada Postal Code is invalid.\n");
						alert(msg); 
						zip.focus();
						return false;					
					}
				}}
			}	

			//endusernodecount validation for all countries (applicable for all regions)
			if (sPartnerType == "Reseller"){
			if (enduser_nodecount.value != "")
				if (!IsInteger(enduser_nodecount.value))
				{
					boolvalidForm = false;
					msg += Localize("End user node count is invalid.\n");
					alert(msg); 
					enduser_nodecount.focus();	
					return false;
				}				
			}										
			if (boolvalidForm)
			{

				action = "find_partner_result.asp";
				submit();
			}
		}
	}

	function CheckZip(sZip,sPartnerType)
	{
		var e = "";
		var sPat;
		//alert(sPartnerType)
		if (sPartnerType == "Reseller"){
		if(document.search_partner.country.value.toUpperCase() == "USA")
		{
			sPat = "^[0-9]{5}$";
		}
		else
		{
			sPat = "^[0-9A-Za-z]{3}[ ][0-9A-Za-z]{3}$";
		}
		var ZipReg = new RegExp(sPat);			
		return ZipReg.test(sZip);
		}
		
	}

	function EvaluateCountry(strRegion, strCountryCode) 
	{
		strRegion = strRegion.toUpperCase();
		if (strRegion == "NA")
		{
			if (document.search_partner.country.options[document.search_partner.country.selectedIndex].value.toUpperCase()=="USA") 
			{		
				document.getElementById("divstate").style.display="";
				document.getElementById("divprovince").style.display="none";
				document.getElementById("divnode").style.display="";
				document.getElementById("divzip").style.display="";						
				document.getElementById("divdist").style.display="";						
			}
			else if (document.search_partner.country.options[document.search_partner.country.selectedIndex].value.toUpperCase()=="CANADA") 
			{				
				document.getElementById("divstate").style.display="none";
				document.getElementById("divprovince").style.display="";
				document.getElementById("divnode").style.display="";
				document.getElementById("divzip").style.display="";						
				document.getElementById("divdist").style.display="";						
			}
			else 
			{	
				document.getElementById("divstate").style.display="none";
				document.getElementById("divprovince").style.display="none";
				document.getElementById("divnode").style.display="none";
				document.getElementById("divzip").style.display="none";						
				document.getElementById("divdist").style.display="none";						
			}
		}
		else 
		{	
			document.getElementById("divzip").style.display="none";						
			document.getElementById("divdist").style.display="none";						
		}
		document.search_partner.rcode.value = document.search_partner.country.options[document.search_partner.country.selectedIndex].value;		
/*		if (strRegion == "NA")
		{
			document.search_partner.country.disabled=true;
			document.search_partner.Button1.disabled=true;
			document.search_partner.Button2.disabled=true;
			document.search_partner.state.disabled=true;
			document.search_partner.action = "find_partner.asp";
			document.search_partner.submit();		
		}*/
	}
	
	// used for dropdown change events of find-a-partner default.asp page.
	/*function EvaluateCountryOnly(strCountry, strRegion, strCountryCode) 
	{
		with (document.search_partner)
		{
			countryapac.disabled=true;
			countryltam.disabled=true;
			countryemea.disabled=true;
			countryna.disabled=true;
			rcode.value = strCountry;
			region.value = strRegion;
			action = "find_partner.asp";
			submit();		
		}
	}

	function SelectRegion(strCountryCode)
	{
		with (document.search_partner)
		{
			action = "default.asp";
			submit();
		}
	}*/