(function(a){settings={duration:400,debug:false};methods={init:function(b){if(settings.debug){console.log("methods.init called");}data.frameWrapper=a("<div />",{id:"jfmFrameWrapper"});data.frame=a("<div />",{id:"jfmFrame"});$closeButton=a("<div />",{"class":"close-button"});$closeButton.bind("click.jfmContent",function(){methods.hide();});data.ajaxContent=a("<div />",{id:"ajaxContent"});data.frame.append($closeButton).append(data.ajaxContent).append('<br class="clearRight" />');a("body").append(data.frameWrapper).append(data.contentPane).append(data.frame);b.each(function(){$this=a(this);$this.bind("click.jfmContent",function(c){methods.show(c);return false;});});},show:function(f){if(settings.debug){console.log("methods.show called");}if(data.visible==false){data.visible=true;var d=f.currentTarget.href;$document=a(document);$window=a(window);data.oldX=f.pageX;data.oldY=f.pageY;a.get(d,function(h){a("div#ajaxContent").append(h);});data.contentPane.css("display","block");data.contentPane.bind("click.jfmContent",function(){methods.hide();});data.frameWrapper.css("display","block").css("top",data.oldY+"px").css("left",data.oldX+"px");data.frame.css("display","block").css("top",data.oldY+"px").css("left",data.oldX+"px");data.contentPane.height($document.height()).width($document.width());var e=$window.width()/2;var c=$window.height()/2;var b=($window.width()-e)/2;var g=($window.height()-c)/2+$window.scrollTop();data.frameWrapper.animate({height:c+"px",width:e+"px",left:b+"px",top:g+"px"},{duration:settings.duration});data.frame.animate({height:c+"px",width:e+"px",left:(b+20)+"px",top:(g+20)+"px"},{duration:settings.duration});a(window).bind("resize.jfmContent",function(){data.contentPane.height($document.height()).width($document.width());});a(window).bind("scroll.jfmContent",function(){data.contentPane.height($document.height()).width($document.width());});}},hide:function(){if(settings.debug){console.log("methods.hide called");}data.contentPane.unbind(".jfmContent");data.frame.animate({left:data.oldX,top:data.oldY,height:"1px",width:"1px"},{duration:settings.duration,step:null});data.frameWrapper.animate({left:data.oldX,top:data.oldY,height:"1px",width:"1px"},{duration:settings.duration,complete:function(){methods.clean();},step:null});},clean:function(){if(settings.debug){console.log("methods.clean called");}data.contentPane.css("display","none");data.frameWrapper.css("display","none");data.frame.css("display","none");data.ajaxContent.empty();data.oldX=null;data.oldY=null;data.visible=false;}};data={oldX:null,oldY:null,frame:null,contentPane:a("div#contentPane"),visible:false,ajaxContent:null,frameWrapper:null};a.fn.jfmContent=function(){methods.init(this);};})(jQuery);$(document).ready(function(){$("a.info").jfmContent();});
