// JavaScript Document
(function (f) {
    function p(a, b, c) {
        var h = c.relative ? a.position().top : a.offset().top,
            d = c.relative ? a.position().left : a.offset().left,
            i = c.position[0];
        h -= b.outerHeight() - c.offset[0];
        d += a.outerWidth() + c.offset[1];
        if (/iPad/i.test(navigator.userAgent)) h -= f(window).scrollTop();
        var j = b.outerHeight() + a.outerHeight();
        if (i == "center") h += j / 2;
        if (i == "bottom") h += j;
        i = c.position[1];
        a = b.outerWidth() + a.outerWidth();
        if (i == "center") d -= a / 2;
        if (i == "left") d -= a;
        return {
            top: h,
            left: d
        }
    }
    function u(a, b) {
        var c = this,
            h = a.add(c),
            d, i = 0,
            j = 0,
            m = a.attr("title"),
            q = a.attr("data-tooltip"),
            r = o[b.effect],
            l, s = a.is(":input"),
            v = s && a.is(":checkbox, :radio, select, :button, :submit"),
            t = a.attr("type"),
            k = b.events[t] || b.events[s ? v ? "widget" : "input" : "def"];
        if (!r) throw 'Nonexistent effect "' + b.effect + '"';
        k = k.split(/,\s*/);
        if (k.length != 2) throw "Tooltip: bad events configuration for " + t;
        a.bind(k[0], function (e) {
            clearTimeout(i);
            if (b.predelay) j = setTimeout(function () {
                c.show(e)
            }, b.predelay);
            else c.show(e)
        }).bind(k[1], function (e) {
            clearTimeout(j);
            if (b.delay) i = setTimeout(function () {
                c.hide(e)
            }, b.delay);
            else c.hide(e)
        });
        if (m && b.cancelDefault) {
            a.removeAttr("title");
            a.data("title", m)
        }
        f.extend(c, {
            show: function (e) {
                if (!d) {
                    if (q) d = f(q);
                    else if (b.tip) d = f(b.tip).eq(0);
                    else if (m) d = f(b.layout).addClass(b.tipClass).appendTo(document.body).hide().append(m);
                    else {
                        d = a.next();
                        d.length || (d = a.parent().next())
                    }
                    if (!d.length) throw "Cannot find tooltip for " + a;
                }
                if (c.isShown()) return c;
                d.stop(true, true);
                var g = p(a, d, b);
                b.tip && d.html(a.data("title"));
                e = e || f.Event();
                e.type = "onBeforeShow";
                h.trigger(e, [g]);
                if (e.isDefaultPrevented()) return c;
                g = p(a, d, b);
                d.css({
                    position: "absolute",
                    top: g.top,
                    left: g.left
                });
                l = true;
                r[0].call(c, function () {
                    e.type = "onShow";
                    l = "full";
                    h.trigger(e)
                });
                g = b.events.tooltip.split(/,\s*/);
                if (!d.data("__set")) {
                    d.bind(g[0], function () {
                        clearTimeout(i);
                        clearTimeout(j)
                    });
                    g[1] && !a.is("input:not(:checkbox, :radio), textarea") && d.bind(g[1], function (n) {
                        n.relatedTarget != a[0] && a.trigger(k[1].split(" ")[0])
                    });
                    d.data("__set", true)
                }
                return c
            },
            hide: function (e) {
                if (!d || !c.isShown()) return c;
                e = e || f.Event();
                e.type = "onBeforeHide";
                h.trigger(e);
                if (!e.isDefaultPrevented()) {
                    l = false;
                    o[b.effect][1].call(c, function () {
                        e.type = "onHide";
                        h.trigger(e)
                    });
                    return c
                }
            },
            isShown: function (e) {
                return e ? l == "full" : l
            },
            getConf: function () {
                return b
            },
            getTip: function () {
                return d
            },
            getTrigger: function () {
                return a
            }
        });
        f.each("onHide,onBeforeShow,onShow,onBeforeHide".split(","), function (e, g) {
            f.isFunction(b[g]) && f(c).bind(g, b[g]);
            c[g] = function (n) {
                n && f(c).bind(g, n);
                return c
            }
        })
    }
    f.tools = f.tools || {
        version: "1.2.5"
    };
    f.tools.tooltip = {
        conf: {
            effect: "toggle",
            fadeOutSpeed: "fast",
            predelay: 0,
            delay: 30,
            opacity: 1,
            tip: 0,
            position: ["top", "center"],
            offset: [0, 0],
            relative: false,
            cancelDefault: true,
            events: {
                def: "mouseenter,mouseleave",
                input: "focus,blur",
                widget: "focus mouseenter,blur mouseleave",
                tooltip: "mouseenter,mouseleave"
            },
            layout: "<div/>",
            tipClass: "tooltip"
        },
        addEffect: function (a, b, c) {
            o[a] = [b, c]
        }
    };
    var o = {
        toggle: [function (a) {
            var b = this.getConf(),
                c = this.getTip();
            b = b.opacity;
            b < 1 && c.css({
                opacity: b
            });
            c.show();
            a.call()
        }, function (a) {
            this.getTip().hide();
            a.call()
        }],
        fade: [function (a) {
            var b = this.getConf();
            this.getTip().fadeTo(b.fadeInSpeed, b.opacity, a)
        }, function (a) {
            this.getTip().fadeOut(this.getConf().fadeOutSpeed, a)
        }]
    };
    f.fn.tooltip = function (a) {
        var b = this.data("tooltip");
        if (b) return b;
        a = f.extend(true, {}, f.tools.tooltip.conf, a);
        if (typeof a.position == "string") a.position = a.position.split(/,?\s/);
        this.each(function () {
            b = new u(f(this), a);
            f(this).data("tooltip", b)
        });
        return a.api ? b : this
    }
})(jQuery);
(function (d) {
    var i = d.tools.tooltip;
    d.extend(i.conf, {
        direction: "up",
        bounce: false,
        slideOffset: 10,
        slideInSpeed: 200,
        slideOutSpeed: 200,
        slideFade: !d.browser.msie
    });
    var e = {
        up: ["-", "top"],
        down: ["+", "top"],
        left: ["-", "left"],
        right: ["+", "left"]
    };
    i.addEffect("slide", function (g) {
        var a = this.getConf(),
            f = this.getTip(),
            b = a.slideFade ? {
                opacity: a.opacity
            } : {},
            c = e[a.direction] || e.up;
        b[c[1]] = c[0] + "=" + a.slideOffset;
        a.slideFade && f.css({
            opacity: 0
        });
        f.show().animate(b, a.slideInSpeed, g)
    }, function (g) {
        var a = this.getConf(),
            f = a.slideOffset,
            b = a.slideFade ? {
                opacity: 0
            } : {},
            c = e[a.direction] || e.up,
            h = "" + c[0];
        if (a.bounce) h = h == "+" ? "-" : "+";
        b[c[1]] = h + "=" + f;
        this.getTip().animate(b, a.slideOutSpeed, function () {
            d(this).hide();
            g.call()
        })
    })
})(jQuery);;
(function ($) {
    jQuery.fn.pngFix = function (settings) {
        settings = jQuery.extend({
            blankgif: 'blank.gif'
        }, settings);
        var ie55 = (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) == 4 && navigator.appVersion.indexOf("MSIE 5.5") != -1);
        var ie6 = (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) == 4 && navigator.appVersion.indexOf("MSIE 6.0") != -1);
        if (jQuery.browser.msie && (ie55 || ie6)) {
            jQuery(this).find("img[src$=.png]").each(function () {
                jQuery(this).attr('width', jQuery(this).width());
                jQuery(this).attr('height', jQuery(this).height());
                var prevStyle = '';
                var strNewHTML = '';
                var imgId = (jQuery(this).attr('id')) ? 'id="' + jQuery(this).attr('id') + '" ' : '';
                var imgClass = (jQuery(this).attr('class')) ? 'class="' + jQuery(this).attr('class') + '" ' : '';
                var imgTitle = (jQuery(this).attr('title')) ? 'title="' + jQuery(this).attr('title') + '" ' : '';
                var imgAlt = (jQuery(this).attr('alt')) ? 'alt="' + jQuery(this).attr('alt') + '" ' : '';
                var imgAlign = (jQuery(this).attr('align')) ? 'float:' + jQuery(this).attr('align') + ';' : '';
                var imgHand = (jQuery(this).parent().attr('href')) ? 'cursor:hand;' : '';
                if (this.style.border) {
                    prevStyle += 'border:' + this.style.border + ';';
                    this.style.border = '';
                }
                if (this.style.padding) {
                    prevStyle += 'padding:' + this.style.padding + ';';
                    this.style.padding = '';
                }
                if (this.style.margin) {
                    prevStyle += 'margin:' + this.style.margin + ';';
                    this.style.margin = '';
                }
                var imgStyle = (this.style.cssText);
                strNewHTML += '<span ' + imgId + imgClass + imgTitle + imgAlt;
                strNewHTML += 'style="position:relative;white-space:pre-line;display:inline-block;background:transparent;' + imgAlign + imgHand;
                strNewHTML += 'width:' + jQuery(this).width() + 'px;' + 'height:' + jQuery(this).height() + 'px;';
                strNewHTML += 'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader' + '(src=\'' + jQuery(this).attr('src') + '\', sizingMethod=\'scale\');';
                strNewHTML += imgStyle + '"></span>';
                if (prevStyle != '') {
                    strNewHTML = '<span style="position:relative;display:inline-block;' + prevStyle + imgHand + 'width:' + jQuery(this).width() + 'px;' + 'height:' + jQuery(this).height() + 'px;' + '">' + strNewHTML + '</span>';
                }
                jQuery(this).hide();
                jQuery(this).after(strNewHTML);
            });
            jQuery(this).find("*").each(function () {
                var bgIMG = jQuery(this).css('background-image');
                if (bgIMG.indexOf(".png") != -1) {
                    var iebg = bgIMG.split('url("')[1].split('")')[0];
                    jQuery(this).css('background-image', 'none');
                    jQuery(this).get(0).runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + iebg + "',sizingMethod='scale')";
                }
            });
            jQuery(this).find("input[src$=.png]").each(function () {
                var bgIMG = jQuery(this).attr('src');
                jQuery(this).get(0).runtimeStyle.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader' + '(src=\'' + bgIMG + '\', sizingMethod=\'scale\');';
                jQuery(this).attr('src', settings.blankgif)
            });
        }
        return jQuery;
    };
})(jQuery);;
/*
 * jQuery Cycle Lite Plugin
 * http://malsup.com/jquery/cycle/lite/
 * Copyright (c) 2008 M. Alsup
 * Version: 1.0 (06/08/2008)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 * Requires: jQuery v1.2.3 or later
 */
