﻿/*
* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
*/

jQuery.easing['jswing'] = jQuery.easing['swing']; jQuery.extend(jQuery.easing, { def: 'easeOutQuad', swing: function(x, t, b, c, d) { return jQuery.easing[jQuery.easing.def](x, t, b, c, d) }, easeInQuad: function(x, t, b, c, d) { return c * (t /= d) * t + b }, easeOutQuad: function(x, t, b, c, d) { return -c * (t /= d) * (t - 2) + b }, easeInOutQuad: function(x, t, b, c, d) { if ((t /= d / 2) < 1) return c / 2 * t * t + b; return -c / 2 * ((--t) * (t - 2) - 1) + b }, easeInCubic: function(x, t, b, c, d) { return c * (t /= d) * t * t + b }, easeOutCubic: function(x, t, b, c, d) { return c * ((t = t / d - 1) * t * t + 1) + b }, easeInOutCubic: function(x, t, b, c, d) { if ((t /= d / 2) < 1) return c / 2 * t * t * t + b; return c / 2 * ((t -= 2) * t * t + 2) + b }, easeInQuart: function(x, t, b, c, d) { return c * (t /= d) * t * t * t + b }, easeOutQuart: function(x, t, b, c, d) { return -c * ((t = t / d - 1) * t * t * t - 1) + b }, easeInOutQuart: function(x, t, b, c, d) { if ((t /= d / 2) < 1) return c / 2 * t * t * t * t + b; return -c / 2 * ((t -= 2) * t * t * t - 2) + b }, easeInQuint: function(x, t, b, c, d) { return c * (t /= d) * t * t * t * t + b }, easeOutQuint: function(x, t, b, c, d) { return c * ((t = t / d - 1) * t * t * t * t + 1) + b }, easeInOutQuint: function(x, t, b, c, d) { if ((t /= d / 2) < 1) return c / 2 * t * t * t * t * t + b; return c / 2 * ((t -= 2) * t * t * t * t + 2) + b }, easeInSine: function(x, t, b, c, d) { return -c * Math.cos(t / d * (Math.PI / 2)) + c + b }, easeOutSine: function(x, t, b, c, d) { return c * Math.sin(t / d * (Math.PI / 2)) + b }, easeInOutSine: function(x, t, b, c, d) { return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b }, easeInExpo: function(x, t, b, c, d) { return (t == 0) ? b : c * Math.pow(2, 10 * (t / d - 1)) + b }, easeOutExpo: function(x, t, b, c, d) { return (t == d) ? b + c : c * (-Math.pow(2, -10 * t / d) + 1) + b }, easeInOutExpo: function(x, t, b, c, d) { if (t == 0) return b; if (t == d) return b + c; if ((t /= d / 2) < 1) return c / 2 * Math.pow(2, 10 * (t - 1)) + b; return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b }, easeInCirc: function(x, t, b, c, d) { return -c * (Math.sqrt(1 - (t /= d) * t) - 1) + b }, easeOutCirc: function(x, t, b, c, d) { return c * Math.sqrt(1 - (t = t / d - 1) * t) + b }, easeInOutCirc: function(x, t, b, c, d) { if ((t /= d / 2) < 1) return -c / 2 * (Math.sqrt(1 - t * t) - 1) + b; return c / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b }, easeInElastic: function(x, t, b, c, d) { var s = 1.70158; var p = 0; var a = c; if (t == 0) return b; if ((t /= d) == 1) return b + c; if (!p) p = d * .3; if (a < Math.abs(c)) { a = c; var s = p / 4 } else var s = p / (2 * Math.PI) * Math.asin(c / a); return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b }, easeOutElastic: function(x, t, b, c, d) { var s = 1.70158; var p = 0; var a = c; if (t == 0) return b; if ((t /= d) == 1) return b + c; if (!p) p = d * .3; if (a < Math.abs(c)) { a = c; var s = p / 4 } else var s = p / (2 * Math.PI) * Math.asin(c / a); return a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b }, easeInOutElastic: function(x, t, b, c, d) { var s = 1.70158; var p = 0; var a = c; if (t == 0) return b; if ((t /= d / 2) == 2) return b + c; if (!p) p = d * (.3 * 1.5); if (a < Math.abs(c)) { a = c; var s = p / 4 } else var s = p / (2 * Math.PI) * Math.asin(c / a); if (t < 1) return -.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b; return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p) * .5 + c + b }, easeInBack: function(x, t, b, c, d, s) { if (s == undefined) s = 1.70158; return c * (t /= d) * t * ((s + 1) * t - s) + b }, easeOutBack: function(x, t, b, c, d, s) { if (s == undefined) s = 1.70158; return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b }, easeInOutBack: function(x, t, b, c, d, s) { if (s == undefined) s = 1.70158; if ((t /= d / 2) < 1) return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b; return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b }, easeInBounce: function(x, t, b, c, d) { return c - jQuery.easing.easeOutBounce(x, d - t, 0, c, d) + b }, easeOutBounce: function(x, t, b, c, d) { if ((t /= d) < (1 / 2.75)) { return c * (7.5625 * t * t) + b } else if (t < (2 / 2.75)) { return c * (7.5625 * (t -= (1.5 / 2.75)) * t + .75) + b } else if (t < (2.5 / 2.75)) { return c * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375) + b } else { return c * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375) + b } }, easeInOutBounce: function(x, t, b, c, d) { if (t < d / 2) return jQuery.easing.easeInBounce(x, t * 2, 0, c, d) * .5 + b; return jQuery.easing.easeOutBounce(x, t * 2 - d, 0, c, d) * .5 + c * .5 + b } });


