$(document).ready(function()
{

	
	
});


function openSendFriendForm() {
	$(".send_friend").show();
	return ret_false();
}

function closeSendFriendForm() {
	$(".send_friend").hide();
	$(".send_friend form").show();				
	$(".send_friend .error").hide();
	$(".send_friend .success").hide();
	
	$(".send_friend form input[name=email]").val('');
	$(".send_friend form input[name=name]").val('');
	return ret_false();
}

//Perform sending mail
function submitSendFriendForm() {	
	var params = $(".send_friend form input").serialize();	
	$.ajax({
		type: "POST",
		url:  "src/pages/send_friend.php",
		data: params,
		success: function(sent){			
			if (sent=='1') { 
				$(".send_friend form").hide();
				$(".send_friend .error").hide();
				$(".send_friend .success").show();					
			}
			if (sent=='0') {					
				$(".send_friend .error").show();
			}
		}
	});		
	return ret_false();
}

function ret_false() {
	try
	 {
	  // VISTA IE 7
	  window.event.returnValue = false;
	 } catch (error)
	 {
	  // ALL OTHER (MOZILLA, OPERA, SAFARI, IE 6 & 7 ON XP)
	  return false;
	 }	
}