function initializeInputHint(oInput, sHint)
{
	if ( !sHint ) {
		if ( !oInput.value.length ) {
			return;
		}
		sHint = oInput.value;
	}
	oInput.onblur = function() { if ( /^\s*$/.test(oInput.value) ) { oInput.value = sHint; } };
	oInput.onfocus = function() { if ( oInput.value.toLowerCase() == sHint.toLowerCase() ) { oInput.value = ""; } };
	if ( /^\s*$/.test(oInput.value) ) {
		oInput.value = sHint;
	}
	return;
}
function clearHint(oInput)
{
	try {
		var sHint = oInput.getAttribute('ctg:hint');
	} catch (e) {
		var sHint = "";
	}
	if ( oInput.value == sHint ) {
		oInput.value = "";
	}
	return;
}
function removeHints()
{
	var oCityLocation = document.getElementById('city');
	if ( oCityLocation ) {
		clearHint(oCityLocation);
	}
	
	var oPropertyName = document.getElementById('property_name');
	if ( oPropertyName ) {
		clearHint(oPropertyName);
	}
	
	return;
}
ready(function() {
	
	var oForm = null;
	
	var oCityLocation = document.getElementById('city');
	if ( oCityLocation ) {
		oForm = oCityLocation.form;
		initializeInputHint(oCityLocation);
	}
	
	var oPropertyName = document.getElementById('property_name');
	if ( oPropertyName ) {
		oForm = oPropertyName.form;
		initializeInputHint(oPropertyName);
	}
	
	if ( oForm && typeof xAddEventListener == 'function' ) {
		xAddEventListener(oForm, 'submit', removeHints);
	}
	
});