/*
* jQuery Easing Compatibility v1 - http://gsgd.co.uk/sandbox/jquery.easing.php
*/

jQuery.extend(jQuery.easing, { easeIn: function(x, t, b, c, d) { return jQuery.easing.easeInQuad(x, t, b, c, d) }, easeOut: function(x, t, b, c, d) { return jQuery.easing.easeOutQuad(x, t, b, c, d) }, easeInOut: function(x, t, b, c, d) { return jQuery.easing.easeInOutQuad(x, t, b, c, d) }, expoin: function(x, t, b, c, d) { return jQuery.easing.easeInExpo(x, t, b, c, d) }, expoout: function(x, t, b, c, d) { return jQuery.easing.easeOutExpo(x, t, b, c, d) }, expoinout: function(x, t, b, c, d) { return jQuery.easing.easeInOutExpo(x, t, b, c, d) }, bouncein: function(x, t, b, c, d) { return jQuery.easing.easeInBounce(x, t, b, c, d) }, bounceout: function(x, t, b, c, d) { return jQuery.easing.easeOutBounce(x, t, b, c, d) }, bounceinout: function(x, t, b, c, d) { return jQuery.easing.easeInOutBounce(x, t, b, c, d) }, elasin: function(x, t, b, c, d) { return jQuery.easing.easeInElastic(x, t, b, c, d) }, elasout: function(x, t, b, c, d) { return jQuery.easing.easeOutElastic(x, t, b, c, d) }, elasinout: function(x, t, b, c, d) { return jQuery.easing.easeInOutElastic(x, t, b, c, d) }, backin: function(x, t, b, c, d) { return jQuery.easing.easeInBack(x, t, b, c, d) }, backout: function(x, t, b, c, d) { return jQuery.easing.easeOutBack(x, t, b, c, d) }, backinout: function(x, t, b, c, d) { return jQuery.easing.easeInOutBack(x, t, b, c, d) } });


//BigTarget http://newism.com.au/blog/post/58/bigtarget-js-increasing-the-size-of-clickable-targets/
(function($) { $.fn.bigTarget = function(options) { debug(this); var opts = $.extend({}, $.fn.bigTarget.defaults, options); return this.each(function() { var $a = $(this); var href = $a.attr('href'); var title = $a.attr('title'); var o = $.meta ? $.extend({}, opts, $a.data()) : opts; $a.parents(o.clickZone).hover(function() { $h = $(this); $h.addClass(o.hoverClass); if (typeof o.title != 'undefined' && o.title === true && title != '') { $h.attr('title', title) } }, function() { $h.removeClass(o.hoverClass); if (typeof o.title != 'undefined' && o.title === true && title != '') { $h.removeAttr('title') } }).click(function() { if (getSelectedText() == "") { if ($a.is('[rel*=external]')) { window.open(href); return false } else { window.location = href } } }) }) }; function debug($obj) { if (window.console && window.console.log) window.console.log('bigTarget selection count: ' + $obj.size()) }; function getSelectedText() { if (window.getSelection) { return window.getSelection().toString() } else if (document.getSelection) { return document.getSelection() } else if (document.selection) { return document.selection.createRange().text } }; $.fn.bigTarget.defaults = { hoverClass: 'hover', clickZone: 'li:eq(0)', title: true} })(jQuery);


