// contact.js
function format_phone(obj)
{
	var number = obj.value;
	var num = '';
	for(var n = 0;n<=number.length-1;n++)
	{		
		if(number.charCodeAt(n) >= 48 && number.charCodeAt(n) <= 57)
		{
			num += number.substr(n,1);
		}
	}
	if(num)
	{
		var tmp;
		tmp = '('+num.substr(0,3)+') '+num.substr(3,3) + '-' + num.substr(6,4);
		if(num.length > 10) tmp += ' ext: ' + num.substr(10);
		obj.value = tmp;
	}
}

function show_hint(id)
{
	if(document.getElementById('h'+id).innerHTML) document.getElementById('h'+id).style.display = 'inline';
}

function hide_hint(id)
{
	document.getElementById('h'+id).style.display = 'none';
}