/* To handle manipulation of 'my pages' */

YAHOO.namespace('zuvvi');

(function()
{
	YAHOO.zuvvi.already_reported = false;
	
	YAHOO.zuvvi.report_profile = function(tid)
	{
		if(YAHOO.zuvvi.already_reported)
		{
			alert('This group has already been reported to the site administrator.');
			return;
		}
		alert("This profile has been reported to the site administrator, thank you.");
		YAHOO.zuvvi.already_reported = true;
	}
	
	
	YAHOO.zuvvi.friend_request = function(fid,vc)
	{
		var add_friend_callback =
		{
	   		success	:	function(o) { /*alert(o.responseText);*/ },
	   		failure	:	function(o) { alert(_com_generic_profile_page_server_busy); },
	   		timeout	:	10000,
	   		cache	:	false
	    };

	    var add_friend_url = document.getElementById('com_generic_profile_friend_request_url').value;
	    post = 'f='+fid+'&vc='+vc;
		YAHOO.util.Connect.asyncRequest('POST', add_friend_url, add_friend_callback, post);
		alert(_com_generic_profile_page_contact_request);
	};

	YAHOO.zuvvi.group_request = function(gid,oid,vc)
	{
		var add_group_callback =
		{
	   		success	:	function(o) { /*alert(o.responseText);*/ },
	   		failure	:	function(o) { alert(_com_generic_profile_page_server_busy); },
	   		timeout	:	10000,
	   		cache	:	false
	    };

	    var add_group_url = document.getElementById('com_generic_profile_membership_request_url').value;
	    post = 'g='+gid+'&oid='+oid+'&vc='+vc;
		YAHOO.util.Connect.asyncRequest('POST', add_group_url, add_group_callback, post);
		alert(_com_generic_profile_page_join_request);
	};

	YAHOO.zuvvi.friend_request_signin = function()
	{
		alert(_com_generic_profile_page_sign_in_to_request);
	};

	//////////////////////////////////////////////
})();


