The requested content cannot be loaded.
Please try again later.
',\r\n closeBtn : '').html(content).find(current.selector);\r\n\r\n } else if (isQuery(content)) {\r\n if (!content.data(placeholder)) {\r\n content.data(placeholder, $('
').insertAfter( content ).hide() );\r\n }\r\n\r\n content = content.show().detach();\r\n\r\n current.wrap.bind('onReset', function () {\r\n if ($(this).find(content).length) {\r\n content.hide().replaceAll( content.data(placeholder) ).data(placeholder, false);\r\n }\r\n });\r\n }\r\n break;\r\n\r\n case 'image':\r\n content = current.tpl.image.replace(/\\{href\\}/g, href);\r\n break;\r\n\r\n case 'swf':\r\n content = '
';\r\n break;\r\n }\r\n\r\n if (!(isQuery(content) && content.parent().is(current.inner))) {\r\n current.inner.append( content );\r\n }\r\n\r\n // Give a chance for helpers or callbacks to update elements\r\n F.trigger('beforeShow');\r\n\r\n // Set scrolling before calculating dimensions\r\n current.inner.css('overflow', scrolling === 'yes' ? 'scroll' : (scrolling === 'yes' ? 'hidden' : scrolling));\r\n\r\n // Set initial dimensions and start position\r\n F._setDimension();\r\n\r\n F.reposition();\r\n\r\n F.isOpen = false;\r\n F.coming = null;\r\n\r\n F.bindEvents();\r\n\r\n if (!F.isOpened) {\r\n $('.fancybox-wrap').not( current.wrap ).stop(true).trigger('onReset').remove();\r\n\r\n } else if (previous.prevMethod) {\r\n F.transitions[ previous.prevMethod ]();\r\n }\r\n\r\n F.transitions[ F.isOpened ? current.nextMethod : current.openMethod ]();\r\n\r\n F._preloadImages();\r\n },\r\n\r\n _setDimension: function () {\r\n var viewport = F.getViewport(),\r\n steps = 0,\r\n canShrink = false,\r\n canExpand = false,\r\n wrap = F.wrap,\r\n skin = F.skin,\r\n inner = F.inner,\r\n current = F.current,\r\n width = current.width,\r\n height = current.height,\r\n minWidth = current.minWidth,\r\n minHeight = current.minHeight,\r\n maxWidth = current.maxWidth,\r\n maxHeight = current.maxHeight,\r\n scrolling = current.scrolling,\r\n scrollOut = current.scrollOutside ? current.scrollbarWidth : 0,\r\n margin = current.margin,\r\n wMargin = getScalar(margin[1] + margin[3]),\r\n hMargin = getScalar(margin[0] + margin[2]),\r\n wPadding,\r\n hPadding,\r\n wSpace,\r\n hSpace,\r\n origWidth,\r\n origHeight,\r\n origMaxWidth,\r\n origMaxHeight,\r\n ratio,\r\n width_,\r\n height_,\r\n maxWidth_,\r\n maxHeight_,\r\n iframe,\r\n body;\r\n\r\n // Reset dimensions so we could re-check actual size\r\n wrap.add(skin).add(inner).width('auto').height('auto').removeClass('fancybox-tmp');\r\n\r\n wPadding = getScalar(skin.outerWidth(true) - skin.width());\r\n hPadding = getScalar(skin.outerHeight(true) - skin.height());\r\n\r\n // Any space between content and viewport (margin, padding, border, title)\r\n wSpace = wMargin + wPadding;\r\n hSpace = hMargin + hPadding;\r\n\r\n origWidth = isPercentage(width) ? (viewport.w - wSpace) * getScalar(width) / 100 : width;\r\n origHeight = isPercentage(height) ? (viewport.h - hSpace) * getScalar(height) / 100 : height;\r\n\r\n if (current.type === 'iframe') {\r\n iframe = current.content;\r\n\r\n if (current.autoHeight && iframe.data('ready') === 1) {\r\n try {\r\n if (iframe[0].contentWindow.document.location) {\r\n inner.width( origWidth ).height(9999);\r\n\r\n body = iframe.contents().find('body');\r\n\r\n if (scrollOut) {\r\n body.css('overflow-x', 'hidden');\r\n }\r\n\r\n origHeight = body.outerHeight(true);\r\n }\r\n\r\n } catch (e) {}\r\n }\r\n\r\n } else if (current.autoWidth || current.autoHeight) {\r\n inner.addClass( 'fancybox-tmp' );\r\n\r\n // Set width or height in case we need to calculate only one dimension\r\n if (!current.autoWidth) {\r\n inner.width( origWidth );\r\n }\r\n\r\n if (!current.autoHeight) {\r\n inner.height( origHeight );\r\n }\r\n\r\n if (current.autoWidth) {\r\n origWidth = inner.width();\r\n }\r\n\r\n if (current.autoHeight) {\r\n origHeight = inner.height();\r\n }\r\n\r\n inner.removeClass( 'fancybox-tmp' );\r\n }\r\n\r\n width = getScalar( origWidth );\r\n height = getScalar( origHeight );\r\n\r\n ratio = origWidth / origHeight;\r\n\r\n // Calculations for the content\r\n minWidth = getScalar(isPercentage(minWidth) ? getScalar(minWidth, 'w') - wSpace : minWidth);\r\n maxWidth = getScalar(isPercentage(maxWidth) ? getScalar(maxWidth, 'w') - wSpace : maxWidth);\r\n\r\n minHeight = getScalar(isPercentage(minHeight) ? getScalar(minHeight, 'h') - hSpace : minHeight);\r\n maxHeight = getScalar(isPercentage(maxHeight) ? getScalar(maxHeight, 'h') - hSpace : maxHeight);\r\n\r\n // These will be used to determine if wrap can fit in the viewport\r\n origMaxWidth = maxWidth;\r\n origMaxHeight = maxHeight;\r\n\r\n if (current.fitToView) {\r\n maxWidth = Math.min(viewport.w - wSpace, maxWidth);\r\n maxHeight = Math.min(viewport.h - hSpace, maxHeight);\r\n }\r\n\r\n maxWidth_ = viewport.w - wMargin;\r\n maxHeight_ = viewport.h - hMargin;\r\n\r\n if (current.aspectRatio) {\r\n if (width > maxWidth) {\r\n width = maxWidth;\r\n height = getScalar(width / ratio);\r\n }\r\n\r\n if (height > maxHeight) {\r\n height = maxHeight;\r\n width = getScalar(height * ratio);\r\n }\r\n\r\n if (width < minWidth) {\r\n width = minWidth;\r\n height = getScalar(width / ratio);\r\n }\r\n\r\n if (height < minHeight) {\r\n height = minHeight;\r\n width = getScalar(height * ratio);\r\n }\r\n\r\n } else {\r\n width = Math.max(minWidth, Math.min(width, maxWidth));\r\n\r\n if (current.autoHeight && current.type !== 'iframe') {\r\n inner.width( width );\r\n\r\n height = inner.height();\r\n }\r\n\r\n height = Math.max(minHeight, Math.min(height, maxHeight));\r\n }\r\n\r\n // Try to fit inside viewport (including the title)\r\n if (current.fitToView) {\r\n inner.width( width ).height( height );\r\n\r\n wrap.width( width + wPadding );\r\n\r\n // Real wrap dimensions\r\n width_ = wrap.width();\r\n height_ = wrap.height();\r\n\r\n if (current.aspectRatio) {\r\n while ((width_ > maxWidth_ || height_ > maxHeight_) && width > minWidth && height > minHeight) {\r\n if (steps++ > 19) {\r\n break;\r\n }\r\n\r\n height = Math.max(minHeight, Math.min(maxHeight, height - 10));\r\n width = getScalar(height * ratio);\r\n\r\n if (width < minWidth) {\r\n width = minWidth;\r\n height = getScalar(width / ratio);\r\n }\r\n\r\n if (width > maxWidth) {\r\n width = maxWidth;\r\n height = getScalar(width / ratio);\r\n }\r\n\r\n inner.width( width ).height( height );\r\n\r\n wrap.width( width + wPadding );\r\n\r\n width_ = wrap.width();\r\n height_ = wrap.height();\r\n }\r\n\r\n } else {\r\n width = Math.max(minWidth, Math.min(width, width - (width_ - maxWidth_)));\r\n height = Math.max(minHeight, Math.min(height, height - (height_ - maxHeight_)));\r\n }\r\n }\r\n\r\n if (scrollOut && scrolling === 'auto' && height < origHeight && (width + wPadding + scrollOut) < maxWidth_) {\r\n width += scrollOut;\r\n }\r\n\r\n inner.width( width ).height( height );\r\n\r\n wrap.width( width + wPadding );\r\n\r\n width_ = wrap.width();\r\n height_ = wrap.height();\r\n\r\n canShrink = (width_ > maxWidth_ || height_ > maxHeight_) && width > minWidth && height > minHeight;\r\n canExpand = current.aspectRatio ? (width < origMaxWidth && height < origMaxHeight && width < origWidth && height < origHeight) : ((width < origMaxWidth || height < origMaxHeight) && (width < origWidth || height < origHeight));\r\n\r\n $.extend(current, {\r\n dim : {\r\n width : getValue( width_ ),\r\n height : getValue( height_ )\r\n },\r\n origWidth : origWidth,\r\n origHeight : origHeight,\r\n canShrink : canShrink,\r\n canExpand : canExpand,\r\n wPadding : wPadding,\r\n hPadding : hPadding,\r\n wrapSpace : height_ - skin.outerHeight(true),\r\n skinSpace : skin.height() - height\r\n });\r\n\r\n if (!iframe && current.autoHeight && height > minHeight && height < maxHeight && !canExpand) {\r\n inner.height('auto');\r\n }\r\n },\r\n\r\n _getPosition: function (onlyAbsolute) {\r\n var current = F.current,\r\n viewport = F.getViewport(),\r\n margin = current.margin,\r\n width = F.wrap.width() + margin[1] + margin[3],\r\n height = F.wrap.height() + margin[0] + margin[2],\r\n rez = {\r\n position: 'absolute',\r\n top : margin[0],\r\n left : margin[3]\r\n };\r\n\r\n if (current.autoCenter && current.fixed && !onlyAbsolute && height <= viewport.h && width <= viewport.w) {\r\n rez.position = 'fixed';\r\n\r\n } else if (!current.locked) {\r\n rez.top += viewport.y;\r\n rez.left += viewport.x;\r\n }\r\n\r\n rez.top = getValue(Math.max(rez.top, rez.top + ((viewport.h - height) * current.topRatio)));\r\n rez.left = getValue(Math.max(rez.left, rez.left + ((viewport.w - width) * current.leftRatio)));\r\n\r\n return rez;\r\n },\r\n\r\n _afterZoomIn: function () {\r\n var current = F.current;\r\n\r\n if (!current) {\r\n return;\r\n }\r\n\r\n F.isOpen = F.isOpened = true;\r\n\r\n F.wrap.css('overflow', 'visible').addClass('fancybox-opened').hide().show(0);\r\n\r\n F.update();\r\n\r\n // Assign a click event\r\n if ( current.closeClick || (current.nextClick && F.group.length > 1) ) {\r\n F.inner.css('cursor', 'pointer').bind('click.fb', function(e) {\r\n if (!$(e.target).is('a') && !$(e.target).parent().is('a')) {\r\n e.preventDefault();\r\n\r\n F[ current.closeClick ? 'close' : 'next' ]();\r\n }\r\n });\r\n }\r\n\r\n // Create a close button\r\n if (current.closeBtn) {\r\n $(current.tpl.closeBtn).appendTo(F.skin).bind('click.fb', function(e) {\r\n e.preventDefault();\r\n\r\n F.close();\r\n });\r\n }\r\n\r\n // Create navigation arrows\r\n if (current.arrows && F.group.length > 1) {\r\n if (current.loop || current.index > 0) {\r\n $(current.tpl.prev).appendTo(F.outer).bind('click.fb', F.prev);\r\n }\r\n\r\n if (current.loop || current.index < F.group.length - 1) {\r\n $(current.tpl.next).appendTo(F.outer).bind('click.fb', F.next);\r\n }\r\n }\r\n\r\n F.trigger('afterShow');\r\n\r\n // Stop the slideshow if this is the last item\r\n if (!current.loop && current.index === current.group.length - 1) {\r\n\r\n F.play( false );\r\n\r\n } else if (F.opts.autoPlay && !F.player.isActive) {\r\n F.opts.autoPlay = false;\r\n\r\n F.play(true);\r\n }\r\n },\r\n\r\n _afterZoomOut: function ( obj ) {\r\n obj = obj || F.current;\r\n\r\n $('.fancybox-wrap').trigger('onReset').remove();\r\n\r\n $.extend(F, {\r\n group : {},\r\n opts : {},\r\n router : false,\r\n current : null,\r\n isActive : false,\r\n isOpened : false,\r\n isOpen : false,\r\n isClosing : false,\r\n wrap : null,\r\n skin : null,\r\n outer : null,\r\n inner : null\r\n });\r\n\r\n F.trigger('afterClose', obj);\r\n }\r\n });\r\n\r\n /*\r\n * Default transitions\r\n */\r\n\r\n F.transitions = {\r\n getOrigPosition: function () {\r\n var current = F.current,\r\n element = current.element,\r\n orig = current.orig,\r\n pos = {},\r\n width = 50,\r\n height = 50,\r\n hPadding = current.hPadding,\r\n wPadding = current.wPadding,\r\n viewport = F.getViewport();\r\n\r\n if (!orig && current.isDom && element.is(':visible')) {\r\n orig = element.find('img:first');\r\n\r\n if (!orig.length) {\r\n orig = element;\r\n }\r\n }\r\n\r\n if (isQuery(orig)) {\r\n pos = orig.offset();\r\n\r\n if (orig.is('img')) {\r\n width = orig.outerWidth();\r\n height = orig.outerHeight();\r\n }\r\n\r\n } else {\r\n pos.top = viewport.y + (viewport.h - height) * current.topRatio;\r\n pos.left = viewport.x + (viewport.w - width) * current.leftRatio;\r\n }\r\n\r\n if (F.wrap.css('position') === 'fixed' || current.locked) {\r\n pos.top -= viewport.y;\r\n pos.left -= viewport.x;\r\n }\r\n\r\n pos = {\r\n top : getValue(pos.top - hPadding * current.topRatio),\r\n left : getValue(pos.left - wPadding * current.leftRatio),\r\n width : getValue(width + wPadding),\r\n height : getValue(height + hPadding)\r\n };\r\n\r\n return pos;\r\n },\r\n\r\n step: function (now, fx) {\r\n var ratio,\r\n padding,\r\n value,\r\n prop = fx.prop,\r\n current = F.current,\r\n wrapSpace = current.wrapSpace,\r\n skinSpace = current.skinSpace;\r\n\r\n if (prop === 'width' || prop === 'height') {\r\n ratio = fx.end === fx.start ? 1 : (now - fx.start) / (fx.end - fx.start);\r\n\r\n if (F.isClosing) {\r\n ratio = 1 - ratio;\r\n }\r\n\r\n padding = prop === 'width' ? current.wPadding : current.hPadding;\r\n value = now - padding;\r\n\r\n F.skin[ prop ]( getScalar( prop === 'width' ? value : value - (wrapSpace * ratio) ) );\r\n F.inner[ prop ]( getScalar( prop === 'width' ? value : value - (wrapSpace * ratio) - (skinSpace * ratio) ) );\r\n }\r\n },\r\n\r\n zoomIn: function () {\r\n var current = F.current,\r\n startPos = current.pos,\r\n effect = current.openEffect,\r\n elastic = effect === 'elastic',\r\n endPos = $.extend({opacity : 1}, startPos);\r\n\r\n // Remove \"position\" property that breaks older IE\r\n delete endPos.position;\r\n\r\n if (elastic) {\r\n startPos = this.getOrigPosition();\r\n\r\n if (current.openOpacity) {\r\n startPos.opacity = 0.1;\r\n }\r\n\r\n } else if (effect === 'fade') {\r\n startPos.opacity = 0.1;\r\n }\r\n\r\n F.wrap.css(startPos).animate(endPos, {\r\n duration : effect === 'none' ? 0 : current.openSpeed,\r\n easing : current.openEasing,\r\n step : elastic ? this.step : null,\r\n complete : F._afterZoomIn\r\n });\r\n },\r\n\r\n zoomOut: function () {\r\n var current = F.current,\r\n effect = current.closeEffect,\r\n elastic = effect === 'elastic',\r\n endPos = {opacity : 0.1};\r\n\r\n if (elastic) {\r\n endPos = this.getOrigPosition();\r\n\r\n if (current.closeOpacity) {\r\n endPos.opacity = 0.1;\r\n }\r\n }\r\n\r\n F.wrap.animate(endPos, {\r\n duration : effect === 'none' ? 0 : current.closeSpeed,\r\n easing : current.closeEasing,\r\n step : elastic ? this.step : null,\r\n complete : F._afterZoomOut\r\n });\r\n },\r\n\r\n\r\n changeIn: function () {\r\n var current = F.current,\r\n effect = current.nextEffect,\r\n startPos = current.pos,\r\n endPos = { opacity : 1 },\r\n direction = F.direction,\r\n distance = 200,\r\n field;\r\n\r\n startPos.opacity = 0.1;\r\n\r\n if (effect === 'elastic') {\r\n field = direction === 'down' || direction === 'up' ? 'top' : 'left';\r\n\r\n if (direction === 'down' || direction === 'right') {\r\n startPos[ field ] = getValue(getScalar(startPos[ field ]) - distance);\r\n endPos[ field ] = '+=' + distance + 'px';\r\n\r\n } else {\r\n startPos[ field ] = getValue(getScalar(startPos[ field ]) + distance);\r\n endPos[ field ] = '-=' + distance + 'px';\r\n }\r\n }\r\n\r\n // Workaround for http://bugs.jquery.com/ticket/12273\r\n if (effect === 'none') {\r\n F._afterZoomIn();\r\n\r\n } else {\r\n F.wrap.css(startPos).animate(endPos, {\r\n duration : current.nextSpeed,\r\n easing : current.nextEasing,\r\n complete : F._afterZoomIn\r\n });\r\n }\r\n },\r\n\r\n changeOut: function () {\r\n var previous = F.previous,\r\n effect = previous.prevEffect,\r\n endPos = { opacity : 0.1 },\r\n direction = F.direction,\r\n distance = 200;\r\n\r\n if (effect === 'elastic') {\r\n endPos[ direction === 'down' || direction === 'up' ? 'top' : 'left' ] = ( direction === 'up' || direction === 'left' ? '-' : '+' ) + '=' + distance + 'px';\r\n }\r\n\r\n previous.wrap.animate(endPos, {\r\n duration : effect === 'none' ? 0 : previous.prevSpeed,\r\n easing : previous.prevEasing,\r\n complete : function () {\r\n $(this).trigger('onReset').remove();\r\n }\r\n });\r\n }\r\n };\r\n\r\n /*\r\n * Overlay helper\r\n */\r\n\r\n F.helpers.overlay = {\r\n defaults : {\r\n closeClick : true, // if true, fancyBox will be closed when user clicks on the overlay\r\n speedOut : 200, // duration of fadeOut animation\r\n showEarly : true, // indicates if should be opened immediately or wait until the content is ready\r\n css : {}, // custom CSS properties\r\n locked : !isTouch, // if true, the content will be locked into overlay\r\n fixed : true // if false, the overlay CSS position property will not be set to \"fixed\"\r\n },\r\n\r\n overlay : null, // current handle\r\n fixed : false, // indicates if the overlay has position \"fixed\"\r\n el : $('html'), // element that contains \"the lock\"\r\n\r\n // Public methods\r\n create : function(opts) {\r\n var parent;\r\n\r\n opts = $.extend({}, this.defaults, opts);\r\n\r\n if (this.overlay) {\r\n this.close();\r\n }\r\n\r\n parent = F.coming ? F.coming.parent : opts.parent;\r\n\r\n this.overlay = $('
').appendTo( parent && parent.length ? parent : 'body' );\r\n this.fixed = false;\r\n\r\n if (opts.fixed && F.defaults.fixed) {\r\n this.overlay.addClass('fancybox-overlay-fixed');\r\n\r\n this.fixed = true;\r\n }\r\n },\r\n\r\n open : function(opts) {\r\n var that = this;\r\n\r\n opts = $.extend({}, this.defaults, opts);\r\n\r\n if (this.overlay) {\r\n this.overlay.unbind('.overlay').width('auto').height('auto');\r\n\r\n } else {\r\n this.create(opts);\r\n }\r\n\r\n if (!this.fixed) {\r\n W.bind('resize.overlay', $.proxy( this.update, this) );\r\n\r\n this.update();\r\n }\r\n\r\n if (opts.closeClick) {\r\n this.overlay.bind('click.overlay', function(e) {\r\n if ($(e.target).hasClass('fancybox-overlay')) {\r\n if (F.isActive) {\r\n F.close();\r\n } else {\r\n that.close();\r\n }\r\n\r\n return false;\r\n }\r\n });\r\n }\r\n\r\n this.overlay.css( opts.css ).show();\r\n },\r\n\r\n close : function() {\r\n W.unbind('resize.overlay');\r\n\r\n if (this.el.hasClass('fancybox-lock')) {\r\n $('.fancybox-margin').removeClass('fancybox-margin');\r\n\r\n this.el.removeClass('fancybox-lock');\r\n\r\n W.scrollTop( this.scrollV ).scrollLeft( this.scrollH );\r\n }\r\n\r\n $('.fancybox-overlay').remove().hide();\r\n\r\n $.extend(this, {\r\n overlay : null,\r\n fixed : false\r\n });\r\n },\r\n\r\n // Private, callbacks\r\n\r\n update : function () {\r\n var width = '100%', offsetWidth;\r\n\r\n // Reset width/height so it will not mess\r\n this.overlay.width(width).height('100%');\r\n\r\n // jQuery does not return reliable result for IE\r\n if (IE) {\r\n offsetWidth = Math.max(document.documentElement.offsetWidth, document.body.offsetWidth);\r\n\r\n if (D.width() > offsetWidth) {\r\n width = D.width();\r\n }\r\n\r\n } else if (D.width() > W.width()) {\r\n width = D.width();\r\n }\r\n\r\n this.overlay.width(width).height(D.height());\r\n },\r\n\r\n // This is where we can manipulate DOM, because later it would cause iframes to reload\r\n onReady : function (opts, obj) {\r\n var overlay = this.overlay;\r\n\r\n $('.fancybox-overlay').stop(true, true);\r\n\r\n if (!overlay) {\r\n this.create(opts);\r\n }\r\n\r\n if (opts.locked && this.fixed && obj.fixed) {\r\n obj.locked = this.overlay.append( obj.wrap );\r\n obj.fixed = false;\r\n }\r\n\r\n if (opts.showEarly === true) {\r\n this.beforeShow.apply(this, arguments);\r\n }\r\n },\r\n\r\n beforeShow : function(opts, obj) {\r\n if (obj.locked && !this.el.hasClass('fancybox-lock')) {\r\n if (this.fixPosition !== false) {\r\n $('*').filter(function(){\r\n return ($(this).css('position') === 'fixed' && !$(this).hasClass(\"fancybox-overlay\") && !$(this).hasClass(\"fancybox-wrap\") );\r\n }).addClass('fancybox-margin');\r\n }\r\n\r\n this.el.addClass('fancybox-margin');\r\n\r\n this.scrollV = W.scrollTop();\r\n this.scrollH = W.scrollLeft();\r\n\r\n this.el.addClass('fancybox-lock');\r\n\r\n W.scrollTop( this.scrollV ).scrollLeft( this.scrollH );\r\n }\r\n\r\n this.open(opts);\r\n },\r\n\r\n onUpdate : function() {\r\n if (!this.fixed) {\r\n this.update();\r\n }\r\n },\r\n\r\n afterClose: function (opts) {\r\n // Remove overlay if exists and fancyBox is not opening\r\n // (e.g., it is not being open using afterClose callback)\r\n if (this.overlay && !F.coming) {\r\n this.overlay.fadeOut(opts.speedOut, $.proxy( this.close, this ));\r\n }\r\n }\r\n };\r\n\r\n /*\r\n * Title helper\r\n */\r\n\r\n F.helpers.title = {\r\n defaults : {\r\n type : 'float', // 'float', 'inside', 'outside' or 'over',\r\n position : 'bottom' // 'top' or 'bottom'\r\n },\r\n\r\n beforeShow: function (opts) {\r\n var current = F.current,\r\n text = current.title,\r\n type = opts.type,\r\n title,\r\n target;\r\n\r\n if ($.isFunction(text)) {\r\n text = text.call(current.element, current);\r\n }\r\n\r\n if (!isString(text) || $.trim(text) === '') {\r\n return;\r\n }\r\n\r\n title = $('
' + text + '
');\r\n\r\n switch (type) {\r\n case 'inside':\r\n target = F.skin;\r\n break;\r\n\r\n case 'outside':\r\n target = F.wrap;\r\n break;\r\n\r\n case 'over':\r\n target = F.inner;\r\n break;\r\n\r\n default: // 'float'\r\n target = F.skin;\r\n\r\n title.appendTo('body');\r\n\r\n if (IE) {\r\n title.width( title.width() );\r\n }\r\n\r\n title.wrapInner('
');\r\n\r\n //Increase bottom margin so this title will also fit into viewport\r\n F.current.margin[2] += Math.abs( getScalar(title.css('margin-bottom')) );\r\n break;\r\n }\r\n\r\n title[ (opts.position === 'top' ? 'prependTo' : 'appendTo') ](target);\r\n }\r\n };\r\n\r\n // jQuery plugin initialization\r\n $.fn.fancybox = function (options) {\r\n var index,\r\n that = $(this),\r\n selector = this.selector || '',\r\n run = function(e) {\r\n var what = $(this).blur(), idx = index, relType, relVal;\r\n\r\n if (!(e.ctrlKey || e.altKey || e.shiftKey || e.metaKey) && !what.is('.fancybox-wrap')) {\r\n relType = options.groupAttr || 'data-fancybox-group';\r\n relVal = what.attr(relType);\r\n\r\n if (!relVal) {\r\n relType = 'rel';\r\n relVal = what.get(0)[ relType ];\r\n }\r\n\r\n if (relVal && relVal !== '' && relVal !== 'nofollow') {\r\n what = selector.length ? $(selector) : that;\r\n what = what.filter('[' + relType + '=\"' + relVal + '\"]');\r\n idx = what.index(this);\r\n }\r\n\r\n options.index = idx;\r\n\r\n\r\n // Stop an event from bubbling if everything is fine\r\n if (F.open(what, options) !== false) {\r\n e.preventDefault();\r\n }\r\n }\r\n };\r\n\r\n options = options || {};\r\n index = options.index || 0;\r\n\r\n if (!selector || options.live === false) {\r\n that.unbind('click.fb-start').bind('click.fb-start', run);\r\n\r\n } else {\r\n D.undelegate(selector, 'click.fb-start').delegate(selector + \":not('.fancybox-item, .fancybox-nav')\", 'click.fb-start', run);\r\n }\r\n\r\n this.filter('[data-fancybox-start=1]').trigger('click');\r\n\r\n return this;\r\n };\r\n\r\n // Tests that need a body at doc ready\r\n D.ready(function() {\r\n var w1, w2;\r\n\r\n if ( $.scrollbarWidth === undefined ) {\r\n // http://benalman.com/projects/jquery-misc-plugins/#scrollbarwidth\r\n $.scrollbarWidth = function() {\r\n var parent = $('
').appendTo('body'),\r\n child = parent.children(),\r\n width = child.innerWidth() - child.height( 99 ).innerWidth();\r\n\r\n parent.remove();\r\n\r\n return width;\r\n };\r\n }\r\n\r\n if ( $.support.fixedPosition === undefined ) {\r\n $.support.fixedPosition = (function() {\r\n var elem = $('
').appendTo('body'),\r\n fixed = ( elem[0].offsetTop === 20 || elem[0].offsetTop === 15 );\r\n\r\n elem.remove();\r\n\r\n return fixed;\r\n }());\r\n }\r\n\r\n $.extend(F.defaults, {\r\n scrollbarWidth : $.scrollbarWidth(),\r\n fixed : $.support.fixedPosition,\r\n parent : $('body')\r\n });\r\n\r\n //Get real width of page scroll-bar\r\n w1 = $(window).width();\r\n\r\n H.addClass('fancybox-lock-test');\r\n\r\n w2 = $(window).width();\r\n\r\n H.removeClass('fancybox-lock-test');\r\n\r\n $(\"\").appendTo(\"head\");\r\n });\r\n\r\n}(window, document, jQuery));\r\n \r\n \r\n jQuery(\".various\").fancybox({\r\n maxWidth : 800,\r\n\r\n maxHeight : 600,\r\n fitToView : false,\r\n width : '98%',\r\n height : '60%',\r\n autoSize : false,\r\n closeClick : false,\r\n openEffect : 'none',\r\n closeEffect : 'none'\r\n });\r\n