// JavaScript Document
$(document).ready(function(){
$("#sendmail").click(function(){
var valid = '';
var isr = ' is required. <a href="mailto:info@buckleyfineart.com?subject=Subscription Problem">Contact Buckley Fine Art</a> if this problem persists.';
var email = $("#email").val();
var cmd = $("#cmd").val();
if (!email.match(/^([a-z0-9._-]+@[a-z0-9._-]+\.[a-z]{2,12}$)/i)) {
valid += '<br />A valid Email'+isr;
}
if (valid!='') {
$("#response").fadeIn("slow");
$("#response").html("<strong>Error</strong>:"+valid);
}
else {
var datastr ='email=' + email + '&cmd=' + cmd;
$("#response").css("display", "block");
$("#response").html("Contacting... ");
$("#response").fadeIn("slow");
setTimeout("send('"+datastr+"')",4000);
}
return false;
});
});
function send(datastr){
$.ajax({
type: "POST",
url: "../send_email.php",
data: datastr,
cache: false,
success: function(html){
$("#response").fadeIn("slow");
$("#response").html(html);
setTimeout('$("#response").fadeOut("slow")',4000);
}
});
}

// JavaScript Document
/// Tell Me More //////////////////////////

$(document).ready(function(){
$("#tellmemore-sendmail").click(function(){
var valid = '';
var isr = ' is required. <a href="mailto:info@buckleyfineart.com?subject=Tell Me More Problem">Contact Buckley Fine Art</a> if this problem persists.';
var email = $("#tellmemore-email").val();
var artwork = $("#artwork").val();
var tellmemore = $("#tellmemore").val();

if (!email.match(/^([a-z0-9._-]+@[a-z0-9._-]+\.[a-z]{2,12}$)/i)) {
valid += '<br />A valid Email'+isr;
}

if (valid!='') {
$("#tellmemore-response").fadeIn("slow");
$("#tellmemore-response").html("<strong>Error</strong>:"+valid);
}
else {
var datastr ='email=' + email + '&artwork=' + artwork + '&tellmemore=' + tellmemore;
$("#tellmemore-response").css("display", "block");
$("#tellmemore-response").html("Contacting... ");
$("#tellmemore-response").fadeIn("slow");
setTimeout("tellmemore_send('"+datastr+"')",4000);
}
return false;
});
});
function tellmemore_send(datastr){
$.ajax({
type: "POST",
url: "../send_email.php",
data: datastr,
cache: false,
success: function(html){
$("#tellmemore-response").fadeIn("slow");
$("#tellmemore-response").html(html);
setTimeout('$("#tellmemore-response").fadeOut("slow")',6000);
}
});
}


