

function tellaFriend(id)
{

//alert(id);

var optionsTellaFriend = {
target:        '',   // target element(s) to be updated with server response
beforeSubmit:  tellaFriendRequest,  // pre-submit callback
success:       tellaFriendResponse,  // post-submit callback
url: 'api/tell-friend.php',
type:      'post',        // 'get' or 'post', override for form's 'method' attribute
dataType:  'json'  //,html, json
};
//$("#"+id).ajaxSubmit(optionsTellaFriend);
$('#tellaFriendFrom').ajaxSubmit(optionsTellaFriend);
return false;
}

// pre-submit callback
function tellaFriendRequest(formData, jqForm, options)
{
return true;
}

function tellaFriendResponse(responseText, statusText)
{
//alert(responseText);
    var html='';
var success = responseText.success;
var msg = responseText.msg;

//alert(msg);

  if( success==true)
      {
      html=' <div class="success">'+msg+'</div>';
      }
      else
      {
     html='<div class="error" >'+msg+'</div>';
      $('#femail').focus();
      }



  $('#tellaFriendDiv').empty();
 $('#tellaFriendDiv').html(html);
  $('#tellaFriendDiv').show();
}


