// remap jQuery to $
(function ($) {

    //Começa jQuery Cycle
    (function ($) { var ver = "2.88"; if ($.support == undefined) { $.support = { opacity: !($.browser.msie) }; } function debug(s) { if ($.fn.cycle.debug) { log(s); } } function log() { if (window.console && window.console.log) { window.console.log("[cycle] " + Array.prototype.join.call(arguments, " ")); } } $.fn.cycle = function (options, arg2) { var o = { s: this.selector, c: this.context }; if (this.length === 0 && options != "stop") { if (!$.isReady && o.s) { log("DOM not ready, queuing slideshow"); $(function () { $(o.s, o.c).cycle(options, arg2); }); return this; } log("terminating; zero elements found by selector" + ($.isReady ? "" : " (DOM not ready)")); return this; } return this.each(function () { var opts = handleArguments(this, options, arg2); if (opts === false) { return; } opts.updateActivePagerLink = opts.updateActivePagerLink || $.fn.cycle.updateActivePagerLink; if (this.cycleTimeout) { clearTimeout(this.cycleTimeout); } this.cycleTimeout = this.cyclePause = 0; var $cont = $(this); var $slides = opts.slideExpr ? $(opts.slideExpr, this) : $cont.children(); var els = $slides.get(); if (els.length < 2) { log("terminating; too few slides: " + els.length); return; } var opts2 = buildOptions($cont, $slides, els, opts, o); if (opts2 === false) { return; } var startTime = opts2.continuous ? 10 : getTimeout(els[opts2.currSlide], els[opts2.nextSlide], opts2, !opts2.rev); if (startTime) { startTime += (opts2.delay || 0); if (startTime < 10) { startTime = 10; } debug("first timeout: " + startTime); this.cycleTimeout = setTimeout(function () { go(els, opts2, 0, (!opts2.rev && !opts.backwards)); }, startTime); } }); }; function handleArguments(cont, options, arg2) { if (cont.cycleStop == undefined) { cont.cycleStop = 0; } if (options === undefined || options === null) { options = {}; } if (options.constructor == String) { switch (options) { case "destroy": case "stop": var opts = $(cont).data("cycle.opts"); if (!opts) { return false; } cont.cycleStop++; if (cont.cycleTimeout) { clearTimeout(cont.cycleTimeout); } cont.cycleTimeout = 0; $(cont).removeData("cycle.opts"); if (options == "destroy") { destroy(opts); } return false; case "toggle": cont.cyclePause = (cont.cyclePause === 1) ? 0 : 1; checkInstantResume(cont.cyclePause, arg2, cont); return false; case "pause": cont.cyclePause = 1; return false; case "resume": cont.cyclePause = 0; checkInstantResume(false, arg2, cont); return false; case "prev": case "next": var opts = $(cont).data("cycle.opts"); if (!opts) { log('options not found, "prev/next" ignored'); return false; } $.fn.cycle[options](opts); return false; default: options = { fx: options }; } return options; } else { if (options.constructor == Number) { var num = options; options = $(cont).data("cycle.opts"); if (!options) { log("options not found, can not advance slide"); return false; } if (num < 0 || num >= options.elements.length) { log("invalid slide index: " + num); return false; } options.nextSlide = num; if (cont.cycleTimeout) { clearTimeout(cont.cycleTimeout); cont.cycleTimeout = 0; } if (typeof arg2 == "string") { options.oneTimeFx = arg2; } go(options.elements, options, 1, num >= options.currSlide); return false; } } return options; function checkInstantResume(isPaused, arg2, cont) { if (!isPaused && arg2 === true) { var options = $(cont).data("cycle.opts"); if (!options) { log("options not found, can not resume"); return false; } if (cont.cycleTimeout) { clearTimeout(cont.cycleTimeout); cont.cycleTimeout = 0; } go(options.elements, options, 1, (!opts.rev && !opts.backwards)); } } } function removeFilter(el, opts) { if (!$.support.opacity && opts.cleartype && el.style.filter) { try { el.style.removeAttribute("filter"); } catch (smother) { } } } function destroy(opts) { if (opts.next) { $(opts.next).unbind(opts.prevNextEvent); } if (opts.prev) { $(opts.prev).unbind(opts.prevNextEvent); } if (opts.pager || opts.pagerAnchorBuilder) { $.each(opts.pagerAnchors || [], function () { this.unbind().remove(); }); } opts.pagerAnchors = null; if (opts.destroy) { opts.destroy(opts); } } function buildOptions($cont, $slides, els, options, o) { var opts = $.extend({}, $.fn.cycle.defaults, options || {}, $.metadata ? $cont.metadata() : $.meta ? $cont.data() : {}); if (opts.autostop) { opts.countdown = opts.autostopCount || els.length; } var cont = $cont[0]; $cont.data("cycle.opts", opts); opts.$cont = $cont; opts.stopCount = cont.cycleStop; opts.elements = els; opts.before = opts.before ? [opts.before] : []; opts.after = opts.after ? [opts.after] : []; opts.after.unshift(function () { opts.busy = 0; }); if (!$.support.opacity && opts.cleartype) { opts.after.push(function () { removeFilter(this, opts); }); } if (opts.continuous) { opts.after.push(function () { go(els, opts, 0, (!opts.rev && !opts.backwards)); }); } saveOriginalOpts(opts); if (!$.support.opacity && opts.cleartype && !opts.cleartypeNoBg) { clearTypeFix($slides); } if ($cont.css("position") == "static") { $cont.css("position", "relative"); } if (opts.width) { $cont.width(opts.width); } if (opts.height && opts.height != "auto") { $cont.height(opts.height); } if (opts.startingSlide) { opts.startingSlide = parseInt(opts.startingSlide); } else { if (opts.backwards) { opts.startingSlide = els.length - 1; } } if (opts.random) { opts.randomMap = []; for (var i = 0; i < els.length; i++) { opts.randomMap.push(i); } opts.randomMap.sort(function (a, b) { return Math.random() - 0.5; }); opts.randomIndex = 1; opts.startingSlide = opts.randomMap[1]; } else { if (opts.startingSlide >= els.length) { opts.startingSlide = 0; } } opts.currSlide = opts.startingSlide || 0; var first = opts.startingSlide; $slides.css({ position: "absolute", top: 0, left: 0 }).hide().each(function (i) { var z; if (opts.backwards) { z = first ? i <= first ? els.length + (i - first) : first - i : els.length - i; } else { z = first ? i >= first ? els.length - (i - first) : first - i : els.length - i; } $(this).css("z-index", z); }); $(els[first]).css("opacity", 1).show(); removeFilter(els[first], opts); if (opts.fit && opts.width) { $slides.width(opts.width); } if (opts.fit && opts.height && opts.height != "auto") { $slides.height(opts.height); } var reshape = opts.containerResize && !$cont.innerHeight(); if (reshape) { var maxw = 0, maxh = 0; for (var j = 0; j < els.length; j++) { var $e = $(els[j]), e = $e[0], w = $e.outerWidth(), h = $e.outerHeight(); if (!w) { w = e.offsetWidth || e.width || $e.attr("width"); } if (!h) { h = e.offsetHeight || e.height || $e.attr("height"); } maxw = w > maxw ? w : maxw; maxh = h > maxh ? h : maxh; } if (maxw > 0 && maxh > 0) { $cont.css({ width: maxw + "px", height: maxh + "px" }); } } if (opts.pause) { $cont.hover(function () { this.cyclePause++; }, function () { this.cyclePause--; }); } if (supportMultiTransitions(opts) === false) { return false; } var requeue = false; options.requeueAttempts = options.requeueAttempts || 0; $slides.each(function () { var $el = $(this); this.cycleH = (opts.fit && opts.height) ? opts.height : ($el.height() || this.offsetHeight || this.height || $el.attr("height") || 0); this.cycleW = (opts.fit && opts.width) ? opts.width : ($el.width() || this.offsetWidth || this.width || $el.attr("width") || 0); if ($el.is("img")) { var loadingIE = ($.browser.msie && this.cycleW == 28 && this.cycleH == 30 && !this.complete); var loadingFF = ($.browser.mozilla && this.cycleW == 34 && this.cycleH == 19 && !this.complete); var loadingOp = ($.browser.opera && ((this.cycleW == 42 && this.cycleH == 19) || (this.cycleW == 37 && this.cycleH == 17)) && !this.complete); var loadingOther = (this.cycleH == 0 && this.cycleW == 0 && !this.complete); if (loadingIE || loadingFF || loadingOp || loadingOther) { if (o.s && opts.requeueOnImageNotLoaded && ++options.requeueAttempts < 100) { log(options.requeueAttempts, " - img slide not loaded, requeuing slideshow: ", this.src, this.cycleW, this.cycleH); setTimeout(function () { $(o.s, o.c).cycle(options); }, opts.requeueTimeout); requeue = true; return false; } else { log("could not determine size of image: " + this.src, this.cycleW, this.cycleH); } } } return true; }); if (requeue) { return false; } opts.cssBefore = opts.cssBefore || {}; opts.animIn = opts.animIn || {}; opts.animOut = opts.animOut || {}; $slides.not(":eq(" + first + ")").css(opts.cssBefore); if (opts.cssFirst) { $($slides[first]).css(opts.cssFirst); } if (opts.timeout) { opts.timeout = parseInt(opts.timeout); if (opts.speed.constructor == String) { opts.speed = $.fx.speeds[opts.speed] || parseInt(opts.speed); } if (!opts.sync) { opts.speed = opts.speed / 2; } var buffer = opts.fx == "shuffle" ? 500 : 250; while ((opts.timeout - opts.speed) < buffer) { opts.timeout += opts.speed; } } if (opts.easing) { opts.easeIn = opts.easeOut = opts.easing; } if (!opts.speedIn) { opts.speedIn = opts.speed; } if (!opts.speedOut) { opts.speedOut = opts.speed; } opts.slideCount = els.length; opts.currSlide = opts.lastSlide = first; if (opts.random) { if (++opts.randomIndex == els.length) { opts.randomIndex = 0; } opts.nextSlide = opts.randomMap[opts.randomIndex]; } else { if (opts.backwards) { opts.nextSlide = opts.startingSlide == 0 ? (els.length - 1) : opts.startingSlide - 1; } else { opts.nextSlide = opts.startingSlide >= (els.length - 1) ? 0 : opts.startingSlide + 1; } } if (!opts.multiFx) { var init = $.fn.cycle.transitions[opts.fx]; if ($.isFunction(init)) { init($cont, $slides, opts); } else { if (opts.fx != "custom" && !opts.multiFx) { log("unknown transition: " + opts.fx, "; slideshow terminating"); return false; } } } var e0 = $slides[first]; if (opts.before.length) { opts.before[0].apply(e0, [e0, e0, opts, true]); } if (opts.after.length > 1) { opts.after[1].apply(e0, [e0, e0, opts, true]); } if (opts.next) { $(opts.next).bind(opts.prevNextEvent, function () { return advance(opts, opts.rev ? -1 : 1); }); } if (opts.prev) { $(opts.prev).bind(opts.prevNextEvent, function () { return advance(opts, opts.rev ? 1 : -1); }); } if (opts.pager || opts.pagerAnchorBuilder) { buildPager(els, opts); } exposeAddSlide(opts, els); return opts; } function saveOriginalOpts(opts) { opts.original = { before: [], after: [] }; opts.original.cssBefore = $.extend({}, opts.cssBefore); opts.original.cssAfter = $.extend({}, opts.cssAfter); opts.original.animIn = $.extend({}, opts.animIn); opts.original.animOut = $.extend({}, opts.animOut); $.each(opts.before, function () { opts.original.before.push(this); }); $.each(opts.after, function () { opts.original.after.push(this); }); } function supportMultiTransitions(opts) { var i, tx, txs = $.fn.cycle.transitions; if (opts.fx.indexOf(",") > 0) { opts.multiFx = true; opts.fxs = opts.fx.replace(/\s*/g, "").split(","); for (i = 0; i < opts.fxs.length; i++) { var fx = opts.fxs[i]; tx = txs[fx]; if (!tx || !txs.hasOwnProperty(fx) || !$.isFunction(tx)) { log("discarding unknown transition: ", fx); opts.fxs.splice(i, 1); i--; } } if (!opts.fxs.length) { log("No valid transitions named; slideshow terminating."); return false; } } else { if (opts.fx == "all") { opts.multiFx = true; opts.fxs = []; for (p in txs) { tx = txs[p]; if (txs.hasOwnProperty(p) && $.isFunction(tx)) { opts.fxs.push(p); } } } } if (opts.multiFx && opts.randomizeEffects) { var r1 = Math.floor(Math.random() * 20) + 30; for (i = 0; i < r1; i++) { var r2 = Math.floor(Math.random() * opts.fxs.length); opts.fxs.push(opts.fxs.splice(r2, 1)[0]); } debug("randomized fx sequence: ", opts.fxs); } return true; } function exposeAddSlide(opts, els) { opts.addSlide = function (newSlide, prepend) { var $s = $(newSlide), s = $s[0]; if (!opts.autostopCount) { opts.countdown++; } els[prepend ? "unshift" : "push"](s); if (opts.els) { opts.els[prepend ? "unshift" : "push"](s); } opts.slideCount = els.length; $s.css("position", "absolute"); $s[prepend ? "prependTo" : "appendTo"](opts.$cont); if (prepend) { opts.currSlide++; opts.nextSlide++; } if (!$.support.opacity && opts.cleartype && !opts.cleartypeNoBg) { clearTypeFix($s); } if (opts.fit && opts.width) { $s.width(opts.width); } if (opts.fit && opts.height && opts.height != "auto") { $slides.height(opts.height); } s.cycleH = (opts.fit && opts.height) ? opts.height : $s.height(); s.cycleW = (opts.fit && opts.width) ? opts.width : $s.width(); $s.css(opts.cssBefore); if (opts.pager || opts.pagerAnchorBuilder) { $.fn.cycle.createPagerAnchor(els.length - 1, s, $(opts.pager), els, opts); } if ($.isFunction(opts.onAddSlide)) { opts.onAddSlide($s); } else { $s.hide(); } }; } $.fn.cycle.resetState = function (opts, fx) { fx = fx || opts.fx; opts.before = []; opts.after = []; opts.cssBefore = $.extend({}, opts.original.cssBefore); opts.cssAfter = $.extend({}, opts.original.cssAfter); opts.animIn = $.extend({}, opts.original.animIn); opts.animOut = $.extend({}, opts.original.animOut); opts.fxFn = null; $.each(opts.original.before, function () { opts.before.push(this); }); $.each(opts.original.after, function () { opts.after.push(this); }); var init = $.fn.cycle.transitions[fx]; if ($.isFunction(init)) { init(opts.$cont, $(opts.elements), opts); } }; function go(els, opts, manual, fwd) { if (manual && opts.busy && opts.manualTrump) { debug("manualTrump in go(), stopping active transition"); $(els).stop(true, true); opts.busy = false; } if (opts.busy) { debug("transition active, ignoring new tx request"); return; } var p = opts.$cont[0], curr = els[opts.currSlide], next = els[opts.nextSlide]; if (p.cycleStop != opts.stopCount || p.cycleTimeout === 0 && !manual) { return; } if (!manual && !p.cyclePause && !opts.bounce && ((opts.autostop && (--opts.countdown <= 0)) || (opts.nowrap && !opts.random && opts.nextSlide < opts.currSlide))) { if (opts.end) { opts.end(opts); } return; } var changed = false; if ((manual || !p.cyclePause) && (opts.nextSlide != opts.currSlide)) { changed = true; var fx = opts.fx; curr.cycleH = curr.cycleH || $(curr).height(); curr.cycleW = curr.cycleW || $(curr).width(); next.cycleH = next.cycleH || $(next).height(); next.cycleW = next.cycleW || $(next).width(); if (opts.multiFx) { if (opts.lastFx == undefined || ++opts.lastFx >= opts.fxs.length) { opts.lastFx = 0; } fx = opts.fxs[opts.lastFx]; opts.currFx = fx; } if (opts.oneTimeFx) { fx = opts.oneTimeFx; opts.oneTimeFx = null; } $.fn.cycle.resetState(opts, fx); if (opts.before.length) { $.each(opts.before, function (i, o) { if (p.cycleStop != opts.stopCount) { return; } o.apply(next, [curr, next, opts, fwd]); }); } var after = function () { $.each(opts.after, function (i, o) { if (p.cycleStop != opts.stopCount) { return; } o.apply(next, [curr, next, opts, fwd]); }); }; debug("tx firing; currSlide: " + opts.currSlide + "; nextSlide: " + opts.nextSlide); opts.busy = 1; if (opts.fxFn) { opts.fxFn(curr, next, opts, after, fwd, manual && opts.fastOnEvent); } else { if ($.isFunction($.fn.cycle[opts.fx])) { $.fn.cycle[opts.fx](curr, next, opts, after, fwd, manual && opts.fastOnEvent); } else { $.fn.cycle.custom(curr, next, opts, after, fwd, manual && opts.fastOnEvent); } } } if (changed || opts.nextSlide == opts.currSlide) { opts.lastSlide = opts.currSlide; if (opts.random) { opts.currSlide = opts.nextSlide; if (++opts.randomIndex == els.length) { opts.randomIndex = 0; } opts.nextSlide = opts.randomMap[opts.randomIndex]; if (opts.nextSlide == opts.currSlide) { opts.nextSlide = (opts.currSlide == opts.slideCount - 1) ? 0 : opts.currSlide + 1; } } else { if (opts.backwards) { var roll = (opts.nextSlide - 1) < 0; if (roll && opts.bounce) { opts.backwards = !opts.backwards; opts.nextSlide = 1; opts.currSlide = 0; } else { opts.nextSlide = roll ? (els.length - 1) : opts.nextSlide - 1; opts.currSlide = roll ? 0 : opts.nextSlide + 1; } } else { var roll = (opts.nextSlide + 1) == els.length; if (roll && opts.bounce) { opts.backwards = !opts.backwards; opts.nextSlide = els.length - 2; opts.currSlide = els.length - 1; } else { opts.nextSlide = roll ? 0 : opts.nextSlide + 1; opts.currSlide = roll ? els.length - 1 : opts.nextSlide - 1; } } } } if (changed && opts.pager) { opts.updateActivePagerLink(opts.pager, opts.currSlide, opts.activePagerClass); } var ms = 0; if (opts.timeout && !opts.continuous) { ms = getTimeout(els[opts.currSlide], els[opts.nextSlide], opts, fwd); } else { if (opts.continuous && p.cyclePause) { ms = 10; } } if (ms > 0) { p.cycleTimeout = setTimeout(function () { go(els, opts, 0, (!opts.rev && !opts.backwards)); }, ms); } } $.fn.cycle.updateActivePagerLink = function (pager, currSlide, clsName) { $(pager).each(function () { $(this).children().removeClass(clsName).eq(currSlide).addClass(clsName); }); }; function getTimeout(curr, next, opts, fwd) { if (opts.timeoutFn) { var t = opts.timeoutFn.call(curr, curr, next, opts, fwd); while ((t - opts.speed) < 250) { t += opts.speed; } debug("calculated timeout: " + t + "; speed: " + opts.speed); if (t !== false) { return t; } } return opts.timeout; } $.fn.cycle.next = function (opts) { advance(opts, opts.rev ? -1 : 1); }; $.fn.cycle.prev = function (opts) { advance(opts, opts.rev ? 1 : -1); }; function advance(opts, val) { var els = opts.elements; var p = opts.$cont[0], timeout = p.cycleTimeout; if (timeout) { clearTimeout(timeout); p.cycleTimeout = 0; } if (opts.random && val < 0) { opts.randomIndex--; if (--opts.randomIndex == -2) { opts.randomIndex = els.length - 2; } else { if (opts.randomIndex == -1) { opts.randomIndex = els.length - 1; } } opts.nextSlide = opts.randomMap[opts.randomIndex]; } else { if (opts.random) { opts.nextSlide = opts.randomMap[opts.randomIndex]; } else { opts.nextSlide = opts.currSlide + val; if (opts.nextSlide < 0) { if (opts.nowrap) { return false; } opts.nextSlide = els.length - 1; } else { if (opts.nextSlide >= els.length) { if (opts.nowrap) { return false; } opts.nextSlide = 0; } } } } var cb = opts.onPrevNextEvent || opts.prevNextClick; if ($.isFunction(cb)) { cb(val > 0, opts.nextSlide, els[opts.nextSlide]); } go(els, opts, 1, val >= 0); return false; } function buildPager(els, opts) { var $p = $(opts.pager); $.each(els, function (i, o) { $.fn.cycle.createPagerAnchor(i, o, $p, els, opts); }); opts.updateActivePagerLink(opts.pager, opts.startingSlide, opts.activePagerClass); } $.fn.cycle.createPagerAnchor = function (i, el, $p, els, opts) { var a; if ($.isFunction(opts.pagerAnchorBuilder)) { a = opts.pagerAnchorBuilder(i, el); debug("pagerAnchorBuilder(" + i + ", el) returned: " + a); } else { a = '<a href="#">' + (i + 1) + "</a>"; } if (!a) { return; } var $a = $(a); if ($a.parents("body").length === 0) { var arr = []; if ($p.length > 1) { $p.each(function () { var $clone = $a.clone(true); $(this).append($clone); arr.push($clone[0]); }); $a = $(arr); } else { $a.appendTo($p); } } opts.pagerAnchors = opts.pagerAnchors || []; opts.pagerAnchors.push($a); $a.bind(opts.pagerEvent, function (e) { e.preventDefault(); opts.nextSlide = i; var p = opts.$cont[0], timeout = p.cycleTimeout; if (timeout) { clearTimeout(timeout); p.cycleTimeout = 0; } var cb = opts.onPagerEvent || opts.pagerClick; if ($.isFunction(cb)) { cb(opts.nextSlide, els[opts.nextSlide]); } go(els, opts, 1, opts.currSlide < i); }); if (!/^click/.test(opts.pagerEvent) && !opts.allowPagerClickBubble) { $a.bind("click.cycle", function () { return false; }); } if (opts.pauseOnPagerHover) { $a.hover(function () { opts.$cont[0].cyclePause++; }, function () { opts.$cont[0].cyclePause--; }); } }; $.fn.cycle.hopsFromLast = function (opts, fwd) { var hops, l = opts.lastSlide, c = opts.currSlide; if (fwd) { hops = c > l ? c - l : opts.slideCount - l; } else { hops = c < l ? l - c : l + opts.slideCount - c; } return hops; }; function clearTypeFix($slides) { debug("applying clearType background-color hack"); function hex(s) { s = parseInt(s).toString(16); return s.length < 2 ? "0" + s : s; } function getBg(e) { for (; e && e.nodeName.toLowerCase() != "html"; e = e.parentNode) { var v = $.css(e, "background-color"); if (v.indexOf("rgb") >= 0) { var rgb = v.match(/\d+/g); return "#" + hex(rgb[0]) + hex(rgb[1]) + hex(rgb[2]); } if (v && v != "transparent") { return v; } } return "#ffffff"; } $slides.each(function () { $(this).css("background-color", getBg(this)); }); } $.fn.cycle.commonReset = function (curr, next, opts, w, h, rev) { $(opts.elements).not(curr).hide(); opts.cssBefore.opacity = 1; opts.cssBefore.display = "block"; if (w !== false && next.cycleW > 0) { opts.cssBefore.width = next.cycleW; } if (h !== false && next.cycleH > 0) { opts.cssBefore.height = next.cycleH; } opts.cssAfter = opts.cssAfter || {}; opts.cssAfter.display = "none"; $(curr).css("zIndex", opts.slideCount + (rev === true ? 1 : 0)); $(next).css("zIndex", opts.slideCount + (rev === true ? 0 : 1)); }; $.fn.cycle.custom = function (curr, next, opts, cb, fwd, speedOverride) { var $l = $(curr), $n = $(next); var speedIn = opts.speedIn, speedOut = opts.speedOut, easeIn = opts.easeIn, easeOut = opts.easeOut; $n.css(opts.cssBefore); if (speedOverride) { if (typeof speedOverride == "number") { speedIn = speedOut = speedOverride; } else { speedIn = speedOut = 1; } easeIn = easeOut = null; } var fn = function () { $n.animate(opts.animIn, speedIn, easeIn, cb); }; $l.animate(opts.animOut, speedOut, easeOut, function () { if (opts.cssAfter) { $l.css(opts.cssAfter); } if (!opts.sync) { fn(); } }); if (opts.sync) { fn(); } }; $.fn.cycle.transitions = { fade: function ($cont, $slides, opts) { $slides.not(":eq(" + opts.currSlide + ")").css("opacity", 0); opts.before.push(function (curr, next, opts) { $.fn.cycle.commonReset(curr, next, opts); opts.cssBefore.opacity = 0; }); opts.animIn = { opacity: 1 }; opts.animOut = { opacity: 0 }; opts.cssBefore = { top: 0, left: 0 }; } }; $.fn.cycle.ver = function () { return ver; }; $.fn.cycle.defaults = { fx: "fade", timeout: 4000, timeoutFn: null, continuous: 0, speed: 1000, speedIn: null, speedOut: null, next: null, prev: null, onPrevNextEvent: null, prevNextEvent: "click.cycle", pager: null, onPagerEvent: null, pagerEvent: "click.cycle", allowPagerClickBubble: false, pagerAnchorBuilder: null, before: null, after: null, end: null, easing: null, easeIn: null, easeOut: null, shuffle: null, animIn: null, animOut: null, cssBefore: null, cssAfter: null, fxFn: null, height: "auto", startingSlide: 0, sync: 1, random: 0, fit: 0, containerResize: 1, pause: 0, pauseOnPagerHover: 0, autostop: 0, autostopCount: 0, delay: 0, slideExpr: null, cleartype: !$.support.opacity, cleartypeNoBg: false, nowrap: 0, fastOnEvent: 0, randomizeEffects: 1, rev: 0, manualTrump: true, requeueOnImageNotLoaded: true, requeueTimeout: 250, activePagerClass: "activeSlide", updateActivePagerLink: null, backwards: false }; })(jQuery);
    (function ($) { $.fn.cycle.transitions.none = function ($cont, $slides, opts) { opts.fxFn = function (curr, next, opts, after) { $(next).show(); $(curr).hide(); after(); }; }; $.fn.cycle.transitions.scrollUp = function ($cont, $slides, opts) { $cont.css("overflow", "hidden"); opts.before.push($.fn.cycle.commonReset); var h = $cont.height(); opts.cssBefore = { top: h, left: 0 }; opts.cssFirst = { top: 0 }; opts.animIn = { top: 0 }; opts.animOut = { top: -h }; }; $.fn.cycle.transitions.scrollDown = function ($cont, $slides, opts) { $cont.css("overflow", "hidden"); opts.before.push($.fn.cycle.commonReset); var h = $cont.height(); opts.cssFirst = { top: 0 }; opts.cssBefore = { top: -h, left: 0 }; opts.animIn = { top: 0 }; opts.animOut = { top: h }; }; $.fn.cycle.transitions.scrollLeft = function ($cont, $slides, opts) { $cont.css("overflow", "hidden"); opts.before.push($.fn.cycle.commonReset); var w = $cont.width(); opts.cssFirst = { left: 0 }; opts.cssBefore = { left: w, top: 0 }; opts.animIn = { left: 0 }; opts.animOut = { left: 0 - w }; }; $.fn.cycle.transitions.scrollRight = function ($cont, $slides, opts) { $cont.css("overflow", "hidden"); opts.before.push($.fn.cycle.commonReset); var w = $cont.width(); opts.cssFirst = { left: 0 }; opts.cssBefore = { left: -w, top: 0 }; opts.animIn = { left: 0 }; opts.animOut = { left: w }; }; $.fn.cycle.transitions.scrollHorz = function ($cont, $slides, opts) { $cont.css("overflow", "hidden").width(); opts.before.push(function (curr, next, opts, fwd) { $.fn.cycle.commonReset(curr, next, opts); opts.cssBefore.left = fwd ? (next.cycleW - 1) : (1 - next.cycleW); opts.animOut.left = fwd ? -curr.cycleW : curr.cycleW; }); opts.cssFirst = { left: 0 }; opts.cssBefore = { top: 0 }; opts.animIn = { left: 0 }; opts.animOut = { top: 0 }; }; $.fn.cycle.transitions.scrollVert = function ($cont, $slides, opts) { $cont.css("overflow", "hidden"); opts.before.push(function (curr, next, opts, fwd) { $.fn.cycle.commonReset(curr, next, opts); opts.cssBefore.top = fwd ? (1 - next.cycleH) : (next.cycleH - 1); opts.animOut.top = fwd ? curr.cycleH : -curr.cycleH; }); opts.cssFirst = { top: 0 }; opts.cssBefore = { left: 0 }; opts.animIn = { top: 0 }; opts.animOut = { left: 0 }; }; $.fn.cycle.transitions.slideX = function ($cont, $slides, opts) { opts.before.push(function (curr, next, opts) { $(opts.elements).not(curr).hide(); $.fn.cycle.commonReset(curr, next, opts, false, true); opts.animIn.width = next.cycleW; }); opts.cssBefore = { left: 0, top: 0, width: 0 }; opts.animIn = { width: "show" }; opts.animOut = { width: 0 }; }; $.fn.cycle.transitions.slideY = function ($cont, $slides, opts) { opts.before.push(function (curr, next, opts) { $(opts.elements).not(curr).hide(); $.fn.cycle.commonReset(curr, next, opts, true, false); opts.animIn.height = next.cycleH; }); opts.cssBefore = { left: 0, top: 0, height: 0 }; opts.animIn = { height: "show" }; opts.animOut = { height: 0 }; }; $.fn.cycle.transitions.shuffle = function ($cont, $slides, opts) { var i, w = $cont.css("overflow", "visible").width(); $slides.css({ left: 0, top: 0 }); opts.before.push(function (curr, next, opts) { $.fn.cycle.commonReset(curr, next, opts, true, true, true); }); if (!opts.speedAdjusted) { opts.speed = opts.speed / 2; opts.speedAdjusted = true; } opts.random = 0; opts.shuffle = opts.shuffle || { left: -w, top: 15 }; opts.els = []; for (i = 0; i < $slides.length; i++) { opts.els.push($slides[i]); } for (i = 0; i < opts.currSlide; i++) { opts.els.push(opts.els.shift()); } opts.fxFn = function (curr, next, opts, cb, fwd) { var $el = fwd ? $(curr) : $(next); $(next).css(opts.cssBefore); var count = opts.slideCount; $el.animate(opts.shuffle, opts.speedIn, opts.easeIn, function () { var hops = $.fn.cycle.hopsFromLast(opts, fwd); for (var k = 0; k < hops; k++) { fwd ? opts.els.push(opts.els.shift()) : opts.els.unshift(opts.els.pop()); } if (fwd) { for (var i = 0, len = opts.els.length; i < len; i++) { $(opts.els[i]).css("z-index", len - i + count); } } else { var z = $(curr).css("z-index"); $el.css("z-index", parseInt(z) + 1 + count); } $el.animate({ left: 0, top: 0 }, opts.speedOut, opts.easeOut, function () { $(fwd ? this : curr).hide(); if (cb) { cb(); } }); }); }; opts.cssBefore = { display: "block", opacity: 1, top: 0, left: 0 }; }; $.fn.cycle.transitions.turnUp = function ($cont, $slides, opts) { opts.before.push(function (curr, next, opts) { $.fn.cycle.commonReset(curr, next, opts, true, false); opts.cssBefore.top = next.cycleH; opts.animIn.height = next.cycleH; }); opts.cssFirst = { top: 0 }; opts.cssBefore = { left: 0, height: 0 }; opts.animIn = { top: 0 }; opts.animOut = { height: 0 }; }; $.fn.cycle.transitions.turnDown = function ($cont, $slides, opts) { opts.before.push(function (curr, next, opts) { $.fn.cycle.commonReset(curr, next, opts, true, false); opts.animIn.height = next.cycleH; opts.animOut.top = curr.cycleH; }); opts.cssFirst = { top: 0 }; opts.cssBefore = { left: 0, top: 0, height: 0 }; opts.animOut = { height: 0 }; }; $.fn.cycle.transitions.turnLeft = function ($cont, $slides, opts) { opts.before.push(function (curr, next, opts) { $.fn.cycle.commonReset(curr, next, opts, false, true); opts.cssBefore.left = next.cycleW; opts.animIn.width = next.cycleW; }); opts.cssBefore = { top: 0, width: 0 }; opts.animIn = { left: 0 }; opts.animOut = { width: 0 }; }; $.fn.cycle.transitions.turnRight = function ($cont, $slides, opts) { opts.before.push(function (curr, next, opts) { $.fn.cycle.commonReset(curr, next, opts, false, true); opts.animIn.width = next.cycleW; opts.animOut.left = curr.cycleW; }); opts.cssBefore = { top: 0, left: 0, width: 0 }; opts.animIn = { left: 0 }; opts.animOut = { width: 0 }; }; $.fn.cycle.transitions.zoom = function ($cont, $slides, opts) { opts.before.push(function (curr, next, opts) { $.fn.cycle.commonReset(curr, next, opts, false, false, true); opts.cssBefore.top = next.cycleH / 2; opts.cssBefore.left = next.cycleW / 2; opts.animIn = { top: 0, left: 0, width: next.cycleW, height: next.cycleH }; opts.animOut = { width: 0, height: 0, top: curr.cycleH / 2, left: curr.cycleW / 2 }; }); opts.cssFirst = { top: 0, left: 0 }; opts.cssBefore = { width: 0, height: 0 }; }; $.fn.cycle.transitions.fadeZoom = function ($cont, $slides, opts) { opts.before.push(function (curr, next, opts) { $.fn.cycle.commonReset(curr, next, opts, false, false); opts.cssBefore.left = next.cycleW / 2; opts.cssBefore.top = next.cycleH / 2; opts.animIn = { top: 0, left: 0, width: next.cycleW, height: next.cycleH }; }); opts.cssBefore = { width: 0, height: 0 }; opts.animOut = { opacity: 0 }; }; $.fn.cycle.transitions.blindX = function ($cont, $slides, opts) { var w = $cont.css("overflow", "hidden").width(); opts.before.push(function (curr, next, opts) { $.fn.cycle.commonReset(curr, next, opts); opts.animIn.width = next.cycleW; opts.animOut.left = curr.cycleW; }); opts.cssBefore = { left: w, top: 0 }; opts.animIn = { left: 0 }; opts.animOut = { left: w }; }; $.fn.cycle.transitions.blindY = function ($cont, $slides, opts) { var h = $cont.css("overflow", "hidden").height(); opts.before.push(function (curr, next, opts) { $.fn.cycle.commonReset(curr, next, opts); opts.animIn.height = next.cycleH; opts.animOut.top = curr.cycleH; }); opts.cssBefore = { top: h, left: 0 }; opts.animIn = { top: 0 }; opts.animOut = { top: h }; }; $.fn.cycle.transitions.blindZ = function ($cont, $slides, opts) { var h = $cont.css("overflow", "hidden").height(); var w = $cont.width(); opts.before.push(function (curr, next, opts) { $.fn.cycle.commonReset(curr, next, opts); opts.animIn.height = next.cycleH; opts.animOut.top = curr.cycleH; }); opts.cssBefore = { top: h, left: w }; opts.animIn = { top: 0, left: 0 }; opts.animOut = { top: h, left: w }; }; $.fn.cycle.transitions.growX = function ($cont, $slides, opts) { opts.before.push(function (curr, next, opts) { $.fn.cycle.commonReset(curr, next, opts, false, true); opts.cssBefore.left = this.cycleW / 2; opts.animIn = { left: 0, width: this.cycleW }; opts.animOut = { left: 0 }; }); opts.cssBefore = { width: 0, top: 0 }; }; $.fn.cycle.transitions.growY = function ($cont, $slides, opts) { opts.before.push(function (curr, next, opts) { $.fn.cycle.commonReset(curr, next, opts, true, false); opts.cssBefore.top = this.cycleH / 2; opts.animIn = { top: 0, height: this.cycleH }; opts.animOut = { top: 0 }; }); opts.cssBefore = { height: 0, left: 0 }; }; $.fn.cycle.transitions.curtainX = function ($cont, $slides, opts) { opts.before.push(function (curr, next, opts) { $.fn.cycle.commonReset(curr, next, opts, false, true, true); opts.cssBefore.left = next.cycleW / 2; opts.animIn = { left: 0, width: this.cycleW }; opts.animOut = { left: curr.cycleW / 2, width: 0 }; }); opts.cssBefore = { top: 0, width: 0 }; }; $.fn.cycle.transitions.curtainY = function ($cont, $slides, opts) { opts.before.push(function (curr, next, opts) { $.fn.cycle.commonReset(curr, next, opts, true, false, true); opts.cssBefore.top = next.cycleH / 2; opts.animIn = { top: 0, height: next.cycleH }; opts.animOut = { top: curr.cycleH / 2, height: 0 }; }); opts.cssBefore = { left: 0, height: 0 }; }; $.fn.cycle.transitions.cover = function ($cont, $slides, opts) { var d = opts.direction || "left"; var w = $cont.css("overflow", "hidden").width(); var h = $cont.height(); opts.before.push(function (curr, next, opts) { $.fn.cycle.commonReset(curr, next, opts); if (d == "right") { opts.cssBefore.left = -w; } else { if (d == "up") { opts.cssBefore.top = h; } else { if (d == "down") { opts.cssBefore.top = -h; } else { opts.cssBefore.left = w; } } } }); opts.animIn = { left: 0, top: 0 }; opts.animOut = { opacity: 1 }; opts.cssBefore = { top: 0, left: 0 }; }; $.fn.cycle.transitions.uncover = function ($cont, $slides, opts) { var d = opts.direction || "left"; var w = $cont.css("overflow", "hidden").width(); var h = $cont.height(); opts.before.push(function (curr, next, opts) { $.fn.cycle.commonReset(curr, next, opts, true, true, true); if (d == "right") { opts.animOut.left = w; } else { if (d == "up") { opts.animOut.top = -h; } else { if (d == "down") { opts.animOut.top = h; } else { opts.animOut.left = -w; } } } }); opts.animIn = { left: 0, top: 0 }; opts.animOut = { opacity: 1 }; opts.cssBefore = { top: 0, left: 0 }; }; $.fn.cycle.transitions.toss = function ($cont, $slides, opts) { var w = $cont.css("overflow", "visible").width(); var h = $cont.height(); opts.before.push(function (curr, next, opts) { $.fn.cycle.commonReset(curr, next, opts, true, true, true); if (!opts.animOut.left && !opts.animOut.top) { opts.animOut = { left: w * 2, top: -h / 2, opacity: 0 }; } else { opts.animOut.opacity = 0; } }); opts.cssBefore = { left: 0, top: 0 }; opts.animIn = { left: 0 }; }; $.fn.cycle.transitions.wipe = function ($cont, $slides, opts) { var w = $cont.css("overflow", "hidden").width(); var h = $cont.height(); opts.cssBefore = opts.cssBefore || {}; var clip; if (opts.clip) { if (/l2r/.test(opts.clip)) { clip = "rect(0px 0px " + h + "px 0px)"; } else { if (/r2l/.test(opts.clip)) { clip = "rect(0px " + w + "px " + h + "px " + w + "px)"; } else { if (/t2b/.test(opts.clip)) { clip = "rect(0px " + w + "px 0px 0px)"; } else { if (/b2t/.test(opts.clip)) { clip = "rect(" + h + "px " + w + "px " + h + "px 0px)"; } else { if (/zoom/.test(opts.clip)) { var top = parseInt(h / 2); var left = parseInt(w / 2); clip = "rect(" + top + "px " + left + "px " + top + "px " + left + "px)"; } } } } } } opts.cssBefore.clip = opts.cssBefore.clip || clip || "rect(0px 0px 0px 0px)"; var d = opts.cssBefore.clip.match(/(\d+)/g); var t = parseInt(d[0]), r = parseInt(d[1]), b = parseInt(d[2]), l = parseInt(d[3]); opts.before.push(function (curr, next, opts) { if (curr == next) { return; } var $curr = $(curr), $next = $(next); $.fn.cycle.commonReset(curr, next, opts, true, true, false); opts.cssAfter.display = "block"; var step = 1, count = parseInt((opts.speedIn / 13)) - 1; (function f() { var tt = t ? t - parseInt(step * (t / count)) : 0; var ll = l ? l - parseInt(step * (l / count)) : 0; var bb = b < h ? b + parseInt(step * ((h - b) / count || 1)) : h; var rr = r < w ? r + parseInt(step * ((w - r) / count || 1)) : w; $next.css({ clip: "rect(" + tt + "px " + rr + "px " + bb + "px " + ll + "px)" }); (step++ <= count) ? setTimeout(f, 13) : $curr.css("display", "none"); })(); }); opts.cssBefore = { display: "block", opacity: 1, top: 0, left: 0 }; opts.animIn = { left: 0 }; opts.animOut = { left: 0 }; }; })(jQuery);
    //Termina jQuery Cycle

    //começa jcarousel
    (function (i) { var q = { vertical: false, rtl: false, start: 1, offset: 1, size: null, scroll: 3, visible: null, animation: "normal", easing: "swing", auto: 0, wrap: null, initCallback: null, reloadCallback: null, itemLoadCallback: null, itemFirstInCallback: null, itemFirstOutCallback: null, itemLastInCallback: null, itemLastOutCallback: null, itemVisibleInCallback: null, itemVisibleOutCallback: null, buttonNextHTML: "<div></div>", buttonPrevHTML: "<div></div>", buttonNextEvent: "click", buttonPrevEvent: "click", buttonNextCallback: null, buttonPrevCallback: null, itemFallbackDimension: null }, r = false; i(window).bind("load.jcarousel", function () { r = true }); i.jcarousel = function (a, c) { this.options = i.extend({}, q, c || {}); this.autoStopped = this.locked = false; this.buttonPrevState = this.buttonNextState = this.buttonPrev = this.buttonNext = this.list = this.clip = this.container = null; if (!c || c.rtl === undefined) this.options.rtl = (i(a).attr("dir") || i("html").attr("dir") || "").toLowerCase() == "rtl"; this.wh = !this.options.vertical ? "width" : "height"; this.lt = !this.options.vertical ? this.options.rtl ? "right" : "left" : "top"; for (var b = "", d = a.className.split(" "), f = 0; f < d.length; f++) if (d[f].indexOf("jcarousel-skin") != -1) { i(a).removeClass(d[f]); b = d[f]; break } if (a.nodeName.toUpperCase() == "UL" || a.nodeName.toUpperCase() == "OL") { this.list = i(a); this.container = this.list.parent(); if (this.container.hasClass("jcarousel-clip")) { if (!this.container.parent().hasClass("jcarousel-container")) this.container = this.container.wrap("<div></div>"); this.container = this.container.parent() } else if (!this.container.hasClass("jcarousel-container")) this.container = this.list.wrap("<div></div>").parent() } else { this.container = i(a); this.list = this.container.find("ul,ol").eq(0) } b !== "" && this.container.parent()[0].className.indexOf("jcarousel-skin") == -1 && this.container.wrap('<div class=" ' + b + '"></div>'); this.clip = this.list.parent(); if (!this.clip.length || !this.clip.hasClass("jcarousel-clip")) this.clip = this.list.wrap("<div></div>").parent(); this.buttonNext = i(".jcarousel-next", this.container); if (this.buttonNext.size() === 0 && this.options.buttonNextHTML !== null) this.buttonNext = this.clip.after(this.options.buttonNextHTML).next(); this.buttonNext.addClass(this.className("jcarousel-next")); this.buttonPrev = i(".jcarousel-prev", this.container); if (this.buttonPrev.size() === 0 && this.options.buttonPrevHTML !== null) this.buttonPrev = this.clip.after(this.options.buttonPrevHTML).next(); this.buttonPrev.addClass(this.className("jcarousel-prev")); this.clip.addClass(this.className("jcarousel-clip")).css({ overflow: "hidden", position: "relative" }); this.list.addClass(this.className("jcarousel-list")).css({ overflow: "hidden", position: "relative", top: 0, margin: 0, padding: 0 }).css(this.options.rtl ? "right" : "left", 0); this.container.addClass(this.className("jcarousel-container")).css({ position: "relative" }); !this.options.vertical && this.options.rtl && this.container.addClass("jcarousel-direction-rtl").attr("dir", "rtl"); var j = this.options.visible !== null ? Math.ceil(this.clipping() / this.options.visible) : null; b = this.list.children("li"); var e = this; if (b.size() > 0) { var g = 0, k = this.options.offset; b.each(function () { e.format(this, k++); g += e.dimension(this, j) }); this.list.css(this.wh, g + 100 + "px"); if (!c || c.size === undefined) this.options.size = b.size() } this.container.css("display", "block"); this.buttonNext.css("display", "block"); this.buttonPrev.css("display", "block"); this.funcNext = function () { e.next() }; this.funcPrev = function () { e.prev() }; this.funcResize = function () { e.reload() }; this.options.initCallback !== null && this.options.initCallback(this, "init"); if (!r && i.browser.safari) { this.buttons(false, false); i(window).bind("load.jcarousel", function () { e.setup() }) } else this.setup() }; var h = i.jcarousel; h.fn = h.prototype = { jcarousel: "0.2.7" }; h.fn.extend = h.extend = i.extend; h.fn.extend({ setup: function () { this.prevLast = this.prevFirst = this.last = this.first = null; this.animating = false; this.tail = this.timer = null; this.inTail = false; if (!this.locked) { this.list.css(this.lt, this.pos(this.options.offset) + "px"); var a = this.pos(this.options.start, true); this.prevFirst = this.prevLast = null; this.animate(a, false); i(window).unbind("resize.jcarousel", this.funcResize).bind("resize.jcarousel", this.funcResize) } }, reset: function () { this.list.empty(); this.list.css(this.lt, "0px"); this.list.css(this.wh, "10px"); this.options.initCallback !== null && this.options.initCallback(this, "reset"); this.setup() }, reload: function () { this.tail !== null && this.inTail && this.list.css(this.lt, h.intval(this.list.css(this.lt)) + this.tail); this.tail = null; this.inTail = false; this.options.reloadCallback !== null && this.options.reloadCallback(this); if (this.options.visible !== null) { var a = this, c = Math.ceil(this.clipping() / this.options.visible), b = 0, d = 0; this.list.children("li").each(function (f) { b += a.dimension(this, c); if (f + 1 < a.first) d = b }); this.list.css(this.wh, b + "px"); this.list.css(this.lt, -d + "px") } this.scroll(this.first, false) }, lock: function () { this.locked = true; this.buttons() }, unlock: function () { this.locked = false; this.buttons() }, size: function (a) { if (a !== undefined) { this.options.size = a; this.locked || this.buttons() } return this.options.size }, has: function (a, c) { if (c === undefined || !c) c = a; if (this.options.size !== null && c > this.options.size) c = this.options.size; for (var b = a; b <= c; b++) { var d = this.get(b); if (!d.length || d.hasClass("jcarousel-item-placeholder")) return false } return true }, get: function (a) { return i(".jcarousel-item-" + a, this.list) }, add: function (a, c) { var b = this.get(a), d = 0, f = i(c); if (b.length === 0) { var j, e = h.intval(a); for (b = this.create(a); ; ) { j = this.get(--e); if (e <= 0 || j.length) { e <= 0 ? this.list.prepend(b) : j.after(b); break } } } else d = this.dimension(b); if (f.get(0).nodeName.toUpperCase() == "LI") { b.replaceWith(f); b = f } else b.empty().append(c); this.format(b.removeClass(this.className("jcarousel-item-placeholder")), a); f = this.options.visible !== null ? Math.ceil(this.clipping() / this.options.visible) : null; d = this.dimension(b, f) - d; a > 0 && a < this.first && this.list.css(this.lt, h.intval(this.list.css(this.lt)) - d + "px"); this.list.css(this.wh, h.intval(this.list.css(this.wh)) + d + "px"); return b }, remove: function (a) { var c = this.get(a); if (!(!c.length || a >= this.first && a <= this.last)) { var b = this.dimension(c); a < this.first && this.list.css(this.lt, h.intval(this.list.css(this.lt)) + b + "px"); c.remove(); this.list.css(this.wh, h.intval(this.list.css(this.wh)) - b + "px") } }, next: function () { this.tail !== null && !this.inTail ? this.scrollTail(false) : this.scroll((this.options.wrap == "both" || this.options.wrap == "last") && this.options.size !== null && this.last == this.options.size ? 1 : this.first + this.options.scroll) }, prev: function () { this.tail !== null && this.inTail ? this.scrollTail(true) : this.scroll((this.options.wrap == "both" || this.options.wrap == "first") && this.options.size !== null && this.first == 1 ? this.options.size : this.first - this.options.scroll) }, scrollTail: function (a) { if (!(this.locked || this.animating || !this.tail)) { this.pauseAuto(); var c = h.intval(this.list.css(this.lt)); c = !a ? c - this.tail : c + this.tail; this.inTail = !a; this.prevFirst = this.first; this.prevLast = this.last; this.animate(c) } }, scroll: function (a, c) { if (!(this.locked || this.animating)) { this.pauseAuto(); this.animate(this.pos(a), c) } }, pos: function (a, c) { var b = h.intval(this.list.css(this.lt)); if (this.locked || this.animating) return b; if (this.options.wrap != "circular") a = a < 1 ? 1 : this.options.size && a > this.options.size ? this.options.size : a; for (var d = this.first > a, f = this.options.wrap != "circular" && this.first <= 1 ? 1 : this.first, j = d ? this.get(f) : this.get(this.last), e = d ? f : f - 1, g = null, k = 0, l = false, m = 0; d ? --e >= a : ++e < a; ) { g = this.get(e); l = !g.length; if (g.length === 0) { g = this.create(e).addClass(this.className("jcarousel-item-placeholder")); j[d ? "before" : "after"](g); if (this.first !== null && this.options.wrap == "circular" && this.options.size !== null && (e <= 0 || e > this.options.size)) { j = this.get(this.index(e)); if (j.length) g = this.add(e, j.clone(true)) } } j = g; m = this.dimension(g); if (l) k += m; if (this.first !== null && (this.options.wrap == "circular" || e >= 1 && (this.options.size === null || e <= this.options.size))) b = d ? b + m : b - m } f = this.clipping(); var p = [], o = 0, n = 0; j = this.get(a - 1); for (e = a; ++o; ) { g = this.get(e); l = !g.length; if (g.length === 0) { g = this.create(e).addClass(this.className("jcarousel-item-placeholder")); j.length === 0 ? this.list.prepend(g) : j[d ? "before" : "after"](g); if (this.first !== null && this.options.wrap == "circular" && this.options.size !== null && (e <= 0 || e > this.options.size)) { j = this.get(this.index(e)); if (j.length) g = this.add(e, j.clone(true)) } } j = g; m = this.dimension(g); if (m === 0) throw Error("jCarousel: No width/height set for items. This will cause an infinite loop. Aborting..."); if (this.options.wrap != "circular" && this.options.size !== null && e > this.options.size) p.push(g); else if (l) k += m; n += m; if (n >= f) break; e++ } for (g = 0; g < p.length; g++) p[g].remove(); if (k > 0) { this.list.css(this.wh, this.dimension(this.list) + k + "px"); if (d) { b -= k; this.list.css(this.lt, h.intval(this.list.css(this.lt)) - k + "px") } } k = a + o - 1; if (this.options.wrap != "circular" && this.options.size && k > this.options.size) k = this.options.size; if (e > k) { o = 0; e = k; for (n = 0; ++o; ) { g = this.get(e--); if (!g.length) break; n += this.dimension(g); if (n >= f) break } } e = k - o + 1; if (this.options.wrap != "circular" && e < 1) e = 1; if (this.inTail && d) { b += this.tail; this.inTail = false } this.tail = null; if (this.options.wrap != "circular" && k == this.options.size && k - o + 1 >= 1) { d = h.margin(this.get(k), !this.options.vertical ? "marginRight" : "marginBottom"); if (n - d > f) this.tail = n - f - d } if (c && a === this.options.size && this.tail) { b -= this.tail; this.inTail = true } for (; a-- > e; ) b += this.dimension(this.get(a)); this.prevFirst = this.first; this.prevLast = this.last; this.first = e; this.last = k; return b }, animate: function (a, c) { if (!(this.locked || this.animating)) { this.animating = true; var b = this, d = function () { b.animating = false; a === 0 && b.list.css(b.lt, 0); if (!b.autoStopped && (b.options.wrap == "circular" || b.options.wrap == "both" || b.options.wrap == "last" || b.options.size === null || b.last < b.options.size || b.last == b.options.size && b.tail !== null && !b.inTail)) b.startAuto(); b.buttons(); b.notify("onAfterAnimation"); if (b.options.wrap == "circular" && b.options.size !== null) for (var f = b.prevFirst; f <= b.prevLast; f++) if (f !== null && !(f >= b.first && f <= b.last) && (f < 1 || f > b.options.size)) b.remove(f) }; this.notify("onBeforeAnimation"); if (!this.options.animation || c === false) { this.list.css(this.lt, a + "px"); d() } else this.list.animate(!this.options.vertical ? this.options.rtl ? { right: a} : { left: a} : { top: a }, this.options.animation, this.options.easing, d) } }, startAuto: function (a) { if (a !== undefined) this.options.auto = a; if (this.options.auto === 0) return this.stopAuto(); if (this.timer === null) { this.autoStopped = false; var c = this; this.timer = window.setTimeout(function () { c.next() }, this.options.auto * 1E3) } }, stopAuto: function () { this.pauseAuto(); this.autoStopped = true }, pauseAuto: function () { if (this.timer !== null) { window.clearTimeout(this.timer); this.timer = null } }, buttons: function (a, c) { if (a == null) { a = !this.locked && this.options.size !== 0 && (this.options.wrap && this.options.wrap != "first" || this.options.size === null || this.last < this.options.size); if (!this.locked && (!this.options.wrap || this.options.wrap == "first") && this.options.size !== null && this.last >= this.options.size) a = this.tail !== null && !this.inTail } if (c == null) { c = !this.locked && this.options.size !== 0 && (this.options.wrap && this.options.wrap != "last" || this.first > 1); if (!this.locked && (!this.options.wrap || this.options.wrap == "last") && this.options.size !== null && this.first == 1) c = this.tail !== null && this.inTail } var b = this; if (this.buttonNext.size() > 0) { this.buttonNext.unbind(this.options.buttonNextEvent + ".jcarousel", this.funcNext); a && this.buttonNext.bind(this.options.buttonNextEvent + ".jcarousel", this.funcNext); this.buttonNext[a ? "removeClass" : "addClass"](this.className("jcarousel-next-disabled")).attr("disabled", a ? false : true); this.options.buttonNextCallback !== null && this.buttonNext.data("jcarouselstate") != a && this.buttonNext.each(function () { b.options.buttonNextCallback(b, this, a) }).data("jcarouselstate", a) } else this.options.buttonNextCallback !== null && this.buttonNextState != a && this.options.buttonNextCallback(b, null, a); if (this.buttonPrev.size() > 0) { this.buttonPrev.unbind(this.options.buttonPrevEvent + ".jcarousel", this.funcPrev); c && this.buttonPrev.bind(this.options.buttonPrevEvent + ".jcarousel", this.funcPrev); this.buttonPrev[c ? "removeClass" : "addClass"](this.className("jcarousel-prev-disabled")).attr("disabled", c ? false : true); this.options.buttonPrevCallback !== null && this.buttonPrev.data("jcarouselstate") != c && this.buttonPrev.each(function () { b.options.buttonPrevCallback(b, this, c) }).data("jcarouselstate", c) } else this.options.buttonPrevCallback !== null && this.buttonPrevState != c && this.options.buttonPrevCallback(b, null, c); this.buttonNextState = a; this.buttonPrevState = c }, notify: function (a) { var c = this.prevFirst === null ? "init" : this.prevFirst < this.first ? "next" : "prev"; this.callback("itemLoadCallback", a, c); if (this.prevFirst !== this.first) { this.callback("itemFirstInCallback", a, c, this.first); this.callback("itemFirstOutCallback", a, c, this.prevFirst) } if (this.prevLast !== this.last) { this.callback("itemLastInCallback", a, c, this.last); this.callback("itemLastOutCallback", a, c, this.prevLast) } this.callback("itemVisibleInCallback", a, c, this.first, this.last, this.prevFirst, this.prevLast); this.callback("itemVisibleOutCallback", a, c, this.prevFirst, this.prevLast, this.first, this.last) }, callback: function (a, c, b, d, f, j, e) { if (!(this.options[a] == null || typeof this.options[a] != "object" && c != "onAfterAnimation")) { var g = typeof this.options[a] == "object" ? this.options[a][c] : this.options[a]; if (i.isFunction(g)) { var k = this; if (d === undefined) g(k, b, c); else if (f === undefined) this.get(d).each(function () { g(k, this, d, b, c) }); else { a = function (m) { k.get(m).each(function () { g(k, this, m, b, c) }) }; for (var l = d; l <= f; l++) l !== null && !(l >= j && l <= e) && a(l) } } } }, create: function (a) { return this.format("<li></li>", a) }, format: function (a, c) { a = i(a); for (var b = a.get(0).className.split(" "), d = 0; d < b.length; d++) b[d].indexOf("jcarousel-") != -1 && a.removeClass(b[d]); a.addClass(this.className("jcarousel-item")).addClass(this.className("jcarousel-item-" + c)).css({ "float": this.options.rtl ? "right" : "left", "list-style": "none" }).attr("jcarouselindex", c); return a }, className: function (a) { return a + " " + a + (!this.options.vertical ? "-horizontal" : "-vertical") }, dimension: function (a, c) { var b = a.jquery !== undefined ? a[0] : a, d = !this.options.vertical ? (b.offsetWidth || h.intval(this.options.itemFallbackDimension)) + h.margin(b, "marginLeft") + h.margin(b, "marginRight") : (b.offsetHeight || h.intval(this.options.itemFallbackDimension)) + h.margin(b, "marginTop") + h.margin(b, "marginBottom"); if (c == null || d == c) return d; d = !this.options.vertical ? c - h.margin(b, "marginLeft") - h.margin(b, "marginRight") : c - h.margin(b, "marginTop") - h.margin(b, "marginBottom"); i(b).css(this.wh, d + "px"); return this.dimension(b) }, clipping: function () { return !this.options.vertical ? this.clip[0].offsetWidth - h.intval(this.clip.css("borderLeftWidth")) - h.intval(this.clip.css("borderRightWidth")) : this.clip[0].offsetHeight - h.intval(this.clip.css("borderTopWidth")) - h.intval(this.clip.css("borderBottomWidth")) }, index: function (a, c) { if (c == null) c = this.options.size; return Math.round(((a - 1) / c - Math.floor((a - 1) / c)) * c) + 1 } }); h.extend({ defaults: function (a) { return i.extend(q, a || {}) }, margin: function (a, c) { if (!a) return 0; var b = a.jquery !== undefined ? a[0] : a; if (c == "marginRight" && i.browser.safari) { var d = { display: "block", "float": "none", width: "auto" }, f, j; i.swap(b, d, function () { f = b.offsetWidth }); d.marginRight = 0; i.swap(b, d, function () { j = b.offsetWidth }); return j - f } return h.intval(i.css(b, c)) }, intval: function (a) { a = parseInt(a, 10); return isNaN(a) ? 0 : a } }); i.fn.jcarousel = function (a) { if (typeof a == "string") { var c = i(this).data("jcarousel"), b = Array.prototype.slice.call(arguments, 1); return c[a].apply(c, b) } else return this.each(function () { i(this).data("jcarousel", new h(this, a)) }) } })(jQuery);
    //termina jcarousel

    //começa prettyphoto
    /* ------------------------------------------------------------------------
    Class: prettyPhoto
    Use: Lightbox clone for jQuery
    Author: Stephane Caron (http://www.no-margin-for-errors.com)
    Version: 3.1.2
    ------------------------------------------------------------------------- */
    (function ($) {
        $.prettyPhoto = { version: '3.1.2' };

        $.fn.prettyPhoto = function (pp_settings) {
            pp_settings = jQuery.extend({
                animation_speed: 'fast', /* fast/slow/normal */
                slideshow: 5000, /* false OR interval time in ms */
                autoplay_slideshow: false, /* true/false */
                opacity: 0.80, /* Value between 0 and 1 */
                show_title: true, /* true/false */
                allow_resize: true, /* Resize the photos bigger than viewport. true/false */
                default_width: 500,
                default_height: 344,
                counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
                theme: 'pp_default', /* light_rounded / dark_rounded / light_square / dark_square / facebook */
                horizontal_padding: 20, /* The padding on each side of the picture */
                hideflash: false, /* Hides all the flash object on a page, set to TRUE if flash appears over prettyPhoto */
                wmode: 'opaque', /* Set the flash wmode attribute */
                autoplay: true, /* Automatically start videos: True/False */
                modal: false, /* If set to true, only the close button will close the window */
                deeplinking: true, /* Allow prettyPhoto to update the url to enable deeplinking. */
                overlay_gallery: true, /* If set to true, a gallery will overlay the fullscreen image on mouse over */
                keyboard_shortcuts: true, /* Set to false if you open forms inside prettyPhoto */
                changepicturecallback: function () { }, /* Called everytime an item is shown/changed */
                callback: function () { }, /* Called when prettyPhoto is closed */
                ie6_fallback: true,
                markup: '<div class="pp_pic_holder"> \
						<div class="ppt">&nbsp;</div> \
						<div class="pp_top"> \
							<div class="pp_left"></div> \
							<div class="pp_middle"></div> \
							<div class="pp_right"></div> \
						</div> \
						<div class="pp_content_container"> \
							<div class="pp_left"> \
							<div class="pp_right"> \
								<div class="pp_content"> \
									<div class="pp_loaderIcon"></div> \
									<div class="pp_fade"> \
										<a href="#" class="pp_expand" title="Expand the image">Expand</a> \
										<div class="pp_hoverContainer"> \
											<a class="pp_next" href="#">next</a> \
											<a class="pp_previous" href="#">previous</a> \
										</div> \
										<div id="pp_full_res"></div> \
										<div class="pp_details"> \
											<div class="pp_nav"> \
												<a href="#" class="pp_arrow_previous">Previous</a> \
												<p class="currentTextHolder">0/0</p> \
												<a href="#" class="pp_arrow_next">Next</a> \
											</div> \
											<p class="pp_description"></p> \
											{pp_social} \
											<a class="pp_close" href="#">Close</a> \
										</div> \
									</div> \
								</div> \
							</div> \
							</div> \
						</div> \
						<div class="pp_bottom"> \
							<div class="pp_left"></div> \
							<div class="pp_middle"></div> \
							<div class="pp_right"></div> \
						</div> \
					</div> \
					<div class="pp_overlay"></div>',
                gallery_markup: '<div class="pp_gallery"> \
								<a href="#" class="pp_arrow_previous">Previous</a> \
								<div> \
									<ul> \
										{gallery} \
									</ul> \
								</div> \
								<a href="#" class="pp_arrow_next">Next</a> \
							</div>',
                image_markup: '<img id="fullResImage" src="{path}" />',
                flash_markup: '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{width}" height="{height}"><param name="wmode" value="{wmode}" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{path}" /><embed src="{path}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="{width}" height="{height}" wmode="{wmode}"></embed></object>',
                quicktime_markup: '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="{height}" width="{width}"><param name="src" value="{path}"><param name="autoplay" value="{autoplay}"><param name="type" value="video/quicktime"><embed src="{path}" height="{height}" width="{width}" autoplay="{autoplay}" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>',
                iframe_markup: '<iframe src ="{path}" width="{width}" height="{height}" frameborder="no"></iframe>',
                inline_markup: '<div class="pp_inline">{content}</div>',
                custom_markup: '',
                social_tools: '<div class="pp_social"><div class="twitter"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="facebook"><iframe src="http://www.facebook.com/plugins/like.php?locale=en_US&href=' + location.href + '&amp;layout=button_count&amp;show_faces=true&amp;width=500&amp;action=like&amp;font&amp;colorscheme=light&amp;height=23" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:23px;" allowTransparency="true"></iframe></div></div>' /* html or false to disable */
            }, pp_settings);

            // Global variables accessible only by prettyPhoto
            var matchedObjects = this, percentBased = false, pp_dimensions, pp_open,

            // prettyPhoto container specific
		pp_contentHeight, pp_contentWidth, pp_containerHeight, pp_containerWidth,

            // Window size
		windowHeight = $(window).height(), windowWidth = $(window).width(),

            // Global elements
		pp_slideshow;

            doresize = true, scroll_pos = _get_scroll();

            // Window/Keyboard events
            $(window).unbind('resize.prettyphoto').bind('resize.prettyphoto', function () { _center_overlay(); _resize_overlay(); });

            if (pp_settings.keyboard_shortcuts) {
                $(document).unbind('keydown.prettyphoto').bind('keydown.prettyphoto', function (e) {
                    if (typeof $pp_pic_holder != 'undefined') {
                        if ($pp_pic_holder.is(':visible')) {
                            switch (e.keyCode) {
                                case 37:
                                    $.prettyPhoto.changePage('previous');
                                    e.preventDefault();
                                    break;
                                case 39:
                                    $.prettyPhoto.changePage('next');
                                    e.preventDefault();
                                    break;
                                case 27:
                                    if (!settings.modal)
                                        $.prettyPhoto.close();
                                    e.preventDefault();
                                    break;
                            };
                            // return false;
                        };
                    };
                });
            };

            /**
            * Initialize prettyPhoto.
            */
            $.prettyPhoto.initialize = function () {

                settings = pp_settings;

                if (settings.theme == 'pp_default') settings.horizontal_padding = 16;
                if (settings.ie6_fallback && $.browser.msie && parseInt($.browser.version) == 6) settings.theme = "light_square"; // Fallback to a supported theme for IE6

                // Find out if the picture is part of a set
                theRel = $(this).attr('rel');
                galleryRegExp = /\[(?:.*)\]/;
                isSet = (galleryRegExp.exec(theRel)) ? true : false;

                // Put the SRCs, TITLEs, ALTs into an array.
                pp_images = (isSet) ? jQuery.map(matchedObjects, function (n, i) { if ($(n).attr('rel').indexOf(theRel) != -1) return $(n).attr('href'); }) : $.makeArray($(this).attr('href'));
                pp_titles = (isSet) ? jQuery.map(matchedObjects, function (n, i) { if ($(n).attr('rel').indexOf(theRel) != -1) return ($(n).find('img').attr('alt')) ? $(n).find('img').attr('alt') : ""; }) : $.makeArray($(this).find('img').attr('alt'));
                pp_descriptions = (isSet) ? jQuery.map(matchedObjects, function (n, i) { if ($(n).attr('rel').indexOf(theRel) != -1) return ($(n).attr('title')) ? $(n).attr('title') : ""; }) : $.makeArray($(this).attr('title'));

                set_position = jQuery.inArray($(this).attr('href'), pp_images); // Define where in the array the clicked item is positionned
                rel_index = (isSet) ? set_position : $("a[rel^='" + theRel + "']").index($(this));

                _build_overlay(this); // Build the overlay {this} being the caller

                if (settings.allow_resize)
                    $(window).bind('scroll.prettyphoto', function () { _center_overlay(); });


                $.prettyPhoto.open();

                return false;
            }


            /**
            * Opens the prettyPhoto modal box.
            * @param image {String,Array} Full path to the image to be open, can also be an array containing full images paths.
            * @param title {String,Array} The title to be displayed with the picture, can also be an array containing all the titles.
            * @param description {String,Array} The description to be displayed with the picture, can also be an array containing all the descriptions.
            */
            $.prettyPhoto.open = function (event) {
                if (typeof settings == "undefined") { // Means it's an API call, need to manually get the settings and set the variables
                    settings = pp_settings;
                    if ($.browser.msie && $.browser.version == 6) settings.theme = "light_square"; // Fallback to a supported theme for IE6
                    pp_images = $.makeArray(arguments[0]);
                    pp_titles = (arguments[1]) ? $.makeArray(arguments[1]) : $.makeArray("");
                    pp_descriptions = (arguments[2]) ? $.makeArray(arguments[2]) : $.makeArray("");
                    isSet = (pp_images.length > 1) ? true : false;
                    set_position = 0;
                    _build_overlay(event.target); // Build the overlay {this} being the caller
                }

                if ($.browser.msie && $.browser.version == 6) $('select').css('visibility', 'hidden'); // To fix the bug with IE select boxes

                if (settings.hideflash) $('object,embed,iframe[src*=youtube],iframe[src*=vimeo]').css('visibility', 'hidden'); // Hide the flash

                _checkPosition($(pp_images).size()); // Hide the next/previous links if on first or last images.

                $('.pp_loaderIcon').show();

                // Fade the content in
                if ($ppt.is(':hidden')) $ppt.css('opacity', 0).show();
                $pp_overlay.show().fadeTo(settings.animation_speed, settings.opacity);

                // Display the current position
                $pp_pic_holder.find('.currentTextHolder').text((set_position + 1) + settings.counter_separator_label + $(pp_images).size());

                // Set the description
                if (pp_descriptions[set_position] != "") {
                    $pp_pic_holder.find('.pp_description').show().html(unescape(pp_descriptions[set_position]));
                } else {
                    $pp_pic_holder.find('.pp_description').hide();
                }

                // Get the dimensions
                movie_width = (parseFloat(getParam('width', pp_images[set_position]))) ? getParam('width', pp_images[set_position]) : settings.default_width.toString();
                movie_height = (parseFloat(getParam('height', pp_images[set_position]))) ? getParam('height', pp_images[set_position]) : settings.default_height.toString();

                // If the size is % based, calculate according to window dimensions
                percentBased = false;
                if (movie_height.indexOf('%') != -1) { movie_height = parseFloat(($(window).height() * parseFloat(movie_height) / 100) - 150); percentBased = true; }
                if (movie_width.indexOf('%') != -1) { movie_width = parseFloat(($(window).width() * parseFloat(movie_width) / 100) - 150); percentBased = true; }

                // Fade the holder
                $pp_pic_holder.fadeIn(function () {
                    // Set the title
                    (settings.show_title && pp_titles[set_position] != "" && typeof pp_titles[set_position] != "undefined") ? $ppt.html(unescape(pp_titles[set_position])) : $ppt.html('&nbsp;');

                    imgPreloader = "";
                    skipInjection = false;

                    // Inject the proper content
                    switch (_getFileType(pp_images[set_position])) {
                        case 'image':
                            imgPreloader = new Image();

                            // Preload the neighbour images
                            nextImage = new Image();
                            if (isSet && set_position < $(pp_images).size() - 1) nextImage.src = pp_images[set_position + 1];
                            prevImage = new Image();
                            if (isSet && pp_images[set_position - 1]) prevImage.src = pp_images[set_position - 1];

                            $pp_pic_holder.find('#pp_full_res')[0].innerHTML = settings.image_markup.replace(/{path}/g, pp_images[set_position]);

                            imgPreloader.onload = function () {
                                // Fit item to viewport
                                pp_dimensions = _fitToViewport(imgPreloader.width, imgPreloader.height);

                                _showContent();
                            };

                            imgPreloader.onerror = function () {
                                alert('Image cannot be loaded. Make sure the path is correct and image exist.');
                                $.prettyPhoto.close();
                            };

                            imgPreloader.src = pp_images[set_position];
                            break;

                        case 'youtube':
                            pp_dimensions = _fitToViewport(movie_width, movie_height); // Fit item to viewport

                            movie = 'http://www.youtube.com/embed/' + getParam('v', pp_images[set_position]);
                            (getParam('rel', pp_images[set_position])) ? movie += "?rel=" + getParam('rel', pp_images[set_position]) : movie += "?rel=1";

                            if (settings.autoplay) movie += "&autoplay=1";

                            toInject = settings.iframe_markup.replace(/{width}/g, pp_dimensions['width']).replace(/{height}/g, pp_dimensions['height']).replace(/{wmode}/g, settings.wmode).replace(/{path}/g, movie);
                            break;

                        case 'vimeo':
                            pp_dimensions = _fitToViewport(movie_width, movie_height); // Fit item to viewport

                            movie_id = pp_images[set_position];
                            var regExp = /http:\/\/(www\.)?vimeo.com\/(\d+)/;
                            var match = movie_id.match(regExp);

                            movie = 'http://player.vimeo.com/video/' + match[2] + '?title=0&amp;byline=0&amp;portrait=0';
                            if (settings.autoplay) movie += "&autoplay=1;";

                            vimeo_width = pp_dimensions['width'] + '/embed/?moog_width=' + pp_dimensions['width'];

                            toInject = settings.iframe_markup.replace(/{width}/g, vimeo_width).replace(/{height}/g, pp_dimensions['height']).replace(/{path}/g, movie);
                            break;

                        case 'quicktime':
                            pp_dimensions = _fitToViewport(movie_width, movie_height); // Fit item to viewport
                            pp_dimensions['height'] += 15; pp_dimensions['contentHeight'] += 15; pp_dimensions['containerHeight'] += 15; // Add space for the control bar

                            toInject = settings.quicktime_markup.replace(/{width}/g, pp_dimensions['width']).replace(/{height}/g, pp_dimensions['height']).replace(/{wmode}/g, settings.wmode).replace(/{path}/g, pp_images[set_position]).replace(/{autoplay}/g, settings.autoplay);
                            break;

                        case 'flash':
                            pp_dimensions = _fitToViewport(movie_width, movie_height); // Fit item to viewport

                            flash_vars = pp_images[set_position];
                            flash_vars = flash_vars.substring(pp_images[set_position].indexOf('flashvars') + 10, pp_images[set_position].length);

                            filename = pp_images[set_position];
                            filename = filename.substring(0, filename.indexOf('?'));

                            toInject = settings.flash_markup.replace(/{width}/g, pp_dimensions['width']).replace(/{height}/g, pp_dimensions['height']).replace(/{wmode}/g, settings.wmode).replace(/{path}/g, filename + '?' + flash_vars);
                            break;

                        case 'iframe':
                            pp_dimensions = _fitToViewport(movie_width, movie_height); // Fit item to viewport

                            frame_url = pp_images[set_position];
                            frame_url = frame_url.substr(0, frame_url.indexOf('iframe') - 1);

                            toInject = settings.iframe_markup.replace(/{width}/g, pp_dimensions['width']).replace(/{height}/g, pp_dimensions['height']).replace(/{path}/g, frame_url);
                            break;

                        case 'ajax':
                            doresize = false; // Make sure the dimensions are not resized.
                            pp_dimensions = _fitToViewport(movie_width, movie_height);
                            doresize = true; // Reset the dimensions

                            skipInjection = true;
                            $.get(pp_images[set_position], function (responseHTML) {
                                toInject = settings.inline_markup.replace(/{content}/g, responseHTML);
                                $pp_pic_holder.find('#pp_full_res')[0].innerHTML = toInject;
                                _showContent();
                            });

                            break;

                        case 'custom':
                            pp_dimensions = _fitToViewport(movie_width, movie_height); // Fit item to viewport

                            toInject = settings.custom_markup;
                            break;

                        case 'inline':
                            // to get the item height clone it, apply default width, wrap it in the prettyPhoto containers , then delete
                            myClone = $(pp_images[set_position]).clone().append('<br clear="all" />').css({ 'width': settings.default_width }).wrapInner('<div id="pp_full_res"><div class="pp_inline"></div></div>').appendTo($('body')).show();
                            doresize = false; // Make sure the dimensions are not resized.
                            pp_dimensions = _fitToViewport($(myClone).width(), $(myClone).height());
                            doresize = true; // Reset the dimensions
                            $(myClone).remove();
                            toInject = settings.inline_markup.replace(/{content}/g, $(pp_images[set_position]).html());
                            break;
                    };

                    if (!imgPreloader && !skipInjection) {
                        $pp_pic_holder.find('#pp_full_res')[0].innerHTML = toInject;

                        // Show content
                        _showContent();
                    };
                });

                return false;
            };


            /**
            * Change page in the prettyPhoto modal box
            * @param direction {String} Direction of the paging, previous or next.
            */
            $.prettyPhoto.changePage = function (direction) {
                currentGalleryPage = 0;

                if (direction == 'previous') {
                    set_position--;
                    if (set_position < 0) set_position = $(pp_images).size() - 1;
                } else if (direction == 'next') {
                    set_position++;
                    if (set_position > $(pp_images).size() - 1) set_position = 0;
                } else {
                    set_position = direction;
                };

                rel_index = set_position;

                if (!doresize) doresize = true; // Allow the resizing of the images
                $('.pp_contract').removeClass('pp_contract').addClass('pp_expand');

                _hideContent(function () { $.prettyPhoto.open(); });
            };


            /**
            * Change gallery page in the prettyPhoto modal box
            * @param direction {String} Direction of the paging, previous or next.
            */
            $.prettyPhoto.changeGalleryPage = function (direction) {
                if (direction == 'next') {
                    currentGalleryPage++;

                    if (currentGalleryPage > totalPage) currentGalleryPage = 0;
                } else if (direction == 'previous') {
                    currentGalleryPage--;

                    if (currentGalleryPage < 0) currentGalleryPage = totalPage;
                } else {
                    currentGalleryPage = direction;
                };

                slide_speed = (direction == 'next' || direction == 'previous') ? settings.animation_speed : 0;

                slide_to = currentGalleryPage * (itemsPerPage * itemWidth);

                $pp_gallery.find('ul').animate({ left: -slide_to }, slide_speed);
            };


            /**
            * Start the slideshow...
            */
            $.prettyPhoto.startSlideshow = function () {
                if (typeof pp_slideshow == 'undefined') {
                    $pp_pic_holder.find('.pp_play').unbind('click').removeClass('pp_play').addClass('pp_pause').click(function () {
                        $.prettyPhoto.stopSlideshow();
                        return false;
                    });
                    pp_slideshow = setInterval($.prettyPhoto.startSlideshow, settings.slideshow);
                } else {
                    $.prettyPhoto.changePage('next');
                };
            }


            /**
            * Stop the slideshow...
            */
            $.prettyPhoto.stopSlideshow = function () {
                $pp_pic_holder.find('.pp_pause').unbind('click').removeClass('pp_pause').addClass('pp_play').click(function () {
                    $.prettyPhoto.startSlideshow();
                    return false;
                });
                clearInterval(pp_slideshow);
                pp_slideshow = undefined;
            }


            /**
            * Closes prettyPhoto.
            */
            $.prettyPhoto.close = function () {
                if ($pp_overlay.is(":animated")) return;

                $.prettyPhoto.stopSlideshow();

                $pp_pic_holder.stop().find('object,embed').css('visibility', 'hidden');

                $('div.pp_pic_holder,div.ppt,.pp_fade').fadeOut(settings.animation_speed, function () { $(this).remove(); });

                $pp_overlay.fadeOut(settings.animation_speed, function () {
                    if ($.browser.msie && $.browser.version == 6) $('select').css('visibility', 'visible'); // To fix the bug with IE select boxes

                    if (settings.hideflash) $('object,embed,iframe[src*=youtube],iframe[src*=vimeo]').css('visibility', 'visible'); // Show the flash

                    $(this).remove(); // No more need for the prettyPhoto markup

                    $(window).unbind('scroll.prettyphoto');

                    settings.callback();

                    doresize = true;

                    pp_open = false;

                    delete settings;
                });
            };

            /**
            * Set the proper sizes on the containers and animate the content in.
            */
            function _showContent() {
                $('.pp_loaderIcon').hide();

                // Calculate the opened top position of the pic holder
                projectedTop = scroll_pos['scrollTop'] + ((windowHeight / 2) - (pp_dimensions['containerHeight'] / 2));
                if (projectedTop < 0) projectedTop = 0;

                $ppt.fadeTo(settings.animation_speed, 1);

                // Resize the content holder
                $pp_pic_holder.find('.pp_content')
				.animate({
				    height: pp_dimensions['contentHeight'],
				    width: pp_dimensions['contentWidth']
				}, settings.animation_speed);

                // Resize picture the holder
                $pp_pic_holder.animate({
                    'top': projectedTop,
                    'left': (windowWidth / 2) - (pp_dimensions['containerWidth'] / 2),
                    width: pp_dimensions['containerWidth']
                }, settings.animation_speed, function () {
                    $pp_pic_holder.find('.pp_hoverContainer,#fullResImage').height(pp_dimensions['height']).width(pp_dimensions['width']);

                    $pp_pic_holder.find('.pp_fade').fadeIn(settings.animation_speed); // Fade the new content

                    // Show the nav
                    if (isSet && _getFileType(pp_images[set_position]) == "image") { $pp_pic_holder.find('.pp_hoverContainer').show(); } else { $pp_pic_holder.find('.pp_hoverContainer').hide(); }

                    if (pp_dimensions['resized']) { // Fade the resizing link if the image is resized
                        $('a.pp_expand,a.pp_contract').show();
                    } else {
                        $('a.pp_expand').hide();
                    }

                    if (settings.autoplay_slideshow && !pp_slideshow && !pp_open) $.prettyPhoto.startSlideshow();

                    if (settings.deeplinking)
                        setHashtag();

                    settings.changepicturecallback(); // Callback!

                    pp_open = true;
                });

                _insert_gallery();
            };

            /**
            * Hide the content...DUH!
            */
            function _hideContent(callback) {
                // Fade out the current picture
                $pp_pic_holder.find('#pp_full_res object,#pp_full_res embed').css('visibility', 'hidden');
                $pp_pic_holder.find('.pp_fade').fadeOut(settings.animation_speed, function () {
                    $('.pp_loaderIcon').show();

                    callback();
                });
            };

            /**
            * Check the item position in the gallery array, hide or show the navigation links
            * @param setCount {integer} The total number of items in the set
            */
            function _checkPosition(setCount) {
                (setCount > 1) ? $('.pp_nav').show() : $('.pp_nav').hide(); // Hide the bottom nav if it's not a set.
            };

            /**
            * Resize the item dimensions if it's bigger than the viewport
            * @param width {integer} Width of the item to be opened
            * @param height {integer} Height of the item to be opened
            * @return An array containin the "fitted" dimensions
            */
            function _fitToViewport(width, height) {
                resized = false;

                _getDimensions(width, height);

                // Define them in case there's no resize needed
                imageWidth = width, imageHeight = height;

                if (((pp_containerWidth > windowWidth) || (pp_containerHeight > windowHeight)) && doresize && settings.allow_resize && !percentBased) {
                    resized = true, fitting = false;

                    while (!fitting) {
                        if ((pp_containerWidth > windowWidth)) {
                            imageWidth = (windowWidth - 200);
                            imageHeight = (height / width) * imageWidth;
                        } else if ((pp_containerHeight > windowHeight)) {
                            imageHeight = (windowHeight - 200);
                            imageWidth = (width / height) * imageHeight;
                        } else {
                            fitting = true;
                        };

                        pp_containerHeight = imageHeight, pp_containerWidth = imageWidth;
                    };

                    _getDimensions(imageWidth, imageHeight);

                    if ((pp_containerWidth > windowWidth) || (pp_containerHeight > windowHeight)) {
                        _fitToViewport(pp_containerWidth, pp_containerHeight)
                    };
                };

                return {
                    width: Math.floor(imageWidth),
                    height: Math.floor(imageHeight),
                    containerHeight: Math.floor(pp_containerHeight),
                    containerWidth: Math.floor(pp_containerWidth) + (settings.horizontal_padding * 2),
                    contentHeight: Math.floor(pp_contentHeight),
                    contentWidth: Math.floor(pp_contentWidth),
                    resized: resized
                };
            };

            /**
            * Get the containers dimensions according to the item size
            * @param width {integer} Width of the item to be opened
            * @param height {integer} Height of the item to be opened
            */
            function _getDimensions(width, height) {
                width = parseFloat(width);
                height = parseFloat(height);

                // Get the details height, to do so, I need to clone it since it's invisible
                $pp_details = $pp_pic_holder.find('.pp_details');
                $pp_details.width(width);
                detailsHeight = parseFloat($pp_details.css('marginTop')) + parseFloat($pp_details.css('marginBottom'));

                $pp_details = $pp_details.clone().addClass(settings.theme).width(width).appendTo($('body')).css({
                    'position': 'absolute',
                    'top': -10000
                });
                detailsHeight += $pp_details.height();
                detailsHeight = (detailsHeight <= 34) ? 36 : detailsHeight; // Min-height for the details
                if ($.browser.msie && $.browser.version == 7) detailsHeight += 8;
                $pp_details.remove();

                // Get the titles height, to do so, I need to clone it since it's invisible
                $pp_title = $pp_pic_holder.find('.ppt');
                $pp_title.width(width);
                titleHeight = parseFloat($pp_title.css('marginTop')) + parseFloat($pp_title.css('marginBottom'));
                $pp_title = $pp_title.clone().appendTo($('body')).css({
                    'position': 'absolute',
                    'top': -10000
                });
                titleHeight += $pp_title.height();
                $pp_title.remove();

                // Get the container size, to resize the holder to the right dimensions
                pp_contentHeight = height + detailsHeight;
                pp_contentWidth = width;
                pp_containerHeight = pp_contentHeight + titleHeight + $pp_pic_holder.find('.pp_top').height() + $pp_pic_holder.find('.pp_bottom').height();
                pp_containerWidth = width;
            }

            function _getFileType(itemSrc) {
                if (itemSrc.match(/youtube\.com\/watch/i)) {
                    return 'youtube';
                } else if (itemSrc.match(/vimeo\.com/i)) {
                    return 'vimeo';
                } else if (itemSrc.match(/\b.mov\b/i)) {
                    return 'quicktime';
                } else if (itemSrc.match(/\b.swf\b/i)) {
                    return 'flash';
                } else if (itemSrc.match(/\biframe=true\b/i)) {
                    return 'iframe';
                } else if (itemSrc.match(/\bajax=true\b/i)) {
                    return 'ajax';
                } else if (itemSrc.match(/\bcustom=true\b/i)) {
                    return 'custom';
                } else if (itemSrc.substr(0, 1) == '#') {
                    return 'inline';
                } else {
                    return 'image';
                };
            };

            function _center_overlay() {
                if (doresize && typeof $pp_pic_holder != 'undefined') {
                    scroll_pos = _get_scroll();
                    contentHeight = $pp_pic_holder.height(), contentwidth = $pp_pic_holder.width();

                    projectedTop = (windowHeight / 2) + scroll_pos['scrollTop'] - (contentHeight / 2);
                    if (projectedTop < 0) projectedTop = 0;

                    if (contentHeight > windowHeight)
                        return;

                    $pp_pic_holder.css({
                        'top': projectedTop,
                        'left': (windowWidth / 2) + scroll_pos['scrollLeft'] - (contentwidth / 2)
                    });
                };
            };

            function _get_scroll() {
                if (self.pageYOffset) {
                    return { scrollTop: self.pageYOffset, scrollLeft: self.pageXOffset };
                } else if (document.documentElement && document.documentElement.scrollTop) { // Explorer 6 Strict
                    return { scrollTop: document.documentElement.scrollTop, scrollLeft: document.documentElement.scrollLeft };
                } else if (document.body) {// all other Explorers
                    return { scrollTop: document.body.scrollTop, scrollLeft: document.body.scrollLeft };
                };
            };

            function _resize_overlay() {
                windowHeight = $(window).height(), windowWidth = $(window).width();

                if (typeof $pp_overlay != "undefined") $pp_overlay.height($(document).height()).width(windowWidth);
            };

            function _insert_gallery() {
                if (isSet && settings.overlay_gallery && _getFileType(pp_images[set_position]) == "image" && (settings.ie6_fallback && !($.browser.msie && parseInt($.browser.version) == 6))) {
                    itemWidth = 52 + 5; // 52 beign the thumb width, 5 being the right margin.
                    navWidth = (settings.theme == "facebook" || settings.theme == "pp_default") ? 50 : 30; // Define the arrow width depending on the theme

                    itemsPerPage = Math.floor((pp_dimensions['containerWidth'] - 100 - navWidth) / itemWidth);
                    itemsPerPage = (itemsPerPage < pp_images.length) ? itemsPerPage : pp_images.length;
                    totalPage = Math.ceil(pp_images.length / itemsPerPage) - 1;

                    // Hide the nav in the case there's no need for links
                    if (totalPage == 0) {
                        navWidth = 0; // No nav means no width!
                        $pp_gallery.find('.pp_arrow_next,.pp_arrow_previous').hide();
                    } else {
                        $pp_gallery.find('.pp_arrow_next,.pp_arrow_previous').show();
                    };

                    galleryWidth = itemsPerPage * itemWidth;
                    fullGalleryWidth = pp_images.length * itemWidth;

                    // Set the proper width to the gallery items
                    $pp_gallery
					.css('margin-left', -((galleryWidth / 2) + (navWidth / 2)))
					.find('div:first').width(galleryWidth + 5)
					.find('ul').width(fullGalleryWidth)
					.find('li.selected').removeClass('selected');

                    goToPage = (Math.floor(set_position / itemsPerPage) < totalPage) ? Math.floor(set_position / itemsPerPage) : totalPage;

                    $.prettyPhoto.changeGalleryPage(goToPage);

                    $pp_gallery_li.filter(':eq(' + set_position + ')').addClass('selected');
                } else {
                    $pp_pic_holder.find('.pp_content').unbind('mouseenter mouseleave');
                    // $pp_gallery.hide();
                }
            }

            function _build_overlay(caller) {

                settings.markup = settings.markup.replace('{pp_social}', (settings.social_tools) ? settings.social_tools : '');

                $('body').append(settings.markup); // Inject the markup

                $pp_pic_holder = $('.pp_pic_holder'), $ppt = $('.ppt'), $pp_overlay = $('div.pp_overlay'); // Set my global selectors

                // Inject the inline gallery!
                if (isSet && settings.overlay_gallery) {
                    currentGalleryPage = 0;
                    toInject = "";
                    for (var i = 0; i < pp_images.length; i++) {
                        if (!pp_images[i].match(/\b(jpg|jpeg|png|gif)\b/gi)) {
                            classname = 'default';
                            img_src = '';
                        } else {
                            classname = '';
                            img_src = pp_images[i];
                        }
                        toInject += "<li class='" + classname + "'><a href='#'><img src='" + img_src + "' width='50' alt='' /></a></li>";
                    };

                    toInject = settings.gallery_markup.replace(/{gallery}/g, toInject);

                    $pp_pic_holder.find('#pp_full_res').after(toInject);

                    $pp_gallery = $('.pp_pic_holder .pp_gallery'), $pp_gallery_li = $pp_gallery.find('li'); // Set the gallery selectors

                    $pp_gallery.find('.pp_arrow_next').click(function () {
                        $.prettyPhoto.changeGalleryPage('next');
                        $.prettyPhoto.stopSlideshow();
                        return false;
                    });

                    $pp_gallery.find('.pp_arrow_previous').click(function () {
                        $.prettyPhoto.changeGalleryPage('previous');
                        $.prettyPhoto.stopSlideshow();
                        return false;
                    });

                    $pp_pic_holder.find('.pp_content').hover(
					function () {
					    $pp_pic_holder.find('.pp_gallery:not(.disabled)').fadeIn();
					},
					function () {
					    $pp_pic_holder.find('.pp_gallery:not(.disabled)').fadeOut();
					});

                    itemWidth = 52 + 5; // 52 beign the thumb width, 5 being the right margin.
                    $pp_gallery_li.each(function (i) {
                        $(this)
						.find('a')
						.click(function () {
						    $.prettyPhoto.changePage(i);
						    $.prettyPhoto.stopSlideshow();
						    return false;
						});
                    });
                };


                // Inject the play/pause if it's a slideshow
                if (settings.slideshow) {
                    $pp_pic_holder.find('.pp_nav').prepend('<a href="#" class="pp_play">Play</a>')
                    $pp_pic_holder.find('.pp_nav .pp_play').click(function () {
                        $.prettyPhoto.startSlideshow();
                        return false;
                    });
                }

                $pp_pic_holder.attr('class', 'pp_pic_holder ' + settings.theme); // Set the proper theme

                $pp_overlay
				.css({
				    'opacity': 0,
				    'height': $(document).height(),
				    'width': $(window).width()
				})
				.bind('click', function () {
				    if (!settings.modal) $.prettyPhoto.close();
				});

                $('a.pp_close').bind('click', function () { $.prettyPhoto.close(); return false; });
                $('a.pp_close_projeto').bind('click', function () { $.prettyPhoto.close(); setTimeout('parent.chamaModalFacaProjeto();', 400); return false; }); /*Essa função "chamaModalFacaProjeto()" esta na pagina Simulador.aspx linha 45*/

                $('a.pp_expand').bind('click', function (e) {
                    // Expand the image
                    if ($(this).hasClass('pp_expand')) {
                        $(this).removeClass('pp_expand').addClass('pp_contract');
                        doresize = false;
                    } else {
                        $(this).removeClass('pp_contract').addClass('pp_expand');
                        doresize = true;
                    };

                    _hideContent(function () { $.prettyPhoto.open(); });

                    return false;
                });

                $pp_pic_holder.find('.pp_previous, .pp_nav .pp_arrow_previous').bind('click', function () {
                    $.prettyPhoto.changePage('previous');
                    $.prettyPhoto.stopSlideshow();
                    return false;
                });

                $pp_pic_holder.find('.pp_next, .pp_nav .pp_arrow_next').bind('click', function () {
                    $.prettyPhoto.changePage('next');
                    $.prettyPhoto.stopSlideshow();
                    return false;
                });

                _center_overlay(); // Center it
            };

            if (!pp_alreadyInitialized && getHashtag()) {
                pp_alreadyInitialized = true;

                // Grab the rel index to trigger the click on the correct element
                hashIndex = getHashtag();
                hashRel = hashIndex;
                hashIndex = hashIndex.substring(hashIndex.indexOf('/') + 1, hashIndex.length - 1);
                hashRel = hashRel.substring(0, hashRel.indexOf('/'));

                // Little timeout to make sure all the prettyPhoto initialize scripts has been run.
                // Useful in the event the page contain several init scripts.
                setTimeout(function () { $("a[rel^='" + hashRel + "']:eq(" + hashIndex + ")").trigger('click'); }, 50);
            }

            return this.unbind('click.prettyphoto').bind('click.prettyphoto', $.prettyPhoto.initialize); // Return the jQuery object for chaining. The unbind method is used to avoid click conflict when the plugin is called more than once
        };

        function getHashtag() {
            url = location.href;
            hashtag = (url.indexOf('#!') != -1) ? decodeURI(url.substring(url.indexOf('#!') + 2, url.length)) : false;
            return hashtag;
        };

        function setHashtag() {
            if (typeof theRel == 'undefined') return; // theRel is set on normal calls, it's impossible to deeplink using the API
            location.hash = '!' + theRel + '/' + rel_index + '/';
        };

        function getParam(name, url) {
            name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
            var regexS = "[\\?&]" + name + "=([^&#]*)";
            var regex = new RegExp(regexS);
            var results = regex.exec(url);
            return (results == null) ? "" : results[1];
        }

    })(jQuery);

    var pp_alreadyInitialized = false; // Used for the deep linking to make sure not to call the same function several times.
    //termina prettyphoto

    //começa EasyListSplitter
    var j = 1;

    (function (jQuery) {
        jQuery.fn.easyListSplitter = function (options) {

            var defaults = {
                colNumber: 2, // Insert here the number of columns you want. Consider that the plugin will create the number of cols requested only if there are enough items in the list.
                direction: 'vertical'
            };

            this.each(function () {

                var obj = jQuery(this);
                var settings = jQuery.extend(defaults, options);
                var totalListElements = jQuery(this).children('li').size();
                var baseColItems = Math.ceil(totalListElements / settings.colNumber);
                var listClass = jQuery(this).attr('class');

                // -------- Create List Elements given colNumber ------------------------------------------------------------------------------

                for (i = 1; i <= settings.colNumber; i++) {
                    if (i == 1) {
                        jQuery(this).addClass('listCol1').wrap('<div class="listContainer' + j + '"></div>');
                    } else if (jQuery(this).is('ul')) { // Check whether the list is ordered or unordered
                        jQuery(this).parents('.listContainer' + j).append('<ul class="listCol' + i + '"></ul>');
                    } else {
                        jQuery(this).parents('.listContainer' + j).append('<ol class="listCol' + i + '"></ol>');
                    }
                    jQuery('.listContainer' + j + ' > ul,.listContainer' + j + ' > ol').addClass(listClass);
                }

                var listItem = 0;
                var k = 1;
                var l = 0;

                if (settings.direction == 'vertical') { // -------- Append List Elements to the respective listCol  - Vertical -------------------------------

                    jQuery(this).children('li').each(function () {
                        listItem = listItem + 1;
                        if (listItem > baseColItems * (settings.colNumber - 1)) {
                            jQuery(this).parents('.listContainer' + j).find('.listCol' + settings.colNumber).append(this);
                        }
                        else {
                            if (listItem <= (baseColItems * k)) {
                                jQuery(this).parents('.listContainer' + j).find('.listCol' + k).append(this);
                            }
                            else {
                                jQuery(this).parents('.listContainer' + j).find('.listCol' + (k + 1)).append(this);
                                k = k + 1;
                            }
                        }
                    });

                    jQuery('.listContainer' + j).find('ol,ul').each(function () {
                        if (jQuery(this).children().size() == 0) {
                            jQuery(this).remove();
                        }
                    });

                } else {  // -------- Append List Elements to the respective listCol  - Horizontal ----------------------------------------------------------

                    jQuery(this).children('li').each(function () {
                        l = l + 1;

                        if (l <= settings.colNumber) {
                            jQuery(this).parents('.listContainer' + j).find('.listCol' + l).append(this);

                        } else {
                            l = 1;
                            jQuery(this).parents('.listContainer' + j).find('.listCol' + l).append(this);
                        }
                    });
                }

                jQuery('.listContainer' + j).find('ol:last,ul:last').addClass('last'); // Set class last on the last UL or OL	
                j = j + 1;

            });
        };
    })(jQuery);
    //termina EasyListSplitter

    //começa mousewheel
    var types = ['DOMMouseScroll', 'mousewheel'];

    $.event.special.mousewheel = {
        setup: function () {
            if (this.addEventListener) {
                for (var i = types.length; i; ) {
                    this.addEventListener(types[--i], handler, false);
                }
            } else {
                this.onmousewheel = handler;
            }
        },

        teardown: function () {
            if (this.removeEventListener) {
                for (var i = types.length; i; ) {
                    this.removeEventListener(types[--i], handler, false);
                }
            } else {
                this.onmousewheel = null;
            }
        }
    };

    $.fn.extend({
        mousewheel: function (fn) {
            return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel");
        },

        unmousewheel: function (fn) {
            return this.unbind("mousewheel", fn);
        }
    });


    function handler(event) {
        var orgEvent = event || window.event, args = [].slice.call(arguments, 1), delta = 0, returnValue = true, deltaX = 0, deltaY = 0;
        event = $.event.fix(orgEvent);
        event.type = "mousewheel";

        // Old school scrollwheel delta
        if (event.wheelDelta) { delta = event.wheelDelta / 120; }
        if (event.detail) { delta = -event.detail / 3; }

        // New school multidimensional scroll (touchpads) deltas
        deltaY = delta;

        // Gecko
        if (orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS) {
            deltaY = 0;
            deltaX = -1 * delta;
        }

        // Webkit
        if (orgEvent.wheelDeltaY !== undefined) { deltaY = orgEvent.wheelDeltaY / 120; }
        if (orgEvent.wheelDeltaX !== undefined) { deltaX = -1 * orgEvent.wheelDeltaX / 120; }

        // Add event and delta to the front of the arguments
        args.unshift(event, delta, deltaX, deltaY);

        return $.event.handle.apply(this, args);
    }
    //termina mousewheel

    //começa jcrollpane
    (function (b, a, c) {
        b.fn.jScrollPane = function (f) {
            function d(C, L) {
                var au, N = this, V, ah, v, aj, Q, W, y, q, av, aB, ap, i, H, h, j, X, R, al, U, t, A, am, ac, ak, F, l, ao, at, x, aq, aE, g, aA, ag = true, M = true, aD = false, k = false, Z = b.fn.mwheelIntent ? "mwheelIntent.jsp" : "mousewheel.jsp"; aE = C.css("paddingTop") + " " + C.css("paddingRight") + " " + C.css("paddingBottom") + " " + C.css("paddingLeft"); g = (parseInt(C.css("paddingLeft")) || 0) + (parseInt(C.css("paddingRight")) || 0); an(L); function an(aH) { var aL, aK, aJ, aG, aF, aI; au = aH; if (V == c) { C.css({ overflow: "hidden", padding: 0 }); ah = C.innerWidth() + g; v = C.innerHeight(); C.width(ah); V = b('<div class="jspPane" />').wrap(b('<div class="jspContainer" />').css({ width: ah + "px", height: v + "px" })); C.wrapInner(V.parent()); aj = C.find(">.jspContainer"); V = aj.find(">.jspPane"); V.css("padding", aE) } else { C.css("width", ""); aI = C.outerWidth() + g != ah || C.outerHeight() != v; if (aI) { ah = C.innerWidth() + g; v = C.innerHeight(); aj.css({ width: ah + "px", height: v + "px" }) } aA = V.innerWidth(); if (!aI && V.outerWidth() == Q && V.outerHeight() == W) { if (aB || av) { V.css("width", aA + "px"); C.css("width", (aA + g) + "px") } return } V.css("width", ""); C.css("width", (ah) + "px"); aj.find(">.jspVerticalBar,>.jspHorizontalBar").remove().end() } aL = V.clone().css("position", "absolute"); aK = b('<div style="width:1px; position: relative;" />').append(aL); b("body").append(aK); Q = Math.max(V.outerWidth(), aL.outerWidth()); aK.remove(); W = V.outerHeight(); y = Q / ah; q = W / v; av = q > 1; aB = y > 1; if (!(aB || av)) { C.removeClass("jspScrollable"); V.css({ top: 0, width: aj.width() - g }); n(); D(); O(); w(); af() } else { C.addClass("jspScrollable"); aJ = au.maintainPosition && (H || X); if (aJ) { aG = ay(); aF = aw() } aC(); z(); E(); if (aJ) { K(aG); J(aF) } I(); ad(); if (au.enableKeyboardNavigation) { P() } if (au.clickOnTrack) { p() } B(); if (au.hijackInternalLinks) { m() } } if (au.autoReinitialise && !aq) { aq = setInterval(function () { an(au) }, au.autoReinitialiseDelay) } else { if (!au.autoReinitialise && aq) { clearInterval(aq) } } C.trigger("jsp-initialised", [aB || av]) } function aC() { if (av) { aj.append(b('<div class="jspVerticalBar" />').append(b('<div class="jspCap jspCapTop" />'), b('<div class="jspTrack" />').append(b('<div class="jspDrag" />').append(b('<div class="jspDragTop" />'), b('<div class="jspDragBottom" />'))), b('<div class="jspCap jspCapBottom" />'))); R = aj.find(">.jspVerticalBar"); al = R.find(">.jspTrack"); ap = al.find(">.jspDrag"); if (au.showArrows) { am = b('<a class="jspArrow jspArrowUp" />').bind("mousedown.jsp", az(0, -1)).bind("click.jsp", ax); ac = b('<a class="jspArrow jspArrowDown" />').bind("mousedown.jsp", az(0, 1)).bind("click.jsp", ax); if (au.arrowScrollOnHover) { am.bind("mouseover.jsp", az(0, -1, am)); ac.bind("mouseover.jsp", az(0, 1, ac)) } ai(al, au.verticalArrowPositions, am, ac) } t = v; aj.find(">.jspVerticalBar>.jspCap:visible,>.jspVerticalBar>.jspArrow").each(function () { t -= b(this).outerHeight() }); ap.hover(function () { ap.addClass("jspHover") }, function () { ap.removeClass("jspHover") }).bind("mousedown.jsp", function (aF) { b("html").bind("dragstart.jsp selectstart.jsp", function () { return false }); ap.addClass("jspActive"); var s = aF.pageY - ap.position().top; b("html").bind("mousemove.jsp", function (aG) { S(aG.pageY - s, false) }).bind("mouseup.jsp mouseleave.jsp", ar); return false }); o() } } function o() { al.height(t + "px"); H = 0; U = au.verticalGutter + al.outerWidth(); V.width(ah - U - g); if (R.position().left == 0) { V.css("margin-left", U + "px") } } function z() {
                    if (aB) {
                        aj.append(b('<div class="jspHorizontalBar" />').append(b('<div class="jspCap jspCapLeft" />'), b('<div class="jspTrack" />').append(b('<div class="jspDrag" />').append(b('<div class="jspDragLeft" />'), b('<div class="jspDragRight" />'))), b('<div class="jspCap jspCapRight" />'))); ak = aj.find(">.jspHorizontalBar"); F = ak.find(">.jspTrack"); h = F.find(">.jspDrag"); if (au.showArrows) {
                            at = b('<a class="jspArrow jspArrowLeft" />').bind("mousedown.jsp", az(-1, 0)).bind("click.jsp", ax); x = b('<a class="jspArrow jspArrowRight" />').bind("mousedown.jsp", az(1, 0)).bind("click.jsp", ax); if (au.arrowScrollOnHover) {
                                at.bind("mouseover.jsp", az(-1, 0, at));
                                x.bind("mouseover.jsp", az(1, 0, x))
                            } ai(F, au.horizontalArrowPositions, at, x)
                        } h.hover(function () { h.addClass("jspHover") }, function () { h.removeClass("jspHover") }).bind("mousedown.jsp", function (aF) { b("html").bind("dragstart.jsp selectstart.jsp", function () { return false }); h.addClass("jspActive"); var s = aF.pageX - h.position().left; b("html").bind("mousemove.jsp", function (aG) { T(aG.pageX - s, false) }).bind("mouseup.jsp mouseleave.jsp", ar); return false }); l = aj.innerWidth(); ae()
                    } else { }
                } function ae() { aj.find(">.jspHorizontalBar>.jspCap:visible,>.jspHorizontalBar>.jspArrow").each(function () { l -= b(this).outerWidth() }); F.width(l + "px"); X = 0 } function E() { if (aB && av) { var aF = F.outerHeight(), s = al.outerWidth(); t -= aF; b(ak).find(">.jspCap:visible,>.jspArrow").each(function () { l += b(this).outerWidth() }); l -= s; v -= s; ah -= aF; F.parent().append(b('<div class="jspCorner" />').css("width", aF + "px")); o(); ae() } if (aB) { V.width((aj.outerWidth() - g) + "px") } W = V.outerHeight(); q = W / v; if (aB) { ao = 1 / y * l; if (ao > au.horizontalDragMaxWidth) { ao = au.horizontalDragMaxWidth } else { if (ao < au.horizontalDragMinWidth) { ao = au.horizontalDragMinWidth } } h.width(ao + "px"); j = l - ao; ab(X) } if (av) { A = 1 / q * t; if (A > au.verticalDragMaxHeight) { A = au.verticalDragMaxHeight } else { if (A < au.verticalDragMinHeight) { A = au.verticalDragMinHeight } } ap.height(A + "px"); i = t - A; aa(H) } } function ai(aG, aI, aF, s) { var aK = "before", aH = "after", aJ; if (aI == "os") { aI = /Mac/.test(navigator.platform) ? "after" : "split" } if (aI == aK) { aH = aI } else { if (aI == aH) { aK = aI; aJ = aF; aF = s; s = aJ } } aG[aK](aF)[aH](s) } function az(aF, s, aG) { return function () { G(aF, s, this, aG); this.blur(); return false } } function G(aH, aF, aK, aJ) { aK = b(aK).addClass("jspActive"); var aI, s = function () { if (aH != 0) { T(X + aH * au.arrowButtonSpeed, false) } if (aF != 0) { S(H + aF * au.arrowButtonSpeed, false) } }, aG = setInterval(s, au.arrowRepeatFreq); s(); aI = aJ == c ? "mouseup.jsp" : "mouseout.jsp"; aJ = aJ || b("html"); aJ.bind(aI, function () { aK.removeClass("jspActive"); clearInterval(aG); aJ.unbind(aI) }) } function p() { w(); if (av) { al.bind("mousedown.jsp", function (aH) { if (aH.originalTarget == c || aH.originalTarget == aH.currentTarget) { var aG = b(this), s = setInterval(function () { var aI = aG.offset(), aJ = aH.pageY - aI.top; if (H + A < aJ) { S(H + au.trackClickSpeed) } else { if (aJ < H) { S(H - au.trackClickSpeed) } else { aF() } } }, au.trackClickRepeatFreq), aF = function () { s && clearInterval(s); s = null; b(document).unbind("mouseup.jsp", aF) }; b(document).bind("mouseup.jsp", aF); return false } }) } if (aB) { F.bind("mousedown.jsp", function (aH) { if (aH.originalTarget == c || aH.originalTarget == aH.currentTarget) { var aG = b(this), s = setInterval(function () { var aI = aG.offset(), aJ = aH.pageX - aI.left; if (X + ao < aJ) { T(X + au.trackClickSpeed) } else { if (aJ < X) { T(X - au.trackClickSpeed) } else { aF() } } }, au.trackClickRepeatFreq), aF = function () { s && clearInterval(s); s = null; b(document).unbind("mouseup.jsp", aF) }; b(document).bind("mouseup.jsp", aF); return false } }) } } function w() { F && F.unbind("mousedown.jsp"); al && al.unbind("mousedown.jsp") } function ar() { b("html").unbind("dragstart.jsp selectstart.jsp mousemove.jsp mouseup.jsp mouseleave.jsp"); ap && ap.removeClass("jspActive"); h && h.removeClass("jspActive") } function S(s, aF) { if (!av) { return } if (s < 0) { s = 0 } else { if (s > i) { s = i } } if (aF == c) { aF = au.animateScroll } if (aF) { N.animate(ap, "top", s, aa) } else { ap.css("top", s); aa(s) } } function aa(aF) { if (aF == c) { aF = ap.position().top } aj.scrollTop(0); H = aF; var aI = H == 0, aG = H == i, aH = aF / i, s = -aH * (W - v); if (ag != aI || aD != aG) { ag = aI; aD = aG; C.trigger("jsp-arrow-change", [ag, aD, M, k]) } u(aI, aG); V.css("top", s); C.trigger("jsp-scroll-y", [-s, aI, aG]) } function T(aF, s) { if (!aB) { return } if (aF < 0) { aF = 0 } else { if (aF > j) { aF = j } } if (s == c) { s = au.animateScroll } if (s) { N.animate(h, "left", aF, ab) } else { h.css("left", aF); ab(aF) } } function ab(aF) { if (aF == c) { aF = h.position().left } aj.scrollTop(0); X = aF; var aI = X == 0, aH = X == j, aG = aF / j, s = -aG * (Q - ah); if (M != aI || k != aH) { M = aI; k = aH; C.trigger("jsp-arrow-change", [ag, aD, M, k]) } r(aI, aH); V.css("left", s); C.trigger("jsp-scroll-x", [-s, aI, aH]) } function u(aF, s) { if (au.showArrows) { am[aF ? "addClass" : "removeClass"]("jspDisabled"); ac[s ? "addClass" : "removeClass"]("jspDisabled") } } function r(aF, s) {
                    if (au.showArrows) {
                        at[aF ? "addClass" : "removeClass"]("jspDisabled");
                        x[s ? "addClass" : "removeClass"]("jspDisabled")
                    }
                } function J(s, aF) { var aG = s / (W - v); S(aG * i, aF) } function K(aF, s) { var aG = aF / (Q - ah); T(aG * j, s) } function Y(aR, aM, aG) { var aK, aH, aI, s = 0, aQ = 0, aF, aL, aO, aN, aP; try { aK = b(aR) } catch (aJ) { return } aH = aK.outerHeight(); aI = aK.outerWidth(); aj.scrollTop(0); aj.scrollLeft(0); while (!aK.is(".jspPane")) { s += aK.position().top; aQ += aK.position().left; aK = aK.offsetParent(); if (/^body|html$/i.test(aK[0].nodeName)) { return } } aF = aw(); aL = aF + v; if (s < aF || aM) { aN = s - au.verticalGutter } else { if (s + aH > aL) { aN = s - v + aH + au.verticalGutter } } if (aN) { J(aN, aG) } viewportLeft = ay(); aO = viewportLeft + ah; if (aQ < viewportLeft || aM) { aP = aQ - au.horizontalGutter } else { if (aQ + aI > aO) { aP = aQ - ah + aI + au.horizontalGutter } } if (aP) { K(aP, aG) } } function ay() { return -V.position().left } function aw() { return -V.position().top } function ad() { aj.unbind(Z).bind(Z, function (aI, aJ, aH, aF) { var aG = X, s = H; T(X + aH * au.mouseWheelSpeed * ah / (Q - ah), false); S(H - aF * au.mouseWheelSpeed * v / (W - v), false); return aG == X && s == H }) } function n() { aj.unbind(Z) } function ax() { return false } function I() { V.unbind("focus.jsp").bind("focus.jsp", function (s) { if (s.target === V[0]) { return } Y(s.target, false) }) } function D() { V.unbind("focus.jsp") } function P() { var aF, s; C.attr("tabindex", 0).unbind("keydown.jsp").bind("keydown.jsp", function (aJ) { if (aJ.target !== C[0]) { return } var aH = X, aG = H, aI = aF ? 2 : 16; switch (aJ.keyCode) { case 40: S(H + aI, false); break; case 38: S(H - aI, false); break; case 34: case 32: J(aw() + Math.max(32, v) - 16); break; case 33: J(aw() - v + 16); break; case 35: J(W - v); break; case 36: J(0); break; case 39: T(X + aI, false); break; case 37: T(X - aI, false); break } if (!(aH == X && aG == H)) { aF = true; clearTimeout(s); s = setTimeout(function () { aF = false }, 260); return false } }); if (au.hideFocus) { C.css("outline", "none"); if ("hideFocus" in aj[0]) { C.attr("hideFocus", true) } } else { C.css("outline", ""); if ("hideFocus" in aj[0]) { C.attr("hideFocus", false) } } } function O() { C.attr("tabindex", "-1").removeAttr("tabindex").unbind("keydown.jsp") } function B() { if (location.hash && location.hash.length > 1) { var aG, aF; try { aG = b(location.hash) } catch (s) { return } if (aG.length && V.find(aG)) { if (aj.scrollTop() == 0) { aF = setInterval(function () { if (aj.scrollTop() > 0) { Y(location.hash, true); b(document).scrollTop(aj.position().top); clearInterval(aF) } }, 50) } else { Y(location.hash, true); b(document).scrollTop(aj.position().top) } } } } function af() { b("a.jspHijack").unbind("click.jsp-hijack").removeClass("jspHijack") } function m() { af(); b("a[href^=#]").addClass("jspHijack").bind("click.jsp-hijack", function () { var s = this.href.split("#"), aF; if (s.length > 1) { aF = s[1]; if (aF.length > 0 && V.find("#" + aF).length > 0) { Y("#" + aF, true); return false } } }) } b.extend(N, { reinitialise: function (aF) { aF = b.extend({}, aF, au); an(aF) }, scrollToElement: function (aG, aF, s) { Y(aG, aF, s) }, scrollTo: function (aG, s, aF) { K(aG, aF); J(s, aF) }, scrollToX: function (aF, s) { K(aF, s) }, scrollToY: function (s, aF) { J(s, aF) }, scrollBy: function (aF, s, aG) { N.scrollByX(aF, aG); N.scrollByY(s, aG) }, scrollByX: function (s, aG) { var aF = ay() + s, aH = aF / (Q - ah); T(aH * j, aG) }, scrollByY: function (s, aG) { var aF = aw() + s, aH = aF / (W - v); S(aH * i, aG) }, animate: function (aF, aI, s, aH) { var aG = {}; aG[aI] = s; aF.animate(aG, { duration: au.animateDuration, ease: au.animateEase, queue: false, step: aH }) }, getContentPositionX: function () { return ay() }, getContentPositionY: function () { return aw() }, getIsScrollableH: function () { return aB }, getIsScrollableV: function () { return av }, getContentPane: function () { return V }, scrollToBottom: function (s) { S(i, s) }, hijackInternalLinks: function () { m() } })
            } f = b.extend({}, b.fn.jScrollPane.defaults, f); var e; this.each(function () { var g = b(this), h = g.data("jsp"); if (h) { h.reinitialise(f) } else { h = new d(g, f); g.data("jsp", h) } e = e ? e.add(g) : g }); return e
        }; b.fn.jScrollPane.defaults = { showArrows: false, maintainPosition: true, clickOnTrack: true, autoReinitialise: false, autoReinitialiseDelay: 500, verticalDragMinHeight: 0, verticalDragMaxHeight: 99999, horizontalDragMinWidth: 0, horizontalDragMaxWidth: 99999, animateScroll: false, animateDuration: 300, animateEase: "linear", hijackInternalLinks: false, verticalGutter: 4, horizontalGutter: 4, mouseWheelSpeed: 30, arrowButtonSpeed: 30, arrowRepeatFreq: 100, arrowScrollOnHover: false, trackClickSpeed: 30, trackClickRepeatFreq: 100, verticalArrowPositions: "split", horizontalArrowPositions: "split", enableKeyboardNavigation: true, hideFocus: false }
    })(jQuery, this);
    //termina jscrollpane


})(this.jQuery);



// usage: log('inside coolFunc',this,arguments);
// paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/
window.log = function(){
  log.history = log.history || [];   // store logs to an array for reference
  log.history.push(arguments);
  if(this.console){
    console.log( Array.prototype.slice.call(arguments) );
  }
};



// catch all document.write() calls
(function(doc){
  var write = doc.write;
  doc.write = function(q){ 
    log('document.write(): ',arguments); 
    if (/docwriteregexwhitelist/.test(q)) write.apply(doc,arguments);  
  };
})(document);
