tamor.co.uk - Art by Tamor Kriwaczek
function contact() { showContactDiv(); } function showContactDiv() { var winHeight = $(window).height(); var winWidth = $(window).width(); var divHeight = $("#contactDivContent").height(); var divWidth = $("#contactDivContent").width(); //alert(divHeight); var t = Math.floor((winHeight / 2) - (divHeight / 2)); var l = Math.floor((winWidth / 2) - (divWidth / 2)); $("#contactDivContent").css("top", t + "px"); $("#contactDivContent").css("left", l + "px"); $("#contactDivOverlay").fadeTo(200, 0.75, function(){$("#contactDivContent").fadeIn(200);}); } function cancel() { $("#contactDivContent").hide(); $("#contactDivOverlay").fadeOut(200); } function sendEmail() { // get all the vars //$.get('gallery.php',{doWhat: "setNew", pTitle: paintings[selectedPainting]['title'], pCatNo: paintings[selectedPainting]['catNo']},function(x){changeGallery(x)});# var nameFrom = $("#contactForm [name=senderName]").val(); var emailFrom = $("#contactForm [name=senderEmail]").val(); var messageToSend = $("#contactForm [name=senderMessage]").val(); var fromPage = document.location; var hasError = false; //alert("testing email: " + emailFrom); var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/; if (emailFrom == '') { alert("Please enter your email address."); hasError = true; return; } else if(!emailReg.test(emailFrom)) { alert("Please enter a VALID email address."); hasError = true; return; } //alert("testing message"); if (messageToSend == "") { alert("No message to send!"); hasError = true; return; } //alert("testing name"); if (nameFrom == "") { alert("Pleae tell me who you are."); hasError = true; return; } if(hasError == true) { return false; } //alert("posting..."); if (!$.post('contact.php',{ doWhat: "sendEmail", fromPage: "" + document.location + "", name: "" + nameFrom + "", email: "" + emailFrom + "", message: "" + messageToSend + "" },function(x){sendResult(x)})) { sendResult("sent=sendFailure"); } //alert("done posting"); } function sendResult(x) { //alert("dealing with result: \nres:" + x); var r = x.split("~"); var actionResult = r[0].split("=")[1]; var errorText = ""; var sentOK = false; if (actionResult == "ok") { // email sent ok! //alert("ok!"); sentOK = true; } else if (actionResult == "sendFalure") { //alert("couldn't send"); errorText = "I'm sorry but your email could not be sent right now.\n\nPlease try again later."; } if (actionResult == "invalidEmail") { alert("invalid email in php"); errorText = "Your email address did not pass the 'validity' test.\n\nPlease correct your email address and try again."; } if (sentOK == false) { alert(errorText); } else { alert("Your message has been sent.\n\nThankyou."); $("#contactDivContent").hide(); $("#contactDivOverlay").fadeOut(200); } }
Contact me.
Find me elsewhere
You can find me on Facebook, Twitter, or read my blog about art, and related ideas, as well as the occassional
review at tamorart.blogspot.com,
latest post:
Cedey Codray - Harvest
.
Alternatively, to keep up to date with exhibitions and my blog just join my mailing list: