/*
 * Author: Digital Zoom Studio
 * Website: http://digitalzoomstudio.net/
 * Portfolio: http://codecanyon.net/user/ZoomIt/portfolio
 * Editor's note: Yes sir, this is GPL.
 */
(function (j) {
   j.fn.phoenixgallery = function (b) {
      var Ga = 0,
          b = j.extend({
            totalWidth: 101,
            totalHeight: 101,
            thumbWidth: 20,
            thumbHeight: 25,
            thumbSpace: 5,
            navigationDivId: "navCustom",
            hideOnCue: "off",
            buttonsAlign: "right",
            basePath: "",
            settings_autoresize: "off",
            transition_type: "fade",
            transition_direction: "horizontal",
            transition_strips_x: 15,
            transition_strips_y: 15,
            block_animation_time: 600,
            nav_position: "down",
            nav_type: "arrows",
            nav_space: 10,
            nav_arrow_size: 40,
            thumb_width: 100,
            thumb_height: 75,
            thumb_space: 10,
            arrows_normal_alpha: 0.7,
            arrows_roll_alpha: 0.7,
            settings_shadow: "off",
            settings_autoresize: "off",
            settings_autoheight: "off",
            settings_slideshow: "on",
            settings_pauseonrollover: "on"
         }, b);
      this.each(function () {
         function Ha() {
            jQuery(this).animate({
               opacity: sa
            }, {
               duration: 300,
               queue: !1
            })
         }

         function Ia() {
            jQuery(this).parent().children().index(jQuery(this)) != e && jQuery(this).animate({
               opacity: ea
            }, {
               duration: 300,
               queue: !1
            })
         }

         function Ja() {
            L(p.children().index(jQuery(this)))
         }

         function Ka(d) {
            a.find(".transitionCon").css("visibility", "visible");
            T = b.transition_strips_x;

            U = b.transition_strips_y;
            g.indexOf("horizontal") > -1 && (U = 1);
            g.indexOf("vertical") > -1 && (T = 1);
            g == "wipe" && (U = T = 1);
            q = f / T;
            q != parseInt(q) && (q = parseInt(q) + 1);
            G = k / U;
            G != parseInt(G) && (G = parseInt(G) + 1);
            for (i = 0; i < T * U; i++) a.find(".transitionCon").append('<div class="transition-block-con"><div class="transition-block"></div></div>'), a.find(".transition-block").eq(i).append(c.eq(d).clone()), a.find(".transition-block-con").eq(i).css({
               width: q,
               height: G
            }), g.indexOf("horizontal") > -1 && (a.find(".transition-block-con").eq(i).css({
               left: q *

               i,
               top: 0
            }), a.find(".transition-block").eq(i).css({
               left: q * -i,
               top: 0
            })), g.indexOf("vertical") > -1 && (a.find(".transition-block-con").eq(i).css({
               left: 0,
               top: G * i
            }), a.find(".transition-block").eq(i).css({
               left: 0,
               top: G * -i
            })), a.find(".transition-block").eq(i).children().eq(0).css({
               visibility: "visible",
               opacity: 1
            }), La == "on" && v.push(a.find(".transition-block").eq(i).children().eq(0));
            if (g == "strips_horizontal_simple") for (i = 0; i < a.find(".transition-block-con").length; i++) a.find(".transition-block-con").eq(i).css({
               top: -G
            }),

            a.find(".transition-block-con").eq(i).animate({
               top: 0
            }, {
               duration: y + C * i,
               queue: !1
            });
            if (g == "strips_horizontal_fade_simple" || g == "strips_vertical_fade_simple") for (i = 0; i < a.find(".transition-block-con").length; i++) a.find(".transition-block-con").eq(i).css({
               opacity: 0
            }), a.find(".transition-block-con").eq(i).animate({
               opacity: 1
            }, {
               duration: y + C * i,
               queue: !1
            }), jQuery.browser.msie == !0 && jQuery.browser.version < 9 && (a.find(".transition-block-con").eq(i).children().eq(0).children().eq(0).css({
               opacity: 0
            }), a.find(".transition-block-con").eq(i).children().eq(0).children().eq(0).animate({
               opacity: 1
            },

            {
               duration: y + C * i,
               queue: !1
            }));
            if (g == "strips_horizontal_fade_random" || g == "strips_vertical_fade_random") {
               for (i = 0; i < a.find(".transition-block-con").length; i++) d = return_random_nr(a.find(".transition-block-con").length), a.find(".transition-block-con").eq(d).css({
                  opacity: 0
               }), a.find(".transition-block-con").eq(d).animate({
                  opacity: 1
               }, {
                  duration: y + C * i,
                  queue: !1
               }), jQuery.browser.msie == !0 && jQuery.browser.version < 9 && (a.find(".transition-block-con").eq(d).children().eq(0).children().eq(0).css({
                  opacity: 0
               }), a.find(".transition-block-con").eq(d).children().eq(0).children().eq(0).animate({
                  opacity: 1
               },

               {
                  duration: y + C * i,
                  queue: !1
               }));
               for (; random_selected_array.length > 0;) random_selected_array.pop()
            }
            if (g == "strips_vertical_simple") for (i = 0; i < a.find(".transition-block-con").length; i++) a.find(".transition-block-con").eq(i).css({
               left: -q
            }), a.find(".transition-block-con").eq(i).animate({
               left: 0
            }, {
               duration: y + C * i,
               queue: !1
            });
            if (g == "wipe") for (i = 0; i < a.find(".transition-block-con").length; i++) a.find(".transition-block-con").eq(i).css({
               width: 0,
               left: q
            }), a.find(".transition-block-con").eq(i).animate({
               width: q,
               left: 0
            },

            {
               duration: y + C * i,
               easing: ta,
               queue: !1
            }), a.find(".transition-block").eq(i).css({
               left: -q / 5 * 4
            }), a.find(".transition-block").eq(i).animate({
               left: 0
            }, {
               duration: y + C * i,
               easing: ta,
               queue: !1
            }), a.find(".transition-block").eq(i).children().eq(0).css({}), a.find(".transition-block").eq(i).children().eq(0).animate({}, {
               duration: y + C * i,
               queue: !1
            });
            setTimeout(Ma, y + C * i + 100)
         }

         function Ma() {
            a.find(".transitionCon").css("visibility", "hidden");
            a.find(".transition-block-con").remove();
            c.eq(e).css({
               display: "block"
            });
            ua()
         }

         function Na() {
            c.eq(V).stop()
         }

         function Oa() {
            M > H - 2 || (M++, fa(M))
         }

         function Pa() {
            M != 0 && (M--, fa(M))
         }

         function fa(a) {
            a >= H || (a == H - 1 ? (l == "right" && p.animate({
               top: D * -(H - 2) - ga
            }, {
               duration: 400,
               queue: !1
            }), l == "down" && p.animate({
               left: D * -(H - 2) - ga
            }, {
               duration: 400,
               queue: !1
            })) : (l == "right" && p.animate({
               top: D * -a
            }, {
               duration: 400,
               queue: !1
            }), l == "down" && p.animate({
               left: D * -a
            }, {
               duration: 400,
               queue: !1
            })), M = a)
         }

         function L(d, p) {
            if (!(d == e || ha == !1 || ia == !0)) {
               for (ia = !0; v.length > 0;) v.pop();
               m = c.eq(d);
               e >= 0 && (V = e, setTimeout(Na, z), c.eq(e).css("z-index", ja));
               a.find(".transition-block-con").remove();

               for (i = 0; i < u; i++) i == e || i == d ? c.eq(i).css("display", "block") : c.eq(i).css("display", "none");
               va == "random" && (g = Qa());
               g != "fade" && g != "swipe" && g != "slide" ? (Ka(d), wa.css("display", "inline-block")) : wa.css("display", "none");
               m.css("z-index", ja + 1);
               ja++;
               xa = m.attr("data-slideshowTime") === 0 || m.attr("data-slideshowTime") == void 0 ? 5 : parseFloat(m.attr("data-slideshowTime"));
               ya = m.attr("data-transitionTime") == "" || m.attr("data-transitionTime") == void 0 ? 5E3 : parseFloat(m.attr("data-transitionTime")) * 1E3;
               za = m.attr("data-initialPosition");

               Aa = m.attr("data-finalPosition");
               R = Ba[d];
               aa = Ca[d];
               W = c.eq(d).attr("data-initialZoom");
               N = c.eq(d).attr("data-finalZoom");
               W == void 0 && (W = 1);
               N == void 0 && (N = 1);
               R === 0 && (R = f, aa = k);
               m.attr("data-href") != void 0 && m.attr("data-href") != "" && (Y = Z.children().eq(d), Y.css("cursor", "pointer"), Y.attr("data-target") == "_self" ? Y.click(function () {
                  location.href = m.attr("data-href")
               }) : Y.click(function () {
                  window.open(m.attr("data-href"))
               }));
               var o = -(R * W - f) * 0.5,
                   l = o * 2,
                   j = -(aa * N - k) * 0.5,
                   q = j * 2;
               n = t = 0;
               switch (za) {
               case "topCenter":
                  n = o;
                  break;

               case "topRight":
                  n = l;
                  break;
               case "middleLeft":
                  t = j;
                  break;
               case "middleCenter":
                  n = o;
                  t = j;
                  break;
               case "middleRight":
                  n = l;
                  t = j;
                  break;
               case "bottomLeft":
                  t = q;
                  break;
               case "bottomCenter":
                  n = o;
                  t = q;
                  break;
               case "bottomRight":
                  n = l, t = q
               }
               ka = n;
               la = t;
               v.push(m);
               for (i = 0; i < v.length; i++) o = v[i], v[i][0] != null && v[i][0].nodeName == "LI" && (o = v[i].find("img").eq(0));
               o = -(R * N - f) * 0.5;
               l = o * 2;
               j = -(aa * N - k) * 0.5;
               q = j * 2;
               n = t = 0;
               switch (Aa) {
               case "topCenter":
                  n = o;
                  break;
               case "topRight":
                  n = l;
                  break;
               case "middleLeft":
                  t = j;
                  break;
               case "middleCenter":
                  n = o;
                  t = j;
                  break;

               case "middleRight":
                  n = l;
                  t = j;
                  break;
               case "bottomLeft":
                  t = q;
                  break;
               case "bottomCenter":
                  n = o;
                  t = q;
                  break;
               case "bottomRight":
                  n = l, t = q
               }
               if (n != ka || t != la || W != N) for (i = 0; i < v.length; i++) o = v[i], v[i][0] != null && v[i][0].nodeName == "LI" && (o = v[i].find("img").eq(0)), o.css({
                  left: ka,
                  top: la,
                  width: W * R,
                  position: "absolute",
                  "max-width": 1E4
               }), o.animate({
                  left: n,
                  top: t,
                  width: N * R
               }, {
                  duration: ya,
                  queue: !1
               }, Ra);
               p != "on" && m.css({
                  opacity: 0,
                  left: 0,
                  top: 0
               });
               g != "fade" && g != "swipe" && g != "slide" ? (m.css("display", "none"), m.css("opacity", 1)) : (setTimeout(ua,

               z), g == "fade" && m.animate({
                  opacity: 1
               }, {
                  queue: !1,
                  duration: z
               }), g == "swipe" && (m.css({
                  opacity: 1,
                  left: f + I
               }), m.animate({
                  left: 0
               }, {
                  queue: !1,
                  duration: z
               })), g == "slide" && (c.eq(e).animate({
                  left: -f
               }, {
                  queue: !1,
                  duration: z
               }), m.css({
                  opacity: 1,
                  left: f + I
               }), m.animate({
                  left: 0
               }, {
                  queue: !1,
                  duration: z
               })));
               for (i = 0; i < c.length; i++) i == e || i == d ? s[i].children().length > 0 && s[i].css("visibility", "visible") : s[i].css("visibility", "hidden");
               s[d].css({
                  top: -15,
                  opacity: 0
               });
               jQuery.browser.mozilla && parseFloat(jQuery.browser.version) < 3 && s[d].css({
                  top: -15,

                  opacity: 1
               });
               s[d].animate({
                  top: 0,
                  opacity: 1
               }, {
                  queue: !1,
                  duration: z
               });
               e >= 0 && (s[e].animate({
                  opacity: 0
               }, {
                  queue: !1,
                  duration: z,
                  complete: Sa
               }), jQuery.browser.msie && Ta(s[e]), E.indexOf("numbers") > -1 && (h.children().eq(e).css("opacity", "0.7"), h.children().eq(d).css("opacity", "1")), E.indexOf("thumbs") > -1 && (a.find(".thumbsSlider").children().eq(e).css("opacity", ea), a.find(".thumbsSlider").children().eq(d).css("opacity", sa)));
               b.settings_autoheight == "on" && (o = k, ma[d] > k && (o = ma[d] + 10), E.indexOf("thumbs") > -1 && b.nav_size ==

               void 0 && (o += O + A), a.animate({
                  height: o
               }, {
                  queue: !1,
                  duration: z
               }).css("overflow", "visible"), a.find(".imgMain").animate({
                  height: o - b.nav_space - A
               }, {
                  queue: !1,
                  duration: z
               }), w.animate({
                  top: o - A
               }, {
                  queue: !1,
                  duration: z
               }));
               jQuery(".phoenixgallery-caption").eq(e).fadeOut("slow");
               jQuery(".phoenixgallery-caption").eq(d).fadeIn("slow");
               e = d;
               na = 0;
               setTimeout(Ua, 2E3)
            }
         }

         function Qa() {
            var a = "";
            switch (Math.floor(Math.random() * 8)) {
            case 1:
               a = "strips_horizontal_simple";
               break;
            case 2:
               a = "strips_horizontal_fade_simple";
               break;
            case 3:
               a =

               "strips_horizontal_fade_random";
               break;
            case 4:
               a = "strips_vertical_simple";
               break;
            case 5:
               a = "strips_vertical_fade_simple";
               break;
            case 6:
               a = "strips_vertical_fade_random";
               break;
            case 7:
               a = "wipe";
               break;
            default:
               a = "fade"
            }
            return a
         }

         function ua() {
            (c.eq(V).attr("title") == "" || c.eq(V).attr("title") == void 0) && Z.css("visibility", "hidden");
            V != e && c.eq(V).css("display", "none");
            ia = !1
         }

         function Sa() {
            jQuery(this).css("visibility", "hidden")
         }

         function Ta(a) {
            a != "undefined" && jQuery(a).css("visibility", "hidden")
         }

         function Ua() {}

         function Va() {
            ba ==

            !1 && b.settings_slideshow == "on" && na++;
            na >= xa && oa == !1 && pa()
         }

         function pa() {
            e == u - 1 ? L(0) : L(e + 1);
            Math.floor(e / qa) != M && fa(Math.floor(e / qa))
         }
         var u = 0,
             a, f = 700,
             k = 420,
             R = 0,
             aa = 0,
             Da = 20,
             Ea = 5,
             E = "custom",
             S = "navCustom",
             Ba = [],
             Ca = [],
             ma = [],
             s = [],
             za = "",
             Aa = "",
             W, N, c, v = [],
             e = -1,
             M = 0,
             V = 0,
             ja = 99,
             xa = 0,
             z = 800,
             Ra = "linear",
             m, Y, na = 0,
             ba = !1,
             oa = !1,
             ya = 3E3,
             Fa = "off",
             ra = "";
         jQuery(this)[0].getAttribute("id");
         var P = "off",
             g = "",
             va = "",
             T = 15,
             U = 10,
             q = 0,
             G = 0,
             La = "on",
             y = 600,
             C = 100,
             ta = "swing",
             l = "right",
             O = 10,
             J = 100,
             A = 75,
             x = 10,
             qa = 4,
             $ = 0,
             D = P = 0,
             H = 0,
             ga = 0,
             F = 40,
             B = 0,
            
             K = 0,
             Q = 0,
             ea = 0.3,
             sa = 1,
             X = 0.7,
             n = 0,
             t = 0,
             ka = 0,
             la = 0,
             ia = !1,
             I = 0;
         a = jQuery(this);
         Ga++;
         b.totalWidth == 101 ? (f = a.width(), k = a.height()) : (f = b.totalWidth, k = b.totalHeight);
         E = b.nav_type;
         O = b.nav_space;
         S = b.navigationDivId;
         Fa = b.hideOnCue;
         ra = b.buttonsAlign;
         Da = b.thumbWidth;
         Ea = b.thumbSpace;
         P = b.settings_autoresize;
         va = g = b.transition_type;
         T = b.transition_strips_x;
         U = b.transition_strips_y;
         y = b.block_animation_time;
         l = b.nav_position;
         F = b.nav_arrow_size;
         J = b.thumb_width;
         A = b.thumb_height;
         x = b.thumb_space;
         X = b.arrows_normal_alpha;
         u = a.children().length;

         a.css({
            width: f,
            height: k,
            overflow: "inherit"
         });
         a.append('<div class="imgMain"><div class="transitionCon"></div><div class="imgCon"></div></div>');
         a.append("<div class='descMain'></div>");
         (b.nav_type.indexOf("arrows") > -1 || b.nav_type.indexOf("numbers") > -1) && a.append("<div class='navMain'></div>");
         a.append("<div class='thumbsMain'><div class='thumbs-arrow-left'></div><div class='thumbs-arrow-right'></div><div class='thumbsCon'><ul class='thumbsSlider'></ul></div></div>");
         var ca = a.find(".imgMain"),
             da = a.find(".imgCon"),
                         
             h = a.find(".navMain"),
             Z = a.find(".descMain"),
             w = a.find(".thumbsMain"),
             p = a.find(".thumbsSlider"),
             wa = a.find(".transitionCon");
         a.find(".imgMain").css({
            width: f,
            height: k
         });
         a.find(".transitionCon").css({
            width: f,
            height: k
         });
         if (is_ie8()) {
            b.settings_shadow = "off";
            for (i = 0; i < u; i++) jQuery(this).children().eq(i)[0].nodeName == "LI" && jQuery(this).children().eq(i).children().eq(0).unwrap()
         }
         b.settings_shadow == "on" && (I = 6, a.css({
            width: f + I
         }), a.parent().find(".pg-shadow").css({
            top: k +

            5,
            width: f
         }));
         Z.css("width", f + I);
         ca = "100%";
         if (b.nav_size) ca = b.nav_size;
         E.indexOf("thumbs") > -1 && (b.settings_shadow == "on" && (thumbsMainY = 6), l == "down" && (a.css({
            height: k + I + O + A
         }), w.css({
            top: k + O,
            width: ca,
            height: A
         })), l == "right" && (a.css({
            width: f + O + J
         }), w.css({
            top: I,
            left: f + O,
            width: J,
            height: k
         })));
         jQuery.browser.msie == !0 && jQuery.browser.version == 7 && a.css("overflow", "visible");
         for (i = 0; i < u; i++) P == "on" && jQuery(this).children().eq(0).find("img").css({
            width: f,
            height: k
         }), da.append(jQuery(this).children().eq(0));
         c = da.children();

         if (E.indexOf("thumbs") > -1) {
            l == "down" && (B = J, K = A, Q = f);
            l == "right" && (B = A, K = J, Q = k);
            P = u * B + (u - 1) * x;
            if (b.nav_size) Q = b.nav_size;
            P < Q - F * 2 ? $ = Q / 2 - P / 2 : (n = (Q - F * 2) / (B + x) * (B + x) - parseInt((Q - F * 2) / (B + x)) * (B + x), D = Q - F * 2 - n, H = P / D, qa = Math.floor(D / (B + x)), H = Math.ceil(H), ga = P - (H - 1) * D, l == "down" && a.find(".thumbsCon").css({
               position: "absolute",
               left: F + n / 2,
               width: D,
               height: K
            }), l == "right" && a.find(".thumbsCon").css({
               position: "absolute",
               top: F + n / 2,
               height: D,
               width: K
            }), p.css({
               position: "absolute"
            }), l == "down" && (w.find(".thumbs-arrow-left").css({
               display: "inline-block",

               top: A / 2 - 10,
               left: n / 2,
               opacity: X
            }), w.find(".thumbs-arrow-right").css({
               display: "inline-block",
               top: A / 2 - 10,
               right: n / 2,
               opacity: X
            })), l == "right" && (w.find(".thumbs-arrow-left").css({
               display: "inline-block",
               top: B / 2 - 10,
               left: K / 2 - 10,
               opacity: X
            }), w.find(".thumbs-arrow-right").css({
               display: "inline-block",
               bottom: B / 2 - 10,
               left: K / 2 - 10,
               opacity: X
            })), F = function () {
               jQuery(this).animate({
                  opacity: 1
               }, {
                  duration: 300,
                  queue: !1
               })
            }, K = function () {
               jQuery(this).animate({
                  opacity: X
               }, {
                  duration: 300,
                  queue: !1
               })
            }, w.find(".thumbs-arrow-left").bind("mouseover",

            F), w.find(".thumbs-arrow-right").bind("mouseover", F), w.find(".thumbs-arrow-left").bind("mouseout", K), w.find(".thumbs-arrow-right").bind("mouseout", K), w.find(".thumbs-arrow-left").bind("click", Pa), w.find(".thumbs-arrow-right").bind("click", Oa));
            b.nav_left && ($ = 0);
            b.nav_left && a.find(".thumbsMain").css("left", b.nav_left);
            b.nav_top && a.find(".thumbsMain").css("top", b.nav_top);
            for (i = 0; i < u; i++) p.append("<li></li>"), c.eq(i).attr("data-thumb") != void 0 ? p.children().eq(i).append('<img src="' + c.eq(i).attr("data-thumb") +

            '"/>') : c.eq(i)[0].nodeName != "IMG" ? p.children().eq(i).append(c.eq(i).find("img").eq(0).clone()) : p.children().eq(i).append(c.eq(i).clone()), l == "down" && p.children().eq(i).css({
               left: $
            }), l == "right" && p.children().eq(i).css({
               top: $
            }), $ += B + x, p.children().eq(i).children().eq(0).css({
               opacity: 1,
               width: J,
               height: A
            }), p.children().eq(i).css({
               opacity: ea
            }), p.children().eq(i).unbind(), p.children().eq(i).bind("mouseover", Ha), p.children().eq(i).bind("mouseout", Ia), p.children().eq(i).bind("click", Ja)
         }
         x = J = "";
         for (i = 0; i < u; i++) J =

         "<div class='descriptionBg' id='descriptionBg-" + i + "'></div>", x = "<div class='descriptionText' id='descriptionText-" + i + "'>", Z.append("<div class='descriptionMain'></div>"), s[i] = Z.children().eq(i), s[i].css("visibility", "hidden"), c.eq(i).attr("title") != void 0 && c.eq(i).attr("title") != "" && (x += c.eq(i).attr("title") + "</div>", s[i].append(J), s[i].append(x), jQuery.browser.msie ? (s[i].find(".descriptionBg").css("margin-top", s[i].find(".descriptionBg").css("top")), s[i].find(".descriptionBg").css("margin-left",

         s[i].find(".descriptionBg").css("left"))) : s[i].find(".descriptionBg").css("position", "absolute"), s[i].find(".descriptionBg").css("opacity"));
         if (E.indexOf("arrows") > -1 || E == "custom") E.indexOf("arrows") > -1 ? (
         	h.append("<div class='arrow-left' style='display: none;cursor:pointer; position:absolute; top: 74px; left: 1190px;'></div>"), 
         	h.append("<div class='arrow-right' style='display: none;cursor:pointer; position:absolute; top: 106px; left: 1190px'></div>"), 
         	h.append("<div class='pause' style='display: none;'></div>"), 
         	h.append("<div class='play' style='display: none;'></div>")) : 
         h.append(jQuery("#" + S)), j(this).find(".play").css("visibility", "hidden"), j(this).find(".arrow-left").click(function () {
            e == 0 ? L(u - 1) : L(e - 1)
         }), j(this).find(".pause").click(function () {
            ba = ba == !0 ? !1 : !0;
            h.find(".pause").css("visibility", "hidden");
            h.find(".play").css("visibility", "visible")
         }), j(this).find(".play").click(function () {
            ba = !1;
            pa();
            h.find(".pause").css("visibility",

            "visible");
            h.find(".kenburns-play").css("visibility", "hidden")
         }), j(this).find(".arrow-right").click(function () {
            pa()
         }), jQuery.browser.msie || (j(this).mouseover(function () {
            h.stop();
            h.animate({
               opacity: 1
            }, 1E3)
         }), j(this).mouseout(function () {
            h.stop();
            h.animate({
               opacity: 0
            }, 1E3)
         }));
         S = 0;
         ra == "right" && (S = f - O - (10 + b.thumb_space) * u - 5);
         ra == "center" && (S = f / 2 - (Ea + Da) * u * 0.5);
         if (E.indexOf("numbers") > -1) for (i = 0; i < u; i++) h.append("<div class='navigation-numbers' style='left:" + S + "px; top:" + (k - O - 20) + "px;'>" + (i + 1) + "</div>"),

         i != 0 && h.children().eq(i).css("opacity", "0.7"), S += 10 + b.thumb_space, h.children().eq(i).click(function () {
            L(h.children().index(jQuery(this)))
         }), h.children().eq(i).mouseout(function () {
            h.children().index(jQuery(this)) != e && jQuery(this).css("opacity", "0.7")
         }), h.children().eq(i).mouseover(function () {
            h.children().index(jQuery(this)) != e && jQuery(this).css("opacity", "0.9")
         });
         if (Fa == "on") for (i = 0; i < da.children().length; i++) da.children().eq(i).css("opacity", "0");
         h.css({
            position: "absolute",
            top: "0px",
            "z-index": "90"
         });

         c.css({
            position: "absolute",
            "max-width": "10000px"
         });
         totalImages = c.length;
         var ha = !1;
         for (i = 0; i < u; i++) c.eq(i).load(function () {}), c.eq(i)[0].nodeName != "IMG" && totalImages--;
         setTimeout(function () {
            if (ha == !1) {
               ha = !0;
               jQuery(".preloader").fadeOut("slow");
               a.animate({
                  opacity: 1
               }, 500);
               b.settings_shadow == "on" && a.parent().find(".pg-shadow").animate({
                  opacity: 1
               }, 1E3);
               g == "fade" && a.find(".transitionCon").remove();
               for (i = 0; i < u; i++) Ba[i] = c.eq(i).width(), Ca[i] = c.eq(i).height(), b.settings_autoheight == "on" && (ma[i] = c.eq(i).find(".post-content").height() +

               20);
               L(0, "on");
               setInterval(Va, 1E3);
               a.find(".thumbsSlider").children().eq(0).css("opacity", 1)
            }
         }, 500);
         j.fn.phoenixgallery.gotoImage = function (a) {
            L(a)
         };
         b.settings_pauseonrollover == "on" && (a.mouseenter(function () {
            oa = !0
         }), a.mouseleave(function () {
            oa = !1
         }));
         return this
      })
   }
})(jQuery);
var random_selected_array = [],
    sw = 0,
    retnr = 0;

