
	function doHide(x)
	{
		try
		{
			x.style.visibility = 'hidden';
			var y = document.getElementById('spPleaseWait');
			y.style.visibility = 'visible';
		}
		catch(e){}
	}
	
	function editAddress(lineId)
	{
		try
		{
			addressType =  getAddressType(lineId);
			document.location = "OrderReviewAddress.aspx?addressType=" + addressType;
			return false;
		}
		catch(e)
		{
			return false;
		}
		
	}
	function isAddressEditable(LineId)
	{
		var selectedId = LineId.split("|");
		var companyId = selectedId[2];
		if(companyId == '0')
			return true;
		else
			return false;
	}
	function getAddressType(LineId)
	{
		var selectedId = LineId.split("|");
		return selectedId[1];
	}
	function addAddress()
	{
		var counter = 0;
		
		for(i = 0; i < Form1.rbShippingAddress.length; i++)
			if(isAddressEditable(Form1.rbShippingAddress[i].value))
				counter++;
				
		if(counter>=4)
		{
			alert('You have reached the limit of addresses.  Please edit an address.');
			return false;
		}		
	}
	function Update_MailingAddress_Name()
	{
		try
		{
			if (document.all)
			{
				document.all("InstitutionSearch1:divMailingAddress_Name").innerHTML = document.all("txtFirstName").value + " " + document.all("txtLastName").value;
			}
			else
			{
				document.getElementById("InstitutionSearch1:divMailingAddress_Name").innerHTML = document.getElementById("txtFirstName").value + " " + document.getElementById("txtLastName").value;
			}
		}
		catch (e) {}//ignore Error
	}

