var ErrorDivStyle = "border: 2px solid Red; margin: 1px; background-color: #ffdddd;"
var ErrorDivStyleStep2 = "border: 2px solid Red; margin: 1px; padding: 2px; background-color: #ffdddd;"

function displayMoreInfo(company, product)
{

tb_show('<strong>Please contact us for more information.</strong>','http://www.annuityrateshopper.com/popupformmoreinfo.php?company=' + company + '&product=' + product + '&KeepThis=true&TB_iframe=true&height=350&width=510&','');

}


function ValidateForm()
{
	ErrorCount = 0;
	
	if ($('#txtFirstName').val() != '')
	{
		$('#divFirstName').attr('style','');
		$('#spanFirstName').attr('style','');
	}
	else
	{
		$('#divFirstName').attr('style',ErrorDivStyleStep2);
		$('#spanFirstName').attr('style','color: Red;');
		ErrorCount++;
	}
	
	if ($('#txtLastName').val() != '')
	{
		$('#divLastName').attr('style','');
		$('#spanLastName').attr('style','');
	}
	else
	{
		$('#divLastName').attr('style',ErrorDivStyleStep2);
		$('#spanLastName').attr('style','color: Red;');
		ErrorCount++;
	}
	


	
	if ( ($('#txtPhone1').val() != '') && ($('#txtPhone2').val() != '') && ($('#txtPhone3').val() != '')  && ($('#txtPhone1').val().length == 3) && ($('#txtPhone2').val().length == 3) && ($('#txtPhone3').val().length == 4))
	{	
			$('#divPhone').attr('style','');
		$('#spanPhone').attr('style','');
	}
	else
	{
		$('#divPhone').attr('style',ErrorDivStyleStep2);
		$('#spanPhone').attr('style','color: Red;');
		ErrorCount++;
	}
	
	
	if ($('#txtEmail').val() != '' )
	{
		$('#divEmail').attr('style','');
		$('#spanEmail').attr('style','');
		
		var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
		var address = $('#txtEmail').val();
		

		if(reg.test(address) == false) 
		{
			
			$('#divEmail').attr('style',ErrorDivStyleStep2);
			$('#spanEmail').attr('style','color: Red;');
			ErrorCount++;
		}
		else
		{
			
			$('#divEmail').attr('style','');
			$('#spanEmail').attr('style','');	
		}
	}
	else
	{
		$('#divEmail').attr('style',ErrorDivStyleStep2);
		$('#spanEmail').attr('style','color: Red;');
		ErrorCount++;
	}
	
	return ErrorCount;
	
	
}

function SubmitForm()
{
	
var Errors = ValidateForm();
if (Errors === 0)
{
	$('#frmContact').submit();
}
else
{
	return false;
	$('#tblError').show().fadeIn('normal');
	
}
	
}