function addressLookup()
{

	var housenum = document.getElementById("pi_search_house");
	var postcode = document.getElementById("pi_search_postcode");

	if(housenum.value == "" || postcode.value == "")
		return false;

	xajax_ajaxsearch_postcode(housenum.value, postcode.value);

}

function addAddress(txt,val)
{
	var id = document.getElementById(txt);
	id.value = val;
}


/*
 * Show and hide element function
*/

function showElement(id)
{

	var e = document.getElementById(id);

	if (e.style.display == 'none')
	{
		e.style.display = 'block';
	}
	else
	{
		e.style.display = 'none';
	}

}

/*
 *Limit the characters in the text area field
 */
function limitText(limitField, limitNum) {
	if (limitField.value.length > limitNum) {
		limitField.value = limitField.value.substring(0, limitNum);
}
}


/*
 * Keypress function (F9) for Webdev stats/info.  This only for Mozilla browsers (e.g. Firefox).
*/
$(document).ready( function()
{
	
	$("#webdev_info").css({ "display" : "block" }).hide();

	$(document).keypress( function(event)
	{
		
		if( event.keyCode == 120 )
		{
			$("#webdev_info").toggle("slow");
		}
		
	});
	
	$('#surveyPopup').dialog({ show: 'slow',position: ['auto',100] }); //Open our survey popup
	
	
	//close survey popup when link clicked on
	$("#surveyPopupClose").click
	( 
		function()
		{
			$('#surveyPopup').dialog('close');
		}
	);
	
	//Survey popup to open new window
	$("#surveyPopupOpen").click
	( 
		function()
		{
			popup = window.open('http://www.helpucover.co.uk/portal/content/survey_popup_question.html','_blank','width=800,height=600,alwaysLowered=yes, scrollbars=yes');
			popup.blur();
			window.focus();
			self.focus();
			
			$('#surveyPopup').dialog('close');
		}
	);
	

});