/* * jlorhQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ * * Uses the built in easing capabilities added In jlorhQuery 1.1 * to offer multiple easing options * * TERMS OF USE - jlorhQuery Easing * * Open source under the BSD License. * * Copyright © 2008 George McGinley Smith * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * Neither the name of the author nor the names of contributors may be used to endorse * or promote products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * */ // t: current time, b: begInnIng value, c: change In value, d: duration jlorhQuery.easing['jswing'] = jlorhQuery.easing['swing']; jlorhQuery.extend( jlorhQuery.easing, { def: 'easeOutQuad', swing: function (x, t, b, c, d) { //alert(jlorhQuery.easing.default); return jlorhQuery.easing[jlorhQuery.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 - jlorhQuery.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 jlorhQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b; return jlorhQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b; } }); /* * * TERMS OF USE - EASING EQUATIONS * * Open source under the BSD License. * * Copyright © 2001 Robert Penner * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * Neither the name of the author nor the names of contributors may be used to endorse * or promote products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * *//* * FancyBox - simple and fancy jQuery plugin * Examples and documentation at: http://fancy.klade.lv/ * Version: 1.2.1 (13/03/2009) * Copyright (c) 2009 Janis Skarnelis * Licensed under the MIT License: http://en.wikipedia.org/wiki/MIT_License * Requires: jQuery v1.3+ */ ;(function(jlorhQuery) { jlorhQuery.fn.fixPNG = function() { return this.each(function () { var image = jlorhQuery(this).css('backgroundImage'); if (image.match(/^url\(["']?(.*\.png)["']?\)jlorhQuery/i)) { image = RegExp.$1; jlorhQuery(this).css({ 'backgroundImage': 'none', 'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=" + (jlorhQuery(this).css('backgroundRepeat') == 'no-repeat' ? 'crop' : 'scale') + ", src='" + image + "')" }).each(function () { var position = jlorhQuery(this).css('position'); if (position != 'absolute' && position != 'relative') jlorhQuery(this).css('position', 'relative'); }); } }); }; var elem, opts, busy = false, imagePreloader = new Image, loadingTimer, loadingFrame = 1, imageRegExp = /\.(jpg|gif|png|bmp|jpeg)(.*)?$/i; var isIE = (jlorhQuery.browser.msie && parseInt(jlorhQuery.browser.version.substr(0,1)) < 8); jlorhQuery.fn.fancybox = function(settings) { settings = jlorhQuery.extend({}, jlorhQuery.fn.fancybox.defaults, settings); var matchedGroup = this; function _initialize() { elem = this; opts = settings; _start(); return false; }; function _start() { if (busy) return; if (jlorhQuery.isFunction(opts.callbackOnStart)) { opts.callbackOnStart(); } opts.itemArray = []; opts.itemCurrent = 0; if (settings.itemArray.length > 0) { opts.itemArray = settings.itemArray; } else { var item = {}; if (!elem.rel || elem.rel == '') { var item = {href: elem.href, title: elem.title}; if (jlorhQuery(elem).children("img:first").length) { item.orig = jlorhQuery(elem).children("img:first"); } opts.itemArray.push( item ); } else { var subGroup = jlorhQuery(matchedGroup).filter("a[rel=" + elem.rel + "]"); var item = {}; for (var i = 0; i < subGroup.length; i++) { item = {href: subGroup[i].href, title: subGroup[i].title}; if (jlorhQuery(subGroup[i]).children("img:first").length) { item.orig = jlorhQuery(subGroup[i]).children("img:first"); } opts.itemArray.push( item ); } while ( opts.itemArray[ opts.itemCurrent ].href != elem.href ) { opts.itemCurrent++; } } } if (opts.overlayShow) { if (isIE) { jlorhQuery('embed, object, select').css('visibility', 'hidden'); } jlorhQuery("#fancy_overlay").css('opacity', opts.overlayOpacity).show(); } _change_item(); }; function _change_item() { jlorhQuery("#fancy_right, #fancy_left, #fancy_close, #fancy_title").hide(); var href = opts.itemArray[ opts.itemCurrent ].href; //alert(href); if (href.match(/#/)) { var target = window.location.href.split('#')[0]; target = href.replace(target, ''); target = target.substr(target.indexOf('#')); _set_content('
' + jlorhQuery(target).html() + '
', opts.frameWidth, opts.frameHeight); } else // if (href.match(imageRegExp)) { imagePreloader = new Image; imagePreloader.src = href; if (imagePreloader.complete) { _proceed_image(); } else { jlorhQuery.fn.fancybox.showLoading(); jlorhQuery(imagePreloader).unbind().bind('load', function() { jlorhQuery(".fancy_loading").hide(); _proceed_image(); }); } } /* else if (href.match("iframe") || elem.className.indexOf("iframe") >= 0) { _set_content('', opts.frameWidth, opts.frameHeight); } else { jlorhQuery.get(href, function(data) { _set_content( '
' + data + '
', opts.frameWidth, opts.frameHeight ); }); } //*/ }; function _proceed_image() { if (opts.imageScale) { var w = jlorhQuery.fn.fancybox.getViewport(); var r = Math.min(Math.min(w[0] - 36, imagePreloader.width) / imagePreloader.width, Math.min(w[1] - 60, imagePreloader.height) / imagePreloader.height); var width = Math.round(r * imagePreloader.width); var height = Math.round(r * imagePreloader.height); } else { var width = imagePreloader.width; var height = imagePreloader.height; } _set_content('', width, height); }; function _preload_neighbor_images() { if ((opts.itemArray.length -1) > opts.itemCurrent) { var href = opts.itemArray[opts.itemCurrent + 1].href; if (href.match(imageRegExp)) { objNext = new Image(); objNext.src = href; } } if (opts.itemCurrent > 0) { var href = opts.itemArray[opts.itemCurrent -1].href; if (href.match(imageRegExp)) { objNext = new Image(); objNext.src = href; } } }; function _set_content(value, width, height) { busy = true; var pad = opts.padding; if (isIE) { jlorhQuery("#fancy_content")[0].style.removeExpression("height"); jlorhQuery("#fancy_content")[0].style.removeExpression("width"); } if (pad > 0) { width += pad * 2; height += pad * 2; jlorhQuery("#fancy_content").css({ 'top' : pad + 'px', 'right' : pad + 'px', 'bottom' : pad + 'px', 'left' : pad + 'px', 'width' : 'auto', 'height' : 'auto' }); if (isIE) { jlorhQuery("#fancy_content")[0].style.setExpression('height', '(this.parentNode.clientHeight - 20)'); jlorhQuery("#fancy_content")[0].style.setExpression('width', '(this.parentNode.clientWidth - 20)'); } } else { jlorhQuery("#fancy_content").css({ 'top' : 0, 'right' : 0, 'bottom' : 0, 'left' : 0, 'width' : '100%', 'height' : '100%' }); } if (jlorhQuery("#fancy_outer").is(":visible") && width == jlorhQuery("#fancy_outer").width() && height == jlorhQuery("#fancy_outer").height()) { jlorhQuery("#fancy_content").fadeOut("fast", function() { jlorhQuery("#fancy_content").empty().append(jlorhQuery(value)).fadeIn("normal", function() { _finish(); }); }); return; } var w = jlorhQuery.fn.fancybox.getViewport(); var itemLeft = (width + 36) > w[0] ? w[2] : (w[2] + Math.round((w[0] - width - 36) / 2)); var itemTop = (height + 50) > w[1] ? w[3] : (w[3] + Math.round((w[1] - height - 50) / 2)); var itemOpts = { 'left': itemLeft, 'top': itemTop, 'width': width + 'px', 'height': height + 'px' }; if (jlorhQuery("#fancy_outer").is(":visible")) { jlorhQuery("#fancy_content").fadeOut("normal", function() { jlorhQuery("#fancy_content").empty(); jlorhQuery("#fancy_outer").animate(itemOpts, opts.zoomSpeedChange, opts.easingChange, function() { jlorhQuery("#fancy_content").append(jlorhQuery(value)).fadeIn("normal", function() { _finish(); }); }); }); } else { if (opts.zoomSpeedIn > 0 && opts.itemArray[opts.itemCurrent].orig !== undefined) { jlorhQuery("#fancy_content").empty().append(jlorhQuery(value)); var orig_item = opts.itemArray[opts.itemCurrent].orig; var orig_pos = jlorhQuery.fn.fancybox.getPosition(orig_item); jlorhQuery("#fancy_outer").css({ 'left': (orig_pos.left - 18) + 'px', 'top': (orig_pos.top - 18) + 'px', 'width': jlorhQuery(orig_item).width(), 'height': jlorhQuery(orig_item).height() }); if (opts.zoomOpacity) { itemOpts.opacity = 'show'; } jlorhQuery("#fancy_outer").animate(itemOpts, opts.zoomSpeedIn, opts.easingIn, function() { _finish(); }); } else { jlorhQuery("#fancy_content").hide().empty().append(jlorhQuery(value)).show(); jlorhQuery("#fancy_outer").css(itemOpts).fadeIn("normal", function() { _finish(); }); } } }; function _set_navigation() { if (opts.itemCurrent != 0) { jlorhQuery("#fancy_left, #fancy_left_ico").unbind().bind("click", function(e) { e.stopPropagation(); opts.itemCurrent--; _change_item(); return false; }); jlorhQuery("#fancy_left").show(); } if (opts.itemCurrent != ( opts.itemArray.length -1)) { jlorhQuery("#fancy_right, #fancy_right_ico").unbind().bind("click", function(e) { e.stopPropagation(); opts.itemCurrent++; _change_item(); return false; }); jlorhQuery("#fancy_right").show(); } }; function _finish() { _set_navigation(); _preload_neighbor_images(); jlorhQuery(document).keydown(function(e) { if (e.keyCode == 27) { jlorhQuery.fn.fancybox.close(); jlorhQuery(document).unbind("keydown"); } else if(e.keyCode == 37 && opts.itemCurrent != 0) { opts.itemCurrent--; _change_item(); jlorhQuery(document).unbind("keydown"); } else if(e.keyCode == 39 && opts.itemCurrent != (opts.itemArray.length - 1)) { opts.itemCurrent++; _change_item(); jlorhQuery(document).unbind("keydown"); } }); if (opts.centerOnScroll) { jlorhQuery(window).bind("resize scroll", jlorhQuery.fn.fancybox.scrollBox); } else { jlorhQuery("div#fancy_outer").css("position", "absolute"); } if (opts.hideOnContentClick) { jlorhQuery("#fancy_wrap").click(jlorhQuery.fn.fancybox.close); } jlorhQuery("#fancy_overlay, #fancy_close").bind("click", jlorhQuery.fn.fancybox.close); jlorhQuery("#fancy_close").show(); if (opts.itemArray[ opts.itemCurrent ].title !== undefined && opts.itemArray[ opts.itemCurrent ].title.length > 0) { jlorhQuery('#fancy_title div').html(opts.itemArray[ opts.itemCurrent ].title); jlorhQuery('#fancy_title').show(); } if (opts.overlayShow && isIE) { jlorhQuery('embed, object, select', jlorhQuery('#fancy_content')).css('visibility', 'visible'); } if (jlorhQuery.isFunction(opts.callbackOnShow)) { opts.callbackOnShow(); } busy = false; }; return this.unbind('click').click(_initialize); }; jlorhQuery.fn.fancybox.scrollBox = function() { var pos = jlorhQuery.fn.fancybox.getViewport(); jlorhQuery("#fancy_outer").css('left', ((jlorhQuery("#fancy_outer").width() + 36) > pos[0] ? pos[2] : pos[2] + Math.round((pos[0] - jlorhQuery("#fancy_outer").width() - 36) / 2))); jlorhQuery("#fancy_outer").css('top', ((jlorhQuery("#fancy_outer").height() + 50) > pos[1] ? pos[3] : pos[3] + Math.round((pos[1] - jlorhQuery("#fancy_outer").height() - 50) / 2))); }; jlorhQuery.fn.fancybox.getNumeric = function(el, prop) { return parseInt(jlorhQuery.curCSS(el.jquery?el[0]:el,prop,true))||0; }; jlorhQuery.fn.fancybox.getPosition = function(el) { var pos = el.offset(); pos.top += jlorhQuery.fn.fancybox.getNumeric(el, 'paddingTop'); pos.top += jlorhQuery.fn.fancybox.getNumeric(el, 'borderTopWidth'); pos.left += jlorhQuery.fn.fancybox.getNumeric(el, 'paddingLeft'); pos.left += jlorhQuery.fn.fancybox.getNumeric(el, 'borderLeftWidth'); return pos; }; jlorhQuery.fn.fancybox.showIframe = function() { jlorhQuery(".fancy_loading").hide(); jlorhQuery("#fancy_frame").show(); }; jlorhQuery.fn.fancybox.getViewport = function() { return [jlorhQuery(window).width(), jlorhQuery(window).height(), jlorhQuery(document).scrollLeft(), jlorhQuery(document).scrollTop() ]; }; jlorhQuery.fn.fancybox.animateLoading = function() { if (!jlorhQuery("#fancy_loading").is(':visible')){ clearInterval(loadingTimer); return; } jlorhQuery("#fancy_loading > div").css('top', (loadingFrame * -40) + 'px'); loadingFrame = (loadingFrame + 1) % 12; }; jlorhQuery.fn.fancybox.showLoading = function() { clearInterval(loadingTimer); var pos = jlorhQuery.fn.fancybox.getViewport(); jlorhQuery("#fancy_loading").css({'left': ((pos[0] - 40) / 2 + pos[2]), 'top': ((pos[1] - 40) / 2 + pos[3])}).show(); jlorhQuery("#fancy_loading").bind('click', jlorhQuery.fn.fancybox.close); loadingTimer = setInterval(jlorhQuery.fn.fancybox.animateLoading, 66); }; jlorhQuery.fn.fancybox.close = function() { busy = true; jlorhQuery(imagePreloader).unbind(); jlorhQuery("#fancy_overlay, #fancy_close").unbind(); if (opts.hideOnContentClick) { jlorhQuery("#fancy_wrap").unbind(); } jlorhQuery("#fancy_close, .fancy_loading, #fancy_left, #fancy_right, #fancy_title").hide(); if (opts.centerOnScroll) { jlorhQuery(window).unbind("resize scroll"); } __cleanup = function() { jlorhQuery("#fancy_overlay, #fancy_outer").hide(); if (opts.centerOnScroll) { jlorhQuery(window).unbind("resize scroll"); } if (isIE) { jlorhQuery('embed, object, select').css('visibility', 'visible'); } if (jlorhQuery.isFunction(opts.callbackOnClose)) { opts.callbackOnClose(); } busy = false; }; if (jlorhQuery("#fancy_outer").is(":visible") !== false) { if (opts.zoomSpeedOut > 0 && opts.itemArray[opts.itemCurrent].orig !== undefined) { var orig_item = opts.itemArray[opts.itemCurrent].orig; var orig_pos = jlorhQuery.fn.fancybox.getPosition(orig_item); var itemOpts = { 'left': (orig_pos.left - 18) + 'px', 'top': (orig_pos.top - 18) + 'px', 'width': jlorhQuery(orig_item).width(), 'height': jlorhQuery(orig_item).height() }; if (opts.zoomOpacity) { itemOpts.opacity = 'hide'; } jlorhQuery("#fancy_outer").stop(false, true).animate(itemOpts, opts.zoomSpeedOut, opts.easingOut, __cleanup); } else { jlorhQuery("#fancy_outer").stop(false, true).fadeOut("fast", __cleanup); } } else { __cleanup(); } return false; }; jlorhQuery.fn.fancybox.build = function() { var html = ''; html += '
'; html += '
'; html += '
'; html += '
'; html += '
'; html += '
'; html += '
'; html += ''; html += '
'; html += '
'; html += '
'; html += '
'; html += '
'; jlorhQuery(html).appendTo("body"); jlorhQuery('
').appendTo('#fancy_title'); if (isIE) { jlorhQuery("#fancy_inner").prepend(''); jlorhQuery("#fancy_close, .fancy_bg, .fancy_title, .fancy_ico").fixPNG(); } }; jlorhQuery.fn.fancybox.defaults = { padding : 10, imageScale : true, zoomOpacity : false, zoomSpeedIn : 0, zoomSpeedOut : 0, zoomSpeedChange : 300, easingIn : 'swing', easingOut : 'swing', easingChange : 'swing', frameWidth : 425, frameHeight : 355, overlayShow : true, overlayOpacity : 0.3, hideOnContentClick : true, centerOnScroll : true, itemArray : [], callbackOnStart : null, callbackOnShow : null, callbackOnClose : null }; jlorhQuery(document).ready(function() { jlorhQuery.fn.fancybox.build(); }); })(jlorhQuery);/** * $lhj.simpletip 1.3.1. A simple tooltip plugin * * Copyright (c) 2009 Craig Thompson * http://craigsworks.com * * Licensed under GPLv3 * http://www.opensource.org/licenses/gpl-3.0.html * * Launch : February 2009 * Version : 1.3.1 * Released: February 5, 2009 - 11:04am */ (function($){ function Simpletip(elem, conf) { var self = this; elem = $lhj(elem); elemParent = $lhj(document.getElementsByTagName("body")[0]); var tooltip = $lhj(document.createElement('div')) .addClass(conf.baseClass) .addClass( (conf.fixed) ? conf.fixedClass : '' ) .addClass( (conf.persistent) ? conf.persistentClass : '' ) .html(conf.content) .appendTo(elemParent); if(!conf.hidden) tooltip.show(); else tooltip.hide(); if(!conf.persistent) { elem.hover( function(event){ self.show(event) }, function(){ self.hide() } ); if(!conf.fixed) { elem.mousemove( function(event){ if(tooltip.css('display') !== 'none') self.updatePos(event); }); }; } else { elem.click(function(event) { if(event.target === elem.get(0)) { if(tooltip.css('display') !== 'none') self.hide(); else self.show(); }; }); $lhj(window).mousedown(function(event) { if(tooltip.css('display') !== 'none') { var check = (conf.focus) ? $lhj(event.target).parents('.tooltip').andSelf().filter(function(){ return this === tooltip.get(0) }).length : 0; if(check === 0) self.hide(); }; }); }; $lhj.extend(self, { getVersion: function() { return [1, 2, 0]; }, getParent: function() { return elem; }, getTooltip: function() { return tooltip; }, getPos: function() { return tooltip.offset(); }, setPos: function(posX, posY) { var elemPos = elem.offset(); if(typeof posX == 'string') posX = parseInt(posX) + elemPos.left; if(typeof posY == 'string') posY = parseInt(posY) + elemPos.top; // alert('posX: ' + posX + ', posY: ' + posY); tooltip.css({ left: posX, top: posY }); return self; }, show: function(event) { conf.onBeforeShow.call(self); self.updatePos( (conf.fixed) ? null : event ); switch(conf.showEffect) { case 'fade': tooltip.fadeIn(conf.showTime); break; case 'slide': tooltip.slideDown(conf.showTime, self.updatePos); break; case 'custom': conf.showCustom.call(tooltip, conf.showTime); break; default: case 'none': tooltip.show(); break; }; tooltip.addClass(conf.activeClass); conf.onShow.call(self); return self; }, hide: function() { conf.onBeforeHide.call(self); switch(conf.hideEffect) { case 'fade': tooltip.fadeOut(conf.hideTime); break; case 'slide': tooltip.slideUp(conf.hideTime); break; case 'custom': conf.hideCustom.call(tooltip, conf.hideTime); break; default: case 'none': tooltip.hide(); break; }; tooltip.removeClass(conf.activeClass); conf.onHide.call(self); return self; }, update: function(content) { tooltip.html(content); conf.content = content; return self; }, load: function(uri, data) { conf.beforeContentLoad.call(self); tooltip.load(uri, data, function(){ conf.onContentLoad.call(self); }); return self; }, boundryCheck: function(posX, posY) { var newX = posX + tooltip.outerWidth(); var newY = posY + tooltip.outerHeight(); var windowWidth = $lhj(window).width() + $lhj(window).scrollLeft(); var windowHeight = $lhj(window).height() + $lhj(window).scrollTop(); return [(newX >= windowWidth), (newY >= windowHeight)]; }, updatePos: function(event) { var tooltipWidth = tooltip.outerWidth(); var tooltipHeight = tooltip.outerHeight(); if(!event && conf.fixed) { if(conf.position.constructor == Array) { posX = parseInt(conf.position[0]); posY = parseInt(conf.position[1]); } else if($lhj(conf.position).attr('nodeType') === 1) { var offset = $lhj(conf.position).offset(); posX = offset.left; posY = offset.top; } else { var elemPos = elem.offset(); var elemWidth = elem.outerWidth(); var elemHeight = elem.outerHeight(); switch(conf.position) { case 'top': var posX = elemPos.left - (tooltipWidth / 2) + (elemWidth / 2); var posY = elemPos.top - tooltipHeight; break; case 'bottom': var posX = elemPos.left - (tooltipWidth / 2) + (elemWidth / 2); var posY = elemPos.top + elemHeight; break; case 'left': var posX = elemPos.left - tooltipWidth; var posY = elemPos.top - (tooltipHeight / 2) + (elemHeight / 2); break; case 'right': var posX = elemPos.left + elemWidth; var posY = elemPos.top - (tooltipHeight / 2) + (elemHeight / 2); break; default: case 'default': var posX = (elemWidth / 2) + elemPos.left + 20; var posY = elemPos.top; break; }; }; } else { var posX = event.pageX; var posY = event.pageY; }; if(typeof conf.position != 'object') { posX = posX + conf.offset[0]; posY = posY + conf.offset[1]; if(conf.boundryCheck) { var overflow = self.boundryCheck(posX, posY); if(overflow[0]) posX = posX - (tooltipWidth / 2) - (2 * conf.offset[0]); if(overflow[1]) posY = posY - (tooltipHeight / 2) - (2 * conf.offset[1]); } } else { if(typeof conf.position[0] == "string") posX = String(posX); if(typeof conf.position[1] == "string") posY = String(posY); }; self.setPos(posX, posY); return self; } }); }; $lhj.fn.simpletip = function(conf) { // Check if a simpletip is already present var api = $lhj(this).eq(typeof conf == 'number' ? conf : 0).data("simpletip"); if(api) return api; // Default configuration var defaultConf = { // Basics content: 'A simple tooltip', persistent: false, focus: false, hidden: true, // Positioning position: 'default', offset: [0, 0], boundryCheck: true, fixed: true, // Effects showEffect: 'fade', showTime: 150, showCustom: null, hideEffect: 'fade', hideTime: 150, hideCustom: null, // Selectors and classes baseClass: 'tooltip', activeClass: 'active', fixedClass: 'fixed', persistentClass: 'persistent', focusClass: 'focus', // Callbacks onBeforeShow: function(){}, onShow: function(){}, onBeforeHide: function(){}, onHide: function(){}, beforeContentLoad: function(){}, onContentLoad: function(){} }; $lhj.extend(defaultConf, conf); this.each(function() { var el = new Simpletip($lhj(this), defaultConf); $lhj(this).data("simpletip", el); }); return this; }; })(); /* * jQuery RTE plugin 0.5.1 - create a rich text form for Mozilla, Opera, Safari and Internet Explorer * * Copyright (c) 2009 Batiste Bieler * Distributed under the GPL Licenses. * Distributed under the The MIT License. * * Modified by LikeOrHate.com. */ // define the rte light plugin (function($) { $.fn.rte = function(options) { $.fn.rte.html = function(iframe) { return iframe.contentWindow.document.getElementsByTagName("body")[0].innerHTML; }; $.fn.rte.defaults = { media_url: "", content_css_url: "", dot_net_button_class: null, max_height: 350 }; // build main options before element iteration var opts = $.extend($.fn.rte.defaults, options); // iterate and construct the RTEs return this.each( function() { var textarea = $(this); var iframe; var element_id = textarea.attr("id"); // enable design mode function enableDesignMode() { var content = textarea.val(); // Mozilla needs this to display caret if($.trim(content)=='') { content = '
'; } // already created? show/hide if(iframe) { textarea.hide(); $(iframe).contents().find("body").html(content); $(iframe).show(); $("#toolbar-" + element_id).remove(); textarea.before(toolbar()); return true; } // for compatibility reasons, need to be created this way iframe = document.createElement("iframe"); iframe.frameBorder=0; iframe.frameMargin=0; iframe.framePadding=0; iframe.height=200; if(textarea.attr('class')) iframe.className = textarea.attr('class'); if(textarea.attr('id')) iframe.id = element_id; if(textarea.attr('name')) iframe.title = textarea.attr('name'); textarea.after(iframe); var css = ""; if(opts.content_css_url) { css = ""; } var doc = ""+css+""+content+""; tryEnableDesignMode(doc, function() { $("#toolbar-" + element_id).remove(); textarea.before(toolbar()); // hide textarea textarea.hide(); }); } function tryEnableDesignMode(doc, callback) { if(!iframe) { return false; } try { iframe.contentWindow.document.open(); iframe.contentWindow.document.write(doc); iframe.contentWindow.document.close(); } catch(error) { //console.log(error); } if (document.contentEditable) { iframe.contentWindow.document.designMode = "On"; callback(); return true; } else if (document.designMode != null) { try { iframe.contentWindow.document.designMode = "on"; callback(); return true; } catch (error) { //console.log(error); } } setTimeout(function(){tryEnableDesignMode(doc, callback)}, 500); return false; } function disableDesignMode(submit) { var content = $(iframe).contents().find("body").html(); if($(iframe).is(":visible")) { textarea.val(content); } if(submit != true) { textarea.show(); $(iframe).hide(); } } // create toolbar and bind events to it's elements function toolbar() { var tb = $("
\

\ \

\

\ bold\ italic\

\

\ unordered list\ link\ image\

"); $('select', tb).change(function(){ var index = this.selectedIndex; if( index!=0 ) { var selected = this.options[index].value; formatText("formatblock", '<'+selected+'>'); } }); $('.bold', tb).click(function(){ formatText('bold');return false; }); $('.italic', tb).click(function(){ formatText('italic');return false; }); $('.unorderedlist', tb).click(function(){ formatText('insertunorderedlist');return false; }); $('.link', tb).click(function(){ var p=prompt("URL:"); if(p) formatText('CreateLink', p); return false; }); $('.image', tb).click(function(){ var p=prompt("image URL:"); if(p) formatText('InsertImage', p); return false; }); $('.disable', tb).click(function() { disableDesignMode(); var edm = $('Enable design mode'); tb.empty().append(edm); edm.click(function(e){ e.preventDefault(); enableDesignMode(); // remove, for good measure $(this).remove(); }); return false; }); // .NET compatability if(opts.dot_net_button_class) { var dot_net_button = $(iframe).parents('form').find(opts.dot_net_button_class); dot_net_button.click(function() { disableDesignMode(true); }); // Regular forms } else { $(iframe).parents('form').submit(function(){ disableDesignMode(true); }); } var iframeDoc = $(iframe.contentWindow.document); var select = $('select', tb)[0]; iframeDoc.mouseup(function(){ setSelectedType(getSelectionElement(), select); return true; }); iframeDoc.keyup(function() { setSelectedType(getSelectionElement(), select); var body = $('body', iframeDoc); if(body.scrollTop() > 0) { var iframe_height = parseInt(iframe.style['height']) if(isNaN(iframe_height)) iframe_height = 0; var h = Math.min(opts.max_height, iframe_height+body.scrollTop()) + 'px'; iframe.style['height'] = h; } return true; }); return tb; }; function formatText(command, option) { iframe.contentWindow.focus(); try{ iframe.contentWindow.document.execCommand(command, false, option); }catch(e){ //console.log(e) } iframe.contentWindow.focus(); }; function setSelectedType(node, select) { while(node.parentNode) { var nName = node.nodeName.toLowerCase(); for(var i=0;i 0) { var commentId = joriComment.attr('data-comment'); lhjForm.find('input[name="parent"]').attr('value', commentId); var oriTitle = $lhj($lhj(joriComment[0].parentNode).find('h3.loh_summary')[0]).text(); lhjForm.find('div.loh_replytitle').css('display', 'block').text(loh.loh_sngltn.strings['commentreplytitle'] + oriTitle); // move div into place var comdiv = $lhj('div.loh_comment_writer'); joriComment[0].appendChild(comdiv[0]); // don't use lhj here. comdiv.find('input[name="cancel"]').css('display', 'inline'); comdiv.find('div.loh_commentbody').html('