var $$ = jQuery.fn; $$.extend({ SplitID: function () { return this.attr("id").split("-").pop() }, Slideshow: { Ready: function () { jQuery("div.tmpSlideshowControl").hover(function () { jQuery(this).addClass("tmpSlideshowControlOn") }, function () { jQuery(this).removeClass("tmpSlideshowControlOn") }).click(function () { $$.Slideshow.Interrupted = true; jQuery("div.tmpSlide").hide(); jQuery("div.tmpSlideshowControl").removeClass("tmpSlideshowControlActive"); jQuery("div#tmpSlide-" + jQuery(this).SplitID()).show(); jQuery(this).addClass("tmpSlideshowControlActive") }); this.Counter = 1; this.Interrupted = false; this.Transition() }, Transition: function () { if (this.Interrupted) { return } this.Last = this.Counter - 1; if (this.Last < 1) { this.Last = 5 } jQuery("div#tmpSlide-" + this.Last).fadeOut("slow", function () { jQuery("div#tmpSlideshowControl-" + $$.Slideshow.Last).removeClass("tmpSlideshowControlActive"); jQuery("div#tmpSlideshowControl-" + $$.Slideshow.Counter).addClass("tmpSlideshowControlActive"); jQuery("div#tmpSlide-" + $$.Slideshow.Counter).fadeIn("slow"); $$.Slideshow.Counter++; if ($$.Slideshow.Counter > 5) { $$.Slideshow.Counter = 1 } setTimeout("$$.Slideshow.Transition();", 5000) }) } } }); (function (b) { function a(c, f) { var e = c.find(f.items); var d = e.children().length; if (d <= 0) { return false } b.extend(c, { initWPWrap: function () { if (f.npInside == true) { var h = b(f.holder, c); var g = b(f.next, c); var l = b(f.prev, c); l.appendTo(h).css({ position: "absolute", top: Math.ceil(h.height() / 3), left: "5px", "z-index": "1200" }); g.appendTo(h).css({ position: "absolute", top: Math.ceil(h.height() / 3), right: "10px", "z-index": "1200" }); g.hide(); l.hide(); h.hover(function () { g.fadeTo("fast", 0.8, function () { b(this).fadeIn("fast") }); l.fadeTo("fast", 0.8, function () { b(this).fadeIn("fast") }) }, function () { g.fadeOut("fast"); l.fadeOut("fast") }) } var k = new Array(); if (f.effect != "slider") { totalWidth = b(f.holder, c).width(); e.width(totalWidth).css("position", "relative"); i = 0; e.children().each(function () { b(this).find(".wphpw_description").data("par", i).appendTo(h); var m = b(this).outerWidth(true) - b(this).width(); b(this).width(totalWidth - m).css({ "float": "left" }).height(c.height()) }); e.children().eq(0).show() } else { if (f.horizontal) { totalWidth = b(f.holder, c).width(); itemWidth = Math.ceil(totalWidth / f.size); i = 0; e.children().each(function () { b(this).find(".wphpw_description").data("par", i).appendTo(h); var m = b(this).outerWidth(true) - b(this).width(); b(this).width(itemWidth - m); k.push(b(this).outerHeight(true)); i++ }); maxh = Math.max.apply(Math, k); if (f.fixHeight) { b(f.holder, c).css({ height: e.children().eq(0).outerHeight(true) }) } } else { totalHeight = b(f.holder, c).height(); itemHeight = Math.ceil(totalHeight / f.size); e.children().each(function () { b(this).find(".wphpw_description").data("par", i).appendTo(h); var m = b(this).outerWidth(true) - b(this).width(); var n = b(this).outerHeight(true) - b(this).height(); b(this).width(b(f.holder, c).width() - m).css("float", "none").height(itemHeight - n) }) } } e.data("cur_item", 0); if (f.descriptionBar == true) { } c.find(f.prev).click(function (m) { c.moveWPPrev(); m.preventDefault() }); c.find(f.next).click(function (m) { c.moveWPNext(); m.preventDefault() }); c.find(f.nextPage).click(function (m) { c.moveWPNextPage(); m.preventDefault() }); c.find(f.prevPage).click(function (m) { c.moveWPPrevPage(); m.preventDefault() }); var j = c.find(f.navi); if (j && j.children().length > 0) { navis = 0; j.children().each(function () { b(this).find("a").attr("goto", navis).click(function (m) { e.data("clicked", navis); c.moveWPTo(b(this).attr("goto")); m.preventDefault() }); navis++ }) } }, moveWPNext: function () { cur = e.data("cur_item"); if (!cur) { c.moveWPTo(1) } else { if (f.loop && (cur == d - 1)) { c.moveWPTo(0) } else { c.moveWPTo(parseInt(cur + 1)) } } return false }, moveWPPrev: function () { cur = e.data("cur_item"); if (!cur) { c.moveWPTo(0) } else { c.moveWPTo(parseInt(cur - 1)) } return false }, moveWPNextPage: function () { cur = e.data("cur_item"); cur_page = parseInt(cur + f.size); c.moveWPTo(cur_page) }, moveWPPrevPage: function () { cur = e.data("cur_item"); cur_page = parseInt(cur - f.size); c.moveWPTo(cur_page) }, moveWPTo: function (g) { e.children().removeClass(f.activeClass); d = e.children().length; b(f.navi, c).find(".active").removeClass("active"); b(f.navi, c).find("li:eq(" + g + ")").addClass("active"); if (g < 0) { g = 0 } if (g > (d - f.size)) { return } e.removeData("cur_item").data("cur_item", g); var k = e.children().eq(g); k.addClass(f.activeClass).attr("indez", g); if (!k.length) { return } if (f.effect == "fadeIn") { e.children().hide(); k.fadeIn(f.speed) } else { if (f.horizontal) { var j = -(k.outerWidth(true) * g); if (f.fixHeight) { b(f.holder, c).animate({ height: (k.outerHeight(true)) }, f.speed, f.easing) } e.animate({ left: j }, f.speed, f.easing) } else { var h = -(k.outerHeight(true) * g); e.animate({ top: h }, f.speed, f.easing) } } } }); c.initWPWrap() } b.fn.wpAnimator = function (c) { var d = { size: 1, horizontal: true, loop: true, interval: 200, speed: 400, activeClass: "active", hoverClass: null, items: ".items", fixHeight: true, prev: ".prev", next: ".next", nextPage: ".nextPage", prevPage: ".prevPage", navi: ".navi", holder: ".s_content", easing: "swing", effect: "slider", descriptionBar: true, afterSeek: null, npInside: true, autoplay: "" }; c = b.extend(d, c); this.each(function () { var e = new a(b(this), c) }); return this } })(jQuery); (function (a) { a.facebox = function (c, b) { a.facebox.init(); a.facebox.loading(); a.isFunction(c) ? c.call(a) : a.facebox.reveal(c, b) }; a.facebox.settings = { image_types: ["png", "jpg", "jpeg", "gif"], facebox_html: '  <div id="facebox" style="display:none;">     <div class="popup">       <table>         <tbody>           <tr>             <td class="tl"/><td style="background:none repeat scroll 0 0 #44C8F5;"/><td class="tr"/>           </tr>           <tr>             <td style="background:none repeat scroll 0 0 #44C8F5;"/>             <td class="body">               <div class="content_face">               </div>                              </div>             </td>           <td style="background:none repeat scroll 0 0 #44C8F5;"/>           </tr>           <tr>             <td class="bl"/><td style="background:none repeat scroll 0 0 #44C8F5;"/><td class="br"/>           </tr>         </tbody>       </table>     </div>   </div>' }; a.facebox.loading = function () { if (a("#facebox .loading").length == 1) { return true } a("#facebox .content_face").empty(); a("#facebox .body").children().hide().end().append('<div class="loading"></div>'); var b = a.facebox.getPageScroll(); a("#facebox").css({ top: b[1] + (a.facebox.getPageHeight() / 10), left: b[0] }).show(); a(document).bind("keydown.facebox", function (c) { if (c.keyCode == 27) { a.facebox.close() } }) }; a.facebox.reveal = function (c, b) { if (b) { a("#facebox .content_face").addClass(b) } a("#facebox .content_face").append(c); a("#facebox .loading").remove(); a("#facebox .body").children().fadeIn("normal") }; a.facebox.close = function () { a(document).trigger("close.facebox"); return false }; a(document).bind("close.facebox", function () { a(document).unbind("keydown.facebox"); a("#facebox").fadeOut(function () { a("#facebox .content_face").removeClass().addClass("content_face") }) }); a(".close").bind("close.facebox", function () { a(document).unbind("keydown.facebox"); a("#facebox").fadeOut(function () { a("#facebox .content_face").removeClass().addClass("content_face") }) }); a.fn.facebox = function (c) { a.facebox.init(c); var b = a.facebox.settings.image_types.join("|"); b = new RegExp("." + b + "$", "i"); function d() { a.facebox.loading(true); var e = this.rel.match(/facebox\[\.(\w+)\]/); if (e) { e = e[1] } if (this.href.match(/#/)) { var f = window.location.href.split("#")[0]; var h = this.href.replace(f, ""); a.facebox.reveal(a(h).clone().show(), e) } else { if (this.href.match(b)) { var g = new Image(); g.onload = function () { a.facebox.reveal('<div class="image"><img src="' + g.src + '" /></div>', e) }; g.src = this.href } else { a.get(this.href, function (j) { a.facebox.reveal(j, e) }) } } return false } this.click(d); return this }; a.facebox.init = function (c) { if (a.facebox.settings.inited) { return true } else { a.facebox.settings.inited = true } if (c) { a.extend(a.facebox.settings, c) } a("body").append(a.facebox.settings.facebox_html); var b = [new Image(), new Image()]; a("#facebox").find(".b:first, .bl, .br, .tl, .tr").each(function () { b.push(new Image()); b.slice(-1).src = a(this).css("background-image").replace(/url\((.+)\)/, "$1") }); a("#facebox .close").click(a.facebox.close) }; a.facebox.getPageScroll = function () { var c, b; if (self.pageYOffset) { b = self.pageYOffset; c = self.pageXOffset } else { if (document.documentElement && document.documentElement.scrollTop) { b = document.documentElement.scrollTop; c = document.documentElement.scrollLeft } else { if (document.body) { b = document.body.scrollTop; c = document.body.scrollLeft } } } return new Array(c, b) }; a.facebox.getPageHeight = function () { var b; if (self.innerHeight) { b = self.innerHeight } else { if (document.documentElement && document.documentElement.clientHeight) { b = document.documentElement.clientHeight } else { if (document.body) { b = document.body.clientHeight } } } return b } })(jQuery);
