	function SaveCompany()
	{
		//Get All Control
		var hCompany = document.getElementById("hCompany");
		var hLanguageSupport = document.getElementById("hLanguageSupport");
		
		var txtCompanyName = document.getElementById("txtCompanyName");		
		var txtAddress1 = document.getElementById("txtAddress1");
		var txtAddress2 = document.getElementById("txtAddress2");	
		var txtCity = document.getElementById("txtCity");		
		var txtZipCode = document.getElementById("txtZipCodeC");	
		var ddlCountryC = document.getElementById("ddlCountryC");
		var txtWebsite = document.getElementById("txtWebsite");
		var ddlStartOperations = document.getElementById("ddlStartOperations");
		var ddlEndOperations = document.getElementById("ddlEndOperations");
		var ddlTimeZone = document.getElementById("ddlTimeZone");
		
		var StateValue = "";
		//if not united state then don't show the State list but show the text to input their state/province
		if(ddlCountryC.options[ddlCountryC.selectedIndex].value != "United States")
		{
			var txtStateC = document.getElementById("txtStateC");
			
			if(txtStateC.value == "")
				StateValue = ",-1";
			else
				StateValue = txtStateC.value + ",-1";
		}
		else
		{
			var ddlStateC = document.getElementById("ddlStateC");
			StateValue = ddlStateC.options[ddlStateC.selectedIndex].value + "," + ddlStateC.selectedIndex;
		}
		
		//Populate Checkbox Language
		var LanguageSupport = document.getElementsByName("cbLanguage");
		//Get Checkbox Length
		var Length = LanguageSupport.length;
		//Find Language Checked
		var TempLanguage = "";
		for (var i = 0; i < Length; i++)
		{
			if(LanguageSupport[i].checked == true)
				TempLanguage += LanguageSupport[i].id + "," + LanguageSupport[i].value + "#";
		}
		
		//Save to temp variable
		TempLanguage = TempLanguage.substring(0, TempLanguage.length - 1);
		
		//Save value Company Information to Hidden input
		hCompany.value = txtCompanyName.value + "#" + txtAddress1.value + "#" + txtAddress2.value + "#" + txtCity.value + "#" + 
					  StateValue + "#" + txtZipCode.value + "#" + 
					  ddlCountryC.options[ddlCountryC.selectedIndex].value + "," + ddlCountryC.selectedIndex + "#" + txtWebsite.value + "#" + 
					  ddlStartOperations.options[ddlStartOperations.selectedIndex].value + "," + ddlStartOperations.selectedIndex + "#" + 
					  ddlEndOperations.options[ddlEndOperations.selectedIndex].value + "," + ddlEndOperations.selectedIndex + "#" +
				          ddlTimeZone.options[ddlTimeZone.selectedIndex].value + "," + ddlTimeZone.selectedIndex + "," + ddlTimeZone.options[ddlTimeZone.selectedIndex].innerHTML;
		
		//Save value Language Support to Hidden Input
		hLanguageSupport.value = TempLanguage;
		
		//~ var StateAddress = StateValue.split(",");
		//~ var Address = txtAddress1.value + " " + txtCity.value + ", " + StateAddress[0] + " " + txtZipCode.value;
		
		//~ SaveLatLng(Address);
		
		var StateAddress = StateValue.split(",");
		SaveLatLng(txtAddress1.value,  txtCity.value, StateAddress[0],  txtZipCode.value,  ddlCountryC.options[ddlCountryC.selectedIndex].value);
	}
	
	function SaveLatLng(Address1, City, State, ZipCode, Country)
	{		
		//Populate address to get Latitude and Longitude
		var Address = Address1  + " " + City + ", " + State + " " + ZipCode;
		//Get Latitude and Longitude from ZipCode	
		if(Address != null && Address != "")
		{
			var CompanyGeocoder = new GClientGeocoder();
			CompanyGeocoder.getLatLng(Address, function(point)
										{
											if(point)
											{
												var Latitude = point.lat();
												var Longitude = point.lng();
												
												document.getElementById("hCompany").value += "#" + Latitude + "#" + Longitude + "#0";
												//~ alert("First Time $$$$$$$$$$$$$$$$ Latitude : " + Latitude + " =============== Longitude : " + Longitude);
											}
											else
											{
												SaveLatLng2Times(City, State, ZipCode);
												//~ document.getElementById("hCompany").value += "#0#0";
											}
										});
		}
		else
		{
			document.getElementById("hCompany").value += "#0#0";
		}
	}
	
	function SaveLatLng2Times(City, State, ZipCode)
	{
		//Populate address to get Latitude and Longitude
		var Address = City + ", " + State + " " + ZipCode;
		var CompanyGeocoder = new GClientGeocoder();
		CompanyGeocoder.getLatLng(Address, function(point)
									{
										if(point)
										{											
											var Latitude = point.lat();
											var Longitude = point.lng();
												
											document.getElementById("hCompany").value += "#" + Latitude + "#" + Longitude + "#1";
											//~ alert("Second Time $$$$$$$$$$$$$$$$ Latitude : " + Latitude + " =============== Longitude : " + Longitude);
										}
										else
										{
											document.getElementById("hCompany").value += "#0#0#0";
										}
									});
	}
	
	function ShowCompany()
	{
		//Get All Control
		var hCompany = document.getElementById("hCompany");		
		var hLanguageSupport = document.getElementById("hLanguageSupport");
		
		var txtCompanyName = document.getElementById("txtCompanyName");		
		var txtAddress1 = document.getElementById("txtAddress1");
		var txtAddress2 = document.getElementById("txtAddress2");	
		var txtCity = document.getElementById("txtCity");		
		var txtZipCode = document.getElementById("txtZipCodeC");	
		var ddlCountryC = document.getElementById("ddlCountryC");
		var txtWebsite = document.getElementById("txtWebsite");
		var ddlStartOperations = document.getElementById("ddlStartOperations");
		var ddlEndOperations = document.getElementById("ddlEndOperations");
		var ddlTimeZone = document.getElementById("ddlTimeZone");		
		var sCompany = document.getElementById("scompany");
		
		//Check to The Last Control if null it's mean the all control not yet Rendered otherwise the control is rendered and bind data to that control
		//Content Not yet Rendered
		if(sCompany == null)
		{
			setTimeout("ShowCompany();", 300);
		}
		//Content Rendered
		else
		{
			if(hCompany.value != "" && hCompany.value != null)
			{		
				//Split value Company Information from Hidden input;
				var AllValue =  hCompany.value.split("#");
				
				//Split index
				var ddlCountryCSelectedIndex = AllValue[6].split(",");
				var ddlStateSelectedIndex = AllValue[4].split(",");
				var ddlStartOperationsIndex = AllValue[8].split(",");
				var ddlEndOperationsIndex = AllValue[9].split(",");
				var ddlTimeZoneIndex = AllValue[10].split(",");
				
				var txtStateC = document.getElementById("txtStateC");
				var ddlStateC = document.getElementById("ddlStateC");
				
				//Hide list state of United States
				if(ddlCountryCSelectedIndex[0] != "United States")
				{
					txtStateC.value = DecodeTag(ddlStateSelectedIndex[0]);
					txtStateC.style.display = "";
					ddlStateC.style.display ="none";					
				}
				//Show list state
				else
				{
					//ddlStateC.selectedIndex = ddlStateSelectedIndex[1];
					
					//Select the State value, with comparing value from Dropdown List value with value from input hidden
					for(var i = 0; i < ddlStateC.options.length; i++)
					{
						if(ddlStateC.options[i].value == ddlStateSelectedIndex[0])
							ddlStateC.options[i].selected = "selected";
					}
					
					txtStateC.style.display = "none";
					ddlStateC.style.display ="";				
				}
				
				//Show value from Hidden input
				txtCompanyName.value = DecodeTag(AllValue[0]);
				txtAddress1.value = DecodeTag(AllValue[1]);
				txtAddress2.value = DecodeTag(AllValue[2]);
				txtCity.value = DecodeTag(AllValue[3]);
				txtZipCode.value = DecodeTag(AllValue[5]);				
				txtWebsite.value = DecodeTag(AllValue[7]);
				
				//~ ddlCountryC.selectedIndex = ddlCountryCSelectedIndex[1];
				//~ ddlStartOperations.selectedIndex = ddlStartOperationsIndex[1];
				//~ ddlEndOperations.selectedIndex = ddlEndOperationsIndex[1];
				//~ ddlTimeZone.selectedIndex = ddlTimeZoneIndex[1];			
				
				//Select the country value, with comparing the value from dropdown country with the value from input hidden
				for(var i = 0; i < ddlCountryC.options.length; i++)
				{
					if(ddlCountryC.options[i].value == ddlCountryCSelectedIndex[0])
						ddlCountryC.options[i].selected = "selected";
				}
				
				//Select the start operations time, with comparing the value from start operations with the value from input hidden
				for(var i = 0; i < ddlStartOperations.options.length; i++)
				{
					if(ddlStartOperations.options[i].value == ddlStartOperationsIndex[0])
						ddlStartOperations.options[i].selected = "selected";
				}
				
				//Select the end operations time, with comparing the value from end operations with the value from input hidden
				for(var i = 0; i < ddlEndOperations.options.length; i++)
				{
					if(ddlEndOperations.options[i].value == ddlEndOperationsIndex[0])
						ddlEndOperations.options[i].selected = "selected";
				}
				
				//Select the Time Zone value with comparing the value from Dropdown with the value from input hidden
				for(var i = 0; i < ddlTimeZone.options.length; i++)
				{
					if(ddlTimeZone.options[i].value == ddlTimeZoneIndex[0])
						ddlTimeZone.options[i].selected = "selected";
				}				
			}
			
			//Check if There is no Language Selected
			if(hLanguageSupport.value != "" && hLanguageSupport.value != null)
			{
				//Split Language Support from Hidden Input		
				var AllLanguage = hLanguageSupport.value.split("#");
				//Populate Language Checked
				for(var i = 0; i < AllLanguage.length; i++)
				{
					//Split Language Id and Language Name
					var LanguageId = AllLanguage[i].split(",");
					
					var LanguageChecked = document.getElementById(LanguageId[0]);
					LanguageChecked.checked = true;
				}
			}
		}
	}
	
	function ChangeStateC(id)
	{
		//Get Dropdown object of Country list
		var ddlCountryC = document.getElementById(id);
		//Get Dropdow object of State list
		var ddlStateC = document.getElementById("ddlStateC");
		//Get Text object of State
		var txtStateC = document.getElementById("txtStateC");
		
		//if not united state then don't show the State list but show the text to input their state/province
		if(ddlCountryC.options[ddlCountryC.selectedIndex].value != "United States")
		{
			//Hide State List
			ddlStateC.style.display = "none";
			//Show Textbox to input state/province
			txtStateC.style.display = "";
		}	
		else
		{
			//Show State List
			ddlStateC.style.display = "";
			//Hide Textbox to input state/province
			txtStateC.style.display = "none";
		}	


		//Get ZipCode Input to set MaxLength
		var txtZipCodeC = document.getElementById("txtZipCodeC");
		//If Country selected is canada then maxlength set to 6 otherwise set to 5
		if(ddlCountryC.options[ddlCountryC.selectedIndex].value == "Canada")
			//~ txtZipCodeC.setAttribute("maxlength", "6");
			txtZipCodeC.maxLength = 6;
		else if(ddlCountryC.options[ddlCountryC.selectedIndex].value == "United States")
			//~ txtZipCodeC.setAttribute("maxlength", "5");		
			txtZipCodeC.maxLength = 5;
		else
			txtZipCodeC.maxLength = 10;
	}
	
	function CompanyValidation()
	{
		//Statue Check
		var ValidationCompany = false;
		var vCompanyName = false;
		var vAddress1 = false;
		var vCity = false;
		var vZipCode = false;
		var vWebsite = false;
		
		//Get All object to be check the value
		var sIndicates = document.getElementById("sIndicates");
		var txtCompanyName = document.getElementById("txtCompanyName");
		var txtAddress1 = document.getElementById("txtAddress1");
		var txtCity = document.getElementById("txtCity");
		var txtStateC = document.getElementById("txtStateC");
		var txtZipCodeC = document.getElementById("txtZipCodeC");
		var txtWebsite = document.getElementById("txtWebsite");
		
		//get object validation star
		var vtxtCompanyName = document.getElementById("vtxtCompanyName");
		var vtxtAddress1 = document.getElementById("vtxtAddress1");
		var vtxtCity = document.getElementById("vtxtCity");
		var vtxtStateC = document.getElementById("vtxtStateC");
		var vtxtZipCodeC = document.getElementById("vtxtZipCodeC");
		var vtxtWebsite = document.getElementById("vtxtWebsite");
		
		//There is a company name value and hide confirmation otherwise show
		if(txtCompanyName.value != null && txtCompanyName.value != "")
		{
			vtxtCompanyName.style.display = "none";
			vCompanyName = true;
		}
		else
		{
			vtxtCompanyName.style.display = "";
			vCompanyName = false;
		}
		
		//There is a Adress1 value and hide confirmation otherwise show
		if(txtAddress1.value != null && txtAddress1.value != "")
		{
			vtxtAddress1.style.display = "none";
			vAddress1 = true;
		}
		else
		{
			vtxtAddress1.style.display = "";
			vAddress1 = false;
		}
			
		//There is a City value and hide confirmation otherwise show
		if(txtCity.value != null && txtCity.value != "")
		{
			vtxtCity.style.display = "none";
			vCity = true;
		}
		else
		{
			vtxtCity.style.display = "";
			vCity = false;
		}
			
		//There is a Zip Code value and hide confirmation otherwise show
		if(txtZipCodeC.value != null && txtZipCodeC.value != "")
		{
			vtxtZipCodeC.style.display = "none";
			vZipCode = true;
		}
		else
		{
			vtxtZipCodeC.style.display = "";
			vZipCode = false;
		}
			
		//~ //There is a Website value and hide confirmation otherwise show
		//~ if(txtWebsite.value != null && txtWebsite.value != "")
		//~ {
			//~ vtxtWebsite.style.display = "none";
			//~ vWebsite = true;
		//~ }
		//~ else
		//~ {
			//~ vtxtWebsite.style.display = "";
			//~ vWebsite = false;
		//~ }		
		
		//~ //All control have value and give return true otherwise false
		//~ if(vCompanyName == true && vAddress1 == true && vCity == true && vZipCode == true && vWebsite == true)
		//~ {
			//~ sIndicates.style.display = "none";
			//~ ValidationCompany = true;			
		//~ }
		//~ else
		//~ {
			//~ sIndicates.style.display = "";
			//~ ValidationCompany = false;			
		//~ }
		
		//All control have value and give return true otherwise false
		if(vCompanyName == true && vAddress1 == true && vCity == true && vZipCode == true)
		{
			sIndicates.style.display = "none";
			ValidationCompany = true;			
		}
		else
		{
			sIndicates.style.display = "";
			ValidationCompany = false;			
		}
		
		return ValidationCompany;
	}