function change_text(obj, txt)
{
	obj.value = txt;
	return true;
}
function focus_input_tri()
{
	document.forms['form_nav_resultats_recherche_annonces'].elements['do_tri'].focus();
}
function getKeyCode(e)
{
	if(window.event)
	{
		return window.event.keyCode;
	}
	else
	{
		if(e)
		{
			return e.which;
		}
		return null;
	}
}
function keyRestrict(e,validchars)
{
	var key = '';
	var keychar = '';
	key = getKeyCode(e);
	if(key == null)
	{
		return true;
	}
	keychar = String.fromCharCode(key);
	keychar = keychar.toLowerCase();
	validchars = validchars.toLowerCase();
	if(validchars.indexOf(keychar) != -1)
	{
		return true;
	}
	if(
		key == null
		|| key == 0
		|| key == 8
		|| key == 9
		|| key == 13
		|| key == 27
	)
	{
		return true;
	}
	return false;
}
function IsNumeric(obj,event)
{
	if(obj.getAttribute('className'))
	{
		var class_obj = obj.getAttribute('className');
	}
	if(obj.getAttribute('class'))
	{
		var class_obj = obj.getAttribute('class');
	}
	if(class_obj.search(/numeric/) != -1)
	{
		return keyRestrict(event,'1234567890');
	}
	else
	{
		if(class_obj.search(/alpha/) != -1)
		{
			return keyRestrict(event,'abcdefghijklmnopqrstuvwxyz ' + String.fromCharCode(241));
		}
		return true;
	}
}