(function (D) {
    var A = "Lite-1.0";
    D.fn.cycle = function (E) {
        return this.each(function () {
            E = E || {};
            if (this.cycleTimeout) {
                clearTimeout(this.cycleTimeout)
            }
            this.cycleTimeout = 0;
            this.cyclePause = 0;
            var I = D(this);
            var J = E.slideExpr ? D(E.slideExpr, this) : I.children();
            var G = J.get();
            if (G.length < 2) {
                if (window.console && window.console.log) {
                    window.console.log("terminating; too few slides: " + G.length)
                }
                return
            }
            var H = D.extend({}, D.fn.cycle.defaults, E || {}, D.metadata ? I.metadata() : D.meta ? I.data() : {});
            H.before = H.before ? [H.before] : [];
            H.after = H.after ? [H.after] : [];
            H.after.unshift(function () {
                H.busy = 0
            });
            var F = this.className;
            H.width = parseInt((F.match(/w:(\d+)/) || [])[1]) || H.width;
            H.height = parseInt((F.match(/h:(\d+)/) || [])[1]) || H.height;
            H.timeout = parseInt((F.match(/t:(\d+)/) || [])[1]) || H.timeout;
            if (I.css("position") == "static") {
                I.css("position", "relative")
            }
            if (H.width) {
                I.width(H.width)
            }
            if (H.height && H.height != "auto") {
                I.height(H.height)
            }
            var K = 0;
            J.css({
                position: "absolute",
                top: 0,
                left: 0
            }).hide().each(function (M) {
                D(this).css("z-index", G.length - M)
            });
            D(G[K]).css("opacity", 1).show();
            if (D.browser.msie) {
                G[K].style.removeAttribute("filter")
            }
            if (H.fit && H.width) {
                J.width(H.width)
            }
            if (H.fit && H.height && H.height != "auto") {
                J.height(H.height)
            }
            if (H.pause) {
                I.hover(function () {
                    this.cyclePause = 1
                }, function () {
                    this.cyclePause = 0
                })
            }
            D.fn.cycle.transitions.fade(I, J, H);
            J.each(function () {
                var M = D(this);
                this.cycleH = (H.fit && H.height) ? H.height : M.height();
                this.cycleW = (H.fit && H.width) ? H.width : M.width()
            });
            J.not(":eq(" + K + ")").css({
                opacity: 0
            });
            if (H.cssFirst) {
                D(J[K]).css(H.cssFirst)
            }
            if (H.timeout) {
                if (H.speed.constructor == String) {
                    H.speed = {
                        slow: 600,
                        fast: 200
                    }[H.speed] || 400
                }
                if (!H.sync) {
                    H.speed = H.speed / 2
                }
                while ((H.timeout - H.speed) < 250) {
                    H.timeout += H.speed
                }
            }
            H.speedIn = H.speed;
            H.speedOut = H.speed;
            H.slideCount = G.length;
            H.currSlide = K;
            H.nextSlide = 1;
            var L = J[K];
            if (H.before.length) {
                H.before[0].apply(L, [L, L, H, true])
            }
            if (H.after.length > 1) {
                H.after[1].apply(L, [L, L, H, true])
            }
            if (H.click && !H.next) {
                H.next = H.click
            }
            if (H.next) {
                D(H.next).bind("click", function () {
                    return C(G, H, H.rev ? -1 : 1)
                })
            }
            if (H.prev) {
                D(H.prev).bind("click", function () {
                    return C(G, H, H.rev ? 1 : -1)
                })
            }
            if (H.timeout) {
                this.cycleTimeout = setTimeout(function () {
                    B(G, H, 0, !H.rev)
                }, H.timeout + (H.delay || 0))
            }
        })
    };

    function B(J, E, I, K) {
        if (E.busy) {
            return
        }
        var H = J[0].parentNode,
            M = J[E.currSlide],
            L = J[E.nextSlide];
        if (H.cycleTimeout === 0 && !I) {
            return
        }
        if (I || !H.cyclePause) {
            if (E.before.length) {
                D.each(E.before, function (N, O) {
                    O.apply(L, [M, L, E, K])
                })
            }
            var F = function () {
                    if (D.browser.msie) {
                        this.style.removeAttribute("filter")
                    }
                    D.each(E.after, function (N, O) {
                        O.apply(L, [M, L, E, K])
                    })
                };
            if (E.nextSlide != E.currSlide) {
                E.busy = 1;
                D.fn.cycle.custom(M, L, E, F)
            }
            var G = (E.nextSlide + 1) == J.length;
            E.nextSlide = G ? 0 : E.nextSlide + 1;
            E.currSlide = G ? J.length - 1 : E.nextSlide - 1
        }
        if (E.timeout) {
            H.cycleTimeout = setTimeout(function () {
                B(J, E, 0, !E.rev)
            }, E.timeout)
        }
    }
    function C(E, F, I) {
        var H = E[0].parentNode,
            G = H.cycleTimeout;
        if (G) {
            clearTimeout(G);
            H.cycleTimeout = 0
        }
        F.nextSlide = F.currSlide + I;
        if (F.nextSlide < 0) {
            F.nextSlide = E.length - 1
        } else {
            if (F.nextSlide >= E.length) {
                F.nextSlide = 0
            }
        }
        B(E, F, 1, I >= 0);
        return false
    }
    D.fn.cycle.custom = function (K, H, I, E) {
        var J = D(K),
            G = D(H);
        G.css({
            opacity: 0
        });
        var F = function () {
                G.animate({
                    opacity: 1
                }, I.speedIn, I.easeIn, E)
            };
        J.animate({
            opacity: 0
        }, I.speedOut, I.easeOut, function () {
            J.css({
                display: "none"
            });
            if (!I.sync) {
                F()
            }
        });
        if (I.sync) {
            F()
        }
    };
    D.fn.cycle.transitions = {
        fade: function (F, G, E) {
            G.not(":eq(0)").css("opacity", 0);
            E.before.push(function () {
                D(this).show()
            })
        }
    };
    D.fn.cycle.ver = function () {
        return A
    };
    D.fn.cycle.defaults = {
        timeout: 4000,
        speed: 1000,
        next: null,
        prev: null,
        before: null,
        after: null,
        height: "auto",
        sync: 1,
        fit: 0,
        pause: 0,
        delay: 0,
        slideExpr: null
    }
})(jQuery);
/* Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
 * Licensed under the MIT License (LICENSE.txt).
 *
 * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
 * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
 * Thanks to: Seamus Leahy for adding deltaX and deltaY
 *
 * Version: 3.0.4
 *
 * Requires: 1.2.2+
 */
