/**
* --------------------------------------------------------------------
* jQuery-Plugin "pngFix"
* Version: 1.1, 11.09.2007
* by Andreas Eberhard, andreas.eberhard@gmail.com
*                      http://jquery.andreaseberhard.de/
*
* Copyright (c) 2007 Andreas Eberhard
* Licensed under GPL (http://www.opensource.org/licenses/gpl-license.php)
*/
eval(function(p, a, c, k, e, r) { e = function(c) { return (c < 62 ? '' : e(parseInt(c / 62))) + ((c = c % 62) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if ('0'.replace(0, e) == 0) { while (c--) r[e(c)] = k[c]; k = [function(e) { return r[e] || e } ]; e = function() { return '([237-9n-zA-Z]|1\\w)' }; c = 1 }; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p } ('(s(m){3.fn.pngFix=s(c){c=3.extend({P:\'blank.gif\'},c);8 e=(o.Q=="t R S"&&T(o.u)==4&&o.u.A("U 5.5")!=-1);8 f=(o.Q=="t R S"&&T(o.u)==4&&o.u.A("U 6.0")!=-1);p(3.browser.msie&&(e||f)){3(2).B("img[n$=.C]").D(s(){3(2).7(\'q\',3(2).q());3(2).7(\'r\',3(2).r());8 a=\'\';8 b=\'\';8 g=(3(2).7(\'E\'))?\'E="\'+3(2).7(\'E\')+\'" \':\'\';8 h=(3(2).7(\'F\'))?\'F="\'+3(2).7(\'F\')+\'" \':\'\';8 i=(3(2).7(\'G\'))?\'G="\'+3(2).7(\'G\')+\'" \':\'\';8 j=(3(2).7(\'H\'))?\'H="\'+3(2).7(\'H\')+\'" \':\'\';8 k=(3(2).7(\'V\'))?\'float:\'+3(2).7(\'V\')+\';\':\'\';8 d=(3(2).parent().7(\'href\'))?\'cursor:hand;\':\'\';p(2.9.v){a+=\'v:\'+2.9.v+\';\';2.9.v=\'\'}p(2.9.w){a+=\'w:\'+2.9.w+\';\';2.9.w=\'\'}p(2.9.x){a+=\'x:\'+2.9.x+\';\';2.9.x=\'\'}8 l=(2.9.cssText);b+=\'<y \'+g+h+i+j;b+=\'9="W:X;white-space:pre-line;Y:Z-10;I:transparent;\'+k+d;b+=\'q:\'+3(2).q()+\'z;r:\'+3(2).r()+\'z;\';b+=\'J:K:L.t.M(n=\\\'\'+3(2).7(\'n\')+\'\\\', N=\\\'O\\\');\';b+=l+\'"></y>\';p(a!=\'\'){b=\'<y 9="W:X;Y:Z-10;\'+a+d+\'q:\'+3(2).q()+\'z;r:\'+3(2).r()+\'z;">\'+b+\'</y>\'}3(2).hide();3(2).after(b)});3(2).B("*").D(s(){8 a=3(2).11(\'I-12\');p(a.A(".C")!=-1){8 b=a.13(\'url("\')[1].13(\'")\')[0];3(2).11(\'I-12\',\'none\');3(2).14(0).15.J="K:L.t.M(n=\'"+b+"\',N=\'O\')"}});3(2).B("input[n$=.C]").D(s(){8 a=3(2).7(\'n\');3(2).14(0).15.J=\'K:L.t.M(n=\\\'\'+a+\'\\\', N=\\\'O\\\');\';3(2).7(\'n\',c.P)})}return 3}})(3);', [], 68, '||this|jQuery||||attr|var|style||||||||||||||src|navigator|if|width|height|function|Microsoft|appVersion|border|padding|margin|span|px|indexOf|find|png|each|id|class|title|alt|background|filter|progid|DXImageTransform|AlphaImageLoader|sizingMethod|scale|blankgif|appName|Internet|Explorer|parseInt|MSIE|align|position|relative|display|inline|block|css|image|split|get|runtimeStyle'.split('|'), 0, {}))

/*
* nyroModal - jQuery Plugin
* http://nyromodal.nyrodev.com
*
* Copyright (c) 2008 Cedric Nirousset (nyrodev.com)
* Licensed under the MIT license
*
* $Date: 2009-02-19 (Thu, 19 Feb 2009) $
* $version: 1.4.2
*/
jQuery(function($) { var userAgent = navigator.userAgent.toLowerCase(); var browserVersion = (userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [0, '0'])[1]; var isIE6 = (/msie/.test(userAgent) && !/opera/.test(userAgent) && parseInt(browserVersion) < 7); var body = $('body'); var currentSettings; var shouldResize = false; var fixFF = false; var contentElt; var contentEltLast; var modal = { started: false, ready: false, dataReady: false, anim: false, animContent: false, loadingShown: false, transition: false, closing: false, error: false, blocker: null, blockerVars: null, full: null, bg: null, loading: null, tmp: null, content: null, wrapper: null, contentWrapper: null, scripts: new Array(), scriptsShown: new Array() }; var resized = { width: false, height: false }; $.fn.nyroModal = function(settings) { if (!this) return false; return this.each(function() { if (this.nodeName.toLowerCase() == 'form') { $(this).submit(function(e) { if ($(this).data('processing')) return true; if (this.enctype == 'multipart/form-data') { processModal($.extend(settings, { from: this })); return true } e.preventDefault(); processModal($.extend(settings, { from: this })); return false }) } else { $(this).click(function(e) { e.preventDefault(); processModal($.extend(settings, { from: this })); return false }) } }) }; $.fn.nyroModalManual = function(settings) { if (!this.length) processModal(settings); return this.each(function() { processModal($.extend(settings, { from: this })) }) }; $.nyroModalManual = function(settings) { processModal(settings) }; $.nyroModalSettings = function(settings, deep1, deep2) { setCurrentSettings(settings, deep1, deep2); if (!deep1 && modal.started) { if (modal.bg && settings.bgColor) currentSettings.updateBgColor(modal, currentSettings, function() { }); if (modal.contentWrapper && settings.title) setTitle(); if (((settings.width && settings.width == currentSettings.width) || (settings.height && settings.height == currentSettings.height))) { if (modal.contentWrapper) calculateSize(true); if (modal.contentWrapper && modal.contentWrapper.is(':visible') && !modal.animContent) { if (fixFF) modal.content.css({ position: '' }); currentSettings.resize(modal, currentSettings, function() { if (fixFF) modal.content.css({ position: 'fixed' }); if ($.isFunction(currentSettings.endResize)) currentSettings.endResize(modal, currentSettings) }) } } } }; $.nyroModalRemove = function() { removeModal() }; $.nyroModalNext = function() { var link = getGalleryLink(1); if (link) return link.nyroModalManual(getCurrentSettingsNew()); return false }; $.nyroModalPrev = function() { var link = getGalleryLink(-1); if (link) return link.nyroModalManual(getCurrentSettingsNew()); return false }; $.fn.nyroModal.settings = { debug: false, blocker: false, modal: false, type: '', from: '', hash: '', processHandler: null, selIndicator: 'nyroModalSel', formIndicator: 'nyroModal', content: null, bgColor: '#000000', ajax: {}, swf: { wmode: 'transparent' }, width: null, height: null, minWidth: 400, minHeight: 300, resizable: true, autoSizable: true, padding: 25, regexImg: '[^\.]\.(jpg|jpeg|png|tiff|gif|bmp)\s*$', defaultImgAlt: 'Image', setWidthImgTitle: true, ltr: true, gallery: null, galleryLinks: '<a href="#" class="nyroModalPrev">Prev</a><a href="#"  class="nyroModalNext">Next</a>', css: { bg: { position: 'absolute', overflow: 'hidden', top: 0, left: 0, height: '100%', width: '100%' }, wrapper: { position: 'absolute', top: '50%', left: '50%' }, wrapper2: {}, content: { overflow: 'auto' }, loading: { position: 'absolute', top: '50%', left: '50%', marginTop: '-50px', marginLeft: '-50px'} }, wrap: { div: '<div class="wrapper"></div>', ajax: '<div class="wrapper"></div>', form: '<div class="wrapper"></div>', formData: '<div class="wrapper"></div>', image: '<div class="wrapperImg"></div>', swf: '<div class="wrapperSwf"></div>', iframe: '<div class="wrapperIframe"></div>', iframeForm: '<div class="wrapperIframe"></div>', manual: '<div class="wrapper"></div>' }, closeButton: '<a href="#" class="nyroModalClose" id="closeBut" title="close">Close</a>', title: null, titleFromIframe: true, openSelector: '.nyroModal', closeSelector: '.nyroModalClose', contentLoading: '<a href="#" class="nyroModalClose">Cancel</a>', errorClass: 'error', contentError: 'The requested content cannot be loaded.<br />Please try again later.<br /><a href="#" class="nyroModalClose">Close</a>', handleError: null, showBackground: showBackground, hideBackground: hideBackground, endFillContent: null, showContent: showContent, endShowContent: null, beforeHideContent: null, hideContent: hideContent, showTransition: showTransition, hideTransition: hideTransition, showLoading: showLoading, hideLoading: hideLoading, resize: resize, endResize: null, updateBgColor: updateBgColor, endRemove: null }; function processModal(settings) { if (modal.loadingShown || modal.transition || modal.anim) return; debug('processModal'); modal.started = true; setDefaultCurrentSettings(settings); if (!modal.full) modal.blockerVars = modal.blocker = null; modal.error = false; modal.closing = false; modal.dataReady = false; modal.scripts = new Array(); modal.scriptsShown = new Array(); currentSettings.type = fileType(); if ($.isFunction(currentSettings.processHandler)) currentSettings.processHandler(currentSettings); from = currentSettings.from; url = currentSettings.url; if (currentSettings.type == 'swf') { currentSettings.resizable = false; setCurrentSettings({ overflow: 'hidden' }, 'css', 'content'); currentSettings.content = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + currentSettings.width + '" height="' + currentSettings.height + '"><param name="movie" value="' + url + '"></param>'; var tmp = ''; $.each(currentSettings.swf, function(name, val) { currentSettings.content += '<param name="' + name + '" value="' + val + '"></param>'; tmp += ' ' + name + '="' + val + '"' }); currentSettings.content += '<embed src="' + url + '" type="application/x-shockwave-flash" width="' + currentSettings.width + '" height="' + currentSettings.height + '"' + tmp + '></embed></object>' } if (from) { var jFrom = $(from); if (currentSettings.type == 'form') { var data = $(from).serializeArray(); data.push({ name: currentSettings.formIndicator, value: 1 }); if (currentSettings.selector) data.push({ name: currentSettings.selIndicator, value: currentSettings.selector.substring(1) }); $.ajax($.extend({}, currentSettings.ajax, { url: url, data: data, type: from.method, success: ajaxLoaded, error: loadingError })); debug('Form Ajax Load: ' + jFrom.attr('action')); showModal() } else if (currentSettings.type == 'formData') { initModal(); jFrom.attr('target', 'nyroModalIframe'); jFrom.attr('action', url); jFrom.prepend('<input type="hidden" name="' + currentSettings.formIndicator + '" value="1" />'); if (currentSettings.selector) jFrom.prepend('<input type="hidden" name="' + currentSettings.selIndicator + '" value="' + currentSettings.selector.substring(1) + '" />'); modal.tmp.html('<iframe frameborder="0" hspace="0" name="nyroModalIframe"></iframe>'); $('iframe', modal.tmp).css({ width: currentSettings.width, height: currentSettings.height }).error(loadingError).load(formDataLoaded); debug('Form Data Load: ' + jFrom.attr('action')); showModal(); showContentOrLoading() } else if (currentSettings.type == 'image') { var title = jFrom.attr('title') || currentSettings.defaultImgAlt; initModal(); modal.tmp.html('<img id="nyroModalImg" />').find('img').attr('alt', title); debug('Image Load: ' + url); modal.tmp.css({ lineHeight: 0 }); $('img', modal.tmp).error(loadingError).load(function() { debug('Image Loaded: ' + this.src); $(this).unbind('load'); var w = modal.tmp.width(); var h = modal.tmp.height(); modal.tmp.css({ lineHeight: '' }); resized.width = w; resized.height = h; setCurrentSettings({ width: w, height: h, imgWidth: w, imgHeight: h }); setCurrentSettings({ overflow: 'hidden' }, 'css', 'content'); modal.dataReady = true; if (modal.loadingShown || modal.transition) showContentOrLoading() }).attr('src', url); showModal() } else if (currentSettings.type == 'iframeForm') { initModal(); modal.tmp.html('<iframe frameborder="0" hspace="0" src="" name="nyroModalIframe" id="nyroModalIframe"></iframe>'); debug('Iframe Form Load: ' + url); $('iframe', modal.tmp).eq(0).css({ width: '100%', height: $.support.boxModel ? '99%' : '100%' }).load(function(e) { if (currentSettings.titleFromIframe && url.indexOf(window.location.hostname) > -1) $.nyroModalSettings({ title: $('iframe', modal.full).contents().find('title').text() }) }); modal.dataReady = true; showModal() } else if (currentSettings.type == 'iframe') { initModal(); modal.tmp.html('<iframe frameborder="0" hspace="0" src="' + url + '" name="nyroModalIframe" id="nyroModalIframe"></iframe>'); debug('Iframe Load: ' + url); $('iframe', modal.tmp).eq(0).css({ width: '100%', height: $.support.boxModel ? '99%' : '100%' }).load(function(e) { if (currentSettings.titleFromIframe && url.indexOf(window.location.hostname) > -1) $.nyroModalSettings({ title: $('iframe', modal.full).contents().find('title').text() }) }); modal.dataReady = true; showModal() } else if (currentSettings.type) { debug('Content: ' + currentSettings.type); initModal(); modal.tmp.html(currentSettings.content); var w = modal.tmp.width(); var h = modal.tmp.height(); var div = $(currentSettings.type); if (div.length) { setCurrentSettings({ type: 'div' }); w = div.width(); h = div.height(); if (contentElt) contentEltLast = contentElt; contentElt = div; modal.tmp.append(div.contents()) } setCurrentSettings({ width: w, height: h }); if (modal.tmp.html()) modal.dataReady = true; else loadingError(); if (!modal.ready) showModal(); else endHideContent() } else { debug('Ajax Load: ' + url); setCurrentSettings({ type: 'ajax' }); var data = currentSettings.ajax.data || {}; if (currentSettings.selector) { if (typeof data == "string") { data += '&' + currentSettings.selIndicator + '=' + currentSettings.selector.substring(1) } else { data[currentSettings.selIndicator] = currentSettings.selector.substring(1) } } $.ajax($.extend(true, currentSettings.ajax, { url: url, success: ajaxLoaded, error: loadingError, data: data })); showModal() } } else if (currentSettings.content) { debug('Content: ' + currentSettings.type); setCurrentSettings({ type: 'manual' }); initModal(); modal.tmp.html($('<div/>').html(currentSettings.content).contents()); if (modal.tmp.html()) modal.dataReady = true; else loadingError(); showModal() } else { } } function setDefaultCurrentSettings(settings) { debug('setDefaultCurrentSettings'); currentSettings = $.extend(true, {}, $.fn.nyroModal.settings, settings); currentSettings.selector = ''; currentSettings.borderW = 0; currentSettings.borderH = 0; currentSettings.resizable = true; setMargin() } function setCurrentSettings(settings, deep1, deep2) { if (modal.started) { if (deep1 && deep2) { $.extend(true, currentSettings[deep1][deep2], settings) } else if (deep1) { $.extend(true, currentSettings[deep1], settings) } else { if (modal.animContent) { if (settings.width) { settings.setWidth = settings.width; delete settings['width']; shouldResize = true } if (settings.height) { settings.setHeight = settings.height; delete settings['height']; shouldResize = true } } $.extend(true, currentSettings, settings) } } else { if (deep1 && deep2) { $.extend(true, $.fn.nyroModal.settings[deep1][deep2], settings) } else if (deep1) { $.extend(true, $.fn.nyroModal.settings[deep1], settings) } else { $.extend(true, $.fn.nyroModal.settings, settings) } } } function setMarginScroll() { if (isIE6 && !modal.blocker) { if (document.documentElement) { currentSettings.marginScrollLeft = document.documentElement.scrollLeft; currentSettings.marginScrollTop = document.documentElement.scrollTop } else { currentSettings.marginScrollLeft = document.body.scrollLeft; currentSettings.marginScrollTop = document.body.scrollTop } } else { currentSettings.marginScrollLeft = 0; currentSettings.marginScrollTop = 0 } } function setMargin() { setMarginScroll(); currentSettings.marginLeft = -(currentSettings.width + currentSettings.borderW) / 2; currentSettings.marginTop = -(currentSettings.height + currentSettings.borderH) / 2; if (!modal.blocker) { currentSettings.marginLeft += currentSettings.marginScrollLeft; currentSettings.marginTop += currentSettings.marginScrollTop } } function setMarginLoading() { setMarginScroll(); var outer = getOuter(modal.loading); currentSettings.marginTopLoading = -(modal.loading.height() + outer.h.border + outer.h.padding) / 2; currentSettings.marginLeftLoading = -(modal.loading.width() + outer.w.border + outer.w.padding) / 2; if (!modal.blocker) { currentSettings.marginLefttLoading += currentSettings.marginScrollLeft; currentSettings.marginTopLoading += currentSettings.marginScrollTop } } function setTitle() { var title = $('h1#nyroModalTitle', modal.contentWrapper); if (title.length) title.text(currentSettings.title); else modal.contentWrapper.prepend('<h1 id="nyroModalTitle">' + currentSettings.title + '</h1>') } function initModal() { debug('initModal'); if (!modal.full) { if (currentSettings.debug) setCurrentSettings({ color: 'white' }, 'css', 'bg'); var full = { zIndex: 100, position: 'fixed', top: 0, left: 0, width: '100%', height: '100%' }; var contain = body; var iframeHideIE = ''; if (currentSettings.blocker) { modal.blocker = contain = $(currentSettings.blocker); var pos = modal.blocker.offset(); var w = modal.blocker.outerWidth(); var h = modal.blocker.outerHeight(); if (isIE6) { setCurrentSettings({ height: '100%', width: '100%', top: 0, left: 0 }, 'css', 'bg') } modal.blockerVars = { top: pos.top, left: pos.left, width: w, height: h }; var plusTop = (/msie/.test(userAgent) ? 0 : getCurCSS(body.get(0), 'borderTopWidth')); var plusLeft = (/msie/.test(userAgent) ? 0 : getCurCSS(body.get(0), 'borderLeftWidth')); full = { position: 'absolute', top: pos.top + plusTop, left: pos.left + plusLeft, width: w, height: h} } else if (isIE6) { body.css({ height: body.height() + 'px', width: body.width() + 'px', position: 'static', overflow: 'hidden' }); $('html').css({ overflow: 'hidden' }); setCurrentSettings({ css: { bg: { position: 'absolute', zIndex: 101, height: '110%', width: '110%', top: currentSettings.marginScrollTop + 'px', left: currentSettings.marginScrollLeft + 'px' }, wrapper: { zIndex: 102 }, loading: { zIndex: 103}} }); iframeHideIE = $('<iframe id="nyroModalIframeHideIe"></iframe>').css($.extend({}, currentSettings.css.bg, { opacity: 0, zIndex: 50, border: 'none' })) } contain.append($('<div id="nyroModalFull"><div id="nyroModalBg"></div><div id="nyroModalWrapper"><div id="nyroModalContent"></div></div><div id="nyrModalTmp"></div><div id="nyroModalLoading"></div></div>').hide()); modal.full = $('#nyroModalFull').css(full).show(); modal.bg = $('#nyroModalBg').css($.extend({ backgroundColor: currentSettings.bgColor }, currentSettings.css.bg)).before(iframeHideIE); if (!currentSettings.modal) modal.bg.click(removeModal); modal.loading = $('#nyroModalLoading').css(currentSettings.css.loading).hide(); modal.contentWrapper = $('#nyroModalWrapper').css(currentSettings.css.wrapper).hide(); modal.content = $('#nyroModalContent'); modal.tmp = $('#nyrModalTmp').hide(); if ($.isFunction($.fn.mousewheel)) { modal.content.mousewheel(function(e, d) { var elt = modal.content.get(0); if ((d > 0 && elt.scrollTop == 0) || (d < 0 && elt.scrollHeight - elt.scrollTop == elt.clientHeight)) { e.preventDefault(); e.stopPropagation() } }) } $(document).keydown(keyHandler); modal.content.css({ width: 'auto', height: 'auto' }); modal.contentWrapper.css({ width: 'auto', height: 'auto' }) } } function showModal() { debug('showModal'); if (!modal.ready) { initModal(); modal.anim = true; currentSettings.showBackground(modal, currentSettings, endBackground) } else { modal.anim = true; modal.transition = true; currentSettings.showTransition(modal, currentSettings, function() { endHideContent(); modal.anim = false; showContentOrLoading() }) } } function keyHandler(e) { if (e.keyCode == 27) { if (!currentSettings.modal) removeModal() } else if (currentSettings.gallery && modal.ready && modal.dataReady && !modal.anim && !modal.transition) { if (e.keyCode == 39 || e.keyCode == 40) { e.preventDefault(); $.nyroModalNext(); return false } else if (e.keyCode == 37 || e.keyCode == 38) { e.preventDefault(); $.nyroModalPrev(); return false } } } function fileType() { if (currentSettings.forceType) { var tmp = currentSettings.forceType; if (!currentSettings.content) currentSettings.from = true; currentSettings.forceType = null; return tmp } var from = currentSettings.from; var url; if (from && from.nodeName) { var jFrom = $(from); currentSettings.url = url = from.nodeName.toLowerCase() == 'form' ? jFrom.attr('action') : from.href; if (jFrom.attr('rev') == 'modal') currentSettings.modal = true; currentSettings.title = jFrom.attr('title'); if (from && from.rel) currentSettings.gallery = from.rel; var imgType = imageType(url, from); if (imgType) return imgType; var iframe = false; if (from.target && from.target.toLowerCase() == '_blank' || (from.hostname && from.hostname.replace(/:\d*$/, '') != window.location.hostname.replace(/:\d*$/, ''))) { iframe = true } if (from.nodeName.toLowerCase() == 'form') { if (iframe) return 'iframeForm'; setCurrentSettings(extractUrlSel(url)); if (jFrom.attr('enctype') == 'multipart/form-data') return 'formData'; return 'form' } if (iframe) return 'iframe' } else { url = currentSettings.url; if (!currentSettings.content) currentSettings.from = true; if (!url) return null; var reg1 = new RegExp("^http://", "g"); if (url.match(reg1)) return 'iframe' } var imgType = imageType(url, from); if (imgType) return imgType; var swf = new RegExp('[^\.]\.(swf)\s*$', 'i'); if (swf.test(url)) return 'swf'; var tmp = extractUrlSel(url); setCurrentSettings(tmp); if (!tmp.url) return tmp.selector } function imageType(url, from) { var image = new RegExp(currentSettings.regexImg, 'i'); if (image.test(url)) { return 'image' } } function extractUrlSel(url) { var ret = { url: null, selector: null }; if (url) { var hash = getHash(url); var hashLoc = getHash(window.location.href); var curLoc = window.location.href.substring(0, window.location.href.length - hashLoc.length); var req = url.substring(0, url.length - hash.length); if (req == curLoc) { ret.selector = hash } else { ret.url = req; ret.selector = hash } } return ret } function loadingError() { debug('loadingError'); modal.error = true; if (!modal.ready) return; if ($.isFunction(currentSettings.handleError)) currentSettings.handleError(modal, currentSettings); modal.loading.addClass(currentSettings.errorClass).html(currentSettings.contentError); $(currentSettings.closeSelector, modal.loading).click(removeModal); setMarginLoading(); modal.loading.css({ marginTop: currentSettings.marginTopLoading + 'px', marginLeft: currentSettings.marginLeftLoading + 'px' }) } function fillContent() { debug('fillContent'); if (!modal.tmp.html()) return; modal.content.html(modal.tmp.contents()); modal.tmp.empty(); wrapContent(); if (currentSettings.type == 'iframeForm') { $(currentSettings.from).attr('target', 'nyroModalIframe').data('processing', 1).submit().attr('target', '_blank').removeData('processing') } if ($.isFunction(currentSettings.endFillContent)) currentSettings.endFillContent(modal, currentSettings); modal.content.append(modal.scripts); $(currentSettings.closeSelector, modal.contentWrapper).click(removeModal); $(currentSettings.openSelector, modal.contentWrapper).nyroModal(getCurrentSettingsNew()) } function getCurrentSettingsNew() { var currentSettingsNew = $.extend(true, {}, currentSettings); if (resized.width) currentSettingsNew.width = null; if (resized.height) currentSettingsNew.height = null; currentSettingsNew.css.content.overflow = 'auto'; return currentSettingsNew } function wrapContent() { debug('wrapContent'); var wrap = $(currentSettings.wrap[currentSettings.type]); modal.content.append(wrap.children().remove()); modal.contentWrapper.wrapInner(wrap); if (currentSettings.gallery) { modal.content.append(currentSettings.galleryLinks); var currentSettingsNew = getCurrentSettingsNew(); var linkPrev = getGalleryLink(-1); if (linkPrev) { var prev = $('.nyroModalPrev', modal.contentWrapper).attr('href', linkPrev.attr('href')).click(function(e) { e.preventDefault(); linkPrev.nyroModalManual(currentSettingsNew); return false }); if (isIE6 && currentSettings.type == 'swf') { prev.before($('<iframe id="nyroModalIframeHideIeGalleryPrev"></iframe>').css({ position: prev.css('position'), top: prev.css('top'), left: prev.css('left'), width: prev.width(), height: prev.height(), opacity: 0, border: 'none' })) } } else { $('.nyroModalPrev', modal.contentWrapper).remove() } var linkNext = getGalleryLink(1); if (linkNext) { var next = $('.nyroModalNext', modal.contentWrapper).attr('href', linkNext.attr('href')).click(function(e) { e.preventDefault(); linkNext.nyroModalManual(currentSettingsNew); return false }); if (isIE6 && currentSettings.type == 'swf') { next.before($('<iframe id="nyroModalIframeHideIeGalleryNext"></iframe>').css($.extend({}, { position: next.css('position'), top: next.css('top'), left: next.css('left'), width: next.width(), height: next.height(), opacity: 0, border: 'none' }))) } } else { $('.nyroModalNext', modal.contentWrapper).remove() } } calculateSize() } function getGalleryLink(dir) { if (currentSettings.gallery) { if (!currentSettings.ltr) dir *= -1; var gallery = $('[rel="' + currentSettings.gallery + '"]'); var currentIndex = gallery.index(currentSettings.from); var index = currentIndex + dir; if (index >= 0 && index < gallery.length) return gallery.eq(index) } return false } function calculateSize(resizing) { debug('calculateSize'); if (!modal.wrapper) modal.wrapper = modal.contentWrapper.children(':first'); resized.width = false; resized.height = false; if (currentSettings.autoSizable && (!currentSettings.width || !currentSettings.height)) { modal.contentWrapper.css({ opacity: 0, width: 'auto', height: 'auto' }).show(); var tmp = { width: 'auto', height: 'auto' }; if (currentSettings.width) { tmp.width = currentSettings.width } else if (currentSettings.type == 'iframe') { tmp.width = currentSettings.minWidth } if (currentSettings.height) { tmp.height = currentSettings.height } else if (currentSettings.type == 'iframe') { tmp.height = currentSettings.minHeight } modal.content.css(tmp); if (!currentSettings.width) { currentSettings.width = modal.content.outerWidth(true); resized.width = true } if (!currentSettings.height) { currentSettings.height = modal.content.outerHeight(true); resized.height = true } modal.contentWrapper.hide().css({ opacity: 1 }) } currentSettings.width = Math.max(currentSettings.width, currentSettings.minWidth); currentSettings.height = Math.max(currentSettings.height, currentSettings.minHeight); var outerWrapper = getOuter(modal.contentWrapper); var outerWrapper2 = getOuter(modal.wrapper); var outerContent = getOuter(modal.content); var tmp = { content: { width: currentSettings.width, height: currentSettings.height }, wrapper2: { width: currentSettings.width + outerContent.w.total, height: currentSettings.height + outerContent.h.total }, wrapper: { width: currentSettings.width + outerContent.w.total + outerWrapper2.w.total, height: currentSettings.height + outerContent.h.total + outerWrapper2.h.total} }; if (currentSettings.resizable) { var maxHeight = modal.blockerVars ? modal.blockerVars.height : $(window).height() - outerWrapper.h.border - (tmp.wrapper.height - currentSettings.height); var maxWidth = modal.blockerVars ? modal.blockerVars.width : $(window).width() - outerWrapper.w.border - (tmp.wrapper.width - currentSettings.width); maxHeight -= currentSettings.padding * 2; maxWidth -= currentSettings.padding * 2; if (tmp.content.height > maxHeight || tmp.content.width > maxWidth) { if (currentSettings.type == 'image') { var diffW = tmp.content.width - currentSettings.imgWidth; var diffH = tmp.content.height - currentSettings.imgHeight; if (diffH < 0) diffH = 0; if (diffW < 0) diffW = 0; var calcH = maxHeight - diffH; var calcW = maxWidth - diffW; var ratio = Math.min(calcH / currentSettings.imgHeight, calcW / currentSettings.imgWidth); calcH = Math.floor(currentSettings.imgHeight * ratio); calcW = Math.floor(currentSettings.imgWidth * ratio); $('img#nyroModalImg', modal.content).css({ height: calcH + 'px', width: calcW + 'px' }); tmp.content.height = calcH + diffH; tmp.content.width = calcW + diffW } else { tmp.content.height = Math.min(tmp.content.height, maxHeight); tmp.content.width = Math.min(tmp.content.width, maxWidth) } tmp.wrapper2 = { width: tmp.content.width + outerContent.w.total, height: tmp.content.height + outerContent.h.total }; tmp.wrapper = { width: tmp.content.width + outerContent.w.total + outerWrapper2.w.total, height: tmp.content.height + outerContent.h.total + outerWrapper2.h.total} } } modal.content.css($.extend({}, tmp.content, currentSettings.css.content)); modal.wrapper.css($.extend({}, tmp.wrapper2, currentSettings.css.wrapper2)); if (!resizing) { modal.contentWrapper.css($.extend({}, tmp.wrapper, currentSettings.css.wrapper)); if (currentSettings.type == 'image') { var title = $('img', modal.content).attr('alt'); $('img', modal.content).removeAttr('alt'); if (title != currentSettings.defaultImgAlt) { var divTitle = $('<div>' + title + '</div>'); modal.content.append(divTitle); if (currentSettings.setWidthImgTitle) { var outerDivTitle = getOuter(divTitle); divTitle.css({ width: (tmp.content.width + outerContent.w.padding - outerDivTitle.w.total) + 'px' }) } } } if (!currentSettings.modal) modal.contentWrapper.prepend(currentSettings.closeButton) } if (currentSettings.title) setTitle(); tmp.wrapper.borderW = outerWrapper.w.border; tmp.wrapper.borderH = outerWrapper.h.border; setCurrentSettings(tmp.wrapper); setMargin() } function removeModal(e) { debug('removeModal'); if (e) e.preventDefault(); if (modal.full && modal.ready) { modal.ready = false; modal.anim = true; modal.closing = true; if (modal.loadingShown || modal.transition) { currentSettings.hideLoading(modal, currentSettings, function() { modal.loading.hide(); modal.loadingShown = false; modal.transition = false; currentSettings.hideBackground(modal, currentSettings, endRemove) }) } else { if (fixFF) modal.content.css({ position: '' }); modal.wrapper.css({ overflow: 'hidden' }); modal.content.css({ overflow: 'hidden' }); if ($.isFunction(currentSettings.beforeHideContent)) { currentSettings.beforeHideContent(modal, currentSettings, function() { currentSettings.hideContent(modal, currentSettings, function() { endHideContent(); currentSettings.hideBackground(modal, currentSettings, endRemove) }) }) } else { currentSettings.hideContent(modal, currentSettings, function() { endHideContent(); currentSettings.hideBackground(modal, currentSettings, endRemove) }) } } } if (e) return false } function showContentOrLoading() { debug('showContentOrLoading'); if (modal.ready && !modal.anim) { if (modal.dataReady) { if (modal.tmp.html()) { modal.anim = true; if (modal.transition) { fillContent(); modal.animContent = true; currentSettings.hideTransition(modal, currentSettings, function() { modal.loading.hide(); modal.transition = false; modal.loadingShown = false; endShowContent() }) } else { currentSettings.hideLoading(modal, currentSettings, function() { modal.loading.hide(); modal.loadingShown = false; fillContent(); setMarginLoading(); setMargin(); modal.animContent = true; currentSettings.showContent(modal, currentSettings, endShowContent) }) } } } else if (!modal.loadingShown && !modal.transition) { modal.anim = true; modal.loadingShown = true; if (modal.error) loadingError(); else modal.loading.html(currentSettings.contentLoading); $(currentSettings.closeSelector, modal.loading).click(removeModal); setMarginLoading(); currentSettings.showLoading(modal, currentSettings, function() { modal.anim = false; showContentOrLoading() }) } } } function ajaxLoaded(data) { debug('AjaxLoaded: ' + this.url); modal.tmp.html(currentSettings.selector ? filterScripts($('<div>' + data + '</div>').find(currentSettings.selector).contents()) : filterScripts(data)); if (modal.tmp.html()) { modal.dataReady = true; showContentOrLoading() } else loadingError() } function formDataLoaded() { debug('formDataLoaded'); var jFrom = $(currentSettings.from); jFrom.attr('action', jFrom.attr('action') + currentSettings.selector); jFrom.attr('target', ''); $('input[name=' + currentSettings.formIndicator + ']', currentSettings.from).remove(); var iframe = modal.tmp.children('iframe'); var iframeContent = iframe.unbind('load').contents().find(currentSettings.selector || 'body').not('script[src]'); iframe.attr('src', 'about:blank'); modal.tmp.html(iframeContent.html()); if (modal.tmp.html()) { modal.dataReady = true; showContentOrLoading() } else loadingError() } function endHideContent() { debug('endHideContent'); modal.anim = false; if (contentEltLast) { contentEltLast.append(modal.content.contents()); contentEltLast = null } else if (contentElt) { contentElt.append(modal.content.contents()); contentElt = null } modal.content.empty(); modal.contentWrapper.hide().children().remove().empty().attr('style', '').hide(); if (modal.closing || modal.transition) modal.contentWrapper.hide(); modal.contentWrapper.css(currentSettings.css.wrapper).append(modal.content); showContentOrLoading() } function endRemove() { debug('endRemove'); $(document).unbind('keydown', keyHandler); modal.anim = false; modal.full.remove(); modal.full = null; if (isIE6) { body.css({ height: '', width: '', position: '', overflow: '' }); $('html').css({ overflow: '' }) } if ($.isFunction(currentSettings.endRemove)) currentSettings.endRemove(modal, currentSettings) } function endBackground() { debug('endBackground'); modal.ready = true; modal.anim = false; showContentOrLoading() } function endShowContent() { debug('endShowContent'); modal.anim = false; modal.animContent = false; modal.contentWrapper.css({ opacity: '' }); fixFF = /mozilla/.test(userAgent) && !/(compatible|webkit)/.test(userAgent) && parseFloat(browserVersion) < 1.9 && currentSettings.type != 'image'; if (fixFF) modal.content.css({ position: 'fixed' }); modal.content.append(modal.scriptsShown); if (currentSettings.autoSizable && currentSettings.type == 'iframe') { var iframe = modal.content.find('iframe'); if (iframe.length && iframe.attr('src').indexOf(window.location.hostname) !== -1) { var body = iframe.contents().find('body'); if (body.height() > 0) { var h = body.outerHeight(true) + 1; var w = body.outerWidth(true) + 1; $.nyroModalSettings({ height: h, width: w }) } else { iframe.bind('load', function() { var body = iframe.contents().find('body'); if (body.length && body.height() > 0) { var h = body.outerHeight(true) + 1; var w = body.outerWidth(true) + 1; $.nyroModalSettings({ height: h, width: w }) } }) } } } if ($.isFunction(currentSettings.endShowContent)) currentSettings.endShowContent(modal, currentSettings); if (shouldResize) { shouldResize = false; $.nyroModalSettings({ width: currentSettings.setWidth, height: currentSettings.setHeight }); delete currentSettings['setWidth']; delete currentSettings['setHeight'] } if (resized.width) setCurrentSettings({ width: null }); if (resized.height) setCurrentSettings({ height: null }) } function getHash(url) { if (typeof url == 'string') { var hashPos = url.indexOf('#'); if (hashPos > -1) return url.substring(hashPos) } return '' } function filterScripts(data) { if (typeof data == 'string') data = data.replace(/<\/?(html|head|body)([^>]*)>/gi, ''); var tmp = new Array(); $.each($.clean({ 0: data }, this.ownerDocument), function() { if ($.nodeName(this, "script")) { if (!this.src || $(this).attr('rel') == 'forceLoad') { if ($(this).attr('rev') == 'shown') modal.scriptsShown.push(this); else modal.scripts.push(this) } } else tmp.push(this) }); return tmp } function getOuter(elm) { elm = elm.get(0); var ret = { h: { margin: getCurCSS(elm, 'marginTop') + getCurCSS(elm, 'marginBottom'), border: getCurCSS(elm, 'borderTopWidth') + getCurCSS(elm, 'borderBottomWidth'), padding: getCurCSS(elm, 'paddingTop') + getCurCSS(elm, 'paddingBottom') }, w: { margin: getCurCSS(elm, 'marginLeft') + getCurCSS(elm, 'marginRight'), border: getCurCSS(elm, 'borderLeftWidth') + getCurCSS(elm, 'borderRightWidth'), padding: getCurCSS(elm, 'paddingLeft') + getCurCSS(elm, 'paddingRight')} }; ret.h.outer = ret.h.margin + ret.h.border; ret.w.outer = ret.w.margin + ret.w.border; ret.h.inner = ret.h.padding + ret.h.border; ret.w.inner = ret.w.padding + ret.w.border; ret.h.total = ret.h.outer + ret.h.padding; ret.w.total = ret.w.outer + ret.w.padding; return ret } function getCurCSS(elm, name) { var ret = parseInt($.curCSS(elm, name, true)); if (isNaN(ret)) ret = 0; return ret } function debug(msg) { if ($.fn.nyroModal.settings.debug || currentSettings && currentSettings.debug) nyroModalDebug(msg, modal, currentSettings || {}) } function showBackground(elts, settings, callback) { elts.bg.css({ opacity: 0 }).fadeTo(500, 0.75, callback) } function hideBackground(elts, settings, callback) { elts.bg.fadeOut(300, callback) } function showLoading(elts, settings, callback) { elts.loading.css({ marginTop: settings.marginTopLoading + 'px', marginLeft: settings.marginLeftLoading + 'px', opacity: 0 }).show().animate({ opacity: 1 }, { complete: callback, duration: 400 }) } function hideLoading(elts, settings, callback) { callback() } function showContent(elts, settings, callback) { elts.loading.css({ marginTop: settings.marginTopLoading + 'px', marginLeft: settings.marginLeftLoading + 'px' }).show().animate({ width: settings.width + 'px', height: settings.height + 'px', marginTop: settings.marginTop + 'px', marginLeft: settings.marginLeft + 'px' }, { duration: 350, complete: function() { elts.contentWrapper.css({ width: settings.width + 'px', height: settings.height + 'px', marginTop: settings.marginTop + 'px', marginLeft: settings.marginLeft + 'px' }).show(); elts.loading.fadeOut(200, callback) } }) } function hideContent(elts, settings, callback) { elts.contentWrapper.animate({ height: '50px', width: '50px', marginTop: (-(25 + settings.borderH) / 2 + settings.marginScrollTop) + 'px', marginLeft: (-(25 + settings.borderW) / 2 + settings.marginScrollLeft) + 'px' }, { duration: 350, complete: function() { elts.contentWrapper.hide(); callback() } }) } function showTransition(elts, settings, callback) { elts.loading.css({ marginTop: elts.contentWrapper.css('marginTop'), marginLeft: elts.contentWrapper.css('marginLeft'), height: elts.contentWrapper.css('height'), width: elts.contentWrapper.css('width'), opacity: 0 }).show().fadeTo(400, 1, function() { elts.contentWrapper.hide(); callback() }) } function hideTransition(elts, settings, callback) { elts.contentWrapper.hide().css({ width: settings.width + 'px', height: settings.height + 'px', marginLeft: settings.marginLeft + 'px', marginTop: settings.marginTop + 'px', opacity: 1 }); elts.loading.animate({ width: settings.width + 'px', height: settings.height + 'px', marginLeft: settings.marginLeft + 'px', marginTop: settings.marginTop + 'px' }, { complete: function() { elts.contentWrapper.show(); elts.loading.fadeOut(400, function() { elts.loading.hide(); callback() }) }, duration: 350 }) } function resize(elts, settings, callback) { elts.contentWrapper.animate({ width: settings.width + 'px', height: settings.height + 'px', marginLeft: settings.marginLeft + 'px', marginTop: settings.marginTop + 'px' }, { complete: callback, duration: 400 }) } function updateBgColor(elts, settings, callback) { if (!$.fx.step.backgroundColor) { elts.bg.css({ backgroundColor: settings.bgColor }); callback() } else elts.bg.animate({ backgroundColor: settings.bgColor }, { complete: callback, duration: 400 }) } $($.fn.nyroModal.settings.openSelector).nyroModal() }); function nyroModalDebug(msg, elts, settings) { if (elts.full) elts.bg.prepend(msg + '<br />') }

/*
* jQuery Cycle Plugin (with Transition Definitions)
* Examples and documentation at: http://jquery.malsup.com/cycle/
* Copyright (c) 2007-2009 M. Alsup
* Version: 2.63 (17-MAR-2009)
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
* Requires: jQuery v1.2.6 or later
*
* Originally based on the work of:
*	1) Matt Oakes
*	2) Torsten Baldes (http://medienfreunde.com/lab/innerfade/)
*	3) Benjamin Sterling (http://www.benjaminsterling.com/experiments/jqShuffle/)
*/
; (function($) { var ver = "2.63"; if ($.support == undefined) { $.support = { opacity: !($.browser.msie) }; } function log() { if (window.console && window.console.log) { window.console.log("[cycle] " + Array.prototype.join.call(arguments, " ")); } } $.fn.cycle = function(options, arg2) { var o = { s: this.selector, c: this.context }; if (this.length == 0 && options != "stop") { if (!$.isReady && o.s) { log("DOM not ready, queuing slideshow"); $(function() { $(o.s, o.c).cycle(options, arg2); }); return this; } log("terminating; zero elements found by selector" + ($.isReady ? "" : " (DOM not ready)")); return this; } return this.each(function() { options = handleArguments(this, options, arg2); if (options === false) { return; } if (this.cycleTimeout) { clearTimeout(this.cycleTimeout); } this.cycleTimeout = this.cyclePause = 0; var $cont = $(this); var $slides = options.slideExpr ? $(options.slideExpr, this) : $cont.children(); var els = $slides.get(); if (els.length < 2) { log("terminating; too few slides: " + els.length); return; } var opts = buildOptions($cont, $slides, els, options, o); if (opts === false) { return; } if (opts.timeout || opts.continuous) { this.cycleTimeout = setTimeout(function() { go(els, opts, 0, !opts.rev); }, opts.continuous ? 10 : opts.timeout + (opts.delay || 0)); } }); }; function handleArguments(cont, options, arg2) { if (cont.cycleStop == undefined) { cont.cycleStop = 0; } if (options === undefined || options === null) { options = {}; } if (options.constructor == String) { switch (options) { case "stop": cont.cycleStop++; if (cont.cycleTimeout) { clearTimeout(cont.cycleTimeout); } cont.cycleTimeout = 0; $(cont).removeData("cycle.opts"); return false; case "pause": cont.cyclePause = 1; return false; case "resume": cont.cyclePause = 0; if (arg2 === true) { options = $(cont).data("cycle.opts"); if (!options) { log("options not found, can not resume"); return false; } if (cont.cycleTimeout) { clearTimeout(cont.cycleTimeout); cont.cycleTimeout = 0; } go(options.elements, options, 1, 1); } return false; default: options = { fx: options }; } } else { if (options.constructor == Number) { var num = options; options = $(cont).data("cycle.opts"); if (!options) { log("options not found, can not advance slide"); return false; } if (num < 0 || num >= options.elements.length) { log("invalid slide index: " + num); return false; } options.nextSlide = num; if (cont.cycleTimeout) { clearTimeout(this.cycleTimeout); cont.cycleTimeout = 0; } if (typeof arg2 == "string") { options.oneTimeFx = arg2; } go(options.elements, options, 1, num >= options.currSlide); return false; } } return options; } function removeFilter(el, opts) { if (!$.support.opacity && opts.cleartype && el.style.filter) { try { el.style.removeAttribute("filter"); } catch (smother) { } } } function buildOptions($cont, $slides, els, options, o) { var opts = $.extend({}, $.fn.cycle.defaults, options || {}, $.metadata ? $cont.metadata() : $.meta ? $cont.data() : {}); if (opts.autostop) { opts.countdown = opts.autostopCount || els.length; } var cont = $cont[0]; $cont.data("cycle.opts", opts); opts.$cont = $cont; opts.stopCount = cont.cycleStop; opts.elements = els; opts.before = opts.before ? [opts.before] : []; opts.after = opts.after ? [opts.after] : []; opts.after.unshift(function() { opts.busy = 0; }); if (!$.support.opacity && opts.cleartype) { opts.after.push(function() { removeFilter(this, opts); }); } if (opts.continuous) { opts.after.push(function() { go(els, opts, 0, !opts.rev); }); } saveOriginalOpts(opts); if (!$.support.opacity && opts.cleartype && !opts.cleartypeNoBg) { clearTypeFix($slides); } if ($cont.css("position") == "static") { $cont.css("position", "relative"); } if (opts.width) { $cont.width(opts.width); } if (opts.height && opts.height != "auto") { $cont.height(opts.height); } if (opts.startingSlide) { opts.startingSlide = parseInt(opts.startingSlide); } if (opts.random) { opts.randomMap = []; for (var i = 0; i < els.length; i++) { opts.randomMap.push(i); } opts.randomMap.sort(function(a, b) { return Math.random() - 0.5; }); opts.randomIndex = 0; opts.startingSlide = opts.randomMap[0]; } else { if (opts.startingSlide >= els.length) { opts.startingSlide = 0; } } opts.currSlide = opts.startingSlide = opts.startingSlide || 0; var first = opts.startingSlide; $slides.css({ position: "absolute", top: 0, left: 0 }).hide().each(function(i) { var z = first ? i >= first ? els.length - (i - first) : first - i : els.length - i; $(this).css("z-index", z); }); $(els[first]).css("opacity", 1).show(); removeFilter(els[first], opts); if (opts.fit && opts.width) { $slides.width(opts.width); } if (opts.fit && opts.height && opts.height != "auto") { $slides.height(opts.height); } var reshape = opts.containerResize && !$cont.innerHeight(); if (reshape) { var maxw = 0, maxh = 0; for (var i = 0; i < els.length; i++) { var $e = $(els[i]), e = $e[0], w = $e.outerWidth(), h = $e.outerHeight(); if (!w) { w = e.offsetWidth; } if (!h) { h = e.offsetHeight; } maxw = w > maxw ? w : maxw; maxh = h > maxh ? h : maxh; } if (maxw > 0 && maxh > 0) { $cont.css({ width: maxw + "px", height: maxh + "px" }); } } if (opts.pause) { $cont.hover(function() { this.cyclePause++; }, function() { this.cyclePause--; }); } if (supportMultiTransitions(opts) === false) { return false; } if (!opts.multiFx) { var init = $.fn.cycle.transitions[opts.fx]; if ($.isFunction(init)) { init($cont, $slides, opts); } else { if (opts.fx != "custom" && !opts.multiFx) { log("unknown transition: " + opts.fx, "; slideshow terminating"); return false; } } } var requeue = false; options.requeueAttempts = options.requeueAttempts || 0; $slides.each(function() { var $el = $(this); this.cycleH = (opts.fit && opts.height) ? opts.height : $el.height(); this.cycleW = (opts.fit && opts.width) ? opts.width : $el.width(); if ($el.is("img")) { var loadingIE = ($.browser.msie && this.cycleW == 28 && this.cycleH == 30 && !this.complete); var loadingOp = ($.browser.opera && this.cycleW == 42 && this.cycleH == 19 && !this.complete); var loadingOther = (this.cycleH == 0 && this.cycleW == 0 && !this.complete); if (loadingIE || loadingOp || loadingOther) { if (o.s && opts.requeueOnImageNotLoaded && ++options.requeueAttempts < 100) { log(options.requeueAttempts, " - img slide not loaded, requeuing slideshow: ", this.src, this.cycleW, this.cycleH); setTimeout(function() { $(o.s, o.c).cycle(options); }, opts.requeueTimeout); requeue = true; return false; } else { log("could not determine size of image: " + this.src, this.cycleW, this.cycleH); } } } return true; }); if (requeue) { return false; } opts.cssBefore = opts.cssBefore || {}; opts.animIn = opts.animIn || {}; opts.animOut = opts.animOut || {}; $slides.not(":eq(" + first + ")").css(opts.cssBefore); if (opts.cssFirst) { $($slides[first]).css(opts.cssFirst); } if (opts.timeout) { opts.timeout = parseInt(opts.timeout); if (opts.speed.constructor == String) { opts.speed = $.fx.speeds[opts.speed] || parseInt(opts.speed); } if (!opts.sync) { opts.speed = opts.speed / 2; } while ((opts.timeout - opts.speed) < 250) { opts.timeout += opts.speed; } } if (opts.easing) { opts.easeIn = opts.easeOut = opts.easing; } if (!opts.speedIn) { opts.speedIn = opts.speed; } if (!opts.speedOut) { opts.speedOut = opts.speed; } opts.slideCount = els.length; opts.currSlide = opts.lastSlide = first; if (opts.random) { opts.nextSlide = opts.currSlide; if (++opts.randomIndex == els.length) { opts.randomIndex = 0; } opts.nextSlide = opts.randomMap[opts.randomIndex]; } else { opts.nextSlide = opts.startingSlide >= (els.length - 1) ? 0 : opts.startingSlide + 1; } var e0 = $slides[first]; if (opts.before.length) { opts.before[0].apply(e0, [e0, e0, opts, true]); } if (opts.after.length > 1) { opts.after[1].apply(e0, [e0, e0, opts, true]); } if (opts.next) { $(opts.next).click(function() { return advance(opts, opts.rev ? -1 : 1); }); } if (opts.prev) { $(opts.prev).click(function() { return advance(opts, opts.rev ? 1 : -1); }); } if (opts.pager) { buildPager(els, opts); } exposeAddSlide(opts, els); return opts; } function saveOriginalOpts(opts) { opts.original = { before: [], after: [] }; opts.original.cssBefore = $.extend({}, opts.cssBefore); opts.original.cssAfter = $.extend({}, opts.cssAfter); opts.original.animIn = $.extend({}, opts.animIn); opts.original.animOut = $.extend({}, opts.animOut); $.each(opts.before, function() { opts.original.before.push(this); }); $.each(opts.after, function() { opts.original.after.push(this); }); } function supportMultiTransitions(opts) { var txs = $.fn.cycle.transitions; if (opts.fx.indexOf(",") > 0) { opts.multiFx = true; opts.fxs = opts.fx.replace(/\s*/g, "").split(","); for (var i = 0; i < opts.fxs.length; i++) { var fx = opts.fxs[i]; var tx = txs[fx]; if (!tx || !txs.hasOwnProperty(fx) || !$.isFunction(tx)) { log("discarding unknown transition: ", fx); opts.fxs.splice(i, 1); i--; } } if (!opts.fxs.length) { log("No valid transitions named; slideshow terminating."); return false; } } else { if (opts.fx == "all") { opts.multiFx = true; opts.fxs = []; for (p in txs) { var tx = txs[p]; if (txs.hasOwnProperty(p) && $.isFunction(tx)) { opts.fxs.push(p); } } } } if (opts.multiFx && opts.randomizeEffects) { var r1 = Math.floor(Math.random() * 20) + 30; for (var i = 0; i < r1; i++) { var r2 = Math.floor(Math.random() * opts.fxs.length); opts.fxs.push(opts.fxs.splice(r2, 1)[0]); } log("randomized fx sequence: ", opts.fxs); } return true; } function exposeAddSlide(opts, els) { opts.addSlide = function(newSlide, prepend) { var $s = $(newSlide), s = $s[0]; if (!opts.autostopCount) { opts.countdown++; } els[prepend ? "unshift" : "push"](s); if (opts.els) { opts.els[prepend ? "unshift" : "push"](s); } opts.slideCount = els.length; $s.css("position", "absolute"); $s[prepend ? "prependTo" : "appendTo"](opts.$cont); if (prepend) { opts.currSlide++; opts.nextSlide++; } if (!$.support.opacity && opts.cleartype && !opts.cleartypeNoBg) { clearTypeFix($s); } if (opts.fit && opts.width) { $s.width(opts.width); } if (opts.fit && opts.height && opts.height != "auto") { $slides.height(opts.height); } s.cycleH = (opts.fit && opts.height) ? opts.height : $s.height(); s.cycleW = (opts.fit && opts.width) ? opts.width : $s.width(); $s.css(opts.cssBefore); if (opts.pager) { $.fn.cycle.createPagerAnchor(els.length - 1, s, $(opts.pager), els, opts); } if ($.isFunction(opts.onAddSlide)) { opts.onAddSlide($s); } else { $s.hide(); } }; } $.fn.cycle.resetState = function(opts, fx) { fx = fx || opts.fx; opts.before = []; opts.after = []; opts.cssBefore = $.extend({}, opts.original.cssBefore); opts.cssAfter = $.extend({}, opts.original.cssAfter); opts.animIn = $.extend({}, opts.original.animIn); opts.animOut = $.extend({}, opts.original.animOut); opts.fxFn = null; $.each(opts.original.before, function() { opts.before.push(this); }); $.each(opts.original.after, function() { opts.after.push(this); }); var init = $.fn.cycle.transitions[fx]; if ($.isFunction(init)) { init(opts.$cont, $(opts.elements), opts); } }; function go(els, opts, manual, fwd) { if (manual && opts.busy && opts.manualTrump) { $(els).stop(true, true); opts.busy = false; } if (opts.busy) { return; } var p = opts.$cont[0], curr = els[opts.currSlide], next = els[opts.nextSlide]; if (p.cycleStop != opts.stopCount || p.cycleTimeout === 0 && !manual) { return; } if (!manual && !p.cyclePause && ((opts.autostop && (--opts.countdown <= 0)) || (opts.nowrap && !opts.random && opts.nextSlide < opts.currSlide))) { if (opts.end) { opts.end(opts); } return; } if (manual || !p.cyclePause) { var fx = opts.fx; curr.cycleH = curr.cycleH || $(curr).height(); curr.cycleW = curr.cycleW || $(curr).width(); next.cycleH = next.cycleH || $(next).height(); next.cycleW = next.cycleW || $(next).width(); if (opts.multiFx) { if (opts.lastFx == undefined || ++opts.lastFx >= opts.fxs.length) { opts.lastFx = 0; } fx = opts.fxs[opts.lastFx]; opts.currFx = fx; } if (opts.oneTimeFx) { fx = opts.oneTimeFx; opts.oneTimeFx = null; } $.fn.cycle.resetState(opts, fx); if (opts.before.length) { $.each(opts.before, function(i, o) { if (p.cycleStop != opts.stopCount) { return; } o.apply(next, [curr, next, opts, fwd]); }); } var after = function() { $.each(opts.after, function(i, o) { if (p.cycleStop != opts.stopCount) { return; } o.apply(next, [curr, next, opts, fwd]); }); }; if (opts.nextSlide != opts.currSlide) { opts.busy = 1; if (opts.fxFn) { opts.fxFn(curr, next, opts, after, fwd); } else { if ($.isFunction($.fn.cycle[opts.fx])) { $.fn.cycle[opts.fx](curr, next, opts, after); } else { $.fn.cycle.custom(curr, next, opts, after, manual && opts.fastOnEvent); } } } opts.lastSlide = opts.currSlide; if (opts.random) { opts.currSlide = opts.nextSlide; if (++opts.randomIndex == els.length) { opts.randomIndex = 0; } opts.nextSlide = opts.randomMap[opts.randomIndex]; } else { var roll = (opts.nextSlide + 1) == els.length; opts.nextSlide = roll ? 0 : opts.nextSlide + 1; opts.currSlide = roll ? els.length - 1 : opts.nextSlide - 1; } if (opts.pager) { $.fn.cycle.updateActivePagerLink(opts.pager, opts.currSlide); } } var ms = 0; if (opts.timeout && !opts.continuous) { ms = getTimeout(curr, next, opts, fwd); } else { if (opts.continuous && p.cyclePause) { ms = 10; } } if (ms > 0) { p.cycleTimeout = setTimeout(function() { go(els, opts, 0, !opts.rev); }, ms); } } $.fn.cycle.updateActivePagerLink = function(pager, currSlide) { $(pager).find("a").removeClass("activeSlide").filter("a:eq(" + currSlide + ")").addClass("activeSlide"); }; function getTimeout(curr, next, opts, fwd) { if (opts.timeoutFn) { var t = opts.timeoutFn(curr, next, opts, fwd); if (t !== false) { return t; } } return opts.timeout; } $.fn.cycle.next = function(opts) { advance(opts, opts.rev ? -1 : 1); }; $.fn.cycle.prev = function(opts) { advance(opts, opts.rev ? 1 : -1); }; function advance(opts, val) { var els = opts.elements; var p = opts.$cont[0], timeout = p.cycleTimeout; if (timeout) { clearTimeout(timeout); p.cycleTimeout = 0; } if (opts.random && val < 0) { opts.randomIndex--; if (--opts.randomIndex == -2) { opts.randomIndex = els.length - 2; } else { if (opts.randomIndex == -1) { opts.randomIndex = els.length - 1; } } opts.nextSlide = opts.randomMap[opts.randomIndex]; } else { if (opts.random) { if (++opts.randomIndex == els.length) { opts.randomIndex = 0; } opts.nextSlide = opts.randomMap[opts.randomIndex]; } else { opts.nextSlide = opts.currSlide + val; if (opts.nextSlide < 0) { if (opts.nowrap) { return false; } opts.nextSlide = els.length - 1; } else { if (opts.nextSlide >= els.length) { if (opts.nowrap) { return false; } opts.nextSlide = 0; } } } } if ($.isFunction(opts.prevNextClick)) { opts.prevNextClick(val > 0, opts.nextSlide, els[opts.nextSlide]); } go(els, opts, 1, val >= 0); return false; } function buildPager(els, opts) { var $p = $(opts.pager); $.each(els, function(i, o) { $.fn.cycle.createPagerAnchor(i, o, $p, els, opts); }); $.fn.cycle.updateActivePagerLink(opts.pager, opts.startingSlide); } $.fn.cycle.createPagerAnchor = function(i, el, $p, els, opts) { var a = ($.isFunction(opts.pagerAnchorBuilder)) ? opts.pagerAnchorBuilder(i, el) : '<a href="#">' + (i + 1) + "</a>"; if (!a) { return; } var $a = $(a); if ($a.parents("body").length == 0) { $a.appendTo($p); } $a.bind(opts.pagerEvent, function() { opts.nextSlide = i; var p = opts.$cont[0], timeout = p.cycleTimeout; if (timeout) { clearTimeout(timeout); p.cycleTimeout = 0; } if ($.isFunction(opts.pagerClick)) { opts.pagerClick(opts.nextSlide, els[opts.nextSlide]); } go(els, opts, 1, opts.currSlide < i); return false; }); if (opts.pauseOnPagerHover) { $a.hover(function() { opts.$cont[0].cyclePause++; }, function() { opts.$cont[0].cyclePause--; }); } }; $.fn.cycle.hopsFromLast = function(opts, fwd) { var hops, l = opts.lastSlide, c = opts.currSlide; if (fwd) { hops = c > l ? c - l : opts.slideCount - l; } else { hops = c < l ? l - c : l + opts.slideCount - c; } return hops; }; function clearTypeFix($slides) { function hex(s) { s = parseInt(s).toString(16); return s.length < 2 ? "0" + s : s; } function getBg(e) { for (; e && e.nodeName.toLowerCase() != "html"; e = e.parentNode) { var v = $.css(e, "background-color"); if (v.indexOf("rgb") >= 0) { var rgb = v.match(/\d+/g); return "#" + hex(rgb[0]) + hex(rgb[1]) + hex(rgb[2]); } if (v && v != "transparent") { return v; } } return "#ffffff"; } $slides.each(function() { $(this).css("background-color", getBg(this)); }); } $.fn.cycle.commonReset = function(curr, next, opts, w, h, rev) { $(opts.elements).not(curr).hide(); opts.cssBefore.opacity = 1; opts.cssBefore.display = "block"; if (w !== false && next.cycleW > 0) { opts.cssBefore.width = next.cycleW; } if (h !== false && next.cycleH > 0) { opts.cssBefore.height = next.cycleH; } opts.cssAfter = opts.cssAfter || {}; opts.cssAfter.display = "none"; $(curr).css("zIndex", opts.slideCount + (rev === true ? 1 : 0)); $(next).css("zIndex", opts.slideCount + (rev === true ? 0 : 1)); }; $.fn.cycle.custom = function(curr, next, opts, cb, speedOverride) { var $l = $(curr), $n = $(next); var speedIn = opts.speedIn, speedOut = opts.speedOut, easeIn = opts.easeIn, easeOut = opts.easeOut; $n.css(opts.cssBefore); if (speedOverride) { if (typeof speedOverride == "number") { speedIn = speedOut = speedOverride; } else { speedIn = speedOut = 1; } easeIn = easeOut = null; } var fn = function() { $n.animate(opts.animIn, speedIn, easeIn, cb); }; $l.animate(opts.animOut, speedOut, easeOut, function() { if (opts.cssAfter) { $l.css(opts.cssAfter); } if (!opts.sync) { fn(); } }); if (opts.sync) { fn(); } }; $.fn.cycle.transitions = { fade: function($cont, $slides, opts) { $slides.not(":eq(" + opts.currSlide + ")").css("opacity", 0); opts.before.push(function(curr, next, opts) { $.fn.cycle.commonReset(curr, next, opts); opts.cssBefore.opacity = 0; }); opts.animIn = { opacity: 1 }; opts.animOut = { opacity: 0 }; opts.cssBefore = { top: 0, left: 0 }; } }; $.fn.cycle.ver = function() { return ver; }; $.fn.cycle.defaults = { fx: "fade", timeout: 4000, timeoutFn: null, continuous: 0, speed: 1000, speedIn: null, speedOut: null, next: null, prev: null, prevNextClick: null, pager: null, pagerClick: null, pagerEvent: "click", pagerAnchorBuilder: null, before: null, after: null, end: null, easing: null, easeIn: null, easeOut: null, shuffle: null, animIn: null, animOut: null, cssBefore: null, cssAfter: null, fxFn: null, height: "auto", startingSlide: 0, sync: 1, random: 0, fit: 0, containerResize: 1, pause: 0, pauseOnPagerHover: 0, autostop: 0, autostopCount: 0, delay: 0, slideExpr: null, cleartype: !$.support.opacity, nowrap: 0, fastOnEvent: 0, randomizeEffects: 1, rev: 0, manualTrump: true, requeueOnImageNotLoaded: true, requeueTimeout: 250 }; })(jQuery);

/*
* jQuery Cycle Plugin Transition Definitions
* This script is a plugin for the jQuery Cycle Plugin
* Examples and documentation at: http://malsup.com/jquery/cycle/
* Copyright (c) 2007-2008 M. Alsup
* Version:	 2.52
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*/
; (function($) { $.fn.cycle.transitions.scrollUp = function($cont, $slides, opts) { $cont.css("overflow", "hidden"); opts.before.push($.fn.cycle.commonReset); var h = $cont.height(); opts.cssBefore = { top: h, left: 0 }; opts.cssFirst = { top: 0 }; opts.animIn = { top: 0 }; opts.animOut = { top: -h }; }; $.fn.cycle.transitions.scrollDown = function($cont, $slides, opts) { $cont.css("overflow", "hidden"); opts.before.push($.fn.cycle.commonReset); var h = $cont.height(); opts.cssFirst = { top: 0 }; opts.cssBefore = { top: -h, left: 0 }; opts.animIn = { top: 0 }; opts.animOut = { top: h }; }; $.fn.cycle.transitions.scrollLeft = function($cont, $slides, opts) { $cont.css("overflow", "hidden"); opts.before.push($.fn.cycle.commonReset); var w = $cont.width(); opts.cssFirst = { left: 0 }; opts.cssBefore = { left: w, top: 0 }; opts.animIn = { left: 0 }; opts.animOut = { left: 0 - w }; }; $.fn.cycle.transitions.scrollRight = function($cont, $slides, opts) { $cont.css("overflow", "hidden"); opts.before.push($.fn.cycle.commonReset); var w = $cont.width(); opts.cssFirst = { left: 0 }; opts.cssBefore = { left: -w, top: 0 }; opts.animIn = { left: 0 }; opts.animOut = { left: w }; }; $.fn.cycle.transitions.scrollHorz = function($cont, $slides, opts) { $cont.css("overflow", "hidden").width(); opts.before.push(function(curr, next, opts, fwd) { $.fn.cycle.commonReset(curr, next, opts); opts.cssBefore.left = fwd ? (next.cycleW - 1) : (1 - next.cycleW); opts.animOut.left = fwd ? -curr.cycleW : curr.cycleW; }); opts.cssFirst = { left: 0 }; opts.cssBefore = { top: 0 }; opts.animIn = { left: 0 }; opts.animOut = { top: 0 }; }; $.fn.cycle.transitions.scrollVert = function($cont, $slides, opts) { $cont.css("overflow", "hidden"); opts.before.push(function(curr, next, opts, fwd) { $.fn.cycle.commonReset(curr, next, opts); opts.cssBefore.top = fwd ? (1 - next.cycleH) : (next.cycleH - 1); opts.animOut.top = fwd ? curr.cycleH : -curr.cycleH; }); opts.cssFirst = { top: 0 }; opts.cssBefore = { left: 0 }; opts.animIn = { top: 0 }; opts.animOut = { left: 0 }; }; $.fn.cycle.transitions.slideX = function($cont, $slides, opts) { opts.before.push(function(curr, next, opts) { $(opts.elements).not(curr).hide(); $.fn.cycle.commonReset(curr, next, opts, false, true); opts.animIn.width = next.cycleW; }); opts.cssBefore = { left: 0, top: 0, width: 0 }; opts.animIn = { width: "show" }; opts.animOut = { width: 0 }; }; $.fn.cycle.transitions.slideY = function($cont, $slides, opts) { opts.before.push(function(curr, next, opts) { $(opts.elements).not(curr).hide(); $.fn.cycle.commonReset(curr, next, opts, true, false); opts.animIn.height = next.cycleH; }); opts.cssBefore = { left: 0, top: 0, height: 0 }; opts.animIn = { height: "show" }; opts.animOut = { height: 0 }; }; $.fn.cycle.transitions.shuffle = function($cont, $slides, opts) { var w = $cont.css("overflow", "visible").width(); $slides.css({ left: 0, top: 0 }); opts.before.push(function(curr, next, opts) { $.fn.cycle.commonReset(curr, next, opts, true, true, true); }); opts.speed = opts.speed / 2; opts.random = 0; opts.shuffle = opts.shuffle || { left: -w, top: 15 }; opts.els = []; for (var i = 0; i < $slides.length; i++) { opts.els.push($slides[i]); } for (var i = 0; i < opts.currSlide; i++) { opts.els.push(opts.els.shift()); } opts.fxFn = function(curr, next, opts, cb, fwd) { var $el = fwd ? $(curr) : $(next); $(next).css(opts.cssBefore); var count = opts.slideCount; $el.animate(opts.shuffle, opts.speedIn, opts.easeIn, function() { var hops = $.fn.cycle.hopsFromLast(opts, fwd); for (var k = 0; k < hops; k++) { fwd ? opts.els.push(opts.els.shift()) : opts.els.unshift(opts.els.pop()); } if (fwd) { for (var i = 0, len = opts.els.length; i < len; i++) { $(opts.els[i]).css("z-index", len - i + count); } } else { var z = $(curr).css("z-index"); $el.css("z-index", parseInt(z) + 1 + count); } $el.animate({ left: 0, top: 0 }, opts.speedOut, opts.easeOut, function() { $(fwd ? this : curr).hide(); if (cb) { cb(); } }); }); }; opts.cssBefore = { display: "block", opacity: 1, top: 0, left: 0 }; }; $.fn.cycle.transitions.turnUp = function($cont, $slides, opts) { opts.before.push(function(curr, next, opts) { $.fn.cycle.commonReset(curr, next, opts, true, false); opts.cssBefore.top = next.cycleH; opts.animIn.height = next.cycleH; }); opts.cssFirst = { top: 0 }; opts.cssBefore = { left: 0, height: 0 }; opts.animIn = { top: 0 }; opts.animOut = { height: 0 }; }; $.fn.cycle.transitions.turnDown = function($cont, $slides, opts) { opts.before.push(function(curr, next, opts) { $.fn.cycle.commonReset(curr, next, opts, true, false); opts.animIn.height = next.cycleH; opts.animOut.top = curr.cycleH; }); opts.cssFirst = { top: 0 }; opts.cssBefore = { left: 0, top: 0, height: 0 }; opts.animOut = { height: 0 }; }; $.fn.cycle.transitions.turnLeft = function($cont, $slides, opts) { opts.before.push(function(curr, next, opts) { $.fn.cycle.commonReset(curr, next, opts, false, true); opts.cssBefore.left = next.cycleW; opts.animIn.width = next.cycleW; }); opts.cssBefore = { top: 0, width: 0 }; opts.animIn = { left: 0 }; opts.animOut = { width: 0 }; }; $.fn.cycle.transitions.turnRight = function($cont, $slides, opts) { opts.before.push(function(curr, next, opts) { $.fn.cycle.commonReset(curr, next, opts, false, true); opts.animIn.width = next.cycleW; opts.animOut.left = curr.cycleW; }); opts.cssBefore = { top: 0, left: 0, width: 0 }; opts.animIn = { left: 0 }; opts.animOut = { width: 0 }; }; $.fn.cycle.transitions.zoom = function($cont, $slides, opts) { opts.before.push(function(curr, next, opts) { $.fn.cycle.commonReset(curr, next, opts, false, false, true); opts.cssBefore.top = next.cycleH / 2; opts.cssBefore.left = next.cycleW / 2; opts.animIn = { top: 0, left: 0, width: next.cycleW, height: next.cycleH }; opts.animOut = { width: 0, height: 0, top: curr.cycleH / 2, left: curr.cycleW / 2 }; }); opts.cssFirst = { top: 0, left: 0 }; opts.cssBefore = { width: 0, height: 0 }; }; $.fn.cycle.transitions.fadeZoom = function($cont, $slides, opts) { opts.before.push(function(curr, next, opts) { $.fn.cycle.commonReset(curr, next, opts, false, false); opts.cssBefore.left = next.cycleW / 2; opts.cssBefore.top = next.cycleH / 2; opts.animIn = { top: 0, left: 0, width: next.cycleW, height: next.cycleH }; }); opts.cssBefore = { width: 0, height: 0 }; opts.animOut = { opacity: 0 }; }; $.fn.cycle.transitions.blindX = function($cont, $slides, opts) { var w = $cont.css("overflow", "hidden").width(); opts.before.push(function(curr, next, opts) { $.fn.cycle.commonReset(curr, next, opts); opts.animIn.width = next.cycleW; opts.animOut.left = curr.cycleW; }); opts.cssBefore = { left: w, top: 0 }; opts.animIn = { left: 0 }; opts.animOut = { left: w }; }; $.fn.cycle.transitions.blindY = function($cont, $slides, opts) { var h = $cont.css("overflow", "hidden").height(); opts.before.push(function(curr, next, opts) { $.fn.cycle.commonReset(curr, next, opts); opts.animIn.height = next.cycleH; opts.animOut.top = curr.cycleH; }); opts.cssBefore = { top: h, left: 0 }; opts.animIn = { top: 0 }; opts.animOut = { top: h }; }; $.fn.cycle.transitions.blindZ = function($cont, $slides, opts) { var h = $cont.css("overflow", "hidden").height(); var w = $cont.width(); opts.before.push(function(curr, next, opts) { $.fn.cycle.commonReset(curr, next, opts); opts.animIn.height = next.cycleH; opts.animOut.top = curr.cycleH; }); opts.cssBefore = { top: h, left: w }; opts.animIn = { top: 0, left: 0 }; opts.animOut = { top: h, left: w }; }; $.fn.cycle.transitions.growX = function($cont, $slides, opts) { opts.before.push(function(curr, next, opts) { $.fn.cycle.commonReset(curr, next, opts, false, true); opts.cssBefore.left = this.cycleW / 2; opts.animIn = { left: 0, width: this.cycleW }; opts.animOut = { left: 0 }; }); opts.cssBefore = { width: 0, top: 0 }; }; $.fn.cycle.transitions.growY = function($cont, $slides, opts) { opts.before.push(function(curr, next, opts) { $.fn.cycle.commonReset(curr, next, opts, true, false); opts.cssBefore.top = this.cycleH / 2; opts.animIn = { top: 0, height: this.cycleH }; opts.animOut = { top: 0 }; }); opts.cssBefore = { height: 0, left: 0 }; }; $.fn.cycle.transitions.curtainX = function($cont, $slides, opts) { opts.before.push(function(curr, next, opts) { $.fn.cycle.commonReset(curr, next, opts, false, true, true); opts.cssBefore.left = next.cycleW / 2; opts.animIn = { left: 0, width: this.cycleW }; opts.animOut = { left: curr.cycleW / 2, width: 0 }; }); opts.cssBefore = { top: 0, width: 0 }; }; $.fn.cycle.transitions.curtainY = function($cont, $slides, opts) { opts.before.push(function(curr, next, opts) { $.fn.cycle.commonReset(curr, next, opts, true, false, true); opts.cssBefore.top = next.cycleH / 2; opts.animIn = { top: 0, height: next.cycleH }; opts.animOut = { top: curr.cycleH / 2, height: 0 }; }); opts.cssBefore = { left: 0, height: 0 }; }; $.fn.cycle.transitions.cover = function($cont, $slides, opts) { var d = opts.direction || "left"; var w = $cont.css("overflow", "hidden").width(); var h = $cont.height(); opts.before.push(function(curr, next, opts) { $.fn.cycle.commonReset(curr, next, opts); if (d == "right") { opts.cssBefore.left = -w; } else { if (d == "up") { opts.cssBefore.top = h; } else { if (d == "down") { opts.cssBefore.top = -h; } else { opts.cssBefore.left = w; } } } }); opts.animIn = { left: 0, top: 0 }; opts.animOut = { opacity: 1 }; opts.cssBefore = { top: 0, left: 0 }; }; $.fn.cycle.transitions.uncover = function($cont, $slides, opts) { var d = opts.direction || "left"; var w = $cont.css("overflow", "hidden").width(); var h = $cont.height(); opts.before.push(function(curr, next, opts) { $.fn.cycle.commonReset(curr, next, opts, true, true, true); if (d == "right") { opts.animOut.left = w; } else { if (d == "up") { opts.animOut.top = -h; } else { if (d == "down") { opts.animOut.top = h; } else { opts.animOut.left = -w; } } } }); opts.animIn = { left: 0, top: 0 }; opts.animOut = { opacity: 1 }; opts.cssBefore = { top: 0, left: 0 }; }; $.fn.cycle.transitions.toss = function($cont, $slides, opts) { var w = $cont.css("overflow", "visible").width(); var h = $cont.height(); opts.before.push(function(curr, next, opts) { $.fn.cycle.commonReset(curr, next, opts, true, true, true); if (!opts.animOut.left && !opts.animOut.top) { opts.animOut = { left: w * 2, top: -h / 2, opacity: 0 }; } else { opts.animOut.opacity = 0; } }); opts.cssBefore = { left: 0, top: 0 }; opts.animIn = { left: 0 }; }; $.fn.cycle.transitions.wipe = function($cont, $slides, opts) { var w = $cont.css("overflow", "hidden").width(); var h = $cont.height(); opts.cssBefore = opts.cssBefore || {}; var clip; if (opts.clip) { if (/l2r/.test(opts.clip)) { clip = "rect(0px 0px " + h + "px 0px)"; } else { if (/r2l/.test(opts.clip)) { clip = "rect(0px " + w + "px " + h + "px " + w + "px)"; } else { if (/t2b/.test(opts.clip)) { clip = "rect(0px " + w + "px 0px 0px)"; } else { if (/b2t/.test(opts.clip)) { clip = "rect(" + h + "px " + w + "px " + h + "px 0px)"; } else { if (/zoom/.test(opts.clip)) { var t = parseInt(h / 2); var l = parseInt(w / 2); clip = "rect(" + t + "px " + l + "px " + t + "px " + l + "px)"; } } } } } } opts.cssBefore.clip = opts.cssBefore.clip || clip || "rect(0px 0px 0px 0px)"; var d = opts.cssBefore.clip.match(/(\d+)/g); var t = parseInt(d[0]), r = parseInt(d[1]), b = parseInt(d[2]), l = parseInt(d[3]); opts.before.push(function(curr, next, opts) { if (curr == next) { return; } var $curr = $(curr), $next = $(next); $.fn.cycle.commonReset(curr, next, opts, true, true, false); opts.cssAfter.display = "block"; var step = 1, count = parseInt((opts.speedIn / 13)) - 1; (function f() { var tt = t ? t - parseInt(step * (t / count)) : 0; var ll = l ? l - parseInt(step * (l / count)) : 0; var bb = b < h ? b + parseInt(step * ((h - b) / count || 1)) : h; var rr = r < w ? r + parseInt(step * ((w - r) / count || 1)) : w; $next.css({ clip: "rect(" + tt + "px " + rr + "px " + bb + "px " + ll + "px)" }); (step++ <= count) ? setTimeout(f, 13) : $curr.css("display", "none"); })(); }); opts.cssBefore = { display: "block", opacity: 1, top: 0, left: 0 }; opts.animIn = { left: 0 }; opts.animOut = { left: 0 }; }; })(jQuery);



/*
 * jQuery UI Spinner @VERSION
 *
 * Copyright (c) 2008 jQuery
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Spinner
 *
 * Depends:
 *  ui.core.js
 */
(function($) {

$.widget('ui.spinner', {
	_init: function() {
		this._trigger('init', null, this.ui(null));
		
		// perform data bind on generic objects
		if (typeof this.options.items[0] == 'object' && !this.element.is('input')) {
			var data = this.options.items;
			for (var i=0; i<data.length; i++) {
				this._addItem(data[i]);
			}
		}
		
		// check for decimals in steppinng and set _decimals as internal
		this._decimals = parseInt(this.options.decimals, 10);
		if (this.options.stepping.toString().indexOf('.') != -1) {
			var s = this.options.stepping.toString();
			this._decimals = s.slice(s.indexOf('.')+1, s.length).length;
		}
		
		//Initialize needed constants
		var self = this;
		this.element
			.addClass('ui-spinner-box')
			.attr('autocomplete', 'off'); // switch off autocomplete in opera
		
		this._setValue( isNaN(this._getValue()) ? this.options.start : this._getValue() );
		
		this.element
		.wrap('<div>')
		.parent()
			.addClass('ui-spinner')
			.append('<button class="ui-spinner-up" type="button">&#9650;</button>')
			.find('.ui-spinner-up')
				.bind('mousedown', function(e) {
					$(this).addClass('ui-spinner-pressed');
					if (!self.counter) {
						self.counter = 1;
					}
					self._mousedown(100, '_up', e);
				})
				.bind('mouseup', function(e) {
					$(this).removeClass('ui-spinner-pressed');
					if (self.counter == 1) {
						self._up(e);
					}
					self._mouseup(e);
				})
				.bind('mouseout', function(e) {
					$(this).removeClass('ui-spinner-pressed');
					if (self.timer) {
						self._mouseup(e);
					}
				})
				// mousedown/mouseup capture first click, now handle second click
				.bind('dblclick', function(e) {
					$(this).removeClass('ui-spinner-pressed');
					self._up(e);
					self._mouseup(e);
				})
				.bind('keydown.spinner', function(e) {
					var KEYS = $.keyCode;
					if (e.keyCode == KEYS.SPACE || e.keyCode == KEYS.ENTER) {
						$(this).addClass('ui-spinner-pressed');
						if (!self.counter) {
							self.counter = 1;
						}
						self._up.call(self, e);
					} else if (e.keyCode == KEYS.DOWN || e.keyCode == KEYS.RIGHT) {
						self.element.siblings('.ui-spinner-down').focus();
					} else if (e.keyCode == KEYS.LEFT) {
						self.element.focus();
					}
				})
				.bind('keyup.spinner', function(e) {
					$(this).removeClass('ui-spinner-pressed');
					self.counter = 0;
					self._propagate('change', e);
				})
			.end()
			.append('<button class="ui-spinner-down" type="button">&#9660;</button>')
			.find('.ui-spinner-down')
				.bind('mousedown', function(e) {
					$(this).addClass('ui-spinner-pressed');
					if (!self.counter) {
						self.counter = 1;
					}
					self._mousedown(100, '_down', e);
				})
				.bind('mouseup', function(e) {
					$(this).removeClass('ui-spinner-pressed');
					if (self.counter == 1) {
						self._down();
					}
					self._mouseup(e);
				})
				.bind('mouseout', function(e) {
					$(this).removeClass('ui-spinner-pressed');
					if (self.timer) {
						self._mouseup(e);
					}
				})
				// mousedown/mouseup capture first click, now handle second click
				.bind('dblclick', function(e) {
					$(this).removeClass('ui-spinner-pressed');
					self._down(e);
					self._mouseup(e);
				})
				.bind('keydown.spinner', function(e) {
					var KEYS = $.keyCode;
					if (e.keyCode == KEYS.SPACE || e.keyCode == KEYS.ENTER) {
						$(this).addClass('ui-spinner-pressed');
						if (!self.counter) {
							self.counter = 1;
						}
						self._down.call(self, e);
					} else if (e.keyCode == KEYS.UP || e.keyCode == KEYS.LEFT) {
						self.element.siblings('.ui-spinner-up').focus();
					}
				})
				.bind('keyup.spinner', function(e) {
					$(this).removeClass('ui-spinner-pressed');
					self.counter = 0;
					self._propagate('change', e);
				})
			.end();
		
		// DataList: Set contraints for object length and step size. 
		// Manipulate height of spinner.
		this._items = this.element.children().length;
		if (this._items > 1) {
			var height = this.element.outerHeight()/this._items;
			this.element
			.addClass('ui-spinner-list')
			.height(height)
			.children()
				.addClass('ui-spinner-listitem')
				.height(height)
				.css('overflow', 'hidden')
			.end()
			.parent()
				.height(height)
			.end();
			this.options.stepping = 1;
			this.options.min = 0;
			this.options.max = this._items-1;
		}
		
		this.element
		.bind('keydown.spinner', function(e) {
			if (!self.counter) {
				self.counter = 1;
			}
			return self._keydown.call(self, e);
		})
		.bind('keyup.spinner', function(e) {
			self.counter = 0;
			self._propagate('change', e);
		})
		.bind('blur.spinner', function(e) {
			self._cleanUp();
		});
		
		if ($.fn.mousewheel) {
			this.element.mousewheel(function(e, delta) {
				self._mousewheel(e, delta);
			});
		}
	},
	
	_constrain: function() {
		if (this.options.min != undefined && this._getValue() < this.options.min) {
			this._setValue(this.options.min);
		}
		if (this.options.max != undefined && this._getValue() > this.options.max) {
			this._setValue(this.options.max);
		}
	},
	_cleanUp: function() {
		this._setValue(this._getValue());
		this._constrain();
	},
	_spin: function(d, e) {
		if (this.disabled) {
			return;
		}
		
		if (isNaN(this._getValue())) {
			this._setValue(this.options.start);
		}
		this._setValue(this._getValue() + (d == 'up' ? 1:-1) * (this.options.incremental && this.counter > 100 ? (this.counter > 200 ? 100 : 10) : 1) * this.options.stepping);
		this._animate(d);
		this._constrain();
		if (this.counter) {
			this.counter++;
		}
		this._propagate('spin', e);
	},
	_down: function(e) {
		this._spin('down', e);
		this._propagate('down', e);
	},
	_up: function(e) {
		this._spin('up', e);
		this._propagate('up', e);
	},
	_mousedown: function(i, d, e) {
		var self = this;
		i = i || 100;
		if (this.timer) {
			window.clearInterval(this.timer);
			this.timer = 0;
		}
		this.timer = window.setInterval(function() {
			self[d](e);
			if (self.counter > 20) {
				self._mousedown(20, d, e);
			}
		}, i);
	},
	_mouseup: function(e) {
		this.counter = 0;
		if (this.timer) {
			window.clearInterval(this.timer);
			this.timer = 0;
		}
		this.element[0].focus();
		this._propagate('change', e);
	},
	_keydown: function(e) {
		var KEYS = $.keyCode;
		
		if (e.keyCode == KEYS.UP) {
			this._up(e);
		}
		if (e.keyCode == KEYS.DOWN) {
			this._down(e);
		}
		if (e.keyCode == KEYS.HOME) {
			//Home key goes to min, if defined, else to start
			this._setValue(this.options.min || this.options.start);
		}
		if (e.keyCode == KEYS.END && this.options.max != undefined) {
			//End key goes to maximum
			this._setValue(this.options.max);
		}
		return (e.keyCode == KEYS.TAB || e.keyCode == KEYS.BACKSPACE ||
			e.keyCode == KEYS.LEFT || e.keyCode == KEYS.RIGHT || e.keyCode == KEYS.PERIOD || 
			e.keyCode == KEYS.NUMPAD_DECIMAL || e.keyCode == KEYS.NUMPAD_SUBTRACT || 
			(e.keyCode >= 96 && e.keyCode <= 105) || // add support for numeric keypad 0-9
			(/[0-9\-\.]/).test(String.fromCharCode(e.keyCode))) ? true : false;
	},
	_mousewheel: function(e, delta) {
		var self = this;
		delta = ($.browser.opera ? -delta / Math.abs(delta) : delta);
		(delta > 0 ? self._up(e) : self._down(e));
		if (self.timeout) {
			window.clearTimeout(self.timeout);
			self.timeout = 0;
		}
		self.timeout = window.setTimeout(function(){self._propagate('change', e)}, 400);
		e.preventDefault();
	},
	_getValue: function() {
		return parseFloat(this.element.val().replace(/[^0-9\-\.]/g, ''));
	},
	_setValue: function(newVal) {
		if (isNaN(newVal)) {
			newVal = this.options.start;
		}
		this.element.val(
			this.options.currency ? 
				$.ui.spinner.format.currency(newVal, this.options.currency) : 
				$.ui.spinner.format.number(newVal, this._decimals)
		);
	},
	_animate: function(d) {
		if (this.element.hasClass('ui-spinner-list') && ((d == 'up' && this._getValue() <= this.options.max) || (d == 'down' && this._getValue() >= this.options.min)) ) {
			this.element.animate({marginTop: '-' + this._getValue() * this.element.parent().height() }, {
				duration: 'fast',
				queue: false
			});
		}
	},
	_addItem: function(obj, fmt) {
		if (!this.element.is('input')) {
			var wrapper = 'div';
			if (this.element.is('ol') || this.element.is('ul')) {
				wrapper = 'li';
			}
			var html = obj; // string or object set it to html first
			
			if (typeof obj == 'object') {
				var format = (fmt !== undefined ? fmt : this.options.format);
				
				html = format.replace(/%(\(([^)]+)\))?/g, 
					(function(data){
						return function(match, a, lbl) { 
							if (!lbl) {
								for (var itm in data) {
									return data[itm]; // return the first item only
								}
							} else {
								return data[lbl];
							}
						};
					})(obj)
				);
			}
			this.element.append('<'+ wrapper +' class="ui-spinner-dyn">'+ html + '</'+ wrapper +'>');
		}
	},
	
	plugins: {},
	ui: function(e) {
		return {
			options: this.options,
			element: this.element,
			value: this._getValue(),
			add: this._addItem
		};
	},
	_propagate: function(n,e) {
		$.ui.plugin.call(this, n, [e, this.ui()]);
		return this.element.triggerHandler(n == 'spin' ? n : 'spin'+n, [e, this.ui()], this.options[n]);
	},
	destroy: function() {
		if (!$.data(this.element[0], 'spinner')) {
			return;
		}
		if ($.fn.mousewheel) {
			this.element.unmousewheel();
		}
		this.element
			.removeClass('ui-spinner-box ui-spinner-list')
			.removeAttr('disabled')
			.removeAttr('autocomplete')
			.removeData('spinner')
			.unbind('.spinner')
			.siblings()
				.remove()
			.end()
			.children()
				.removeClass('ui-spinner-listitem')
				.remove('.ui-spinner-dyn')
			.end()
			.parent()
				.removeClass('ui-spinner ui-spinner-disabled')
				.before(this.element.clone())
				.remove()
			.end();
	},
	enable: function() {
		this.element
			.removeAttr('disabled')
			.siblings()
				.removeAttr('disabled')
			.parent()
				.removeClass('ui-spinner-disabled');
		this.disabled = false;
	},
	disable: function() {
		this.element
			.attr('disabled', true)
			.siblings()
				.attr('disabled', true)
			.parent()
				.addClass('ui-spinner-disabled');
		this.disabled = true;
	}
});

$.extend($.ui.spinner, {
	defaults: {
		decimals: 0,
		stepping: 1,
		start: 0,
		incremental: true,
		currency: false,
		format: '%',
		items: []
	},
	format: {
		currency: function(num, sym) {
			num = isNaN(num) ? 0 : num;
			return (num !== Math.abs(num) ? '-' : '') + sym + this.number(Math.abs(num), 2);
		},
		number: function(num, dec) {
			var regex = /(\d+)(\d{3})/;
			for (num = isNaN(num) ? 0 : parseFloat(num,10).toFixed(dec); regex.test(num); num=num.replace(regex, '$1,$2'));
			return num;
		}
	}
});

})(jQuery);
