function $(name) {
if (document.getElementById) return document.getElementById(name);
else if (document.all) return document.all[name];
else return null;
}

function trim(s) {
return rtrim(ltrim(s));
}

function ltrim(s) {
return s.replace(/^\s+/, ''); 
}

function rtrim(s) {
return s.replace(/\s+$/, ''); 
}

function checkContactForm() {
if (!trim($('name').value) || !trim($('phone').value) || !trim($('email').value) || !trim($('title').value) ||!trim($('comment').value)) {
	alert('Заполните все поля.');
	return false;
	}
	else {
	return true;
	}
}