//This script belong to Esben Stig Ehrenskjöld - Streamline data. © Copyright 2007 - 2008 All rights reserved.

function emailValidatorC() {
var name = document.getElementById('CName');
var emailc = document.getElementById('CEmail');
	var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
	if (emailc.value.match(emailExp)) {
		return true;
    }
	else{
		alert("Your e-mail is not valid; please try again.");
		emailc.value = ""; // delete the text in this input
		emailc.focus(); // set the focus to this input
		return false;
	}
}


function notEmptyC(){
var name = document.getElementById('CName');
var massage = document.getElementById('CMessage');
var emailc = document.getElementById('CEmail');
var emailc2 = document.getElementById('CEmail2');
    if (name.value.length == 0) {
        alert('please enter your name');
        name.focus(); // set the focus to this input
        return false;
    }
    else if (emailc.value.length == 0) {
        alert('please enter your e-mail');
        emailc.focus(); // set the focus to this input
        return false;
    }
    else if (emailc.value != emailc2.value) {
        alert('The email addresses do not match. Please re-enter.');
        emailc2.focus(); // set the focus to this input
        return false;
    }
    else if (massage.value.length == 0) {
        alert('please type a massage');
        massage.focus(); // set the focus to this input
        return false;
    }
	return true;
};

function checkCValidation(){
	if (notEmptyC()==true && emailValidatorC()==true){
		document.cform.submit();
		return true;
	}
return false;
};
// End -->