var bustout=bustout||{}; bustout.version="0.1"; bustout.global=this; bustout.isArray=function(a){return a!=null&&typeof a==="object"&&"splice" in a&&"join" in a }; bustout.isString=function(a){return typeof a==="string" }; bustout.bind=function(d,a,f){var g=d.boundArgs_; if(arguments.length>2){var b=Array.prototype.slice.call(arguments,2); if(g){b.unshift.apply(b,g) }g=b }a=d.boundSelf_||a; d=d.boundFn_||d; var e; var c=a||bustout.global; if(g){e=function(){var h=Array.prototype.slice.call(arguments); h.unshift.apply(h,g); return d.apply(c,h) } }else{e=function(){return d.apply(c,arguments) } }e.boundArgs_=g; e.boundSelf_=a; e.boundFn_=d; return e }; bustout.extend=function(c,b){function a(){}a.prototype=b.prototype; c.superClass_=b.prototype; c.prototype=new a(); c.prototype.constructor=c }; bustout.sequence_=0; bustout.getNextSequence=function(){return bustout.sequence_++ }; var bustout=bustout||{}; bustout.Browser={}; bustout.Browser.IE=!!(window.attachEvent&&navigator.userAgent.indexOf("Opera")===-1); bustout.Browser.Opera=navigator.userAgent.indexOf("Opera")>-1; bustout.Browser.WebKit=navigator.userAgent.indexOf("AppleWebKit/")>-1; bustout.Browser.Gecko=navigator.userAgent.indexOf("Gecko")>-1&&navigator.userAgent.indexOf("KHTML")===-1; bustout.Browser.MobileSafari=!!navigator.userAgent.match(/Apple.*Mobile.*Safari/); bustout.dom=bustout.dom||{}; bustout.dom.NodeType={DOCUMENT:9}; bustout.dom.$=function(a){if(bustout.isString(a)){return document.getElementById(a) }return a }; bustout.dom.getElementsByClassName=function(c,h){if(document.getElementsByClassName){return h?h.getElementsByClassName(c):document.getElementsByClassName(c) }else{if(!!document.evaluate){var g=".//*[contains(concat(' ', @class, ' '), ' "+c+" ')]"; return bustout.dom.getElementsByXPath_(g,h) }else{var f=[]; var b=(bustout.dom.$(h)||document.body).getElementsByTagName("*"); var e=new RegExp("(^|\\s)"+c+"(\\s|$)"); for(var a=0,d=b.length; aparent.bustout.util.HashListener.instance_.setHash_("+parent.document.location.hash+"); window.onload = parent.bustout.util.HashListener.instance_.syncHash_;<\/script>"); c.close() }; bustout.util.HashListener.prototype.syncHash_=function(){var a=this.hash_; if(a!=document.location.hash){document.location.hash=a }}; bustout.util.HashListener.prototype.handlePropertyChange_=function(a){if(a.event.propertyName==="location"){this.check_() }}; bustout.util.HashListener.prototype.disposeInternal=function(){bustout.util.HashListener.superClass_.disposeInternal.call(this); if("onpropertychange" in document&&"attachEvent" in document){document.detachEvent("onpropertychange",this.iePropertyChangeFn_) }if(this.timer_){window.clearInterval(this.timer_); this.timer_=null }}; bustout.effects=bustout.effects||{}; bustout.effects.Effect=function(c,b,a){bustout.events.EventTarget.call(this); this.from_=c; this.to_=b; if(!a){a={} }this.duration_=a.duration||500; this.fps_=a.fps||50; this.transition_=a.transition||bustout.effects.Effect.Transition.LINEAR }; bustout.extend(bustout.effects.Effect,bustout.events.EventTarget); bustout.effects.Effect.EventType={START:"start_effect",RENDER:"render_effect",END:"end_effect"}; bustout.effects.Effect.Transition={LINEAR:function(a){return a }}; bustout.effects.Effect.compute=function(c,b,a){return(b-c)*a+c }; bustout.effects.Effect.prototype.time_=0; bustout.effects.Effect.prototype.timer_=null; bustout.effects.Effect.prototype.start=function(){this.time_=new Date().getTime()-this.time_; this.timer_=setInterval(bustout.bind(this.step_,this),Math.round(1000/this.fps_)); this.dispatchEvent(new bustout.events.Event(bustout.effects.Effect.EventType.START,this)) }; bustout.effects.Effect.prototype.step_=function(){var a=new Date().getTime(); if(a1?j[j.length-1]:j; this.images_[d]=h+c }}; bustout.extend(bustout.gallery.Gallery,bustout.events.EventTarget); bustout.gallery.Gallery.prototype.thumbnail_=null; bustout.gallery.Gallery.prototype.position_=1; bustout.gallery.Gallery.prototype.hashListener_=null; bustout.gallery.Gallery.prototype.ignoreNextHashChange_=false; bustout.gallery.Gallery.prototype.start=function(){this.hashListener_=new bustout.util.HashListener(); this.hashListener_.addEventListener(bustout.util.HashListener.EventType.CHANGE,bustout.bind(this.handleHashChange_,this)); var a=this.hashListener_.getHash(); this.hashItOut_(a) }; bustout.gallery.Gallery.prototype.handleHashChange_=function(a){if(!this.ignoreNextHashChange_){this.hashItOut_(a.target.getHash()) }this.ignoreNextHashChange_=false }; bustout.gallery.Gallery.prototype.hashItOut_=function(b){try{this.position_=Number(b?b.substring(1):1) }catch(a){this.position_=1 }if(this.thumbnail_){this.thumbnail_.setSelected(false) }var c=this.ids_[this.position_-1]; this.thumbnail_=this.thumbnails_[c]; this.thumbnail_.setSelected(true); this.image_.setSrc(this.images_[c]) }; bustout.gallery.Gallery.prototype.handleImageLoad_=function(a){this.image_.show(new bustout.effects.OpacityEffect(this.image_.getId(),0,1)) }; bustout.gallery.Gallery.prototype.handleImageShow_=function(a){this.setLinkHrefs_(); this.showLinks_() }; bustout.gallery.Gallery.prototype.handleThumbnailSelected_=function(a){this.hideLinks_(); if(this.thumbnail_&&this.thumbnail_!=a.target){this.thumbnail_.setSelected(false) }this.thumbnail_=a.target; this.image_.hide(); this.image_.setSrc(this.images_[this.thumbnail_.getId()]); this.position_=this.positions_[this.thumbnail_.getId()]; this.ignoreNextHashChange_=true }; bustout.gallery.Gallery.prototype.setLinkHrefs_=function(){var a=this.position_===this.ids_.length?1:this.position_+1; var b=this.position_===1?this.ids_.length:this.position_-1; this.nextLinkEl_.href="#"+a; this.backLinkEl_.href="#"+b }; bustout.gallery.Gallery.prototype.hideLinks_=function(){this.nextLinkEl_.style.display="none"; this.backLinkEl_.style.display="none" }; bustout.gallery.Gallery.prototype.showLinks_=function(){bustout.dom.overlay(bustout.dom.$(this.image_.getId()),this.linkContainerEl_); this.nextLinkEl_.style.display=""; this.backLinkEl_.style.display="" }; bustout.gallery.Gallery.prototype.next_=function(){var a=this.position_+1; if(a>this.ids_.length){a=1 }this.thumbnails_[this.ids_[a-1]].setSelected(true); this.ignoreNextHashChange_=true }; bustout.gallery.Gallery.prototype.back_=function(){var a=this.position_-1; if(a<1){a=this.ids_.length }this.thumbnails_[this.ids_[a-1]].setSelected(true); this.ignoreNextHashChange_=true }; bustout.gallery.Gallery.prototype.disposeInternal=function(){if(this.image_){this.image_.dispose(); this.image_=null }for(id in this.images_){this.images_[id]=null; delete this.images_[id] }for(id in this.thumbnails_){this.thumbnails_[id].dispose(); this.thumbnails_[id]=null; delete this.thumbnails_[id] }if(this.linkContainerEl_){this.linkContainerEl_=null }if(this.nextLinkEl_){this.nextLinkEl_.onclick=null; this.nextLinkEl_=null }if(this.backLinkEl_){this.backLinkEl_.onclick=null; this.backLinkEl_=null }if(this.hashListener_){this.hashListener_.dispose(); this.hashListener_=null }}; bustout.gallery=bustout.gallery||{}; bustout.gallery.Carousel=function(b,m,o){bustout.events.EventTarget.call(this); this.id_=b; var e=bustout.dom.$(this.id_); var j=document.createElement("img"); var g=document.createElement("img"); var i=j.id=this.id_+bustout.getNextSequence(); var c=g.id=this.id_+bustout.getNextSequence(); j.className=g.className=e.className; j.style.cssText=g.style.cssText=e.style.cssText; var k=bustout.dom.getCssDisplay(e); var a=bustout.dom.getCssPosition(e); var h=bustout.dom.getCssFloat(e); var l=e.style.display; try{var n=false; if(a!="absolute"&&k=="inline"||(a=="static"||a=="relative")&&!h){n=true; e.style.display="none" }if(a=="fixed"){j.style.position=g.style.position=a }else{j.style.position=g.style.position="absolute" }j.style.top=g.style.top=e.offsetTop+"px"; if(e.direction&&e.dir==="rtl"){j.style.right=g.style.right=e.offsetRight+"px" }else{j.style.left=g.style.left=e.offsetLeft+"px" }}finally{if(n){e.style.display=l }}e.parentNode.appendChild(j); e.parentNode.appendChild(g); this.foo_=new bustout.gallery.Image(i); this.bar_=new bustout.gallery.Image(c); this.foo_.addEventListener(bustout.gallery.Image.EventType.LOAD,bustout.bind(this.handleImageLoad_,this)); this.bar_.addEventListener(bustout.gallery.Image.EventType.LOAD,bustout.bind(this.handleImageLoad_,this)); this.foo_.addEventListener(bustout.gallery.Image.EventType.SHOW,bustout.bind(this.handleImageShow_,this)); this.bar_.addEventListener(bustout.gallery.Image.EventType.SHOW,bustout.bind(this.handleImageShow_,this)); this.foo_.hide(); this.bar_.hide(); this.images_=m; if(!o){o={} }this.rate_=o.rate||2000; this.duration_=o.duration||500; this.cursor_=0; this.currentImage_=this.foo_; this.currentImage_.setSrc(this.images_[0]) }; bustout.extend(bustout.gallery.Carousel,bustout.events.EventTarget); bustout.gallery.Carousel.EventType={BEFORE_SWAP:"before_swap",AFTER_SWAP:"after_swap"}; bustout.gallery.Carousel.prototype.initialized_=false; bustout.gallery.Carousel.prototype.running_=false; bustout.gallery.Carousel.prototype.timer_=null; bustout.gallery.Carousel.prototype.previousImage_=null; bustout.gallery.Carousel.prototype.start=function(){if(!this.initialized_){setTimeout(bustout.bind(this.start,this),50) }else{this.running_=true; this.timer_=setTimeout(bustout.bind(this.swap_,this),this.rate_) }}; bustout.gallery.Carousel.prototype.stop=function(){clearTimeout(this.timer_); this.timer_=null; this.running_=false }; bustout.gallery.Carousel.prototype.getCurrentImage=function(){return this.currentImage_ }; bustout.gallery.Carousel.prototype.swap_=function(){this.dispatchEvent(new bustout.events.Event(bustout.gallery.Carousel.EventType.BEFORE_SWAP,this)); if(this.running_){if(this.cursor_==(this.images_.length-1)){this.cursor_=0 }else{this.cursor_++ }this.previousImage_=this.currentImage_; this.currentImage_=this.currentImage_==this.foo_?this.bar_:this.foo_; this.currentImage_.setSrc(this.images_[this.cursor_]) }}; bustout.gallery.Carousel.prototype.handleImageLoad_=function(a){if(this.previousImage_){this.previousImage_.hide(new bustout.effects.OpacityEffect(this.previousImage_.getId(),1,0,{duration:this.duration_})); this.previousImage_=null }this.currentImage_.show(new bustout.effects.OpacityEffect(this.currentImage_.getId(),0,1,{duration:this.duration_})) }; bustout.gallery.Carousel.prototype.handleImageShow_=function(a){this.dispatchEvent(new bustout.events.Event(bustout.gallery.Carousel.EventType.AFTER_SWAP,this)); if(!this.initialized_){this.initialized_=true }if(this.initialized_&&this.running_){this.timer_=setTimeout(bustout.bind(this.swap_,this),this.rate_) }}; bustout.gallery.Carousel.prototype.disposeInternal=function(){bustout.events.Event.superClass_.disposeInternal.call(this); this.foo_.dispose(); this.foo_=null; this.bar_.dispose(); this.bar_=null; this.currentImage_=null; this.images_=null; if(this.timer_){clearTimeout(this.timer_); this.timer_=null }};