/*
* hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+
* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
* @author    Brian Cherne <brian@cherne.net>
*/
(function($) { $.fn.hoverIntent = function(f, g) { var cfg = { sensitivity: 7, interval: 100, timeout: 0 }; cfg = $.extend(cfg, g ? { over: f, out: g} : f); var cX, cY, pX, pY; var track = function(ev) { cX = ev.pageX; cY = ev.pageY; }; var compare = function(ev, ob) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); if ((Math.abs(pX - cX) + Math.abs(pY - cY)) < cfg.sensitivity) { $(ob).unbind("mousemove", track); ob.hoverIntent_s = 1; return cfg.over.apply(ob, [ev]); } else { pX = cX; pY = cY; ob.hoverIntent_t = setTimeout(function() { compare(ev, ob); }, cfg.interval); } }; var delay = function(ev, ob) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); ob.hoverIntent_s = 0; return cfg.out.apply(ob, [ev]); }; var handleHover = function(e) { var p = (e.type == "mouseover" ? e.fromElement : e.toElement) || e.relatedTarget; while (p && p != this) { try { p = p.parentNode; } catch (e) { p = this; } } if (p == this) { return false; } var ev = jQuery.extend({}, e); var ob = this; if (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); } if (e.type == "mouseover") { pX = ev.pageX; pY = ev.pageY; $(ob).bind("mousemove", track); if (ob.hoverIntent_s != 1) { ob.hoverIntent_t = setTimeout(function() { compare(ev, ob); }, cfg.interval); } } else { $(ob).unbind("mousemove", track); if (ob.hoverIntent_s == 1) { ob.hoverIntent_t = setTimeout(function() { delay(ev, ob); }, cfg.timeout); } } }; return this.mouseover(handleHover).mouseout(handleHover); }; })(jQuery);



/* bgIframe
* Version 2.1.1
*/
(function($) { $.fn.bgIframe = $.fn.bgiframe = function(s) { if ($.browser.msie && /6.0/.test(navigator.userAgent)) { s = $.extend({ top: 'auto', left: 'auto', width: 'auto', height: 'auto', opacity: true, src: 'javascript:false;' }, s || {}); var prop = function(n) { return n && n.constructor == Number ? n + 'px' : n; }, html = '<iframe class="bgiframe"frameborder="0"tabindex="-1"src="' + s.src + '"' + 'style="display:block;position:absolute;z-index:-1;' + (s.opacity !== false ? 'filter:Alpha(Opacity=\'0\');' : '') + 'top:' + (s.top == 'auto' ? 'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')' : prop(s.top)) + ';' + 'left:' + (s.left == 'auto' ? 'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')' : prop(s.left)) + ';' + 'width:' + (s.width == 'auto' ? 'expression(this.parentNode.offsetWidth+\'px\')' : prop(s.width)) + ';' + 'height:' + (s.height == 'auto' ? 'expression(this.parentNode.offsetHeight+\'px\')' : prop(s.height)) + ';' + '"/>'; return this.each(function() { if ($('> iframe.bgiframe', this).length == 0) this.insertBefore(document.createElement(html), this.firstChild); }); } return this; }; })(jQuery);



/*
* Superfish v1.4.8 - jQuery menu widget
* Copyright (c) 2008 Joel Birch
*/

