jQuery(document).ready(function(){
jQuery("button.btnSend").click(function(){
var form = jQuery(this).closest('form');
jQuery.ajax({type:'POST', url: 'https://psychologyhelps.ca/wp-content/themes/cp-wp/inc/contactus/contact2.php', data:jQuery(form).serialize(), success: function(response) {
if(parseInt(response)>0)
{
if(jQuery(form).find(".spanMessage").length)
jQuery(form).find(".spanMessage").html('
Well done! Your message has been sent.
');
else
alert('Well done! Your message has been sent');
}
else{
if(jQuery(form).find(".spanMessage").length)
jQuery(form).find(".spanMessage").html('Error! '+response+'
');
else
alert(response);
}
}});
});
});
function tz_format_twitter(twitters) {
var statusHTML = [];
var status = twitters.replace(/((https?|s?ftp|ssh)\:\/\/[^"\s\<\>]*[^.,;'">\:\s\<\>\)\]\!])/g, function(url) {
return ''+url+'';
}).replace(/\B#([_a-z0-9]+)/ig, function(reply) {
return reply.charAt(0)+''+reply.substring(1)+'';
});
statusHTML.push(''+status+'');
return statusHTML.join('');
}
jQuery(document).ready(function(){
var Tweets = jQuery('#twitter').html();
if(Tweets)
jQuery('#twitter').html(tz_format_twitter(Tweets));
});