
	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
	
	//constant for tracking value of estimated price field
	var getScriptPageValue="";
	var getScriptPagetimer;
	function getScriptPage(div_id,content_id,type,quote_id)
	{
		content = document.getElementById(content_id).value;
		if(quote_id == '')
		  quote_id = 'quote_type';
		//console.debug("1 content="+content);
        if(content.length >=2 ){
        
        	subject_id = div_id;
			document.getElementById(div_id).style.display = 'block';
			if(document.getElementById(quote_id).value == 'international' && type == 'to')
			type = 'to_int';
			
            xajax_request_autosuggest_postcode(div_id,escape(content),type);
            
            //var from = document.getElementById('moving_from').value;
            //console.debug("2 from="+from);
            
            //console.debug("3 content_id="+content_id);
            
            
            	getScriptPageValue=$("#estimated_price").val();
            	//console.debug("run updatePageAfterGetScriptPage");
            	updatePageAfterGetScriptPage();
            
        }
		else
		{
		  box(0,div_id);
		}
	}
	
	function updatePageAfterGetScriptPage()
	{
		//console.debug("updatePageAfterGetScriptPage runs");
		var thisval=$("#estimated_price").val();
		//console.debug(thisval+" : "+getScriptPageValue);
		if (thisval!=getScriptPageValue) {
			//console.debug("partial success");
			//do the stuff you need to do
			if(document.getElementById('moving_from').value 
					&& document.getElementById('moving_to').value 
					&& document.getElementById('moving_from').value!='Suburb or Postcode'
					&& document.getElementById('moving_to').value!='Suburb or Postcode')
			{				
				//console.debug("success");
				$('.est_price1').css('visibility','visible');
				$('input.est_price').attr('readonly','true');
				$('#quick_quote_details').css('display','block');
				//_gaq.push(['_trackEvent', 'QQ_tracker', 'quick_quote']);
			}
			else
			{
				$('.est_price1').css('visibility','hidden');
				$('#quick_quote_details').css('display','none');
			}
			//cancel any timers
			window.clearTimeout(getScriptPagetimer);
		}else {
			//check again
			getScriptPagetimer=window.setTimeout("updatePageAfterGetScriptPage()",200);
		}
	}

	function highlight(action,id)
	{
	  if(action)	
		document.getElementById('word'+id).bgColor = "#83AF9E";
	  else
		document.getElementById('word'+id).bgColor = "#F8F8F8";
	}
	function displayfrom(word)
	{
		document.getElementById('moving_from').value = word;
		document.getElementById('box1').style.display = 'none';
		document.getElementById('moving_from').focus();
		//xajax_request_autosuggest_quickquote('quick_quote_price',32,xajax.getFormValues('quick_quote'),'');
	}
	function displayfrom2(word)
	{
		document.getElementById('moving_from2').value = word;
		document.getElementById('box12').style.display = 'none';
		document.getElementById('moving_from2').focus();
	}
	function displayfrom3(word)
	{
		document.getElementById('moving_from3').value = word;
		document.getElementById('box13').style.display = 'none';
		document.getElementById('moving_from3').focus();
	}
	function displayto(word)
	{
		document.getElementById('moving_to').value = word;
		document.getElementById('box2').style.display = 'none';
		document.getElementById('moving_to').focus();
		//xajax_request_autosuggest_quickquote('quick_quote_price',32,xajax.getFormValues('quick_quote'),'');
	}
	function displayto2(word)
	{
		document.getElementById('moving_to').value = word;
		document.getElementById('box2').style.display = 'none';
		document.getElementById('moving_to').focus();
	}
	
	function displayfromInt(word)
	{
		//document.getElementById('moving_from_int').value = word;
		document.getElementById('box3').style.display = 'none';
		//document.getElementById('moving_from_int').focus();
		//xajax_request_autosuggest_quickquote('quick_quote_price_int',32,xajax.getFormValues('quick_quote'),'');
	}
	function displaytoInt(word)
	{
		document.getElementById('moving_to_int').value = word;
		document.getElementById('box4').style.display = 'none';
		document.getElementById('moving_to_int').focus();
		//xajax_request_autosuggest_quickquote('quick_quote_price_int',32,xajax.getFormValues('quick_quote'),'');
	}
	function box(act,boxid)
	{
	  if(boxid == "")
	    boxid = "box";
	  if(act=='0')	
	  {
		document.getElementById(boxid).style.display = 'none';

	  }
	  else
		document.getElementById(boxid).style.display = 'block';
	}
	
    function getCountryScriptPage(div_id,content_id,type,sup_id)
	{
		content = document.getElementById('send_to_country').value;
        subject_id = div_id;
		//document.getElementById(div_id).style.display = 'block';
        xajax_request_autosuggest_postcode(div_id,escape(content),type,sup_id);
	}
    function getScriptPageCountry(div_id,content_id,type,sup_id,countryVal,template_name,sel_value)
	{
		content = document.getElementById(content_id).value;
        if(content.length >=2 ){
		document.getElementById(div_id).style.display = 'block';
        xajax_request_autosuggest_postcode(div_id,escape(content),type,sup_id,countryVal,template_name,sel_value);
        }	
	}