; (function($) { $.fn.superfish = function(d) { var e = $.fn.superfish, c = e.c, $arrow = $(['<span class="', c.arrowClass, '"> &#187;</span>'].join('')), over = function() { var a = $(this), menu = getMenu(a); clearTimeout(menu.sfTimer); a.showSuperfishUl().siblings().hideSuperfishUl() }, out = function() { var a = $(this), menu = getMenu(a), o = e.op; clearTimeout(menu.sfTimer); menu.sfTimer = setTimeout(function() { o.retainPath = ($.inArray(a[0], o.$path) > -1); a.hideSuperfishUl(); if (o.$path.length && a.parents(['li.', o.hoverClass].join('')).length < 1) { over.call(o.$path) } }, o.delay) }, getMenu = function(a) { var b = a.parents(['ul.', c.menuClass, ':first'].join(''))[0]; e.op = e.o[b.serial]; return b }, addArrow = function(a) { a.addClass(c.anchorClass).append($arrow.clone()) }; return this.each(function() { var s = this.serial = e.o.length; var o = $.extend({}, e.defaults, d); o.$path = $('li.' + o.pathClass, this).slice(0, o.pathLevels).each(function() { $(this).addClass([o.hoverClass, c.bcClass].join(' ')).filter('li:has(ul)').removeClass(o.pathClass) }); e.o[s] = e.op = o; $('li:has(ul)', this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over, out).each(function() { if (o.autoArrows) addArrow($('>a:first-child', this)) }).not('.' + c.bcClass).hideSuperfishUl(); var b = $('a', this); b.each(function(i) { var a = b.eq(i).parents('li'); b.eq(i).focus(function() { over.call(a) }).blur(function() { out.call(a) }) }); o.onInit.call(this) }).each(function() { var a = [c.menuClass]; if (e.op.dropShadows && !($.browser.msie && $.browser.version < 7)) a.push(c.shadowClass); $(this).addClass(a.join(' ')) }) }; var f = $.fn.superfish; f.o = []; f.op = {}; f.IE7fix = function() { var o = f.op; if ($.browser.msie && $.browser.version > 6 && o.dropShadows && o.animation.opacity != undefined) this.toggleClass(f.c.shadowClass + '-off') }; f.c = { bcClass: 'sf-breadcrumb', menuClass: 'sf-js-enabled', anchorClass: 'sf-with-ul', arrowClass: 'sf-sub-indicator', shadowClass: 'sf-shadow' }; f.defaults = { hoverClass: 'sfHover', pathClass: 'overideThisToUse', pathLevels: 1, delay: 800, animation: { height: 'show' }, speed: 'normal', autoArrows: true, dropShadows: true, disableHI: false, onInit: function() { }, onBeforeShow: function() { }, onShow: function() { }, onHide: function() { } }; $.fn.extend({ hideSuperfishUl: function() { var o = f.op, not = (o.retainPath === true) ? o.$path : ''; o.retainPath = false; var a = $(['li.', o.hoverClass].join(''), this).add(this).not(not).removeClass(o.hoverClass).find('>ul').hide().css('visibility', 'hidden'); o.onHide.call(a); return this }, showSuperfishUl: function() { var o = f.op, sh = f.c.shadowClass + '-off', $ul = this.addClass(o.hoverClass).find('>ul:hidden').css('visibility', 'visible'); f.IE7fix.call($ul); o.onBeforeShow.call($ul); $ul.animate(o.animation, o.speed, function() { f.IE7fix.call($ul); o.onShow.call($ul) }); return this } }) })(jQuery);


/*
* Supersubs v0.2b - jQuery plugin
* Copyright (c) 2008 Joel Birch
*/

; (function($) { $.fn.supersubs = function(k) { var l = $.extend({}, $.fn.supersubs.defaults, k); return this.each(function() { var h = $(this); var o = $.meta ? $.extend({}, l, h.data()) : l; var j = $('<li id="menu-fontsize">&#8212;</li>').css({ 'padding': 0, 'position': 'absolute', 'top': '-999em', 'width': 'auto' }).appendTo(h).width(); $('#menu-fontsize').remove(); $ULs = h.find('ul'); $ULs.each(function(i) { var c = $ULs.eq(i); var d = c.children(); var e = d.children('a'); var f = d.css('white-space', 'nowrap').css('float'); var g = c.add(d).add(e).css({ 'float': 'none', 'width': 'auto' }).end().end()[0].clientWidth / j; g += o.extraWidth; if (g > o.maxWidth) { g = o.maxWidth } else if (g < o.minWidth) { g = o.minWidth } g += 'em'; c.css('width', g); d.css({ 'float': f, 'width': '100%', 'white-space': 'normal' }).each(function() { var a = $('>ul', this); var b = a.css('left') !== undefined ? 'left' : 'right'; a.css(b, g) }) }) }) }; $.fn.supersubs.defaults = { minWidth: 9, maxWidth: 25, extraWidth: 0} })(jQuery);