function return_random_nr(j) {
   retnr = parseInt(Math.random() * j);
   for (r = sw = 0; r < random_selected_array.length; r++) random_selected_array[r] == retnr && (sw = 1, return_random_nr(j));
   if (sw == 0) return random_selected_array.push(retnr), retnr
}

function zs2_add_configurator() {
   jQuery("body").append("<div class=\"gallery-configurator\"><div class=\"activator\"></div><form><h4>WIDTH & HEIGHT</h4><input type='text' name='o11' value='830'></input><input type='text' name='o12' value='400'></input><h4>THUMBS WIDTH & HEIGHT</h4><input type='text' value='100' name='o21'></input><input type='text' value='75'  name='o22'></input><h4>MENU POSITION</h4><select name='sel1'><option>right</option><option>down</option></select><h4>TRANSITION</h4><select name='sel2'><option>random</option><option>strips_horizontal_simple</option><option>wipe</option><option>fade</option><option>strips_horizontal_fade_simple</option><option>strips_horizontal_fade_random</option><option>strips_vertical_simple</option><option>strips_vertical_fade_simple</option><option>strips_vertical_fade_random</option></select><h4>NAVIGATION</h4><select name='sel3'><option>thumbs</option><option>numbers</option><option>arrows</option></select><h4>STRIPS NR X&Y</h4><input type='text' value='15' name='o31' maxlength='2'></input><input type='text' value='15'  name='o32' maxlength='2'></input><h4>IMAGES AUTORESIZE</h4><select name='sel4'><option>off</option><option>on</option></select><h4>SHADOW</h4><select name='sel5'><option>on</option><option>off</option></select><br><br><button type='submit'>Apply</button></form></div>");
   jQuery("body").css("overflow-x",

   "hidden");
   jQuery(".gallery-configurator .activator").click(zs2_configurator_click);
   jQuery(".gallery-configurator").animate({
      opacity: 0.9
   }, {
      duration: 700
   }).animate({
      right: -300
   }, {
      duration: 1200
   })
}

function zs2_configurator_click() {
   jQuery(".gallery-configurator").css("right") == "-25px" ? jQuery(".gallery-configurator").animate({
      right: -300
   }, {
      duration: 300,
      queue: !1,
      complete: zs2_configurator_end
   }) : jQuery(".gallery-configurator").animate({
      right: -25
   }, {
      duration: 300,
      queue: !1
   })
}

function zs2_configurator_end() {}

function is_ie8() {
   return jQuery.browser.msie == void 0 ? !1 : jQuery.browser.version > 8 ? !1 : !0
};
