   // we will add our javascript code here           
   
$(document).ready(function(){

$("#ajax-tellafriend-form").submit(function(){

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

   $.ajax({
   type: "POST",
   url: "http://www.minhaj.org/include/ajax-tellafriend.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 message has been sent. Thank you!</div>';
$("#friendsfed").hide();
}
else
{
result = msg;
}

$(this).html(result);

});

}

 });

return false;

});


$("#ajax-sponsor-form").submit(function(){

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

   $.ajax({
   type: "POST",
   url: "http://www.minhaj.org/include/ajax-sponsor.php",
   data: str,
   success: function(msg){
    
$("#notesponsor").ajaxComplete(function(event, request, settings){

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

$(this).html(result);

});

}

 });

return false;

});


$("#ajax-comment-form").submit(function(){

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

   $.ajax({
   type: "POST",
   url: "http://www.minhaj.org/include/ajax-text-comments.php",
   data: str,
   success: function(msg){
    
$("#notecomment").ajaxComplete(function(event, request, settings){

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

$(this).html(result);

});

}

 });

return false;

});



$("#ajax-complaint-form").submit(function(){

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

   $.ajax({
   type: "POST",
   url: "http://www.minhaj.org/include/ajax-complaint.php",
   data: str,
   success: function(msg){
    
$("#notecom").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 complaint has been sent to administrator. Thank you!</div>';
$("#friendscom").hide();
}
else
{
result = msg;
}

$(this).html(result);

});

}

 });

return false;

});

$("#ajax-join-form").submit(function(){

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

   $.ajax({
   type: "POST",
   url: "http://www.minhaj.org/include/ajax-join.php",
   data: str,
   success: function(msg){
    
$("#notejoin").ajaxComplete(function(event, request, settings){

if(msg == 'OK') // Message Sent? Show the 'Thank You' message and hide the form
{
result = '<div class="notification_ok">You successfully subscribe or unsubscribe yourself for our newsletter. Thank you!</div>';
$("#filedsjoin").hide();
}
else
{
result = msg;
}

$(this).html(result);

});

}

 });

return false;

});

});
