/**
 * Cookie plugin
 * Get the value of a cookie with the given name.
 *
 * @example $.cookie('the_cookie');
 * @desc Get the value of a cookie.
 *
 * @param String name The name of the cookie.
 * @return The value of the cookie.
 * @type String
 *
 * @name $.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */
jQuery.cookie = function(name, value, options) {
    if (typeof value != 'undefined') { // name and value given, set cookie
        options = options || {};
        if (value === null) {
            value = '';
            options.expires = -1;
        }
        var expires = '';
        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
            var date;
            if (typeof options.expires == 'number') {
                date = new Date();
                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
            } else {
                date = options.expires;
            }
            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
        }
        // CAUTION: Needed to parenthesize options.path and options.domain
        // in the following expressions, otherwise they evaluate to undefined
        // in the packed version for some reason...
        var path = options.path ? '; path=' + (options.path) : '';
        var domain = options.domain ? '; domain=' + (options.domain) : '';
        var secure = options.secure ? '; secure' : '';
        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
    } else { // only name given, get cookie
        var cookieValue = null;
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split(';');
            for (var i = 0; i < cookies.length; i++) {
                var cookie = jQuery.trim(cookies[i]);
                // Does this cookie string begin with the name we want?
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                    break;
                }
            }
        }
        return cookieValue;
    }
};

