jQuery(document).ready(function(){var options={beforeSubmit:validate_profile_comments,success:showServerResponse_comments,timeout:8000,type:"post",url:"http://www.bobproctornetwork.com/beta/bp_ajax.php"};jQuery('#frm_profile_comments').ajaxForm(options);});function send_profile_comment(){val=jQuery('#profile_comment_box').attr('value');val=jQuery.trim(val);to=jQuery('#profile_comment_to').attr('value');if(val==''){jQuery('#validation_profile_comments_postnew').empty().append('
- Message is empty.
').show();}else{jQuery.ajax({type:"POST",data:"action=writeonwall_popup&_ajax_nonce=af477959f8&profile_comment="+val+"&to="+to,url:"http://www.bobproctornetwork.com/beta/bp_ajax.php",success:function(msg){text_parts=msg.substr(0,7);if(text_parts=="__Error"){message=msg.split(":");jQuery('#validation_profile_comments_postnew').empty().html('Following errors have occured.- '+message[1]+'
');jQuery('#validation_profile_comments_postnew').show();}else{jQuery('#validation_profile_comments_postnew').hide();html='| Write a Comment | |
|---|---|
| '+msg+' | |
- Message is empty.
');isvalidated=false;} if(!isvalidated){jQuery('.profile_comment_textbox blur').attr('value','');jQuery('#validation_profile_comments').show();return false;} return isvalidated;} function showServerResponse_comments(responseText,statusText){text=jQuery.trim(responseText);text_parts=text.substr(0,7);if(text_parts=="__Error"){message=text.split(":");jQuery('#validation').html('Following errors have occured.- '+message[1]+'
');jQuery('#validation').show();}else{jQuery('#profile_comment').attr('value','');if((jQuery('td.contactCommentBoxHolder').html())) jQuery("td.contactCommentBoxHolder").empty().html(text);else jQuery('- Subject is empty.
");isvalidated=false;} if(typeof(message)=="undefined"){jQuery("#validation").append("- Message is empty.
");isvalidated=false;} if(isvalidated){subject=jQuery.trim(subject);message=jQuery.trim(message);if(subject==""){jQuery("#validation").append("- Subject is empty.
");isvalidated=false;} if(message==""){jQuery("#validation").append("- Message is empty.
");isvalidated=false;}} if(!isvalidated){jQuery("#validation").show();return false;} return isvalidated;} function showServerResponse(responseText){text=jQuery.trim(responseText);text_parts=text.substr(0,7);if(text_parts=="__Error"){message=text.split(":");jQuery("#validation").html("Following errors have occured.- "+message[1]+"
");jQuery("#validation").show();}else{jQuery("td.sendmessage_container").empty().html(""+text+"
");}} function submit_message(){if(validate()){str=jQuery("#frm_sendmessage").serialize();jQuery.ajax({type:"POST",url:"bp_ajax.php",data:str,success:function(msg){showServerResponse(msg);}});}}