
	subject_id = '';
	function handleHttpResponse() {
		if (http.readyState == 4) {
			if (subject_id != '') {
				document.getElementById(subject_id).innerHTML = http.responseText;
			}
		}
	}
	function getHTTPObject() {
		var xmlhttp;
		/*@cc_on
		@if (@_jscript_version >= 5)
			try {
				xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				try {
					xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (E) {
					xmlhttp = false;
				}
			}
		@else
		xmlhttp = false;
		@end @*/
		if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
			try {
				xmlhttp = new XMLHttpRequest();
			} catch (e) {
				xmlhttp = false;
			}
		}
		return xmlhttp;
	}
	var http = getHTTPObject(); // We create the HTTP Object

	function getScriptPage(div_id,content_id,type)
	{
		content = document.getElementById(content_id).value;
        if(content.length >=2 ){

        subject_id = div_id;
		document.getElementById(div_id).style.display = 'block';
        xajax_request_autosuggest_postcode(div_id,escape(content),type);
        }


	}

	function getScriptPage1(div_id,content_id,type)
	{
    content = document.getElementById(content_id).value;
    subject_id = div_id;
    document.getElementById(div_id).style.display = 'block';
    //xajax_request_autosuggest_postcode(div_id,escape(content),type);
    xajax_request_calendar_checker(div_id,escape(content),type);
	}

	function highlight(action,id)
	{
	  if(action)
		{
			if(action == 2)
				document.getElementById('word'+id).bgColor = "#2C2C2C";
			else if(action == 3)
				document.getElementById('word'+id).bgColor = "#FFFFFF";
			else
				document.getElementById('word'+id).bgColor = "#C2B8F5";
		}
	  else
		document.getElementById('word'+id).bgColor = "#F8F8F8";
	}
	function displayfrom(word)
	{
		document.getElementById('srch_codedtls').value = word;
		document.getElementById('box1').style.display = 'none';
		document.getElementById('srch_codedtls').focus();
	}
	function displayto(word)
	{
		document.getElementById('send_to').value = word;
		document.getElementById('box2').style.display = 'none';
		document.getElementById('send_to').focus();
	}

	function displayfromValue(word)
	{
		//document.getElementById('srch_code_hid').value = word;
		//document.getElementById('box1').style.display = 'none';

	}
	function displaytoValue(word)
	{
		document.getElementById('send_to_hid').value = word;
		document.getElementById('box2').style.display = 'none';

	}

	function displayfromShow(word)
	{
		document.getElementById('srch_codedtls').value = word;
		if(isNaN(document.getElementById('srch_codedtls').value))
		{
			if(document.getElementById('srch_codedtls').value != 'Suburb or Postcode or Country' && document.getElementById('srch_codedtls').value != '')
			{
				var suburbname = document.getElementById('srch_codedtls').value;
				var suburbstring = suburbname.split(',');
				var pcode = suburbstring[1].split(' ');
				if(!isNaN(pcode[1]))
				{
					document.getElementById('searchby').value = 'srch_both_postcode';
					document.getElementById('srch_code').value = pcode[1];
				}
				else
				{
					document.getElementById('searchby').value = 'srch_both_suburb';
					document.getElementById('srch_code').value = suburbstring[0];
				}
			}
		}
		else
		{
			document.getElementById('searchby').value = 'srch_both_postcode';
			document.getElementById('srch_code').value = document.getElementById('srch_codedtls').value;
		}
		document.getElementById('box1').style.display = 'none';

	}
	function displaytoShow(word)
	{
		document.getElementById('send_to').value = word;
		document.getElementById('box2').style.display = 'none';

	}

	function fillfrom(pickup_suburb,pickup_state,pickup_postcode,pickup_country)
	{
		document.getElementById('pickup_suburb').value = pickup_suburb;
		document.getElementById('pickup_state').value = pickup_state;
		document.getElementById('pickup_postcode').value = pickup_postcode;
		document.getElementById('pickup_country').value = pickup_country;
		document.getElementById('box1').style.display = 'none';

		document.getElementById('pickup_state').readOnly = true;
	}


	function fillto(delivery_suburb,delivery_state,delivery_postcode,delivery_country)
	{
		document.getElementById('delivery_suburb').value = delivery_suburb;
		document.getElementById('delivery_state').value = delivery_state;
		document.getElementById('delivery_postcode').value = delivery_postcode;
		document.getElementById('delivery_country').value = delivery_country;
		document.getElementById('box2').style.display = 'none';
	
    document.getElementById('delivery_state').readOnly = true;
}

	function fillcontacts(contact_suburb,contact_state,contact_postcode,contact_country)
	{
		document.getElementById('contact_suburb').value = contact_suburb;
		document.getElementById('contact_state').value = contact_state;
		document.getElementById('contact_postcode').value = contact_postcode;
		document.getElementById('contact_country').value = contact_country;
		document.getElementById('box1').style.display = 'none';
	}


	function fillregister(register_suburb,register_state,register_postcode,register_country)
	{
		document.getElementById('user_suburb').value = register_suburb;
		document.getElementById('user_postcode').value = register_postcode;
		document.getElementById('user_state').value  = register_state;
		document.getElementById('box1').style.display = 'none';
	}

	function fillaccount(register_suburb,register_state,register_postcode,register_country)
	{
		document.getElementById('user_suburb').value = register_suburb;
		document.getElementById('user_postcode').value = register_postcode;
		document.getElementById('user_state').value  = register_state;
		document.getElementById('box1').style.display = 'none';
	}

	function box(act)
	{
	  if(act=='0')
	  {
		document.getElementById('box').style.display = 'none';

	  }
	  else
		document.getElementById('box').style.display = 'block';
	}