(function (d) {
    function g(a) {
        var b = a || window.event,
            i = [].slice.call(arguments, 1),
            c = 0,
            h = 0,
            e = 0;
        a = d.event.fix(b);
        a.type = "mousewheel";
        if (a.wheelDelta) c = a.wheelDelta / 120;
        if (a.detail) c = -a.detail / 3;
        e = c;
        if (b.axis !== undefined && b.axis === b.HORIZONTAL_AXIS) {
            e = 0;
            h = -1 * c
        }
        if (b.wheelDeltaY !== undefined) e = b.wheelDeltaY / 120;
        if (b.wheelDeltaX !== undefined) h = -1 * b.wheelDeltaX / 120;
        i.unshift(a, c, h, e);
        return d.event.handle.apply(this, i)
    }
    var f = ["DOMMouseScroll", "mousewheel"];
    d.event.special.mousewheel = {
        setup: function () {
            if (this.addEventListener) for (var a = f.length; a;) this.addEventListener(f[--a], g, false);
            else this.onmousewheel = g
        },
        teardown: function () {
            if (this.removeEventListener) for (var a = f.length; a;) this.removeEventListener(f[--a], g, false);
            else this.onmousewheel = null
        }
    };
    d.fn.extend({
        mousewheel: function (a) {
            return a ? this.bind("mousewheel", a) : this.trigger("mousewheel")
        },
        unmousewheel: function (a) {
            return this.unbind("mousewheel", a)
        }
    })
})(jQuery);;
eval(function (p, a, c, k, e, r) {
    e = function (c) {
        return (c < a ? '' : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36))
    };
    if (!''.replace(/^/, String)) {
        while (c--) r[e(c)] = k[c] || e(c);
        k = [function (e) {
            return r[e]
        }];
        e = function () {
            return '\\w+'
        };
        c = 1
    };
    while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]);
    return p
}('h.i[\'1a\']=h.i[\'z\'];h.O(h.i,{y:\'D\',z:9(x,t,b,c,d){6 h.i[h.i.y](x,t,b,c,d)},17:9(x,t,b,c,d){6 c*(t/=d)*t+b},D:9(x,t,b,c,d){6-c*(t/=d)*(t-2)+b},13:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t+b;6-c/2*((--t)*(t-2)-1)+b},X:9(x,t,b,c,d){6 c*(t/=d)*t*t+b},U:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t+1)+b},R:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t+b;6 c/2*((t-=2)*t*t+2)+b},N:9(x,t,b,c,d){6 c*(t/=d)*t*t*t+b},M:9(x,t,b,c,d){6-c*((t=t/d-1)*t*t*t-1)+b},L:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t+b;6-c/2*((t-=2)*t*t*t-2)+b},K:9(x,t,b,c,d){6 c*(t/=d)*t*t*t*t+b},J:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t*t*t+1)+b},I:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t*t+b;6 c/2*((t-=2)*t*t*t*t+2)+b},G:9(x,t,b,c,d){6-c*8.C(t/d*(8.g/2))+c+b},15:9(x,t,b,c,d){6 c*8.n(t/d*(8.g/2))+b},12:9(x,t,b,c,d){6-c/2*(8.C(8.g*t/d)-1)+b},Z:9(x,t,b,c,d){6(t==0)?b:c*8.j(2,10*(t/d-1))+b},Y:9(x,t,b,c,d){6(t==d)?b+c:c*(-8.j(2,-10*t/d)+1)+b},W:9(x,t,b,c,d){e(t==0)6 b;e(t==d)6 b+c;e((t/=d/2)<1)6 c/2*8.j(2,10*(t-1))+b;6 c/2*(-8.j(2,-10*--t)+2)+b},V:9(x,t,b,c,d){6-c*(8.o(1-(t/=d)*t)-1)+b},S:9(x,t,b,c,d){6 c*8.o(1-(t=t/d-1)*t)+b},Q:9(x,t,b,c,d){e((t/=d/2)<1)6-c/2*(8.o(1-t*t)-1)+b;6 c/2*(8.o(1-(t-=2)*t)+1)+b},P:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6-(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b},H:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6 a*8.j(2,-10*t)*8.n((t*d-s)*(2*8.g)/p)+c+b},T:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d/2)==2)6 b+c;e(!p)p=d*(.3*1.5);e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);e(t<1)6-.5*(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b;6 a*8.j(2,-10*(t-=1))*8.n((t*d-s)*(2*8.g)/p)*.5+c+b},F:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*(t/=d)*t*((s+1)*t-s)+b},E:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},16:9(x,t,b,c,d,s){e(s==u)s=1.l;e((t/=d/2)<1)6 c/2*(t*t*(((s*=(1.B))+1)*t-s))+b;6 c/2*((t-=2)*t*(((s*=(1.B))+1)*t+s)+2)+b},A:9(x,t,b,c,d){6 c-h.i.v(x,d-t,0,c,d)+b},v:9(x,t,b,c,d){e((t/=d)<(1/2.k)){6 c*(7.q*t*t)+b}m e(t<(2/2.k)){6 c*(7.q*(t-=(1.5/2.k))*t+.k)+b}m e(t<(2.5/2.k)){6 c*(7.q*(t-=(2.14/2.k))*t+.11)+b}m{6 c*(7.q*(t-=(2.18/2.k))*t+.19)+b}},1b:9(x,t,b,c,d){e(t<d/2)6 h.i.A(x,t*2,0,c,d)*.5+b;6 h.i.v(x,t*2-d,0,c,d)*.5+c*.5+b}});', 62, 74, '||||||return||Math|function|||||if|var|PI|jQuery|easing|pow|75|70158|else|sin|sqrt||5625|asin|||undefined|easeOutBounce|abs||def|swing|easeInBounce|525|cos|easeOutQuad|easeOutBack|easeInBack|easeInSine|easeOutElastic|easeInOutQuint|easeOutQuint|easeInQuint|easeInOutQuart|easeOutQuart|easeInQuart|extend|easeInElastic|easeInOutCirc|easeInOutCubic|easeOutCirc|easeInOutElastic|easeOutCubic|easeInCirc|easeInOutExpo|easeInCubic|easeOutExpo|easeInExpo||9375|easeInOutSine|easeInOutQuad|25|easeOutSine|easeInOutBack|easeInQuad|625|984375|jswing|easeInOutBounce'.split('|'), 0, {}));;
(function (b) {
    var m, t, u, f, D, j, E, n, z, A, q = 0,
        e = {},
        o = [],
        p = 0,
        d = {},
        l = [],
        G = null,
        v = new Image,
        J = /\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,
        W = /[^\.]\.(swf)\s*$/i,
        K, L = 1,
        y = 0,
        s = "",
        r, i, h = false,
        B = b.extend(b("<div/>")[0], {
            prop: 0
        }),
        M = b.browser.msie && b.browser.version < 7 && !window.XMLHttpRequest,
        N = function () {
            t.hide();
            v.onerror = v.onload = null;
            G && G.abort();
            m.empty()
        },
        O = function () {
            if (false === e.onError(o, q, e)) {
                t.hide();
                h = false
            } else {
                e.titleShow = false;
                e.width = "auto";
                e.height = "auto";
                m.html('<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>');
                F()
            }
        },
        I = function () {
            var a = o[q],
                c, g, k, C, P, w;
            N();
            e = b.extend({}, b.fn.fancybox.defaults, typeof b(a).data("fancybox") == "undefined" ? e : b(a).data("fancybox"));
            w = e.onStart(o, q, e);
            if (w === false) h = false;
            else {
                if (typeof w == "object") e = b.extend(e, w);
                k = e.title || (a.nodeName ? b(a).attr("title") : a.title) || "";
                if (a.nodeName && !e.orig) e.orig = b(a).children("img:first").length ? b(a).children("img:first") : b(a);
                if (k === "" && e.orig && e.titleFromAlt) k = e.orig.attr("alt");
                c = e.href || (a.nodeName ? b(a).attr("href") : a.href) || null;
                if (/^(?:javascript)/i.test(c) || c == "#") c = null;
                if (e.type) {
                    g = e.type;
                    if (!c) c = e.content
                } else if (e.content) g = "html";
                else if (c) g = c.match(J) ? "image" : c.match(W) ? "swf" : b(a).hasClass("iframe") ? "iframe" : c.indexOf("#") === 0 ? "inline" : "ajax";
                if (g) {
                    if (g == "inline") {
                        a = c.substr(c.indexOf("#"));
                        g = b(a).length > 0 ? "inline" : "ajax"
                    }
                    e.type = g;
                    e.href = c;
                    e.title = k;
                    if (e.autoDimensions) if (e.type == "html" || e.type == "inline" || e.type == "ajax") {
                        e.width = "auto";
                        e.height = "auto"
                    } else e.autoDimensions = false;
                    if (e.modal) {
                        e.overlayShow = true;
                        e.hideOnOverlayClick = false;
                        e.hideOnContentClick = false;
                        e.enableEscapeButton = false;
                        e.showCloseButton = false
                    }
                    e.padding = parseInt(e.padding, 10);
                    e.margin = parseInt(e.margin, 10);
                    m.css("padding", e.padding + e.margin);
                    b(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change", function () {
                        b(this).replaceWith(j.children())
                    });
                    switch (g) {
                    case "html":
                        m.html(e.content);
                        F();
                        break;
                    case "inline":
                        if (b(a).parent().is("#fancybox-content") === true) {
                            h = false;
                            break
                        }
                        b('<div class="fancybox-inline-tmp" />').hide().insertBefore(b(a)).bind("fancybox-cleanup", function () {
                            b(this).replaceWith(j.children())
                        }).bind("fancybox-cancel", function () {
                            b(this).replaceWith(m.children())
                        });
                        b(a).appendTo(m);
                        F();
                        break;
                    case "image":
                        h = false;
                        b.fancybox.showActivity();
                        v = new Image;
                        v.onerror = function () {
                            O()
                        };
                        v.onload = function () {
                            h = true;
                            v.onerror = v.onload = null;
                            e.width = v.width;
                            e.height = v.height;
                            b("<img />").attr({
                                id: "fancybox-img",
                                src: v.src,
                                alt: e.title
                            }).appendTo(m);
                            Q()
                        };
                        v.src = c;
                        break;
                    case "swf":
                        e.scrolling = "no";
                        C = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + e.width + '" height="' + e.height + '"><param name="movie" value="' + c + '"></param>';
                        P = "";
                        b.each(e.swf, function (x, H) {
                            C += '<param name="' + x + '" value="' + H + '"></param>';
                            P += " " + x + '="' + H + '"'
                        });
                        C += '<embed src="' + c + '" type="application/x-shockwave-flash" width="' + e.width + '" height="' + e.height + '"' + P + "></embed></object>";
                        m.html(C);
                        F();
                        break;
                    case "ajax":
                        h = false;
                        b.fancybox.showActivity();
                        e.ajax.win = e.ajax.success;
                        G = b.ajax(b.extend({}, e.ajax, {
                            url: c,
                            data: e.ajax.data || {},
                            error: function (x) {
                                x.status > 0 && O()
                            },
                            success: function (x, H, R) {
                                if ((typeof R == "object" ? R : G).status == 200) {
                                    if (typeof e.ajax.win == "function") {
                                        w = e.ajax.win(c, x, H, R);
                                        if (w === false) {
                                            t.hide();
                                            return
                                        } else if (typeof w == "string" || typeof w == "object") x = w
                                    }
                                    m.html(x);
                                    F()
                                }
                            }
                        }));
                        break;
                    case "iframe":
                        Q()
                    }
                } else O()
            }
        },
        F = function () {
            var a = e.width,
                c = e.height;
            a = a.toString().indexOf("%") > -1 ? parseInt((b(window).width() - e.margin * 2) * parseFloat(a) / 100, 10) + "px" : a == "auto" ? "auto" : a + "px";
            c = c.toString().indexOf("%") > -1 ? parseInt((b(window).height() - e.margin * 2) * parseFloat(c) / 100, 10) + "px" : c == "auto" ? "auto" : c + "px";
            m.wrapInner('<div style="width:' + a + ";height:" + c + ";overflow: " + (e.scrolling == "auto" ? "auto" : e.scrolling == "yes" ? "scroll" : "hidden") + ';position:relative;"></div>');
            e.width = m.width();
            e.height = m.height();
            Q()
        },
        Q = function () {
            var a, c;
            t.hide();
            if (f.is(":visible") && false === d.onCleanup(l, p, d)) {
                b.event.trigger("fancybox-cancel");
                h = false
            } else {
                h = true;
                b(j.add(u)).unbind();
                b(window).unbind("resize.fb scroll.fb");
                b(document).unbind("keydown.fb");
                f.is(":visible") && d.titlePosition !== "outside" && f.css("height", f.height());
                l = o;
                p = q;
                d = e;
                if (d.overlayShow) {
                    u.css({
                        "background-color": d.overlayColor,
                        opacity: d.overlayOpacity,
                        cursor: d.hideOnOverlayClick ? "pointer" : "auto",
                        height: b(document).height()
                    });
                    if (!u.is(":visible")) {
                        M && b("select:not(#fancybox-tmp select)").filter(function () {
                            return this.style.visibility !== "hidden"
                        }).css({
                            visibility: "hidden"
                        }).one("fancybox-cleanup", function () {
                            this.style.visibility = "inherit"
                        });
                        u.show()
                    }
                } else u.hide();
                i = X();
                s = d.title || "";
                y = 0;
                n.empty().removeAttr("style").removeClass();
                if (d.titleShow !== false) {
                    if (b.isFunction(d.titleFormat)) a = d.titleFormat(s, l, p, d);
                    else a = s && s.length ? d.titlePosition == "float" ? '<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">' + s + '</td><td id="fancybox-title-float-right"></td></tr></table>' : '<div id="fancybox-title-' + d.titlePosition + '">' + s + "</div>" : false;
                    s = a;
                    if (!(!s || s === "")) {
                        n.addClass("fancybox-title-" + d.titlePosition).html(s).appendTo("body").show();
                        switch (d.titlePosition) {
                        case "inside":
                            n.css({
                                width: i.width - d.padding * 2,
                                marginLeft: d.padding,
                                marginRight: d.padding
                            });
                            y = n.outerHeight(true);
                            n.appendTo(D);
                            i.height += y;
                            break;
                        case "over":
                            n.css({
                                marginLeft: d.padding,
                                width: i.width - d.padding * 2,
                                bottom: d.padding
                            }).appendTo(D);
                            break;
                        case "float":
                            n.css("left", parseInt((n.width() - i.width - 40) / 2, 10) * -1).appendTo(f);
                            break;
                        default:
                            n.css({
                                width: i.width - d.padding * 2,
                                paddingLeft: d.padding,
                                paddingRight: d.padding
                            }).appendTo(f)
                        }
                    }
                }
                n.hide();
                if (f.is(":visible")) {
                    b(E.add(z).add(A)).hide();
                    a = f.position();
                    r = {
                        top: a.top,
                        left: a.left,
                        width: f.width(),
                        height: f.height()
                    };
                    c = r.width == i.width && r.height == i.height;
                    j.fadeTo(d.changeFade, 0.3, function () {
                        var g = function () {
                                j.html(m.contents()).fadeTo(d.changeFade, 1, S)
                            };
                        b.event.trigger("fancybox-change");
                        j.empty().removeAttr("filter").css({
                            "border-width": d.padding,
                            width: i.width - d.padding * 2,
                            height: e.autoDimensions ? "auto" : i.height - y - d.padding * 2
                        });
                        if (c) g();
                        else {
                            B.prop = 0;
                            b(B).animate({
                                prop: 1
                            }, {
                                duration: d.changeSpeed,
                                easing: d.easingChange,
                                step: T,
                                complete: g
                            })
                        }
                    })
                } else {
                    f.removeAttr("style");
                    j.css("border-width", d.padding);
                    if (d.transitionIn == "elastic") {
                        r = V();
                        j.html(m.contents());
                        f.show();
                        if (d.opacity) i.opacity = 0;
                        B.prop = 0;
                        b(B).animate({
                            prop: 1
                        }, {
                            duration: d.speedIn,
                            easing: d.easingIn,
                            step: T,
                            complete: S
                        })
                    } else {
                        d.titlePosition == "inside" && y > 0 && n.show();
                        j.css({
                            width: i.width - d.padding * 2,
                            height: e.autoDimensions ? "auto" : i.height - y - d.padding * 2
                        }).html(m.contents());
                        f.css(i).fadeIn(d.transitionIn == "none" ? 0 : d.speedIn, S)
                    }
                }
            }
        },
        Y = function () {
            if (d.enableEscapeButton || d.enableKeyboardNav) b(document).bind("keydown.fb", function (a) {
                if (a.keyCode == 27 && d.enableEscapeButton) {
                    a.preventDefault();
                    b.fancybox.close()
                } else if ((a.keyCode == 37 || a.keyCode == 39) && d.enableKeyboardNav && a.target.tagName !== "INPUT" && a.target.tagName !== "TEXTAREA" && a.target.tagName !== "SELECT") {
                    a.preventDefault();
                    b.fancybox[a.keyCode == 37 ? "prev" : "next"]()
                }
            });
            if (d.showNavArrows) {
                if (d.cyclic && l.length > 1 || p !== 0) z.show();
                if (d.cyclic && l.length > 1 || p != l.length - 1) A.show()
            } else {
                z.hide();
                A.hide()
            }
        },
        S = function () {
            if (!b.support.opacity) {
                j.get(0).style.removeAttribute("filter");
                f.get(0).style.removeAttribute("filter")
            }
            e.autoDimensions && j.css("height", "auto");
            f.css("height", "auto");
            s && s.length && n.show();
            d.showCloseButton && E.show();
            Y();
            d.hideOnContentClick && j.bind("click", b.fancybox.close);
            d.hideOnOverlayClick && u.bind("click", b.fancybox.close);
            b(window).bind("resize.fb", b.fancybox.resize);
            d.centerOnScroll && b(window).bind("scroll.fb", b.fancybox.center);
            if (d.type == "iframe") b('<iframe id="fancybox-frame" name="fancybox-frame' + (new Date).getTime() + '" frameborder="0" hspace="0" ' + (b.browser.msie ? 'allowtransparency="true""' : "") + ' scrolling="' + e.scrolling + '" src="' + d.href + '"></iframe>').appendTo(j);
            f.show();
            h = false;
            b.fancybox.center();
            d.onComplete(l, p, d);
            var a, c;
            if (l.length - 1 > p) {
                a = l[p + 1].href;
                if (typeof a !== "undefined" && a.match(J)) {
                    c = new Image;
                    c.src = a
                }
            }
            if (p > 0) {
                a = l[p - 1].href;
                if (typeof a !== "undefined" && a.match(J)) {
                    c = new Image;
                    c.src = a
                }
            }
        },
        T = function (a) {
            var c = {
                width: parseInt(r.width + (i.width - r.width) * a, 10),
                height: parseInt(r.height + (i.height - r.height) * a, 10),
                top: parseInt(r.top + (i.top - r.top) * a, 10),
                left: parseInt(r.left + (i.left - r.left) * a, 10)
            };
            if (typeof i.opacity !== "undefined") c.opacity = a < 0.5 ? 0.5 : a;
            f.css(c);
            j.css({
                width: c.width - d.padding * 2,
                height: c.height - y * a - d.padding * 2
            })
        },
        U = function () {
            return [b(window).width() - d.margin * 2, b(window).height() - d.margin * 2, b(document).scrollLeft() + d.margin, b(document).scrollTop() + d.margin]
        },
        X = function () {
            var a = U(),
                c = {},
                g = d.autoScale,
                k = d.padding * 2;
            c.width = d.width.toString().indexOf("%") > -1 ? parseInt(a[0] * parseFloat(d.width) / 100, 10) : d.width + k;
            c.height = d.height.toString().indexOf("%") > -1 ? parseInt(a[1] * parseFloat(d.height) / 100, 10) : d.height + k;
            if (g && (c.width > a[0] || c.height > a[1])) if (e.type == "image" || e.type == "swf") {
                g = d.width / d.height;
                if (c.width > a[0]) {
                    c.width = a[0];
                    c.height = parseInt((c.width - k) / g + k, 10)
                }
                if (c.height > a[1]) {
                    c.height = a[1];
                    c.width = parseInt((c.height - k) * g + k, 10)
                }
            } else {
                c.width = Math.min(c.width, a[0]);
                c.height = Math.min(c.height, a[1])
            }
            c.top = parseInt(Math.max(a[3] - 20, a[3] + (a[1] - c.height - 40) * 0.5), 10);
            c.left = parseInt(Math.max(a[2] - 20, a[2] + (a[0] - c.width - 40) * 0.5), 10);
            return c
        },
        V = function () {
            var a = e.orig ? b(e.orig) : false,
                c = {};
            if (a && a.length) {
                c = a.offset();
                c.top += parseInt(a.css("paddingTop"), 10) || 0;
                c.left += parseInt(a.css("paddingLeft"), 10) || 0;
                c.top += parseInt(a.css("border-top-width"), 10) || 0;
                c.left += parseInt(a.css("border-left-width"), 10) || 0;
                c.width = a.width();
                c.height = a.height();
                c = {
                    width: c.width + d.padding * 2,
                    height: c.height + d.padding * 2,
                    top: c.top - d.padding - 20,
                    left: c.left - d.padding - 20
                }
            } else {
                a = U();
                c = {
                    width: d.padding * 2,
                    height: d.padding * 2,
                    top: parseInt(a[3] + a[1] * 0.5, 10),
                    left: parseInt(a[2] + a[0] * 0.5, 10)
                }
            }
            return c
        },
        Z = function () {
            if (t.is(":visible")) {
                b("div", t).css("top", L * -40 + "px");
                L = (L + 1) % 12
            } else clearInterval(K)
        };
    b.fn.fancybox = function (a) {
        if (!b(this).length) return this;
        b(this).data("fancybox", b.extend({}, a, b.metadata ? b(this).metadata() : {})).unbind("click.fb").bind("click.fb", function (c) {
            c.preventDefault();
            if (!h) {
                h = true;
                b(this).blur();
                o = [];
                q = 0;
                c = b(this).attr("rel") || "";
                if (!c || c == "" || c === "nofollow") o.push(this);
                else {
                    o = b("a[rel=" + c + "], area[rel=" + c + "]");
                    q = o.index(this)
                }
                I()
            }
        });
        return this
    };
    b.fancybox = function (a, c) {
        var g;
        if (!h) {
            h = true;
            g = typeof c !== "undefined" ? c : {};
            o = [];
            q = parseInt(g.index, 10) || 0;
            if (b.isArray(a)) {
                for (var k = 0, C = a.length; k < C; k++) if (typeof a[k] == "object") b(a[k]).data("fancybox", b.extend({}, g, a[k]));
                else a[k] = b({}).data("fancybox", b.extend({
                    content: a[k]
                }, g));
                o = jQuery.merge(o, a)
            } else {
                if (typeof a == "object") b(a).data("fancybox", b.extend({}, g, a));
                else a = b({}).data("fancybox", b.extend({
                    content: a
                }, g));
                o.push(a)
            }
            if (q > o.length || q < 0) q = 0;
            I()
        }
    };
    b.fancybox.showActivity = function () {
        clearInterval(K);
        t.show();
        K = setInterval(Z, 66)
    };
    b.fancybox.hideActivity = function () {
        t.hide()
    };
    b.fancybox.next = function () {
        return b.fancybox.pos(p + 1)
    };
    b.fancybox.prev = function () {
        return b.fancybox.pos(p - 1)
    };
    b.fancybox.pos = function (a) {
        if (!h) {
            a = parseInt(a);
            o = l;
            if (a > -1 && a < l.length) {
                q = a;
                I()
            } else if (d.cyclic && l.length > 1) {
                q = a >= l.length ? 0 : l.length - 1;
                I()
            }
        }
    };
    b.fancybox.cancel = function () {
        if (!h) {
            h = true;
            b.event.trigger("fancybox-cancel");
            N();
            e.onCancel(o, q, e);
            h = false
        }
    };
    b.fancybox.close = function () {
        function a() {
            u.fadeOut("fast");
            n.empty().hide();
            f.hide();
            b.event.trigger("fancybox-cleanup");
            j.empty();
            d.onClosed(l, p, d);
            l = e = [];
            p = q = 0;
            d = e = {};
            h = false
        }
        if (!(h || f.is(":hidden"))) {
            h = true;
            if (d && false === d.onCleanup(l, p, d)) h = false;
            else {
                N();
                b(E.add(z).add(A)).hide();
                b(j.add(u)).unbind();
                b(window).unbind("resize.fb scroll.fb");
                b(document).unbind("keydown.fb");
                j.find("iframe").attr("src", M && /^https/i.test(window.location.href || "") ? "javascript:void(false)" : "about:blank");
                d.titlePosition !== "inside" && n.empty();
                f.stop();
                if (d.transitionOut == "elastic") {
                    r = V();
                    var c = f.position();
                    i = {
                        top: c.top,
                        left: c.left,
                        width: f.width(),
                        height: f.height()
                    };
                    if (d.opacity) i.opacity = 1;
                    n.empty().hide();
                    B.prop = 1;
                    b(B).animate({
                        prop: 0
                    }, {
                        duration: d.speedOut,
                        easing: d.easingOut,
                        step: T,
                        complete: a
                    })
                } else f.fadeOut(d.transitionOut == "none" ? 0 : d.speedOut, a)
            }
        }
    };
    b.fancybox.resize = function () {
        u.is(":visible") && u.css("height", b(document).height());
        b.fancybox.center(true)
    };
    b.fancybox.center = function (a) {
        var c, g;
        if (!h) {
            g = a === true ? 1 : 0;
            c = U();
            !g && (f.width() > c[0] || f.height() > c[1]) || f.stop().animate({
                top: parseInt(Math.max(c[3] - 20, c[3] + (c[1] - j.height() - 40) * 0.5 - d.padding)),
                left: parseInt(Math.max(c[2] - 20, c[2] + (c[0] - j.width() - 40) * 0.5 - d.padding))
            }, typeof a == "number" ? a : 200)
        }
    };
    b.fancybox.init = function () {
        if (!b("#fancybox-wrap").length) {
            b("body").append(m = b('<div id="fancybox-tmp"></div>'), t = b('<div id="fancybox-loading"><div></div></div>'), u = b('<div id="fancybox-overlay"></div>'), f = b('<div id="fancybox-wrap"></div>'));
            D = b('<div id="fancybox-outer"></div>').append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>').appendTo(f);
            D.append(j = b('<div id="fancybox-content"></div>'), E = b('<a id="fancybox-close"></a>'), n = b('<div id="fancybox-title"></div>'), z = b('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'), A = b('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));
            E.click(b.fancybox.close);
            t.click(b.fancybox.cancel);
            z.click(function (a) {
                a.preventDefault();
                b.fancybox.prev()
            });
            A.click(function (a) {
                a.preventDefault();
                b.fancybox.next()
            });
            b.fn.mousewheel && f.bind("mousewheel.fb", function (a, c) {
                if (h) a.preventDefault();
                else if (b(a.target).get(0).clientHeight == 0 || b(a.target).get(0).scrollHeight === b(a.target).get(0).clientHeight) {
                    a.preventDefault();
                    b.fancybox[c > 0 ? "prev" : "next"]()
                }
            });
            b.support.opacity || f.addClass("fancybox-ie");
            if (M) {
                t.addClass("fancybox-ie6");
                f.addClass("fancybox-ie6");
                b('<iframe id="fancybox-hide-sel-frame" src="' + (/^https/i.test(window.location.href || "") ? "javascript:void(false)" : "about:blank") + '" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(D)
            }
        }
    };
    b.fn.fancybox.defaults = {
        padding: 10,
        margin: 40,
        opacity: false,
        modal: false,
        cyclic: false,
        scrolling: "auto",
        width: 560,
        height: 340,
        autoScale: true,
        autoDimensions: true,
        centerOnScroll: false,
        ajax: {},
        swf: {
            wmode: "transparent"
        },
        hideOnOverlayClick: true,
        hideOnContentClick: false,
        overlayShow: true,
        overlayOpacity: 0.7,
        overlayColor: "#777",
        titleShow: true,
        titlePosition: "float",
        titleFormat: null,
        titleFromAlt: false,
        transitionIn: "fade",
        transitionOut: "fade",
        speedIn: 300,
        speedOut: 300,
        changeSpeed: 300,
        changeFade: "fast",
        easingIn: "swing",
        easingOut: "swing",
        showCloseButton: true,
        showNavArrows: true,
        enableEscapeButton: true,
        enableKeyboardNav: true,
        onStart: function () {},
        onCancel: function () {},
        onComplete: function () {},
        onCleanup: function () {},
        onClosed: function () {},
        onError: function () {}
    };
    b(document).ready(function () {
        b.fancybox.init()
    })
})(jQuery);;
eval(function (p, a, c, k, e, r) {
    e = function (c) {
        return (c < a ? '' : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36))
    };
    if (!''.replace(/^/, String)) {
        while (c--) r[e(c)] = k[c] || e(c);
        k = [function (e) {
            return r[e]
        }];
        e = function () {
            return '\\w+'
        };
        c = 1
    };
    while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]);
    return p
}('t K={16:\'K\',1L:G,1M:G,1d:G,2f:y(){u(D.2g!=8&&D.1N&&!D.1N[q.16]){q.1L=M;q.1M=M}17 u(D.2g==8){q.1d=M}},2h:D.2i,1O:[],1b:{},2j:y(){u(q.1L||q.1M){D.1N.2L(q.16,\'2M:2N-2O-2P:x\')}u(q.1d){D.2Q(\'<?2R 2S="\'+q.16+\'" 2T="#1P#2k" ?>\')}},2l:y(){t a=D.1k(\'z\');D.2m.1w.1Q(a,D.2m.1w.1w);u(a.12){2n{t b=a.12;b.1x(q.16+\'\\\\:*\',\'{1l:2U(#1P#2k)}\');q.12=b}2o(2p){}}17{q.12=a}},1x:y(a,b,c){u(1R b==\'1S\'||b===2V){b=0}u(b.2W.2q().1y(\'2X\')==-1){b=b.2q().2Y(/[^0-9 ]/g,\'\').1T(\' \')}H(t i=0;i<4;i++){b[i]=(!b[i]&&b[i]!==0)?b[C.1e((i-2),0)]:b[i]}u(q.12){u(q.12.1x){t d=a.1T(\',\');H(t i=0;i<d.1U;i++){q.12.1x(d[i],\'1l:2Z(K.1V.2r(q, [\'+b.1W(\',\')+\']))\')}}17 u(c){t e=b.1W(\'F \')+\'F\';q.12.1z(D.2s(a+\' {Q-1f:\'+e+\'; -30-Q-1f:\'+e+\';}\'));q.12.1z(D.2s(a+\' {-1A-Q-1m-1n-1f:\'+b[0]+\'F \'+b[0]+\'F; -1A-Q-1m-1X-1f:\'+b[1]+\'F \'+b[1]+\'F; -1A-Q-1Y-1X-1f:\'+b[2]+\'F \'+b[2]+\'F; -1A-Q-1Y-1n-1f:\'+b[3]+\'F \'+b[3]+\'F;}\'))}}17 u(q.1d){q.1O.31({\'2t\':a,\'2u\':b})}},2v:y(a){2w(32.33){I\'z.Q\':I\'z.34\':I\'z.1B\':q.1o(a);13;I\'z.2x\':q.1Z(a);13;I\'z.1p\':I\'z.2y\':I\'z.2z\':q.1o(a);13;I\'z.20\':a.18.z.20=(a.z.20==\'S\')?\'S\':\'35\';13;I\'z.21\':q.22(a);13;I\'z.1c\':a.18.z.1c=a.z.1c;13}},1o:y(a){a.14.23=\'\';q.2A(a);q.1Z(a);q.1C(a);q.1D(a);q.24(a);q.2B(a);q.22(a)},22:y(a){u(a.W.21.1y(\'36\')!=-1){t b=a.W.21;b=1g(b.37(b.25(\'=\')+1,b.25(\')\')),10)/2C;H(t v 1h a.x){a.x[v].1i.38=b}}},2A:y(a){u(!a.W){1q}17{t b=a.W}a.14.1p=\'\';a.14.1E=\'\';t c=(b.1p==\'2D\');t d=M;u(b.1E!=\'S\'||a.1F){u(!a.1F){a.J=b.1E;a.J=a.J.39(5,a.J.25(\'")\')-5)}17{a.J=a.26}t e=q;u(!e.1b[a.J]){t f=D.1k(\'3a\');f.1r(\'3b\',y(){q.1s=q.3c;q.1t=q.3d;e.1D(a)});f.3e=e.16+\'3f\';f.14.23=\'1l:S; 1j:27; 1m:-2E; 1n:-2E; Q:S;\';f.26=a.J;f.2F(\'1s\');f.2F(\'1t\');D.2G.1Q(f,D.2G.1w);e.1b[a.J]=f}a.x.Z.1i.26=a.J;d=G}a.x.Z.2H=!d;a.x.Z.1G=\'S\';a.x.1u.2H=!c;a.x.1u.1G=b.1p;a.14.1E=\'S\';a.14.1p=\'2D\'},1Z:y(a){a.x.1H.1G=a.W.2x},1C:y(a){t c=[\'N\',\'19\',\'1a\',\'O\'];a.P={};H(t b=0;b<4;b++){a.P[c[b]]=1g(a.W[\'Q\'+c[b]+\'U\'],10)||0}},1D:y(c){t e=[\'O\',\'N\',\'U\',\'V\'];H(t d=0;d<4;d++){c.E[e[d]]=c[\'3g\'+e[d]]}t f=y(a,b){a.z.1n=(b?0:c.E.O)+\'F\';a.z.1m=(b?0:c.E.N)+\'F\';a.z.1s=c.E.U+\'F\';a.z.1t=c.E.V+\'F\'};H(t v 1h c.x){t g=(v==\'Z\')?1:2;c.x[v].3h=(c.E.U*g)+\', \'+(c.E.V*g);f(c.x[v],M)}f(c.18,G);u(K.1d){c.x.1H.z.28=\'-3i\';u(1R c.P==\'1S\'){q.1C(c)}c.x.1u.z.28=(c.P.N-1)+\'F \'+(c.P.O-1)+\'F\'}},24:y(j){t k=y(a,w,h,r,b,c,d){t e=a?[\'m\',\'1I\',\'l\',\'1J\',\'l\',\'1I\',\'l\',\'1J\',\'l\']:[\'1J\',\'l\',\'1I\',\'l\',\'1J\',\'l\',\'1I\',\'l\',\'m\'];b*=d;c*=d;w*=d;h*=d;t R=r.2I();H(t i=0;i<4;i++){R[i]*=d;R[i]=C.3j(w/2,h/2,R[i])}t f=[e[0]+C.11(0+b)+\',\'+C.11(R[0]+c),e[1]+C.11(R[0]+b)+\',\'+C.11(0+c),e[2]+C.15(w-R[1]+b)+\',\'+C.11(0+c),e[3]+C.15(w+b)+\',\'+C.11(R[1]+c),e[4]+C.15(w+b)+\',\'+C.15(h-R[2]+c),e[5]+C.15(w-R[2]+b)+\',\'+C.15(h+c),e[6]+C.11(R[3]+b)+\',\'+C.15(h+c),e[7]+C.11(0+b)+\',\'+C.15(h-R[3]+c),e[8]+C.11(0+b)+\',\'+C.11(R[0]+c)];u(!a){f.3k()}t g=f.1W(\'\');1q g};u(1R j.P==\'1S\'){q.1C(j)}t l=j.P;t m=j.2J.2I();t n=k(M,j.E.U,j.E.V,m,0,0,2);m[0]-=C.1e(l.O,l.N);m[1]-=C.1e(l.N,l.19);m[2]-=C.1e(l.19,l.1a);m[3]-=C.1e(l.1a,l.O);H(t i=0;i<4;i++){m[i]=C.1e(m[i],0)}t o=k(G,j.E.U-l.O-l.19,j.E.V-l.N-l.1a,m,l.O,l.N,2);t p=k(M,j.E.U-l.O-l.19+1,j.E.V-l.N-l.1a+1,m,l.O,l.N,1);j.x.1u.29=o;j.x.Z.29=p;j.x.1H.29=n+o;q.2K(j)},2B:y(a){t s=a.W;t b=[\'N\',\'O\',\'19\',\'1a\'];H(t i=0;i<4;i++){a.14[\'1B\'+b[i]]=(1g(s[\'1B\'+b[i]],10)||0)+(1g(s[\'Q\'+b[i]+\'U\'],10)||0)+\'F\'}a.14.Q=\'S\'},2K:y(e){t f=K;u(!e.J||!f.1b[e.J]){1q}t g=e.W;t h={\'X\':0,\'Y\':0};t i=y(a,b){t c=M;2w(b){I\'1n\':I\'1m\':h[a]=0;13;I\'3l\':h[a]=0.5;13;I\'1X\':I\'1Y\':h[a]=1;13;1P:u(b.1y(\'%\')!=-1){h[a]=1g(b,10)*0.3m}17{c=G}}t d=(a==\'X\');h[a]=C.15(c?((e.E[d?\'U\':\'V\']-(e.P[d?\'O\':\'N\']+e.P[d?\'19\':\'1a\']))*h[a])-(f.1b[e.J][d?\'1s\':\'1t\']*h[a]):1g(b,10));h[a]+=1};H(t b 1h h){i(b,g[\'2y\'+b])}e.x.Z.1i.1j=(h.X/(e.E.U-e.P.O-e.P.19+1))+\',\'+(h.Y/(e.E.V-e.P.N-e.P.1a+1));t j=g.2z;t c={\'T\':1,\'R\':e.E.U+1,\'B\':e.E.V+1,\'L\':1};t k={\'X\':{\'2a\':\'L\',\'2b\':\'R\',\'d\':\'U\'},\'Y\':{\'2a\':\'T\',\'2b\':\'B\',\'d\':\'V\'}};u(j!=\'2c\'){c={\'T\':(h.Y),\'R\':(h.X+f.1b[e.J].1s),\'B\':(h.Y+f.1b[e.J].1t),\'L\':(h.X)};u(j.1y(\'2c-\')!=-1){t v=j.1T(\'2c-\')[1].3n();c[k[v].2a]=1;c[k[v].2b]=e.E[k[v].d]+1}u(c.B>e.E.V){c.B=e.E.V+1}}e.x.Z.z.3o=\'3p(\'+c.T+\'F \'+c.R+\'F \'+c.B+\'F \'+c.L+\'F)\'},1v:y(a){t b=q;2d(y(){b.1o(a)},1)},2e:y(a){q.1D(a);q.24(a)},1V:y(b){q.z.1l=\'S\';u(!q.W){1q}17{t c=q.W}t d={3q:G,3r:G,3s:G,3t:G,3u:G,3v:G,3w:G};u(d[q.1K]===G){1q}t e=q;t f=K;q.2J=b;q.E={};t g={3x:\'2e\',3y:\'2e\'};u(q.1K==\'A\'){t i={3z:\'1v\',3A:\'1v\',3B:\'1v\',3C:\'1v\'};H(t a 1h i){g[a]=i[a]}}H(t h 1h g){q.1r(\'3D\'+h,y(){f[g[h]](e)})}q.1r(\'3E\',y(){f.2v(e)});t j=y(a){a.z.3F=1;u(a.W.1j==\'3G\'){a.z.1j=\'3H\'}};j(q.3I);j(q);q.18=D.1k(\'3J\');q.18.14.23=\'1l:S; 1j:27; 28:0; 1B:0; Q:0; 3K:S;\';q.18.z.1c=c.1c;q.x={\'1u\':M,\'Z\':M,\'1H\':M};H(t v 1h q.x){q.x[v]=D.1k(f.16+\':3L\');q.x[v].1i=D.1k(f.16+\':3M\');q.x[v].1z(q.x[v].1i);q.x[v].3N=G;q.x[v].z.1j=\'27\';q.x[v].z.1c=c.1c;q.x[v].3O=\'1,1\';q.18.1z(q.x[v])}q.x.Z.1G=\'S\';q.x.Z.1i.3P=\'3Q\';q.3R.1Q(q.18,q);q.1F=G;u(q.1K==\'3S\'){q.1F=M;q.z.3T=\'3U\'}2d(y(){f.1o(e)},1)}};2n{D.3V("3W",G,M)}2o(2p){}K.2f();K.2j();K.2l();u(K.1d&&D.1r&&K.2h){D.1r(\'3X\',y(){u(D.3Y==\'3Z\'){t d=K.1O;t e=d.1U;t f=y(a,b,c){2d(y(){K.1V.2r(a,b)},c*2C)};H(t i=0;i<e;i++){t g=D.2i(d[i].2t);t h=g.1U;H(t r=0;r<h;r++){u(g[r].1K!=\'40\'){f(g[r],d[i].2u,r)}}}}})}', 62, 249, '||||||||||||||||||||||||||this|||var|if|||vml|function|style|||Math|document|dim|px|false|for|case|vmlBg|DD_roundies||true|Top|Left|bW|border||none||Width|Height|currentStyle|||image||floor|styleSheet|break|runtimeStyle|ceil|ns|else|vmlBox|Right|Bottom|imgSize|zIndex|IE8|max|radius|parseInt|in|filler|position|createElement|behavior|top|left|applyVML|backgroundColor|return|attachEvent|width|height|color|pseudoClass|firstChild|addRule|search|appendChild|webkit|padding|vmlStrokeWeight|vmlOffsets|backgroundImage|isImg|fillcolor|stroke|qy|qx|nodeName|IE6|IE7|namespaces|selectorsToProcess|default|insertBefore|typeof|undefined|split|length|roundify|join|right|bottom|vmlStrokeColor|display|filter|vmlOpacity|cssText|vmlPath|lastIndexOf|src|absolute|margin|path|b1|b2|repeat|setTimeout|reposition|IEversion|documentMode|querySelector|querySelectorAll|createVmlNameSpace|VML|createVmlStyleSheet|documentElement|try|catch|err|toString|call|createTextNode|selector|radii|readPropertyChanges|switch|borderColor|backgroundPosition|backgroundRepeat|vmlFill|nixBorder|100|transparent|10000px|removeAttribute|body|filled|slice|DD_radii|clipImage|add|urn|schemas|microsoft|com|writeln|import|namespace|implementation|url|null|constructor|Array|replace|expression|moz|push|event|propertyName|borderWidth|block|lpha|substring|opacity|substr|img|onload|offsetWidth|offsetHeight|className|_sizeFinder|offset|coordsize|1px|min|reverse|center|01|toUpperCase|clip|rect|BODY|TABLE|TR|TD|SELECT|OPTION|TEXTAREA|resize|move|mouseleave|mouseenter|focus|blur|on|onpropertychange|zoom|static|relative|offsetParent|ignore|background|shape|fill|stroked|coordorigin|type|tile|parentNode|IMG|visibility|hidden|execCommand|BackgroundImageCache|onreadystatechange|readyState|complete|INPUT'.split('|'), 0, {}));
var swfobject = function () {
        var D = "undefined",
            r = "object",
            S = "Shockwave Flash",
            W = "ShockwaveFlash.ShockwaveFlash",
            q = "application/x-shockwave-flash",
            R = "SWFObjectExprInst",
            x = "onreadystatechange",
            O = window,
            j = document,
            t = navigator,
            T = false,
            U = [h],
            o = [],
            N = [],
            I = [],
            l, Q, E, B, J = false,
            a = false,
            n, G, m = true,
            M = function () {
                var aa = typeof j.getElementById != D && typeof j.getElementsByTagName != D && typeof j.createElement != D,
                    ah = t.userAgent.toLowerCase(),
                    Y = t.platform.toLowerCase(),
                    ae = Y ? /win/.test(Y) : /win/.test(ah),
                    ac = Y ? /mac/.test(Y) : /mac/.test(ah),
                    af = /webkit/.test(ah) ? parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false,
                    X = !+"\v1",
                    ag = [0, 0, 0],
                    ab = null;
                if (typeof t.plugins != D && typeof t.plugins[S] == r) {
                    ab = t.plugins[S].description;
                    if (ab && !(typeof t.mimeTypes != D && t.mimeTypes[q] && !t.mimeTypes[q].enabledPlugin)) {
                        T = true;
                        X = false;
                        ab = ab.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
                        ag[0] = parseInt(ab.replace(/^(.*)\..*$/, "$1"), 10);
                        ag[1] = parseInt(ab.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
                        ag[2] = /[a-zA-Z]/.test(ab) ? parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0
                    }
                } else {
                    if (typeof O.ActiveXObject != D) {
                        try {
                            var ad = new ActiveXObject(W);
                            if (ad) {
                                ab = ad.GetVariable("$version");
                                if (ab) {
                                    X = true;
                                    ab = ab.split(" ")[1].split(",");
                                    ag = [parseInt(ab[0], 10), parseInt(ab[1], 10), parseInt(ab[2], 10)]
                                }
                            }
                        } catch (Z) {}
                    }
                }
                return {
                    w3: aa,
                    pv: ag,
                    wk: af,
                    ie: X,
                    win: ae,
                    mac: ac
                }
            }(),
            k = function () {
                if (!M.w3) {
                    return
                }
                if ((typeof j.readyState != D && j.readyState == "complete") || (typeof j.readyState == D && (j.getElementsByTagName("body")[0] || j.body))) {
                    f()
                }
                if (!J) {
                    if (typeof j.addEventListener != D) {
                        j.addEventListener("DOMContentLoaded", f, false)
                    }
                    if (M.ie && M.win) {
                        j.attachEvent(x, function () {
                            if (j.readyState == "complete") {
                                j.detachEvent(x, arguments.callee);
                                f()
                            }
                        });
                        if (O == top) {
                            (function () {
                                if (J) {
                                    return
                                }
                                try {
                                    j.documentElement.doScroll("left")
                                } catch (X) {
                                    setTimeout(arguments.callee, 0);
                                    return
                                }
                                f()
                            })()
                        }
                    }
                    if (M.wk) {
                        (function () {
                            if (J) {
                                return
                            }
                            if (!/loaded|complete/.test(j.readyState)) {
                                setTimeout(arguments.callee, 0);
                                return
                            }
                            f()
                        })()
                    }
                    s(f)
                }
            }();

        function f() {
            if (J) {
                return
            }
            try {
                var Z = j.getElementsByTagName("body")[0].appendChild(C("span"));
                Z.parentNode.removeChild(Z)
            } catch (aa) {
                return
            }
            J = true;
            var X = U.length;
            for (var Y = 0; Y < X; Y++) {
                U[Y]()
            }
        }
        function K(X) {
            if (J) {
                X()
            } else {
                U[U.length] = X
            }
        }
        function s(Y) {
            if (typeof O.addEventListener != D) {
                O.addEventListener("load", Y, false)
            } else {
                if (typeof j.addEventListener != D) {
                    j.addEventListener("load", Y, false)
                } else {
                    if (typeof O.attachEvent != D) {
                        i(O, "onload", Y)
                    } else {
                        if (typeof O.onload == "function") {
                            var X = O.onload;
                            O.onload = function () {
                                X();
                                Y()
                            }
                        } else {
                            O.onload = Y
                        }
                    }
                }
            }
        }
        function h() {
            if (T) {
                V()
            } else {
                H()
            }
        }
        function V() {
            var X = j.getElementsByTagName("body")[0];
            var aa = C(r);
            aa.setAttribute("type", q);
            var Z = X.appendChild(aa);
            if (Z) {
                var Y = 0;
                (function () {
                    if (typeof Z.GetVariable != D) {
                        var ab = Z.GetVariable("$version");
                        if (ab) {
                            ab = ab.split(" ")[1].split(",");
                            M.pv = [parseInt(ab[0], 10), parseInt(ab[1], 10), parseInt(ab[2], 10)]
                        }
                    } else {
                        if (Y < 10) {
                            Y++;
                            setTimeout(arguments.callee, 10);
                            return
                        }
                    }
                    X.removeChild(aa);
                    Z = null;
                    H()
                })()
            } else {
                H()
            }
        }
        function H() {
            var ag = o.length;
            if (ag > 0) {
                for (var af = 0; af < ag; af++) {
                    var Y = o[af].id;
                    var ab = o[af].callbackFn;
                    var aa = {
                        success: false,
                        id: Y
                    };
                    if (M.pv[0] > 0) {
                        var ae = c(Y);
                        if (ae) {
                            if (F(o[af].swfVersion) && !(M.wk && M.wk < 312)) {
                                w(Y, true);
                                if (ab) {
                                    aa.success = true;
                                    aa.ref = z(Y);
                                    ab(aa)
                                }
                            } else {
                                if (o[af].expressInstall && A()) {
                                    var ai = {};
                                    ai.data = o[af].expressInstall;
                                    ai.width = ae.getAttribute("width") || "0";
                                    ai.height = ae.getAttribute("height") || "0";
                                    if (ae.getAttribute("class")) {
                                        ai.styleclass = ae.getAttribute("class")
                                    }
                                    if (ae.getAttribute("align")) {
                                        ai.align = ae.getAttribute("align")
                                    }
                                    var ah = {};
                                    var X = ae.getElementsByTagName("param");
                                    var ac = X.length;
                                    for (var ad = 0; ad < ac; ad++) {
                                        if (X[ad].getAttribute("name").toLowerCase() != "movie") {
                                            ah[X[ad].getAttribute("name")] = X[ad].getAttribute("value")
                                        }
                                    }
                                    P(ai, ah, Y, ab)
                                } else {
                                    p(ae);
                                    if (ab) {
                                        ab(aa)
                                    }
                                }
                            }
                        }
                    } else {
                        w(Y, true);
                        if (ab) {
                            var Z = z(Y);
                            if (Z && typeof Z.SetVariable != D) {
                                aa.success = true;
                                aa.ref = Z
                            }
                            ab(aa)
                        }
                    }
                }
            }
        }
        function z(aa) {
            var X = null;
            var Y = c(aa);
            if (Y && Y.nodeName == "OBJECT") {
                if (typeof Y.SetVariable != D) {
                    X = Y
                } else {
                    var Z = Y.getElementsByTagName(r)[0];
                    if (Z) {
                        X = Z
                    }
                }
            }
            return X
        }
        function A() {
            return !a && F("6.0.65") && (M.win || M.mac) && !(M.wk && M.wk < 312)
        }
        function P(aa, ab, X, Z) {
            a = true;
            E = Z || null;
            B = {
                success: false,
                id: X
            };
            var ae = c(X);
            if (ae) {
                if (ae.nodeName == "OBJECT") {
                    l = g(ae);
                    Q = null
                } else {
                    l = ae;
                    Q = X
                }
                aa.id = R;
                if (typeof aa.width == D || (!/%$/.test(aa.width) && parseInt(aa.width, 10) < 310)) {
                    aa.width = "310"
                }
                if (typeof aa.height == D || (!/%$/.test(aa.height) && parseInt(aa.height, 10) < 137)) {
                    aa.height = "137"
                }
                j.title = j.title.slice(0, 47) + " - Flash Player Installation";
                var ad = M.ie && M.win ? "ActiveX" : "PlugIn",
                    ac = "MMredirectURL=" + O.location.toString().replace(/&/g, "%26") + "&MMplayerType=" + ad + "&MMdoctitle=" + j.title;
                if (typeof ab.flashvars != D) {
                    ab.flashvars += "&" + ac
                } else {
                    ab.flashvars = ac
                }
                if (M.ie && M.win && ae.readyState != 4) {
                    var Y = C("div");
                    X += "SWFObjectNew";
                    Y.setAttribute("id", X);
                    ae.parentNode.insertBefore(Y, ae);
                    ae.style.display = "none";
                    (function () {
                        if (ae.readyState == 4) {
                            ae.parentNode.removeChild(ae)
                        } else {
                            setTimeout(arguments.callee, 10)
                        }
                    })()
                }
                u(aa, ab, X)
            }
        }
        function p(Y) {
            if (M.ie && M.win && Y.readyState != 4) {
                var X = C("div");
                Y.parentNode.insertBefore(X, Y);
                X.parentNode.replaceChild(g(Y), X);
                Y.style.display = "none";
                (function () {
                    if (Y.readyState == 4) {
                        Y.parentNode.removeChild(Y)
                    } else {
                        setTimeout(arguments.callee, 10)
                    }
                })()
            } else {
                Y.parentNode.replaceChild(g(Y), Y)
            }
        }
        function g(ab) {
            var aa = C("div");
            if (M.win && M.ie) {
                aa.innerHTML = ab.innerHTML
            } else {
                var Y = ab.getElementsByTagName(r)[0];
                if (Y) {
                    var ad = Y.childNodes;
                    if (ad) {
                        var X = ad.length;
                        for (var Z = 0; Z < X; Z++) {
                            if (!(ad[Z].nodeType == 1 && ad[Z].nodeName == "PARAM") && !(ad[Z].nodeType == 8)) {
                                aa.appendChild(ad[Z].cloneNode(true))
                            }
                        }
                    }
                }
            }
            return aa
        }
        function u(ai, ag, Y) {
            var X, aa = c(Y);
            if (M.wk && M.wk < 312) {
                return X
            }
            if (aa) {
                if (typeof ai.id == D) {
                    ai.id = Y
                }
                if (M.ie && M.win) {
                    var ah = "";
                    for (var ae in ai) {
                        if (ai[ae] != Object.prototype[ae]) {
                            if (ae.toLowerCase() == "data") {
                                ag.movie = ai[ae]
                            } else {
                                if (ae.toLowerCase() == "styleclass") {
                                    ah += ' class="' + ai[ae] + '"'
                                } else {
                                    if (ae.toLowerCase() != "classid") {
                                        ah += " " + ae + '="' + ai[ae] + '"'
                                    }
                                }
                            }
                        }
                    }
                    var af = "";
                    for (var ad in ag) {
                        if (ag[ad] != Object.prototype[ad]) {
                            af += '<param name="' + ad + '" value="' + ag[ad] + '" />'
                        }
                    }
                    aa.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + ah + ">" + af + "</object>";
                    N[N.length] = ai.id;
                    X = c(ai.id)
                } else {
                    var Z = C(r);
                    Z.setAttribute("type", q);
                    for (var ac in ai) {
                        if (ai[ac] != Object.prototype[ac]) {
                            if (ac.toLowerCase() == "styleclass") {
                                Z.setAttribute("class", ai[ac])
                            } else {
                                if (ac.toLowerCase() != "classid") {
                                    Z.setAttribute(ac, ai[ac])
                                }
                            }
                        }
                    }
                    for (var ab in ag) {
                        if (ag[ab] != Object.prototype[ab] && ab.toLowerCase() != "movie") {
                            e(Z, ab, ag[ab])
                        }
                    }
                    aa.parentNode.replaceChild(Z, aa);
                    X = Z
                }
            }
            return X
        }
        function e(Z, X, Y) {
            var aa = C("param");
            aa.setAttribute("name", X);
            aa.setAttribute("value", Y);
            Z.appendChild(aa)
        }
        function y(Y) {
            var X = c(Y);
            if (X && X.nodeName == "OBJECT") {
                if (M.ie && M.win) {
                    X.style.display = "none";
                    (function () {
                        if (X.readyState == 4) {
                            b(Y)
                        } else {
                            setTimeout(arguments.callee, 10)
                        }
                    })()
                } else {
                    X.parentNode.removeChild(X)
                }
            }
        }
        function b(Z) {
            var Y = c(Z);
            if (Y) {
                for (var X in Y) {
                    if (typeof Y[X] == "function") {
                        Y[X] = null
                    }
                }
                Y.parentNode.removeChild(Y)
            }
        }
        function c(Z) {
            var X = null;
            try {
                X = j.getElementById(Z)
            } catch (Y) {}
            return X
        }
        function C(X) {
            return j.createElement(X)
        }
        function i(Z, X, Y) {
            Z.attachEvent(X, Y);
            I[I.length] = [Z, X, Y]
        }
        function F(Z) {
            var Y = M.pv,
                X = Z.split(".");
            X[0] = parseInt(X[0], 10);
            X[1] = parseInt(X[1], 10) || 0;
            X[2] = parseInt(X[2], 10) || 0;
            return (Y[0] > X[0] || (Y[0] == X[0] && Y[1] > X[1]) || (Y[0] == X[0] && Y[1] == X[1] && Y[2] >= X[2])) ? true : false
        }
        function v(ac, Y, ad, ab) {
            if (M.ie && M.mac) {
                return
            }
            var aa = j.getElementsByTagName("head")[0];
            if (!aa) {
                return
            }
            var X = (ad && typeof ad == "string") ? ad : "screen";
            if (ab) {
                n = null;
                G = null
            }
            if (!n || G != X) {
                var Z = C("style");
                Z.setAttribute("type", "text/css");
                Z.setAttribute("media", X);
                n = aa.appendChild(Z);
                if (M.ie && M.win && typeof j.styleSheets != D && j.styleSheets.length > 0) {
                    n = j.styleSheets[j.styleSheets.length - 1]
                }
                G = X
            }
            if (M.ie && M.win) {
                if (n && typeof n.addRule == r) {
                    n.addRule(ac, Y)
                }
            } else {
                if (n && typeof j.createTextNode != D) {
                    n.appendChild(j.createTextNode(ac + " {" + Y + "}"))
                }
            }
        }
        function w(Z, X) {
            if (!m) {
                return
            }
            var Y = X ? "visible" : "hidden";
            if (J && c(Z)) {
                c(Z).style.visibility = Y
            } else {
                v("#" + Z, "visibility:" + Y)
            }
        }
        function L(Y) {
            var Z = /[\\\"<>\.;]/;
            var X = Z.exec(Y) != null;
            return X && typeof encodeURIComponent != D ? encodeURIComponent(Y) : Y
        }
        var d = function () {
                if (M.ie && M.win) {
                    window.attachEvent("onunload", function () {
                        var ac = I.length;
                        for (var ab = 0; ab < ac; ab++) {
                            I[ab][0].detachEvent(I[ab][1], I[ab][2])
                        }
                        var Z = N.length;
                        for (var aa = 0; aa < Z; aa++) {
                            y(N[aa])
                        }
                        for (var Y in M) {
                            M[Y] = null
                        }
                        M = null;
                        for (var X in swfobject) {
                            swfobject[X] = null
                        }
                        swfobject = null
                    })
                }
            }();
        return {
            registerObject: function (ab, X, aa, Z) {
                if (M.w3 && ab && X) {
                    var Y = {};
                    Y.id = ab;
                    Y.swfVersion = X;
                    Y.expressInstall = aa;
                    Y.callbackFn = Z;
                    o[o.length] = Y;
                    w(ab, false)
                } else {
                    if (Z) {
                        Z({
                            success: false,
                            id: ab
                        })
                    }
                }
            },
            getObjectById: function (X) {
                if (M.w3) {
                    return z(X)
                }
            },
            embedSWF: function (ab, ah, ae, ag, Y, aa, Z, ad, af, ac) {
                var X = {
                    success: false,
                    id: ah
                };
                if (M.w3 && !(M.wk && M.wk < 312) && ab && ah && ae && ag && Y) {
                    w(ah, false);
                    K(function () {
                        ae += "";
                        ag += "";
                        var aj = {};
                        if (af && typeof af === r) {
                            for (var al in af) {
                                aj[al] = af[al]
                            }
                        }
                        aj.data = ab;
                        aj.width = ae;
                        aj.height = ag;
                        var am = {};
                        if (ad && typeof ad === r) {
                            for (var ak in ad) {
                                am[ak] = ad[ak]
                            }
                        }
                        if (Z && typeof Z === r) {
                            for (var ai in Z) {
                                if (typeof am.flashvars != D) {
                                    am.flashvars += "&" + ai + "=" + Z[ai]
                                } else {
                                    am.flashvars = ai + "=" + Z[ai]
                                }
                            }
                        }
                        if (F(Y)) {
                            var an = u(aj, am, ah);
                            if (aj.id == ah) {
                                w(ah, true)
                            }
                            X.success = true;
                            X.ref = an
                        } else {
                            if (aa && A()) {
                                aj.data = aa;
                                P(aj, am, ah, ac);
                                return
                            } else {
                                w(ah, true)
                            }
                        }
                        if (ac) {
                            ac(X)
                        }
                    })
                } else {
                    if (ac) {
                        ac(X)
                    }
                }
            },
            switchOffAutoHideShow: function () {
                m = false
            },
            ua: M,
            getFlashPlayerVersion: function () {
                return {
                    major: M.pv[0],
                    minor: M.pv[1],
                    release: M.pv[2]
                }
            },
            hasFlashPlayerVersion: F,
            createSWF: function (Z, Y, X) {
                if (M.w3) {
                    return u(Z, Y, X)
                } else {
                    return undefined
                }
            },
            showExpressInstall: function (Z, aa, X, Y) {
                if (M.w3 && A()) {
                    P(Z, aa, X, Y)
                }
            },
            removeSWF: function (X) {
                if (M.w3) {
                    y(X)
                }
            },
            createCSS: function (aa, Z, Y, X) {
                if (M.w3) {
                    v(aa, Z, Y, X)
                }
            },
            addDomLoadEvent: K,
            addLoadEvent: s,
            getQueryParamValue: function (aa) {
                var Z = j.location.search || j.location.hash;
                if (Z) {
                    if (/\?/.test(Z)) {
                        Z = Z.split("?")[1]
                    }
                    if (aa == null) {
                        return L(Z)
                    }
                    var Y = Z.split("&");
                    for (var X = 0; X < Y.length; X++) {
                        if (Y[X].substring(0, Y[X].indexOf("=")) == aa) {
                            return L(Y[X].substring((Y[X].indexOf("=") + 1)))
                        }
                    }
                }
                return ""
            },
            expressInstallCallback: function () {
                if (a) {
                    var X = c(R);
                    if (X && l) {
                        X.parentNode.replaceChild(l, X);
                        if (Q) {
                            w(Q, true);
                            if (M.ie && M.win) {
                                l.style.display = "block"
                            }
                        }
                        if (E) {
                            E(B)
                        }
                    }
                    a = false
                }
            }
        }
    }();;
$(document).ready(function () {
	/*add by xavi*/
	$('a.loading').mouseover(function(){
		if($(this).hasClass('noCursor')) return;
		$(this).children('.common').addClass('hidden');
		$(this).children('.excerpt').removeClass('hidden');
	}).mouseout(function(){		
		if($(this).hasClass('noCursor')) return;
		$(this).children('.common').removeClass('hidden');
		$(this).children('.excerpt').addClass('hidden');
	})
	$('.project_class').each(function(){
		var c = $(this).html();
		//alert(c);
		$('a.'+c).lightBox();
	})
	$('a.lightBox').lightBox();
	/*add by xavi*/
	
    $('#sendForm').click(function () {
        var lang = $(this).attr('rel');
        var msg = '';
        var em = '';
        var fnr = 0;
        var fnme = '';
        var fid = '';
        var j = 0;
        var sel = false;
        $('form#formcontact *[rel=form]').each(function () {
            if ($(this).attr('alt') == 'Required' && $(this).val() == '' && fnme == '' && $(this).parent('div').parent('div').find('div').attr('alt') != 'E-mail') {
                fnr = j;
                if ($(this).get(0).tagName == 'SELECT') {
                    fnme = $(this).parent('div').parent('div').find('.label').attr('alt');
                    sel = true;
                } else {
                    fnme = $(this).parent('div').parent('div').find('div').attr('alt');
                    sel = false;
                }
                fid = $(this);
                return false;
            }
            if ($(this).parent('div').parent('div').find('div').attr('alt') == 'E-mail' && fnme == '') {
                if (!validMail($(this).val())) {
                    fnr = j;
                    fnme = $(this).parent('div').parent('div').find('div').attr('alt');
                    fid = $(this);
                    sel = false;
                    return false;
                }
            }
            j++;
        });
        if (fnme != '') {
            alert_form(fnr, fnme, fid, lang, sel);
        } else {
            $('form#formcontact').submit();
        }
    })
})

function alert_form2(msg) {
    var obj = $("#alertform");
    obj.html('<span id="af_close"></span><div><div id="alertformcontainer"><div><a href="javascript:void(0)" id="af_sluit">X sluit</a><span><p>' + msg + '<br /><br /><button id="alertformbutton" onmousedown="document.getElementById(\'alertform\').innerHTML = \'\';document.getElementById(\'alertform\').style.display = \'none\';">Ok</button></p></span></div></div></div>');
    $('#af_close, #af_sluit').click(function () {
        obj.empty();
        obj.css({
            "display": "none"
        });
    })
    $('#alertformcontainer').css({
        'margin': Math.round((obj.height() - $("#alertformcontainer").height()) / 2) + 'px 0px 0px 0px'
    })
    obj.css({
            "display": "block"
        });
}

function alert_form(fnr, fnme, fid, lang, sel) {
    var obj = $("#alertform");
    obj.css({
        'display': 'block'
    });
    if (lang == "nl") {
        var comment = "Sommige velden in dit formulier zijn verplicht in te vullen. Gelieve hier <strong>uw " + fnme.toLowerCase() + "</strong> in te vullen.";
        var emcomment = "Gelieve uw e-mail adres correct in te vullen. Indien dit niet zo is, kunt u uw bericht niet versturen.";
    } else if (lang == "fr") {
        var comment = "Entrez votre " + fnme.toLowerCase() + ", s'il vous plaît.";
        var emcomment = "Gelieve uw e-mail adres correct in te vullen. Indien dit niet zo is, kunt u uw bericht niet versturen.";
    } else if (lang == "en") {
        var comment = "Please enter your " + fnme.toLowerCase() + ".";
        var emcomment = "Gelieve uw e-mail adres correct in te vullen. Indien dit niet zo is, kunt u uw bericht niet versturen.";
    } else if (lang == "es") {
        var comment = "Por favor, ingrese su " + fnme.toLowerCase() + ".";
        var emcomment = "Gelieve uw e-mail adres correct in te vullen. Indien dit niet zo is, kunt u uw bericht niet versturen.";
    } else if (lang == "pl") {
        var comment = "Proszę podać swoje " + fnme.toLowerCase() + ".";
        var emcomment = "Gelieve uw e-mail adres correct in te vullen. Indien dit niet zo is, kunt u uw bericht niet versturen.";
    } else if (lang == "cz") {
        var comment = "Prosím, zadejte své " + fnme.toLowerCase() + ".";
        var emcomment = "Gelieve uw e-mail adres correct in te vullen. Indien dit niet zo is, kunt u uw bericht niet versturen.";
    } else if (lang == "it") {
        var comment = "Inserisci il tuo " + fnme.toLowerCase() + ".";
        var emcomment = "Gelieve uw e-mail adres correct in te vullen. Indien dit niet zo is, kunt u uw bericht niet versturen.";
    } else if (lang == "de") {
        var comment = "Bitte geben Sie Ihre " + fnme.toLowerCase() + ".";
        var emcomment = "Gelieve uw e-mail adres correct in te vullen. Indien dit niet zo is, kunt u uw bericht niet versturen.";
    } else if (lang == "ru") {
        var comment = "Пожалуйста, укажите ваш  " + fnme.toLowerCase() + ".";
        var emcomment = "Пожалуйста, укажите ваш адрес е-майл. В противном случае вы не сможете послать сообщение.";
    }
    if (fnme == "E-mail") {
        comment = comment + '<br /><br />' + emcomment;
    }
    if (!sel) {
        var inputField = '<input type="text" value="' + fid.val() + '" id="alertformfield" />';
    } else {
        var inputField = '';
    }
    obj.html('<span id="af_close"></span><div><div id="alertformcontainer"><div><a href="javascript:void(0)" id="af_sluit">X sluit</a><span><p>' + comment + '<br /><br />' + inputField + ' <button id="alertformbutton" onmousedown="javascript:af_setfield(' + fnr + ');document.getElementById(\'alertform\').innerHTML = \'\';document.getElementById(\'alertform\').style.display = \'none\';">Ok</button></p></span></div></div></div>');
    $('#af_close, #af_sluit').click(function () {
        obj.empty();
        obj.css({
            "display": "none"
        });
    })
    $('#alertformcontainer').css({
        'margin': Math.round((obj.height() - $("#alertformcontainer").height()) / 2) + 'px 0px 0px 0px'
    })
}

function af_sent(lang) {
    var obj = $("#alertform");
    obj.css({
        'display': 'block'
    })
    if (lang == "nl") {
        var comment = "Uw e-mail werd succesvol verzonden.";
    } else if (lang == "fr") {
        var comment = "Votre adresse e-mail a été envoyé.";
    } else if (lang == "en") {
        var comment = "Your e-mail has succesfully been delivered.";
    } else if (lang == "es") {
        var comment = "Tu e-mail se ha enviado correctamente.";
    } else if (lang == "pl") {
        var comment = "Twój e-mail została pomyślnie dostarczona.";
    } else if (lang == "cz") {
        var comment = "Váš e-mail byl úspěšně doručen.";
    } else if (lang == "it") {
        var comment = "Il tuo indirizzo email è stato consegnato con successo.";
    } else if (lang == "de") {
        var comment = "Ihre E-Mail wurde erfolgreich ausgeliefert.";
    } else if (lang == "ru") {
        var comment = "Ваш адрес е-майл успешно доставлен.";
    }
    obj.html('<span id="af_close"></span><div><div id="alertformcontainer"><div><a href="javascript:void(0)" id="af_sluit">X sluit</a><span><p>' + comment + '<button id="alertformbutton" onmousedown="document.getElementById(\'alertform\').innerHTML = \'\';document.getElementById(\'alertform\').style.display = \'none\';">Ok</button></p></span></div></div></div>');
    $('#af_close, #af_sluit').click(function () {
        $("#alertform").empty();
        $("#alertform").css({
            "display": "none"
        });
    })
    $("#alertformcontainer").css({
        'margin': Math.round((obj.height() - $("#alertformcontainer").height()) / 2) + 'px 0px 0px 0px'
    })
}

function af_setfield(fnr) {
    var val = $('#alertformfield').val();
    $('form#formcontact *[rel=form]').each(function () {
        $(this).removeClass("alertform_border");
    })
    $('form#formcontact *[rel=form]:eq(' + fnr + ')').addClass("alertform_border");
    $('form#formcontact *[rel=form]:eq(' + fnr + ')').val(val);
}

function validMail(str) {
    var at = "@";
    var dot = ".";
    var lat = str.indexOf(at);
    var lstr = str.length;
    var ldot = str.indexOf(dot);
    if (str.indexOf(at) == -1) {
        return false;
    }
    if (str.indexOf(at) == -1 || str.indexOf(at) == 0 || str.indexOf(at) == lstr) {
        return false;
    }
    if (str.indexOf(dot) == -1 || str.indexOf(dot) == 0 || str.indexOf(dot) == lstr) {
        return false;
    }
    if (str.indexOf(at, (lat + 1)) != -1) {
        return false;
    }
    if (str.substring(lat - 1, lat) == dot || str.substring(lat + 1, lat + 2) == dot) {
        return false;
    }
    if (str.indexOf(dot, (lat + 2)) == -1) {
        return false;
    }
    if (str.indexOf(" ") != -1) {
        return false;
    }
    return true;
};
var country_arr;

function loadDealerModule(id, countrylist, extra, cnt) {
    var object = document.getElementById(id);
    object.innerHTML = '<div id="world"></div>';
//    $.ajax({
//        type: 'POST',
//        url: 'ajax.php?lang=' + $('html').attr('lang'),
//        data: {
//            m: 'GETCOUNTRYARR'
//        },
//        success: function (data) {
//            var output = data;
//            country_arr = output.split(',');
//            var lang = $('html').attr('lang');
//            var flashvars = {
//                file: "ajax.php?m=GETCOUNTRIES",
//                countryList: countrylist,
//                cntry: extra,
//                cnt: cnt,
//                language: lang
//            };
//            var params = {
//                wmode: "transparent",
//                allowScriptAccess: "always"
//            };
//            swfobject.embedSWF("swf/world.swf", "world", "100%", "100%", "9.0.0", "swf/expressInstall.swf", flashvars, params);
//        }
//    })

        var lang = $('html').attr('lang');
        var flashvars = {
            file: "ajax.php?m=GETCOUNTRIES",
            countryList: countrylist,
            cntry: extra,
            cnt: cnt,
            language: lang
        };
        var params = {
            wmode: "transparent",
            allowScriptAccess: "always"
        };
        swfobject.embedSWF("swf/china.swf", "world", "100%", "100%", "9.0.0", "swf/expressInstall.swf", flashvars, params);
        
}

function loadWorld(id) {
    var fla = document.getElementById('world');
    fla.loadWorldJS();
    clearCountryList();
}

function loadContinent(id) {
    var fla = document.getElementById('world');
    fla.loadContinentJS(id);
    clearCountryList();
}

function loadCountry(id) {
    var fla = document.getElementById('world');
    fla.loadCountryJS(id);
}

function loadProvince(id) {    
    var fla = document.getElementById('world');
    fla.loadProvinceJS(id);
}

function setContinentList(id) {
    if (id >= 0) {
        $('#dealernavcontinents li a').css({
            'color': '#fff'
        });
        $('#dealernavcontinents li:eq(' + id + ') a').css({
            'color': '#8E181B'
        });
        $('#dealernavworld li a').css({
            'color': '#fff'
        });
    } else {
        $('#dealernavcontinents li a').css({
            'color': '#fff'
        });
        $('#dealernavworld li a').css({
            'color': '#8E181B'
        });
    }
}

function setCountryList(id) {
    $('#dealernavcountries ul.minicol li a').css({
        'color': '#fff'
    });
    $('#dealernavcountries ul.minicol li:eq(' + id + ') a').css({
        'color': '#8E181B'
    });
}

function loadCountryList(arr) {
    var posArr = arr.split(',');
    var newArr = new Array();
    for (i = 0; i < posArr.length; i++) {
        var position = posArr[i];
        newArr[i] = country_arr[position];
    }
    var obj = document.getElementById("dealernavcountries");
    var temp = newArr;
    var html = "<ul class='minicol'>";
    for (i = 0; i < temp.length; i++) {
        html += "<li><a href='javascript:loadCountry(" + i + ");' title='show " + temp[i] + "'>" + temp[i] + "</a></li>";
    }
    html += "</ul>";
    obj.innerHTML = html;
}

function clearCountryList() {
    var obj = document.getElementById("dealernavcountries");
    obj.innerHTML = "";
}

function setDealers(province, area) {
	
    $('#dealernav ul li a').removeClass('actived');
    $('#dealernav ul li a.'+province).addClass('actived');
    
    
    $('#dealers .contactDealer').unbind('click');
    hidePostalCode();
    $('#dealers').html('');
    $.ajax({
        type: 'POST',
        url: 'ajax.php?lang=' + $('html').attr('lang'),
        data: {
            m: 'INTERDEALERS',
            province: province
        },
        success: function (data) {
            $('#dealers').html(data);
            $('#dealers .contactDealer').click(function () {
                var dealerEmail = $(this).attr('rel');
                openPopUp(dealerEmail);
            })
        }
    })
}
//function setDealers(country, area) {
//	
//    $('#dealernav ul li a').removeClass('actived');
//    $('#dealernav ul li a.'+country).addClass('actived');
//    
//    
//    $('#dealers .contactDealer').unbind('click');
//    hidePostalCode();
//    $('#dealers').html('');
//    $.ajax({
//        type: 'POST',
//        url: 'ajax.php?lang=' + $('html').attr('lang'),
//        data: {
//            m: 'INTERDEALERS',
//            country: country_arr[country],
//            area: area
//        },
//        success: function (data) {
//            $('#dealers').html(data);
//            $('#dealers .contactDealer').click(function () {
//                var dealerEmail = $(this).attr('rel');
//                openPopUp(dealerEmail);
//            })
//        }
//    })
//}

function loadPostalCode(c) {
    $('#dealers').html('');
    var obj = $("#dealerpostal");
    obj.attr('rel', c);
    obj.show();
}

function hidePostalCode() {
    var obj = $("#dealerpostal");
    obj.hide();
}

function getDealerByPostalCode(c, postcode) {
    $.ajax({
        type: 'POST',
        url: 'ajax.php?lang=' + $('html').attr('lang'),
        data: {
            m: 'DEALERS',
            country: c,
            postcode: postcode
        },
        success: function (data) {
            $('#dealers').html(data);
            $('#dealers .contactDealer').click(function () {
                var dealerEmail = $(this).attr('rel');
                openPopUp(dealerEmail);
            })
        }
    })
}

function getDefaultDealer(c) {
    switch ($('html').attr('lang')) {
    case 'nl':
        var cont = 'Contacteer deze dealer';
        break;
    case 'en':
        var cont = 'Contact this dealer';
        break;
    case 'fr':
        var cont = 'Prend contact avec cet distributeur';
        break;
    default:
        var cont = 'Contact this dealer';
        break;
    }
    switch (c) {
    case 'asia':
        var data = '<div class="default"><h1>Lamett</h1><p><a class="contactDealer" href="javascript:void(0)" rel="asia@lamett.com">' + cont + '</a><br /><a href="http://www.lamett.com" target="_blank">www.lamett.com</a></p></div>';
        break
    case 'europe':
        var data = '<div class="default"><h1>Lamett Europe</h1><p>Ter Donkt 2<br />8540 Deerlijk, Belgium<br /><br />T: +32 056 774 515<br />F: +32 056 775 995</div>';
        break
    case 'africa':
        var data = '<div class="default"><h1>Lamett</h1><p><a class="contactDealer" href="javascript:void(0)" rel="africa@lamett.com">' + cont + '</a><br /><a href="http://www.lamett.com" target="_blank">www.lamett.com</a></p></div>';
        break
    case 'namerica':
        var data = '<div class="default"><h1>Lamett America</h1><p>4579 Cabinwood Turn<br />30135 Douglasville, Georgia , USA<br /><br />T: (770) 489-2419<br />F: (770) 489-1934</p></div>';
        break
    case 'samerica':
        var data = '<div class="default"><h1>Lamett America</h1><p>4579 Cabinwood Turn<br />30135 Douglasville, Georgia , USA<br /><br />T: (770) 489-2419<br />F: (770) 489-1934</p></div>';
        break
    case 'oceania':
        var data = '<div class="default"><h1>Lamett</h1><p><a class="contactDealer" href="javascript:void(0)" rel="asia@lamett.com">' + cont + '</a><br /><a href="http://www.lamett.com" target="_blank">www.lamett.com</a></p></div>';
        break
    }
    hidePostalCode();
    $('#dealers').html(data);
    $('#dealers .contactDealer').click(function () {
        var dealerEmail = $(this).attr('rel');
        openPopUp(dealerEmail);
    })
}

function openPopUp(e) {
    $('#contactDealerClose').unbind('click');
    $('#contactDealerWrapper, #contactDealer').show();
    $('#emailDealer1, #emailDealer').val(e);
    $('#contactDealerClose').click(function () {
        $('#contactDealerWrapper, #contactDealer').hide();
    })
};
var v = "";
var selectedFloor = "";
$(document).ready(function () {
    embedSWF();
    var animating = false;
    var lang = $('meta:first').attr('lang');
    var currentRoom = 1;
    $('a[rel=external]').click(function () {
        this.target = "_blank";
    });
//    $('#menu,#mainmenu').append('<li class="sprite last"></li>');
//    if ($('#loginform').length == 0) {
//        $('#menu li:last').html('<a id="logout" href="./logout">登出</span>');
//    } else {
//        $('#menu li:last').html('<span id="login">登录</span>');
//    }
    $('#langmenu li:last a, #bottomMenu li:last').css('border', 'none');
    $('#lang').hover(function () {
        $('#langmenu').slideDown('fast');
    })
    $('.orderList:even').addClass('striped');
    $('html, body').click(function () {
        $('#loginform').slideUp('fast');
        $('#langmenu').slideUp('fast');
    })
    $('#loginform, #langmenu').click(function (event) {
        event.stopPropagation();
    });
    $('#login').click(function (event) {
        event.stopPropagation();
        $('#login_type').val('dealer');
        $('#loginform').css('right','5px');
        $('#loginform').slideToggle('fast');
    })
    $('#project').click(function (event) {
        event.stopPropagation();
        $('#login_type').val('project');
        $('#loginform').css('right','300px');
        $('#loginform').slideToggle('fast');
    })
    $('#project_footer').click(function (event) {
        event.stopPropagation();
        $('#login_type').val('project');
        $('#loginform').css('right','300px');
        $('#loginform').slideToggle('fast');
    })
    $('#langmenu li').hover(function () {
        $(this).addClass('active');
    }, function () {
        $(this).removeClass('active');
    })
    $('#pages ul li:last a, #pages ul li:last span').css('border', 'none');
    $(document).pngFix();
    $('p.readMore').bind('click', function () {
        $(this).hide();
        $(this).parent('.newsText').find('.moreInfo').slideDown('fast', function () {
            $(this).css('display', 'inline');
        });
    })
    $('p.closeMore').bind('click', function () {
        $(this).parent('div.moreInfo').hide('fast', function () {
            $(this).css('display', 'none');
        });
        $(this).parent('div.moreInfo').parent('.newsText').find('p.readMore').slideDown('fast');
    })
    $('a.loading').hover(function () {
        $(this).find('.a').css('background', '#65822c');
        $(this).find('.ext').show('fast');
    }, function () {
        $(this).find('.a').css('background', '#8e181b');
        $(this).find('.ext').hide('fast');
    });
    $('#floorType').bind('change', function () {
        var floorType = $(this).val();
        if (floorType == 'all') {
            $('#collection option').removeAttr('disabled');
        } else {
            $.getJSON('ajax.php', {
                m: 'findFloor',
                change: 'floorType',
                floorType: floorType,
                lang: $('html').attr('lang')
            }, function (data) {
                $('#collection option').attr('disabled', 'disabled');
                for (i = 0; i < data.length; i++) {
                    $('#collection option[value=' + data[i].ID + ']').removeAttr('disabled');
                }
            })
        }
    })
    $('#controls [name=cboVloeren]').change(changeFloor);
    $('#next').click(function () {
        if ($('#rooms').is(':animated')) {} else {
            document['swfHolder'].sendToActionScript4();
         //   if (currentRoom == 5) {
            if (currentRoom == 3) {
                $('#rooms').animate({
                    top: '0px'
                }, 1000, function () {
                    currentRoom = 1;
                    document['swfHolder'].sendToActionScript2(currentRoom);
                });
            } else {
                $('#rooms').animate({
                    top: '-=98'
                }, 1000, function () {
                    currentRoom++;
                    document['swfHolder'].sendToActionScript2(currentRoom);
                });
            }
        }
    });
    $('#prev').click(function () {
        if ($('#rooms').is(':animated')) {} else {
            document['swfHolder'].sendToActionScript4();
            if (currentRoom == 1) {
                $('#rooms').animate({
                    //top: '-392'
                    top: '-196'
                }, 1000, function () {
                    currentRoom = 3;
                    //currentRoom = 5;
                    document['swfHolder'].sendToActionScript2(currentRoom);
                });
            } else {
                $('#rooms').animate({
                    top: '+=98'
                }, 1000, function () {
                    currentRoom--;
                    document['swfHolder'].sendToActionScript2(currentRoom);
                });
            }
        }
    });
    $('.wrapper #colors a').click(function () {
        $('.wrapper #colors a').removeAttr('class');
        $(this).addClass('active');
        document['swfHolder'].sendToActionScript3($(this).attr('rel'));
    });
    $('#print').click(function () {
        var chosenFloor = '';
        if ($('html').attr('lang') == 'nl') {
            chosenFloor = "Geselecteerde vloer: \r" + $('#vloeren option:selected').text() + " - " + selectedFloor;
        }
        if ($('html').attr('lang') == 'fr') {
            chosenFloor = "Le sol choisi \r: " + $('#vloeren option:selected').text() + " - " + selectedFloor;
        }
        if ($('html').attr('lang') == 'en') {
            chosenFloor = "Chosen floor: \r" + $('#vloeren option:selected').text() + " - " + selectedFloor;
        }
        if ($('html').attr('lang') == 'es') {
            chosenFloor = "Suelo seleccionado: \r" + $('#vloeren option:selected').text() + " - " + selectedFloor;
        }
        if ($('html').attr('lang') == 'pl') {
            chosenFloor = "Wybrane pietro: \r" + $('#vloeren option:selected').text() + " - " + selectedFloor;
        }
        if ($('html').attr('lang') == 'cz') {
            chosenFloor = "Vybrané patro: \r" + $('#vloeren option:selected').text() + " - " + selectedFloor;
        }
        if ($('html').attr('lang') == 'it') {
            chosenFloor = "Selezionato pavimento: \r" + $('#vloeren option:selected').text() + " - " + selectedFloor;
        }
        if ($('html').attr('lang') == 'de') {
            chosenFloor = "Ausgewählte Fußboden: \r" + $('#vloeren option:selected').text() + " - " + selectedFloor;
        }
        if ($('html').attr('lang') == 'ru') {
            chosenFloor = "Выбранный пол : \r" + $('#vloeren option:selected').text() + " - " + selectedFloor;
        }
        document['swfHolder'].sendToActionScript5(chosenFloor);
    })
    if ($('#dealermap').length > 0) {
        loadDealerModule('dealermap', 1, '', '');
    }
    $('#dealersend').bind('click', function () {
        var c = $(this).parent('div').parent('div').parent('div').parent('div').attr('rel');
        getDealerByPostalCode(c, $('#postalCode').val())
    })
    $('a.vid').click(function () {
        var vid = $(this).attr('rel');
        $.fancybox({
            'type': 'swf',
            'overlayOpacity': 0.5,
            'overlayColor': '#000',
            'width': 620,
            'height': 480,
            'hideOnContentClick': false,
            'onClose': function () {
                $("#video_content").remove();
            },
            'onComplete': function () {
                $("#fancybox-content").html('<div id="video_content"></div>');
                loadVideo("video_content", vid);
            }
        })
    })
    $('select.amount').change(function () {
        var orderID = $(this).attr('rel');
        var amount = $(this).val();
        $.ajax({
            type: 'POST',
            url: 'ajax.php?lang=' + $('html').attr('lang'),
            data: {
                m: 'CHANGEAMOUNT',
                orderID: orderID,
                amount: amount
            },
            success: function (data) {
                location.reload(true)
            }
        })
    })
    $('#countrySelect').change(function () {
        var country = $(this).val();
        $.ajax({
            type: 'POST',
            url: 'ajax.php?lang=' + $('html').attr('lang'),
            data: {
                m: 'CHANGETRANSPORT',
                country: country
            },
            success: function (data) {
                location.reload(true)
            }
        })
    })
    $('#addMaintenance').click(function () {
        var maintID = $('#orderMaint').val();
        var amount = $('#maintAmount').val();
        $.ajax({
            type: 'POST',
            url: 'ajax.php?lang=' + $('html').attr('lang'),
            data: {
                m: 'ADDMAINT',
                maintID: maintID,
                amount: amount
            },
            success: function (data) {
                location.reload(true)
            }
        });
    });
    $('#addSample').click(function () {
        var sampleID = $('#orderSample').val();
        var amount = $('#sampleAmount').val();
        $.ajax({
            type: 'POST',
            url: 'ajax.php?lang=' + $('html').attr('lang'),
            data: {
                m: 'ADDSAMPLE',
                sampleID: sampleID,
                amount: amount
            },
            success: function (data) {
                location.reload(true)
            }
        });
    });
    $('#deleteAll').click(function () {
        $.ajax({
            type: 'POST',
            url: 'ajax.php?lang=' + $('html').attr('lang'),
            data: {
                m: 'REMOVEORDERING'
            },
            success: function (data) {
                location.reload(true)
            }
        });
    });
});

function loadVideo(id, flv) {
    var rnd = Math.floor(Math.random() * 9999);
    var params = {
        wmode: "transparent"
    };
    var flashvars = {
        flvurl: flv,
        skinurl: "swf/ClearOverPlaySeekMute.swf"
    };
    swfobject.embedSWF("swf/video.swf?" + rnd, id, "100%", "100%", "9.0.0", "swf/expressInstall.swf", flashvars, params);
}

function changeColor() {
    var kleur = $('.wrapper #colors a.active').attr('rel');
    document['swfHolder'].sendToActionScript3(kleur);
}

function currentFloor() {
    if (v != "") {
        document['swfHolder'].sendToActionScript(v);
    } else {
        v = "Louvre-Cotton-Nat.-White.jpg";
        document['swfHolder'].sendToActionScript(v);
    }
}

function changeFloor() {
    var vloer = $('#controls [name=cboVloeren]').val();
    $('#vloerthumbs').empty();
    
    $.get('ajax.php?lang=' + $('html').attr('lang'), {
        m: 'getRefs',
        id: vloer
    }, function (data) {
    	data = eval(data);
        for (i = 0; i < data.length; i++) {
            $('#vloerthumbs').append('<a class="vloerthumb" href="javascript:void(0)"><img height="25" width="25" src="files/products/' + data[i].img + '" title="' + data[i].name + '" alt="' + data[i].name + '"></a>');
        }
        $('.vloerthumb').click(function () {
            $('.vloerthumb img').css({
                'border': '0px solid #fff',
                'width': '25px',
                'height': '25px'
            });
            $(this).find('img').css({
                'border': '3px solid #fff',
                'width': '19px',
                'height': '19px'
            });
            changeSelectedFloor($(this).find('img').attr('title'));
            var vloer = $(this).find('img').attr('src');
            arr = vloer.split('/');
            v = arr.pop();
            document['swfHolder'].sendToActionScript4();
            document['swfHolder'].sendToActionScript(v);
        });
    })
}

function changeSelectedFloor(naam) {
    var n = naam;
    if ($('#selectedFloor').children().size() > 0) {
        $('#selectedFloor').empty();
    }
    $('#selectedFloor').append('<p>' + $('#vloeren option:selected').text() + ' - ' + n + '</p>');
    selectedFloor = naam;
}

function embedSWF() {
    var flashvars = {};
    var params = {
        wmode: "opaque",
        menu: "false"
    };
    var attributes = {};
    swfobject.embedSWF("swf/roomplanner.swf", "swfHolder", "790px", "590px", "9.0.0", "swf/expressInstall.swf", flashvars, params, attributes);
}
