Enjin_Profile_Friends = function() {
	this.init();
}

Enjin_Profile_Friends.__instance = null;
Enjin_Profile_Friends.gi = function() {
	if (Enjin_Profile_Friends.__instance == null) {
		Enjin_Profile_Friends.__instance = new Enjin_Profile_Friends();
	}
	
	return Enjin_Profile_Friends.__instance;
}

Enjin_Profile_Friends.prototype = {
	
	init: function() {
	},
	
	launchPopup: function(evt, message, message1, baseurl) {
		var params = {
				message: message,
				message1: message1,
				button_continue: 'Yes',
				scope: this,
				callback: function() {
					window.location = baseurl;
				}
			};
		
		//prevent close due same click event
		if (!evt) var evt = window.event;
		evt.cancelBubble = true;
		if (evt.stopPropagation) evt.stopPropagation();		
		
		Enjin_Core.showPopup(params);			
	},
	
	removeFollowing: function(evt, baseurl) {
		this.launchPopup(evt, 'Confirm Remove', 'Do you want to remove this user?', baseurl);
	},
	
	blockUser: function(evt, baseurl) {
		this.launchPopup(evt, 'Confirm block', 'Do you want to block this user?', baseurl);	
	},
	
	unblockUser: function(evt, baseurl) {
		this.launchPopup(evt, 'Unblock User', 'Do you want to unblock this user?', baseurl);		
	}	
}

$(document).ready(function() {	
	Enjin_Profile_Friends.gi();
});
