function MouseEvent(e) { this.x = e.pageX; this.y = e.pageY }; function doane(event) { e = event ? event : window.event; if ($.browser.msie) { e.returnValue = false; e.cancelBubble = true } else if (e) { e.stopPropagation(); e.preventDefault() } }; String.prototype.format = function() { var args = arguments; return this.replace(/{(\d{1})}/g, function() { return args[arguments[1]] }) }; function isNone(str) { return str == null || $.trim(str) == "" ? true : false }; String.prototype.trim = function() { return this.replace(/(^[\s]*)|([\s]*$)/g, "") }; String.prototype.inc = function(k1, k2) { if (k2 == null) { k2 = "," }; return (k2 + this + k2).indexOf(k2 + k1 + k2) > -1 ? true : false }; String.prototype.sub = function(k1, k2) { if (k2 == null) { k2 = "," }; var tmp = k2 + this + k2; var size = tmp.indexOf(k1); if (size == -1) { return 0 } var i = 0; while (tmp.charAt(size + 3 + i) != '/') { i++ } return tmp.substring(size + 3, size + 3 + i) }; var NameRule = /^[a-zA-Z0-9]{6,20}$/; var EmailRule = /(\,|^)([\w+._]+@\w+\.(\w+\.){0,3}\w{2,4})/; function sBuilder() { this.strings = new Array(); this.length = 0; this.append = function(a) { this.strings.push(a); this.length += a.length }; this.toString = function(c, d, b) { var c = c ? c : "", a = this.strings.join(c); if (d && b) { a = a.substr(d, b) } return a } }; $.fetchWH = function(e) { var d = {}; d.w = 0; d.h = 0; if (e) { d.w = Math.max(e.outerWidth(), e.outerWidth(true)); d.h = Math.max(e.outerHeight(), e.outerHeight(true)) } return d };
/*jquery.bgiframe.min*/
(function($) { $.fn.bgIframe = $.fn.bgiframe = function(s) { if ($.browser.msie && /6.0/.test(navigator.userAgent)) { s = $.extend({ top: 'auto', left: 'auto', width: 'auto', height: 'auto', opacity: true, src: 'javascript:false;' }, s || {}); var prop = function(n) { return n && n.constructor == Number ? n + 'px' : n; }, html = '<iframe class="bgiframe"frameborder="0"tabindex="-1"src="' + s.src + '"' + 'style="display:block;position:absolute;z-index:-1;' + (s.opacity !== false ? 'filter:Alpha(Opacity=\'0\');' : '') + 'top:' + (s.top == 'auto' ? 'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')' : prop(s.top)) + ';' + 'left:' + (s.left == 'auto' ? 'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')' : prop(s.left)) + ';' + 'width:' + (s.width == 'auto' ? 'expression(this.parentNode.offsetWidth+\'px\')' : prop(s.width)) + ';' + 'height:' + (s.height == 'auto' ? 'expression(this.parentNode.offsetHeight+\'px\')' : prop(s.height)) + ';' + '"/>'; return this.each(function() { if ($('> iframe.bgiframe', this).length == 0) this.insertBefore(document.createElement(html), this.firstChild); }); } return this; }; })(jQuery);
/*ScreenLightBox*/
(function($) { $.fn.ScreenLightBox = function(options) { var C = null, badObjects = ["select", "object", "embed"], l = null, B = [], k = null, c = null, m = 50, I, showTimer; if (!document.getElementsByTagName) { return } options = $.extend({ animate: true, autoPlay: true, borderSize: 39, containerID: document, enableSlideshow: true, enableimageDetail: true, googleAnalytics: false, descSliding: true, imageDataLocation: "south", closeLocation: "", initImage: "", initStart: "", imageData: [], isImgData: false, loop: true, loopend: true, overlayDuration: 0.2, overlayOpacity: 0.7, prefix: "", classNames: "vscreenbox", resizeSpeed: 7, Ae: false, slideTime: 4, strings: { closeLink: "", loadingMsg: "loading", nextLink: "", prevLink: "", startSlideshow: "", stopSlideshow: "", numDisplayPrefix: "", numDisplaySeparator: "/" }, enableRightClick: false, featBrowser: true, breathingSize: 20, startZoom: false, floating: true, GetDefaultImg: function() { } }, options); if (options.animate) { var overlayDuration = Math.max(options.overlayDuration, 0); options.resizeSpeed = Math.max(Math.min(options.resizeSpeed, 10), 1); var resizeDuration = (11 - options.resizeSpeed) * 0.15 } else { var overlayDuration = 0; var resizeDuration = 0 } var enableSlideshow = options.enableSlideshow; options.overlayOpacity = Math.max(Math.min(options.overlayOpacity, 1), 0); var playSlides = options.autoPlay; var container = $(options.containerID); var classNames = options.classNames; AW(); var objBody = container.length && container.get(0) != document ? container.get(0) : document.getElementsByTagName("body").item(0); if (objBody.childNodes.length) { $(objBody.childNodes[0]).before($("<div></div>")); objBody = objBody.childNodes[0] } function connectEvent(obj, name, func) { $(obj)[name](func) } var n = document.createElement("div"); n.setAttribute("id", getID("overlay")); n.style.display = "none"; objBody.appendChild(n); connectEvent(n, "click", end); var W = document.createElement("div"); W.setAttribute("id", getID("lightbox")); W.style.display = "none"; objBody.appendChild(W); connectEvent(W, "click", end); var U = document.createElement("div"); U.setAttribute("id", getID("imageDataContainer")); U.className = getID("clearfix"); var P = document.createElement("table"); P.setAttribute("id", getID("outerImageContainer")); P.cellSpacing = 0; W.appendChild(P); var AG = P.insertRow(-1); var AY = AG.insertCell(-1); AY.className = "tl"; var Ac = AG.insertCell(-1); Ac.className = "tc"; var AI = AG.insertCell(-1); AI.className = "tr"; var AF = P.insertRow(-1); var Af = AF.insertCell(-1); Af.className = "ml"; var b = AF.insertCell(-1); b.setAttribute("id", getID("lightboxFrameBody")); b.innerHTML = String.fromCharCode(160); var Ag = AF.insertCell(-1); Ag.className = "mr"; var AD = P.insertRow(-1); var AZ = AD.insertCell(-1); AZ.className = "bl"; var Ab = AD.insertCell(-1); Ab.className = "bc"; var Ad = AD.insertCell(-1); Ad.className = "br"; if (options.imageDataLocation == "north") { b.appendChild(U) } var p = document.createElement("div"); p.setAttribute("id", getID("imageData")); U.appendChild(p); if (options.enableimageDetail) { var g = document.createElement("div"); g.setAttribute("id", getID("imageDetails")); p.appendChild(g); var AP = document.createElement("div"); AP.setAttribute("id", getID("caption")); g.appendChild(AP); var AK = document.createElement("span"); AK.setAttribute("id", getID("numberDisplay")); g.appendChild(AK); var S = document.createElement("span"); S.setAttribute("id", getID("detailsNav")); g.appendChild(S); var T = document.createElement("a"); T.setAttribute("id", getID("prevLinkDetails")); T.setAttribute("href", "javascript:void(0);"); T.innerHTML = options.strings.prevLink; S.appendChild(T); connectEvent(T, "click", showPrev); var q = document.createElement("a"); q.setAttribute("id", getID("slideShowControl")); q.setAttribute("href", "javascript:void(0);"); S.appendChild(q); connectEvent(q, "click", AH); var f = document.createElement("a"); f.setAttribute("id", getID("nextLinkDetails")); f.setAttribute("href", "javascript:void(0);"); f.innerHTML = options.strings.nextLink; S.appendChild(f); connectEvent(f, "click", showNext) } var Z = document.createElement("a"); Z.setAttribute("id", getID("closeLink")); Z.setAttribute("href", "javascript:void(0);"); Z.innerHTML = options.strings.closeLink; if (options.closeLocation == "nav") { S.appendChild(Z) } else { var _ = document.createElement("div"); _.setAttribute("id", getID("close")); if (options.closeLocation == "top") { AI.appendChild(_) } else { p.appendChild(_) } _.appendChild(Z) } connectEvent(Z, "click", end); var h = document.createElement("div"); h.setAttribute("id", getID("imageContainer")); b.appendChild(h); var AJ = document.createElement("img"); AJ.setAttribute("id", getID("lightboxImage")); h.appendChild(AJ); if (!options.enableRightClick) { var AB = document.createElement("div"); AB.setAttribute("id", getID("hoverNav")); AB.style.background = "white"; AB.style.opacity = 0; AB.style.filter = "alpha(opacity=0)"; h.appendChild(AB); connectEvent(AB, "mousemove", hoverNav); connectEvent(AB, "mouseout", outNav) } var AA = document.createElement("a"); AA.setAttribute("id", getID("prevLinkImg")); AA.setAttribute("href", "javascript:void(0);"); h.appendChild(AA); connectEvent(AA, "click", showPrev); var u = document.createElement("a"); u.setAttribute("id", getID("nextLinkImg")); u.setAttribute("href", "javascript:void(0);"); h.appendChild(u); connectEvent(u, "click", showNext); var AE = document.createElement("div"); AE.setAttribute("id", getID("loading")); h.appendChild(AE); var a = document.createElement("a"); a.setAttribute("id", getID("loadingLink")); a.setAttribute("href", "javascript:void(0);"); a.innerHTML = options.strings.loadingMsg; AE.appendChild(a); connectEvent(a, "click", end); if (options.imageDataLocation != "north") { b.appendChild(U) } function getHref(Node) { if (Node.tagName.toLowerCase() != "a") { Node = $("A:first", Node) } return $(Node).attr("href") } function getSrc(Node) { if (Node.tagName.toLowerCase() != "img") { Node = $("img:first", Node) } return $(Node).attr("src") } function getTitle(Node) { if (Node.tagName.toLowerCase() == "a" || Node.tagName.toLowerCase() == "img") { return $(Node).attr("title") || Node.title } return $(">*:last", Node).html() } function AW() { if (options.isImgData && options.imageData.length > 0) { $(options.initStart, container).each(function() { $(this).click(function(event) { event.preventDefault(); startImg($(options.initImage), options.GetDefaultImg()); return false }) }) } else { $("." + classNames.replace(/^\,/, ".$&"), container).each(function() { if (getHref(this)) { $(this).click(function(event) { event.preventDefault(); start(this); return false }) } }) } } var t = ""; if (t) { var c = $("<div></div>"); c.css({ position: "absolute", right: "0px", bottom: "0px", padding: "2px 3px", 'background-color': "#EEE", 'z-index': 10 }); $(h).append(c); var d = $(document.createElement("A")); d.css({ color: "#555", font: "11px Arial,Verdana,sans-serif", padding: "3px 6px", width: "auto", height: "auto", margin: "0 0 0 0", outline: "none" }); d.attr({ href: "http://" + t.toLowerCase() }); d.html(t); d.bind("contextmenu", function(eventObject) { return false }); c.append(d) } var start = this.start = function(G) { Aa(); G = $(G); $$("overlay").css({ height: docWH()[1] + "px" }); if (options.descSliding) { $$("imageDataContainer").hide() } $$("lightboxImage").hide().attr({ src: "" }); if (options.startZoom) { $$("imageContainer").css({ width: G.width() + "px", height: G.height() + "px" }); if (!document.all) { $$("outerImageContainer").css({ opacity: 0.1 }) } $$("lightbox").css({ left: G.offset().left - options.borderSize + "px", top: G.offset().top - options.borderSize + "px", width: G.width() + options.borderSize * 2 + "px", height: "auto" }) } else { $$("overlay").css({ opacity: 0 }).show().fadeTo(overlayDuration * 1000, options.overlayOpacity); $$("lightbox").css({ left: 0, width: "100%" }) } $$("lightbox").show(); B = []; l = null; c = 0; $("." + (G.attr("className") || G.get(0).className), container).each(function() { if (getHref(this)) { B.push({ link: getHref(this), title: getTitle(this) }); if (this == G.get(0)) { c = B.length - 1 } } }); if (B.length > 1) { l = G.attr("className") } if (options.featBrowser) { $(window).resize(v) } if (options.floating) { $(window).scroll(v) } $(window).resize(adjustOverlay); $(window).scroll(adjustOverlay); changeImage(c) }; var startImg = this.startImg = function(G, imgSrc) { Aa(); G = $(G); $$("overlay").css({ height: docWH()[1] + "px" }); if (options.descSliding) { $$("imageDataContainer").hide() } $$("lightboxImage").hide().attr({ src: "" }); if (options.startZoom) { $$("imageContainer").css({ width: G.width() + "px", height: G.height() + "px" }); if (!document.all) { $$("outerImageContainer").css({ opacity: 0.1 }) } $$("lightbox").css({ left: G.offset().left - options.borderSize + "px", top: G.offset().top - options.borderSize + "px", width: G.width() + options.borderSize * 2 + "px", height: "auto" }) } else { $$("overlay").css({ opacity: 0 }).show().fadeTo(overlayDuration * 1000, options.overlayOpacity); $$("lightbox").css({ left: 0, width: "100%" }) } $$("lightbox").show(); B = []; l = null; c = 0; $.each(options.imageData, function(n, value) { B.push({ link: value, title: "" }); if (value.toLowerCase() == imgSrc.toLowerCase()) { c = B.length - 1 } }); if (B.length > 1) { l = G.attr("className") } if (options.featBrowser) { $(window).resize(v) } if (options.floating) { $(window).scroll(v) } $(window).resize(adjustOverlay); $(window).scroll(adjustOverlay); changeImage(c) }; function changeImage(imageNum) { C = imageNum; disableKeyboardNav(); V(); showLoading(); if (!options.startZoom) { $$("lightboxImage").hide() } $$("prevLinkImg").hide(); $$("nextLinkImg").hide(); if (options.descSliding) { $$("imageDataContainer").hide() } I = new Image; I.onload = function() { B[C].link = I.src; B[C].width = I.width; B[C].height = I.height; AC(false) }; if (options.startZoom && !$$("lightboxImage").attr("src")) { B[C].width = 320; B[C].height = 240; AC(false, true) } I.src = B[C].link; if (options.googleAnalytics) { urchinTracker(B[C].link) } } function AC(recall, J) { var imgWidth = B[C].width; var imgHeight = B[C].height; var L = w(); var r = imgWidth / imgHeight; if (options.featBrowser) { var AX = L.AL / L.s; if (r > AX) { var t = L.AL - options.borderSize * 2 - options.breathingSize * 2; var z = Math.round(t / r) } else { var z = L.s - options.borderSize * 2 - options.breathingSize * 2 - m; var t = Math.round(z * r) } if (imgWidth > t || imgHeight > z) { imgWidth = t; imgHeight = z } } var K = AM().y + (w().s - (imgHeight + m + options.borderSize * 2)) / 2; var Q = $$("imageContainer"); if (recall == true) { Q.css({ height: imgHeight + "px", width: imgWidth + "px" }); if (options.floating) { moveEffect($$("lightbox"), K) } else { $$("lightbox").css({ top: K + "px" }) } } else { var F = $$("lightboxImage"); Q.stop(true, false); F.stop(true, false); var H; if (options.startZoom && F.attr("src")) { H = F; H.attr({ id: getID("lightboxImage2") }) } else { F.remove() } if (!J) { F = $(I); F.hide(); F.attr({ id: getID("lightboxImage") }); Q.append(F) } with (Q) { var D = r / (width() / height()) } if (!J) { if (options.startZoom) { if (H) { $$("lightboxImage2").stop(true, true) } var o = H ? 120 : 100; if (H) { with (H) { css({ width: 1 > D ? "auto" : width() / parent().width() * 100 + "%", height: 1 > D ? height() / parent().height() * 100 + "%" : "auto", left: 0, top: 0 }) } } F.css({ opacity: 0, display: "block", position: "absolute", width: 1 > D ? o + "%" : "auto", height: 1 > D ? "auto" : o + "%", left: (100 - o * (1 > D ? 1 : D)) / 2 + "%", top: (100 - o * (1 > D ? 1 / D : 1)) / 2 + "%" }) } if (options.startZoom) { hideLoading() } } AV(K, imgWidth, imgHeight, D, J) } if (options.enableRightClick) { $$("lightboxImage").mousemove(hoverNav); $$("lightboxImage").mouseout(outNav) } } function AV(K, imgWidth, imgHeight, D, J) { var Q = $$("imageContainer"); var F = $$("lightboxImage"); var lightbox = $$("lightbox"); if (!J) { var H = $$("lightboxImage2") } if (options.startZoom) { F.fadeTo(resizeDuration * 1000, 1); if (!document.all) { $$("outerImageContainer").fadeTo(resizeDuration * 1000, 1) } } moveEffect(lightbox, K); if (options.startZoom && !J) { H.animate($.extend({ opacity: 0 }, D < 1 ? { height: "120%", top: "-10%", left: (100 - 120 / D) / 2 + "%"} : { width: "120%", left: "-10%", top: (100 - D * 120) / 2 + "%" }), { queue: false, duration: resizeDuration * 1000, complete: function() { $(this).remove() } }); F.animate($.extend({ left: 0, top: 0 }, D < 1 ? { width: "100%"} : { height: "100%" }), { queue: false, duration: resizeDuration * 1000 }) } Q.animate({ width: imgWidth + "px", height: imgHeight + "px" }, { queue: false, duration: resizeDuration * 1000, complete: !J ? function() { showImage() } : null }) } function moveEffect(lightbox, K) { lightbox.stop(true, false); lightbox.animate({ width: "100%", left: 0, top: K }, { queue: false, duration: resizeDuration * 1000 }) } function showLoading() { clearTimeout(showTimer); var loading = $$("loading"); loading.show(); loading.css({ visibility: "hidden" }); showTimer = setTimeout(function() { $$("loading").css({ visibility: "visible" }) }, 300) } function hideLoading() { clearTimeout(showTimer); $$("loading").hide() } function showImage() { hideLoading(); if (options.startZoom) { $$("overlay:hidden").css({ opacity: 0 }).show().fadeTo(overlayDuration * 1000, options.overlayOpacity); if (options.enableimageDetail) { showDetails() } else { updateNav() } } else { $$("lightboxImage").css({ opacity: 0 }).show().fadeTo(500, 1, function() { if (options.enableimageDetail) { showDetails() } else { updateNav() } }) } AS() } function updateDetails() { $$("caption").html(B[C].title || ""); if (B.length > 1) { var num_display = options.strings.numDisplayPrefix + " " + eval(C + 1) + " " + options.strings.numDisplaySeparator + " " + B.length; if (options.Ae && l) { num_display += " " + options.strings.numDisplaySeparator + " " + l } $$("numberDisplay").text(num_display); $$("slideShowControl").css({ display: enableSlideshow ? "" : "none" }) } } function showDetails() { updateDetails(); if (options.descSliding) { $$("imageDataContainer").animate({ height: "show", opacity: "show" }, 650, null, function() { updateNav() }) } else { updateNav() } } function updateNav() { var d = 1 / B.length; if (B.length > 1) { $$("prevLinkImg").show(); $$("nextLinkImg").show(); if (enableSlideshow) { if (playSlides) { AN() } else { AO() } } } AR() } function AN() { if ($$("lightbox:hidden").length) { return } V(); playSlides = true; k = setTimeout(function() { showNext() }, options.slideTime * 1000); $$("slideShowControl").text(options.strings.stopSlideshow); $$("slideShowControl").addClass("started") } function AO() { playSlides = false; V(); $$("slideShowControl").text(options.strings.startSlideshow); $$("slideShowControl").removeClass("started") } function AH() { if (playSlides) { AO() } else { AN() } } function V() { if (k) { k = clearTimeout(k) } } function isEnd() { if (!options.loop && (C == B.length - 1 && c == 0 || C + 1 == c)) { return true } return false } function showNext() { if (B.length > 1) { V(); if (!options.loop && (C == B.length - 1 && c == 0 || C + 1 == c)) { if (options.loopend) { end() } return } if (C == B.length - 1) { O(0) } else { O(C + 1) } } } function O(imageNum) { if (options.descSliding) { $$("imageDataContainer").animate({ height: "hide", opacity: "hide" }, 650, null, function() { changeImage(imageNum) }) } else { changeImage(imageNum) } } function isStart() { if (!options.loop && C == 0) { return true } return false } function showPrev() { if (B.length > 1) { if (!options.loop && C == 0) { if (options.loopend) { end() } return } if (C == 0) { O(B.length - 1) } else { O(C - 1) } } } function showFirst() { if (B.length > 1) { O(0) } } function showLast() { if (B.length > 1) { O(B.length - 1) } } function AR() { document.onkeydown = keyboardAction } function disableKeyboardNav() { document.onkeydown = "" } function keyboardAction(e) { if (e == null) { keycode = event.keyCode } else { keycode = e.which } key = String.fromCharCode(keycode).toLowerCase(); if (key == "x" || key == "o" || key == "c") { end() } else if (key == "p" || key == "%") { showPrev() } else if (key == "n" || key == "'") { showNext() } else if (key == "f") { showFirst() } else if (key == "l") { showLast() } else if (key == "s") { if (B.length > 0 && options.enableSlideshow) { AH() } } } function AS() { var AT = B.length - 1 == C ? 0 : C + 1; (new Image).src = B[AT].link; var AQ = C == 0 ? B.length - 1 : C - 1; (new Image).src = B[AQ].link } function end(Event) { if (Event) { var id = $(Event.target).attr("id"); if (getID("closeLink") != id && getID("lightbox") != id && getID("overlay") != id) { return } } $$("imageContainer").stop(true, false); $$("lightboxImage").stop(true, false); I.onload = null; disableKeyboardNav(); V(); $$("lightbox").hide(); AU(); if (options.overlayOpacity) { $$("overlay").fadeOut(overlayDuration * 1000) } else { $$("overlay").hide() } $(window).unbind("resize", v); $(window).unbind("scroll", v); $(window).unbind("resize", adjustOverlay); $(window).unbind("scroll", adjustOverlay) } function hoverNav(event) { if (event.pageX - $$("imageContainer").offset().left < $$("imageContainer").width() / 2) { if (!isStart()) { $$("prevLinkImg").addClass("hover") } $$("nextLinkImg").removeClass("hover") } else { $$("prevLinkImg").removeClass("hover"); if (!isEnd()) { $$("nextLinkImg").addClass("hover") } } } function outNav() { $$("prevLinkImg").removeClass("hover"); $$("nextLinkImg").removeClass("hover") } function v() { AC(true) } function adjustOverlay() { $$("overlay").css({ left: AM().x + "px", top: 0, width: "100%", height: docWH()[1] + "px" }) } function AU() { var els; var tags = badObjects; for (var i = 0; i < tags.length; i++) { els = document.getElementsByTagName(tags[i]); for (var j = 0; j < els.length; j++) { $(els[j]).css({ visibility: "visible" }) } } } function Aa() { var tags = badObjects; for (var i = 0; i < tags.length; i++) { $(tags[i]).css({ visibility: "hidden" }) } } function AM() { var x, y; if (self.pageYOffset) { x = self.pageXOffset; y = self.pageYOffset } else if (document.documentElement && document.documentElement.scrollTop) { x = document.documentElement.scrollLeft; y = document.documentElement.scrollTop } else if (document.body) { x = document.body.scrollLeft; y = document.body.scrollTop } return { x: x, y: y} } function w() { var N, M; if (self.innerHeight) { N = self.innerWidth; M = self.innerHeight } else if (document.documentElement && document.documentElement.clientHeight) { N = document.documentElement.clientWidth; M = document.documentElement.clientHeight } else if (document.body) { N = document.body.clientWidth; M = document.body.clientHeight } return { AL: N, s: M} } function docWH() { var b = document.body, e = document.documentElement, w = 0, h = 0; if (e) { w = Math.max(w, e.scrollWidth, e.offsetWidth); h = Math.max(h, e.scrollHeight, e.offsetHeight) } if (b) { w = Math.max(w, b.scrollWidth, b.offsetWidth); h = Math.max(h, b.scrollHeight, b.offsetHeight); if (window.innerWidth) { w = Math.max(w, window.innerWidth); h = Math.max(h, window.innerHeight) } } return [w, h] } function getID(id) { return options.prefix + id } function $$(name) { return $("#" + getID(name)) } return this } })(jQuery);
/*kkMarquee*/
(function($) { $.fn.kkMarquee = function(option, callback) { if (typeof option == "function") { callback = option; option = {} }; var s = $.extend({ deriction: "left", speed: 10, auto: false, cycle: true, width: null, height: null, step: 1, control: false, _front: null, _back: null, _stop: null, _continue: null, wrapstyle: "", stay: 5000, delay: 20, dom: "div>ul>li".split(">"), mainTimer: null, subTimer: null, tag: false, convert: false, btn: null, disabled: "disabled", pos: { ojbect: null, clone: null} }, option || {}); var object = this.find(s.dom[1]); var subObject = this.find(s.dom[2]); var childHeight = $.fetchWH(subObject.eq(0)).h; var childWidth = $.fetchWH(subObject.eq(0)).w; var domCount = subObject.length; var maxPx = 0; var clone; if (s.deriction == "up" || s.deriction == "down") { var height = object.eq(0).outerHeight(); var step = s.step * childHeight; maxPx = subObject.length * childHeight; object.css({ width: s.width + "px", overflow: "hidden" }) }; if (s.deriction == "left" || s.deriction == "right") { var width = subObject.length * childWidth; maxPx = subObject.length * childWidth; object.css({ width: (width + childWidth) + "px", overflow: "hidden" }); var step = s.step * childWidth }; var init = function() { var wrap = "<div style='position:relative;overflow:hidden;z-index:1;width:" + s.width + "px;height:" + s.height + "px;" + s.wrapstyle + "'></div>"; object.css({ position: "absolute", left: 0, top: 0 }).wrap(wrap); s.pos.object = 0; if (s.cycle || s.auto) { clone = object.clone(); object.after(clone) } switch (s.deriction) { default: case "up": object.css({ marginLeft: 0, marginTop: 0 }); if (s.cycle || s.auto) { clone.css({ marginLeft: 0, marginTop: height + "px" }); s.pos.clone = height } break; case "down": object.css({ marginLeft: 0, marginTop: 0 }); if (s.cycle || s.auto) { clone.css({ marginLeft: 0, marginTop: -height + "px" }); s.pos.clone = -height } break; case "left": object.css({ marginTop: 0, marginLeft: 0 }); if (s.cycle || s.auto) { clone.css({ marginTop: 0, marginLeft: width + "px" }); s.pos.clone = width } break; case "right": object.css({ marginTop: 0, marginLeft: 0 }); if (s.cycle || s.auto) { clone.css({ marginTop: 0, marginLeft: -width + "px" }); s.pos.clone = -width } break }; if (s.auto) { initMainTimer(); object.hover(function() { clear(s.mainTimer) }, function() { initMainTimer() }); clone.hover(function() { clear(s.mainTimer) }, function() { initMainTimer() }) }; if (callback) { callback() }; if (s.control) { initControls() } }; var initMainTimer = function(delay) { clear(s.mainTimer); if (s.auto) { s.stay = delay ? delay : s.stay; s.mainTimer = setInterval(function() { initSubTimer() }, s.stay) } }; var initSubTimer = function() { clear(s.subTimer); s.subTimer = setInterval(function() { roll() }, s.delay) }; var clear = function(timer) { if (timer != null) { clearInterval(timer) } }; var disControl = function(A) { if (A) { $(s._front).unbind("click"); $(s._back).unbind("click"); $(s._stop).unbind("click"); $(s._continue).unbind("click") } else { initControls() } }; var initControls = function() { if (s._front != null) { $(s._front).click(function() { if (!s.cycle && !s.auto) { if (checkFront()) { return } } $(s._front).addClass(s.disabled); disControl(true); clear(s.mainTimer); s.convert = true; s.btn = "front"; initSubTimer(); if (!s.auto) { s.tag = true }; convert() }) }; if (s._back != null) { $(s._back).click(function() { if (!s.cycle && !s.auto) { if (checkBack()) { return } } $(s._back).addClass(s.disabled); disControl(true); clear(s.mainTimer); s.convert = true; s.btn = "back"; initSubTimer(); if (!s.auto) { s.tag = true }; convert() }) }; if (s._stop != null) { if (s.auto) { $(s._stop).click(function() { clear(s.mainTimer) }) } }; if (s._continue != null) { if (s.auto) { $(s._continue).click(function() { initMainTimer() }) } } }; var convert = function() { if (s.tag && s.convert) { s.convert = false; if (s.btn == "front") { if (s.deriction == "down") { s.deriction = "up" }; if (s.deriction == "right") { s.deriction = "left" } }; if (s.btn == "back") { if (s.deriction == "up") { s.deriction = "down" }; if (s.deriction == "left") { s.deriction = "right" } }; if (s.auto) { initMainTimer() } else { } } }; var checkFront = function() { if (!s.cycle && !s.auto) { if (s.deriction == "down" || s.deriction == "up") { return (Math.abs(s.pos.object) + step) >= maxPx && s.pos.object < 0 }; if (s.deriction == "right" || s.deriction == "left") { return (Math.abs(s.pos.object) + step) >= maxPx && s.pos.object < 0 } } return false }; var checkBack = function() { if (!s.cycle && !s.auto) { return s.pos.object >= 0 } return false }; var setPos = function(y1, y2, x) { if (!s.cycle && !s.auto) { if (Math.abs(y1) >= maxPx && y1 < 0) { y1 = s.width - maxPx } else if (y1 >= 0) { y1 = 0 } } if (x) { clear(s.subTimer); s.pos.object = y1; if (s.cycle || s.auto) { s.pos.clone = y2; s.tag = true } } else { if (!s.cycle || !s.auto) { s.tag = false } }; if (s.tag) { if (s.convert) { convert() } else { if (!s.auto) { clear(s.mainTimer) } } }; if (s.deriction == "up" || s.deriction == "down") { object.css({ marginTop: y1 + "px" }); if (s.cycle || s.auto) { clone.css({ marginTop: y2 + "px" }) } }; if (s.deriction == "left" || s.deriction == "right") { object.css({ marginLeft: y1 + "px" }); if (s.cycle || s.auto) { clone.css({ marginLeft: y2 + "px" }) } } }; var roll = function() { var y_object = (s.deriction == "up" || s.deriction == "down") ? parseInt(object.get(0).style.marginTop) : parseInt(object.get(0).style.marginLeft); var y_clone = 0; if (s.cycle || s.auto) { y_clone = (s.deriction == "up" || s.deriction == "down") ? parseInt(clone.get(0).style.marginTop) : parseInt(clone.get(0).style.marginLeft); var y_add = Math.max(Math.abs(y_object - s.pos.object), Math.abs(y_clone - s.pos.clone)) } else { var y_add = Math.abs(y_object - s.pos.object) } var y_ceil = Math.ceil((step - y_add) / s.speed); switch (s.deriction) { case "up": if (y_add == step) { setPos(y_object, y_clone, true); $(s._front).removeClass(s.disabled); disControl(false) } else { if (s.cycle || s.auto) { if (y_object <= -height) { y_object = y_clone + height; s.pos.object = y_object }; if (y_clone <= -height) { y_clone = y_object + height; s.pos.clone = y_clone }; setPos((y_object - y_ceil), (y_clone - y_ceil)) } else { y_object = y_object - y_ceil; if (y_object <= -height) { y_object = -height; s.pos.object = y_object; setPos(y_object, y_clone, true); disControl(false) } else { setPos(y_object, y_clone) } } }; break; case "down": if (y_add == step) { setPos(y_object, y_clone, true); $(s._back).removeClass(s.disabled); disControl(false) } else { if (s.cycle || s.auto) { if (y_object >= height) { y_object = y_clone - height; s.pos.object = y_object }; if (y_clone >= height) { y_clone = y_object - height; s.pos.clone = y_clone }; setPos((y_object + y_ceil), (y_clone + y_ceil)) } else { y_object = y_object + y_ceil; if (y_object >= 0) { s.pos.object = height; setPos(y_object, y_clone, true); disControl(false) } else { setPos(y_object, y_clone) } } }; break; case "left": if (y_add == step) { setPos(y_object, y_clone, true); $(s._front).removeClass(s.disabled); disControl(false) } else { if (s.cycle || s.auto) { if (y_object <= -width) { y_object = y_clone + width; s.pos.object = y_object }; if (y_clone <= -width) { y_clone = y_object + width; s.pos.clone = y_clone }; setPos((y_object - y_ceil), (y_clone - y_ceil)) } else { y_object = y_object - y_ceil; if (y_object <= -width) { s.pos.object = -width; setPos(y_object, y_clone, true); disControl(false) } else { setPos(y_object, y_clone) } } }; break; case "right": if (y_add == step) { setPos(y_object, y_clone, true); $(s._back).removeClass(s.disabled); disControl(false) } else { if (s.cycle || s.auto) { if (y_object >= width) { y_object = y_clone - width; s.pos.object = y_object }; if (y_clone >= width) { y_clone = y_object - width; s.pos.clone = y_clone }; setPos((y_object + y_ceil), (y_clone + y_ceil)) } else { y_object = y_object + y_ceil; if (y_object >= 0) { s.pos.object = width; setPos(y_object, y_clone, true); disControl(false) } else { setPos(y_object, y_clone) } } }; break } }; if (s.deriction == "up" || s.deriction == "down") { if (height >= s.height && height >= s.step) { init() } }; if (s.deriction == "left" || s.deriction == "right") { if (width >= s.width && width >= s.step) { init() } } } })(jQuery);
/*ImageMarquee*/
(function($) { $.fn.ImageMarquee = function(option, callback) { if (typeof option == "function") { callback = option; option = {} }; var s = $.extend({ deriction: "left", speed: 10, maxspeed: 10, auto: true, width: null, height: null, step: 1, isavglen: true, control: false, _front: null, _back: null, _stop: null, _continue: null, wrapstyle: "", dom: "div>ul>li".split(">"), mainTimer: null, tag: false, convert: false, btn: null, disabled: "disabled", pos: { ojbect: null, clone: null} }, option || {}); var startderiction = s.deriction; var object = this.find(s.dom[1]); var subObject = this.find(s.dom[2]); var childHeight = $.fetchWH(subObject.eq(0)).h; var childWidth = $.fetchWH(subObject.eq(0)).w; var domCount = subObject.length; var clone; var getChildLength = function() { if (s.isavglen) { return subObject.length * childWidth } else { var len = 0; for (var sub = 0; sub < subObject.length; sub++) { len += $.fetchWH(subObject.eq(sub)).w; }; return len } }; if (s.deriction == "up" || s.deriction == "down") { var height = object.eq(0).outerHeight(); object.css({ width: s.width + "px", overflow: "hidden" }) }; if (s.deriction == "left" || s.deriction == "right") { var width = getChildLength(); object.css({ width: (width + childWidth) + "px", overflow: "hidden" }) }; var init = function() { var wrap = "<div style='position:relative;overflow:hidden;z-index:1;width:" + s.width + "px;height:" + s.height + "px;" + s.wrapstyle + "'></div>"; object.css({ position: "absolute", left: 0, top: 0 }).wrap(wrap); s.pos.object = 0; clone = object.clone(); object.after(clone); switch (s.deriction) { default: case "up": object.css({ marginLeft: 0, marginTop: 0 }); clone.css({ marginLeft: 0, marginTop: height + "px" }); s.pos.clone = height; break; case "down": object.css({ marginLeft: 0, marginTop: 0 }); clone.css({ marginLeft: 0, marginTop: -height + "px" }); s.pos.clone = -height; break; case "left": object.css({ marginTop: 0, marginLeft: 0 }); clone.css({ marginTop: 0, marginLeft: width + "px" }); s.pos.clone = width; break; case "right": object.css({ marginTop: 0, marginLeft: 0 }); clone.css({ marginTop: 0, marginLeft: -width + "px" }); s.pos.clone = -width; break }; if (s.auto) { initMainTimer(s.speed); object.hover(function() { clear(s.mainTimer) }, function() { initMainTimer(s.speed) }); clone.hover(function() { clear(s.mainTimer) }, function() { initMainTimer(s.speed) }) }; if (callback) { callback() }; if (s.control) { initControls() } }; var initMainTimer = function(speed) { clear(s.mainTimer); if (s.auto) { s.mainTimer = setInterval(function() { roll() }, speed) } }; var clear = function(timer) { if (timer != null) { clearInterval(timer) } }; var initControls = function() { if (s._front != null) { $(s._front).hover(function() { $(s._front).addClass(s.disabled); clear(s.mainTimer); s.convert = true; s.btn = "front"; initMainTimer(s.maxspeed); if (!s.auto) { s.tag = true }; convert() }, function() { $(s._front).removeClass(s.disabled); clear(s.mainTimer); s.deriction = startderiction; initMainTimer(s.speed) }) }; if (s._back != null) { $(s._back).hover(function() { $(s._back).addClass(s.disabled); clear(s.mainTimer); s.convert = true; s.btn = "back"; initMainTimer(s.maxspeed); if (!s.auto) { s.tag = true }; convert() }, function() { $(s._back).removeClass(s.disabled); clear(s.mainTimer); s.deriction = startderiction; initMainTimer(s.speed) }) }; if (s._stop != null) { if (s.auto) { $(s._stop).click(function() { clear(s.mainTimer) }) } }; if (s._continue != null) { if (s.auto) { $(s._continue).click(function() { initMainTimer(s.speed) }) } } }; var convert = function() { if (s.tag && s.convert) { s.convert = false; if (s.btn == "front") { if (s.deriction == "down") { s.deriction = "up" }; if (s.deriction == "right") { s.deriction = "left" } }; if (s.btn == "back") { if (s.deriction == "up") { s.deriction = "down" }; if (s.deriction == "left") { s.deriction = "right" } } } }; var setPos = function(y1, y2, x) { if (x) { s.pos.object = y1; s.pos.clone = y2; s.tag = true } else { s.tag = false }; if (s.tag) { if (s.convert) { convert() } else { if (!s.auto) { clear(s.mainTimer) } } }; if (s.deriction == "up" || s.deriction == "down") { object.css({ marginTop: y1 + "px" }); clone.css({ marginTop: y2 + "px" }) }; if (s.deriction == "left" || s.deriction == "right") { object.css({ marginLeft: y1 + "px" }); clone.css({ marginLeft: y2 + "px" }) } }; var roll = function() { var y_object = (s.deriction == "up" || s.deriction == "down") ? parseInt(object.get(0).style.marginTop) : parseInt(object.get(0).style.marginLeft); var y_clone = (s.deriction == "up" || s.deriction == "down") ? parseInt(clone.get(0).style.marginTop) : parseInt(clone.get(0).style.marginLeft); var pos = 1; switch (s.deriction) { case "up": if (y_object <= -height) { y_object = y_clone + height; s.pos.object = y_object }; if (y_clone <= -height) { y_clone = y_object + height; s.pos.clone = y_clone }; pos = -1; break; case "down": if (y_object >= height) { y_object = y_clone - height; s.pos.object = y_object }; if (y_clone >= height) { y_clone = y_object - height; s.pos.clone = y_clone }; pos = 1; break; case "left": if (y_object <= -width) { y_object = y_clone + width; s.pos.object = y_object }; if (y_clone <= -width) { y_clone = y_object + width; s.pos.clone = y_clone }; pos = -1; break; case "right": if (y_object >= width) { y_object = y_clone - width; s.pos.object = y_object }; if (y_clone >= width) { y_clone = y_object - width; s.pos.clone = y_clone }; pos = 1; break; default: break }; setPos(y_object + pos * s.step, y_clone + pos * s.step, true) }; if (s.deriction == "up" || s.deriction == "down") { if (height >= s.height && height) { init() } }; if (s.deriction == "left" || s.deriction == "right") { if (width >= s.width) { init() } } } })(jQuery);
/*ImageSlider*/
function ImageSlider() { this.moodbanner = this.moodlink = this.moodtitle = []; this.currentKey = 0; this.moodbannerid = ""; this.moodbannerimageid = ""; this.moodbannertoptionname = ""; this.classname = ""; this.mode = "fade"; this.speed = 400; this.playspeed = 5000; this.isauto = false; var timer; this.init = function(id, o, i, c, b, l, t, k, s, ps, mo) { this.moodbanner = b; this.moodlink = l; this.moodtitle = t; this.currentKey = k; this.moodbannerid = id; this.moodbannertoptionname = o; this.classname = c; this.moodbannerimageid = i; this.speed = s == "" || typeof s == 'undefined' ? 400 : s; this.playspeed = ps == "" || typeof ps == 'undefined' ? 5000 : ps; this.mode = mo == "" || typeof mo == 'undefined' ? "fade" : mo }; this.autoPlay = function() { var _slider = this; this.isauto = true; _slider.timer = setInterval(function() { _slider.nextSlide(_slider.currentKey + 1) }, this.playspeed) }; this.clickNext = function(key) { this.clearAuto(); this.nextSlide(key); if (this.isauto) { this.autoPlay() } }; this.nextSlide = function(key) { if (key >= this.moodbanner.length) { key = 0 }; if (key == this.currentKey) { return }; if (this.moodbannertoptionname != "") { $("#" + this.moodbannertoptionname + this.currentKey).removeClass(this.classname); $("#" + this.moodbannertoptionname + key).addClass(this.classname) }; var _slider = this; switch (this.mode) { case "fade": $("#" + this.moodbannerid).fadeOut(this.speed, function() { _slider.FadeIn(key) }); break; default: $("#" + this.moodbannerid).css("background", "url(" + this.moodbanner[key] + ") no-repeat"); $("#" + this.moodbannerimageid).css("background", "url(" + this.moodbanner[key] + ") no-repeat"); $("#" + this.moodbannerimageid).attr("href", this.moodlink[key]); break }; this.currentKey = key }; this.FadeIn = function(key) { $("#" + this.moodbannerid).css("background", "url(" + this.moodbanner[key] + ") no-repeat"); $("#" + this.moodbannerimageid).css("background", "url(" + this.moodbanner[key] + ") no-repeat"); $("#" + this.moodbannerimageid).attr("href", this.moodlink[key]); $("#" + this.moodbannerid).fadeIn(this.speed) }; this.clearAuto = function() { clearInterval(this.timer) } }
/*jqueryzoom*/
(function($) { $.fn.jqueryzoom = function(options) { var settings = { xzoom: 200, yzoom: 200, offset: 10, position: "right", lens: 1, preload: 1 }; if (options) { $.extend(settings, options) }; var noalt = ''; $(this).hover(function() { var imageLeft = $(this).offset().left; var imageTop = $(this).offset().top; var imageWidth = $(this).children('img').get(0).offsetWidth; var imageHeight = $(this).children('img').get(0).offsetHeight; noalt = $(this).children("img").attr("alt"); var bigimage = $(this).children("img").attr("jqimg"); var ieframe = $('<iframe class="zoomIframe" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" ></iframe>'); $(this).children("img").attr("alt", ''); if ($("div.zoomdiv").get().length == 0) { $(this).after("<div class=\"jqzoomPad\"><div class='zoomdiv'><img class='bigimg' src='" + bigimage + "'/></div></div>"); $(this).append("<div class='jqZoomPup'>&nbsp;</div>") }; if (settings.position == "right") { if (imageLeft + imageWidth + settings.offset + settings.xzoom > screen.width) { leftpos = imageLeft - settings.offset - settings.xzoom } else { leftpos = imageLeft + imageWidth + settings.offset } } else { leftpos = imageLeft - settings.xzoom - settings.offset; if (leftpos < 0) { leftpos = imageLeft + imageWidth + settings.offset } }; $("div.zoomdiv").css({ top: imageTop, left: leftpos }); $("div.zoomdiv").width(settings.xzoom); $("div.zoomdiv").height(settings.yzoom); $("div.zoomdiv").show(); if (!settings.lens) { $(this).css('cursor', 'crosshair') }; $(document.body).mousemove(function(e) { var mouse = new MouseEvent(e); var bigwidth = $(".bigimg").get(0).offsetWidth; var bigheight = $(".bigimg").get(0).offsetHeight; var scaley = 'x'; var scalex = 'y'; if (isNaN(scalex) | isNaN(scaley)) { var scalex = (bigwidth / imageWidth); var scaley = (bigheight / imageHeight); $("div.jqZoomPup").width((settings.xzoom) / (scalex * 1)); $("div.jqZoomPup").height((settings.yzoom) / (scaley * 1)); if (settings.lens) { $("div.jqZoomPup").css('visibility', 'visible') } }; var xpos = mouse.x - $("div.jqZoomPup").width() / 2 - imageLeft; var ypos = mouse.y - $("div.jqZoomPup").height() / 2 - imageTop; if (settings.lens) { xpos = (mouse.x - $("div.jqZoomPup").width() / 2 < imageLeft) ? 0 : (mouse.x + $("div.jqZoomPup").width() / 2 > imageWidth + imageLeft) ? (imageWidth - $("div.jqZoomPup").width() - 2) : xpos; ypos = (mouse.y - $("div.jqZoomPup").height() / 2 < imageTop) ? 0 : (mouse.y + $("div.jqZoomPup").height() / 2 > imageHeight + imageTop) ? (imageHeight - $("div.jqZoomPup").height() - 2) : ypos }; if (settings.lens) { $("div.jqZoomPup").css({ top: ypos, left: xpos }) }; if ($.browser.msie && $.browser.version < 7 && $("iframe.zoomIframe").length == 0) { $(document.body).append(ieframe); var sieframe = $("iframe.zoomIframe"); sieframe.width = $("div.zoomdiv").width(); sieframe.height = $("div.zoomdiv").height(); sieframe.left = $("div.zoomdiv").css("left"); sieframe.top = $("div.zoomdiv").css("top"); sieframe.css({ left: sieframe.left, top: sieframe.top, display: 'block', position: "absolute", zIndex: 9900, width: sieframe.width + 'px', height: sieframe.height + 'px' }) }; var scrolly = ypos; $("div.zoomdiv").get(0).scrollTop = scrolly * scaley; scrollx = xpos; $("div.zoomdiv").get(0).scrollLeft = (scrollx) * scalex }) }, function() { $(this).children("img").attr("alt", noalt); $(document.body).unbind("mousemove"); if (settings.lens) { $("div.jqZoomPup").remove() }; $("div.zoomdiv").remove(); $(".zoomIframe").remove() }); var count = 0; if (settings.preload) { $('body').append("<div style='display:none;' class='jqPreload" + count + "'>kk100</div>"); $(this).each(function() { var imagetopreload = $(this).children("img").attr("jqimg"); var content = $('div.jqPreload' + count + '').html(); $('div.jqPreload' + count + '').html(content + '<img src=\"' + imagetopreload + '\">') }) } } })(jQuery);
/*kkSelect*/
(function($) { $.fn.kkSelect = function(option) { if (typeof option == "function") { callback = option; option = {} }; var s = $.extend({ position: "down", auto: true, autohide: false, isinner: true, width: 20, height: 30, _inspire: null, overcss: {}, outcss: {}, dom: "div>div>ul>li".split(">"), onSelected: function() { } }, option || {}); var object = this; var subDiv = this.find(s.dom[1]); var subObject = this.find(s.dom[3]); if (!s.auto) { subDiv.css({ width: "100%", height: "100%" }); subDiv.css("overflow-x", "hidden"); subDiv.css("overflow-y", "auto"); this.css({ display: "none", position: "absolute", width: s.width + "px", height: s.height + "px" }) }; if ($.browser.msie && $.browser.version < 7) { this.bgiframe() }; if (s._inspire) { $(s._inspire).focus(function() { showSelect(); $(s._inspire).click(function() { showSelect() }) }); $(s._inspire).blur(function() { $(s._inspire).unbind("click") }) }; subObject.mousedown(function() { s.onSelected($(this).attr("val")); object.hide() }); subObject.mouseover(function() { $(this).css(s.overcss) }); subObject.mouseout(function() { $(this).css(s.outcss) }); if (s.autohide) { this.mouseleave(function() { object.hide() }) }; var showSelect = function() { var offsetobj = $(s._inspire).offset(); if (s.position == "up") { object.css({ top: (offsetobj.top + s.height) + "px", left: offsetobj.left + "px" }) } else { object.css({ top: (offsetobj.top + (s.isinner ? $(s._inspire).innerHeight() : $(s._inspire).outerHeight())) + "px", left: offsetobj.left + "px" }) } object.show() } } })(jQuery);
/*kkDialog*/
(function($) { $.fn.kkDialog = function(option) { if (typeof option == "function") { callback = option; option = {} }; var s = $.extend({ pos: "down", auto: true, ajax: false, autoHide: false, autoPos: 0, overClose: false, isText: false, trigger: "click", width: 100, height: 100, maxWidth: false, top: -1, left: -1, topoffset: 0, leftoffset: 0, _element: false, _close: ".jqmClose", _outclose: "", _box: '.jqmWindow', cText: "", link: "", overlayClass: "jqmOverlay", target: false, overlay: 50, getText: false, getPos: false, onLoad: false, onShow: false, onHide: false }, option || {}); var object = this; var objWin = $(s._box); var ie6 = $.browser.msie && $.browser.version < 7; var h = {}; var init = function() { if (s.autoHide) { objWin.mouseleave(function() { jqmHide() }) }; object.bind(s.trigger, function() { jqmShow() }) }; var jqmAddClose = function(e, t) { if (t) { $(e).bind(t, function() { jqmHide() }) } else { $(e).click(function() { jqmHide() }) } }; var jqmHide = function() { if (s.onHide) { s.onHide(h) } else { objWin.hide(); if (h.o) { h.o.remove() } } }; var getPosition = function(el, pos, offsetobj) { switch (pos) { case "up": return { position: "absolute", top: (offsetobj.top - $.fetchWH(objWin).h - s.topoffset) + "px", left: (offsetobj.left + s.leftoffset) + "px" }; break; case "right": return { position: "absolute", top: (offsetobj.top + s.topoffset) + "px", left: (offsetobj.left + $.fetchWH(el).w + s.leftoffset) + "px" }; case "left": return { position: "absolute", top: (offsetobj.top + s.topoffset) + "px", left: (offsetobj.left - $.fetchWH(objWin).w - s.leftoffset) + "px" }; default: return { position: "absolute", top: (offsetobj.top + $.fetchWH(el).h + s.topoffset) + "px", left: (offsetobj.left + s.leftoffset) + "px" }; break } }; var jqmShow = function() { if (s.getText) { s.cText = s.getText(object) } var z = parseInt(objWin.css("z-index")), z = (z > 0) ? z : 1000, o = $("<div></div>").css({ height: "100%", width: "100%", position: 'fixed', left: 0, top: 0, "z-index": z - 1, opacity: s.overlay / 100 }); objWin.css("z-index", z); if (!s.auto) { objWin.css({ width: s.width + "px", height: s.height + "px", overflow: "auto" }) } if (s.overlay > 0) { if (s.overClose) jqmAddClose(o) } else { o = false } if (o) { h.o = o.addClass(s.overlayClass).prependTo('body') }; if (ie6) { $("html,body").css({ height: "100%", width: "100%" }); if (o) { o = o.css({ position: "absolute" })[0]; for (var y in { Top: 1, Left: 1 }) o.style.setExpression(y.toLowerCase(), "(_=(document.documentElement.scroll" + y + " || document.body.scroll" + y + "))+'px'") } }; if (s.ajax) { var r = s.target || objWin, u = s.link, r = (typeof r == 'string') ? $(r, objWin) : $(r), u = (u.substr(0, 1) == '@') ? $(t).attr(u.substring(1)) : u; r.html(s.cText).load(u, function() { if (s.onLoad) s.onLoad.call(this, objWin); if (s._close) jqmAddClose(s._close) }) } else { if (s.isText) { var rt = s.target || objWin; rt = (typeof rt == 'string') ? $(rt, objWin) : $(rt), rt.html(s.cText); if (s._close) jqmAddClose(s._close) } else if (s._close) { jqmAddClose(s._close) } } if (s._outclose) { jqmAddClose(s._outclose, "mouseleave") } if (s.autoPos == 1) { objWin.css({ position: "absolute", top: s.top + "px", left: s.left + "px" }) } else if (s.autoPos == 2) { var obj = s._element || object; obj = $(obj); var offsetobj = obj.offset(); var objWidth = $.fetchWH(obj).w; var objWinWidth = $.fetchWH(objWin).w; var bodywidth = s.maxWidth ? s.maxWidth : $(document.body).outerWidth(); if (offsetobj.left + objWidth + objWinWidth >= bodywidth) { objWin.css(getPosition(obj, s.getPos ? s.getPos(object, objWin) : "left", offsetobj)) } else { objWin.css(getPosition(obj, s.getPos ? s.getPos(object, objWin) : "right", offsetobj)) } } else { var obj = s._element || object; obj = $(obj); var offsetobj = obj.offset(); objWin.css(getPosition(obj, s.pos, offsetobj)) } (s.onShow) ? s.onShow(h) : objWin.show(); if (ie6) { if (h.o) { var i = $('<iframe src="javascript:false;document.write(\'\');" class="jqmiframe"></iframe>').css({ opacity: 0, width: "100%", height: "100%" }); h.o.html('<p style="width:100%;height:100%"/>').prepend(i) } else { objWin.bgiframe() } } }; init(); return $(s._box || this) } })(jQuery);
/*kkDrag*/
(function($) { $.fn.kkDrag = function(h) { return i(this, h, 'd') }; $.fn.kkResize = function(h) { return i(this, h, 'r') }; $.kkDnR = { dnr: {}, e: 0, drag: function(v) { if (M.k == 'd') { var leftx = Math.max(0, M.X + v.pageX - M.pX); var topy = Math.max(0, M.Y + v.pageY - M.pY); var bodywidth = $(document.body).outerWidth(); var bodyheight = Math.max(document.documentElement.clientHeight || 0, $(document.body).outerHeight()); leftx = (leftx + M.tW) > bodywidth ? (bodywidth - M.tW) : leftx; topy = (topy + M.tH) > bodyheight ? (bodyheight - M.tH) : topy; E.css({ left: leftx, top: topy }) } else { E.css({ width: Math.max(v.pageX - M.pX + M.W, 0), height: Math.max(v.pageY - M.pY + M.H, 0) }) } return false }, stop: function() { if (!($.browser.msie && $.browser.version < 7)) { E.css({ opacity: M.o }) } $(document).unbind('mousemove', J.drag).unbind('mouseup', J.stop) } }; var J = $.kkDnR, M = J.dnr, E = J.e, i = function(e, h, k) { var m = e; return e.each(function() { h = (h) ? $(h, e) : e; h.bind('mousedown', { e: e, k: k }, function(v) { var d = v.data, p = {}; E = d.e; if (E.css('position') != 'relative') { try { E.position(p) } catch (e) { } }; M = { X: p.left || f('left') || 0, Y: p.top || f('top') || 0, tW: $.fetchWH(m).w || 0, tH: $.fetchWH(m).h || 0, W: f('width') || E[0].scrollWidth || 0, H: f('height') || E[0].scrollHeight || 0, pX: v.pageX, pY: v.pageY, k: d.k, o: E.css('opacity') }; if (!($.browser.msie && $.browser.version < 7)) { E.css({ opacity: 0.8 }) } $(document).mousemove($.kkDnR.drag).mouseup($.kkDnR.stop); return false }) }) }, f = function(k) { return parseInt(E.css(k)) || false } })(jQuery);
/*kkTab*/
(function($) { $.fn.kkTab = function(option) { if (typeof option == "function") { option = {} }; var s = $.extend({ trigger: "click", focusCss: "active", blurCss: "normal", effect: ".tabbox", onFinish: function() { } }, option || {}); var object = this; object.bind(s.trigger, function() { if (!$(this).hasClass(s.focusCss)) { $(this).parent().find("." + s.focusCss).addClass(s.blurCss).removeClass(s.focusCss); $(this).removeClass(s.blurCss).addClass(s.focusCss) } $(s.effect).hide(); $(s.effect).eq(object.index(this)).show() }) } })(jQuery);
/*kkmask*/
(function() { $.extend($.fn, { kkmask: function(msg, maskDivClass) { this.kkunmask(); var i = $('<iframe src="javascript:false;document.write(\'\');" class="maskiframe"></iframe>').css({ opacity: 0, 'z-index': -1, width: "100%", height: "100%" }); var op = { opacity: 0.8, z: 10000, bgcolor: '#ccc' }; var original = $(document.body); var position = { top: 0, left: 0 }; var isbody = false; if (this[0] && this[0] != window.document && this[0] != document.body) { original = this; position = original.position() } else { isbody = true } var maskDiv = $('<div class="maskdivgen"></div>'); maskDiv.prepend(i).appendTo(original); var maskWidth = original.outerWidth(); if (!maskWidth) { maskWidth = original.width() } var maskHeight = isbody ? Math.max(document.documentElement.clientHeight || 0, $(document.body).outerHeight()) : original.outerHeight(); if (!maskHeight) { maskHeight = original.height() } maskDiv.css({ position: 'absolute', top: position.top, left: position.left, 'z-index': op.z, width: maskWidth, height: maskHeight, 'background-color': op.bgcolor, opacity: 0 }); if (maskDivClass) { maskDiv.addClass(maskDivClass) } if (msg) { var msgDiv = $('<div style="position:absolute;"><div>' + msg + '</div></div>'); msgDiv.appendTo(maskDiv); var widthspace = (maskDiv.width() - msgDiv.width()); var heightspace = (maskDiv.height() - msgDiv.height()); msgDiv.css({ opacity: 1, top: (heightspace / 2 - 2), left: (widthspace / 2 - 2) }) } maskDiv.fadeIn('fast', function() { $(this).fadeTo('slow', op.opacity) }); return maskDiv }, kkunmask: function() { var original = $(document.body); if (this[0] && this[0] !== window.document) { original = $(this[0]) } original.find("> div.maskdivgen").fadeOut('slow', 0, function() { $(this).remove() }) } }) })();
/*jSlider*/
(function($) { $.extend($.fn, { jSlider: function(setting) { var ps = $.extend({ renderTo: $(document.body), enable: true, initPosition: 'min', initData: -1, size: { barWidth: 200, sliderWidth: 5 }, barCssName: 'defaultbar', completedCssName: 'jquery-completed', sliderCssName: 'jquery-jslider', sliderHover: 'jquery-jslider-hover', onChanging: function() { }, onChanged: function() { } }, setting); ps.renderTo = (typeof ps.renderTo == 'string' ? $(ps.renderTo) : ps.renderTo); var sliderbar = $('<div><div>&nbsp;</div><div>&nbsp;</div></div>').attr('class', ps.barCssName).css('width', ps.size.barWidth).appendTo(ps.renderTo); var completedbar = sliderbar.find('div:eq(0)').attr('class', ps.completedCssName); var slider = sliderbar.find('div:eq(1)').attr('class', ps.sliderCssName).css('width', ps.size.sliderWidth); var bw = sliderbar.width(), sw = slider.width(); if (typeof window.$sliderProcess == 'undefined') { window.$sliderProcess = new Function('obj1', 'obj2', 'left', 'obj1.css(\'left\',left);obj2.css(\'width\',left);') } ps.limited = { min: 0, max: bw - sw }; $sliderProcess(slider, completedbar, (ps.initData - ps.limited.min) > -1 && (ps.initData - ps.limited.min) <= ps.limited.max ? (ps.initData - ps.limited.min) : eval('ps.limited.' + ps.initPosition)); var slide = { drag: function(e) { var d = e.data; var l = Math.min(Math.max(e.pageX - d.pageX + d.left, ps.limited.min), ps.limited.max); $sliderProcess(slider, completedbar, l); ps.onChanging(l / ps.limited.max, e) }, drop: function(e) { slider.removeClass(ps.sliderHover); ps.onChanged(parseInt(slider.css('left')) / sw - ps.limited.max, e); $(document).unbind('mousemove', slide.drag).unbind('mouseup', slide.drop) } }; if (ps.enable) { slider.mousedown(function(e) { var d = { left: parseInt(slider.css('left')), pageX: e.pageX }; $(this).addClass(ps.sliderHover); $(document).bind('mousemove', d, slide.drag).bind('mouseup', d, slide.drop) }) } slider.data = { bar: sliderbar, completed: completedbar }; return slider }, setSliderValue: function(v, callback) { try { if (typeof v == 'undefined' || v < 0 || v > 1) { throw new Error('\'v\' must be a Float variable between 0 and 1.'); } var s = this; if (typeof s == 'undefined' || typeof s.data == 'undefined' || typeof s.data.bar == 'undefined') { throw new Error('You bound the method to an object that is not a slider!'); } $sliderProcess(s, s.data.completed, v * s.data.bar.width()); if (typeof callback != 'undefined') { callback(v) } } catch (e) { alert(e.message) } } }) })(jQuery);
/*kkIntger*/
(function($) { $.fn.kkIntger = function(option) { if (typeof option == "function") { option = {} }; var s = $.extend({ _addBtn: '', _reduceBtn: '', min: 1, max: 99999999 }, option || {}); var object = this; object.bind('blur', function() { var value = object.val(); if (!/^-?[1-9]\d*$/.test(value)) { value = value.replace(/\D/g, ''); object.val(value) } }); if (s._addBtn != '') { $(s._addBtn).bind('click', function() { var value = parseInt(object.val()) + 1; if (value <= s.max) { object.val(value) } }) } if (s._reduceBtn != '') { $(s._reduceBtn).bind('click', function() { var value = parseInt(object.val()) - 1; if (value >= s.min) { object.val(value) } }) } return $(this) } })(jQuery);
