(function(a){jQuery.AjaxifyDefaults={event:"click",link:false,target:"#container",animateOut:false,animateIn:false,animateOutSpeed:"normal",animateInSpeed:"normal",method:"GET",tagToload:false,loading_txt:"",loading_img:"images/loading.gif",loading_target:false,loading_fn:function(b){jQuery.ajaxifyLoading(b)},loadHash:false,title:false,forms:false,params:"ajax=true",timeout:false,contentType:"application/x-www-form-urlencoded",dataType:"html",cache:false,username:false,password:false,onStart:function(b){},onError:function(b){jQuery.ajaxifyManip(b,"<font style='color: #CC0000'>Error: </font> Couldn't open the page.")},onSuccess:function(b){},onComplete:function(b){}};jQuery.AjaxifyFirstLoad=true;jQuery.AjaxifyhistorySet=new Object();jQuery.AjaxifyPageTitle=document.title;jQuery.AjaxifyDebug=false;jQuery.fn.ajaxify=function(b){if(!jQuery(this).size()){jQuery.ajaxifylog('Error: No matched element/s for your ajaxify selector " '+jQuery(this).selector+' ".');return false}return this.each(function(){var c=jQuery.extend({},jQuery.AjaxifyDefaults,b);if(jQuery.metadata){c=jQuery.extend(c,jQuery(this).metadata())}if(c.event){jQuery(this).bind(c.event,function(){jQuery(this).ajaxifyAnalyse(c);if(!c.hash){jQuery.ajaxifyLoad(c)}else{jQuery.ajaxifyHash(c)}if(jQuery(this).is("a")||jQuery(this).is("form")){return false}})}else{jQuery(this).ajaxifyAnalyse(c);jQuery.ajaxifyLoad(c)}if(c.loadHash&&jQuery.AjaxifyFirstLoad){jQuery(this).ajaxifyAnalyse(c);if(document.location.hash.replace(/^#/,"")==c.hash&&c.hash){jQuery.ajaxifyHash(c);jQuery.AjaxifyFirstLoad=false}}})};jQuery.fn.ajaxifyAnalyse=function(d){d.object=this;if(jQuery(this).is("a")){if(jQuery(this).attr("href")){var c=jQuery(this).attr("href").replace(/^#/,"");d.link=c||d.link}else{d.link}if(typeof d.tagToload!="object"){if(jQuery(this).attr("target")){d.target=jQuery(this).attr("target")}else{d.target}}else{d.target=d.loading_target||"#AjaxifyTemp"}}if(!d.loading_target){d.loading_target=d.target}if(d.forms){var f=jQuery(d.forms).serialize();d.paramres=f}if(typeof d.params=="function"){var e=d.params(d)}else{var e=d.params}if(typeof e=="string"){if(f){d.paramres+="&"+e}else{d.paramres=e}}var b=d.target.length-1;if(typeof d.tagToload!="object"){if(d.target.charAt(b)=="+"||d.target.charAt(b)=="-"){d.manip=d.target.charAt(b);d.target=d.target.substr(0,b)}}if(d.loadHash){if(!jQuery.historyInit){jQuery.ajaxifylog("Error: loadHash is enabled but history plugin couldn't be found.");return false}if(d.loadHash===true){jQuery.ajaxifylog('Info: It seemes you are upgrading from v1.0. Please see the new documentation about loadHash. "attr:href" will be used instead of "true".');d.loadHash="attr:href"}if(d.loadHash.toLowerCase()=="attr:href"||d.loadHash.toLowerCase()=="attr:rel"||d.loadHash.toLowerCase()=="attr:title"){d.loadHash=d.loadHash.toLowerCase();d.hash=jQuery(this).attr(d.loadHash.replace("attr:",""));if(jQuery.browser.opera){d.hash=d.hash.replace("?","%3F");d.hash=d.hash.replace("&","%26");d.hash=d.hash.replace("=","%3D")}}else{d.hash=d.loadHash}if(!d.hash){jQuery.ajaxifylog("Warning: You have specified loadHash, but its empty or attribute couldn't be found.")}}if(!jQuery(d.target).size()&&typeof d.tagToload!="object"){jQuery.ajaxifylog('Warning: Target " '+d.target+" \" couldn't be found.")}};jQuery.ajaxifyLoading=function(b){var c="<div id='AjaxifyLoading'><img src='"+b.loading_img+"' alt='Loading...' title='Loading...' >"+b.loading_txt+"</div>";if(b.loading_target){jQuery.ajaxifyManip(b.loading_target,c)}else{jQuery.ajaxifyManip(b,c)}};jQuery.ajaxifyHash=function(c){var b=new Object();jQuery.each(c,function(d,e){b[d]=e});jQuery.AjaxifyhistorySet[b.hash]=b;location.hash=b.hash;jQuery.historyInit(jQuery.ajaxifyHistory);jQuery.AjaxifyFirstLoad.history=false};jQuery.ajaxifyLoad=function(b){jQuery.ajaxSetup({global:false});jQuery.ajax({type:b.method,url:b.link,dataType:b.dataType,data:b.paramres,contentType:b.contentType,processData:true,timeout:b.timeout,cache:b.cache,username:b.username,password:b.password,complete:function(){b.onComplete(b)},beforeSend:function(){b.onStart(b);if(b.animateOut){if(b.loading_target!=b.target){}b.loading_fn(b);jQuery(b.target).animate(b.animateOut,b.animateOutSpeed,function(){if(!b.loading_target){b.loading_fn(b)}})}else{b.loading_fn(b)}},success:function(c){jQuery(b.target).stop();jQuery("#AjaxifyLoading").remove();if(b.title){document.title=b.title}else{if(document.title!=jQuery.AjaxifyPageTitle){document.title=jQuery.AjaxifyPageTitle}}if(b.tagToload){c="<div>"+c+"</div>";if(typeof b.tagToload=="string"){jQuery.ajaxifyManip(b,jQuery(c).find(b.tagToload))}else{if(typeof b.tagToload=="object"){jQuery.each(b.tagToload,function(d,e){if(jQuery(c).find(d).size()){jQuery.ajaxifyManip(e,jQuery(c).find(d))}else{jQuery.ajaxifylog('Warning: Tag "'+d+"\" couldn't be found.")}})}}}else{jQuery.ajaxifyManip(b,c)}b.onSuccess(b,c);if(b.animateIn){jQuery(b.target).animate(b.animateIn,b.animateInSpeed)}},error:function(c){jQuery(b.target).stop();b.onError(b,c);if(b.animateIn){jQuery(b.target).animate(b.animateIn,b.animateInSpeed)}}})};jQuery.ajaxifylog=function(b){if(jQuery.AjaxifyDebug){if(window.console){console.debug(b)}else{alert(b)}}};jQuery.ajaxifyHistory=function(c){if(c){if(jQuery.browser.safari){var b=jQuery.AjaxifyhistorySet[location.hash.replace(/^#/,"")]}else{var b=jQuery.AjaxifyhistorySet[c]}if(b){jQuery.ajaxifyLoad(b)}else{jQuery.ajaxifylog("History Fired. But I couldn't find hash. Most propabley, the hash is empty. If so, its normal.")}}};jQuery.ajaxifyManip=function(e,c){if(typeof e!="object"){var d=e;var e=new Object;var b=d.length-1;if(d.charAt(b)=="+"||d.charAt(b)=="-"){e.manip=d.charAt(b);e.target=d.substr(0,b)}else{e.manip="";e.target=d}if(!jQuery(e.target).size()){jQuery.ajaxifylog('Warning: Target "'+e.target+"\" couldn't be found.")}}if(e.manip=="+"){jQuery(e.target).append(c)}else{if(e.manip=="-"){jQuery(e.target).prepend(c)}else{jQuery(e.target).html(c)}}}})(jQuery);