function CheckRegister() {
    if (document.RegForm.check_out_email.value==""){
				window.alert('Enter your email address, please!');
				document.RegForm.check_out_email.focus();
				return false;
	}  else {
        // test if it is valid email address
		var emailReg = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$";
		var regex = new RegExp(emailReg);
		if(!regex.test(document.RegForm.check_out_email.value)){
				window.alert('Enter a valid email address, please!');
				document.RegForm.check_out_email.focus();
				return false;
		}
	}
	if(document.RegForm.check_out_source.value=="")
	{
		window.alert('Enter how you found this page, please!');
		document.RegForm.check_out_source.focus();
		return false;
	}

    $.cookie('contactus', 'webcast', {expires:180});
    return true;
}

function CheckContact() {
	if (document.ContactForm.contact_us_email.value==""){
		window.alert('Enter your email address, please!');
		document.ContactForm.contact_us_email.focus();
		return false;
	}  else {
		// test if it is valid email address
		var emailReg = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$";
		var regex = new RegExp(emailReg);
		if(!regex.test(document.ContactForm.contact_us_email.value)){
				window.alert('Enter a valid email address, please!');
				document.ContactForm.contact_us_email.focus();
				return false;
		}
	}
	if(document.ContactForm.contact_us_industry.value=="")
	{
		window.alert('Enter your company\'s industry, please!');
		document.ContactForm.contact_us_industry.focus();
		return false;
	}
	if(document.ContactForm.contact_us_volume.value=="")
	{
		window.alert('Enter your average call volume, please!');
		document.ContactForm.contact_us_volume.focus();
		return false;
	}
	if(document.ContactForm.contact_us_site.value=="")
	{
		window.alert('Enter your I.V.R., please!');
		document.ContactForm.contact_us_site.focus();
		return false;
	}
	if(document.ContactForm.contact_us_source.value=="")
	{
		window.alert('Enter how you found this page, please!');
		document.ContactForm.contact_us_source.focus();
		return false;
	}
    // set cookie
    $.cookie('letstalk', 'registered', {expires:180});
}

function CheckTellmemore() {
	if (document.MoreForm.tellme_email.value==""){
		window.alert('Enter your email address, please!');
		document.MoreForm.tellme_email.focus();
		return false;
	}  else {
		// test if it is valid email address
		var emailReg = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$";
		var regex = new RegExp(emailReg);
		if(!regex.test(document.MoreForm.tellme_email.value)){
				window.alert('Enter a valid email address, please!');
				document.MoreForm.tellme_email.focus();
				return false;
		}
	}
	if(document.MoreForm.tellme_industry.value=="")
	{
		window.alert('Enter your company\'s industry, please!');
		document.MoreForm.tellme_industry.focus();
		return false;
	}
	if(document.MoreForm.tellme_volume.value=="")
	{
		window.alert('Enter your average call volume, please!');
		document.MoreForm.tellme_volume.focus();
		return false;
	}
	if(document.MoreForm.tellme_site.value=="")
	{
		window.alert('Enter your I.V.R., please!');
		document.MoreForm.tellme_site.focus();
		return false;
	}
	if(document.MoreForm.tellme_source.value=="")
	{
		window.alert('Enter how you found this page, please!');
		document.MoreForm.tellme_source.focus();
		return false;
	}
    
    $.cookie('contactus', 'tell-me-more', {expires:180});
    return true;
    
}

function CheckCoworker() {
	if (document.CoworkerForm.tell_my_email.value==""){
		$(".content .promos #third.promo .eform .invalid").show();
		document.CoworkerForm.tell_my_email.focus();
		return false;
	}  else {
		// test if it is valid email address
		var emailReg = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$";
		var regex = new RegExp(emailReg);
		if(!regex.test(document.CoworkerForm.tell_my_email.value)){
				$(".content .promos #third.promo .eform .invalid").show();
				document.CoworkerForm.tell_my_email.focus();
				return false;
		}
	}
	if (document.CoworkerForm.tell_my_coworker.value==""){
		$(".content .promos #third.promo .eform .invalid").show();
		document.CoworkerForm.tell_my_coworker.focus();
		return false;
	}  else {
		// test if it is valid email address
		var emailReg = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$";
		var regex = new RegExp(emailReg);
		if(!regex.test(document.CoworkerForm.tell_my_coworker.value)){
				$(".content .promos #third.promo .eform .invalid").show();
				document.CoworkerForm.tell_my_coworker.focus();
				return false;
		}
	}

}

function CheckCalculator() {
	if(document.erlangform.calculator_total.value=="" || document.erlangform.calculator_total.value=="$")
	{
		window.alert('Enter the monthly toll-free telephony minute-based spend, please!');
		document.erlangform.calculator_total.focus();
		document.erlangform.calculator_total.value="";
		return false;
	}
	if(document.erlangform.calculator_rate.value=="" || document.erlangform.calculator_rate.value=="$")
	{
		window.alert('Enter the per minute rate charged by your service provider, please!');
		document.erlangform.calculator_rate.focus();
		document.erlangform.calculator_rate.value="";
		return false;
	}
	if(document.erlangform.calculator_fees.value=="" || document.erlangform.calculator_fees.value=="$")
	{
		window.alert('Enter the monthly call transfer fees, please!');
		document.erlangform.calculator_fees.focus();
		document.erlangform.calculator_fees.value="";
		return false;
	}
}

function CheckCalculator2() {
	if (document.erlangform2.tell_my_email.value=="" || document.erlangform2.tell_my_email.value=="Your email address"){
				$(".content .overview .left .calculator .eform .invalid").show();
				document.erlangform2.tell_my_email.focus();
				return false;
	}  else {
		// test if it is valid email address
		var emailReg = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$";
		var regex = new RegExp(emailReg);
		if(!regex.test(document.erlangform2.tell_my_email.value)){
				$(".content .overview .left .calculator .eform .invalid").show();
				document.erlangform2.tell_my_email.focus();
				return false;
		}
	}
}