/*
* jquery-roundcorners-canvas (jrc)
* http://jrc.meerbox.nl/?page_id=4
*/
if (!document.createElement('canvas').getContext) { (function() { var m = Math; var mr = m.round; var ms = m.sin; var mc = m.cos; var Z = 10; var Z2 = Z / 2; function getContext() { if (this.context_) { return this.context_ } return this.context_ = new CanvasRenderingContext2D_(this) } var slice = Array.prototype.slice; function bind(f, obj, var_args) { var a = slice.call(arguments, 2); return function() { return f.apply(obj, a.concat(slice.call(arguments))) } } var G_vmlCanvasManager_ = { init: function(opt_doc) { if (/MSIE/.test(navigator.userAgent) && !window.opera) { var doc = opt_doc || document; doc.createElement('canvas'); doc.attachEvent('onreadystatechange', bind(this.init_, this, doc)) } }, init_: function(doc) { if (!doc.namespaces['g_vml_']) { doc.namespaces.add('g_vml_', 'urn:schemas-microsoft-com:vml') } if (!doc.styleSheets['ex_canvas_']) { var ss = doc.createStyleSheet(); ss.owningElement.id = 'ex_canvas_'; ss.cssText = 'canvas{display:inline-block;overflow:hidden;' + 'text-align:left;width:300px;height:150px}' + 'g_vml_\\:*{behavior:url(#default#VML)}' } }, i: function(el) { if (!el.getContext) { el.getContext = getContext; el.attachEvent('onpropertychange', onPropertyChange); el.attachEvent('onresize', onResize); var attrs = el.attributes; if (attrs.width && attrs.width.specified) { el.style.width = attrs.width.nodeValue + 'px' } else { el.width = el.clientWidth } if (attrs.height && attrs.height.specified) { el.style.height = attrs.height.nodeValue + 'px' } else { el.height = el.clientHeight } } return el } }; function onPropertyChange(e) { var el = e.srcElement; switch (e.propertyName) { case 'width': el.style.width = el.attributes.width.nodeValue + 'px'; el.getContext().clearRect(); break; case 'height': el.style.height = el.attributes.height.nodeValue + 'px'; el.getContext().clearRect(); break } } function onResize(e) { var el = e.srcElement; if (el.firstChild) { el.firstChild.style.width = el.clientWidth + 'px'; el.firstChild.style.height = el.clientHeight + 'px' } } G_vmlCanvasManager_.init(); var dec2hex = []; for (var i = 0; i < 16; i++) { for (var j = 0; j < 16; j++) { dec2hex[i * 16 + j] = i.toString(16) + j.toString(16) } } function createMatrixIdentity() { return [[1, 0, 0], [0, 1, 0], [0, 0, 1]] } function processStyle(styleString) { var str, alpha = 1; styleString = String(styleString); if (styleString.substring(0, 3) == 'rgb') { var start = styleString.indexOf('(', 3); var end = styleString.indexOf(')', start + 1); var guts = styleString.substring(start + 1, end).split(','); str = '#'; for (var i = 0; i < 3; i++) { str += dec2hex[Number(guts[i])] } if (guts.length == 4 && styleString.substr(3, 1) == 'a') { alpha = guts[3] } } else { str = styleString } return [str, alpha] } function processLineCap(lineCap) { switch (lineCap) { case 'butt': return 'flat'; case 'round': return 'round'; case 'square': default: return 'square' } } function CanvasRenderingContext2D_(surfaceElement) { this.m_ = createMatrixIdentity(); this.mStack_ = []; this.aStack_ = []; this.currentPath_ = []; this.strokeStyle = '#000'; this.fillStyle = '#000'; this.lineWidth = 1; this.lineJoin = 'miter'; this.lineCap = 'butt'; this.miterLimit = Z * 1; this.globalAlpha = 1; this.canvas = surfaceElement; var el = surfaceElement.ownerDocument.createElement('div'); el.style.width = surfaceElement.clientWidth + 'px'; el.style.height = surfaceElement.clientHeight + 'px'; el.style.overflow = 'hidden'; el.style.position = 'absolute'; surfaceElement.appendChild(el); this.element_ = el; this.arcScaleX_ = 1; this.arcScaleY_ = 1 } var contextPrototype = CanvasRenderingContext2D_.prototype; contextPrototype.clearRect = function() { this.element_.innerHTML = ''; this.currentPath_ = [] }; contextPrototype.beginPath = function() { this.currentPath_ = [] }; contextPrototype.moveTo = function(aX, aY) { var p = this.getCoords_(aX, aY); this.currentPath_.push({ type: 'moveTo', x: p.x, y: p.y }); this.currentX_ = p.x; this.currentY_ = p.y }; contextPrototype.lineTo = function(aX, aY) { var p = this.getCoords_(aX, aY); this.currentPath_.push({ type: 'lineTo', x: p.x, y: p.y }); this.currentX_ = p.x; this.currentY_ = p.y }; contextPrototype.bezierCurveTo = function(aCP1x, aCP1y, aCP2x, aCP2y, aX, aY) { var p = this.getCoords_(aX, aY); var cp1 = this.getCoords_(aCP1x, aCP1y); var cp2 = this.getCoords_(aCP2x, aCP2y); this.currentPath_.push({ type: 'bezierCurveTo', cp1x: cp1.x, cp1y: cp1.y, cp2x: cp2.x, cp2y: cp2.y, x: p.x, y: p.y }); this.currentX_ = p.x; this.currentY_ = p.y }; contextPrototype.fillRect = function(aX, aY, aWidth, aHeight) { this.beginPath(); this.moveTo(aX, aY); this.lineTo(aX + aWidth, aY); this.lineTo(aX + aWidth, aY + aHeight); this.lineTo(aX, aY + aHeight); this.closePath(); this.fill(); this.currentPath_ = [] }; contextPrototype.createLinearGradient = function(aX0, aY0, aX1, aY1) { return new CanvasGradient_('gradient') }; contextPrototype.createRadialGradient = function(aX0, aY0, aR0, aX1, aY1, aR1) { var gradient = new CanvasGradient_('gradientradial'); gradient.radius1_ = aR0; gradient.radius2_ = aR1; gradient.focus_.x = aX0; gradient.focus_.y = aY0; return gradient }; contextPrototype.stroke = function(aFill) { var lineStr = []; var lineOpen = false; var a = processStyle(aFill ? this.fillStyle : this.strokeStyle); var color = a[0]; var opacity = a[1] * this.globalAlpha; var W = 10; var H = 10; lineStr.push('<g_vml_:shape', ' fillcolor="', color, '"', ' filled="', Boolean(aFill), '"', ' style="position:absolute;width:', W, ';height:', H, ';"', ' coordorigin="0 0" coordsize="', Z * W, ' ', Z * H, '"', ' stroked="', !aFill, '"', ' strokeweight="', this.lineWidth, '"', ' strokecolor="', color, '"', ' path="'); var newSeq = false; var min = { x: null, y: null }; var max = { x: null, y: null }; for (var i = 0; i < this.currentPath_.length; i++) { var p = this.currentPath_[i]; var c; switch (p.type) { case 'moveTo': lineStr.push(' m '); c = p; lineStr.push(mr(p.x), ',', mr(p.y)); break; case 'lineTo': lineStr.push(' l '); lineStr.push(mr(p.x), ',', mr(p.y)); break; case 'close': lineStr.push(' x '); p = null; break; case 'bezierCurveTo': lineStr.push(' c '); lineStr.push(mr(p.cp1x), ',', mr(p.cp1y), ',', mr(p.cp2x), ',', mr(p.cp2y), ',', mr(p.x), ',', mr(p.y)); break; case 'at': case 'wa': lineStr.push(' ', p.type, ' '); lineStr.push(mr(p.x - this.arcScaleX_ * p.radius), ',', mr(p.y - this.arcScaleY_ * p.radius), ' ', mr(p.x + this.arcScaleX_ * p.radius), ',', mr(p.y + this.arcScaleY_ * p.radius), ' ', mr(p.xStart), ',', mr(p.yStart), ' ', mr(p.xEnd), ',', mr(p.yEnd)); break } if (p) { if (min.x == null || p.x < min.x) { min.x = p.x } if (max.x == null || p.x > max.x) { max.x = p.x } if (min.y == null || p.y < min.y) { min.y = p.y } if (max.y == null || p.y > max.y) { max.y = p.y } } } lineStr.push(' ">'); if (typeof this.fillStyle == 'object') { var focus = { x: '50%', y: '50%' }; var width = max.x - min.x; var height = max.y - min.y; var dimension = width > height ? width : height; focus.x = mr(this.fillStyle.focus_.x / width * 100 + 50) + '%'; focus.y = mr(this.fillStyle.focus_.y / height * 100 + 50) + '%'; var colors = []; if (this.fillStyle.type_ == 'gradientradial') { var inside = this.fillStyle.radius1_ / dimension * 100; var expansion = this.fillStyle.radius2_ / dimension * 100 - inside } else { var inside = 0; var expansion = 100 } var insidecolor = { offset: null, color: null }; var outsidecolor = { offset: null, color: null }; this.fillStyle.colors_.sort(function(cs1, cs2) { return cs1.offset - cs2.offset }); for (var i = 0; i < this.fillStyle.colors_.length; i++) { var fs = this.fillStyle.colors_[i]; colors.push(fs.offset * expansion + inside, '% ', fs.color, ','); if (fs.offset > insidecolor.offset || insidecolor.offset == null) { insidecolor.offset = fs.offset; insidecolor.color = fs.color } if (fs.offset < outsidecolor.offset || outsidecolor.offset == null) { outsidecolor.offset = fs.offset; outsidecolor.color = fs.color } } colors.pop(); lineStr.push('<g_vml_:fill', ' color="', outsidecolor.color, '"', ' color2="', insidecolor.color, '"', ' type="', this.fillStyle.type_, '"', ' focusposition="', focus.x, ', ', focus.y, '"', ' colors="', colors.join(''), '"', ' opacity="', opacity, '" />') } else if (aFill) { lineStr.push('<g_vml_:fill color="', color, '" opacity="', opacity, '" />') } else { var lineWidth = Math.max(this.arcScaleX_, this.arcScaleY_) * this.lineWidth; lineStr.push('<g_vml_:stroke', ' opacity="', opacity, '"', ' joinstyle="', this.lineJoin, '"', ' miterlimit="', this.miterLimit, '"', ' endcap="', processLineCap(this.lineCap), '"', ' weight="', lineWidth, 'px"', ' color="', color, '" />') } lineStr.push('</g_vml_:shape>'); this.element_.insertAdjacentHTML('beforeEnd', lineStr.join('')) }; contextPrototype.fill = function() { this.stroke(true) }; contextPrototype.closePath = function() { this.currentPath_.push({ type: 'close' }) }; contextPrototype.getCoords_ = function(aX, aY) { return { x: Z * (aX * this.m_[0][0] + aY * this.m_[1][0] + this.m_[2][0]) - Z2, y: Z * (aX * this.m_[0][1] + aY * this.m_[1][1] + this.m_[2][1]) - Z2} }; function CanvasPattern_() { } G_vmlCMjrc = G_vmlCanvasManager_ })() } if (jQuery.browser.msie) { document.execCommand("BackgroundImageCache", false, true) } (function($) { var isMSIE = $.browser.msie; var isltMSIE7 = isMSIE && !window.XMLHttpRequest; var isOpera = $.browser.opera; var canvasSupport = typeof document.createElement('canvas').getContext == "function"; var Num = function(i) { return parseInt(i, 10) || 0 }; var getStyle = function(el, styleProp, styleProp2) { var x = el, y; if (x.currentStyle) { y = x.currentStyle[styleProp] } else if (window.getComputedStyle) { if (typeof arguments[2] == "string") styleProp = styleProp2; y = document.defaultView.getComputedStyle(x, null).getPropertyValue(styleProp) } return y }; var getBorderColor = function(elm, p) { return getStyle(elm, 'border' + p + 'Color', 'border-' + p.toLowerCase() + '-color') }; var getBorderWidth = function(elm, p) { if (elm.currentStyle && !isOpera) { w = elm.currentStyle['border' + p + 'Width']; if (w == 'thin') w = 2; if (w == 'medium' && !(elm.currentStyle['border' + p + 'Style'] == 'none')) w = 4; if (w == 'thick') w = 6 } else { p = p.toLowerCase(); w = document.defaultView.getComputedStyle(elm, null).getPropertyValue('border-' + p + '-width') } return Num(w) }; var isElm = function(elm, i) { return elm.tagName.toLowerCase() == i }; var rotationSteps = function(r_type, a, b, c, d) { if (r_type == 'tl') return a; if (r_type == 'tr') return b; if (r_type == 'bl') return c; if (r_type == 'br') return d }; var drawCorner = function(canvas, radius, r_type, bg_color, border_width, border_color, corner_effect) { var steps, curve_to; if (bg_color.indexOf('rgba') != -1) { var reg = /^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/; var bits = reg.exec(bg_color); if (bits) { var channels = [Num(bits[1]), Num(bits[2]), Num(bits[3])]; bg_color = 'rgb(' + channels[0] + ', ' + channels[1] + ', ' + channels[2] + ')' } } var ctx = canvas.getContext('2d'); if (radius == 1 || corner_effect == 'notch') { if (border_width > 0 && radius > 1) { ctx.fillStyle = border_color; ctx.fillRect(0, 0, radius, radius); ctx.fillStyle = bg_color; steps = rotationSteps(r_type, [0 - border_width, 0 - border_width], [border_width, 0 - border_width], [0 - border_width, border_width], [border_width, border_width]); ctx.fillRect(steps[0], steps[1], radius, radius) } else { ctx.fillStyle = bg_color; ctx.fillRect(0, 0, radius, radius) } return canvas } else if (corner_effect == 'bevel') { steps = rotationSteps(r_type, [0, 0, 0, radius, radius, 0, 0, 0], [0, 0, radius, radius, radius, 0, 0, 0], [0, 0, radius, radius, 0, radius, 0, 0], [radius, radius, radius, 0, 0, radius, radius, radius]); ctx.fillStyle = bg_color; ctx.beginPath(); ctx.moveTo(steps[0], steps[1]); ctx.lineTo(steps[2], steps[3]); ctx.lineTo(steps[4], steps[5]); ctx.lineTo(steps[6], steps[7]); ctx.fill(); if (border_width > 0 && border_width < radius) { ctx.strokeStyle = border_color; ctx.lineWidth = border_width; ctx.beginPath(); steps = rotationSteps(r_type, [0, radius, radius, 0], [0, 0, radius, radius], [radius, radius, 0, 0], [0, radius, radius, 0]); ctx.moveTo(steps[0], steps[1]); ctx.lineTo(steps[2], steps[3]); ctx.stroke() } return canvas } steps = rotationSteps(r_type, [0, 0, radius, 0, radius, 0, 0, radius, 0, 0], [radius, 0, radius, radius, radius, 0, 0, 0, 0, 0], [0, radius, radius, radius, 0, radius, 0, 0, 0, radius], [radius, radius, radius, 0, radius, 0, 0, radius, radius, radius]); ctx.fillStyle = bg_color; ctx.beginPath(); ctx.moveTo(steps[0], steps[1]); ctx.lineTo(steps[2], steps[3]); if (r_type == 'br') ctx.bezierCurveTo(steps[4], steps[5], radius, radius, steps[6], steps[7]); else ctx.bezierCurveTo(steps[4], steps[5], 0, 0, steps[6], steps[7]); ctx.lineTo(steps[8], steps[9]); ctx.fill(); if (border_width > 0 && border_width < radius) { var offset = border_width / 2; var ro = radius - offset; steps = rotationSteps(r_type, [ro, offset, ro, offset, offset, ro], [ro, ro, ro, offset, offset, offset], [ro, ro, offset, ro, offset, offset, offset, ro], [ro, offset, ro, offset, offset, ro, ro, ro]); curve_to = rotationSteps(r_type, [0, 0], [0, 0], [0, 0], [radius, radius]); ctx.strokeStyle = border_color; ctx.lineWidth = border_width; ctx.beginPath(); ctx.moveTo(steps[0], steps[1]); ctx.bezierCurveTo(steps[2], steps[3], curve_to[0], curve_to[1], steps[4], steps[5]); ctx.stroke() } return canvas }; var createCanvas = function(p, radius) { var elm = document.createElement('canvas'); elm.setAttribute("height", radius); elm.setAttribute("width", radius); elm.style.display = "block"; elm.style.position = "absolute"; elm.className = "jrCorner"; appendToParent(p, elm); if (!canvasSupport && isMSIE) { if (typeof G_vmlCanvasManager == "object") { elm = G_vmlCanvasManager.initElement(elm) } else if (typeof G_vmlCMjrc == "object") { elm = G_vmlCMjrc.i(elm) } else { throw Error('Could not find excanvas'); } } return elm }; var appendToParent = function(p, elm) { if (p.is("table")) { p.children("tbody").children("tr:first").children("td:first").append(elm); p.css('display', 'block') } else if (p.is("td")) { if (p.children(".JrcTdContainer").length === 0) { p.html('<div class="JrcTdContainer" style="padding:0px;position:relative;margin:-1px;zoom:1;">' + p.html() + '</div>'); p.css('zoom', '1'); if (isltMSIE7) { p.children(".JrcTdContainer").get(0).style.setExpression("height", "this.parentNode.offsetHeight") } } p.children(".JrcTdContainer").append(elm) } else { p.append(elm) } }; if (isMSIE) { var ss = document.createStyleSheet(); ss.media = 'print'; ss.cssText = '.jrcIECanvasDiv { display:none !important; }' } var _corner = function(options) { if (this.length == 0 || !(canvasSupport || isMSIE)) { return this } if (options == "destroy") { return this.each(function() { var p, elm = $(this); if (elm.is(".jrcRounded")) { if (typeof elm.data("ie6tmr.jrc") == 'number') window.clearInterval(elm.data("ie6tmr.jrc")); if (elm.is("table")) p = elm.children("tbody").children("tr:first").children("td:first"); else if (elm.is("td")) p = elm.children(".JrcTdContainer"); else p = elm; p.children(".jrCorner").remove(); elm.unbind('mouseleave.jrc').unbind('mouseenter.jrc').removeClass('jrcRounded').removeData('ie6tmr.jrc'); if (elm.is("td")) elm.html(elm.children(".JrcTdContainer").html()) } }) } var o = (options || "").toLowerCase(); var radius = Num((o.match(/(\d+)px/) || [])[1]) || "auto"; var bg_arg = ((o.match(/(#[0-9a-f]+)/) || [])[1]) || "auto"; var re = /round|bevel|notch/; var fx = ((o.match(re) || ['round'])[0]); var hover = /hover/.test(o); var overSized = /oversized/.test(o); var hiddenparent_arg = o.match("hiddenparent"); if (isMSIE) { var re = /ie6nofix|ie6fixinit|ie6fixexpr|ie6fixonload|ie6fixwidthint|ie6fixheightint|ie6fixbothint/; var ie6Fix = ((o.match(re) || ['ie6fixinit'])[0]) } var opts = { tl: /top|left|tl/.test(o), tr: /top|right|tr/.test(o), bl: /bottom|left|bl/.test(o), br: /bottom|right|br/.test(o) }; if (!opts.tl && !opts.tr && !opts.bl && !opts.br) opts = { tl: 1, tr: 1, bl: 1, br: 1 }; this.each(function() { var elm = $(this), rbg = null, bg, s, b, pr; var a = this; var elm_display = getStyle(this, 'display'); var elm_position = getStyle(this, 'position'); var elm_lineheight = getStyle(this, 'lineHeight', 'line-height'); if (bg_arg == "auto") { s = elm.siblings(".jrcRounded:eq(0)"); if (s.length > 0) { b = s.data("rbg.jrc"); if (typeof b == "string") { rbg = b } } } if (hiddenparent_arg || rbg === null) { var current_p = this.parentNode, hidden_parents = new Array(), a = 0; while ((typeof current_p == 'object') && !isElm(current_p, 'html')) { if (hiddenparent_arg && getStyle(current_p, 'display') == 'none') { hidden_parents.push({ originalvisibility: getStyle(current_p, 'visibility'), elm: current_p }); current_p.style.display = 'block'; current_p.style.visibility = 'hidden' } var pbg = getStyle(current_p, 'backgroundColor', 'background-color'); if (rbg === null && pbg != "transparent" && pbg != "rgba(0, 0, 0, 0)") { rbg = pbg } current_p = current_p.parentNode } if (rbg === null) rbg = "#ffffff" } if (bg_arg == "auto") { bg = rbg; elm.data("rbg.jrc", rbg) } else { bg = bg_arg } if (elm_display == 'none') { var originalvisibility = getStyle(this, 'visibility'); this.style.display = 'block'; this.style.visibility = 'hidden'; var ishidden = true } else { var ishiddden = false } var elm_height = elm.outerHeight(); var elm_width = elm.outerWidth(); if (hover) { var newOptions = o.replace(/hover|ie6nofix|ie6fixinit|ie6fixexpr|ie6fixonload|ie6fixwidthint|ie6fixheightint|ie6fixbothint/g, ""); if (ie6Fix != 'ie6nofix') newOptions = "ie6fixinit " + newOptions; elm.bind("mouseenter.jrc", function() { elm.addClass('jrcHover'); elm.corner(newOptions) }); elm.bind("mouseleave.jrc", function() { elm.removeClass('jrcHover'); elm.corner(newOptions) }) } if (isltMSIE7 && ie6Fix != 'ie6nofix') { this.style.zoom = 1; if (ie6Fix != 'ie6fixexpr') { if (elm.outerWidth() % 2 != 0) elm.width(elm.outerWidth() + 1); if (elm.outerHeight() % 2 != 0) elm.height(elm.outerHeight() + 1) } $(window).load(function() { if (ie6Fix == 'ie6fixonload') { if (elm.css('height') == 'auto') elm.height(elm.css('height')); if (elm.outerWidth() % 2 != 0) elm.width(elm.outerWidth() + 1); if (elm.outerHeight() % 2 != 0) elm.height(elm.outerHeight() + 1) } else if (ie6Fix == 'ie6fixwidthint' || ie6Fix == 'ie6fixheightint' || ie6Fix == 'ie6fixbothint') { var myInterval, ie6FixFunction; if (ie6Fix == 'ie6fixheightint') { ie6FixFunction = function() { elm.height('auto'); var elm_height = elm.outerHeight(); if (elm_height % 2 != 0) elm_height = elm_height + 1; elm.css({ height: elm_height }) } } else if (ie6Fix == 'ie6fixwidthint') { ie6FixFunction = function() { elm.width('auto'); var elm_width = elm.outerWidth(); if (elm_width % 2 != 0) elm_width = elm_width + 1; elm.css({ width: elm_width }); elm.data('lastWidth.jrc', elm.get(0).offsetWidth) } } else if (ie6Fix == 'ie6fixbothint') { ie6FixFunction = function() { elm.width('auto'); elm.height('auto'); var elm_width = elm.outerWidth(); var elm_height = elm.outerHeight(); if (elm_height % 2 != 0) elm_height = elm_height + 1; if (elm_width % 2 != 0) elm_width = elm_width + 1; elm.css({ width: elm_width, height: elm_height }) } } myInterval = window.setInterval(ie6FixFunction, 100); elm.data("ie6tmr.jrc", myInterval) } }) } var widthHeightSmallest = elm_height < elm_width ? this.offsetHeight : this.offsetWidth; if (radius == "auto") { radius = widthHeightSmallest / 2; if (radius > 10) radius = widthHeightSmallest / 4 } if (radius > widthHeightSmallest / 2 && !overSized) { radius = widthHeightSmallest / 2 } radius = Math.floor(radius); var border_t = getBorderWidth(this, 'Top'); var border_r = getBorderWidth(this, 'Right'); var border_b = getBorderWidth(this, 'Bottom'); var border_l = getBorderWidth(this, 'Left'); if (elm_position == 'static' && !isElm(this, 'td')) { this.style.position = 'relative' } else if (elm_position == 'fixed' && isMSIE && !(document.compatMode == 'CSS1Compat' && !isltMSIE7)) { this.style.position = 'absolute' } if (border_t + border_r + border_b + border_l > 0) { this.style.overflow = 'visible' } if (ishidden) elm.css({ display: 'none', visibility: originalvisibility }); if (typeof hidden_parents != "undefined") { for (var i = 0; i < hidden_parents.length; i++) { hidden_parents[i].elm.style.display = 'none'; hidden_parents[i].elm.style.visibility = hidden_parents[i].originalvisibility } } var p_top = 0 - border_t, p_right = 0 - border_r, p_bottom = 0 - border_b, p_left = 0 - border_l; var mhc = (elm.find("canvas").length > 0); if (mhc) { if (isElm(this, 'table')) pr = elm.children("tbody").children("tr:first").children("td:first"); else if (isElm(this, 'td')) pr = elm.children(".JrcTdContainer"); else pr = elm } if (opts.tl) { bordersWidth = border_t < border_l ? border_t : border_l; if (mhc) pr.children("canvas.jrcTL").remove(); var tl = drawCorner(createCanvas(elm, radius), radius, 'tl', bg, bordersWidth, getBorderColor(this, 'Top'), fx); $(tl).css({ left: p_left, top: p_top }).addClass('jrcTL') } if (opts.tr) { bordersWidth = border_t < border_r ? border_t : border_r; if (mhc) pr.children("canvas.jrcTR").remove(); var tr = drawCorner(createCanvas(elm, radius), radius, 'tr', bg, bordersWidth, getBorderColor(this, 'Top'), fx); $(tr).css({ right: p_right, top: p_top }).addClass('jrcTR') } if (opts.bl) { bordersWidth = border_b < border_l ? border_b : border_l; if (mhc) pr.children("canvas.jrcBL").remove(); var bl = drawCorner(createCanvas(elm, radius), radius, 'bl', bg, bordersWidth, getBorderColor(this, 'Bottom'), fx); $(bl).css({ left: p_left, bottom: p_bottom }).addClass('jrcBL') } if (opts.br) { bordersWidth = border_b < border_r ? border_b : border_r; if (mhc) pr.children("canvas.jrcBR").remove(); var br = drawCorner(createCanvas(elm, radius), radius, 'br', bg, bordersWidth, getBorderColor(this, 'Bottom'), fx); $(br).css({ right: p_right, bottom: p_bottom }).addClass('jrcBR') } if (isMSIE) elm.children('canvas.jrCorner').children('div').addClass('jrcIECanvasDiv'); if (isltMSIE7 && ie6Fix == 'ie6fixexpr') { if (opts.bl) { bl.style.setExpression("bottom", "this.parentNode.offsetHeight % 2 == 0 || this.parentNode.offsetWidth % 2 == 0 ? 0-(parseInt(this.parentNode.currentStyle['borderBottomWidth'])) : 0-(parseInt(this.parentNode.currentStyle['borderBottomWidth'])+1)") } if (opts.br) { br.style.setExpression("right", "this.parentNode.offsetWidth  % 2 == 0 || this.parentNode.offsetWidth % 2 == 0 ? 0-(parseInt(this.parentNode.currentStyle['borderRightWidth']))  : 0-(parseInt(this.parentNode.currentStyle['borderRightWidth'])+1)"); br.style.setExpression("bottom", "this.parentNode.offsetHeight % 2 == 0 || this.parentNode.offsetWidth % 2 == 0 ? 0-(parseInt(this.parentNode.currentStyle['borderBottomWidth'])) : 0-(parseInt(this.parentNode.currentStyle['borderBottomWidth'])+1)") } if (opts.tr) { tr.style.setExpression("right", "this.parentNode.offsetWidth   % 2 == 0 || this.parentNode.offsetWidth % 2 == 0 ? 0-(parseInt(this.parentNode.currentStyle['borderRightWidth']))  : 0-(parseInt(this.parentNode.currentStyle['borderRightWidth'])+1)") } } elm.addClass('jrcRounded') }); if (typeof arguments[1] == "function") arguments[1](this); return this }; $.fn.corner = _corner })(jQuery);

/*
* jQuery Corners 0.3
* Copyright (c) 2008 David Turnbull, Steven Wittens
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*/
jQuery.fn.corners = function(C) { var N = "rounded_by_jQuery_corners"; var V = B(C); var F = false; try { F = (document.body.style.WebkitBorderRadius !== undefined); var Y = navigator.userAgent.indexOf("Chrome"); if (Y >= 0) { F = false } } catch (E) { } var W = false; try { W = (document.body.style.MozBorderRadius !== undefined); var Y = navigator.userAgent.indexOf("Firefox"); if (Y >= 0 && parseInt(navigator.userAgent.substring(Y + 8)) < 3) { W = false } } catch (E) { } return this.each(function(b, h) { $e = jQuery(h); if ($e.hasClass(N)) { return } $e.addClass(N); var a = /{(.*)}/.exec(h.className); var c = a ? B(a[1], V) : V; var j = h.nodeName.toLowerCase(); if (j == "input") { h = O(h) } if (F && c.webkit) { K(h, c) } else { if (W && c.mozilla && (c.sizex == c.sizey)) { M(h, c) } else { var d = D(h.parentNode); var f = D(h); switch (j) { case "a": case "input": Z(h, c, d, f); break; default: R(h, c, d, f); break } } } }); function K(d, c) { var a = "" + c.sizex + "px " + c.sizey + "px"; var b = jQuery(d); if (c.tl) { b.css("WebkitBorderTopLeftRadius", a) } if (c.tr) { b.css("WebkitBorderTopRightRadius", a) } if (c.bl) { b.css("WebkitBorderBottomLeftRadius", a) } if (c.br) { b.css("WebkitBorderBottomRightRadius", a) } } function M(d, c) { var a = "" + c.sizex + "px"; var b = jQuery(d); if (c.tl) { b.css("-moz-border-radius-topleft", a) } if (c.tr) { b.css("-moz-border-radius-topright", a) } if (c.bl) { b.css("-moz-border-radius-bottomleft", a) } if (c.br) { b.css("-moz-border-radius-bottomright", a) } } function Z(k, n, l, a) { var m = S("table"); var i = S("tbody"); m.appendChild(i); var j = S("tr"); var d = S("td", "top"); j.appendChild(d); var h = S("tr"); var c = T(k, n, S("td")); h.appendChild(c); var f = S("tr"); var b = S("td", "bottom"); f.appendChild(b); if (n.tl || n.tr) { i.appendChild(j); X(d, n, l, a, true) } i.appendChild(h); if (n.bl || n.br) { i.appendChild(f); X(b, n, l, a, false) } k.appendChild(m); if (jQuery.browser.msie) { m.onclick = Q } k.style.overflow = "hidden" } function Q() { if (!this.parentNode.onclick) { this.parentNode.click() } } function O(c) { var b = document.createElement("a"); b.id = c.id; b.className = c.className; if (c.onclick) { b.href = "javascript:"; b.onclick = c.onclick } else { jQuery(c).parent("form").each(function() { b.href = this.action }); b.onclick = I } var a = document.createTextNode(c.value); b.appendChild(a); c.parentNode.replaceChild(b, c); return b } function I() { jQuery(this).parent("form").each(function() { this.submit() }); return false } function R(d, a, b, c) { var f = T(d, a, document.createElement("div")); d.appendChild(f); if (a.tl || a.tr) { X(d, a, b, c, true) } if (a.bl || a.br) { X(d, a, b, c, false) } } function T(j, i, k) { var b = jQuery(j); var l; while (l = j.firstChild) { k.appendChild(l) } if (j.style.height) { var f = parseInt(b.css("height")); k.style.height = f + "px"; f += parseInt(b.css("padding-top")) + parseInt(b.css("padding-bottom")); j.style.height = f + "px" } if (j.style.width) { var a = parseInt(b.css("width")); k.style.width = a + "px"; a += parseInt(b.css("padding-left")) + parseInt(b.css("padding-right")); j.style.width = a + "px" } k.style.paddingLeft = b.css("padding-left"); k.style.paddingRight = b.css("padding-right"); if (i.tl || i.tr) { k.style.paddingTop = U(j, i, b.css("padding-top"), true) } else { k.style.paddingTop = b.css("padding-top") } if (i.bl || i.br) { k.style.paddingBottom = U(j, i, b.css("padding-bottom"), false) } else { k.style.paddingBottom = b.css("padding-bottom") } j.style.padding = 0; return k } function U(f, a, d, c) { if (d.indexOf("px") < 0) { try { console.error("%s padding not in pixels", (c ? "top" : "bottom"), f) } catch (b) { } d = a.sizey + "px" } d = parseInt(d); if (d - a.sizey < 0) { try { console.error("%s padding is %ipx for %ipx corner:", (c ? "top" : "bottom"), d, a.sizey, f) } catch (b) { } d = a.sizey } return d - a.sizey + "px" } function S(b, a) { var c = document.createElement(b); c.style.border = "none"; c.style.borderCollapse = "collapse"; c.style.borderSpacing = 0; c.style.padding = 0; c.style.margin = 0; if (a) { c.style.verticalAlign = a } return c } function D(b) { try { var d = jQuery.css(b, "background-color"); if (d.match(/^(transparent|rgba\(0,\s*0,\s*0,\s*0\))$/i) && b.parentNode) { return D(b.parentNode) } if (d == null) { return "#ffffff" } if (d.indexOf("rgb") > -1) { d = A(d) } if (d.length == 4) { d = L(d) } return d } catch (a) { return "#ffffff" } } function L(a) { return "#" + a.substring(1, 2) + a.substring(1, 2) + a.substring(2, 3) + a.substring(2, 3) + a.substring(3, 4) + a.substring(3, 4) } function A(h) { var a = 255; var d = ""; var b; var e = /([0-9]+)[, ]+([0-9]+)[, ]+([0-9]+)/; var f = e.exec(h); for (b = 1; b < 4; b++) { d += ("0" + parseInt(f[b]).toString(16)).slice(-2) } return "#" + d } function B(b, d) { var b = b || ""; var c = { sizex: 5, sizey: 5, tl: false, tr: false, bl: false, br: false, webkit: true, mozilla: true, transparent: false }; if (d) { c.sizex = d.sizex; c.sizey = d.sizey; c.webkit = d.webkit; c.transparent = d.transparent; c.mozilla = d.mozilla } var a = false; var e = false; jQuery.each(b.split(" "), function(f, j) { j = j.toLowerCase(); var h = parseInt(j); if (h > 0 && j == h + "px") { c.sizey = h; if (!a) { c.sizex = h } a = true } else { switch (j) { case "no-native": c.webkit = c.mozilla = false; break; case "webkit": c.webkit = true; break; case "no-webkit": c.webkit = false; break; case "mozilla": c.mozilla = true; break; case "no-mozilla": c.mozilla = false; break; case "anti-alias": c.transparent = false; break; case "transparent": c.transparent = true; break; case "top": e = c.tl = c.tr = true; break; case "right": e = c.tr = c.br = true; break; case "bottom": e = c.bl = c.br = true; break; case "left": e = c.tl = c.bl = true; break; case "top-left": e = c.tl = true; break; case "top-right": e = c.tr = true; break; case "bottom-left": e = c.bl = true; break; case "bottom-right": e = c.br = true; break } } }); if (!e) { if (!d) { c.tl = c.tr = c.bl = c.br = true } else { c.tl = d.tl; c.tr = d.tr; c.bl = d.bl; c.br = d.br } } return c } function P(f, d, h) { var e = Array(parseInt("0x" + f.substring(1, 3)), parseInt("0x" + f.substring(3, 5)), parseInt("0x" + f.substring(5, 7))); var c = Array(parseInt("0x" + d.substring(1, 3)), parseInt("0x" + d.substring(3, 5)), parseInt("0x" + d.substring(5, 7))); r = "0" + Math.round(e[0] + (c[0] - e[0]) * h).toString(16); g = "0" + Math.round(e[1] + (c[1] - e[1]) * h).toString(16); d = "0" + Math.round(e[2] + (c[2] - e[2]) * h).toString(16); return "#" + r.substring(r.length - 2) + g.substring(g.length - 2) + d.substring(d.length - 2) } function X(f, a, b, d, c) { if (a.transparent) { G(f, a, b, c) } else { J(f, a, b, d, c) } } function J(k, z, p, a, n) { var h, f; var l = document.createElement("div"); l.style.fontSize = "1px"; l.style.backgroundColor = p; var b = 0; for (h = 1; h <= z.sizey; h++) { var u, t, q; arc = Math.sqrt(1 - Math.pow(1 - h / z.sizey, 2)) * z.sizex; var c = z.sizex - Math.ceil(arc); var w = Math.floor(b); var v = z.sizex - c - w; var o = document.createElement("div"); var m = l; o.style.margin = "0px " + c + "px"; o.style.height = "1px"; o.style.overflow = "hidden"; for (f = 1; f <= v; f++) { if (f == 1) { if (f == v) { u = ((arc + b) * 0.5) - w } else { t = Math.sqrt(1 - Math.pow(1 - (c + 1) / z.sizex, 2)) * z.sizey; u = (t - (z.sizey - h)) * (arc - w - v + 1) * 0.5 } } else { if (f == v) { t = Math.sqrt(1 - Math.pow((z.sizex - c - f + 1) / z.sizex, 2)) * z.sizey; u = 1 - (1 - (t - (z.sizey - h))) * (1 - (b - w)) * 0.5 } else { q = Math.sqrt(1 - Math.pow((z.sizex - c - f) / z.sizex, 2)) * z.sizey; t = Math.sqrt(1 - Math.pow((z.sizex - c - f + 1) / z.sizex, 2)) * z.sizey; u = ((t + q) * 0.5) - (z.sizey - h) } } H(z, o, m, n, P(p, a, u)); m = o; var o = m.cloneNode(false); o.style.margin = "0px 1px" } H(z, o, m, n, a); b = arc } if (n) { k.insertBefore(l, k.firstChild) } else { k.appendChild(l) } } function H(c, a, e, d, b) { if (d && !c.tl) { a.style.marginLeft = 0 } if (d && !c.tr) { a.style.marginRight = 0 } if (!d && !c.bl) { a.style.marginLeft = 0 } if (!d && !c.br) { a.style.marginRight = 0 } a.style.backgroundColor = b; if (d) { e.appendChild(a) } else { e.insertBefore(a, e.firstChild) } } function G(c, o, l, h) { var f = document.createElement("div"); f.style.fontSize = "1px"; var a = document.createElement("div"); a.style.overflow = "hidden"; a.style.height = "1px"; a.style.borderColor = l; a.style.borderStyle = "none solid"; var m = o.sizex - 1; var j = o.sizey - 1; if (!j) { j = 1 } for (var b = 0; b < o.sizey; b++) { var n = m - Math.floor(Math.sqrt(1 - Math.pow(1 - b / j, 2)) * m); if (b == 2 && o.sizex == 6 && o.sizey == 6) { n = 2 } var k = a.cloneNode(false); k.style.borderWidth = "0 " + n + "px"; if (h) { k.style.borderWidth = "0 " + (o.tr ? n : 0) + "px 0 " + (o.tl ? n : 0) + "px" } else { k.style.borderWidth = "0 " + (o.br ? n : 0) + "px 0 " + (o.bl ? n : 0) + "px" } h ? f.appendChild(k) : f.insertBefore(k, f.firstChild) } if (h) { c.insertBefore(f, c.firstChild) } else { c.appendChild(f) } } };

/*
VERSION: Drop Shadow jQuery Plugin 1.6  12-13-2007
*/
(function($) {

    var dropShadowZindex = 1;  //z-index counter

    $.fn.dropShadow = function(options) {
        // Default options
        var opt = $.extend({
            left: 4,
            top: 4,
            blur: 2,
            opacity: .5,
            color: "black",
            swap: false
        }, options);
        var jShadows = $([]);  //empty jQuery collection

        // Loop through original elements
        this.not(".dropShadow").each(function() {
            var jthis = $(this);
            var shadows = [];
            var blur = (opt.blur <= 0) ? 0 : opt.blur;
            var opacity = (blur == 0) ? opt.opacity : opt.opacity / (blur * 8);
            var zOriginal = (opt.swap) ? dropShadowZindex : dropShadowZindex + 1;
            var zShadow = (opt.swap) ? dropShadowZindex + 1 : dropShadowZindex;

            // Create ID for shadow
            var shadowId;
            if (this.id) {
                shadowId = this.id + "_dropShadow";
            }
            else {
                shadowId = "ds" + (1 + Math.floor(9999 * Math.random()));
            }

            // Modify original element
            $.data(this, "shadowId", shadowId); //store id in expando
            $.data(this, "shadowOptions", options); //store options in expando
            jthis
				.attr("shadowId", shadowId)
				.css("zIndex", zOriginal);
            if (jthis.css("position") != "absolute") {
                jthis.css({
                    position: "relative",
                    zoom: 1 //for IE layout
                });
            }

            // Create first shadow layer
            bgColor = jthis.css("backgroundColor");
            //if (bgColor == "rgba(0, 0, 0, 0)") bgColor = "transparent";  //Safari
            // if (bgColor != "transparent" || jthis.css("backgroundImage") != "none" 
            // 					|| this.nodeName == "SELECT" 
            // 					|| this.nodeName == "INPUT"
            // 					|| this.nodeName == "TEXTAREA") {		
            // 				shadows[0] = $("<div></div>")
            // 					.css("background", opt.color);								
            // 			}
            if (bgColor == "transparent" || jthis.css("backgroundImage") == "none"
					|| this.nodeName == "SELECT"
					|| this.nodeName == "INPUT"
					|| this.nodeName == "TEXTAREA") {
                shadows[0] = $("<div></div>")
					.css("background", opt.color);
            }
            else {
                shadows[0] = jthis
					.clone()
					.removeAttr("id")
					.removeAttr("name")
					.removeAttr("shadowId")
					.css("color", opt.color);
            }
            shadows[0]
				.addClass("dropShadow")
				.css({
				    height: jthis.outerHeight(),
				    left: blur,
				    opacity: opacity,
				    position: "absolute",
				    top: blur,
				    width: jthis.outerWidth(),
				    zIndex: zShadow
				});

            // Create other shadow layers
            var layers = (8 * blur) + 1;
            for (i = 1; i < layers; i++) {
                shadows[i] = shadows[0].clone();
            }

            // Position layers
            var i = 1;
            var j = blur;
            while (j > 0) {
                shadows[i].css({ left: j * 2, top: 0 });           //top
                shadows[i + 1].css({ left: j * 4, top: j * 2 });   //right
                shadows[i + 2].css({ left: j * 2, top: j * 4 });   //bottom
                shadows[i + 3].css({ left: 0, top: j * 2 });       //left
                shadows[i + 4].css({ left: j * 3, top: j });       //top-right
                shadows[i + 5].css({ left: j * 3, top: j * 3 });   //bottom-right
                shadows[i + 6].css({ left: j, top: j * 3 });       //bottom-left
                shadows[i + 7].css({ left: j, top: j });           //top-left
                i += 8;
                j--;
            }

            // Create container
            var divShadow = $("<div></div>")
				.attr("id", shadowId)
				.addClass("dropShadow")
				.css({
				    left: jthis.position().left + opt.left - blur,
				    marginTop: jthis.css("marginTop"),
				    marginRight: jthis.css("marginRight"),
				    marginBottom: jthis.css("marginBottom"),
				    marginLeft: jthis.css("marginLeft"),
				    position: "absolute",
				    top: jthis.position().top + opt.top - blur,
				    zIndex: zShadow
				});

            // Add layers to container	
            for (i = 0; i < layers; i++) {
                divShadow.append(shadows[i]);
            }

            // Add container to DOM
            jthis.after(divShadow);

            // Add shadow to return set
            jShadows = jShadows.add(divShadow);

            // Re-align shadow on window resize
            $(window).resize(function() {
                try {
                    divShadow.css({
                        left: jthis.position().left + opt.left - blur,
                        top: jthis.position().top + opt.top - blur
                    });
                }
                catch (e) { }
            });

            // Increment z-index counter
            dropShadowZindex += 2;

        });  //end each

        return this.pushStack(jShadows);
    };


    $.fn.redrawShadow = function() {
        // Remove existing shadows
        this.removeShadow();

        // Draw new shadows
        return this.each(function() {
            var shadowOptions = $.data(this, "shadowOptions");
            $(this).dropShadow(shadowOptions);
        });
    };


    $.fn.removeShadow = function() {
        return this.each(function() {
            var shadowId = $(this).shadowId();
            $("div#" + shadowId).remove();
        });
    };


    $.fn.shadowId = function() {
        return $.data(this[0], "shadowId");
    };


    $(function() {
        // Suppress printing of shadows
        var noPrint = "<style type='text/css' media='print'>";
        noPrint += ".dropShadow{visibility:hidden;}</style>";
        $("head").append(noPrint);
    });

})(jQuery);

/*
* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
*
* Uses the built In easIng capabilities added In jQuery 1.1
* to offer multiple easIng options
*
* Copyright (c) 2007 George Smith
* Licensed under the MIT License:
*   http://www.opensource.org/licenses/mit-license.php
*/

// t: current time, b: begInnIng value, c: change In value, d: duration
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 } });

/*
* Thickbox 3.1 - One Box To Rule Them All.
* By Cody Lindley (http://www.codylindley.com)
* Copyright (c) 2007 cody lindley
* Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php

added dropshadow - pim.rijpsma@gmail.com (cc)
	
*/
var tb_pathToImage = "/images/backend/thickbox/loadingAnimation.gif";

/*!!!!!!!!!!!!!!!!! edit below this line at your own risk !!!!!!!!!!!!!!!!!!!!!!!*/

//on page load call tb_init
jQuery(document).ready(function() {
    tb_init('a.thickbox, area.thickbox, input.thickbox'); //pass where to apply thickbox
    imgLoader = new Image(); // preload image
    imgLoader.src = tb_pathToImage;
});

//add thickbox to href & area elements that have a class of .thickbox
function tb_init(domChunk) {
    jQuery(domChunk).click(function() {
        var t = this.title || this.name || null;
        var a = this.href || this.alt;
        var g = this.rel || false;
        tb_show(t, a, g);
        this.blur();
        return false;
    });
}

function tb_show(caption, url, imageGroup) {//function called when the user clicks on a thickbox link

    try {
        if (typeof document.body.style.maxHeight === "undefined") {//if IE 6
            jQuery("body", "html").css({ height: "100%", width: "100%" });
            jQuery("html").css("overflow", "hidden");
            if (document.getElementById("TB_HideSelect") === null) {//iframe to hide select elements in ie6
                jQuery("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div><div id='TB_window'></div>");
                //jQuery("#TB_overlay").click(tb_remove);
            }
        } else {//all others
            if (document.getElementById("TB_overlay") === null) {
                jQuery("body").append("<div id='TB_overlay'></div><div id='TB_window'></div>");
                //jQuery("#TB_overlay").click(tb_remove);
            }
        }

        jQuery("#TB_overlay").addClass("TB_overlayBG"); //use background and opacity
        // if(tb_detectMacXFF()){
        // 			jQuery("#TB_overlay").addClass("TB_overlayMacFFBGHack");//use png overlay so hide flash
        // 		}else{
        // 			jQuery("#TB_overlay").addClass("TB_overlayBG");//use background and opacity
        // 		}

        if (caption === null) { caption = ""; }
        jQuery("body").append("<div id='TB_load'><img src='" + imgLoader.src + "' /></div>"); //add loader to the page
        jQuery('#TB_load').show(); //show loader

        var baseURL;
        if (url.indexOf("?") !== -1) { //ff there is a query string involved
            baseURL = url.substr(0, url.indexOf("?"));
        } else {
            baseURL = url;
        }

        var urlString = /\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/;
        var urlType = baseURL.toLowerCase().match(urlString);

        if (urlType == '.jpg' || urlType == '.jpeg' || urlType == '.png' || urlType == '.gif' || urlType == '.bmp') {//code to show images

            TB_PrevCaption = "";
            TB_PrevURL = "";
            TB_PrevHTML = "";
            TB_NextCaption = "";
            TB_NextURL = "";
            TB_NextHTML = "";
            TB_imageCount = "";
            TB_FoundURL = false;
            if (imageGroup) {
                TB_TempArray = jQuery("a[@rel=" + imageGroup + "]").get();
                for (TB_Counter = 0; ((TB_Counter < TB_TempArray.length) && (TB_NextHTML === "")); TB_Counter++) {
                    var urlTypeTemp = TB_TempArray[TB_Counter].href.toLowerCase().match(urlString);
                    if (!(TB_TempArray[TB_Counter].href == url)) {
                        if (TB_FoundURL) {
                            TB_NextCaption = TB_TempArray[TB_Counter].title;
                            TB_NextURL = TB_TempArray[TB_Counter].href;
                            TB_NextHTML = "<span id='TB_next'>&nbsp;&nbsp;<a class='color' href='#'>Next &gt;</a></span>";
                        } else {
                            TB_PrevCaption = TB_TempArray[TB_Counter].title;
                            TB_PrevURL = TB_TempArray[TB_Counter].href;
                            TB_PrevHTML = "<span id='TB_prev'>&nbsp;&nbsp;<a class='color' href='#'>&lt; Prev</a></span>";
                        }
                    } else {
                        TB_FoundURL = true;
                        TB_imageCount = "Image " + (TB_Counter + 1) + " of " + (TB_TempArray.length);
                    }
                }
            }

            imgPreloader = new Image();
            imgPreloader.onload = function() {
                imgPreloader.onload = null;

                // Resizing large images - orginal by Christian Montoya edited by me.
                var pagesize = tb_getPageSize();
                var x = pagesize[0] - 100;
                var y = pagesize[1] - 100;
                var imageWidth = imgPreloader.width;
                var imageHeight = imgPreloader.height;
                if (imageWidth > x) {
                    imageHeight = imageHeight * (x / imageWidth);
                    imageWidth = x;
                    if (imageHeight > y) {
                        imageWidth = imageWidth * (y / imageHeight);
                        imageHeight = y;
                    }
                } else if (imageHeight > y) {
                    imageWidth = imageWidth * (y / imageHeight);
                    imageHeight = y;
                    if (imageWidth > x) {
                        imageHeight = imageHeight * (x / imageWidth);
                        imageWidth = x;
                    }
                }
                // End Resizing

                TB_WIDTH = imageWidth + 30;
                TB_HEIGHT = imageHeight + 60;
                if (browser.safari) {
                    jQuery("#TB_window").append("<div class='TB_ImageOff closebtn'></div><a href='javascript:void()' class='TB_ImageOff' title='Sluit venster'><img id='TB_Image' src='" + url + "' width='" + imageWidth + "' height='" + imageHeight + "' alt='" + caption + "'/></a>" + "<div class='georgia atta left' id='TB_caption'><span><em>&ldquo; " + caption + " &bdquo;</em></span></div><div class='right darkgreytxt' id='TB_secondLine'>" + TB_imageCount + TB_PrevHTML + TB_NextHTML + "</div>");
                } else {
                    jQuery("#TB_window").append("<div class='TB_ImageOff closebtn'></div><div class='tl'></div><div style='width:" + (imageWidth + 6) + "px !important;' class='tm'></div><div class='tr'></div><div style='height:" + (imageHeight + 26) + "px !important;' class='ml'></div><a href='javascript:void()' class='TB_ImageOff' title='Sluit venster'><img id='TB_Image' src='" + url + "' width='" + imageWidth + "' height='" + imageHeight + "' alt='" + caption + "'/></a>" + "<div class='georgia atta left' id='TB_caption'><span><em>&ldquo; " + caption + " &bdquo;</em></span></div><div class='right darkgreytxt' id='TB_secondLine'>" + TB_imageCount + TB_PrevHTML + TB_NextHTML + "</div><div style='height:" + (imageHeight + 26) + "px !important;' class='mr'></div><div class='bl'></div><div style='width:" + (imageWidth + 6) + "px !important;' class='bm'></div><div class='br'></div>");
                }

                jQuery("#TB_closeWindowButton").click(tb_remove);

                if (!(TB_PrevHTML === "")) {
                    function goPrev() {
                        if (jQuery(document).unbind("click", goPrev)) { jQuery(document).unbind("click", goPrev); }
                        jQuery("#TB_window").remove();
                        jQuery("body").append("<div id='TB_window'></div>");
                        tb_show(TB_PrevCaption, TB_PrevURL, imageGroup);
                        return false;
                    }
                    jQuery("#TB_prev").click(goPrev);
                }

                if (!(TB_NextHTML === "")) {
                    function goNext() {
                        jQuery("#TB_window").remove();
                        jQuery("body").append("<div id='TB_window'></div>");
                        tb_show(TB_NextCaption, TB_NextURL, imageGroup);
                        return false;
                    }
                    jQuery("#TB_next").click(goNext);

                }

                document.onkeydown = function(e) {
                    if (e == null) { // ie
                        keycode = event.keyCode;
                    } else { // mozilla
                        keycode = e.which;
                    }
                    if (keycode == 27) { // close
                        tb_remove();
                    } else if (keycode == 190 || keycode == 39) { // display previous image
                        if (!(TB_NextHTML == "")) {
                            document.onkeydown = "";
                            goNext();
                        }
                    } else if (keycode == 188 || keycode == 37) { // display next image
                        if (!(TB_PrevHTML == "")) {
                            document.onkeydown = "";
                            goPrev();
                        }
                    }
                };

                tb_position();
                jQuery("#TB_load").remove();
                jQuery(".TB_ImageOff").click(tb_remove);
                jQuery("#TB_window").css({ display: "block" }); //for safari using css instead of show
            };

            imgPreloader.src = url;
        } else {//code to show html

            var queryString = url.replace(/^[^\?]+\??/, '');
            var params = tb_parseQuery(queryString);

            TB_WIDTH = (params['width'] * 1) + 30 || 630; //defaults to 630 if no paramaters were added to URL
            TB_HEIGHT = (params['height'] * 1) + 40 || 440; //defaults to 440 if no paramaters were added to URL
            ajaxContentW = TB_WIDTH - 30;
            ajaxContentH = TB_HEIGHT - 45;

            if (url.indexOf('TB_iframe') != -1) {// either iframe or ajax window		
                urlNoQuery = url.split('TB_');
                jQuery("#TB_iframeContent").remove();
                if (params['modal'] != "true") {//iframe no modal
                    if (browser.safari) {
                        jQuery("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>" + caption + "</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton' title='Sluit venster'>Sluit venster</a></div></div><iframe frameborder='0' hspace='0' src='" + urlNoQuery[0] + "' id='TB_iframeContent' name='TB_iframeContent" + Math.round(Math.random() * 1000) + "' onload='tb_showIframe()' style='width:" + (ajaxContentW + 29) + "px;height:" + (ajaxContentH + 17) + "px;' > </iframe>");
                    } else {
                        jQuery("#TB_window").append("<div class='tl'></div><div style='width:" + (ajaxContentW + 6) + "px !important;' class='tm'></div><div class='tr'></div><div style='height:" + (ajaxContentH + 20) + "px !important;' class='ml'></div><div style='height:" + (ajaxContentH + 20) + "px !important;' class='mr'></div><div class='bl'></div><div style='width:" + (ajaxContentW + 6) + "px !important;' class='bm'></div><div class='br'></div><div id='TB_title'><div id='TB_ajaxWindowTitle'>" + caption + "</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton' title='Sluit venster'>Sluit venster</a></div></div><iframe frameborder='0' hspace='0' src='" + urlNoQuery[0] + "' id='TB_iframeContent' name='TB_iframeContent" + Math.round(Math.random() * 1000) + "' onload='tb_showIframe()' style='width:" + (ajaxContentW + 29) + "px;height:" + (ajaxContentH + 17) + "px;' > </iframe>");
                    }
                } else {//iframe modal
                    jQuery("#TB_overlay").unbind();
                    jQuery("#TB_window").append("<iframe frameborder='0' hspace='0' src='" + urlNoQuery[0] + "' id='TB_iframeContent' name='TB_iframeContent" + Math.round(Math.random() * 1000) + "' onload='tb_showIframe()' style='width:" + (ajaxContentW + 29) + "px;height:" + (ajaxContentH + 17) + "px;'> </iframe>");
                }
            } else {// not an iframe, ajax
                if (jQuery("#TB_window").css("display") != "block") {
                    if (params['modal'] != "true") {//ajax no modal
                        if (browser.safari) {
                            jQuery("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>" + caption + "</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton'>Sluit venster</a></div></div><div id='TB_ajaxContent' style='width:" + ajaxContentW + "px;height:" + ajaxContentH + "px'></div>");
                        } else {
                            jQuery("#TB_window").append("<div class='tl'></div><div style='width:" + (ajaxContentW + 6) + "px !important;' class='tm'></div><div class='tr'></div><div style='height:" + (ajaxContentH + 20) + "px !important;' class='ml'></div><div style='height:" + (ajaxContentH + 20) + "px !important;' class='mr'></div><div class='bl'></div><div style='width:" + (ajaxContentW + 6) + "px !important;' class='bm'></div><div class='br'></div><div id='TB_title'><div id='TB_ajaxWindowTitle'>" + caption + "</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton'>Sluit venster</a></div></div><div id='TB_ajaxContent' style='width:" + ajaxContentW + "px;height:" + ajaxContentH + "px'></div>");
                        }
                    } else {//ajax modal
                        jQuery("#TB_overlay").unbind();
                        jQuery("#TB_window").append("<div id='TB_ajaxContent' class='TB_modal' style='width:" + ajaxContentW + "px;height:" + ajaxContentH + "px;'></div>");
                    }
                } else {//this means the window is already up, we are just loading new content via ajax
                    jQuery("#TB_ajaxContent")[0].style.width = ajaxContentW + "px";
                    jQuery("#TB_ajaxContent")[0].style.height = ajaxContentH + "px";
                    jQuery("#TB_ajaxContent")[0].scrollTop = 0;
                    jQuery("#TB_ajaxWindowTitle").html(caption);
                }
            }

            jQuery("#TB_closeWindowButton").click(tb_remove);

            if (url.indexOf('TB_inline') != -1) {
                jQuery("#TB_ajaxContent").append(jQuery('#' + params['inlineId']).children());
                jQuery("#TB_window").unload(function() {
                    jQuery('#' + params['inlineId']).append(jQuery("#TB_ajaxContent").children()); // move elements back when you're finished
                });
                tb_position();
                jQuery("#TB_load").remove();
                jQuery("#TB_window").css({ display: "block" });
            } else if (url.indexOf('TB_iframe') != -1) {
                tb_position();
                if (jQuery.browser.safari) {//safari needs help because it will not fire iframe onload
                    jQuery("#TB_load").remove();
                    jQuery("#TB_window").css({ display: "block" });
                }
            } else {
                jQuery("#TB_ajaxContent").load(url += "&random=" + (new Date().getTime()), function() {//to do a post change this load method
                    tb_position();
                    jQuery("#TB_load").remove();
                    tb_init("#TB_ajaxContent a.thickbox");
                    jQuery("#TB_window").css({ display: "block" });
                });
            }

        }

        if (!params['modal']) {
            document.onkeyup = function(e) {
                if (e == null) { // ie
                    keycode = event.keyCode;
                } else { // mozilla
                    keycode = e.which;
                }
                if (keycode == 27) { // close
                    tb_remove();
                }
            };
        }

    } catch (e) {
        //nothing here
    }
}

//helper functions below
function tb_showIframe() {
    jQuery("#TB_load").remove();
    jQuery("#TB_window").css({ display: "block" });
    //jQuery("#TB_window").animate({ height: 'toggle', opacity: 'toggle' }, "slow");
}

function tb_remove() {
    jQuery(".TB_imageOff").unbind("click");
    jQuery("#TB_closeWindowButton").unbind("click");
    jQuery("#TB_window").fadeOut("fast", function() { jQuery('#TB_window,#TB_overlay,#TB_HideSelect').trigger("unload").unbind().remove(); });
    jQuery("#TB_load").remove();
    if (typeof document.body.style.maxHeight == "undefined") {//if IE 6
        jQuery("body", "html").css({ height: "auto", width: "auto" });
        jQuery("html").css("overflow", "");
    }
    //document.onkeydown = "";
    //document.onkeyup = "";
    try { document.onkeydown = keyDown; } catch (err) { };
    return false;
}

function tb_position() {
    jQuery("#TB_window").css({ marginLeft: '-' + parseInt((TB_WIDTH / 2), 10) + 'px', width: TB_WIDTH + 'px' });
    if (!(jQuery.browser.msie && jQuery.browser.version < 7)) { // take away IE6
        jQuery("#TB_window").css({ marginTop: '-' + parseInt((TB_HEIGHT / 2), 10) + 'px' });
    }
}

function tb_parseQuery(query) {
    var Params = {};
    if (!query) { return Params; } // return empty object
    var Pairs = query.split(/[;&]/);
    for (var i = 0; i < Pairs.length; i++) {
        var KeyVal = Pairs[i].split('=');
        if (!KeyVal || KeyVal.length != 2) { continue; }
        var key = unescape(KeyVal[0]);
        var val = unescape(KeyVal[1]);
        val = val.replace(/\+/g, ' ');
        Params[key] = val;
    }
    return Params;
}

function tb_getPageSize() {
    var de = document.documentElement;
    var w = window.innerWidth || self.innerWidth || (de && de.clientWidth) || document.body.clientWidth;
    var h = window.innerHeight || self.innerHeight || (de && de.clientHeight) || document.body.clientHeight;
    arrayPageSize = [w, h];
    return arrayPageSize;
}

function tb_detectMacXFF() {
    var userAgent = navigator.userAgent.toLowerCase();
    if (userAgent.indexOf('mac') != -1 && userAgent.indexOf('firefox') != -1) {
        return true;
    }
}
