/**
 * jQuery hijack plugin
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 * @author Krzysztof Kotowicz <kkotowicz at gmail dot com>
 * @see http://code.google.com/p/jquery-hijack/
 */
jQuery.fn.hijack=function(afterLoadFunction){var target=this;return this.find('a:not(.nohijack)').click(function(event){if(event.isDefaultPrevented())
return;jQuery(target).load(this.href,function(){jQuery(this).hijack(afterLoadFunction);if(jQuery.isFunction(afterLoadFunction)){afterLoadFunction.call(this);}});return false;}).end().find('form:not(.nohijack)').hijackForm(target,afterLoadFunction).end();};jQuery.fn.hijackForm=function(target,afterLoadFunction){if(!jQuery.fn.ajaxForm){return this;}
return jQuery(this).ajaxForm({target:target,beforeSubmit:function(fdata,jqForm,options){if(jqForm.data('skip')){jqForm.data('skip',false);return false;}},success:function(){jQuery(target).hijack(afterLoadFunction);if(jQuery.isFunction(afterLoadFunction)){afterLoadFunction.call(target);}}});};