function clickclear(thisfield, defaulttext) {
	if (thisfield.value == defaulttext) {
	thisfield.value = "";
	}
	}
	
	function clickrecall(thisfield, defaulttext) {
	if (thisfield.value == "") {
	thisfield.value = defaulttext;
	}
	}
function isValidEmail(email)
{
    email = email.replace(/^\s+|\s+$/g, '');
    return (/^([a-z0-9_\-]+\.)*[a-z0-9_\-]+@([a-z0-9][a-z0-9\-]*[a-z0-9]\.)+[a-z]{2,4}$/i).test(email);
}

function checkFieldsAndEmail(form_obj)
{
	
	var msg;
	var check = 0;
	
	
	if(document.getElementById("msg").value == '' || document.getElementById("msg").value == 'текст вашего сообщения' || document.getElementById("mbr_name").value == '' || document.getElementById("mbr_name").value == 'имя' )
		{
			msg = "Please fill all fields!";
			check = 1;	
		}
	
	
	
    if(!isValidEmail(document.getElementById("mbr_email").value))
	{
		msg = "E-mail incorrect!";
                check = 1;
	}
	
    if (check == 0) return true;
    else { alert(msg); return false;}
}