/**
 * plugin for wiring up ajax modal windows using the Boxy plugin
 * pass in a function to afterShow to execute a callback after the modal is opened
 *
 */

$.fn.boxifyLink = function(options) {
	var settings = jQuery.extend({
		afterShow: function(){
			$('.boxy-wrapper .form-cancel').show().click(function(){
				Boxy.get(this).hide();
				return false;
			})
		}
	}, options);

	$(this).click(function(){
		Boxy.load($(this).attr('href'), {
			modal: true,
			afterShow: settings.afterShow
		});
		return false;
	});

};

