//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function showlookupbox(lookupiframeDiv){
	document.getElementById(lookupiframeDiv).style.display = "block";
}

function findaddress(inputString)
{
	if (inputString != ''){
		// disable the button
		toggleFormButton(true);
		// clear the form
		clearform();
		// submit the form and data
		document.getElementById("S2SForm").inputString.value = inputString;
		document.getElementById("S2SForm").submit();
	}
}
function toggleFormButton(status) {
	var theform = document.contactDetails;
	if (document.all || document.getElementById) {
		var tempobj = theform.searchbutton;
		if (status == true){
			tempobj.value = 'Searching...';
			showlookupbox("addresslookup");
		} else{
			tempobj.value = 'Find Address';				
			tempobj.disabled = status;
		}
	}
}
function clearform(){
	var theform = document.contactDetails;
	theform.organisation.value="";
	theform.address1.value="";
	theform.address2.value="";
	theform.address3.value="";
	theform.address4.value="";
	theform.town.value="";
	theform.county.value="";
	theform.postcode.value="";
}
