function modal_register(redirect_url) {
	$.ajax({
	url: 'facebookregister',
	data: $('#register_form').serialize(),
	type: 'post',
	cache: false,
	complete: function (xhr) {
			// create a modal dialog with the data
                        $.modal.close();
                        str = xhr.responseText;
                        if (str.match("success")) {
                           window.location = redirect_url;
                        }
			$(xhr.responseText).modal({
				close: false,
				position: ["5%",]
                                //onClose: modalform.close,
			});

	}
	});
}

function modal_signin(redirect_url) {
	$.ajax({
	url: 'linkaccount',
	data: $('#linkaccount_form').serialize(),
	type: 'post',
	cache: false,
	complete: function (xhr) {
                        $.modal.close();
                        str = xhr.responseText;
                        if (str.match("success")) {
                           window.location = redirect_url;
                        }
			// create a modal dialog with the data
			$(xhr.responseText).modal({
				close: false,
				position: ["5%",]
                                //onClose: modalform.close,
			});

	}
	});
}

/*
var modalform = {
        close: function (dialog) {
           FB.Connect.logoutAndRedirect("<?php echo sfConfig::get('app_biz_frontend_url');?>logout")
        }
    };
*/