/*
GalleryView - jQuery Content Gallery Plugin
Author: 		Jack Anderson
Version:		1.1 (April 5, 2009)
Documentation: 	http://www.spaceforaname.com/jquery/galleryview/
*/
(function($) { $.fn.galleryView = function(g) { var h = $.extend($.fn.galleryView.defaults, g); var j; var k = 0; var l; var m; var n = 10; var o; var p; var q = 0; var r; var t; var u = false; var v = 20; var w = 5; var z = 2; var A; var B; var C; var D; var E; function showItem(i) { $('img.nav-next').unbind('click'); $('img.nav-prev').unbind('click'); C.unbind('click'); if (has_panels) { if (h.fade_panels) { D.fadeOut(h.transition_speed).eq(i % q).fadeIn(h.transition_speed, function() { if (!has_filmstrip) { $('img.nav-prev').click(showPrevItem); $('img.nav-next').click(showNextItem) } }) } } if (has_filmstrip) { if (r == 'strip') { B.stop(); var b = getPos(C[i]).left - (getPos(E[0]).left + 2); var c = (b >= 0 ? '-=' : '+=') + Math.abs(b) + 'px'; B.animate({ 'left': c }, h.transition_speed, h.easing, function() { if (i > q) { i = i % q; k = i; B.css('left', '-' + ((h.frame_width + n) * i) + 'px') } else if (i <= (q - strip_size)) { i = (i % q) + q; k = i; B.css('left', '-' + ((h.frame_width + n) * i) + 'px') } if (!h.fade_panels) { D.hide().eq(i % q).show() } $('img.nav-prev').click(showPrevItem); $('img.nav-next').click(showNextItem); enableFrameClicking() }) } else if (r == 'pointer') { E.stop(); var d = getPos(C[i]); E.animate({ 'left': (d.left - 2 + 'px') }, h.transition_speed, h.easing, function() { if (!h.fade_panels) { D.hide().eq(i % q).show() } $('img.nav-prev').click(showPrevItem); $('img.nav-next').click(showNextItem); enableFrameClicking() }) } if ($('a', C[i])[0]) { E.unbind('click').click(function() { var a = $('a', C[i]).eq(0); if (a.attr('target') == '_blank') { window.open(a.attr('href')) } else { location.href = a.attr('href') } }) } } }; function showNextItem() { $(document).stopTime("transition"); if (++k == C.length) { k = 0 } showItem(k); $(document).everyTime(h.transition_interval, "transition", function() { showNextItem() }) }; function showPrevItem() { $(document).stopTime("transition"); if (--k < 0) { k = q - 1 } showItem(k); $(document).everyTime(h.transition_interval, "transition", function() { showNextItem() }) }; function getPos(a) { var b = 0, top = 0; var c = a.id; if (a.offsetParent) { do { b += a.offsetLeft; top += a.offsetTop } while (a = a.offsetParent) } if (c == j) { return { 'left': b, 'top': top} } else { var d = getPos(A[0]); var e = d.left; var f = d.top; return { 'left': b - e, 'top': top - f} } }; function enableFrameClicking() { C.each(function(i) { if ($('a', this).length == 0) { $(this).click(function() { $(document).stopTime("transition"); showItem(i); k = i; $(document).everyTime(h.transition_interval, "transition", function() { showNextItem() }) }) } }) }; function buildPanels() { if ($('.panel-overlay').length > 0) { D.append('<div class="overlay"></div>') } if (!has_filmstrip) { $('<img />').addClass('nav-next').attr('src', '/images/themes/' + h.nav_theme + '/next.png').appendTo(A).css({ 'position': 'absolute', 'zIndex': '1100', 'cursor': 'pointer', 'top': ((h.panel_height - 22) / 2) + 'px', 'right': '10px', 'display': 'none' }).click(showNextItem); $('<img />').addClass('nav-prev').attr('src', '/images/themes/' + h.nav_theme + '/prev.png').appendTo(A).css({ 'position': 'absolute', 'zIndex': '1100', 'cursor': 'pointer', 'top': ((h.panel_height - 22) / 2) + 'px', 'left': '10px', 'display': 'none' }).click(showPrevItem); $('<img />').addClass('nav-overlay').attr('src', '/images/themes/' + h.nav_theme + '/panel-nav-next.png').appendTo(A).css({ 'position': 'absolute', 'zIndex': '1099', 'top': ((h.panel_height - 22) / 2) - 10 + 'px', 'right': '0', 'display': 'none' }); $('<img />').addClass('nav-overlay').attr('src', '/images/themes/' + h.nav_theme + '/panel-nav-prev.png').appendTo(A).css({ 'position': 'absolute', 'zIndex': '1099', 'top': ((h.panel_height - 22) / 2) - 10 + 'px', 'left': '0', 'display': 'none' }) } D.css({ 'width': (h.panel_width - parseInt(D.css('paddingLeft').split('px')[0], 10) - parseInt(D.css('paddingRight').split('px')[0], 10)) + 'px', 'height': (h.panel_height - parseInt(D.css('paddingTop').split('px')[0], 10) - parseInt(D.css('paddingBottom').split('px')[0], 10)) + 'px', 'position': 'absolute', 'top': (h.filmstrip_position == 'top' ? (h.frame_height + w + (h.show_captions ? v : w)) + 'px' : '0px'), 'left': '0px', 'overflow': 'hidden', 'background': '', 'display': 'none' }); $('.panel-overlay', D).css({ 'position': 'absolute', 'zIndex': '999', 'width': '250px', 'height': '359px', 'top': '0', 'right': '0', 'padding': '20px 10px 10px 10px', 'color': h.overlay_text_color, 'fontSize': h.overlay_font_size }); $('.overlay', D).css({ 'position': 'absolute', 'zIndex': '998', 'width': '270px', 'height': '389px', 'top': '0px', 'right': '0' }); $('.panel iframe', D).css({ 'width': h.panel_width + 'px', 'height': (h.panel_height - h.overlay_height) + 'px', 'border': '0' }) }; function buildFilmstrip() { B.wrap('<div class="strip_wrapper"></div>'); if (r == 'strip') { C.clone().appendTo(B); C.clone().appendTo(B); C = $('li', B) } if (h.show_captions) { C.append('<div class="caption"></div>').each(function(i) { $(this).find('.caption').html($(this).find('img').attr('title')) }) } B.css({ 'listStyle': 'none', 'margin': '0', 'padding': '0', 'width': o + 'px', 'position': 'absolute', 'zIndex': '900', 'top': '0', 'left': '0', 'height': (h.frame_height + 10) + 'px', 'background': h.background_color }); C.css({ 'float': 'left', 'position': 'relative', 'height': h.frame_height + 'px', 'zIndex': '901', 'marginTop': w + 'px', 'marginBottom': '0px', 'marginRight': n + 'px', 'padding': '0', 'cursor': 'pointer' }); $('img', C).css({ 'border': 'none' }); $('.strip_wrapper', A).css({ 'position': 'absolute', 'top': (h.filmstrip_position == 'top' ? '0px' : h.panel_height + 'px'), 'left': ((l - p) / 2) + 'px', 'width': p + 'px', 'height': (h.frame_height + w + (h.show_captions ? v : w)) + 'px', 'overflow': 'hidden' }); $('.caption', A).css({ 'position': 'absolute', 'top': h.frame_height + 'px', 'left': '0', 'margin': '0', 'width': h.frame_width + 'px', 'padding': '0', 'color': h.caption_text_color, 'textAlign': 'center', 'fontSize': '10px', 'height': v + 'px', 'lineHeight': v + 'px' }); var b = $('<div></div>'); b.attr('id', 'pointer').appendTo(A).css({ 'position': 'absolute', 'zIndex': '1000', 'cursor': 'pointer', 'top': getPos(C[0]).top - (z / 2) + 'px', 'left': getPos(C[0]).left - (z / 2) + 'px', 'height': h.frame_height - z + 'px', 'width': h.frame_width - z + 'px', 'border': (has_panels ? z + 'px solid ' + (h.nav_theme == 'dark' ? 'black' : 'white') : 'none') }); E = $('#pointer', A); if (has_panels) { var c = $('<img />'); c.attr('src', '/images/themes/' + h.nav_theme + '/pointer' + (h.filmstrip_position == 'top' ? '-down' : '') + '.png').appendTo($('#pointer')).css({ 'position': 'absolute', 'zIndex': '1001', 'top': (h.filmstrip_position == 'bottom' ? '-' + (10 + z) + 'px' : h.frame_height + 'px'), 'left': ((h.frame_width / 2) - 10) + 'px' }) } if (r == 'strip') { B.css('left', '-' + ((h.frame_width + n) * q) + 'px'); k = q } if ($('a', C[k])[0]) { E.click(function() { var a = $('a', C[k]).eq(0); if (a.attr('target') == '_blank') { window.open(a.attr('href')) } else { location.href = a.attr('href') } }) } $('<img />').addClass('nav-next').attr('src', '/images/themes/' + h.nav_theme + '/next.png').appendTo(A).css({ 'position': 'absolute', 'cursor': 'pointer', 'top': (h.filmstrip_position == 'top' ? 0 : h.panel_height) + w + ((h.frame_height - 22) / 2) + 'px', 'right': (l / 2) - (p / 2) - 10 - 22 + 'px' }).click(showNextItem); $('<img />').addClass('nav-prev').attr('src', '/images/themes/' + h.nav_theme + '/prev.png').appendTo(A).css({ 'position': 'absolute', 'cursor': 'pointer', 'top': (h.filmstrip_position == 'top' ? 0 : h.panel_height) + w + ((h.frame_height - 22) / 2) + 'px', 'left': (l / 2) - (p / 2) - 10 - 22 + 'px' }).click(showPrevItem) }; function mouseIsOverPanels(x, y) { var a = getPos(A[0]); var b = a.top; var c = a.left; return x > c && x < c + h.panel_width && y > b && y < b + h.panel_height }; return this.each(function() { A = $(this); $('script').each(function(i) { var s = $(this); if (s.attr('src') && s.attr('src').match(/jquery\.galleryview/)) { t = s.attr('src').split('jquery.galleryview')[0] + 'themes/' } }); A.css('visibility', 'hidden'); B = $('.filmstrip', A); C = $('li', B); D = $('.panel', A); j = A.attr('id'); has_panels = D.length > 0; has_filmstrip = C.length > 0; if (!has_panels) h.panel_height = 0; q = has_panels ? D.length : C.length; strip_size = has_panels ? Math.floor((h.panel_width - 64) / (h.frame_width + n)) : Math.min(q, h.filmstrip_size); if (strip_size >= q) { r = 'pointer'; strip_size = q } else { r = 'strip' } l = has_panels ? h.panel_width : (strip_size * (h.frame_width + n)) - n + 64; m = (has_panels ? h.panel_height : 0) + (has_filmstrip ? h.frame_height + w + (h.show_captions ? v : w) : 0); if (r == 'pointer') { o = (h.frame_width * q) + (n * (q)) } else { o = (h.frame_width * q * 3) + (n * (q * 3)) } p = ((strip_size * h.frame_width) + ((strip_size - 1) * n)); A.css({ 'position': 'relative', 'margin': '0', 'background': h.background_color, 'border': h.border, 'width': l + 'px', 'height': m + 'px' }); if (has_filmstrip) { buildFilmstrip() } if (has_panels) { buildPanels() } if (has_filmstrip) enableFrameClicking(); $().mousemove(function(e) { if (mouseIsOverPanels(e.pageX, e.pageY)) { if (h.pause_on_hover) { $(document).oneTime(500, "animation_pause", function() { $(document).stopTime("transition"); u = true }) } if (has_panels && !has_filmstrip) { $('.nav-overlay').fadeIn('fast'); $('.nav-next').fadeIn('fast'); $('.nav-prev').fadeIn('fast') } } else { if (h.pause_on_hover) { $(document).stopTime("animation_pause"); if (u) { $(document).everyTime(h.transition_interval, "transition", function() { showNextItem() }); u = false } } if (has_panels && !has_filmstrip) { $('.nav-overlay').fadeOut('fast'); $('.nav-next').fadeOut('fast'); $('.nav-prev').fadeOut('fast') } } }); D.eq(0).show(); if (q > 1) { $(document).everyTime(h.transition_interval, "transition", function() { showNextItem() }) } A.css('visibility', 'visible') }) }; $.fn.galleryView.defaults = { panel_width: 400, panel_height: 300, frame_width: 80, frame_height: 80, filmstrip_size: 3, overlay_height: 70, overlay_font_size: '1em', transition_speed: 400, transition_interval: 6000, overlay_opacity: 0.6, overlay_color: 'black', background_color: 'black', overlay_text_color: 'white', caption_text_color: 'white', border: '1px solid black', nav_theme: 'light', easing: 'swing', filmstrip_position: 'bottom', overlay_position: 'bottom', show_captions: false, fade_panels: true, pause_on_hover: false} })(jQuery);