function ajax(user_id_by, user_id_s, m, formname, email, num)
{
//	$(document).ready(function()	{
		jQuery.ajax(
		{
  	 		type: "POST",
	 		url: "http://www.gigsmack.com/insert.php",
	 		data: "user_id=" + user_id_by + "&user_s=" + user_id_s + "&x1=" + m + "&email=" + email + "&num=" + num,
	 		success: function(data)
			{
				if (data == 2)
					alert('User was added to favorites.');
				else
					if (data == 1)
						alert('Message was send.');
					else
						if (data == -2)
							alert("Error send data.");
						else
							if (data == -1)
								location.replace("Login_redirect.php");
						    else
								alert('User was smacked.');
			}
		});
//	});
}

function favor(user_id, profileName)
{
//if(profileName=='')profileName='';
//jQuery.ready(function(){
		jQuery.ajax(
		{
  	 		type: "GET",
	 		url: "http://www.gigsmack.com/ua_favorites.php",
	 		data: "action=add&user_id="+user_id+"&is_ajax=1",
	 		success: function(data)
			{
				if (data == 'success')
					alert("Request has been sent to "+profileName);
				else
					if (data == 'exists')
						alert("User "+profileName+" is already in your favorites list");
			}
		});
//	});
}
