// JavaScript Document
$(document).ready(function(){
$("form#lets_talk").submit(function(){
//hide error containers
$("#email_error").hide();
if(validateForm()){
var getlink = '_popups/news.html?KeepThis=true&TB_iframe=true&height=400&width=600';
$("#formopen").attr('href',getlink);
$("#formopen").click();
//$.get("test.php",{ //http://visitor.constantcontact.com/d.jsp
// ea: $("#ea").val(),
// m: $("#m").val(),
// p: $("#p").val()
// }, function(data) {
// $("#ea").val(" Thank You");
//});
};
return false;
});
});
//get link info from flash file
function formlink(getlink){
var getlink = '_popups/'+getlink+'?KeepThis=true&TB_iframe=true&height=400&width=600';
$("#formopen").attr('href',getlink);
$("#formopen").click();
};
function addMessages(xml) {
$("#messagewindow").empty();
$("message",xml).each(function(id) {
message = $("message",xml).text();
$("#messagewindow").prepend(""+message+"
");
});
}
function validateForm()
{
$("#email_error").empty().hide();
var email = $("#ea").val();
var errors = 0;
if (email == null || email == '' || email == 'Your Email Address')
{
//$("#email_error").show().append("Email is required");
//alert ("Email is required");
//errors++;
}
if (errors > 0)
{
//alert ("Errors were found on the form");
return false;
} else {
return true;
}
}