function facebook_LoginController() {

	var _fqlFields = {
		user: [
			"uid",
			"first_name",
			//"middle_name",
			"last_name",
			//"name",
			//"pic_small",
			"pic_big",
			//"pic_square",
			"pic",
			//"affiliations",
			//"profile_update_time",
			//"timezone",
			//"religion",
			"birthday",
			"birthday_date",
			//"sex",
			"hometown_location",
			//"meeting_sex",
			//"meeting_for",
			//"relationship_status",
			//"significant_other_id",
			//"political",
			"current_location",
			//"activities",
			//"interests",
			//"is_app_user",
			//"music",
			//"tv",
			//"movies",
			//"books",
			//"quotes",
			//"about_me",
			//"hs_info",
			//"education_history",
			//"work_history",
			//"notes_count",
			//"wall_count",
			//"status",
			//"has_added_app",
			//"online_presence",
			//"locale",
			"proxied_email",
			"profile_url",
			"email_hashes",
			//"pic_small_with_logo",
			//"pic_big_with_logo",
			//"pic_square_with_logo",
			//"pic_with_logo",
			//"allowed_restrictions",
			//"verified",
			//"profile_blurb",
			//"family",
			//"username",
			//"website",
			"is_blocked",
			"contact_email",
			"email"
			//"third_party_id"
		]
	};

	function _onLoginCompleteHandler() {

		if( FB.getUserID() == 0 ) {
			alert( "No se estableció la conexión con Facebook" );
			return;
		}

		$( "#login_facebookUid" ).val( FB.getUserID() );
		$( "#login_facebookAccessToken" ).val( FB.getAccessToken() );
		//$( "#login_facebookSecret" ).val( session.secret );

		$( "#login_with_facebook" ).submit();

	}

	return {
		onLoginCompleteHandler: _onLoginCompleteHandler
	};

}

var fbLoginCtrl = new facebook_LoginController();
