// When DOM is ready
$(document).ready(function(){

// ------- Submit First Form -------

$("#suggest_us_a_story").submit(function(){

var str = $(this).serialize();

   $.ajax({
   type: "POST",
   url: "http://www.crisisobserver.com/suggest/suggest_us_a_story.php",
   data: str,
   success: function(msg){
    
$("#note").ajaxComplete(function(event, request, settings){

if(msg == 'OK') // Message Sent? Show the 'Thank You' message and hide the form
{
result = '<div class="notification_ok">Your suggestion has been received. Thank you!</div>';
$("#fields").hide();
}
else
{
result = msg;
}

$(this).html(result);

});

}

 });

return false;

});

// ------- Submit Second Form -------

$("#suggest_a_source").submit(function() {

var str = $(this).serialize();

   $.ajax({
   type: "POST",
   url: "http://www.crisisobserver.com/suggest/suggest_a_source.php",
   data: str,
   success: function(msg){
    
$("#note-two").ajaxComplete(function(event, request, settings){

if(msg == 'OK') // Message Sent? Show the 'Thank You' message and hide the form
{
result = '<div class="notification_ok">Your source has been received. Thank you!</div>';
$("#fields-two").hide();
}
else
{
result = msg;
}

$(this).html(result);

});

}

 });

return false;

});

});