$(function(){var q=navigator.userAgent.toLowerCase();var r=(q.match(/.+(?:rv|webkit|khtml|opera|msie)[\/: ]([\d.]+)/)||[0,'0'])[1];var s=(/msie/.test(q)&&!/opera/.test(q)&&parseInt(r)<7&&!window.XMLHttpRequest);var t=$('body');var u;var v=false;var x={};var y=false;var z;var A;var B={started:false,ready:false,dataReady:false,anim:false,animContent:false,loadingShown:false,transition:false,resizing:false,closing:false,error:false,blocker:null,blockerVars:null,full:null,bg:null,loading:null,tmp:null,content:null,wrapper:null,contentWrapper:null,scripts:new Array(),scriptsShown:new Array()};var C={width:false,height:false,windowResizing:false};var D={width:null,height:null,windowResizing:true};var E;$.fn.flyBox=function(b){if(!this)return false;return this.each(function(){var a=$(this);if(this.nodeName.toLowerCase()=='form'){a.unbind('submit.flyBox').bind('submit.flyBox',function(e){if(a.data('flyBoxprocessing'))return true;if(this.enctype=='multipart/form-data'){processModal($.extend(b,{from:this}));return true}e.preventDefault();processModal($.extend(b,{from:this}));return false})}else{a.unbind('click.flyBox').bind('click.flyBox',function(e){e.preventDefault();processModal($.extend(b,{from:this}));return false})}})};$.fn.flyBoxManual=function(a){if(!this.length)processModal(a);return this.each(function(){processModal($.extend(a,{from:this}))})};$.flyBoxManual=function(a){processModal(a)};$.flyBoxSettings=function(a,b,c){setCurrentSettings(a,b,c);if(!b&&B.started){if(B.bg&&a.bgColor)u.updateBgColor(B,u,function(){});if(B.contentWrapper&&a.title)setTitle();if(!B.error&&(a.windowResizing||(!B.resizing&&(('width'in a&&a.width==u.width)||('height'in a&&a.height==u.height))))){B.resizing=true;if(B.contentWrapper)calculateSize(true);if(B.contentWrapper&&B.contentWrapper.is(':visible')&&!B.animContent){if(y)B.content.css({position:''});u.resize(B,u,function(){u.windowResizing=false;B.resizing=false;if(y)B.content.css({position:'fixed'});if($.isFunction(u.endResize))u.endResize(B,u)})}}}};$.flyBoxRemove=function(){removeModal()};$.flyBoxNext=function(){var a=getGalleryLink(1);if(a)return a.flyBoxManual(getCurrentSettingsNew());return false};$.flyBoxPrev=function(){var a=getGalleryLink(-1);if(a)return a.flyBoxManual(getCurrentSettingsNew());return false};$.fn.flyBox.settings={debug:false,blocker:false,modal:true,type:'',forceType:null,from:'',hash:'',processHandler:null,selIndicator:'flyBoxSel',formIndicator:'flyBox',content:null,bgColor:'#000000',ajax:{},swf:{wmode:'transparent'},width:null,height:null,minWidth:400,minHeight:300,resizable:true,autoSizable:true,padding:25,regexImg:'[^\.]\.(jpg|jpeg|png|tiff|gif|bmp)\s*$',addImageDivTitle:false,defaultImgAlt:'Image',setWidthImgTitle:true,ltr:true,gallery:null,galleryLinks:'<a href="#" class="flyBoxPrev">Prev</a><a href="#"  class="flyBoxNext">Next</a>',galleryCounts:galleryCounts,zIndexStart:100,css:{bg:{position:'absolute',overflow:'hidden',top:0,left:0,height:'100%',width:'100%'},wrapper:{position:'absolute',top:'50%',left:'50%'},wrapper2:{},content:{overflow:'auto'},loading:{position:'absolute',top:'50%',left:'50%',marginTop:'-50px',marginLeft:'-50px'}},wrap:{div:'<div class="flyBoxContainer"></div>',ajax:'<div class="flyBoxContainer"></div>',form:'<div class="flyBoxContainer"></div>',formData:'<div class="flyBoxContainer"></div>',image:'<div class="flyBoxContainerImg"></div>',swf:'<div class="flyBoxContainerSwf"></div>',iframe:'<div class="flyBoxContainerIframe"></div>',iframeForm:'<div class="flyBoxContainerIframe"></div>',manual:'<div class="flyBoxContainer"></div>'},closeButton:'<a href="#" class="flyBoxClose" id="closeBut" title="close">Close</a>',title:null,titleFromIframe:true,openSelector:'.flyBox',closeSelector:'.flyBoxClose',contentLoading:'<a href="#" class="flyBoxClose">Cancel</a>',errorClass:'error',contentError:'The requested content cannot be loaded.<br />Please try again later.<br /><a href="#" class="flyBoxClose">Close</a>',handleError:null,showBackground:showBackground,hideBackground:hideBackground,endFillContent:null,showContent:showContent,endShowContent:null,beforeHideContent:null,hideContent:hideContent,showTransition:showTransition,hideTransition:hideTransition,showLoading:showLoading,hideLoading:hideLoading,resize:resize,endResize:null,updateBgColor:updateBgColor,endRemove:null};function processModal(c){if(B.loadingShown||B.transition||B.anim)return;debug('processModal');B.started=true;setDefaultCurrentSettings(c);if(!B.full)B.blockerVars=B.blocker=null;B.error=false;B.closing=false;B.dataReady=false;B.scripts=new Array();B.scriptsShown=new Array();u.type=fileType();if(u.forceType){if(!u.content)u.from=true;u.type=u.forceType;u.forceType=null}if($.isFunction(u.processHandler))u.processHandler(u);var d=u.from;var e=u.url;D.width=u.width;D.height=u.height;if(u.type=='swf'){setCurrentSettings({overflow:'hidden'},'css','content');u.content='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+u.width+'" height="'+u.height+'"><param name="movie" value="'+e+'"></param>';var f='';$.each(u.swf,function(a,b){u.content+='<param name="'+a+'" value="'+b+'"></param>';f+=' '+a+'="'+b+'"'});u.content+='<embed src="'+e+'" type="application/x-shockwave-flash" width="'+u.width+'" height="'+u.height+'"'+f+'></embed></object>'}if(d){var g=$(d).blur();if(u.type=='form'){var i=$(d).serializeArray();i.push({name:u.formIndicator,value:1});if(u.selector)i.push({name:u.selIndicator,value:u.selector.substring(1)});$.ajax($.extend({},u.ajax,{url:e,data:i,type:g.attr('method')?g.attr('method'):'get',success:ajaxLoaded,error:loadingError}));debug('Form Ajax Load: '+g.attr('action'));showModal()}else if(u.type=='formData'){initModal();g.attr('target','flyBoxIframe');g.attr('action',e);g.prepend('<input type="hidden" name="'+u.formIndicator+'" value="1" />');if(u.selector)g.prepend('<input type="hidden" name="'+u.selIndicator+'" value="'+u.selector.substring(1)+'" />');B.tmp.html('<iframe frameborder="0" hspace="0" name="flyBoxIframe" src="javascript:false;"></iframe>');$('iframe',B.tmp).css({width:u.width,height:u.height}).error(loadingError).load(formDataLoaded);debug('Form Data Load: '+g.attr('action'));showModal();showContentOrLoading()}else if(u.type=='image'){debug('Image Load: '+e);var j=g.attr('title')||u.defaultImgAlt;initModal();B.tmp.html('<img id="flyBoxImg" />').find('img').attr('alt',j);B.tmp.css({lineHeight:0});$('img',B.tmp).error(loadingError).load(function(){debug('Image Loaded: '+this.src);$(this).unbind('load');var w=B.tmp.width();var h=B.tmp.height();B.tmp.css({lineHeight:''});C.width=w;C.height=h;setCurrentSettings({width:w,height:h,imgWidth:w,imgHeight:h});D.width=w;D.height=h;setCurrentSettings({overflow:'hidden'},'css','content');B.dataReady=true;if(B.loadingShown||B.transition)showContentOrLoading()}).attr('src',e);showModal()}else if(u.type=='iframeForm'){initModal();B.tmp.html('<iframe frameborder="0" hspace="0" src="javascript:false;" name="flyBoxIframe" id="flyBoxIframe"></iframe>');debug('Iframe Form Load: '+e);$('iframe',B.tmp).eq(0).css({width:'100%',height:$.support.boxModel?'99%':'100%'}).load(iframeLoaded);B.dataReady=true;showModal()}else if(u.type=='iframe'){initModal();B.tmp.html('<iframe frameborder="0" hspace="0" src="javascript:false;" name="flyBoxIframe" id="flyBoxIframe"></iframe>');debug('Iframe Load: '+e);$('iframe',B.tmp).eq(0).css({width:'100%',height:$.support.boxModel?'99%':'100%'}).load(iframeLoaded);B.dataReady=true;showModal()}else if(u.type){debug('Content: '+u.type);initModal();B.tmp.html(u.content);var w=B.tmp.width();var h=B.tmp.height();var k=$(u.type);if(k.length){setCurrentSettings({type:'div'});w=k.width();h=k.height();if(z)A=z;z=k;B.tmp.append(k.contents())}D.width=w;D.height=h;setCurrentSettings({width:w,height:h});if(B.tmp.html())B.dataReady=true;else loadingError();if(!B.ready)showModal();else endHideContent()}else{debug('Ajax Load: '+e);setCurrentSettings({type:'ajax'});var i=u.ajax.data||{};if(u.selector){if(typeof i=="string"){i+='&'+u.selIndicator+'='+u.selector.substring(1)}else{i[u.selIndicator]=u.selector.substring(1)}}$.ajax($.extend(true,u.ajax,{url:e,success:ajaxLoaded,error:loadingError,data:i}));showModal()}}else if(u.content){debug('Content: '+u.type);setCurrentSettings({type:'manual'});initModal();B.tmp.html($('<div/>').html(u.content).contents());if(B.tmp.html())B.dataReady=true;else loadingError();showModal()}else{}}function setDefaultCurrentSettings(a){debug('setDefaultCurrentSettings');u=$.extend(true,{},$.fn.flyBox.settings,a);u.selector='';u.borderW=0;u.borderH=0;u.resizable=true;setMargin()}function setCurrentSettings(a,b,c){if(B.started){if(b&&c){$.extend(true,u[b][c],a)}else if(b){$.extend(true,u[b],a)}else{if(B.animContent){if('width'in a){if(!B.resizing){a.setWidth=a.width;v=true}delete a['width']}if('height'in a){if(!B.resizing){a.setHeight=a.height;v=true}delete a['height']}}$.extend(true,u,a)}}else{if(b&&c){$.extend(true,$.fn.flyBox.settings[b][c],a)}else if(b){$.extend(true,$.fn.flyBox.settings[b],a)}else{$.extend(true,$.fn.flyBox.settings,a)}}}function setMarginScroll(){if(s&&!B.blocker){if(document.documentElement){u.marginScrollLeft=document.documentElement.scrollLeft;u.marginScrollTop=document.documentElement.scrollTop}else{u.marginScrollLeft=document.body.scrollLeft;u.marginScrollTop=document.body.scrollTop}}else{u.marginScrollLeft=0;u.marginScrollTop=0}}function setMargin(){setMarginScroll();u.marginLeft=-(u.width+u.borderW)/2;u.marginTop=-(u.height+u.borderH)/2;if(!B.blocker){u.marginLeft+=u.marginScrollLeft;u.marginTop+=u.marginScrollTop}}function setMarginLoading(){setMarginScroll();var a=getOuter(B.loading);u.marginTopLoading=-(B.loading.height()+a.h.border+a.h.padding)/2;u.marginLeftLoading=-(B.loading.width()+a.w.border+a.w.padding)/2;if(!B.blocker){u.marginLefttLoading+=u.marginScrollLeft;u.marginTopLoading+=u.marginScrollTop}}function setTitle(){var a=$('h1#flyBoxTitle',B.contentWrapper);if(a.length)a.text(u.title);else B.contentWrapper.prepend('<h1 id="flyBoxTitle">'+u.title+'</h1>')}function initModal(){debug('initModal');if(!B.full){if(u.debug)setCurrentSettings({color:'white'},'css','bg');var b={zIndex:u.zIndexStart,position:'fixed',top:0,left:0,width:'100%',height:'100%'};var c=t;var f='';if(u.blocker){B.blocker=c=$(u.blocker);var g=B.blocker.offset();var w=B.blocker.outerWidth();var h=B.blocker.outerHeight();if(s){setCurrentSettings({height:'100%',width:'100%',top:0,left:0},'css','bg')}B.blockerVars={top:g.top,left:g.left,width:w,height:h};var i=(/msie/.test(q)?0:getCurCSS(t.get(0),'borderTopWidth'));var j=(/msie/.test(q)?0:getCurCSS(t.get(0),'borderLeftWidth'));b={position:'absolute',top:g.top+i,left:g.left+j,width:w,height:h}}else if(s){t.css({height:t.height()+'px',width:t.width()+'px',position:'static',overflow:'hidden'});$('html').css({overflow:'hidden'});setCurrentSettings({css:{bg:{position:'absolute',zIndex:u.zIndexStart+1,height:'110%',width:'110%',top:u.marginScrollTop+'px',left:u.marginScrollLeft+'px'},wrapper:{zIndex:u.zIndexStart+2},loading:{zIndex:u.zIndexStart+3}}});f=$('<iframe id="flyBoxIframeHideIe" src="javascript:false;"></iframe>').css($.extend({},u.css.bg,{opacity:0,zIndex:50,border:'none'}))}c.append($('<div id="flyBoxFull"><div id="flyBoxBg"></div><div id="flyBoxWrapper"><div id="flyBoxContent"></div></div><div id="nyrModalTmp"></div><div id="flyBoxLoading"></div></div>').hide());B.full=$('#flyBoxFull').css(b).show();B.bg=$('#flyBoxBg').css($.extend({backgroundColor:u.bgColor},u.css.bg)).before(f);if(!u.modal)B.bg.click(removeModal);B.loading=$('#flyBoxLoading').css(u.css.loading).hide();B.contentWrapper=$('#flyBoxWrapper').css(u.css.wrapper).hide();B.content=$('#flyBoxContent');B.tmp=$('#nyrModalTmp').hide();if($.isFunction($.fn.mousewheel)){B.content.mousewheel(function(e,d){var a=B.content.get(0);if((d>0&&a.scrollTop==0)||(d<0&&a.scrollHeight-a.scrollTop==a.clientHeight)){e.preventDefault();e.stopPropagation()}})}$(document).bind('keydown.flyBox',keyHandler);B.content.css({width:'auto',height:'auto'});B.contentWrapper.css({width:'auto',height:'auto'});if(!u.blocker){$(window).bind('resize.flyBox',function(){window.clearTimeout(E);E=window.setTimeout(windowResizeHandler,200)})}}}function windowResizeHandler(){$.flyBoxSettings(D)}function showModal(){debug('showModal');if(!B.ready){initModal();B.anim=true;u.showBackground(B,u,endBackground)}else{B.anim=true;B.transition=true;u.showTransition(B,u,function(){endHideContent();B.anim=false;showContentOrLoading()})}}function keyHandler(e){if(e.keyCode==27){if(!u.modal)removeModal()}else if(u.gallery&&B.ready&&B.dataReady&&!B.anim&&!B.transition){if(e.keyCode==39||e.keyCode==40){e.preventDefault();$.flyBoxNext();return false}else if(e.keyCode==37||e.keyCode==38){e.preventDefault();$.flyBoxPrev();return false}}}function fileType(){var a=u.from;var b;if(a&&a.nodeName){var c=$(a);b=c.attr(a.nodeName.toLowerCase()=='form'?'action':'href');if(!b)b=location.href.substring(window.location.host.length+7);u.url=b;if(c.attr('rev')=='modal')u.modal=true;u.title=c.attr('title');if(a&&a.rel&&a.rel.toLowerCase()!='nofollow'){var d=a.rel.indexOf(' ');u.gallery=d>0?a.rel.substr(0,d):a.rel}var e=imageType(b,a);if(e)return e;if(isSwf(b))return'swf';var f=false;if(a.target&&a.target.toLowerCase()=='_blank'||(a.hostname&&a.hostname.replace(/:\d*$/,'')!=window.location.hostname.replace(/:\d*$/,''))){f=true}if(a.nodeName.toLowerCase()=='form'){if(f)return'iframeForm';setCurrentSettings(extractUrlSel(b));if(c.attr('enctype')=='multipart/form-data')return'formData';return'form'}if(f)return'iframe'}else{b=u.url;if(!u.content)u.from=true;if(!b)return null;if(isSwf(b))return'swf';var g=new RegExp("^http://","g");if(b.match(g))return'iframe'}var e=imageType(b,a);if(e)return e;var h=extractUrlSel(b);setCurrentSettings(h);if(!h.url)return h.selector}function imageType(a,b){var c=new RegExp(u.regexImg,'i');if(c.test(a)){return'image'}}function isSwf(a){var b=new RegExp('[^\.]\.(swf)\s*$','i');return b.test(a)}function extractUrlSel(a){var b={url:null,selector:null};if(a){var c=getHash(a);var d=getHash(window.location.href);var e=window.location.href.substring(0,window.location.href.length-d.length);var f=a.substring(0,a.length-c.length);if(f==e||f==$('base').attr('href')){b.selector=c}else{b.url=f;b.selector=c}}return b}function loadingError(){debug('loadingError');B.error=true;if(!B.ready)return;if($.isFunction(u.handleError))u.handleError(B,u);B.loading.addClass(u.errorClass).html(u.contentError);$(u.closeSelector,B.loading).unbind('click.flyBox').bind('click.flyBox',removeModal);setMarginLoading();B.loading.css({marginTop:u.marginTopLoading+'px',marginLeft:u.marginLeftLoading+'px'})}function fillContent(){debug('fillContent');if(!B.tmp.html())return;B.content.html(B.tmp.contents());B.tmp.empty();wrapContent();if(u.type=='iframeForm'){$(u.from).attr('target','flyBoxIframe').data('flyBoxprocessing',1).submit().attr('target','_blank').removeData('flyBoxprocessing')}/*if(!u.modal)*/B.wrapper.prepend(u.closeButton);if($.isFunction(u.endFillContent))u.endFillContent(B,u);B.content.append(B.scripts);$(u.closeSelector,B.contentWrapper).unbind('click.flyBox').bind('click.flyBox',removeModal);$(u.openSelector,B.contentWrapper).flyBox(getCurrentSettingsNew())}function getCurrentSettingsNew(){var a=$.extend(true,{},u);if(C.width)a.width=null;else a.width=D.width;if(C.height)a.height=null;else a.height=D.height;a.css.content.overflow='auto';return a}function wrapContent(){debug('wrapContent');var a=$(u.wrap[u.type]);B.content.append(a.children().remove());B.contentWrapper.wrapInner(a);if(u.gallery){B.content.append(u.galleryLinks);x.links=$('[rel*="'+u.gallery+'"]');x.index=x.links.index(u.from);if(u.galleryCounts&&$.isFunction(u.galleryCounts))u.galleryCounts(x.index+1,x.links.length,B,u);var b=getCurrentSettingsNew();var c=getGalleryLink(-1);if(c){var d=$('.flyBoxPrev',B.contentWrapper).attr('href',c.attr('href')).click(function(e){e.preventDefault();$.flyBoxPrev();return false});if(s&&u.type=='swf'){d.before($('<iframe id="flyBoxIframeHideIeGalleryPrev" src="javascript:false;"></iframe>').css({position:d.css('position'),top:d.css('top'),left:d.css('left'),width:d.width(),height:d.height(),opacity:0,border:'none'}))}}else{$('.flyBoxPrev',B.contentWrapper).remove()}var f=getGalleryLink(1);if(f){var g=$('.flyBoxNext',B.contentWrapper).attr('href',f.attr('href')).click(function(e){e.preventDefault();$.flyBoxNext();return false});if(s&&u.type=='swf'){g.before($('<iframe id="flyBoxIframeHideIeGalleryNext" src="javascript:false;"></iframe>').css($.extend({},{position:g.css('position'),top:g.css('top'),left:g.css('left'),width:g.width(),height:g.height(),opacity:0,border:'none'})))}}else{$('.flyBoxNext',B.contentWrapper).remove()}}calculateSize()}function getGalleryLink(a){if(u.gallery){if(!u.ltr)a*=-1;var b=x.index+a;if(b>=0&&b<x.links.length)return x.links.eq(b)}return false}function calculateSize(a){debug('calculateSize');B.wrapper=B.contentWrapper.children('div:first');C.width=false;C.height=false;if(false&&!u.windowResizing){D.width=u.width;D.height=u.height}if(u.autoSizable&&(!u.width||!u.height)){B.contentWrapper.css({opacity:0,width:'auto',height:'auto'}).show();var b={width:'auto',height:'auto'};if(u.width){b.width=u.width}else if(u.type=='iframe'){b.width=u.minWidth}if(u.height){b.height=u.height}else if(u.type=='iframe'){b.height=u.minHeight}B.content.css(b);if(!u.width){u.width=B.content.outerWidth(true);C.width=true}if(!u.height){u.height=B.content.outerHeight(true);C.height=true}B.contentWrapper.css({opacity:1});if(!a)B.contentWrapper.hide()}if(u.type!='image'&&u.type!='swf'){u.width=Math.max(u.width,u.minWidth);u.height=Math.max(u.height,u.minHeight)}var c=getOuter(B.contentWrapper);var d=getOuter(B.wrapper);var e=getOuter(B.content);var b={content:{width:u.width,height:u.height},wrapper2:{width:u.width+e.w.total,height:u.height+e.h.total},wrapper:{width:u.width+e.w.total+d.w.total,height:u.height+e.h.total+d.h.total}};if(u.resizable){var f=B.blockerVars?B.blockerVars.height:$(window).height()-c.h.border-(b.wrapper.height-u.height);var g=B.blockerVars?B.blockerVars.width:$(window).width()-c.w.border-(b.wrapper.width-u.width);f-=u.padding*2;g-=u.padding*2;if(b.content.height>f||b.content.width>g){if(u.type=='image'||u.type=='swf'){var h=u.imgWidth?u.imgWidth:u.width;var i=u.imgHeight?u.imgHeight:u.height;var j=b.content.width-h;var k=b.content.height-i;if(k<0)k=0;if(j<0)j=0;var l=f-k;var m=g-j;var n=Math.min(l/i,m/h);m=Math.floor(h*n);l=Math.floor(i*n);b.content.height=l+k;b.content.width=m+j}else{b.content.height=Math.min(b.content.height,f);b.content.width=Math.min(b.content.width,g)}b.wrapper2={width:b.content.width+e.w.total,height:b.content.height+e.h.total};b.wrapper={width:b.content.width+e.w.total+d.w.total,height:b.content.height+e.h.total+d.h.total}}}if(u.type=='swf'){$('object, embed',B.content).attr('width',b.content.width).attr('height',b.content.height)}else if(u.type=='image'){$('img',B.content).css({width:b.content.width,height:b.content.height})}B.content.css($.extend({},b.content,u.css.content));B.wrapper.css($.extend({},b.wrapper2,u.css.wrapper2));if(!a)B.contentWrapper.css($.extend({},b.wrapper,u.css.wrapper));if(u.type=='image'&&u.addImageDivTitle){$('img',B.content).removeAttr('alt');var o=$('div',B.content);if(u.title!=u.defaultImgAlt&&u.title){if(o.length==0){o=$('<div>'+u.title+'</div>');B.content.append(o)}if(u.setWidthImgTitle){var p=getOuter(o);o.css({width:(b.content.width+e.w.padding-p.w.total)+'px'})}}else if(o.length=0){o.remove()}}if(u.title)setTitle();b.wrapper.borderW=c.w.border;b.wrapper.borderH=c.h.border;setCurrentSettings(b.wrapper);setMargin()}function removeModal(e){debug('removeModal');if(e)e.preventDefault();if(B.full&&B.ready){$(document).unbind('keydown.flyBox');if(!u.blocker)$(window).unbind('resize.flyBox');B.ready=false;B.anim=true;B.closing=true;if(B.loadingShown||B.transition){u.hideLoading(B,u,function(){B.loading.hide();B.loadingShown=false;B.transition=false;u.hideBackground(B,u,endRemove)})}else{if(y)B.content.css({position:''});B.wrapper.css({overflow:'hidden'});B.content.css({overflow:'hidden'});if($.isFunction(u.beforeHideContent)){u.beforeHideContent(B,u,function(){u.hideContent(B,u,function(){endHideContent();u.hideBackground(B,u,endRemove)})})}else{u.hideContent(B,u,function(){endHideContent();u.hideBackground(B,u,endRemove)})}}}if(e)return false}function showContentOrLoading(){debug('showContentOrLoading');if(B.ready&&!B.anim){if(B.dataReady){if(B.tmp.html()){B.anim=true;if(B.transition){fillContent();B.animContent=true;u.hideTransition(B,u,function(){B.loading.hide();B.transition=false;B.loadingShown=false;endShowContent()})}else{u.hideLoading(B,u,function(){B.loading.hide();B.loadingShown=false;fillContent();setMarginLoading();setMargin();B.animContent=true;u.showContent(B,u,endShowContent)})}}}else if(!B.loadingShown&&!B.transition){B.anim=true;B.loadingShown=true;if(B.error)loadingError();else B.loading.html(u.contentLoading);$(u.closeSelector,B.loading).unbind('click.flyBox').bind('click.flyBox',removeModal);setMarginLoading();u.showLoading(B,u,function(){B.anim=false;showContentOrLoading()})}}}function ajaxLoaded(a){debug('AjaxLoaded: '+this.url);B.tmp.html(u.selector?filterScripts($('<div>'+a+'</div>').find(u.selector).contents()):filterScripts(a));if(B.tmp.html()){B.dataReady=true;showContentOrLoading()}else loadingError()}function formDataLoaded(){debug('formDataLoaded');var a=$(u.from);a.attr('action',a.attr('action')+u.selector);a.attr('target','');$('input[name='+u.formIndicator+']',u.from).remove();var b=B.tmp.children('iframe');var c=b.unbind('load').contents().find(u.selector||'body').not('script[src]');b.attr('src','about:blank');B.tmp.html(c.html());if(B.tmp.html()){B.dataReady=true;showContentOrLoading()}else loadingError()}function iframeLoaded(){if((window.location.hostname&&u.url.indexOf(window.location.hostname)>-1)||u.url.indexOf('http://')){var a=$('iframe',B.full).contents();var b={};if(u.titleFromIframe)b.title=a.find('title').text();if(!b.title){try{b.title=a.find('title').html()}catch(err){}}var c=a.find('body');if(!u.height&&c.height())b.height=c.height();if(!u.width&&c.width())b.width=c.width();$.extend(D,b);$.flyBoxSettings(b)}}function galleryCounts(a,b,c,d){if(b>1)d.title+=(d.title?' - ':'')+a+'/'+b}function endHideContent(){debug('endHideContent');B.anim=false;if(A){A.append(B.content.contents());A=null}else if(z){z.append(B.content.contents());z=null}B.content.empty();x={};B.contentWrapper.hide().children().remove().empty().attr('style','').hide();if(B.closing||B.transition)B.contentWrapper.hide();B.contentWrapper.css(u.css.wrapper).append(B.content);showContentOrLoading()}function endRemove(){debug('endRemove');$(document).unbind('keydown',keyHandler);B.anim=false;B.full.remove();B.full=null;if(s){t.css({height:'',width:'',position:'',overflow:''});$('html').css({overflow:''})}if($.isFunction(u.endRemove))u.endRemove(B,u)}function endBackground(){debug('endBackground');B.ready=true;B.anim=false;showContentOrLoading()}function endShowContent(){debug('endShowContent');B.anim=false;B.animContent=false;B.contentWrapper.css({opacity:''});y=/mozilla/.test(q)&&!/(compatible|webkit)/.test(q)&&parseFloat(r)<1.9&&u.type!='image';if(y)B.content.css({position:'fixed'});B.content.append(B.scriptsShown);if(u.type=='iframe')B.content.find('iframe').attr('src',u.url);if($.isFunction(u.endShowContent))u.endShowContent(B,u);if(v){v=false;$.flyBoxSettings({width:u.setWidth,height:u.setHeight});delete u['setWidth'];delete u['setHeight']}if(C.width)setCurrentSettings({width:null});if(C.height)setCurrentSettings({height:null})}function getHash(a){if(typeof a=='string'){var b=a.indexOf('#');if(b>-1)return a.substring(b)}return''}function filterScripts(a){if(typeof a=='string')a=a.replace(/<\/?(html|head|body)([^>]*)>/gi,'');var b=new Array();$.each($.clean({0:a},this.ownerDocument),function(){if($.nodeName(this,"script")){if(!this.src||$(this).attr('rel')=='forceLoad'){if($(this).attr('rev')=='shown')B.scriptsShown.push(this);else B.scripts.push(this)}}else b.push(this)});return b}function getOuter(a){a=a.get(0);var b={h:{margin:getCurCSS(a,'marginTop')+getCurCSS(a,'marginBottom'),border:getCurCSS(a,'borderTopWidth')+getCurCSS(a,'borderBottomWidth'),padding:getCurCSS(a,'paddingTop')+getCurCSS(a,'paddingBottom')},w:{margin:getCurCSS(a,'marginLeft')+getCurCSS(a,'marginRight'),border:getCurCSS(a,'borderLeftWidth')+getCurCSS(a,'borderRightWidth'),padding:getCurCSS(a,'paddingLeft')+getCurCSS(a,'paddingRight')}};b.h.outer=b.h.margin+b.h.border;b.w.outer=b.w.margin+b.w.border;b.h.inner=b.h.padding+b.h.border;b.w.inner=b.w.padding+b.w.border;b.h.total=b.h.outer+b.h.padding;b.w.total=b.w.outer+b.w.padding;return b}function getCurCSS(a,b){var c=parseInt($.curCSS(a,b,true));if(isNaN(c))c=0;return c}function debug(a){if($.fn.flyBox.settings.debug||u&&u.debug)flyBoxDebug(a,B,u||{})}function showBackground(a,b,c){a.bg.css({opacity:0}).fadeTo(500,0.75,c)}function hideBackground(a,b,c){a.bg.fadeOut(300,c)}function showLoading(a,b,c){a.loading.css({marginTop:b.marginTopLoading+'px',marginLeft:b.marginLeftLoading+'px',opacity:0}).show().animate({opacity:1},{complete:c,duration:400})}function hideLoading(a,b,c){c()}function showContent(a,b,c){a.loading.css({marginTop:b.marginTopLoading+'px',marginLeft:b.marginLeftLoading+'px'}).show().animate({width:b.width+'px',height:b.height+'px',marginTop:b.marginTop+'px',marginLeft:b.marginLeft+'px'},{duration:350,complete:function(){a.contentWrapper.css({width:b.width+'px',height:b.height+'px',marginTop:b.marginTop+'px',marginLeft:b.marginLeft+'px'}).show();a.loading.fadeOut(200,c)}})}function hideContent(a,b,c){a.contentWrapper.animate({height:'50px',width:'50px',marginTop:(-(25+b.borderH)/2+b.marginScrollTop)+'px',marginLeft:(-(25+b.borderW)/2+b.marginScrollLeft)+'px'},{duration:350,complete:function(){a.contentWrapper.hide();c()}})}function showTransition(a,b,c){a.loading.css({marginTop:a.contentWrapper.css('marginTop'),marginLeft:a.contentWrapper.css('marginLeft'),height:a.contentWrapper.css('height'),width:a.contentWrapper.css('width'),opacity:0}).show().fadeTo(400,1,function(){a.contentWrapper.hide();c()})}function hideTransition(a,b,c){a.contentWrapper.hide().css({width:b.width+'px',height:b.height+'px',marginLeft:b.marginLeft+'px',marginTop:b.marginTop+'px',opacity:1});a.loading.animate({width:b.width+'px',height:b.height+'px',marginLeft:b.marginLeft+'px',marginTop:b.marginTop+'px'},{complete:function(){a.contentWrapper.show();a.loading.fadeOut(400,function(){a.loading.hide();c()})},duration:350})}function resize(a,b,c){a.contentWrapper.animate({width:b.width+'px',height:b.height+'px',marginLeft:b.marginLeft+'px',marginTop:b.marginTop+'px'},{complete:c,duration:400})}function updateBgColor(a,b,c){if(!$.fx.step.backgroundColor){a.bg.css({backgroundColor:b.bgColor});c()}else a.bg.animate({backgroundColor:b.bgColor},{complete:c,duration:400})}$($.fn.flyBox.settings.openSelector).flyBox(); });  function flyBoxDebug(a,b,c){if(b.full)b.bg.prepend(a+'<br />')}

