(function(jQuery,originalAnimateMethod,originalStopMethod){var cssTransitionProperties=["top","right","bottom","left","opacity","height","width"],directions=["top","right","bottom","left"],cssPrefixes=["","-webkit-","-moz-","-o-"],pluginOptions=["avoidTransforms","useTranslate3d","leaveTransforms"],rfxnum=/^([+-]=)?([\d+-.]+)(.*)$/,rupper=/([A-Z])/g,defaultEnhanceData={secondary:{},meta:{top:0,right:0,bottom:0,left:0}},DATA_KEY='jQe',CUBIC_BEZIER_OPEN='cubic-bezier(',CUBIC_BEZIER_CLOSE=')',use3DByDefault=false,originalAnimatedFilter=null;var thisBody=document.body||document.documentElement,thisStyle=thisBody.style,transitionEndEvent=(thisStyle.WebkitTransition!==undefined)?"webkitTransitionEnd":(thisStyle.OTransition!==undefined)?"oTransitionEnd":"transitionend",cssTransitionsSupported=thisStyle.WebkitTransition!==undefined||thisStyle.MozTransition!==undefined||thisStyle.OTransition!==undefined||thisStyle.transition!==undefined,has3D=use3DByDefault=('WebKitCSSMatrix'in window&&'m11'in new WebKitCSSMatrix());if(jQuery.expr&&jQuery.expr.filters){originalAnimatedFilter=jQuery.expr.filters.animated;jQuery.expr.filters.animated=function(elem){return jQuery(elem).data('events')&&jQuery(elem).data('events')[transitionEndEvent]?true:originalAnimatedFilter.call(this,elem);}}
function _interpretValue(e,val,prop,isTransform){var parts=rfxnum.exec(val),start=e.css(prop)==="auto"?0:e.css(prop),cleanCSSStart=typeof start=="string"?_cleanValue(start):start,cleanTarget=typeof val=="string"?_cleanValue(val):val,cleanStart=isTransform===true?0:cleanCSSStart,hidden=e.is(":hidden"),translation=e.translation();if(prop=="left")cleanStart=parseInt(cleanCSSStart,10)+translation.x;if(prop=="right")cleanStart=parseInt(cleanCSSStart,10)+translation.x;if(prop=="top")cleanStart=parseInt(cleanCSSStart,10)+translation.y;if(prop=="bottom")cleanStart=parseInt(cleanCSSStart,10)+translation.y;if(!parts&&val=="show"){cleanStart=1;if(hidden)e.css({'display':'block','opacity':0});}else if(!parts&&val=="hide"){cleanStart=0;}
if(parts){var end=parseFloat(parts[2]);if(parts[1])end=((parts[1]==="-="?-1:1)*end)+parseInt(cleanStart,10);return end;}else{return cleanStart;}};function _getTranslation(x,y,use3D){return((use3D===true||(use3DByDefault==true&&use3D!=false))&&has3D)?"translate3d("+x+"px,"+y+"px,0)":"translate("+x+"px,"+y+"px)";};function _applyCSSTransition(e,property,duration,easing,value,isTransform,isTranslatable,use3D){var enhanceData=e.data(DATA_KEY)?!_isEmptyObject(e.data(DATA_KEY))?e.data(DATA_KEY):jQuery.extend(true,{},defaultEnhanceData):jQuery.extend(true,{},defaultEnhanceData),offsetPosition=value,isDirection=jQuery.inArray(property,directions)>-1;if(isDirection){var meta=enhanceData.meta,cleanPropertyValue=_cleanValue(e.css(property))||0,stashedProperty=property+"_o";offsetPosition=value-cleanPropertyValue;meta[property]=offsetPosition;meta[stashedProperty]=e.css(property)=="auto"?0+offsetPosition:cleanPropertyValue+offsetPosition||0;enhanceData.meta=meta;if(isTranslatable&&offsetPosition===0){offsetPosition=0-meta[stashedProperty];meta[property]=offsetPosition;meta[stashedProperty]=0;}}
return e.data(DATA_KEY,_applyCSSWithPrefix(enhanceData,property,duration,easing,offsetPosition,isTransform,isTranslatable,use3D));};function _applyCSSWithPrefix(cssProperties,property,duration,easing,value,isTransform,isTranslatable,use3D){cssProperties=typeof cssProperties==='undefined'?{}:cssProperties;cssProperties.secondary=typeof cssProperties.secondary==='undefined'?{}:cssProperties.secondary;for(var i=cssPrefixes.length-1;i>=0;i--){if(typeof cssProperties[cssPrefixes[i]+'transition-property']==='undefined')cssProperties[cssPrefixes[i]+'transition-property']='';cssProperties[cssPrefixes[i]+'transition-property']+=', '+((isTransform===true&&isTranslatable===true)?cssPrefixes[i]+'transform':property);cssProperties[cssPrefixes[i]+'transition-duration']=duration+'ms';cssProperties[cssPrefixes[i]+'transition-timing-function']=easing;cssProperties.secondary[((isTransform===true&&isTranslatable===true)?cssPrefixes[i]+'transform':property)]=(isTransform===true&&isTranslatable===true)?_getTranslation(cssProperties.meta.left,cssProperties.meta.top,use3D):value;};return cssProperties;};function _isBoxShortcut(prop){for(var property in prop){if((property=="width"||property=="height")&&(prop[property]=="show"||prop[property]=="hide"||prop[property]=="toggle")){return true;}}
return false;};function _isEmptyObject(obj){for(var i in obj)return false;return true;};function _cleanValue(val){return parseFloat(val.replace(/px/i,''));};function _appropriateProperty(prop,value,element){var is=jQuery.inArray(prop,cssTransitionProperties)>-1;if((prop=='width'||prop=='height')&&(value===parseFloat(element.css(prop))))is=false;return is;};jQuery.extend({toggle3DByDefault:function(){use3DByDefault=!use3DByDefault;}});jQuery.fn.translation=function(){if(!this[0]){return null;}
var elem=this[0],cStyle=window.getComputedStyle(elem,null),translation={x:0,y:0};for(var i=cssPrefixes.length-1;i>=0;i--){var transform=cStyle.getPropertyValue(cssPrefixes[i]+"transform");if(transform&&(/matrix/i).test(transform)){var explodedMatrix=transform.replace(/^matrix\(/i,'').split(/, |\)$/g);translation={x:parseInt(explodedMatrix[4],10),y:parseInt(explodedMatrix[5],10)};break;}}
return translation;};jQuery.fn.animate=function(prop,speed,easing,callback){prop=prop||{};var isTranslatable=!(typeof prop["bottom"]!=="undefined"||typeof prop["right"]!=="undefined"),optall=jQuery.speed(speed,easing,callback),elements=this,callbackQueue=0,propertyCallback=function(){callbackQueue--;if(callbackQueue===0){if(typeof optall.complete==='function'){optall.complete.apply(elements[0],arguments);}}};if(!cssTransitionsSupported||_isEmptyObject(prop)||_isBoxShortcut(prop)||optall.duration<=0||(jQuery.fn.animate.defaults.avoidTransforms===true&&prop['avoidTransforms']!==false)){return originalAnimateMethod.apply(this,arguments);}
return this[optall.queue===true?"queue":"each"](function(){var self=jQuery(this),opt=jQuery.extend({},optall),cssCallback=function(){var reset={};for(var i=cssPrefixes.length-1;i>=0;i--){reset[cssPrefixes[i]+'transition-property']='none';reset[cssPrefixes[i]+'transition-duration']='';reset[cssPrefixes[i]+'transition-timing-function']='';};self.unbind(transitionEndEvent);if(!prop.leaveTransforms===true){var props=self.data(DATA_KEY)||{},restore={};for(i=cssPrefixes.length-1;i>=0;i--){restore[cssPrefixes[i]+'transform']='';}
if(isTranslatable&&typeof props.meta!=='undefined'){for(var j=0,dir;dir=directions[j];++j){restore[dir]=props.meta[dir+"_o"]+"px";}}
self.css(reset).css(restore);}
if(prop.opacity==='hide'){self.css('display','none');}
self.data(DATA_KEY,null);propertyCallback.call(self);},easings={bounce:CUBIC_BEZIER_OPEN+'0.0, 0.35, .5, 1.3'+CUBIC_BEZIER_CLOSE,linear:'linear',swing:'ease-in-out',easeInQuad:CUBIC_BEZIER_OPEN+'0.550, 0.085, 0.680, 0.530'+CUBIC_BEZIER_CLOSE,easeInCubic:CUBIC_BEZIER_OPEN+'0.550, 0.055, 0.675, 0.190'+CUBIC_BEZIER_CLOSE,easeInQuart:CUBIC_BEZIER_OPEN+'0.895, 0.030, 0.685, 0.220'+CUBIC_BEZIER_CLOSE,easeInQuint:CUBIC_BEZIER_OPEN+'0.755, 0.050, 0.855, 0.060'+CUBIC_BEZIER_CLOSE,easeInSine:CUBIC_BEZIER_OPEN+'0.470, 0.000, 0.745, 0.715'+CUBIC_BEZIER_CLOSE,easeInExpo:CUBIC_BEZIER_OPEN+'0.950, 0.050, 0.795, 0.035'+CUBIC_BEZIER_CLOSE,easeInCirc:CUBIC_BEZIER_OPEN+'0.600, 0.040, 0.980, 0.335'+CUBIC_BEZIER_CLOSE,easeOutQuad:CUBIC_BEZIER_OPEN+'0.250, 0.460, 0.450, 0.940'+CUBIC_BEZIER_CLOSE,easeOutCubic:CUBIC_BEZIER_OPEN+'0.215, 0.610, 0.355, 1.000'+CUBIC_BEZIER_CLOSE,easeOutQuart:CUBIC_BEZIER_OPEN+'0.165, 0.840, 0.440, 1.000'+CUBIC_BEZIER_CLOSE,easeOutQuint:CUBIC_BEZIER_OPEN+'0.230, 1.000, 0.320, 1.000'+CUBIC_BEZIER_CLOSE,easeOutSine:CUBIC_BEZIER_OPEN+'0.390, 0.575, 0.565, 1.000'+CUBIC_BEZIER_CLOSE,easeOutExpo:CUBIC_BEZIER_OPEN+'0.190, 1.000, 0.220, 1.000'+CUBIC_BEZIER_CLOSE,easeOutCirc:CUBIC_BEZIER_OPEN+'0.075, 0.820, 0.165, 1.000'+CUBIC_BEZIER_CLOSE,easeInOutQuad:CUBIC_BEZIER_OPEN+'0.455, 0.030, 0.515, 0.955'+CUBIC_BEZIER_CLOSE,easeInOutCubic:CUBIC_BEZIER_OPEN+'0.645, 0.045, 0.355, 1.000'+CUBIC_BEZIER_CLOSE,easeInOutQuart:CUBIC_BEZIER_OPEN+'0.770, 0.000, 0.175, 1.000'+CUBIC_BEZIER_CLOSE,easeInOutQuint:CUBIC_BEZIER_OPEN+'0.860, 0.000, 0.070, 1.000'+CUBIC_BEZIER_CLOSE,easeInOutSine:CUBIC_BEZIER_OPEN+'0.445, 0.050, 0.550, 0.950'+CUBIC_BEZIER_CLOSE,easeInOutExpo:CUBIC_BEZIER_OPEN+'1.000, 0.000, 0.000, 1.000'+CUBIC_BEZIER_CLOSE,easeInOutCirc:CUBIC_BEZIER_OPEN+'0.785, 0.135, 0.150, 0.860'+CUBIC_BEZIER_CLOSE},domProperties={},cssEasing=easings[opt.easing||"swing"]?easings[opt.easing||"swing"]:opt.easing||"swing";for(var p in prop){if(jQuery.inArray(p,pluginOptions)===-1){var isDirection=jQuery.inArray(p,directions)>-1,cleanVal=_interpretValue(self,prop[p],p,(isDirection&&prop.avoidTransforms!==true));if(prop.avoidTransforms!==true&&_appropriateProperty(p,cleanVal,self)){_applyCSSTransition(self,p,opt.duration,cssEasing,isDirection&&prop.avoidTransforms===true?cleanVal+"px":cleanVal,isDirection&&prop.avoidTransforms!==true,isTranslatable,prop.useTranslate3d===true);}
else{domProperties[p]=prop[p];}}}
var cssProperties=self.data(DATA_KEY)||{};for(var i=cssPrefixes.length-1;i>=0;i--){if(typeof cssProperties[cssPrefixes[i]+'transition-property']!=='undefined'){cssProperties[cssPrefixes[i]+'transition-property']=cssProperties[cssPrefixes[i]+'transition-property'].substr(2);}}
self.data(DATA_KEY,cssProperties).unbind(transitionEndEvent);if(!_isEmptyObject(self.data(DATA_KEY))&&!_isEmptyObject(self.data(DATA_KEY).secondary)){callbackQueue++;self.css(self.data(DATA_KEY));var secondary=self.data(DATA_KEY).secondary;setTimeout(function(){self.bind(transitionEndEvent,cssCallback).css(secondary);});}
else{opt.queue=false;}
if(!_isEmptyObject(domProperties)){callbackQueue++;originalAnimateMethod.apply(self,[domProperties,{duration:opt.duration,easing:jQuery.easing[opt.easing]?opt.easing:(jQuery.easing.swing?"swing":"linear"),complete:propertyCallback,queue:opt.queue}]);}
return true;});};jQuery.fn.animate.defaults={};jQuery.fn.stop=function(clearQueue,gotoEnd,leaveTransforms){if(!cssTransitionsSupported)return originalStopMethod.apply(this,[clearQueue,gotoEnd]);if(clearQueue)this.queue([]);var reset={};for(var i=cssPrefixes.length-1;i>=0;i--){reset[cssPrefixes[i]+'transition-property']='none';reset[cssPrefixes[i]+'transition-duration']='';reset[cssPrefixes[i]+'transition-timing-function']='';};this.each(function(){var self=jQuery(this),cStyle=window.getComputedStyle(this,null),restore={},i;if(!_isEmptyObject(self.data(DATA_KEY))&&!_isEmptyObject(self.data(DATA_KEY).secondary)){var selfCSSData=self.data(DATA_KEY);if(gotoEnd){restore=selfCSSData.secondary;if(!leaveTransforms&&typeof selfCSSData.meta['left_o']!==undefined||typeof selfCSSData.meta['top_o']!==undefined){restore['left']=typeof selfCSSData.meta['left_o']!==undefined?selfCSSData.meta['left_o']:'auto';restore['top']=typeof selfCSSData.meta['top_o']!==undefined?selfCSSData.meta['top_o']:'auto';for(i=cssPrefixes.length-1;i>=0;i--){restore[cssPrefixes[i]+'transform']='';}}}
else{for(var prop in self.data(DATA_KEY).secondary){prop=prop.replace(rupper,"-$1").toLowerCase();restore[prop]=cStyle.getPropertyValue(prop);if(!leaveTransforms&&(/matrix/i).test(restore[prop])){var explodedMatrix=restore[prop].replace(/^matrix\(/i,'').split(/, |\)$/g);restore['left']=(parseFloat(explodedMatrix[4])+parseFloat(self.css('left'))+'px')||'auto';restore['top']=(parseFloat(explodedMatrix[5])+parseFloat(self.css('top'))+'px')||'auto';for(i=cssPrefixes.length-1;i>=0;i--){restore[cssPrefixes[i]+'transform']='';}}}}
self.unbind(transitionEndEvent).css(reset).css(restore).data(DATA_KEY,null);}
else{originalStopMethod.apply(self,[clearQueue,gotoEnd]);}});return this;};})(jQuery,jQuery.fn.animate,jQuery.fn.stop);
;(function(window,document,undefined){var prefixes=['webkit','Moz','ms','O'],animations={},useCssAnimations;function createEl(tag,prop){var el=document.createElement(tag||'div'),n;for(n in prop){el[n]=prop[n];}
return el;}
function ins(parent,child1,child2){if(child2&&!child2.parentNode)ins(parent,child2);parent.insertBefore(child1,child2||null);return parent;}
var sheet=(function(){var el=createEl('style');ins(document.getElementsByTagName('head')[0],el);return el.sheet||el.styleSheet;})();function addAnimation(alpha,trail,i,lines){var name=['opacity',trail,~~(alpha*100),i,lines].join('-'),start=0.01+i/lines*100,z=Math.max(1-(1-alpha)/trail*(100-start),alpha),prefix=useCssAnimations.substring(0,useCssAnimations.indexOf('Animation')).toLowerCase(),pre=prefix&&'-'+prefix+'-'||'';if(!animations[name]){sheet.insertRule('@'+pre+'keyframes '+name+'{'+'0%{opacity:'+z+'}'+
start+'%{opacity:'+alpha+'}'+
(start+0.01)+'%{opacity:1}'+
(start+trail)%100+'%{opacity:'+alpha+'}'+'100%{opacity:'+z+'}'+'}',0);animations[name]=1;}
return name;}
function vendor(el,prop){var s=el.style,pp,i;if(s[prop]!==undefined)return prop;prop=prop.charAt(0).toUpperCase()+prop.slice(1);for(i=0;i<prefixes.length;i++){pp=prefixes[i]+prop;if(s[pp]!==undefined)return pp;}}
function css(el,prop){for(var n in prop){el.style[vendor(el,n)||n]=prop[n];}
return el;}
function merge(obj){for(var i=1;i<arguments.length;i++){var def=arguments[i];for(var n in def){if(obj[n]===undefined)obj[n]=def[n];}}
return obj;}
function pos(el){var o={x:el.offsetLeft,y:el.offsetTop};while((el=el.offsetParent)){o.x+=el.offsetLeft;o.y+=el.offsetTop;}
return o;}
var Spinner=function Spinner(o){if(!this.spin)return new Spinner(o);this.opts=merge(o||{},Spinner.defaults,defaults);},defaults=Spinner.defaults={lines:12,length:7,width:5,radius:10,color:'#000',speed:1,trail:100,opacity:1/4,fps:20},proto=Spinner.prototype={spin:function(target){this.stop();var self=this,el=self.el=css(createEl(),{position:'relative'}),ep,tp;if(target){tp=pos(ins(target,el,target.firstChild));ep=pos(el);css(el,{left:(target.offsetWidth>>1)-ep.x+tp.x+'px',top:(target.offsetHeight>>1)-ep.y+tp.y+'px'});}
el.setAttribute('aria-role','progressbar');self.lines(el,self.opts);if(!useCssAnimations){var o=self.opts,i=0,fps=o.fps,f=fps/o.speed,ostep=(1-o.opacity)/(f*o.trail/100),astep=f/o.lines;(function anim(){i++;for(var s=o.lines;s;s--){var alpha=Math.max(1-(i+s*astep)%f*ostep,o.opacity);self.opacity(el,o.lines-s,alpha,o);}
self.timeout=self.el&&setTimeout(anim,~~(1000/fps));})();}
return self;},stop:function(){var el=this.el;if(el){clearTimeout(this.timeout);if(el.parentNode)el.parentNode.removeChild(el);this.el=undefined;}
return this;}};proto.lines=function(el,o){var i=0,seg;function fill(color,shadow){return css(createEl(),{position:'absolute',width:(o.length+o.width)+'px',height:o.width+'px',background:color,boxShadow:shadow,transformOrigin:'left',transform:'rotate('+~~(360/o.lines*i)+'deg) translate('+o.radius+'px'+',0)',borderRadius:(o.width>>1)+'px'});}
for(;i<o.lines;i++){seg=css(createEl(),{position:'absolute',top:1+~(o.width/2)+'px',transform:'translate3d(0,0,0)',opacity:o.opacity,animation:useCssAnimations&&addAnimation(o.opacity,o.trail,i,o.lines)+' '+1/o.speed+'s linear infinite'});if(o.shadow)ins(seg,css(fill('#000','0 0 4px '+'#000'),{top:2+'px'}));ins(el,ins(seg,fill(o.color,'0 0 1px rgba(0,0,0,.1)')));}
return el;};proto.opacity=function(el,i,val){if(i<el.childNodes.length)el.childNodes[i].style.opacity=val;};(function(){var s=css(createEl('group'),{behavior:'url(#default#VML)'}),i;if(!vendor(s,'transform')&&s.adj){for(i=4;i--;)sheet.addRule(['group','roundrect','fill','stroke'][i],'behavior:url(#default#VML)');proto.lines=function(el,o){var r=o.length+o.width,s=2*r;function grp(){return css(createEl('group',{coordsize:s+' '+s,coordorigin:-r+' '+-r}),{width:s,height:s});}
var g=grp(),margin=~(o.length+o.radius+o.width)+'px',i;function seg(i,dx,filter){ins(g,ins(css(grp(),{rotation:360/o.lines*i+'deg',left:~~dx}),ins(css(createEl('roundrect',{arcsize:1}),{width:r,height:o.width,left:o.radius,top:-o.width>>1,filter:filter}),createEl('fill',{color:o.color,opacity:o.opacity}),createEl('stroke',{opacity:0}))));}
if(o.shadow){for(i=1;i<=o.lines;i++){seg(i,-2,'progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)');}}
for(i=1;i<=o.lines;i++){seg(i);}
return ins(css(el,{margin:margin+' 0 0 '+margin,zoom:1}),g);};proto.opacity=function(el,i,val,o){var c=el.firstChild;o=o.shadow&&o.lines||0;if(c&&i+o<c.childNodes.length){c=c.childNodes[i+o];c=c&&c.firstChild;c=c&&c.firstChild;if(c)c.opacity=val;}};}
else{useCssAnimations=vendor(s,'animation');}})();window.Spinner=Spinner;})(window,document);
;window.log=function(){log.history=log.history||[];log.history.push(arguments);if(this.console){arguments.callee=arguments.callee.caller;console.log(Array.prototype.slice.call(arguments));}};(function(b){function c(){}for(var d="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,time,timeEnd,trace,warn".split(","),a;a=d.pop();)b[a]=b[a]||c})(window.console=window.console||{});
;(function($){$.address=(function(){var _trigger=function(name){$($.address).trigger($.extend($.Event(name),(function(){var parameters={},parameterNames=$.address.parameterNames();for(var i=0,l=parameterNames.length;i<l;i++){parameters[parameterNames[i]]=$.address.parameter(parameterNames[i]);}
return{value:$.address.value(),path:$.address.path(),pathNames:$.address.pathNames(),parameterNames:parameterNames,parameters:parameters,queryString:$.address.queryString()};}).call($.address)));},_array=function(obj){return Array.prototype.slice.call(obj);},_bind=function(value,data,fn){$().bind.apply($($.address),Array.prototype.slice.call(arguments));return $.address;},_supportsState=function(){return(_h.pushState&&_opts.state!==UNDEFINED);},_hrefState=function(){return('/'+_l.pathname.replace(new RegExp(_opts.state),'')+
_l.search+(_hrefHash()?'#'+_hrefHash():'')).replace(_re,'/');},_hrefHash=function(){var index=_l.href.indexOf('#');return index!=-1?_crawl(_l.href.substr(index+1),FALSE):'';},_href=function(){return _supportsState()?_hrefState():_hrefHash();},_window=function(){try{return top.document!==UNDEFINED?top:window;}catch(e){return window;}},_js=function(){return'javascript';},_strict=function(value){value=value.toString();return(_opts.strict&&value.substr(0,1)!='/'?'/':'')+value;},_crawl=function(value,direction){if(_opts.crawlable&&direction){return(value!==''?'!':'')+value;}
return value.replace(/^\!/,'');},_cssint=function(el,value){return parseInt(el.css(value),10);},_listen=function(){if(!_silent){var hash=_href(),diff=_value!=hash;if(diff){if(_msie&&_version<7){_l.reload();}else{if(_msie&&_version<8&&_opts.history){_st(_html,50);}
_value=hash;_update(FALSE);}}}},_update=function(internal){_trigger(CHANGE);_trigger(internal?INTERNAL_CHANGE:EXTERNAL_CHANGE);_st(_track,10);},_track=function(){if(_opts.tracker!=='null'&&_opts.tracker!==null){var fn=$.isFunction(_opts.tracker)?_opts.tracker:_t[_opts.tracker],value=(_l.pathname+_l.search+
($.address&&!_supportsState()?$.address.value():'')).replace(/\/\//,'/').replace(/^\/$/,'');if($.isFunction(fn)){fn(value);}else if($.isFunction(_t.urchinTracker)){_t.urchinTracker(value);}else if(_t.pageTracker!==UNDEFINED&&$.isFunction(_t.pageTracker._trackPageview)){_t.pageTracker._trackPageview(value);}else if(_t._gaq!==UNDEFINED&&$.isFunction(_t._gaq.push)){_t._gaq.push(['_trackPageview',decodeURI(value)]);}}},_html=function(){var src=_js()+':'+FALSE+';document.open();document.writeln(\'<html><head><title>'+
_d.title.replace('\'','\\\'')+'</title><script>var '+ID+' = "'+encodeURIComponent(_href())+
(_d.domain!=_l.hostname?'";document.domain="'+_d.domain:'')+'";</'+'script></head></html>\');document.close();';if(_version<7){_frame.src=src;}else{_frame.contentWindow.location.replace(src);}},_options=function(){if(_url&&_qi!=-1){var param,params=_url.substr(_qi+1).split('&');for(i=0;i<params.length;i++){param=params[i].split('=');if(/^(autoUpdate|crawlable|history|strict|wrap)$/.test(param[0])){_opts[param[0]]=(isNaN(param[1])?/^(true|yes)$/i.test(param[1]):(parseInt(param[1],10)!==0));}
if(/^(state|tracker)$/.test(param[0])){_opts[param[0]]=param[1];}}
_url=null;}
_value=_href();},_load=function(){if(!_loaded){_loaded=TRUE;_options();var complete=function(){_enable.call(this);_unescape.call(this);},body=$('body').ajaxComplete(complete);complete();if(_opts.wrap){var wrap=$('body > *').wrapAll('<div style="padding:'+
(_cssint(body,'marginTop')+_cssint(body,'paddingTop'))+'px '+
(_cssint(body,'marginRight')+_cssint(body,'paddingRight'))+'px '+
(_cssint(body,'marginBottom')+_cssint(body,'paddingBottom'))+'px '+
(_cssint(body,'marginLeft')+_cssint(body,'paddingLeft'))+'px;" />').parent().wrap('<div id="'+ID+'" style="height:100%;overflow:auto;position:relative;'+
(_webkit&&!window.statusbar.visible?'resize:both;':'')+'" />');$('html, body').css({height:'100%',margin:0,padding:0,overflow:'hidden'});if(_webkit){$('<style type="text/css" />').appendTo('head').text('#'+ID+'::-webkit-resizer { background-color: #fff; }');}}
if(_msie&&_version<8){var frameset=_d.getElementsByTagName('frameset')[0];_frame=_d.createElement((frameset?'':'i')+'frame');if(frameset){frameset.insertAdjacentElement('beforeEnd',_frame);frameset[frameset.cols?'cols':'rows']+=',0';_frame.noResize=TRUE;_frame.frameBorder=_frame.frameSpacing=0;}else{_frame.style.display='none';_frame.style.width=_frame.style.height=0;_frame.tabIndex=-1;_d.body.insertAdjacentElement('afterBegin',_frame);}
_st(function(){$(_frame).bind('load',function(){var win=_frame.contentWindow;_value=win[ID]!==UNDEFINED?win[ID]:'';if(_value!=_href()){_update(FALSE);_l.hash=_crawl(_value,TRUE);}});if(_frame.contentWindow[ID]===UNDEFINED){_html();}},50);}
_st(function(){_trigger('init');_update(FALSE);},1);if(!_supportsState()){if((_msie&&_version>7)||(!_msie&&('on'+HASH_CHANGE)in _t)){if(_t.addEventListener){_t.addEventListener(HASH_CHANGE,_listen,FALSE);}else if(_t.attachEvent){_t.attachEvent('on'+HASH_CHANGE,_listen);}}else{_si(_listen,50);}}}},_enable=function(){var el,elements=$('a'),length=elements.size(),delay=1,index=-1,fn=function(){if(++index!=length){el=$(elements.get(index));if(el.is('[rel*="address:"]')){el.address();}
_st(fn,delay);}};_st(fn,delay);},_popstate=function(){if(_value!=_href()){_value=_href();_update(FALSE);}},_unload=function(){if(_t.removeEventListener){_t.removeEventListener(HASH_CHANGE,_listen,FALSE);}else if(_t.detachEvent){_t.detachEvent('on'+HASH_CHANGE,_listen);}},_unescape=function(){if(_opts.crawlable){var base=_l.pathname.replace(/\/$/,''),fragment='_escaped_fragment_';if($('body').html().indexOf(fragment)!=-1){$('a[href]:not([href^=http]), a[href*="'+document.domain+'"]').each(function(){var href=$(this).attr('href').replace(/^http:/,'').replace(new RegExp(base+'/?$'),'');if(href===''||href.indexOf(fragment)!=-1){$(this).attr('href','#'+href.replace(new RegExp('/(.*)\\?'+fragment+'=(.*)$'),'!$2'));}});}}},UNDEFINED,ID='jQueryAddress',STRING='string',HASH_CHANGE='hashchange',INIT='init',CHANGE='change',INTERNAL_CHANGE='internalChange',EXTERNAL_CHANGE='externalChange',TRUE=true,FALSE=false,_opts={autoUpdate:TRUE,crawlable:FALSE,history:TRUE,strict:TRUE,wrap:FALSE},_browser=$.browser,_version=parseFloat($.browser.version),_mozilla=_browser.mozilla,_msie=_browser.msie,_opera=_browser.opera,_webkit=_browser.webkit||_browser.safari,_supported=FALSE,_t=_window(),_d=_t.document,_h=_t.history,_l=_t.location,_si=setInterval,_st=setTimeout,_re=/\/{2,9}/g,_agent=navigator.userAgent,_frame,_form,_url=$('script:last').attr('src'),_qi=_url?_url.indexOf('?'):-1,_title=_d.title,_silent=FALSE,_loaded=FALSE,_justset=TRUE,_juststart=TRUE,_updating=FALSE,_listeners={},_value=_href();if(_msie){_version=parseFloat(_agent.substr(_agent.indexOf('MSIE')+4));if(_d.documentMode&&_d.documentMode!=_version){_version=_d.documentMode!=8?7:8;}
var pc=_d.onpropertychange;_d.onpropertychange=function(){if(pc){pc.call(_d);}
if(_d.title!=_title&&_d.title.indexOf('#'+_href())!=-1){_d.title=_title;}};}
_supported=(_mozilla&&_version>=1)||(_msie&&_version>=6)||(_opera&&_version>=9.5)||(_webkit&&_version>=523);if(_supported){if(_opera){history.navigationMode='compatible';}
if(document.readyState=='complete'){var interval=setInterval(function(){if($.address){_load();clearInterval(interval);}},50);}else{_options();$(_load);}
$(window).bind('popstate',_popstate).bind('unload',_unload);}else if(!_supported&&_hrefHash()!==''){_l.replace(_l.href.substr(0,_l.href.indexOf('#')));}else{_track();}
return{bind:function(type,data,fn){return _bind.apply(this,_array(arguments));},init:function(data,fn){return _bind.apply(this,[INIT].concat(_array(arguments)));},change:function(data,fn){return _bind.apply(this,[CHANGE].concat(_array(arguments)));},internalChange:function(data,fn){return _bind.apply(this,[INTERNAL_CHANGE].concat(_array(arguments)));},externalChange:function(data,fn){return _bind.apply(this,[EXTERNAL_CHANGE].concat(_array(arguments)));},baseURL:function(){var url=_l.href;if(url.indexOf('#')!=-1){url=url.substr(0,url.indexOf('#'));}
if(/\/$/.test(url)){url=url.substr(0,url.length-1);}
return url;},autoUpdate:function(value){if(value!==UNDEFINED){_opts.autoUpdate=value;return this;}
return _opts.autoUpdate;},crawlable:function(value){if(value!==UNDEFINED){_opts.crawlable=value;return this;}
return _opts.crawlable;},history:function(value){if(value!==UNDEFINED){_opts.history=value;return this;}
return _opts.history;},state:function(value){if(value!==UNDEFINED){_opts.state=value;var hrefState=_hrefState();if(_opts.state!==UNDEFINED){if(_h.pushState){if(hrefState.substr(0,3)=='/#/'){_l.replace(_opts.state.replace(/^\/$/,'')+hrefState.substr(2));}}else if(hrefState!='/'&&hrefState.replace(/^\/#/,'')!=_hrefHash()){_st(function(){_l.replace(_opts.state.replace(/^\/$/,'')+'/#'+hrefState);},1);}}
return this;}
return _opts.state;},strict:function(value){if(value!==UNDEFINED){_opts.strict=value;return this;}
return _opts.strict;},tracker:function(value){if(value!==UNDEFINED){_opts.tracker=value;return this;}
return _opts.tracker;},wrap:function(value){if(value!==UNDEFINED){_opts.wrap=value;return this;}
return _opts.wrap;},update:function(){_updating=TRUE;this.value(_value);_updating=FALSE;return this;},title:function(value){if(value!==UNDEFINED){_st(function(){_title=_d.title=value;if(_juststart&&_frame&&_frame.contentWindow&&_frame.contentWindow.document){_frame.contentWindow.document.title=value;_juststart=FALSE;}
if(!_justset&&_mozilla){_l.replace(_l.href.indexOf('#')!=-1?_l.href:_l.href+'#');}
_justset=FALSE;},50);return this;}
return _d.title;},value:function(value){if(value!==UNDEFINED){value=_strict(value);if(value=='/'){value='';}
if(_value==value&&!_updating){return;}
_justset=TRUE;_value=value;if(_opts.autoUpdate||_updating){_update(TRUE);if(_supportsState()){_h[_opts.history?'pushState':'replaceState']({},'',_opts.state.replace(/\/$/,'')+(_value===''?'/':_value));}else{_silent=TRUE;if(_webkit){if(_opts.history){_l.hash='#'+_crawl(_value,TRUE);}else{_l.replace('#'+_crawl(_value,TRUE));}}else if(_value!=_href()){if(_opts.history){_l.hash='#'+_crawl(_value,TRUE);}else{_l.replace('#'+_crawl(_value,TRUE));}}
if((_msie&&_version<8)&&_opts.history){_st(_html,50);}
if(_webkit){_st(function(){_silent=FALSE;},1);}else{_silent=FALSE;}}}
return this;}
if(!_supported){return null;}
return _strict(_value);},path:function(value){if(value!==UNDEFINED){var qs=this.queryString(),hash=this.hash();this.value(value+(qs?'?'+qs:'')+(hash?'#'+hash:''));return this;}
return _strict(_value).split('#')[0].split('?')[0];},pathNames:function(){var path=this.path(),names=path.replace(_re,'/').split('/');if(path.substr(0,1)=='/'||path.length===0){names.splice(0,1);}
if(path.substr(path.length-1,1)=='/'){names.splice(names.length-1,1);}
return names;},queryString:function(value){if(value!==UNDEFINED){var hash=this.hash();this.value(this.path()+(value?'?'+value:'')+(hash?'#'+hash:''));return this;}
var arr=_value.split('?');return arr.slice(1,arr.length).join('?').split('#')[0];},parameter:function(name,value,append){var i,params;if(value!==UNDEFINED){var names=this.parameterNames();params=[];value=value?value.toString():'';for(i=0;i<names.length;i++){var n=names[i],v=this.parameter(n);if(typeof v==STRING){v=[v];}
if(n==name){v=(value===null||value==='')?[]:(append?v.concat([value]):[value]);}
for(var j=0;j<v.length;j++){params.push(n+'='+v[j]);}}
if($.inArray(name,names)==-1&&value!==null&&value!==''){params.push(name+'='+value);}
this.queryString(params.join('&'));return this;}
value=this.queryString();if(value){var r=[];params=value.split('&');for(i=0;i<params.length;i++){var p=params[i].split('=');if(p[0]==name){r.push(p.slice(1).join('='));}}
if(r.length!==0){return r.length!=1?r:r[0];}}},parameterNames:function(){var qs=this.queryString(),names=[];if(qs&&qs.indexOf('=')!=-1){var params=qs.split('&');for(var i=0;i<params.length;i++){var name=params[i].split('=')[0];if($.inArray(name,names)==-1){names.push(name);}}}
return names;},hash:function(value){if(value!==UNDEFINED){this.value(_value.split('#')[0]+(value?'#'+value:''));return this;}
var arr=_value.split('#');return arr.slice(1,arr.length).join('#');}};})();$.fn.address=function(fn){if(!$(this).attr('address')){var f=function(e){if(e.shiftKey||e.ctrlKey||e.metaKey||e.which==2){return true;}
if($(this).is('a')){var value=fn?fn.call(this):/address:/.test($(this).attr('rel'))?$(this).attr('rel').split('address:')[1].split(' ')[0]:$.address.state()!==undefined&&$.address.state()!='/'?$(this).attr('href').replace(new RegExp('^(.*'+$.address.state()+'|\\.)'),''):$(this).attr('href').replace(/^(#\!?|\.)/,'');$.address.value(value);e.preventDefault();}};$(this).live('click',f).live('submit',function(e){if($(this).is('form')){var action=$(this).attr('action'),value=fn?fn.call(this):(action.indexOf('?')!=-1?action.replace(/&$/,''):action+'?')+
$(this).serialize();$.address.value(value);e.preventDefault();}}).attr('address',true);}
return this;};})(jQuery);
;eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('h.i[\'1a\']=h.i[\'z\'];h.O(h.i,{y:\'D\',z:9(x,t,b,c,d){6 h.i[h.i.y](x,t,b,c,d)},17:9(x,t,b,c,d){6 c*(t/=d)*t+b},D:9(x,t,b,c,d){6-c*(t/=d)*(t-2)+b},13:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t+b;6-c/2*((--t)*(t-2)-1)+b},X:9(x,t,b,c,d){6 c*(t/=d)*t*t+b},U:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t+1)+b},R:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t+b;6 c/2*((t-=2)*t*t+2)+b},N:9(x,t,b,c,d){6 c*(t/=d)*t*t*t+b},M:9(x,t,b,c,d){6-c*((t=t/d-1)*t*t*t-1)+b},L:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t+b;6-c/2*((t-=2)*t*t*t-2)+b},K:9(x,t,b,c,d){6 c*(t/=d)*t*t*t*t+b},J:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t*t*t+1)+b},I:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t*t+b;6 c/2*((t-=2)*t*t*t*t+2)+b},G:9(x,t,b,c,d){6-c*8.C(t/d*(8.g/2))+c+b},15:9(x,t,b,c,d){6 c*8.n(t/d*(8.g/2))+b},12:9(x,t,b,c,d){6-c/2*(8.C(8.g*t/d)-1)+b},Z:9(x,t,b,c,d){6(t==0)?b:c*8.j(2,10*(t/d-1))+b},Y:9(x,t,b,c,d){6(t==d)?b+c:c*(-8.j(2,-10*t/d)+1)+b},W:9(x,t,b,c,d){e(t==0)6 b;e(t==d)6 b+c;e((t/=d/2)<1)6 c/2*8.j(2,10*(t-1))+b;6 c/2*(-8.j(2,-10*--t)+2)+b},V:9(x,t,b,c,d){6-c*(8.o(1-(t/=d)*t)-1)+b},S:9(x,t,b,c,d){6 c*8.o(1-(t=t/d-1)*t)+b},Q:9(x,t,b,c,d){e((t/=d/2)<1)6-c/2*(8.o(1-t*t)-1)+b;6 c/2*(8.o(1-(t-=2)*t)+1)+b},P:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6-(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b},H:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6 a*8.j(2,-10*t)*8.n((t*d-s)*(2*8.g)/p)+c+b},T:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d/2)==2)6 b+c;e(!p)p=d*(.3*1.5);e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);e(t<1)6-.5*(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b;6 a*8.j(2,-10*(t-=1))*8.n((t*d-s)*(2*8.g)/p)*.5+c+b},F:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*(t/=d)*t*((s+1)*t-s)+b},E:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},16:9(x,t,b,c,d,s){e(s==u)s=1.l;e((t/=d/2)<1)6 c/2*(t*t*(((s*=(1.B))+1)*t-s))+b;6 c/2*((t-=2)*t*(((s*=(1.B))+1)*t+s)+2)+b},A:9(x,t,b,c,d){6 c-h.i.v(x,d-t,0,c,d)+b},v:9(x,t,b,c,d){e((t/=d)<(1/2.k)){6 c*(7.q*t*t)+b}m e(t<(2/2.k)){6 c*(7.q*(t-=(1.5/2.k))*t+.k)+b}m e(t<(2.5/2.k)){6 c*(7.q*(t-=(2.14/2.k))*t+.11)+b}m{6 c*(7.q*(t-=(2.18/2.k))*t+.19)+b}},1b:9(x,t,b,c,d){e(t<d/2)6 h.i.A(x,t*2,0,c,d)*.5+b;6 h.i.v(x,t*2-d,0,c,d)*.5+c*.5+b}});',62,74,'||||||return||Math|function|||||if|var|PI|jQuery|easing|pow|75|70158|else|sin|sqrt||5625|asin|||undefined|easeOutBounce|abs||def|swing|easeInBounce|525|cos|easeOutQuad|easeOutBack|easeInBack|easeInSine|easeOutElastic|easeInOutQuint|easeOutQuint|easeInQuint|easeInOutQuart|easeOutQuart|easeInQuart|extend|easeInElastic|easeInOutCirc|easeInOutCubic|easeOutCirc|easeInOutElastic|easeOutCubic|easeInCirc|easeInOutExpo|easeInCubic|easeOutExpo|easeInExpo||9375|easeInOutSine|easeInOutQuad|25|easeOutSine|easeInOutBack|easeInQuad|625|984375|jswing|easeInOutBounce'.split('|'),0,{}))
;/* Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
* Licensed under the MIT License (LICENSE.txt).
*
* Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
* Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
* Thanks to: Seamus Leahy for adding deltaX and deltaY
*
* Version: 3.0.4
*
* Requires: 1.2.2+
*/
(function(d){function g(a){var b=a||window.event,i=[].slice.call(arguments,1),c=0,h=0,e=0;a=d.event.fix(b);a.type="mousewheel";if(a.wheelDelta)c=a.wheelDelta/120;if(a.detail)c=-a.detail/3;e=c;if(b.axis!==undefined&&b.axis===b.HORIZONTAL_AXIS){e=0;h=-1*c}if(b.wheelDeltaY!==undefined)e=b.wheelDeltaY/120;if(b.wheelDeltaX!==undefined)h=-1*b.wheelDeltaX/120;i.unshift(a,c,h,e);return d.event.handle.apply(this,i)}var f=["DOMMouseScroll","mousewheel"];d.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=f.length;a;)this.addEventListener(f[--a],g,false);else this.onmousewheel=g},teardown:function(){if(this.removeEventListener)for(var a=f.length;a;)this.removeEventListener(f[--a],g,false);else this.onmousewheel=null}};d.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery);
;(function($){var tmp,loading,overlay,wrap,outer,content,close,title,nav_left,nav_right,selectedIndex=0,selectedOpts={},selectedArray=[],currentIndex=0,currentOpts={},currentArray=[],ajaxLoader=null,imgPreloader=new Image(),imgRegExp=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,swfRegExp=/[^\.]\.(swf)\s*$/i,loadingTimer,loadingFrame=1,titleHeight=0,titleStr='',start_pos,final_pos,busy=false,fx=$.extend($('<div/>')[0],{prop:0}),isIE6=$.browser.msie&&$.browser.version<7&&!window.XMLHttpRequest,_abort=function(){loading.hide();imgPreloader.onerror=imgPreloader.onload=null;if(ajaxLoader){ajaxLoader.abort();}
tmp.empty();},_error=function(){if(false===selectedOpts.onError(selectedArray,selectedIndex,selectedOpts)){loading.hide();busy=false;return;}
selectedOpts.titleShow=false;selectedOpts.width='auto';selectedOpts.height='auto';tmp.html('<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>');_process_inline();},_start=function(){var obj=selectedArray[selectedIndex],href,type,title,str,emb,ret;_abort();selectedOpts=$.extend({},$.fn.fancybox.defaults,(typeof $(obj).data('fancybox')=='undefined'?selectedOpts:$(obj).data('fancybox')));ret=selectedOpts.onStart(selectedArray,selectedIndex,selectedOpts);if(ret===false){busy=false;return;}
else if(typeof ret=='object'){selectedOpts=$.extend(selectedOpts,ret);}
title=selectedOpts.title||(obj.nodeName?$(obj).attr('title'):obj.title)||'';if(obj.nodeName&&!selectedOpts.orig){selectedOpts.orig=$(obj).children("img:first").length?$(obj).children("img:first"):$(obj);}
if(title===''&&selectedOpts.orig&&selectedOpts.titleFromAlt){title=selectedOpts.orig.attr('alt');}
href=selectedOpts.href||(obj.nodeName?$(obj).attr('href'):obj.href)||null;if((/^(?:javascript)/i).test(href)||href=='#'){href=null;}
if(selectedOpts.type){type=selectedOpts.type;if(!href){href=selectedOpts.content;}}
else if(selectedOpts.content){type='html';}
else if(href){if(href.match(imgRegExp)){type='image';}
else if(href.match(swfRegExp)){type='swf';}
else if($(obj).hasClass("iframe")){type='iframe';}
else if(href.indexOf("#")===0){type='inline';}
else{type='ajax';}}
if(!type){_error();return;}
if(type=='inline'){obj=href.substr(href.indexOf("#"));type=$(obj).length>0?'inline':'ajax';}
selectedOpts.type=type;selectedOpts.href=href;selectedOpts.title=title;if(selectedOpts.autoDimensions){if(selectedOpts.type=='html'||selectedOpts.type=='inline'||selectedOpts.type=='ajax'){selectedOpts.width='auto';selectedOpts.height='auto';}
else{selectedOpts.autoDimensions=false;}}
if(selectedOpts.modal){selectedOpts.overlayShow=true;selectedOpts.hideOnOverlayClick=false;selectedOpts.hideOnContentClick=false;selectedOpts.enableEscapeButton=false;selectedOpts.showCloseButton=false;}
selectedOpts.padding=parseInt(selectedOpts.padding,10);selectedOpts.margin=parseInt(selectedOpts.margin,10);tmp.css('padding',(selectedOpts.padding+selectedOpts.margin));$('.fancybox-inline-tmp').unbind('fancybox-cancel').bind('fancybox-change',function(){$(this).replaceWith(content.children());});switch(type){case'html':tmp.html(selectedOpts.content);_process_inline();break;case'inline':if($(obj).parent().is('#fancybox-content')===true){busy=false;return;}
$('<div class="fancybox-inline-tmp" />').hide().insertBefore($(obj)).bind('fancybox-cleanup',function(){$(this).replaceWith(content.children());}).bind('fancybox-cancel',function(){$(this).replaceWith(tmp.children());});$(obj).appendTo(tmp);_process_inline();break;case'image':busy=false;$.fancybox.showActivity();imgPreloader=new Image();imgPreloader.onerror=function(){_error();};imgPreloader.onload=function(){busy=true;imgPreloader.onerror=imgPreloader.onload=null;_process_image();};imgPreloader.src=href;break;case'swf':selectedOpts.scrolling='no';str='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+selectedOpts.width+'" height="'+selectedOpts.height+'"><param name="movie" value="'+href+'"></param>';emb='';$.each(selectedOpts.swf,function(name,val){str+='<param name="'+name+'" value="'+val+'"></param>';emb+=' '+name+'="'+val+'"';});str+='<embed src="'+href+'" type="application/x-shockwave-flash" width="'+selectedOpts.width+'" height="'+selectedOpts.height+'"'+emb+'></embed></object>';tmp.html(str);_process_inline();break;case'ajax':busy=false;$.fancybox.showActivity();selectedOpts.ajax.win=selectedOpts.ajax.success;ajaxLoader=$.ajax($.extend({},selectedOpts.ajax,{url:href,data:selectedOpts.ajax.data||{},error:function(XMLHttpRequest,textStatus,errorThrown){if(XMLHttpRequest.status>0){_error();}},success:function(data,textStatus,XMLHttpRequest){var o=typeof XMLHttpRequest=='object'?XMLHttpRequest:ajaxLoader;if(o.status==200){if(typeof selectedOpts.ajax.win=='function'){ret=selectedOpts.ajax.win(href,data,textStatus,XMLHttpRequest);if(ret===false){loading.hide();return;}
else if(typeof ret=='string'||typeof ret=='object'){data=ret;}}
tmp.html(data);_process_inline();}}}));break;case'iframe':_show();break;}},_process_inline=function(){var
w=selectedOpts.width,h=selectedOpts.height;if(w.toString().indexOf('%')>-1){w=parseInt(($(window).width()-(selectedOpts.margin*2))*parseFloat(w)/100,10)+'px';}
else{w=w=='auto'?'auto':w+'px';}
if(h.toString().indexOf('%')>-1){h=parseInt(($(window).height()-(selectedOpts.margin*2))*parseFloat(h)/100,10)+'px';}
else{h=h=='auto'?'auto':h+'px';}
tmp.wrapInner('<div style="width:'+w+';height:'+h+';overflow: '+(selectedOpts.scrolling=='auto'?'auto':(selectedOpts.scrolling=='yes'?'scroll':'hidden'))+';position:relative;"></div>');selectedOpts.width=tmp.width();selectedOpts.height=tmp.height();_show();},_process_image=function(){selectedOpts.width=imgPreloader.width;selectedOpts.height=imgPreloader.height;$("<img />").attr({'id':'fancybox-img','src':imgPreloader.src,'alt':selectedOpts.title}).appendTo(tmp);_show();},_show=function(){var pos,equal;loading.hide();if(wrap.is(":visible")&&false===currentOpts.onCleanup(currentArray,currentIndex,currentOpts)){$.event.trigger('fancybox-cancel');busy=false;return;}
busy=true;$(content.add(overlay)).unbind();$(window).unbind("resize.fb scroll.fb");$(document).unbind('keydown.fb');if(wrap.is(":visible")&&currentOpts.titlePosition!=='outside'){wrap.css('height',wrap.height());}
currentArray=selectedArray;currentIndex=selectedIndex;currentOpts=selectedOpts;if(currentOpts.overlayShow){overlay.css({'background-color':currentOpts.overlayColor,'opacity':currentOpts.overlayOpacity,'cursor':currentOpts.hideOnOverlayClick?'pointer':'auto','height':$(document).height()});if(!overlay.is(':visible')){if(isIE6){$('select:not(#fancybox-tmp select)').filter(function(){return this.style.visibility!=='hidden';}).css({'visibility':'hidden'}).one('fancybox-cleanup',function(){this.style.visibility='inherit';});}
overlay.show();}}
else{overlay.hide();}
final_pos=_get_zoom_to();_process_title();if(wrap.is(":visible")){$(close.add(nav_left).add(nav_right)).hide();pos=wrap.position(),start_pos={top:pos.top,left:pos.left,width:wrap.width(),height:wrap.height()};equal=(start_pos.width==final_pos.width&&start_pos.height==final_pos.height);content.fadeTo(currentOpts.changeFade,0.3,function(){var finish_resizing=function(){content.html(tmp.contents()).fadeTo(currentOpts.changeFade,1,_finish);};$.event.trigger('fancybox-change');content.empty().removeAttr('filter').css({'border-width':currentOpts.padding,'width':final_pos.width-currentOpts.padding*2,'height':selectedOpts.autoDimensions?'auto':final_pos.height-titleHeight-currentOpts.padding*2});if(equal){finish_resizing();}
else{fx.prop=0;$(fx).animate({prop:1},{duration:currentOpts.changeSpeed,easing:currentOpts.easingChange,step:_draw,complete:finish_resizing});}});return;}
wrap.removeAttr("style");content.css('border-width',currentOpts.padding);if(currentOpts.transitionIn=='elastic'){start_pos=_get_zoom_from();content.html(tmp.contents());wrap.show();if(currentOpts.opacity){final_pos.opacity=0;}
fx.prop=0;$(fx).animate({prop:1},{duration:currentOpts.speedIn,easing:currentOpts.easingIn,step:_draw,complete:_finish});return;}
if(currentOpts.titlePosition=='inside'&&titleHeight>0){title.show();}
content.css({'width':final_pos.width-currentOpts.padding*2,'height':selectedOpts.autoDimensions?'auto':final_pos.height-titleHeight-currentOpts.padding*2}).html(tmp.contents());wrap.css(final_pos).fadeIn(currentOpts.transitionIn=='none'?0:currentOpts.speedIn,_finish);},_format_title=function(title){if(title&&title.length){if(currentOpts.titlePosition=='float'){return'<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">'+title+'</td><td id="fancybox-title-float-right"></td></tr></table>';}
return'<div id="fancybox-title-'+currentOpts.titlePosition+'">'+title+'</div>';}
return false;},_process_title=function(){titleStr=currentOpts.title||'';titleHeight=0;title.empty().removeAttr('style').removeClass();if(currentOpts.titleShow===false){title.hide();return;}
titleStr=$.isFunction(currentOpts.titleFormat)?currentOpts.titleFormat(titleStr,currentArray,currentIndex,currentOpts):_format_title(titleStr);if(!titleStr||titleStr===''){title.hide();return;}
title.addClass('fancybox-title-'+currentOpts.titlePosition).html(titleStr).appendTo('body').show();switch(currentOpts.titlePosition){case'inside':title.css({'width':final_pos.width-(currentOpts.padding*2),'marginLeft':currentOpts.padding,'marginRight':currentOpts.padding});titleHeight=title.outerHeight(true);title.appendTo(outer);final_pos.height+=titleHeight;break;case'over':title.css({'marginLeft':currentOpts.padding,'width':final_pos.width-(currentOpts.padding*2),'bottom':currentOpts.padding}).appendTo(outer);break;case'float':title.css('left',parseInt((title.width()-final_pos.width-40)/2,10)*-1).appendTo(wrap);break;default:title.css({'width':final_pos.width-(currentOpts.padding*2),'paddingLeft':currentOpts.padding,'paddingRight':currentOpts.padding}).appendTo(wrap);break;}
title.hide();},_set_navigation=function(){if(currentOpts.enableEscapeButton||currentOpts.enableKeyboardNav){$(document).bind('keydown.fb',function(e){if(e.keyCode==27&&currentOpts.enableEscapeButton){e.preventDefault();$.fancybox.close();}
else if((e.keyCode==37||e.keyCode==39)&&currentOpts.enableKeyboardNav&&e.target.tagName!=='INPUT'&&e.target.tagName!=='TEXTAREA'&&e.target.tagName!=='SELECT'){e.preventDefault();$.fancybox[e.keyCode==37?'prev':'next']();}});}
if(!currentOpts.showNavArrows){nav_left.hide();nav_right.hide();return;}
if((currentOpts.cyclic&&currentArray.length>1)||currentIndex!==0){nav_left.show();}
if((currentOpts.cyclic&&currentArray.length>1)||currentIndex!=(currentArray.length-1)){nav_right.show();}},_finish=function(){if(!$.support.opacity){content.get(0).style.removeAttribute('filter');wrap.get(0).style.removeAttribute('filter');}
if(selectedOpts.autoDimensions){content.css('height','auto');}
wrap.css('height','auto');if(titleStr&&titleStr.length){title.show();}
if(currentOpts.showCloseButton){close.show();}
_set_navigation();if(currentOpts.hideOnContentClick){content.bind('click',$.fancybox.close);}
if(currentOpts.hideOnOverlayClick){overlay.bind('click',$.fancybox.close);}
$(window).bind("resize.fb",$.fancybox.resize);if(currentOpts.centerOnScroll){$(window).bind("scroll.fb",$.fancybox.center);}
if(currentOpts.type=='iframe'){$('<iframe id="fancybox-frame" name="fancybox-frame'+new Date().getTime()+'" frameborder="0" hspace="0" '+($.browser.msie?'allowtransparency="true""':'')+' scrolling="'+selectedOpts.scrolling+'" src="'+currentOpts.href+'"></iframe>').appendTo(content);}
wrap.show();busy=false;$.fancybox.center();currentOpts.onComplete(currentArray,currentIndex,currentOpts);_preload_images();},_preload_images=function(){var href,objNext;if((currentArray.length-1)>currentIndex){href=currentArray[currentIndex+1].href;if(typeof href!=='undefined'&&href.match(imgRegExp)){objNext=new Image();objNext.src=href;}}
if(currentIndex>0){href=currentArray[currentIndex-1].href;if(typeof href!=='undefined'&&href.match(imgRegExp)){objNext=new Image();objNext.src=href;}}},_draw=function(pos){var dim={width:parseInt(start_pos.width+(final_pos.width-start_pos.width)*pos,10),height:parseInt(start_pos.height+(final_pos.height-start_pos.height)*pos,10),top:parseInt(start_pos.top+(final_pos.top-start_pos.top)*pos,10),left:parseInt(start_pos.left+(final_pos.left-start_pos.left)*pos,10)};if(typeof final_pos.opacity!=='undefined'){dim.opacity=pos<0.5?0.5:pos;}
wrap.css(dim);content.css({'width':dim.width-currentOpts.padding*2,'height':dim.height-(titleHeight*pos)-currentOpts.padding*2});},_get_viewport=function(){return[$(window).width()-(currentOpts.margin*2),$(window).height()-(currentOpts.margin*2),$(document).scrollLeft()+currentOpts.margin,$(document).scrollTop()+currentOpts.margin];},_get_zoom_to=function(){var view=_get_viewport(),to={},resize=currentOpts.autoScale,double_padding=currentOpts.padding*2,ratio;if(currentOpts.width.toString().indexOf('%')>-1){to.width=parseInt((view[0]*parseFloat(currentOpts.width))/100,10);}
else{to.width=currentOpts.width+double_padding;}
if(currentOpts.height.toString().indexOf('%')>-1){to.height=parseInt((view[1]*parseFloat(currentOpts.height))/100,10);}
else{to.height=currentOpts.height+double_padding;}
if(resize&&(to.width>view[0]||to.height>view[1])){if(selectedOpts.type=='image'||selectedOpts.type=='swf'){ratio=(currentOpts.width)/(currentOpts.height);if((to.width)>view[0]){to.width=view[0];to.height=parseInt(((to.width-double_padding)/ratio)+double_padding,10);}
if((to.height)>view[1]){to.height=view[1];to.width=parseInt(((to.height-double_padding)*ratio)+double_padding,10);}}
else{to.width=Math.min(to.width,view[0]);to.height=Math.min(to.height,view[1]);}}
to.top=parseInt(Math.max(view[3]-20,view[3]+((view[1]-to.height-40)*0.5)),10);to.left=parseInt(Math.max(view[2]-20,view[2]+((view[0]-to.width-40)*0.5)),10);return to;},_get_obj_pos=function(obj){var pos=obj.offset();pos.top+=parseInt(obj.css('paddingTop'),10)||0;pos.left+=parseInt(obj.css('paddingLeft'),10)||0;pos.top+=parseInt(obj.css('border-top-width'),10)||0;pos.left+=parseInt(obj.css('border-left-width'),10)||0;pos.width=obj.width();pos.height=obj.height();return pos;},_get_zoom_from=function(){var orig=selectedOpts.orig?$(selectedOpts.orig):false,from={},pos,view;if(orig&&orig.length){pos=_get_obj_pos(orig);from={width:pos.width+(currentOpts.padding*2),height:pos.height+(currentOpts.padding*2),top:pos.top-currentOpts.padding-20,left:pos.left-currentOpts.padding-20};}
else{view=_get_viewport();from={width:currentOpts.padding*2,height:currentOpts.padding*2,top:parseInt(view[3]+view[1]*0.5,10),left:parseInt(view[2]+view[0]*0.5,10)};}
return from;},_animate_loading=function(){if(!loading.is(':visible')){clearInterval(loadingTimer);return;}
$('div',loading).css('top',(loadingFrame*-40)+'px');loadingFrame=(loadingFrame+1)%12;};$.fn.fancybox=function(options){if(!$(this).length){return this;}
$(this).data('fancybox',$.extend({},options,($.metadata?$(this).metadata():{}))).unbind('click.fb').bind('click.fb',function(e){e.preventDefault();if(busy){return;}
busy=true;$(this).blur();selectedArray=[];selectedIndex=0;var rel=$(this).attr('rel')||'';if(!rel||rel==''||rel==='nofollow'){selectedArray.push(this);}
else{selectedArray=$("a[rel="+rel+"], area[rel="+rel+"]");selectedIndex=selectedArray.index(this);}
_start();return;});return this;};$.fancybox=function(obj){var opts;if(busy){return;}
busy=true;opts=typeof arguments[1]!=='undefined'?arguments[1]:{};selectedArray=[];selectedIndex=parseInt(opts.index,10)||0;if($.isArray(obj)){for(var i=0,j=obj.length;i<j;i++){if(typeof obj[i]=='object'){$(obj[i]).data('fancybox',$.extend({},opts,obj[i]));}
else{obj[i]=$({}).data('fancybox',$.extend({content:obj[i]},opts));}}
selectedArray=jQuery.merge(selectedArray,obj);}
else{if(typeof obj=='object'){$(obj).data('fancybox',$.extend({},opts,obj));}
else{obj=$({}).data('fancybox',$.extend({content:obj},opts));}
selectedArray.push(obj);}
if(selectedIndex>selectedArray.length||selectedIndex<0){selectedIndex=0;}
_start();};$.fancybox.showActivity=function(){clearInterval(loadingTimer);loading.show();loadingTimer=setInterval(_animate_loading,66);};$.fancybox.hideActivity=function(){loading.hide();};$.fancybox.next=function(){return $.fancybox.pos(currentIndex+1);};$.fancybox.prev=function(){return $.fancybox.pos(currentIndex-1);};$.fancybox.pos=function(pos){if(busy){return;}
pos=parseInt(pos);selectedArray=currentArray;if(pos>-1&&pos<currentArray.length){selectedIndex=pos;_start();}
else if(currentOpts.cyclic&&currentArray.length>1){selectedIndex=pos>=currentArray.length?0:currentArray.length-1;_start();}
return;};$.fancybox.cancel=function(){if(busy){return;}
busy=true;$.event.trigger('fancybox-cancel');_abort();selectedOpts.onCancel(selectedArray,selectedIndex,selectedOpts);busy=false;};$.fancybox.close=function(){if(busy||wrap.is(':hidden')){return;}
busy=true;if(currentOpts&&false===currentOpts.onCleanup(currentArray,currentIndex,currentOpts)){busy=false;return;}
_abort();$(close.add(nav_left).add(nav_right)).hide();$(content.add(overlay)).unbind();$(window).unbind("resize.fb scroll.fb");$(document).unbind('keydown.fb');content.find('iframe').attr('src',isIE6&&/^https/i.test(window.location.href||'')?'javascript:void(false)':'about:blank');if(currentOpts.titlePosition!=='inside'){title.empty();}
wrap.stop();function _cleanup(){overlay.fadeOut('fast');title.empty().hide();wrap.hide();$.event.trigger('fancybox-cleanup');content.empty();currentOpts.onClosed(currentArray,currentIndex,currentOpts);currentArray=[];currentIndex=selectedIndex=0;currentOpts=selectedOpts={};busy=false;}
if(currentOpts.transitionOut=='elastic'){start_pos=_get_zoom_from();var pos=wrap.position();final_pos={top:pos.top,left:pos.left,width:wrap.width(),height:wrap.height()};if(currentOpts.opacity){final_pos.opacity=1;}
title.empty().hide();fx.prop=1;$(fx).animate({prop:0},{duration:currentOpts.speedOut,easing:currentOpts.easingOut,step:_draw,complete:_cleanup});}
else{wrap.fadeOut(currentOpts.transitionOut=='none'?0:currentOpts.speedOut,_cleanup);}};$.fancybox.resize=function(){if(overlay.is(':visible')){overlay.css('height',$(document).height());}
$.fancybox.center(true);};$.fancybox.center=function(){var view,align;if(busy){return;}
align=arguments[0]===true?1:0;view=_get_viewport();if(!align&&(wrap.width()>view[0]||wrap.height()>view[1])){return;}
wrap.stop().animate({'top':parseInt(Math.max(view[3]-20,view[3]+((view[1]-content.height()-40)*0.5)-currentOpts.padding)),'left':parseInt(Math.max(view[2]-20,view[2]+((view[0]-content.width()-40)*0.5)-currentOpts.padding)),'avoidTransforms':true},typeof arguments[0]=='number'?arguments[0]:200);};$.fancybox.init=function(){if($("#fancybox-wrap").length){return;}
$('body').append(tmp=$('<div id="fancybox-tmp"></div>'),loading=$('<div id="fancybox-loading"><div></div></div>'),overlay=$('<div id="fancybox-overlay"></div>'),wrap=$('<div id="fancybox-wrap"></div>'));outer=$('<div id="fancybox-outer"></div>').append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>').appendTo(wrap);outer.append(content=$('<div id="fancybox-content"></div>'),close=$('<a id="fancybox-close"></a>'),title=$('<div id="fancybox-title"></div>'),nav_left=$('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),nav_right=$('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));close.click($.fancybox.close);loading.click($.fancybox.cancel);nav_left.click(function(e){e.preventDefault();$.fancybox.prev();});nav_right.click(function(e){e.preventDefault();$.fancybox.next();});if($.fn.mousewheel){wrap.bind('mousewheel.fb',function(e,delta){if(busy){e.preventDefault();}
else if($(e.target).get(0).clientHeight==0||$(e.target).get(0).scrollHeight===$(e.target).get(0).clientHeight){e.preventDefault();$.fancybox[delta>0?'prev':'next']();}});}
if(!$.support.opacity){wrap.addClass('fancybox-ie');}
if(isIE6){loading.addClass('fancybox-ie6');wrap.addClass('fancybox-ie6');$('<iframe id="fancybox-hide-sel-frame" src="'+(/^https/i.test(window.location.href||'')?'javascript:void(false)':'about:blank')+'" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(outer);}};$.fn.fancybox.defaults={padding:10,margin:40,opacity:false,modal:false,cyclic:false,scrolling:'auto',width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:'transparent'},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.7,overlayColor:'#777',titleShow:true,titlePosition:'float',titleFormat:null,titleFromAlt:false,transitionIn:'fade',transitionOut:'fade',speedIn:300,speedOut:300,changeSpeed:300,changeFade:'fast',easingIn:'swing',easingOut:'swing',showCloseButton:true,showNavArrows:true,enableEscapeButton:true,enableKeyboardNav:true,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};$(document).ready(function(){$.fancybox.init();});})(jQuery);
;/**
 * Created by JetBrains PhpStorm.
 * User: Oliver Turner - oliver@dragonuk.co.uk
 * Date: 22/02/2011
 * Time: 20:19
 */

(function($) {

    var settings = {
            animation: 'fade',               // fade, horizontal-slide, vertical-slide, horizontal-push
            animationSpeed: 1000,            // how fast animtions are
            timer: false,                    // true or false to have the timer
            clock: false,                    // true or false to have the timer
            rate: 4000,                      // if timer is enabled, time between transitions
            pauseOnHover: false,             // if you hover pauses the slider
            startTimerOnMouseOut: false,     // if clock should start on MouseOut
            startTimerOnMouseOutAfter: 1000, // how long after MouseOut should the timer start again
            arrows: true,                    // manual advancing directional navs
            captions: false,                 // do you want captions?
            captionAnimation: 'fade',        // fade, slideOpen, none
            captionAnimationSpeed: 500,      // if so how quickly should they animate in
            bullets: true,                   // true or false to activate the bullet navigation
            bulletThumbs: false,             // thumbnails for the bullets
            bulletThumbLocation: '',         // location from this file where thumbs will be pulled
            cycleLimit: -1,                  // How many times to loop: -1 = infinite
            activeID: 0,                     // The frame on which to start; default = first
            afterSlideChange: function() {}  // empty function
        },

        methods = {
            initialise: function(options) {

                return this.each(function(){

                    options = $.extend({}, settings, options);

                    var self      = this,
                        $_this    = $(this).addClass('orbit'),
                        $_wrapper = $_this.wrap('<div class="orbit-wrapper"></div>').parent(),
                        $_slides  = $_this.children(),
                        _slideNum = $_slides.length,
                        _points   = [],
                        _data     = $_this.data('orbit'),
                        _xTracker = 0,
                        _xOffset  = 20,
                        _init     = {
                            getDimensions: function(){
                                var $slide,
                                    slide_w,
                                    slide_h,
                                    orbit_w = 1,
                                    orbit_h = 1;

                                $_slides.each(function(i) {
                                    $slide  = $(this);
                                    slide_w = $slide.outerWidth();
                                    slide_h = $slide.outerHeight();

                                    orbit_w = (slide_w > orbit_w) ? slide_w : orbit_w;
                                    orbit_h = (slide_h > orbit_h) ? slide_h : orbit_h;

                                    // Store x values for stack-style animation
                                    _points[i] = _xTracker;

                                    _xTracker += (slide_w + _xOffset);
                                });

                                $_wrapper.width($_this.outerWidth()).height($_this.outerHeight());

                                return {
                                    orbit_w: orbit_w,
                                    orbit_h: orbit_h
                                };
                            },
                            createBullets: function(){
                                var $clip, bullets = '', i = 0;

                                for (; i < _slideNum; i++) {
                                    bullets += '<li data-index="'+i+'">' + (i + 1) + '</li>';
                                }
                                $_wrapper.append('<ol class="orbit-bullets">' + bullets + '</ol>');

                                $clip = $('.orbit-bullets', $_wrapper);
                                $clip.css('margin-left', Math.round($clip.outerWidth() * -0.5));

                                return $clip.children();
                            },
                            applyBullets: function(){

                            },
                            createThumbs: function(){
                                var _thumbURL,
                                    $_bullet;

                                for (var i = 0; i < _slideNum; i++) {
                                    $_bullet = $_slides.eq(i).data('thumb');
                                    if (_thumbURL) {
                                        $_bullet = $('<li class="has-thumb">' + i + '</li>');
                                        $_bullet.css({"background" : "url(" + options.bulletThumbLocation + _thumbURL + ") no-repeat"});
                                    }
                                }
                            },
                            createClock: function(){
                                var _html = '<div class="clock">' +
                                             '<span class="mask"><span class="rotator"></span></span>' +
                                             '<span class="pause"></span>' +
                                             '</div>',
                                    $_div = $_wrapper.append(_html).children().last();

                                return {
                                    div:      $_div,
                                    pause:    $('span.pause', $_div),
                                    rotator:  $('span.rotator', $_div),
                                    mask:     $('span.mask', $_div),
                                    degrees:  0,
                                    interval: null
                                }
                            },
                            createTimerOnMouseOut: function(){
                                var outTimer;

                                $_wrapper
                                    .mouseleave(function() {
                                        outTimer = setTimeout(function() {
                                            if (!_data.timer.running) {
                                                startTimer();
                                            }
                                        }, options.startTimerOnMouseOutAfter)
                                    })
                                    .mouseenter(function() {
                                        clearTimeout(outTimer);
                                    });
                            },
                            createCaptionDiv: function(){
                                var html = '<div class="orbit-caption"></div>';
                                return $_wrapper.append(html).children().last();
                            },
                            createDirectionNav: function(){
                                var html = '<div class="slider-nav">' +
                                           '<span class="right">Right</span>' +
                                           '<span class="left">Left</span>' +
                                           '</div>',
                                    $_leftBtn,
                                    $_rightBtn;

                                $_wrapper.append(html);
                                $('span.left', $_wrapper).click(function() { self.gotoAndStop("prev"); });
                                $('span.right', $_wrapper).click(function() { self.gotoAndStop("next"); });
                            }
                        };

                    if (!_data) {
                        _data = {
                            target:     $_this,
                            wrapper:    $_wrapper,
                            slides:     $_slides,
                            slideNum:   _slideNum,
                            locked:     false,
                            cycleID:    0,
                            activeID:   options.activeID,
                            dimensions: _init.getDimensions(),
                            points:     _points
                        };

                        if (options.captions) {
                            _data.captionDiv = _init.createCaptionDiv();
                        }

                        if(options.bullets && _slideNum > 1){
                            _data.bullets = _init.createBullets();
                            _data.bullets.click(function() { self.gotoAndStop($(this).data('index')); });

                            if (options.bulletThumbs) {
                                _init.createThumbs();
                            }
                        }

                        if(options.timer) {
                            _data.timer = {
                                running: false,
                                interval: null
                            }
                        }

                        if(options.clock) {
                            _data.clock = _init.createClock();
                            _data.clock.div.click(function() { self.toggleTimer(); });
                        }

                        // Pause Timer on hover
                        if (options.pauseOnHover) {
                            $_wrapper.mouseenter(function() {
                                stopTimer();
                            });
                        }

                        if (options.startTimerOnMouseOut) {
                            _init.createTimerOnMouseOut();
                        }

                        if(options.animation === "horizontal-stack") {
                            $_slides.each(function(i) {
                                $(this).css({ "left": _points[i] });
                            });

                            $_this.width(_xTracker - _xOffset);
                        }

                        if(options.arrows) {

                            // If animation type is stacking, only add directional nav if required
                            switch(options.animation) {
                                case "horizontal-stack":
                                    if($_this.width() > $_wrapper.width()) _init.createDirectionNav();
                                    break;

                                default:
                                    _init.createDirectionNav();
                            }
                        }

                        $_this.data('orbit', _data);
                    }

                    function shift(direction){

                        var _prevID  = _data.activeID,
                            _dirNext = (direction === "next"),
                            _dimensions = _data.dimensions,
                            $_activeSlide,
                            $_prevSlide;

                        if (!_data.locked) {

                            setActiveID();

                            // exit function if bullet clicked is same as the current image
                            if (direction == _prevID) return;

                            _data.locked = true;

                            setActiveBullet();
                            setCaption();
                            setSlide();

                            // Kill off looping if max cycles reached
                            if(_data.timer && _data.timer.running && cycleMaxReached()) {
                                stopTimer(true);
                            }
                        }

                        //reset Z & Unlock
                        function resetAndUnlock() {
                            _data.slides.eq(_prevID).css({ "z-index": 1 });
                            _data.locked = false;

                            options.afterSlideChange.call(this);
                        }

                        // Deduce activeID from direction argument: "next", "prev" or numeric
                        // Store data.activeID and set to correct bullet
                        function setActiveID() {
                            if (_dirNext) {
                                if(++_data.activeID == _data.slideNum) {
                                    _data.activeID = 0;
                                    _data.cycleID++;
                                }
                            }
                            else if (direction == "prev") {
                                _data.activeID = (--_data.activeID < 0) ? _data.slideNum - 1 : _data.activeID;
                            }
                            else {
                                _data.activeID = direction;
                                _dirNext = (_prevID < _data.activeID);
                            }
                        }

                        function setSlide(){
                            $_activeSlide = _data.slides.eq(_data.activeID);
                            $_prevSlide   = _data.slides.eq(_prevID).css({"z-index" : 2});

                            var x, y, prev_x, active_x;

                            switch(options.animation) {
                                case "horizontal-stack":

                                    x = _data.points[_data.activeID] * -1;

                                    var dx = $_wrapper.outerWidth() - $_this.outerWidth(),
                                        cx = $_this.position().left;

                                    if(x < dx) x = dx;

                                    if(x != cx) {
                                        $_this.animate({"left": x}, options.animationSpeed, resetAndUnlock);
                                    }
                                    else {
                                        _data.locked = false;
                                        shift("next");
                                    }

                                    //$_this.animate({"left": x}, options.animationSpeed, resetAndUnlock);
                                    break;

                                case "horizontal-slide":
                                    x = _dirNext  ? _dimensions.orbit_w : -_dimensions.orbit_w;

                                    $_activeSlide
                                        .css({"left": x, "z-index": 3})
                                        .animate({"left": 0}, options.animationSpeed, resetAndUnlock);
                                    break;

                                case "vertical-slide":
                                    y = _dirNext  ? -_dimensions.orbit_h : _dimensions.orbit_h;
                                    $_activeSlide
                                        .css({"top": y, "z-index": 3})
                                        .animate({"left": 0}, options.animationSpeed, resetAndUnlock);
                                    break;

                                case "horizontal-push":
                                    active_x = _dirNext  ?  _dimensions.orbit_w : -_dimensions.orbit_w,
                                    prev_x   = _dirNext  ? -_dimensions.orbit_w :  _dimensions.orbit_w;

                                    $_activeSlide
                                        .css({"left": active_x, "z-index" : 3})
                                        .animate({"left":0}, options.animationSpeed, resetAndUnlock);
                                    $_prevSlide.animate({"left": prev_x}, options.animationSpeed);
                                    break;

                                case "fade":
                                default:
                                    $_activeSlide
                                        .css({"opacity": 0, "z-index": 3})
                                        .animate({"opacity": 1}, options.animationSpeed, resetAndUnlock);
                                    break;
                            }
                        }
                    }

                    function setActiveBullet(){
                        if(!options.bullets) return;

                        _data.bullets
                            .removeClass('active')
                            .eq(_data.activeID)
                            .addClass('active');
                    }

                    function setCaption(){
                        if (!options.captions) return;

                        // get ID from rel tag on image then HTML from matching entity
                        var _captionEl   = _data.slides.eq(_data.activeID).data('caption'),
                            _captionHTML = $(_captionEl).html(),
                            _display     = (_captionHTML),
                            _method;

                        // Set HTML for the caption if it exists
                        if (_display) {
                            _data.captionDiv.attr('id', _captionEl).html(_captionHTML);
                        }

                        switch(options.captionAnimation) {
                            case "fade":
                                _method = _display ? "fadeIn" : "fadeOut";
                                break;

                            case "slideOpen":
                                _method = _display ? "slideUp" : "slideDown";
                                break;

                            case "none":
                            default:
                                _method = _display ? "show" : "hide";
                                break;
                        }

                        _data.captionDiv[_method]();
                    }

                    function cycleMaxReached()
                    {
                        return (options.cycleLimit > -1 && _data.cycleID >= options.cycleLimit);
                    }

                    function startTimer() {
                        if(!options.timer || cycleMaxReached()) {
                            return;
                        }

                        var _timer = _data.timer,
                            _clock = _data.clock;

                        // Only do calculations if clock is visible and requested
                        if (options.clock && _clock.div.is(':visible')) {

                            _clock.pause.removeClass('active');

                            _clock.interval = setInterval(function(e) {
                                var degreeCSS = "rotate(" + _clock.degrees++ + "deg)";

                                if (_clock.degrees == 180) {
                                    _clock.rotator.addClass('move');
                                    _clock.mask.addClass('move');
                                }
                                if (_clock.degrees > 360) {
                                    _clock.rotator.removeClass('move');
                                    _clock.mask.removeClass('move');
                                    _clock.degrees = 0;
                                    shift("next");
                                }

                                _clock.rotator.css({
                                    "-webkit-transform": degreeCSS,
                                    "-moz-transform": degreeCSS,
                                    "-o-transform": degreeCSS,
                                    "transform": degreeCSS
                                });

                            }, Math.floor(options.rate / 360));
                        }

                        _timer.running  = true;
                        _timer.interval = setInterval(function(e) {
                            shift("next");
                        }, options.rate);
                    }

                    function stopTimer(killTimer){
                        if(!options.timer) return;

                        if(options.timer) {
                            _data.timer.running = false;
                            clearInterval(_data.timer.interval);
                        }

                        if(options.clock) {
                            clearInterval(_data.clock.interval);

                            if(killTimer) {
                                _data.clock.div.fadeOut();
                            }
                            else {
                                _data.clock.pause.addClass('active');
                            }
                        }
                    }

                    function display() {

                        function _onDisplayed(){
                            $_this.removeClass('loading');

                            //brings in all other slides IF css declares a display: none
                            $_slides.css({"display":"block"});

                            if(options.bullets)  setActiveBullet();
                            if(options.captions) setCaption();
                            if(options.timer)    startTimer();
                        }

                        if(options.animation === "horizontal-stack") {
                            $_slides.css({"display":"block"});
                            $_this.fadeIn(_onDisplayed);
                        }
                        else {
                            //Set initial front photo z-index and fades it in
                            $_slides.eq(_data.activeID)
                                .css({"z-index": 3})
                                .fadeIn(_onDisplayed);
                        }
                    }

                    /* Public methods
                    ----------------------------------------------------------------------------------*/
                    this.gotoAndStop = function(index){
                        //console.log("gotoAndStop called:", index);
                        stopTimer();
                        shift(index);
                    };

                    this.toggleTimer = function() {
                        if (!options.timer) return;

                        _data.timer.running ? stopTimer() : startTimer();
                    };

                    /* FIRE!!
                    ----------------------------------------------------------------------------------*/
                    display();
                });
            },
            pause: function(){
                return this.each(function(){
                    var $_this = $(this),
                        _data  = $_this.first().data('orbit');

                    this.gotoAndStop(_data.activeID);
                });
            },
            resume: function(){
                return this.each(function(){
                    this.toggleTimer();
                });
            },
            destroy: function(){
                return this.each(function(){
                    var $_this = $(this),
                        _data  = $_this.data('orbit');
                });
            },
            goto: function(index){
                return this.each(function(){
                    var $_this = $(this),
                        _data  = $_this.data('orbit');

                    this.gotoAndStop(index);
                });
            }
        };

    $.fn.orbit = function(method) {

        // Method calling logic
        if (methods[method]) {
            return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
        }
        else if (typeof method === 'object' || !method) {
            return methods.initialise.apply(this, arguments);
        }
        else {
            $.error('Method ' + method + ' does not exist on jQuery.orbit');
        }

    };
})(jQuery);

;var Dragon=(function(){var __map,__fbDefaults;__fbDefaults={type:"ajax",width:1000,height:680,padding:0,bullets:true,scrolling:false,autoScale:false,titleShow:false,autoDimensions:false,centerOnScroll:false};function _onOverlayDisplay(){$('.main .slideshow').orbit('pause');}
function _overlayDestroy(){$('body').removeClass('overlayed');$('.main .slideshow').orbit('resume');$.address.value("/");}
function _getOrbitParams($slideshow){var params=($slideshow.hasClass('autofade'))?{timer:true,animation:"fade",rate:3000,arrows:false,bullets:false}:{animation:"horizontal-stack"};console.log("params",params);return params;}
function _slidesDisplay(){var $slideshow=$('#fancybox-content .slideshow');_onOverlayDisplay();$slideshow.orbit(_getOrbitParams($slideshow));}
function _slidesDestroy(){_overlayDestroy();$('#fancybox-content .slideshow').orbit('destroy');}
function _mapDisplay(){_onOverlayDisplay();var $find,map,latlngs,map_opts,map_image;map=document.getElementById("map");$find=$(map);latlngs={'london':new google.maps.LatLng(51.526193,-0.078847),'dublin':new google.maps.LatLng(53.336005,-6.24415)};map_opts={zoom:16,center:latlngs[window.locale],mapTypeId:google.maps.MapTypeId.ROADMAP};function mapAddMarker(latlng,title){return new google.maps.Marker({position:latlng,map:__map,icon:"/assets/images/map_marker.png",title:title,draggable:true,animation:google.maps.Animation.DROP});}
__map=new google.maps.Map(map,map_opts);google.maps.event.addListenerOnce(__map,'tilesloaded',function(){$find.animate({opacity:1},500,function(){mapAddMarker(latlngs[window.locale],"Dragon");});});}
function _mapDestroy(){_overlayDestroy();google.maps.event.clearInstanceListeners(__map);}
function _getFBOptions(href){function _onOverlayStart(){$('body').addClass('overlayed');}
function getCallBack(displayed){var callback=null;switch(href){case"/":break;case"/contact":callback=displayed?_mapDisplay:_mapDestroy;break;default:callback=displayed?_slidesDisplay:_slidesDestroy;break;}
return callback;}
return $.extend({},__fbDefaults,{href:href,onStart:_onOverlayStart,onComplete:getCallBack(true),onClosed:getCallBack(false)});}
function _onFBClick(event){var href=$(this).attr('href');if(href!=="/"){$.address.value(href);$.address.title("Dragon: "+$(this).text());$.fancybox(_getFBOptions(href));event.preventDefault();}}
function _onMenuHover(event){var $el=$(this);if(event.type==='mouseenter'){$el.siblings().children('ul').slideUp('fast');$el.children('ul').stop(true,true).slideDown();}
else{$el.children('ul').slideUp('fast');}}
function _onHoverFade(event){var $el=$(event.data.el,this);(event.type==='mouseenter')?$el.fadeIn():$el.fadeOut();}
function _onDisjointFade(event){var $this=$(this),$el=$(event.data.el,this);if(event.type==='mouseenter'){$this.siblings().removeClass('active').each(function(){$("figcaption",this).fadeOut()});$el.css('left',($this.index(this.parent)+1)*30).fadeIn('slow',function(){$this.addClass('active')});}
else{}}
function _init(){$.address.externalChange(function(event){switch(event.path){case"/":$.fancybox.close();break;default:$.fancybox(_getFBOptions(event.path));break;}});$('#recent_work .slideshow').orbit({timer:true,rate:10000});$('#clients .slideshow').orbit({bullets:false,animation:"horizontal-push",timer:true,cycleLimit:1});$(".appendices").fancybox();$('body').delegate("#recent_work a.slide, ul.navigation a, ul.subnav a, a.modal","click",_onFBClick).delegate("ul.navigation > li","hover",_onMenuHover).delegate(".reveal figure","hover",{el:"figcaption"},_onHoverFade).delegate(".disjoint figure","hover",{el:"figcaption"},_onDisjointFade);}
_init();return this;}());
