function showObject(obj) {
    obj.className = "visible"
}
function hideObject(obj) {
    obj.className = "hidden"
}

function check()
{
	Fields = new Array( "fam", "name", "city", "tel" )
	flag = true
	for( i=0; i<Fields.length; i++ )
	{	
		obj = document.getElementById( Fields[i] )
		sss = obj.value
		while( sss.indexOf(" ") >= 0 )  
		{
			p = sss.indexOf(" ")
			sss = sss.substring( 0, p ) + sss.substring( p+1, sss.length )  
		}
		if ( !sss )  
		{ 
			flag = false
			obj.style.border = "solid 1px #FF9900"
			obj.style.background = "#FFFFE5"
			obj = document.getElementById( "label_" + Fields[i] )
			obj.style.color = "#FF6600"
		}
		else
		{
			obj.style.border = "solid 1px #CCCCCC"
			obj.style.background = "#F2F2F2"
			obj = document.getElementById( "label_" + Fields[i] )
			obj.style.color = "#000000"
		}
	}
	if ( !flag )  alert("Пожалуйста, заполните обязательные поля.")
	return flag
}
