// Added By Syam Code for Validating UK Post Code District.
function xmlhttpPost(strURL, strCountry, strPCodeId, strElToUpdate, strElToShowLoading, strCallFrom) 
{
	//	strCountry	-	may be used in future to get check postcode based on country

	var xmlHttpReq	=	false;
	var thisform		=	this;
	var tVal				=	$('#'+strElToShowLoading).html();

	// Checks if browser is Mozilla or Safari
	if (window.XMLHttpRequest){thisform .xmlHttpReq = new XMLHttpRequest();}
	// Checks if browser is Internet Explorer
	else if (window.ActiveXObject){thisform .xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");}

	thisform .xmlHttpReq.open('POST', strURL, true);
	thisform .xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	thisform .xmlHttpReq.onreadystatechange = function()
	{
		$('#'+strElToShowLoading).html(ShowLoading(''));
		if (thisform .xmlHttpReq.readyState == 4) {
			updatepage(thisform .xmlHttpReq.responseText, strElToUpdate);
			$('#'+strElToShowLoading).html(tVal);
		}
	}
	thisform .xmlHttpReq.send(getquerystring(strPCodeId, (('POPUP' == strCallFrom)	?	1	:	0)));
}

function getquerystring(strPCodeId, strCallFrom)
{
  var postcode= eval("document.getElementById('"+strPCodeId+"').value");
  qstr = 'postcode=' + escape(postcode);  // NOTE: no '?' before querystring
  qstr += '&is_popup=' + escape(strCallFrom);
  return qstr;
}

function updatepage(str, strElToUpdate)
{
   //document.getElementById("POST_CODE_RESULT").innerHTML = str;	//	use strElToUpdate instead of "POST_CODE_RESULT"
   $('#'+strElToUpdate).html(str);
}
// End Code for Validating UK Post Code District
