/************************************************************************************************
* Floatbox v3.24
* December 01, 2008
*
* Copyright (C) 2008 Byron McGregor
* Website: http://randomous.com/tools/floatbox/
* License: Creative Commons Attribution 3.0 License (http://creativecommons.org/licenses/by/3.0/)
* This comment block must be retained in all deployments and distributions
*************************************************************************************************/

function Floatbox() {
    this.defaultOptions = {

        /***** BEGIN OPTIONS CONFIGURATION *****/
        // see docs/options.html for detailed descriptions

        /*** <General Options> ***/
        theme: 'custom', // 'auto'|'black'|'white'|'blue'|'yellow'|'red'|'custom'
        padding: 12, // pixels
        panelPadding: 8, // pixels
        outerBorder: 1, // pixels
        innerBorder: 0, // pixels
        overlayOpacity: 85, // 0-100
        controlOpacity: 60, // 0-100
        autoSizeImages: true, // true|false
        autoSizeOther: false, // true|false
        resizeImages: true, // true|false
        resizeOther: false, // true|false
        resizeTool: 'cursor', // 'cursor'|'topleft'|'both'
        infoPos: 'bl', // 'tl'|'tc'|'tr'|'bl'|'bc'|'br'
        controlPos: 'br', // 'tl'|'tr'|'bl'|'br'
        boxLeft: 'auto', // 'auto'|pixels|'[-]xx%'
        boxTop: 'auto', // 'auto'|pixels|'[-]xx%'
        shadowType: 'none', // 'drop'|'halo'|'none'
        shadowSize: 8, // 8|12|16|24
        enableDrag: true, // true|false
        showCaption: true, // true|false
        showItemNumber: true, // true|false
        showClose: true, // true|false
        hideFlash: true, // true|false
        hideJava: true, // true|false
        disableScroll: false, // true|false
        autoGallery: false, // true|false
        preloadAll: true, // true|false
        enableCookies: false, // true|false
        cookieScope: 'site', // 'site'|'folder'
        language: 'auto', // 'auto'|'en'|... (see the languages folder)
        graphicsType: 'auto', // 'auto'|'international'|'english'
        urlGraphics: '/floatbox/graphics/', // change this if you install in another folder
        urlLanguages: '/floatbox/languages/', // change this if you install in another folder
        /*** </General Options> ***/

        /*** <Navigation Options> ***/
        navType: 'button', // 'overlay'|'button'|'both'|'none'
        navOverlayWidth: 35, // 0-50
        navOverlayPos: 30, // 0-100
        showNavOverlay: 'never', // 'always'|'once'|'never'
        showHints: 'once', // 'always'|'once'|'never'
        enableWrap: true, // true|false
        enableKeyboardNav: true, // true|false
        outsideClickCloses: true, // true|false
        numIndexLinks: 0, // number, -1 = no limit
        indexLinksPanel: 'control', // 'info'|'control'
        showIndexThumbs: true, // true|false
        /*** </Navigation Options> ***/

        /*** <Animation Options> ***/
        doAnimations: true, // true|false
        resizeDuration: 3.5, // 0-10
        imageFadeDuration: 3.5, // 0-10
        overlayFadeDuration: 4, // 0-10
        splitResize: 'no', // 'no'|'auto'|'wh'|'hw'
        startAtClick: true, // true|false
        zoomImageStart: true, // true|false
        liveImageResize: false, // true|false
        /*** </Animation Options> ***/

        /*** <Slideshow Options> ***/
        slideInterval: 4.5, // seconds
        endTask: 'exit', // 'stop'|'exit'|'loop'
        showPlayPause: true, // true|false
        startPaused: false, // true|false
        pauseOnResize: true, // true|false
        pauseOnPrev: true, // true|false
        pauseOnNext: false   // true|false
        /*** </Slideshow Options> ***/
    };

    /*** <New Child Window Options> ***/
    // Will inherit from the primary floatbox options unless overridden here
    // Add any you like
    this.childOptions = {
        overlayOpacity: 45,
        resizeDuration: 3,
        imageFadeDuration: 3,
        overlayFadeDuration: 0
    };
    /*** </New Child Window Options> ***/

    /***** END OPTIONS CONFIGURATION *****/
    this.init();
}
Floatbox.prototype = { panelGap: 22, infoLinkGap: 16, showHintsTime: 1600, zoomPopBorder: 1, controlSpacing: 0, minInfoWidth: 80, minIndexWidth: 120, ctrlJump: 5, slowLoadDelay: 750, loaderDelay: 200, autoSizeSpace: 4, initialSize: 120, defaultWidth: "85%", defaultHeight: "82%", init: function() { this.setOptions(this.defaultOptions); if (typeof fbPageOptions === "object") { this.setOptions(fbPageOptions) } this.setOptions(this.parseOptionString(location.search.substring(1))); this.items = []; this.nodeNames = []; this.hiddenEls = []; this.timeouts = {}; this.pos = {}; var path = this.urlGraphics; this.slowZoomImg = path + "loading_white.gif"; this.slowLoadImg = path + "loading_black.gif"; this.iframeSrc = path + "loading_iframe.html"; this.resizeUpCursor = path + "magnify_plus.cur"; this.resizeDownCursor = path + "magnify_minus.cur"; this.notFoundImg = path + "404.jpg"; var agent = navigator.userAgent, version = navigator.appVersion; this.mac = version.indexOf("Macintosh") !== -1; if (window.opera) { this.opera = true; this.operaOld = parseFloat(version) < 9.5; this.operaMac = this.mac } else { if (document.all) { this.ie = true; this.ieOld = parseInt(version.substr(version.indexOf("MSIE") + 5), 10) < 7; this.ie8b2 = version.indexOf("MSIE 8.0") !== -1 && navigator.appMinorVersion === "beta 2"; this.ieXP = parseInt(version.substr(version.indexOf("Windows NT") + 11), 10) < 6 } else { if (agent.indexOf("Firefox") !== -1) { this.ff = true; this.ffOld = parseInt(agent.substr(agent.indexOf("Firefox") + 8), 10) < 3; this.ffNew = !this.ffOld; this.ffMac = this.mac } else { if (version.indexOf("WebKit") !== -1) { this.webkit = true; this.webkitNew = parseInt(version.substr(version.indexOf("WebKit") + 7), 10) >= 500; this.webkitOld = !this.webkitNew; this.webkitMac = this.mac } } } } this.isChild = !!(self.fb && self.fb.fbBox); if (!this.isChild) { this.fbParent = this.lastChild = this; this.anchors = []; this.children = []; this.preloads = {}; this.preloads.count = 0; this.html = document.documentElement; this.bod = document.body || document.getElementsByTagName("body")[0]; this.rtl = this.getStyle(this.bod, "direction") === "rtl" || this.getStyle(this.html, "direction") === "rtl"; this.xhr = this.getXMLHttpRequest(); this.strings = { hintClose: "Exit (key: Esc)", hintPrev: "Previous (key: <--)", hintNext: "Next (key: -->)", hintPlay: "Play (key: spacebar)", hintPause: "Pause (key: spacebar)", hintResize: "Resize (key: Tab)", imgCount: "Image %1 of %2", nonImgCount: "Page %1 of %2", mixedCount: "(%1 of %2)", infoText: "Info...", printText: "Print..."} } else { this.fbParent = fb.lastChild; fb.lastChild = this; fb.children.push(this); if (this.fbParent.isSlideshow) { this.fbParent.setPause(true) } this.anchors = fb.anchors; this.children = fb.children; this.html = fb.html; this.bod = fb.bod; this.rtl = fb.rtl; this.xhr = fb.xhr; this.strings = fb.strings } this.browserLanguage = (navigator.language || navigator.userLanguage || navigator.systemLanguage || navigator.browserLanguage || "en").substring(0, 2); if (!this.isChild) { var lang = this.language === "auto" ? this.browserLanguage : this.language; if (this.xhr) { var that = this; this.xhr.getResponse(this.urlLanguages + lang + ".json", function(xhr) { if ((xhr.status === 200 || xhr.status === 203 || xhr.status === 304) && xhr.responseText) { var ltArrow = String.fromCharCode(8592), rtArrow = String.fromCharCode(8594), text = xhr.responseText; if (that.ieXP) { text = text.replace(ltArrow, "<--").replace(rtArrow, "-->") } try { var obj = eval("(" + text + ")"); if (obj && obj.hintClose) { that.strings = obj } } catch (e) { } } if (that.rtl) { if (!/^(ar|he)$/.test(that.language)) { that.strings.infoText = that.strings.infoText.replace("...", ""); that.strings.printText = that.strings.printText.replace("...", "") } that.strings.hintPrev = that.strings.hintPrev.replace(ltArrow, rtArrow).replace("-->", "<--"); that.strings.hintNext = that.strings.hintNext.replace(rtArrow, ltArrow).replace("<--", "-->"); var t = that.strings.hintPrev; that.strings.hintPrev = that.strings.hintNext; that.strings.hintNext = t } }) } } if (!this.rtl && (this.graphicsType.toLowerCase() === "english" || (this.graphicsType === "auto" && this.browserLanguage === "en"))) { this.offPos = "top left"; this.onPos = "bottom left" } else { this.offPos = "top right"; this.onPos = "bottom right"; this.controlSpacing = 0 } this.zIndex = { base: 90000 + 10 * this.children.length, fbOverlay: 1, fbBox: 2, fbCanvas: 3, fbMainDiv: 4, fbLeftNav: 5, fbRightNav: 5, fbOverlayPrev: 6, fbOverlayNext: 6, fbResizer: 7, fbZoomDiv: 8, fbInfoPanel: 8, fbControlPanel: 8 }; var match = /\bautoStart=(.+?)(?:&|$)/i.exec(location.search); this.autoHref = match ? match[1] : false }, tagAnchors: function(D) { var C = fb.lastChild, B = this.ieOld && /^fb/.test(D.id); function A(I) { var K = D.getElementsByTagName(I); for (var H = 0, E = K.length; H < E; H++) { var J = K[H], G = C.parseOptionString(J.getAttribute("rev")), F = G.href || J.getAttribute("href"); if (C.autoGallery && C.fileType(F) === "img" && J.getAttribute("rel") !== "nofloatbox") { J.setAttribute("rel", "floatbox.autoGallery"); if (C.autoTitle && !J.getAttribute("title")) { J.setAttribute("title", C.autoTitle) } } if (B) { J.setAttribute("hideFocus", "true") } C.tagOneAnchor(J, G) } } A("a"); A("area") }, tagOneAnchor: function(F, M) { var J = this, A = !!F.getAttribute; if (A) { var K = { rel: F.getAttribute("rel"), rev: F.getAttribute("rev"), title: F.getAttribute("title"), anchor: F, thumb: this.getThumb(F) }; var I; if (K.thumb && (I = /(?:^|\s)fbPop(up|down)(?:\s|$)/i.exec(F.className))) { var G = (I[1] === "up"); K.popup = true; K.thumb.style.borderWidth = this.zoomPopBorder + "px"; F.onmouseover = function() { K.thumb.style.display = "none"; var O = J.getLeftTop(this, true), P = O.left, U = O.top; O = J.getLayout(this); K.thumb.style.display = ""; var R = (O.width - K.thumb.offsetWidth) / 2, T = G ? 2 - K.thumb.offsetHeight : O.height, N = J.getScroll(), Q = N.left + J.getDisplayWidth(); var S = O.left + R + K.thumb.offsetWidth - Q; if (S > 0) { R -= S } var S = O.left + R - N.left; if (S < 0) { R -= S } if (G) { if (O.top + T < N.top) { T = O.height } } else { if (O.top + T + K.thumb.offsetHeight > N.top + J.getDisplayHeight()) { T = 2 - K.thumb.offsetHeight } } K.thumb.style.left = (P + R) + "px"; K.thumb.style.top = (U + T) + "px" }; F.onmouseout = function() { K.thumb.style.left = "0"; K.thumb.style.top = "-9999px" }; if (!F.onclick) { F.onclick = F.onmouseout } } } else { var K = F } if (/^(floatbox|gallery|iframe|slideshow|lytebox|lyteshow|lyteframe|lightbox)/i.test(K.rel)) { K.revOptions = M || this.parseOptionString(K.rev); K.href = K.revOptions.href || F.href || F.getAttribute("href"); K.level = this.children.length + (fb.lastChild.fbBox && !K.revOptions.sameBox ? 1 : 0); var H, E = this.anchors.length; while (E--) { H = this.anchors[E]; if (H.href === K.href && H.rel === K.rel && H.rev === K.rev && H.title === K.title && H.level === K.level) { H.anchor = F; break } } if (E === -1) { K.type = K.revOptions.type || this.fileType(K.href); if (K.type === "html") { K.type = "iframe"; var I = /#(\w+)/.exec(K.href); if (I) { var L = document; if (K.anchor) { L = K.anchor.ownerDocument || K.anchor.document || L } if (L === document && this.currentItem && this.currentItem.anchor) { L = this.currentItem.anchor.ownerDocument || this.currentItem.anchor.document || L } var C = L.getElementById(I[1]); if (C) { K.type = "inline"; K.sourceEl = C } } } this.anchors.push(K); if (this.autoHref) { if (K.revOptions.showThis !== false && this.autoHref === K.href.substr(K.href.length - this.autoHref.length)) { this.autoStart = K } } else { if (K.revOptions.autoStart === true) { this.autoStart = K } else { if (K.revOptions.autoStart === "once") { var I = /fbAutoShown=(.+?)(?:;|$)/.exec(document.cookie), D = I ? I[1] : "", B = escape(K.href); if (D.indexOf(B) === -1) { this.autoStart = K; document.cookie = "fbAutoShown=" + D + B + "; path=/" } } } } } if (A) { F.onclick = function(Q) { Q = Q || window.event; if (this.ie && !Q) { var P = self.frames, N = P.length; while (N-- && !Q) { try { if (typeof P[N].window === "object") { Q = P[N].window.event } } catch (O) { } } } if (!(Q && (Q.ctrlKey || Q.metaKey || Q.shiftKey)) || K.revOptions.showThis === false || !/img|iframe/.test(K.type)) { fb.start(this); if (this.ie && Q) { Q.returnValue = false } return false } } } } return K }, fileType: function(A) { var C = A.toLowerCase(), B = C.indexOf("?"); if (B !== -1) { C = C.substr(0, B) } C = C.substr(C.lastIndexOf(".") + 1); if (/^(jpe?g|png|gif|bmp)$/.test(C)) { return "img" } if (C === "swf" || /^(http:)?\/\/(www.)?youtube.com\/v\//i.test(A)) { return "flash" } if (/^(mov|mpe?g|movie)$/.test(C)) { return "quicktime" } return "html" }, preloadImages: function(D, F) { if (this !== fb) { return fb.preloadImages(D, F) } if (typeof F !== "undefined") { arguments.callee.chain = F } if (!D && arguments.callee.chain && (this.preloadAll || !this.preloads.count)) { for (var E = 0, A = this.anchors.length; E < A; E++) { var B = this.anchors[E]; if (B.type === "img" && !this.preloads[B.href]) { D = B.href; break } } } if (D) { if (this.preloads[D]) { this.preloadImages() } else { var C = this.preloads[D] = new Image(); C.onerror = function() { setTimeout(function() { fb.preloadImages() }, 50); fb.preloads[D] = true }; C.onload = function() { fb.preloads.count++; this.onerror() }; C.src = D } } }, start: function(B) { if (this !== fb.lastChild) { return fb.lastChild.start(B) } var F = this; this.preloadImages("", false); if (B.getAttribute) { var A = { rel: B.getAttribute("rel"), rev: B.getAttribute("rev"), title: B.getAttribute("title") }; A.revOptions = this.parseOptionString(A.rev); A.href = A.revOptions.href || B.href || B.getAttribute("href"); B.blur() } else { var A = B } this.isRestart = !!this.fbBox; if (this.isRestart) { if (!A.revOptions.sameBox) { return new Floatbox().start(B) } this.setOptions(A.revOptions) } else { this.clickedAnchor = B.getAttribute ? B : false } A.level = this.children.length + (fb.lastChild.fbBox && !A.revOptions.sameBox ? 1 : 0); this.itemsShown = 0; fb.previousAnchor = this.currentItem; this.buildItemArray(A); if (!this.itemCount) { return } if (this.itemCount === 1 && this.fbNavControls) { this.fbNavControls.style.display = "none" } self.focus(); this.revOptions = A.revOptions; if (!this.isRestart) { this.getOptions(); this.buildDOM(); this.addEventHandlers(); this.initState() } this.collapse(); this.updatePanels(); var D = function() { F.fetchContent(function() { F.clearTimeout("slowLoad"); F.calcSize() }) }; if (this.fbBox.style.visibility || this.isRestart) { D() } else { var G = this.initialSize / 2, C = { id: "fbBox", left: F.pos.fbBox.left - G, top: F.pos.fbBox.top - G, width: F.initialSize, height: F.initialSize, borderWidth: F.outerBorder }; if (this.splitResize) { var E = function() { F.setSize(D, C) } } else { this.timeouts.slowLoad = setTimeout(function() { F.setSize(C) }, this.slowLoadDelay); var E = D } this.fadeOpacity(this.fbOverlay, this.overlayOpacity, this.overlayFadeDuration, E) } }, buildItemArray: function(B) { this.itemCount = this.items.length = this.currentIndex = 0; this.justImages = true; this.hasImages = false; var G = /^(floatbox|gallery|iframe|lytebox|lyteframe|lightbox)$/i.test(B.rel); for (var E = 0, A = this.anchors.length; E < A; E++) { var D = this.anchors[E]; if (D.rel === B.rel && D.level === B.level) { if (D.revOptions.showThis !== false) { var F = D.rev === B.rev && D.title === B.title && D.href === B.href.substr(B.href.length - D.href.length); if (F || !G) { D.seen = false; this.items.push(D); if (D.type === "img") { this.hasImages = true } else { this.justImages = false } if (F) { this.currentIndex = this.items.length - 1 } } } } } if (B.revOptions.showThis === false && B.href) { E = this.items.length; while (E--) { var C = this.items[E].href; if (C === B.href.substr(B.href.length - C.length)) { this.currentIndex = E } } } this.itemCount = this.items.length; this.currentItem = this.items[this.currentIndex] }, getOptions: function() { if (this.isChild) { for (var C in this.defaultOptions) { if (this.defaultOptions.hasOwnProperty(C)) { this[C] = this.fbParent[C] } } this.setOptions(this.childOptions) } else { this.setOptions(this.defaultOptions) } this.doSlideshow = this.loadPageOnClose = this.sameBox = false; if (!(this.isChild || this.fbBox)) { if (typeof setFloatboxOptions === "function") { setFloatboxOptions() } if (typeof fbPageOptions === "object") { this.setOptions(fbPageOptions) } if (this.enableCookies) { var B = /fbOptions=(.+?)(;|$)/.exec(document.cookie); if (B) { this.setOptions(this.parseOptionString(B[1])) } var D = ""; for (var C in this.defaultOptions) { if (this.defaultOptions.hasOwnProperty(C)) { D += " " + C + ":" + this[C] } } var F = "/"; if (this.cookieScope === "folder") { F = location.pathname; F = F.substring(0, F.lastIndexOf("/") + 1) } document.cookie = "fbOptions=" + D + "; path=" + F } } this.setOptions(this.revOptions); this.setOptions(this.parseOptionString(location.search.substring(1))); if (this.theme === "grey") { this.theme = "white" } if (this.endTask === "cont") { this.endTask = "loop" } if (this.navType === "upper") { this.navType = "overlay" } if (this.navType === "lower") { this.navType = "button" } if (this.upperOpacity) { this.controlOpacity = this.upperOpacity } if (this.upperNavWidth) { this.navOverlayWidth = this.upperNavWidth } if (this.upperNavPos) { this.navOverlayPos = this.upperNavPos } if (this.showUpperNav) { this.showNavOverlay = this.showUpperNav } if (this.dropShadow) { this.shadowType = "drop" } if (!/^(auto|black|white|blue|yellow|red|custom)$/.test(this.theme)) { this.theme = "auto" } if (!/^(overlay|button|both|none)$/i.test(this.navType)) { this.navType = "button" } if (!/^(auto|wh|hw)$/.test(this.splitResize)) { this.splitResize = false } if (this.webkitOld && (this.navType === "overlay" || this.navType === "both")) { this.navType = "button" } if (this.itemCount > 1) { this.isSlideshow = this.doSlideshow || /^(slideshow|lyteshow)/i.test(this.currentItem.rel); var E = /overlay|both/i.test(this.navType), A = /button|both/i.test(this.navType); this.navOverlay = this.justImages && E; this.navButton = A || (!this.justImages && E); this.lclShowItemNumber = this.showItemNumber; this.lclNumIndexLinks = this.numIndexLinks } else { this.isSlideshow = this.navOverlay = this.navButton = this.lclShowItemNumber = this.lclNumIndexLinks = false } this.isPaused = this.startPaused; if ((this.lclTheme = this.theme) === "auto") { this.lclTheme = this.currentItem.type === "img" ? "black" : /flash|quicktime/.test(this.currentItem.type) ? "blue" : "white" } if (!this.doAnimations) { this.resizeDuration = this.imageFadeDuration = this.overlayFadeDuration = 0 } if (!this.resizeDuration) { this.zoomImageStart = false } if (!/[tb][lr]/.test(this.controlPos)) { this.controlPos = "" } if (!/[tb][lcr]/.test(this.infoPos)) { this.infoPos = "" } this.controlTop = this.controlPos.charAt(0) === "t"; this.controlLeft = this.controlPos.charAt(1) === "l"; this.infoTop = this.infoPos.charAt(0) === "t"; this.infoCenter = this.infoPos.charAt(1) === "c"; this.infoLeft = this.infoPos.charAt(1) === "l" || (this.infoCenter && this.controlTop === this.infoTop && !this.controlLeft); if (this.infoLeft === this.controlLeft && this.infoTop === this.controlTop) { this.infoLeft = true; this.controlLeft = false } if (this.indexLinksPanel === "info") { this.indexCenter = this.infoCenter; this.indexLeft = this.infoLeft; this.indexTop = this.infoTop } else { this.indexLeft = this.controlLeft; this.indexTop = this.controlTop } if (!/^(drop|halo|none)$/.test(this.shadowType)) { this.shadowType = "drop" } if (!/^(8|12|16|24)$/.test(this.shadowSize + "")) { this.shadowSize = 8 } this.shadowSize = +this.shadowSize; if (this.opera || (this.mac && !this.webkitNew)) { this.resizeTool = "topleft" } else { this.resizeTool = this.resizeTool.toLowerCase(); if (!/topleft|cursor|both/.test(this.resizeTool)) { this.resizeTool = "cursor" } } if (this.ieOld) { this.shadowType = "none" } if (this.padding + this.outerBorder === 0) { this.zoomPopBorder = 0 } if (this.overlayOpacity > 1) { this.overlayOpacity /= 100 } if (this.controlOpacity > 1) { this.controlOpacity /= 100 } }, parseOptionString: function(H) { if (!H) { return {} } var G = [], E, C = /`([^`]*?)`/g; while ((E = C.exec(H))) { G.push(E[1]) } if (G.length) { H = H.replace(C, "``") } H = H.replace(/\s*[:=]\s*/g, ":"); H = H.replace(/\s*[;&]\s*/g, " "); H = H.replace(/^\s+|\s+$/g, ""); var B = {}, F = H.split(" "), D = F.length; while (D--) { var J = F[D].split(":"), A = J[0], I = J[1]; if (typeof I === "string") { if (!isNaN(I)) { I = +I } else { if (I === "true") { I = true } else { if (I === "false") { I = false } } } } if (I === "``") { I = G.pop() || "" } B[A] = I } return B }, setOptions: function(B) { for (var A in B) { if (B.hasOwnProperty(A)) { this[A] = B[A] } } }, buildDOM: function() { this.fbOverlay = this.newNode("div", "fbOverlay", this.bod); this.fbZoomDiv = this.newNode("div", "fbZoomDiv", this.bod); this.fbZoomImg = this.newNode("img", "fbZoomImg", this.fbZoomDiv); this.fbBox = this.newNode("div", "fbBox"); this.fbShadowTop = this.newNode("div", "fbShadowTop", this.fbBox); this.fbShadowRight = this.newNode("div", "fbShadowRight", this.fbBox); this.fbShadowBottom = this.newNode("div", "fbShadowBottom", this.fbBox); this.fbShadowLeft = this.newNode("div", "fbShadowLeft", this.fbBox); this.fbShadowCorner = this.newNode("div", "fbShadowCorner", this.fbBox); this.fbLoader = this.newNode("div", "fbLoader", this.fbBox); this.fbCanvas = this.newNode("div", "fbCanvas", this.fbBox); this.fbMainDiv = this.newNode("div", "fbMainDiv", this.fbCanvas); this.fbLeftNav = this.newNode("a", "fbLeftNav", this.fbMainDiv); this.fbRightNav = this.newNode("a", "fbRightNav", this.fbMainDiv); this.fbOverlayPrev = this.newNode("a", "fbOverlayPrev", this.fbMainDiv, this.strings.hintPrev); this.fbOverlayNext = this.newNode("a", "fbOverlayNext", this.fbMainDiv, this.strings.hintNext); this.fbResizer = this.newNode("a", "fbResizer", this.fbMainDiv, this.strings.hintResize); this.fbInfoPanel = this.newNode("div", "fbInfoPanel", this.fbCanvas); this.fbCaptionDiv = this.newNode("div", "fbCaptionDiv", this.fbInfoPanel); this.fbCaption = this.newNode("span", "fbCaption", this.fbCaptionDiv); this.fbInfoDiv = this.newNode("div", "fbInfoDiv", this.fbInfoPanel); if (this.infoLeft || this.infoCenter) { this.fbInfoLink = this.newNode("span", "fbInfoLink", this.fbInfoDiv); this.fbPrintLink = this.newNode("span", "fbPrintLink", this.fbInfoDiv); this.fbItemNumber = this.newNode("span", "fbItemNumber", this.fbInfoDiv) } else { this.fbItemNumber = this.newNode("span", "fbItemNumber", this.fbInfoDiv); this.fbPrintLink = this.newNode("span", "fbPrintLink", this.fbInfoDiv); this.fbInfoLink = this.newNode("span", "fbInfoLink", this.fbInfoDiv) } this.fbControlPanel = this.newNode("div", "fbControlPanel", this.fbCanvas); this.fbControls = this.newNode("div", "fbControls", this.fbControlPanel); this.fbNavControls = this.newNode("div", "fbNavControls", this.fbControls); this.fbPrev = this.newNode("a", "fbPrev", this.fbNavControls, this.strings.hintPrev); this.fbNext = this.newNode("a", "fbNext", this.fbNavControls, this.strings.hintNext); this.fbSubControls = this.newNode("div", "fbSubControls", this.fbControls); this.fbPlayPause = this.newNode("div", "fbPlayPause", this.fbSubControls); this.fbPlay = this.newNode("a", "fbPlay", this.fbPlayPause, this.strings.hintPlay); this.fbPause = this.newNode("a", "fbPause", this.fbPlayPause, this.strings.hintPause); this.fbClose = this.newNode("a", "fbClose", this.fbSubControls, this.strings.hintClose); this.fbIndexLinks = this.newNode("span", "fbIndexLinks", this.indexLinksPanel === "info" ? this.fbInfoPanel : this.fbControlPanel); this.bod.appendChild(this.fbBox) }, newNode: function(B, E, A, D) { if (this[E] && this[E].parentNode) { this[E].parentNode.removeChild(this[E]) } var C = document.createElement(B); C.id = E; C.className = E + "_" + (E.indexOf("fbShadow") === -1 ? this.lclTheme : this.shadowType + this.shadowSize); if (B === "a") { if (!this.operaOld) { C.setAttribute("href", "") } if (this.ieOld) { C.setAttribute("hideFocus", "true") } C.style.outline = "none" } else { if (B === "iframe") { C.setAttribute("scrolling", this.itemScroll); C.setAttribute("frameBorder", "0"); C.setAttribute("align", "middle"); C.src = this.iframeSrc } } if (this.isChild && this.fbParent[E]) { D = this.fbParent[E].getAttribute("title") } if (D && this.showHints !== "never") { C.setAttribute("title", D) } if (this.zIndex[E]) { C.style.zIndex = this.zIndex.base + this.zIndex[E] } C.style.display = "none"; if (A) { A.appendChild(C) } this.nodeNames.push(E); return C }, addEventHandlers: function() { var G = this, A = this.fbLeftNav.style, E = this.fbRightNav.style, D = this.fbOverlayPrev.style, B = this.fbOverlayNext.style, F = this.fbPrev.style, C = this.fbNext.style; if (this.showHints === "once") { this.hideHint = function(H) { if (G[H].title) { G.timeouts[H] = setTimeout(function() { G[H].title = G.fbParent[H].title = ""; var I = ""; if (/fbOverlay(Prev|Next)/.test(H)) { I = H.replace("Overlay", "") } else { if (/fb(Prev|Next)/.test(H)) { I = H.replace("fb", "fbOverlay") } } if (I) { G[I].title = G.fbParent[I].title = "" } }, G.showHintsTime) } } } else { this.hideHint = function() { } } this.fbPlay.onclick = function() { G.setPause(false); if (window.event) { event.returnValue = false } return false }; this.fbPause.onclick = function() { G.setPause(true); if (window.event) { event.returnValue = false } return false }; this.fbClose.onclick = function() { G.end(); if (window.event) { event.returnValue = false } return false }; if (this.outsideClickCloses) { this.fbOverlay.onclick = this.fbShadowTop.onclick = this.fbShadowRight.onclick = this.fbShadowBottom.onclick = this.fbShadowLeft.onclick = this.fbShadowCorner.onclick = this.fbClose.onclick } this[this.rtl ? "fbNext" : "fbPrev"].onclick = function(I) { if (typeof I !== "number") { I = 1 } var H = (G.currentIndex - I) % G.itemCount; if (H < 0) { H += G.itemCount } if (G.enableWrap || H < G.currentIndex) { G.newContent(H); if (G.isSlideshow && G.pauseOnPrev && !G.isPaused) { G.setPause(true) } } if (window.event) { event.returnValue = false } return false }; this[this.rtl ? "fbPrev" : "fbNext"].onclick = function(I) { if (typeof I !== "number") { I = 1 } var H = (G.currentIndex + I) % G.itemCount; if (G.enableWrap || H > G.currentIndex) { G.newContent(H); if (G.isSlideshow && G.pauseOnNext && !G.isPaused) { G.setPause(true) } } if (window.event) { event.returnValue = false } return false }; this.fbLeftNav.onclick = this.fbOverlayPrev.onclick = this.fbPrev.onclick; this.fbRightNav.onclick = this.fbOverlayNext.onclick = this.fbNext.onclick; this.fbLeftNav.onmouseover = this.fbLeftNav.onmousemove = this.fbOverlayPrev.onmousemove = function() { if (!G.timeouts.fbCanvas) { D.visibility = "" } if (G.navButton) { F.backgroundPosition = G.onPos } return true }; this.fbRightNav.onmouseover = this.fbRightNav.onmousemove = this.fbOverlayNext.onmousemove = function() { if (!G.timeouts.fbCanvas) { B.visibility = "" } if (G.navButton) { C.backgroundPosition = G.onPos } return true }; this.fbOverlayPrev.onmouseover = this.fbOverlayNext.onmouseover = function() { this.onmousemove(); G.hideHint(this.id); return true }; this.fbLeftNav.onmouseout = function() { D.visibility = "hidden"; if (G.navButton) { F.backgroundPosition = G.offPos } }; this.fbRightNav.onmouseout = function() { B.visibility = "hidden"; if (G.navButton) { C.backgroundPosition = G.offPos } }; this.fbOverlayPrev.onmouseout = this.fbOverlayNext.onmouseout = function() { this.style.visibility = "hidden"; G.clearTimeout(this.id) }; this.fbLeftNav.onmousedown = this.fbRightNav.onmousedown = function(H) { H = H || window.event; if (H.button === 2) { A.visibility = E.visibility = "hidden"; G.timeouts.hideNavOverlay = setTimeout(function() { A.visibility = E.visibility = "" }, 600) } }; this.fbPlay.onmouseover = this.fbPause.onmouseover = this.fbClose.onmouseover = this.fbPrev.onmouseover = this.fbNext.onmouseover = function() { this.style.backgroundPosition = G.onPos; G.hideHint(this.id); return true }; this.fbResizer.onmouseover = function() { G.hideHint(this.id); return true }; this.fbPlay.onmouseout = this.fbPause.onmouseout = this.fbClose.onmouseout = this.fbPrev.onmouseout = this.fbNext.onmouseout = function() { this.style.backgroundPosition = G.offPos; G.clearTimeout(this.id) }; this.fbResizer.onmouseout = function() { G.clearTimeout(this.id) }; if (this.enableKeyboardNav) { if (!document.keydownSet) { this.priorOnkeydown = document.onkeydown; document.onkeydown = this.keydownHandler; document.keydownSet = true } } else { if (document.keydownSet) { document.onkeydown = this.priorOnkeydown; document.keydownSet = false } } if (this.opera && !document.keypressSet) { this.priorOnkeypress = document.onkeypress; document.onkeypress = function() { return false }; document.keypressSet = true } if (this.enableDrag) { this.fbBox.onmousedown = this.dragonDrop() } }, keydownHandler: function(C) { C = C || window.event; var A = fb.lastChild, B = C.keyCode || C.which; switch (B) { case 37: case 39: if (A.itemCount > 1) { A[B === 37 ? "fbPrev" : "fbNext"].onclick((C.ctrlKey || C.metaKey) ? A.ctrlJump : 1); if (A.showHints === "once") { A.fbPrev.title = A.fbNext.title = A.fbOverlayPrev.title = A.fbOverlayNext.title = "" } } return false; case 32: if (A.isSlideshow) { A.setPause(!A.isPaused); if (A.showHints === "once") { A.fbPlay.title = A.fbPause.title = "" } } return false; case 9: if (A.fbResizer.onclick) { A.fbResizer.onclick(); if (A.showHints === "once") { A.fbResizer.title = "" } } return false; case 27: if (A.showHints === "once") { A.fbClose.title = "" } A.end(); return false; case 13: return false } }, dragonDrop: function() { var B = this, A = this.fbBox; return function(H) { H = H || window.event; if (/fb(Box|Canvas|Info|Caption|Item|Control|Index)/.test((H.target || H.srcElement).id)) { var F = H.clientX, D = H.clientY, E = B.fbBox.style, I = B.fbContent.style, J = B.pos.fbBox, L = J.left, K = J.top; J.dx = J.dy = 0; var G = function(M) { if (B.currentItem.type === "iframe" && !(B.ie || B.opera) && !I.visibility) { I.visibility = "hidden" } if (B.isSlideshow && !B.isPaused) { B.setPause(true) } M = M || window.event; J.dx = M.clientX - F; J.dy = M.clientY - D; E.left = (L + J.dx) + "px"; E.top = (K + J.dy) + "px"; (M.stopPropagation && M.stopPropagation()) || (M.cancelBubble = true); B.clearTimeout("dragonDrop"); B.timeouts.dragonDrop = setTimeout(C, 1500); return false }; var C = function(M) { B.clearTimeout("dragonDrop"); M = M || window.event; if (document.removeEventListener) { document.removeEventListener("mouseup", C, true); document.removeEventListener("mousemove", G, true) } else { if (A.detachEvent) { A.detachEvent("onlosecapture", C); A.detachEvent("onmouseup", C); A.detachEvent("onmousemove", G); A.releaseCapture() } } if (M) { (M.stopPropagation && M.stopPropagation()) || (M.cancelBubble = true) } J.left += J.dx; J.top += J.dy; I.visibility = ""; return false }; if (document.addEventListener) { document.addEventListener("mousemove", G, true); document.addEventListener("mouseup", C, true) } else { if (A.attachEvent) { A.setCapture(); A.attachEvent("onmousemove", G); A.attachEvent("onmouseup", C); A.attachEvent("onlosecapture", C) } } return false } } }, initState: function() { var K = this, H = this.fbBox.style, E = this.fbMainDiv.style, D = this.fbCanvas.style, C = this.fbZoomDiv.style, I = this.fbZoomImg.style; if (this.currentItem.popup) { this.currentItem.anchor.onmouseover() } var B = this.getAnchorPos(this.clickedAnchor, this.currentItem.anchor === this.clickedAnchor && this.currentItem.type === "img"); if (B.width) { this.pos.fbZoomDiv = B; C.borderWidth = this.zoomPopBorder + "px"; C.left = (B.left - this.zoomPopBorder) + "px"; C.top = (B.top - this.zoomPopBorder) + "px"; C.width = (this.fbZoomImg.width = B.width) + "px"; C.height = (this.fbZoomImg.height = B.height) + "px"; this.fbZoomImg.src = B.src; H.visibility = "hidden"; this.timeouts.slowLoad = setTimeout(function() { if (K.fbOverlay.style.display) { K.fadeOpacity(K.fbOverlay, K.overlayOpacity, K.overlayFadeDuration) } K.fbZoomImg.src = K.slowZoomImg; C.display = I.display = "" }, this.slowLoadDelay) } else { this.pos.fbBox = B; this.pos.fbBox.borderWidth = 0; this.pos.fbMainDiv = { width: 0, height: 0} } H.position = "absolute"; H.left = H.top = H.width = H.height = H.borderWidth = "0"; E.borderWidth = this.innerBorder + "px"; E.left = this.padding + "px"; this.fbControlPanel.style[this.controlLeft ? "left" : "right"] = this.fbInfoPanel.style[this.infoLeft ? "left" : "right"] = Math.max(this.padding, this.panelPadding) + "px"; D.visibility = "hidden"; H.display = D.display = ""; if (this.shadowType === "none") { this.shadowSize = 0 } else { var J = this.fbShadowTop.style, A = this.fbShadowRight.style, L = this.fbShadowBottom.style, G = this.fbShadowLeft.style, F = this.fbShadowCorner.style; A.top = L.left = G.top = -this.outerBorder + "px"; A.paddingRight = L.paddingBottom = F.paddingRight = F.paddingBottom = (this.outerBorder + this.shadowSize) + "px"; if (this.shadowType === "halo") { J.paddingRight = A.paddingBottom = L.paddingRight = G.paddingBottom = (this.outerBorder * 2 + this.shadowSize) + "px"; J.top = J.left = A.top = G.left = -(this.outerBorder + this.shadowSize) + "px" } else { L.backgroundPosition = "bottom left"; A.paddingBottom = L.paddingRight = this.outerBorder * 2 + "px" } } if (this.navOverlay) { if (fb.showNavOverlay === "never" || (fb.showNavOverlay === "once" && fb.navOverlayShown)) { fb.showNavOverlay = false } else { this.fbOverlayPrev.style.backgroundPosition = this.fbOverlayNext.style.backgroundPosition = this.onPos; this.fadeOpacity(this.fbOverlayPrev, this.controlOpacity); this.fadeOpacity(this.fbOverlayNext, this.controlOpacity) } } this.initPanels(); this.lastShown = false; if (this.hideFlash) { this.hideElements("flash") } if (this.hideJava) { this.hideElements("applet") } if (this.ieOld) { this.hideElements("select"); this.fbOverlay.style.position = "absolute"; this.stretchOverlay()(); attachEvent("onresize", this.stretchOverlay()); attachEvent("onscroll", this.stretchOverlay()) } }, hideElements: function(G, I) { if (!I) { this.hideElements(G, self) } else { var B, H = G === "flash" ? ["object", "embed"] : [G]; try { while ((B = H.pop())) { var C = I.document.getElementsByTagName(B), D = C.length; while (D--) { var A = C[D]; if (A.style.visibility !== "hidden" && (B !== "object" || (A.getAttribute("type") && A.getAttribute("type").toLowerCase() === "application/x-shockwave-flash") || (A.getAttribute("classid") && A.getAttribute("classid").toLowerCase() === "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000") || /data\s*=\s*"?[^>"]+\.swf\b/i.test(A.innerHTML) || /param\s+name\s*=\s*"?(movie|src)("|\s)[^>]+\.swf\b/i.test(A.innerHTML))) { this.hiddenEls.push(A); A.style.visibility = "hidden" } } } } catch (F) { } var E = I.frames, D = E.length; while (D--) { try { if (typeof E[D].window === "object") { this.hideElements(G, E[D].window) } } catch (F) { } } } }, getAnchorPos: function(F, B) { var G = this.getDisplaySize(), I = this.getScroll(), C = { left: G.width / 2 + I.left, top: G.height / 3 + I.top, width: 0, height: 0 }; var A = B ? this.getThumb(F) : false; if (A && this.zoomImageStart) { var H = this.getLeftTop(A), E = (A.offsetWidth - A.width) / 2; H.left += E; H.top += E; H.width = A.width; H.height = A.height; H.src = A.src } else { if (this.startAtClick && F && F.offsetWidth && F.tagName.toLowerCase() === "a") { var H = this.getLayout(A || F) } else { return C } } var D = { left: H.left + H.width / 2, top: H.top + H.height / 2, width: 0, height: 0 }; if (D.left < I.left || D.left > (I.left + G.width) || D.top < I.top || D.top > (I.top + G.height)) { return C } return (A && this.zoomImageStart ? H : D) }, getThumb: function(B) { var A = B && B.childNodes, C = (A && A.length) || 0; while (C--) { if ((A[C].tagName || "").toLowerCase() === "img") { return A[C] } } return false }, initPanels: function() { var C = this.fbInfoPanel.style, O = this.fbInfoLink.style, K = this.fbPrintLink.style, B = this.fbItemNumber.style; if (this.infoCenter) { var E = " posCenter"; C.textAlign = "center"; O.paddingLeft = K.paddingLeft = B.paddingLeft = O.paddingRight = K.paddingRight = B.paddingRight = (this.infoLinkGap / 2) + "px" } else { if (this.infoLeft) { var E = " posLeft"; C.textAlign = "left"; O.paddingRight = K.paddingRight = this.infoLinkGap + "px" } else { var E = " posRight"; C.textAlign = "right"; O.paddingLeft = K.paddingLeft = this.infoLinkGap + "px" } } this.fbInfoPanel.className += E; this.fbInfoDiv.className += E; C.width = "400px"; var N = this.fbControlPanel.style, G = this.fbControls.style, I = this.fbSubControls.style; if (this.controlLeft) { var F = " posLeft"; N.textAlign = "left" } else { var F = " posRight"; N.textAlign = "right"; G.right = "0" } this.fbControlPanel.className += F; this.fbSubControls.className += F; if (!this.ieOld) { this.fbControls.className += F } if (this.navButton) { var J = this.fbPrev.style, L = this.fbNext.style, A = this.fbNavControls.style; J.backgroundPosition = L.backgroundPosition = this.offPos; A["padding" + (this.controlLeft ? "Left" : "Right")] = this.controlSpacing + "px"; this.fbNavControls.className += F; N.display = A.display = J.display = L.display = "" } var M = 0; if (this.showClose) { var H = this.fbClose.style; H.backgroundPosition = this.offPos; this.fbClose.className += F; N.display = G.display = I.display = H.display = ""; M = this.fbClose.offsetWidth } if (this.showPlayPause && this.isSlideshow) { var P = this.fbPlay.style, D = this.fbPause.style, R = this.fbPlayPause.style; P.backgroundPosition = D.backgroundPosition = this.offPos; R["padding" + (this.controlLeft ? "Left" : "Right")] = this.controlSpacing + "px"; this.fbPlayPause.className += F; N.display = G.display = I.display = R.display = P.display = D.display = ""; P.top = this.isPaused ? "" : "-9999px"; D.top = this.isPaused ? "-9999px" : ""; M += this.fbPlayPause.offsetWidth } I.width = M + "px"; N.width = G.width = (M + this.fbNavControls.offsetWidth) + "px"; if (this.lclNumIndexLinks) { var Q = this.fbIndexLinks.style; if (this.indexLinksPanel === "info") { this.fbIndexLinks.className += E; C.display = ""; if (this.showIndexThumbs) { C.overflow = "visible" } } else { this.fbIndexLinks.className += F; N.display = ""; if (this.showIndexThumbs) { N.overflow = "visible" } Q["padding" + (this.indexLeft ? "Left" : "Right")] = "2px" } Q.width = "250px"; Q.display = "" } }, fetchContent: function(G, B) { var E = this; if (!B) { if (this.fbContent) { this.fbMainDiv.removeChild(this.fbContent); delete this.fbContent; return this.timeouts.fetch = setTimeout(function() { E.fetchContent(G, 1) }, 10) } } var D = this.currentItem; D.nativeWidth = D.revOptions.width; D.nativeHeight = D.revOptions.height; if (D.type !== "img") { D.nativeWidth = D.nativeWidth || (fb.previousAnchor && fb.previousAnchor.nativeWidth) || this.defaultWidth; D.nativeHeight = D.nativeHeight || (fb.previousAnchor && fb.previousAnchor.nativeHeight) || this.defaultHeight } if (this.ieOld) { this.fbMainDiv.style.backgroundColor = D.type === "img" ? "#000" : "" } this.itemScroll = D.revOptions.scrolling || D.revOptions.scroll || "auto"; if (/img|iframe/.test(D.type)) { this.fbContent = this.newNode(D.type, "fbContent", this.fbMainDiv); if (D.type === "img") { var A = new Image(); A.onload = function() { D.nativeWidth = D.nativeWidth || A.width; D.nativeHeight = D.nativeHeight || A.height; E.fbContent.src = A.src; if (G) { G() } }; A.onerror = function() { if (this.src !== E.notFoundImg) { this.src = E.notFoundImg } }; A.src = D.href } } else { this.fbContent = this.newNode("div", "fbContent", this.fbMainDiv); this.fbContent.style.overflow = this.itemScroll === "yes" ? "scroll" : (this.itemScroll === "no" ? "hidden" : "auto"); if (D.type === "inline") { var C = D.sourceEl.cloneNode(true); C.style.display = C.style.visibility = ""; try { this.fbContent.appendChild(C) } catch (F) { this.setInnerHTML(this.fbContent, C.innerHTML) } this.tagAnchors(this.fbContent) } else { if (D.type === "ajax") { this.xhr.getResponse(D.href, function(H) { if ((H.status === 200 || H.status === 203 || H.status === 304) && H.responseText) { E.setInnerHTML(E.fbContent, H.responseText); E.tagAnchors(E.fbContent) } else { E.setInnerHTML(E.fbContent, '<p style="color:#000; background:#fff; margin:1em; padding:1em;">Unable to fetch content from ' + D.href + "</p>") } }) } } } this.fbContent.style.border = "0"; this.fbContent.style.display = ""; if (D.type !== "img" && G) { G() } }, updatePanels: function() { var C = this.fbInfoPanel.style, L = this.fbCaptionDiv.style, P = this.fbCaption.style, H = this.fbInfoDiv.style, Q = this.fbInfoLink.style, J = this.fbPrintLink.style, B = this.fbItemNumber.style, R = this.currentItem, K; C.display = L.display = P.display = H.display = Q.display = J.display = B.display = "none"; if (this.showCaption) { K = R.revOptions.caption || R.title || ""; if (K === "href") { K = this.encodeHTML(this.currentItem.href) } else { K = this.decodeHTML(K).replace(/&/g, "&amp;") } if (this.setInnerHTML(this.fbCaption, K) && K) { C.display = L.display = P.display = "" } } if (R.revOptions.info) { K = this.encodeHTML(this.decodeHTML(R.revOptions.info)); var A = R.revOptions.infoOptions || ""; if (A) { A = this.encodeHTML(this.decodeHTML(A)) } K = '<a href="' + K + '" rel="floatbox" rev="' + A + '"><b>' + (R.revOptions.infoText || this.strings.infoText) + "</b></a>"; if (this.setInnerHTML(this.fbInfoLink, K)) { C.display = H.display = Q.display = "" } } if (R.revOptions.showPrint) { var G = R.revOptions.printCSS || ""; K = '<a href="' + this.encodeHTML(this.currentItem.href) + '" onclick="fb.printContents(null, \'' + G + "'); if (window.event) event.returnValue = false; return false;\"><b>" + (R.revOptions.printText || this.strings.printText) + "</b></a>"; if (this.setInnerHTML(this.fbPrintLink, K)) { C.display = H.display = J.display = "" } } if (this.lclShowItemNumber) { K = this.justImages ? this.strings.imgCount : (this.hasImages ? this.strings.mixedCount : this.strings.nonImgCount); K = K.replace("%1", this.currentIndex + 1); K = K.replace("%2", this.itemCount); if (this.setInnerHTML(this.fbItemNumber, K)) { C.display = H.display = B.display = "" } } var F = this.fbInfoLink.offsetWidth + this.fbPrintLink.offsetWidth + this.fbItemNumber.offsetWidth; if (this.ie) { if (this.fbInfoLink.offsetWidth) { F += this.infoLinkGap } if (this.fbPrintLink.offsetWidth) { F += this.infoLinkGap } if (this.fbItemNumber.offsetWidth) { F += this.infoLinkGap } } H.width = F + "px"; if (this.lclNumIndexLinks) { K = ""; var N = this.itemCount - 1, S, E; if (this.lclNumIndexLinks === -1) { S = 0; E = N } else { var I = Math.floor(this.lclNumIndexLinks / 2) - 1; S = this.currentIndex - I; E = this.currentIndex + I; if (S <= 0) { E += Math.min(1 - S, I) } if (this.currentIndex === 0) { E++ } if (E - N >= 0) { S -= Math.min(1 + E - N, I) } if (this.currentIndex === N) { S-- } } var D = this.indexTop ? "down" : "up", M = 0; while (M < this.itemCount) { if (M !== 0 && M < S) { K += "... "; M = S } else { if (M !== N && M > E) { K += "... "; M = N } else { if (M !== this.currentIndex) { var R = this.items[M]; K += '<a class="fbPop' + D + '" rel="nofloatbox" href="' + R.href + '" onclick="fb.newContent(' + M + '); if (window.event) event.returnValue = false; return false;">' + ++M; try { if (this.showIndexThumbs && R.thumb) { K += '<img src="' + R.thumb.src + '" />' } } catch (O) { } K += "</a> " } else { K += ++M + " " } } } } if (this.setInnerHTML(this.fbIndexLinks, K)) { if (this.indexLinksPanel === "info") { C.display = "" } else { this.tagAnchors(this.fbIndexLinks) } } } if (!C.display) { this.tagAnchors(this.fbInfoPanel) } }, calcSize: function(h, A) { var i = this; if (!this.fbBox) { return } var L, K, M, T, B, F; if (typeof h === "undefined") { h = this.currentItem.type === "img" ? this.autoSizeImages : this.autoSizeOther } var E = this.fbBox.style, p = this.fbInfoPanel.style, C = this.fbControlPanel.style, D = this.fbIndexLinks.style, W = this.fbCaptionDiv.style, n = this.fbItemNumber.style; if (!A) { this.displaySize = this.getDisplaySize(); if (this.showCaption && this.fbCaption.innerHTML) { W.display = "" } if (this.lclShowItemNumber) { n.display = "" } } this.upperSpace = Math.max(this.infoTop ? this.fbInfoPanel.offsetHeight : 0, this.controlTop ? this.fbControlPanel.offsetHeight : 0); this.lowerSpace = Math.max(this.infoTop ? 0 : this.fbInfoPanel.offsetHeight, this.controlTop ? 0 : this.fbControlPanel.offsetHeight); if (this.upperSpace) { this.upperSpace += 2 * this.panelPadding } if (this.lowerSpace) { this.lowerSpace += 2 * this.panelPadding } this.upperSpace = Math.max(this.upperSpace, this.padding); this.lowerSpace = Math.max(this.lowerSpace, this.padding); var G; if (this.shadowType === "none") { G = 2 * this.autoSizeSpace } else { if (this.shadowType === "halo") { G = 2 * this.shadowSize + this.autoSizeSpace } else { G = this.shadowSize + 1.5 * this.autoSizeSpace } } var N = 2 * (this.outerBorder + this.innerBorder) + G, R = Math.floor(this.displaySize.width - N - 2 * this.padding), a = Math.floor(this.displaySize.height - N - this.upperSpace - this.lowerSpace), b = false, k = false; B = this.currentItem.nativeWidth + ""; if (B === "max") { B = R } else { if (B.substr(B.length - 1) === "%") { B = Math.floor(R * parseInt(B, 10) / 100) } else { B = parseInt(B, 10); b = true } } F = this.currentItem.nativeHeight + ""; if (F === "max") { F = a } else { if (F.substr(F.length - 1) === "%") { F = Math.floor(a * parseInt(F, 10) / 100) } else { F = parseInt(F, 10); k = true } } this.scaledBy = this.oversizedBy = 0; if (h) { var g = R / B, m = a / F, S = B, c = F; if (b && k) { g = m = Math.min(g, m) } if (g < 1) { B = Math.round(B * g) } if (m < 1) { F = Math.round(F * m) } this.scaledBy = Math.max(S - B, c - F); if (this.scaledBy && this.scaledBy < this.outerBorder + G + this.panelPadding) { B = S; F = c; this.scaledBy = 0 } } M = B + 2 * (this.innerBorder + this.padding); T = F + 2 * this.innerBorder + this.upperSpace + this.lowerSpace; var d = this.fbInfoPanel.offsetHeight, q = this.fbControlPanel.offsetHeight; var U = M - 2 * Math.max(this.padding, this.panelPadding); if (this.infoTop === this.controlTop && this.fbControls.offsetWidth) { U -= this.fbControls.offsetWidth + this.panelGap } if (U < 0) { U = 0 } p.width = U + "px"; if (!this.lclNumIndexLinks) { var P = 0 } else { if (this.indexLinksPanel === "info" || this.infoTop !== this.controlTop) { var P = U } else { if (this.indexLinksPanel !== "info" && this.infoTop === this.controlTop && this.infoCenter) { var P = Math.max(this.minIndexWidth, this.fbControls.offsetWidth) } else { var O = Math.max(this.fbCaption.offsetWidth, this.fbInfoLink.offsetWidth + this.fbPrintLink.offsetWidth + this.fbItemNumber.offsetWidth); var P = Math.max(this.minIndexWidth, this.fbControls.offsetWidth, (M - O - 2 * Math.max(this.padding, this.panelPadding))); if (O) { P -= this.panelGap } } } } if (P) { D.width = (P - (this.indexLinksPanel !== "info" ? 2 : 0)) + "px" } C.width = Math.max(P, this.fbControls.offsetWidth) + "px"; var Z = this.fbInfoPanel.offsetHeight !== d || this.fbControlPanel.offsetHeight !== q; if (this.showCaption) { if (this.minInfoWidth > U && !W.display) { W.display = "none"; Z = true } } if (this.lclShowItemNumber) { if (this.fbInfoLink.offsetWidth + this.fbPrintLink.offsetWidth + this.fbItemNumber.offsetWidth > U && !n.display) { n.display = "none"; Z = true } } if (Z && A !== 3) { return this.calcSize(h, (A || 0) + 1) } if (!h) { this.oversizedBy = Math.max(M - this.displaySize.width, T - this.displaySize.height) + 2 * this.outerBorder + G } if (this.oversizedBy < 0) { this.oversizedBy = 0 } if (this.shadowType === "halo") { G = this.shadowSize + this.autoSizeSpace / 2 } else { G = this.autoSizeSpace } if (typeof this.boxLeft === "number") { L = this.boxLeft } else { if (B === R) { L = G } else { var Q = this.displaySize.width - M - 2 * this.outerBorder; L = Math.floor(Q / 2); if (L < this.autoSizeSpace) { L = this.autoSizeSpace } else { if (typeof this.boxLeft === "string" && this.boxLeft.substr(this.boxLeft.length - 1) === "%") { L += parseInt(this.boxLeft, 10) / 100 * L } } } } if (typeof this.boxTop === "number") { K = this.boxTop } else { if (F === a) { K = G } else { var Q = this.displaySize.height - T - 2 * this.outerBorder, j = Q / this.displaySize.height, o; if (j <= 0.15) { o = 2 } else { if (j >= 0.3) { o = 3 } else { o = 1 + j / 0.15 } } K = Math.floor(Q / o); if (K < this.autoSizeSpace) { K = this.autoSizeSpace } else { if (typeof this.boxTop === "string" && this.boxTop.substr(this.boxTop.length - 1) === "%") { K += parseInt(this.boxTop, 10) / 100 * K } } } } var H = E.position; if (this.ieOld) { E.display = "none"; this.stretchOverlay()() } else { this.setPosition(this.fbBox, "fixed") } var l = this.getScroll(); this.setPosition(this.fbBox, H); E.display = ""; L += l.left; K += l.top; if (this.isChild) { var X = /max|%/i, Y = this.fbParent.pos.fbBox, f = X.test(this.currentItem.nativeWidth) ? 99999 : (Y.left + L) / 2, e = X.test(this.currentItem.nativeHeight) ? 99999 : (Y.top + K) / 2; if (l.left < f && l.top < e) { L = Math.min(L, f); K = Math.min(K, e) } } var V = (Y = this.pos.fbBox) && !this.liveResize && this.splitResize; if (V === "auto") { V = M - Y.width <= T - Y.height ? "wh" : "hw" } var J = function() { i.fbBox.style.visibility ? i.zoomIn() : i.showContent() }; var I = function() { i.setSize(V, { id: "fbBox", left: L, top: K, width: M, height: T, borderWidth: i.outerBorder }, { id: "fbMainDiv", width: B, height: F, top: i.upperSpace }, function() { i.timeouts.showContent = setTimeout(J, 10) }) }; this.timeouts.setSize = setTimeout(I, 10) }, setPosition: function(C, B) { if (C.style.position === B) { return } var A = this.getScroll(); if (B === "fixed") { A.left = -A.left; A.top = -A.top } if (this.pos[C.id]) { this.pos[C.id].left += A.left; this.pos[C.id].top += A.top } C.style.left = (C.offsetLeft + A.left) + "px"; C.style.top = (C.offsetTop + A.top) + "px"; C.style.position = B }, collapse: function(H, A) { var E = this; if (!A) { this.setPosition(this.fbBox, "absolute"); this.fbResizer.onclick = null; this.fbResizer.style.display = "none"; if (this.fbContent) { this.fbContent.onclick = null; this.fbContent.style.cursor = "" } if (this.navOverlay) { this.fbLeftNav.style.display = this.fbRightNav.style.display = this.fbOverlayPrev.style.display = this.fbOverlayNext.style.display = "none" } var C = 0, G = 0; if (this.currentItem.type === "img" && !this.fbCanvas.style.visibility) { if (this.currentItem === this.lastShown && this.liveImageResize) { C = 1 } G = this.imageFadeDuration } this.liveResize = (C === 1); var D = function() { E.collapse(H, 1) }; return this.fadeOpacity(this.fbCanvas, C, G, D) } if (!this.liveResize) { this.fbMainDiv.style.display = "none"; if (this.fbContent) { this.fbContent.style.display = "none" } this.clearTimeout("loader"); this.timeouts.loader = setTimeout(function() { E.fbLoader.style.display = "" }, this.loaderDelay) } var F = this.fbInfoPanel.style, B = this.fbControlPanel.style; F.visibility = B.visibility = "hidden"; F.left = B.left = "0"; F.top = B.top = "-9999px"; if (H) { H() } }, restore: function(M, J) { var G = this; if (!J) { if (this.fbShadowRight.style.display && this.shadowType !== "none") { this.fbShadowRight.style.display = this.fbShadowBottom.style.display = ""; if (this.shadowType === "halo") { this.fbShadowTop.style.display = this.fbShadowLeft.style.display = "" } else { this.fbShadowCorner.style.display = "" } } var K = this.fbInfoPanel.style, I = this.fbControlPanel.style, C = this.upperSpace + this.pos.fbMainDiv.height + 2 * this.innerBorder; K.top = (((this.infoTop ? this.upperSpace : this.lowerSpace) - this.fbInfoPanel.offsetHeight) / 2 - 1 + (this.infoTop ? 0 : C)) + "px"; I.top = (((this.controlTop ? this.upperSpace : this.lowerSpace) - this.fbControlPanel.offsetHeight) / 2 + (this.controlTop ? 0 : C)) + "px"; var C = Math.max(this.padding, this.panelPadding) + "px"; K.left = [this.infoLeft ? C : ""]; I.left = [this.controlLeft ? C : ""]; K.visibility = I.visibility = ""; this.clearTimeout("loader"); this.fbLoader.style.display = "none"; this.fbMainDiv.style.display = this.fbContent.style.display = ""; var F = (this.currentItem.type === "img" && !this.fbCanvas.style.visibility) ? this.imageFadeDuration : 0, D = function() { G.restore(M, 1) }; return this.fadeOpacity(this.fbCanvas, 1, F, D) } if (this.currentItem.type === "img" ? this.resizeImages : this.resizeOther) { var E = 0; if (this.scaledBy > 35) { E = 1 } else { if (this.oversizedBy > 28) { E = -1 } } if (E) { this.fbResizer.onclick = function() { if (G.isSlideshow && G.pauseOnResize && !G.isPaused) { G.setPause(true) } G.collapse(function() { G.calcSize(E === -1) }); if (window.event) { event.returnValue = false } return false }; if (this.currentItem.type === "img" && /cursor|both/.test(this.resizeTool)) { this.fbContent.style.cursor = "url(" + (E === -1 ? this.resizeDownCursor : this.resizeUpCursor) + "), default"; this.fbContent.onclick = this.fbResizer.onclick } if (this.currentItem.type !== "img" || /topleft|both/.test(this.resizeTool)) { this.fbResizer.style.backgroundPosition = (E === -1 ? "bottom" : "top"); this.fadeOpacity(this.fbResizer, this.controlOpacity) } } } if (this.navOverlay) { var H = this.fbLeftNav.style, L = this.fbRightNav.style, A = this.fbOverlayPrev.style, B = this.fbOverlayNext.style; H.width = L.width = Math.max(this.navOverlayWidth / 100 * this.pos.fbMainDiv.width, this.fbOverlayPrev.offsetWidth) + "px"; H.display = L.display = ""; if (fb.showNavOverlay) { A.visibility = B.visibility = "hidden"; A.display = B.display = ""; A.top = B.top = ((this.pos.fbMainDiv.height - this.fbOverlayPrev.offsetHeight) * this.navOverlayPos / 100) + "px" } } if (M) { M() } }, setSize: function(E) { var I = this, D = function() { }, H = [[], []], A = {}, C, G = arguments.length; if (E === "wh") { A.top = 1; A.height = 1 } else { if (E === "hw") { A.left = 1; A.width = 1 } } while (G--) { if (typeof arguments[G] === "object" && (C = this[arguments[G].id])) { var F = arguments[G]; if (!this.pos[F.id]) { this.pos[F.id] = {} } for (var K in F) { if (F.hasOwnProperty(K) && K !== "id") { var J = A[K] || 0; var B = this.pos[F.id][K]; if (typeof B !== "number" || C.style.display || C.style.visibility) { B = F[K] } H[J].push({ node: C, property: K, start: B, finish: F[K] }); if (F.id === "fbMainDiv") { H[J].push({ node: this.fbContent, property: K, start: B, finish: F[K] }) } if (F.id === "fbZoomDiv" && /\b(width|height)\b/i.test(K)) { H[J].push({ node: this.fbZoomImg, property: K, start: B, finish: F[K] }) } this.pos[F.id][K] = F[K] } } } else { if (typeof arguments[G] === "function") { D = arguments[G] } } } this.resizeGroup(H[0], function() { I.resizeGroup(H[1], D) }) }, showContent: function(H) { var C = this; if (!H) { var E = this.getDisplaySize(); if (!this.resized) { var F = E.width !== this.displaySize.width, G = E.height !== this.displaySize.height; if ((F && Math.abs(this.pos.fbBox.width - E.width) < 50) || (G && Math.abs(this.pos.fbBox.height - E.height) < 50)) { this.resized = true; return this.calcSize(this.scaledBy) } } this.resized = false; self.focus(); if (this.ieOld) { this.stretchOverlay()() } if ((this.disableScroll || (this.ffOld && /iframe|quicktime/i.test(this.currentItem.type))) && !(this.ieOld || this.webkitOld || this.ie8b2)) { if (this.pos.fbBox.width <= E.width && this.pos.fbBox.height <= E.height) { this.setPosition(this.fbBox, "fixed") } } if (this.currentItem.type === "iframe") { this.fbContent.src = this.currentItem.href } else { if (/flash|quicktime/.test(this.currentItem.type)) { this.setInnerHTML(this.fbContent, this.objectHTML(this.currentItem.href, this.currentItem.type, this.pos.fbMainDiv.width, this.pos.fbMainDiv.height)) } } this.prevIndex = this.currentIndex ? this.currentIndex - 1 : this.itemCount - 1; this.nextIndex = this.currentIndex < this.itemCount - 1 ? this.currentIndex + 1 : 0; var I = this.enableWrap || this.currentIndex !== 0 ? this.items[this.prevIndex].href : "", A = this.enableWrap || this.currentIndex !== this.itemCount - 1 ? this.items[this.nextIndex].href : ""; if (this.navButton) { if (I) { if (!this.operaOld) { this.fbPrev.href = I } this.fbPrev.title = this.fbOverlayPrev.title } else { this.fbPrev.removeAttribute("href"); this.fbPrev.title = "" } if (A) { if (!this.operaOld) { this.fbNext.href = A } this.fbNext.title = this.fbOverlayNext.title } else { this.fbNext.removeAttribute("href"); this.fbNext.title = "" } var B = this.fbPrev.className.replace("_off", ""), D = this.fbNext.className.replace("_off", ""); this.fbPrev.className = B + (I ? "" : "_off"); this.fbNext.className = D + (A ? "" : "_off") } if (this.navOverlay) { if (!this.operaOld) { this.fbLeftNav.href = this.fbOverlayPrev.href = I; this.fbRightNav.href = this.fbOverlayNext.href = A } this.fbLeftNav.style.visibility = I ? "" : "hidden"; this.fbRightNav.style.visibility = A ? "" : "hidden"; fb.navOverlayShown = true } this.fbCanvas.style.visibility = ""; return this.restore(function() { C.timeouts.showContent = setTimeout(function() { C.showContent(1) }, 10) }) } this.lastShown = this.currentItem; if (!this.currentItem.seen) { this.currentItem.seen = true; this.itemsShown++ } if (this.isSlideshow && !this.isPaused) { this.timeouts.slideshow = setTimeout(function() { if (C.endTask === "loop" || C.itemsShown < C.itemCount) { C.newContent(C.nextIndex) } else { if (C.endTask === "exit") { C.end() } else { C.setPause(true); var J = C.itemCount; while (J--) { C.items[J].seen = false } C.itemsShown = 0 } } }, this.slideInterval * 1000) } this.timeouts.preload = setTimeout(function() { C.preloadImages(A || I || "", true) }, 10) }, objectHTML: function(C, L, D, M) { if (L === "flash") { var K = 'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"', B = 'type="application/x-shockwave-flash"', I = "http://get.adobe.com/flashplayer/", J = /\bwmode=(\w+?)\b/i.exec(C), E = J ? J[1] : "window", J = /\bbgcolor=(#\w+?)\b/i.exec(C), N = J ? J[1] : "", J = /\bscale=(\w+?)\b/i.exec(C), F = J ? J[1] : "exactfit", G = { wmode: E, bgcolor: N, scale: F, quality: "high", flashvars: "autoplay=1&amp;ap=true&amp;border=0&amp;rel=0" }; if (this.ffOld) { G.wmode = this.ffMac ? "window" : "opaque" } if (this.ffNew && C.indexOf("YV_YEP.swf") !== -1) { G.wmode = "window" } } else { var K = 'classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"', B = 'type="video/quicktime"', I = "http://www.apple.com/quicktime/download/", G = { autoplay: "true", controller: "true", showlogo: "false", scale: "tofit"} } var H = '<object id="fbObject" name="fbObject" width="' + D + '" height="' + M + '" '; if (this.ie) { H += K + ">"; G[L === "flash" ? "movie" : "src"] = this.encodeHTML(C) } else { H += B + ' data="' + this.encodeHTML(C) + '">' } for (var A in G) { if (G.hasOwnProperty(A)) { H += '<param name="' + A + '" value="' + G[A] + '" />' } } if (L === "quicktime" && this.webkitMac) { H += '<embed src="' + this.encodeHTML(C) + '" width="' + D + '" height="' + M + '" autoplay="true" controller="true" showlogo="false" scale="tofit" pluginspage="' + I + '"></embed></object>' } else { H += '<p style="color:#000; background:#fff; margin:1em; padding:1em;">' + (L === "flash" ? "Flash" : "QuickTime") + ' player is required to view this content.<br /><a href="' + I + '">download player</a></p></object>' } return H }, newContent: function(A) { var C = this; this.clearTimeout("slideshow"); this.clearTimeout("resize"); this.currentIndex = A; fb.previousAnchor = this.currentItem; this.currentItem = this.items[A]; if (this.showNavOverlay == "once" && this.navOverlayShown) { this.showNavOverlay = false } var B = function() { C.updatePanels(); C.fetchContent(function() { C.calcSize() }) }; this.collapse(function() { C.timeouts.fetch = setTimeout(B, 10) }) }, end: function(K) { if (this !== fb.lastChild) { return fb.lastChild.end(K) } var G = this; this.endAll = this.endAll || K; this.fbOverlay.onclick = null; if (this.isChild) { if (this.endAll) { this.imageFadeDuration = this.overlayFadeDuration = this.resizeDuration = 0 } } else { if (document.keydownSet) { document.onkeydown = this.priorOnkeydown; document.keydownSet = false } if (document.keypressSet) { document.onkeypress = this.priorOnkeypress; document.keypressSet = false } parent.focus() } if (this.ieOld) { detachEvent("onresize", this.stretchOverlay()); detachEvent("onscroll", this.stretchOverlay()) } for (var L in this.timeouts) { if (this.timeouts.hasOwnProperty(L)) { this.clearTimeout(L) } } if (this.fbBox.style.visibility) { if (!this.lastShown) { this.fbZoomDiv.style.display = "none" } } else { if (this.currentItem.type === "img" && this.zoomImageStart) { if (this.currentItem.popup) { this.currentItem.anchor.onmouseover() } var B = this.getAnchorPos(this.currentItem.anchor, true); if (this.currentItem.popup) { this.currentItem.anchor.onmouseout() } if (B.width) { this.fbZoomDiv.style.borderWidth = this.zoomPopBorder + "px"; B.left -= this.zoomPopBorder; B.top -= this.zoomPopBorder; this.pos.thumb = B; return this.zoomOut() } } } if (!this.fbBox.style.visibility) { var B = this.getAnchorPos(this.currentItem.anchor, !this.currentItem.popup), E = this.initialSize / 2, C = { id: "fbBox", left: B.left - E, top: B.top - E, width: this.initialSize, height: this.initialSize }, M = { id: "fbBox", left: B.left, top: B.top, width: 0, height: 0, borderWidth: 0 }, I = this.splitResize; if (I === "wh") { I = "hw" } else { if (I === "hw") { I = "wh" } else { if (I === "auto") { I = this.pos.fbBox.width <= this.pos.fbBox.height ? "hw" : "wh" } } } var H = function() { setTimeout(function() { G.fbBox.style.visibility = "hidden"; G.end() }, 10) }; if (I) { var J = function() { G.setSize(I, C, function() { G.setSize(M, H) }) } } else { var J = function() { G.setSize(M, H) } } var D = function() { if (G.fbContent) { G.fbMainDiv.removeChild(G.fbContent); delete G.fbContent } G.fbLoader.style.display = ""; G.fbCanvas.style.display = G.fbShadowTop.style.display = G.fbShadowRight.style.display = G.fbShadowBottom.style.display = G.fbShadowLeft.style.display = G.fbShadowCorner.style.display = "none"; J() }; return this.collapse(D) } this.fbBox.style.display = "none"; var A = this.children.length + 1, F = this.anchors.length; while (F && this.anchors[F - 1].level >= A) { F-- } this.anchors.length = F; if (this.isChild) { this.children.length-- } fb.lastChild = this.children[this.children.length - 1] || fb; var J = function() { setTimeout(function() { while (G.nodeNames.length) { var N = G.nodeNames.pop(); if (G[N] && G[N].parentNode) { G[N].parentNode.removeChild(G[N]); delete G[N] } } if (G.endAll && G.isChild) { return fb.end(true) } else { if (G.loadPageOnClose) { if (G.loadPageOnClose === "self" || G.loadPageOnClose === "this") { location.reload(true) } else { if (G.loadPageOnClose === "back") { history.back() } else { location.replace(G.loadPageOnClose) } } } } }, 10) }; var D = function() { while (G.hiddenEls.length) { var O = G.hiddenEls.pop(); O.style.visibility = "visible"; if (this.ffOld && this.ffMac) { O.focus(); O.blur() } } var N = G.fbOverlay.style; N.display = "none"; N.width = N.height = "0"; var P = G.currentItem.popup ? 6.5 : 0; G.fbZoomDiv.style.opacity = "1"; G.fadeOpacity(G.fbZoomDiv, 0, P, J); G.currentItem = fb.previousAnchor = null }; this.fadeOpacity(this.fbOverlay, 0, this.overlayFadeDuration, D) }, zoomIn: function(B) { var D = this, G = this.fbZoomDiv.style; if (!B) { this.clearTimeout("slowLoad"); G.display = this.fbZoomImg.style.display = ""; if (this.currentItem.popup) { this.currentItem.anchor.onmouseout() } var F = this.outerBorder + this.innerBorder - this.zoomPopBorder; var C = function() { D.fbZoomImg.src = D.currentItem.href; D.setSize({ id: "fbZoomDiv", width: D.pos.fbMainDiv.width, height: D.pos.fbMainDiv.height, left: D.pos.fbBox.left + F + D.padding, top: D.pos.fbBox.top + F + D.upperSpace }, function() { D.zoomIn(1) }) }; return this.fadeOpacity(this.fbOverlay, this.overlayOpacity, this.overlayFadeDuration, C) } if (B === 1) { var E = { left: this.pos.fbBox.left, top: this.pos.fbBox.top, width: this.pos.fbBox.width, height: this.pos.fbBox.height }; var F = 2 * (this.zoomPopBorder - this.outerBorder); this.pos.fbBox = { left: this.pos.fbZoomDiv.left, top: this.pos.fbZoomDiv.top, width: this.pos.fbZoomDiv.width + F, height: this.pos.fbZoomDiv.height + F }; this.fbBox.style.visibility = ""; var C = function() { D.restore(function() { D.zoomIn(2) }) }; return this.setSize({ id: "fbBox", left: E.left, top: E.top, width: E.width, height: E.height }, C) } var A = function() { G.display = "none"; D.fbZoomImg.src = ""; G.left = G.top = G.width = G.height = D.fbZoomImg.width = D.fbZoomImg.height = "0"; D.showContent() }; this.timeouts.showContent = setTimeout(A, 10) }, zoomOut: function(B) { var C = this; if (!B) { this.fbZoomImg.src = this.currentItem.href; var D = this.outerBorder + this.innerBorder - this.zoomPopBorder; this.setSize({ id: "fbZoomDiv", width: this.pos.fbMainDiv.width, height: this.pos.fbMainDiv.height, left: this.pos.fbBox.left + D + this.padding, top: this.pos.fbBox.top + D + this.upperSpace }, function() { C.zoomOut(1) }) } if (B === 1) { this.fbZoomDiv.style.display = this.fbZoomImg.style.display = ""; this.fbCanvas.style.visibility = "hidden"; return this.collapse(function() { C.zoomOut(2) }) } if (B === 2) { var D = 2 * (this.zoomPopBorder - this.outerBorder); return this.setSize({ id: "fbBox", left: this.pos.fbZoomDiv.left, top: this.pos.fbZoomDiv.top, width: this.pos.fbZoomDiv.width + D, height: this.pos.fbZoomDiv.height + D }, function() { C.zoomOut(3) }) } this.fbBox.style.visibility = "hidden"; var A = function() { C.fbZoomImg.src = C.pos.thumb.src; C.end() }; this.setSize({ id: "fbZoomDiv", left: this.pos.thumb.left, top: this.pos.thumb.top, width: this.pos.thumb.width, height: this.pos.thumb.height }, A) }, setPause: function(A) { this.isPaused = A; if (A) { this.clearTimeout("slideshow") } else { this.newContent(this.nextIndex) } if (this.showPlayPause) { this.fbPlay.style.top = A ? "" : "-9999px"; this.fbPause.style.top = A ? "-9999px" : "" } }, fadeOpacity: function(C, E, D, I) { var H = +(C.style.opacity || 0); D = D || 0; this.clearTimeout["fade" + C.id]; var F = (H <= E && E > 0); if (D > 10) { D = 10 } if (D < 0) { D = 0 } if (D === 0) { H = E; var B = 1 } else { var G = Math.pow(100, 0.1), A = D + ((10 - D) / 9) * (Math.log(2) / Math.log(G) - 1), B = 1 / Math.pow(G, A) } if (F) { C.style.display = C.style.visibility = "" } else { B = -B } this.stepFade(C, H, E, B, F, I) }, stepFade: function(C, B, E, G, A, F) { if (!C) { return } var D = this; if ((A && B >= E) || (!A && B <= E)) { B = E } if (this.ie) { C.style.filter = "alpha(opacity=" + B * 100 + ")" } C.style.opacity = B + ""; if (B === E) { if (this.ie && E >= 1) { C.style.removeAttribute("filter") } if (F) { F() } } else { this.timeouts["fade" + C.id] = setTimeout(function() { D.stepFade(C, B + G, E, G, A, F) }, 20) } }, resizeGroup: function(A, F) { var B = A.length; if (!B) { return F ? F() : null } this.clearTimeout("resize"); var E = 0; while (B--) { E = Math.max(E, Math.abs(A[B].finish - A[B].start)) } var D = this.resizeDuration * (this.liveResize ? 0.65 : 1); var C = E && D ? Math.pow(Math.max(1, 2.2 - D / 10), (Math.log(E))) / E : 1; B = A.length; while (B--) { A[B].diff = A[B].finish - A[B].start } this.stepResize(C, C, A, F) }, stepResize: function(H, G, E, I) { var F = this; if (H > 1) { H = 1 } var D = E.length; while (D--) { var C = E[D].node, A = E[D].property, B = Math.round(E[D].start + E[D].diff * H), J = C.tagName.toLowerCase(); if (J === "img" || J === "iframe") { C[A] = B } else { C.style[A] = B + "px" } } if (H >= 1) { delete this.timeouts.resize; if (I) { I() } } else { this.timeouts.resize = setTimeout(function() { F.stepResize(H + G, G, E, I) }, 20) } }, getDisplaySize: function() { return { width: this.getDisplayWidth(), height: this.getDisplayHeight()} }, getDisplayWidth: function() { return this.html.clientWidth || this.bod.clientWidth }, getDisplayHeight: function() { if (this.webkitOld) { return window.innerHeight } if (!this.html.clientHeight || this.operaOld || document.compatMode === "BackCompat") { return this.bod.clientHeight } return this.html.clientHeight }, getScroll: function(E) { if (!(E && E.document)) { E = self } var D = E.document, B = D.documentElement, A = D.body || D.getElementsByTagName("body")[0], C = E.pageXOffset || A.scrollLeft || D.documentElement.scrollLeft || 0; if (this.ie && this.rtl) { C -= B.scrollWidth - B.clientWidth } return { left: C, top: E.pageYOffset || A.scrollTop || D.documentElement.scrollTop || 0} }, getLeftTop: function(B, O) { var E = B.offsetLeft || 0, L = B.offsetTop || 0, X = B.ownerDocument || B.document, U = X.body || X.getElementsByTagName("body")[0], H = X.defaultView || X.parentWindow || X.contentWindow, A = this.getScroll(H), W = this.getStyle(B, "position", H), V = /absolute|fixed/, K = !V.test(W), D = K, P = B; if (W === "fixed") { E += A.left; L += A.top } while (W !== "fixed" && (P = P.offsetParent)) { var C = 0, M = 0, G = true, W = this.getStyle(P, "position", H), G = !V.test(W); if (this.opera) { if (O && P !== U) { E += P.scrollLeft - P.clientLeft; L += P.scrollTop - P.clientTop } } else { if (this.ie) { if (P.currentStyle.hasLayout && P !== X.documentElement) { C = P.clientLeft; M = P.clientTop } } else { C = parseInt(this.getStyle(P, "border-left-width", H), 10); M = parseInt(this.getStyle(P, "border-top-width", H), 10); if (this.ff && P === B.offsetParent && !G && (this.ffOld || !K)) { E += C; L += M } } } if (!G) { if (O) { return { left: E, top: L} } D = false } if (P.offsetLeft > 0) { E += P.offsetLeft } E += C; L += P.offsetTop + M; if (W === "fixed") { E += A.left; L += A.top } if (!(this.opera && K) && P !== U && P !== X.documentElement) { E -= P.scrollLeft; L -= P.scrollTop } } if (this.ff && D) { E += parseInt(this.getStyle(U, "border-left-width", H), 10); L += parseInt(this.getStyle(U, "border-top-width", H), 10) } if (this.webkitOld) { var Q = X.createElement("script"); Q.innerHTML = "document.parentWindow=self"; X.documentElement.appendChild(Q); X.documentElement.removeChild(Q); H = X.parentWindow } if (!O && H !== self) { var F = H.parent.document.getElementsByTagName("iframe"), S = F.length; while (S--) { var P = F[S], N = false; try { N = P.contentDocument || P.contentWindow; N = N.document || N } catch (T) { } if (N === X || (typeof N !== "object" && P.src === H.location.href.substr(H.location.href.length - P.src.length))) { if (this.webkitOld) { H = X.defaultView } var I = this.getLeftTop(P); E += I.left - A.left; L += I.top - A.top; if (this.ie || this.opera) { var R = 0, J = 0; if (!this.ie || K) { R = parseInt(this.getStyle(P, "padding-left", H), 10); J = parseInt(this.getStyle(P, "padding-top", H), 10) } E += P.clientLeft + R; L += P.clientTop + J } else { E += parseInt(this.getStyle(P, "border-left-width", H), 10) + parseInt(this.getStyle(P, "padding-left", H), 10); L += parseInt(this.getStyle(P, "border-top-width", H), 10) + parseInt(this.getStyle(P, "padding-top", H), 10) } break } } } return { left: E, top: L} }, getStyle: function(A, D, C) { if (!(A && D)) { return "" } if (!C) { var B = A.ownerDocument || A.document; C = B.defaultView || B.parentWindow || B.contentWindow } if (A.currentStyle) { return A.currentStyle[D.replace(/-(\w)/g, function(E, F) { return F.toUpperCase() })] || "" } else { if (!C) { var B = A.ownerDocument || A.document; C = B.defaultView || B.parentWindow || B.contentWindow } return (C.getComputedStyle && C.getComputedStyle(A, "").getPropertyValue(D)) || "" } }, getLayout: function(B) { var A = this.getLeftTop(B); A.width = B.offsetWidth; A.height = B.offsetHeight; return A }, clearTimeout: function(A) { if (this.timeouts[A]) { clearTimeout(this.timeouts[A]); delete this.timeouts[A] } }, stretchOverlay: function() { var A = this; return function() { if (arguments.length === 1) { A.clearTimeout("stretch"); A.timeouts.stretch = setTimeout(function() { A.stretchOverlay()() }, 25) } else { delete A.timeouts.stretch; if (!A.fbBox) { return } var F = A.fbBox.offsetLeft + A.fbBox.offsetWidth, C = A.fbBox.offsetTop + A.fbBox.offsetHeight, G = A.getDisplaySize(), B = A.getScroll(), E = A.fbOverlay.style; E.width = E.height = "0"; var D = (A.rtl && B.left) ? A.html.clientWidth - A.html.scrollWidth : 0; E.left = D + "px"; E.width = Math.max(F, A.bod.scrollWidth, A.bod.clientWidth, A.html.clientWidth, G.width + B.left) + "px"; E.height = Math.max(C, A.bod.scrollHeight, A.bod.clientHeight, A.html.clientHeight, G.height + B.top) + "px" } } }, encodeHTML: function(A) { return A.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;") }, decodeHTML: function(A) { return A.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/&apos;/g, "'").replace(/&#39;/g, "'") }, getXMLHttpRequest: function() { var C, A = this; if (window.XMLHttpRequest) { if (!(C = new XMLHttpRequest())) { return false } } else { try { C = new ActiveXObject("Msxml2.XMLHTTP") } catch (B) { try { C = new ActiveXObject("Microsoft.XMLHTTP") } catch (B) { return false } } } return { getResponse: function(D, F) { try { C.open("GET", D, true); C.setRequestHeader("If-Modified-Since", "Thu, 1 Jan 1970 00:00:00 GMT"); C.setRequestHeader("Cache-Control", "no-cache"); C.onreadystatechange = function() { if (C.readyState === 4) { C.onreadystatechange = function() { }; F(C) } }; C.send(null) } catch (E) { } } } }, setInnerHTML: function(E, C) { try { var B = document.createRange(); B.selectNodeContents(E); B.deleteContents(); if (C) { var H = new DOMParser().parseFromString('<div xmlns="http://www.w3.org/1999/xhtml">' + C + "</div>", "application/xhtml+xml"), G = H.documentElement.childNodes; for (var D = 0, A = G.length; D < A; D++) { E.appendChild(document.importNode(G[D], true)) } } return true } catch (F) { } try { E.innerHTML = C; return true } catch (F) { } return false }, printContents: function(D, C) { if (D && D.offsetWidth) { var B = D.offsetWidth, A = D.offsetHeight } else { D = fb.lastChild.fbContent; var H = fb.lastChild.pos.fbMainDiv, B = H.width, A = H.height } var F = window.open("", "", "width=" + B + ", height=" + A), E = F && F.document; if (!E) { alert("Popup windows are being blocked by your browser.\nUnable to print."); return false } if (/\.css$/i.test(C)) { C = '<link rel="stylesheet" type="text/css" href="' + C + '" />' } else { C = '<style type="text/css"> html,body{border:0;margin:0;padding:0;}' + (C || "") + "</style>" } var G = document.createElement("div"); G.appendChild(D.cloneNode(true)); E.open("text/html"); E.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head>' + C + "</head><body><div>" + G.innerHTML + "</div></body></html>"); E.close(); setTimeout(function() { F && F.print(); F && F.close() }, 200); return true }, loadAnchor: function(B, A, D) { if (B.setAttribute) { var C = B; if (!C.getAttribute("rel")) { C.setAttribute("rel", "floatbox") } fb.lastChild.start(this.tagOneAnchor(C)) } else { fb.lastChild.start(this.tagOneAnchor({ href: B, rev: A, title: D, rel: "floatbox" })) } }, goBack: function() { var A = fb.previousAnchor; if (A) { this.loadAnchor(A.href, A.rev + " sameBox:true", A.title) } }, resize: function(B, A) { var C = false; if (B && fb.lastChild.currentItem && fb.lastChild.currentItem.nativeWidth != B) { fb.lastChild.currentItem.nativeWidth = B; C = true } if (A && fb.lastChild.currentItem && fb.lastChild.currentItem.nativeHeight != A) { fb.lastChild.currentItem.nativeHeight = A; C = true } if (C) { fb.lastChild.calcSize(false) } } }; function initfb() { if (arguments.callee.done) { return } var A = "self"; if (self !== parent) { try { if (self.location.host === parent.location.host && self.location.protocol === parent.location.protocol) { A = "parent" } } catch (B) { } if (A === "parent" && !parent.fb) { return setTimeout(initfb, 50) } } arguments.callee.done = true; if (document.compatMode === "BackCompat") { alert("Floatbox does not support quirks mode.\nPage needs to have a valid a doc type."); return } fb = (A === "self" ? new Floatbox() : parent.fb); fb.tagAnchors(self.document.body || self.document.getElementsByTagName("body")[0]); if (fb.autoStart) { fb.start(fb.autoStart); if (typeof fb !== "undefined") { delete fb.autoStart } } else { fb.preloadImages("", true) } } if (document.addEventListener) { document.addEventListener("DOMContentLoaded", initfb, false) };
(function() { /*@cc_onif (document.body) { try { document.createElement('div').doScroll('left'); return initfb(); } catch (e) { } } /*@if (false) @*/if(/loaded|complete/.test(document.readyState)){return initfb()}/*@end@*/if (!initfb.done) { setTimeout(arguments.callee, 50) } })(); fb_prevOnload = window.onload; window.onload = function() { if (arguments.callee.done) { return } arguments.callee.done = true; if (typeof fb_prevOnload === "function") { fb_prevOnload() } initfb() };
