window.QZFL = window.QZONE = window.QZFL || window.QZONE || {}; QZFL.version = "2.0.9.6"; QZFL._qzfl = 2.096; QZFL.emptyFn = function () { }; QZFL.returnFn = function (v) { return v; }; (function () { var ua = QZFL.userAgent = {}, agent = navigator.userAgent, nv = navigator.appVersion, r, m; ua.adjustBehaviors = QZFL.emptyFn; if (window.ActiveXObject) { ua.ie = 9 - ((agent.indexOf("Trident/5.0") > -1) ? 0 : 1) - (window.XDomainRequest ? 0 : 1) - (window.XMLHttpRequest ? 0 : 1); ua.isBeta = navigator.appMinorVersion && navigator.appMinorVersion.toLowerCase().indexOf("beta") > -1; if (ua.ie) { if (ua.ie < 7) { try { document.execCommand("BackgroundImageCache", false, true); } catch (ign) { } } QZFL._doc = document; eval("var document = QZFL._doc;"); } } else { if (document.getBoxObjectFor || typeof (window.mozInnerScreenX) != "undefined") { r = /(?:Firefox|GranParadiso|Iceweasel|Minefield).(d+.d+)/i; ua.firefox = parseFloat((r.exec(agent) || r.exec("Firefox/3.3"))[1], 10); } else { if (!navigator.taintEnabled) { m = /AppleWebKit.(d+.d+)/i.exec(agent); ua.webkit = m ? parseFloat(m[1], 10) : (document.evaluate ? (document.querySelector ? 525 : 420) : 419); if ((m = /Chrome.(d+.d+)/i.exec(agent)) || window.chrome) { ua.chrome = m ? parseFloat(m[1], 10) : "2.0"; } else { if ((m = /Version.(d+.d+)/i.exec(agent)) || window.safariHandler) { ua.safari = m ? parseFloat(m[1], 10) : "3.3"; } } ua.air = agent.indexOf("AdobeAIR") > -1 ? 1 : 0; ua.isiPad = agent.indexOf("iPad") > -1; ua.isiPhone = agent.indexOf("iPhone") > -1; } else { if (window.opera) { ua.opera = parseFloat(navigator.appVersion, 10); } else { ua.ie = 6; } } } } if (!(ua.macs = agent.indexOf("Mac OS X") > -1)) { ua.windows = (m = /Windows.+?(d+.d+)/i.exec(agent)) ? parseFloat(m[1], 10) : "5.1"; } })(); QZFL.object = QZFL.namespace = { map: function (object, scope) { return QZFL.object.extend(scope || window, object); }, extend: function () { var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options, name, src, copy; if (typeof target === "boolean") { deep = target; target = arguments[1] || {}; i = 2; } if (typeof target !== "object" && QZFL.object.getType(target) !== "function") { target = {}; } if (length === i) { target = QZFL; --i; } for (; i < length; i++) { if ((options = arguments[i]) != null) { for (name in options) { src = target[name]; copy = options[name]; if (target === copy) { continue; } if (deep && copy && typeof copy === "object" && !copy.nodeType) { var clone; if (src) { clone = src; } else { if (QZFL.lang.isArray(copy)) { clone = []; } else { if (QZFL.object.getType(copy) === "object") { clone = {}; } else { clone = copy; } } } target[name] = QZFL.object.extend(deep, clone, copy); } else { if (copy !== undefined) { target[name] = copy; } } } } } return target; }, each: function (obj, callback) { var name, value, i = 0, length = obj.length, isObj = (length === undefined) || (typeof (obj) == "function"); if (isObj) { for (name in obj) { if (callback.call(obj[name], obj[name], name, obj) === false) { break; } } } else { for (value = obj[0]; i < length && callback.call(value, value, i, obj) !== false; value = obj[++i]) { } } return obj; }, getType: function (obj) { return obj === null ? "null" : (obj === undefined ? "undefined" : Object.prototype.toString.call(obj).slice(8, -1).toLowerCase()); }, routeRE: /([dw_]+)/g, route: function (obj, path) { obj = obj || {}; path += ""; var r = QZFL.object.routeRE, m; r.lastIndex = 0; while ((m = r.exec(path)) !== null) { obj = obj[m[0]]; if (obj === undefined || obj === null) { break; } } return obj; }, bind: function (obj, fn) { var slice = Array.prototype.slice, args = slice.call(arguments, 2); return function () { obj = obj || this; fn = typeof fn == "string" ? obj[fn] : fn; fn = typeof fn == "function" ? fn : QZFL.emptyFn; return fn.apply(obj, args.concat(slice.call(arguments, 0))); }; }, ease: function (src, tar, rule) { if (tar) { if (typeof (rule) != "function") { rule = function (name) { return "$" + name; }; } QZFL.object.each(src, function (v, k) { if (typeof (v) == "function") { tar[rule[k]] = v; } }); } } }; QZFL.object.map(QZFL.object, QZFL); QZFL.console = function (expr) { if (window.console) { if (console.assert) { console.assert.apply(null, arguments); } else { expr || console.log.apply(null, slice.call(arguments, 1)); } } }; QZFL.console.print = function (msg, type) { window.console && console.log((type == 4 ? (new Date() + ":") : "") + msg); }; QZFL.runTime = { isDebugMode: false, error: QZFL.emptyFn, warn: QZFL.emptyFn }; QZFL.widget = {}; QZFL.config = { debugLevel: 0, defaultDataCharacterSet: "GB2312", DCCookieDomain: "qzone.qq.com", domainPrefix: "qq.com", gbEncoderPath: "http://imgcache.qq.com/qzone/v5/toolpages/", FSHelperPage: "http://imgcache.qq.com/qzone/v5/toolpages/fp_gbk.html", defaultShareObject: "http://imgcache.qq.com/qzone/v5/toolpages/getset.swf", staticServer: "http://imgcache.qq.com/ac/qzone/qzfl/lc/" }; QZFL.css = { classNameCache: {}, getClassRegEx: function (className) { var o = QZFL.css.classNameCache; return o[className] || (o[className] = new RegExp("(?:^|/s+)" + className + "(?:/s+|$)")); }, convertHexColor: function (color) { var p = "0x"; color = (color || "").toString(); color.charAt(0) == "#" && (color = color.substring(1)); color.length == 3 && (color = color.replace(/([0-9a-f])/ig, "$1$1")); return color.length == 6 ? [p + color.substr(0, 2) - 0, p + color.substr(2, 2) - 0, p + color.substr(4, 2) - 0] : [0, 0, 0]; }, styleSheets: {}, getStyleSheetById: function (id) { var s; return (s = QZFL.dom.get(id)) && s.sheet || (s = document.styleSheets) && s[id]; }, getRulesBySheet: function (sheetId) { var ss = typeof (sheetId) == "object" ? sheetId : QZFL.css.getStyleSheetById(sheetId), rs = {}, head, base; if (ss && !(rs = ss.cssRules || ss.rules)) { if (head = document.getElementsByTagName("head")[0]) { if (base = head.getElementsByTagName("base")[0]) { QZFL.dom.removeElement(base); rs = ss.cssRules; head.appendChild(base); } } } return rs; }, getRuleBySelector: function (sheetId, selector) { var _ss = QZFL.css.getStyleSheetById(sheetId), _rs = QZFL.css.getRulesBySheet(_ss); if (!_rs) { return null; } selector = (selector + "").toLowerCase(); !_ss.cacheSelector && (_ss.cacheSelector = {}); var _cs = _ss.cacheSelector[selector]; if (_cs && _rs[_cs] && selector == (_rs[_cs].selectorText + "").toLowerCase()) { return _rs[_cs]; } for (var i = 0, len = _rs.length; i < len; i++) { if (selector == (_rs[i].selectorText + "").toLowerCase()) { _ss.cacheSelector[selector] = i; return _rs[i]; } } return null; }, insertCSSLink: function (url, id) { var doc = document, cssLink = (cssLink = $(id)) && cssLink.nodeName == "LINK" ? cssLink : null, head = doc.getElementsByTagName("head")[0]; if (!cssLink) { cssLink = doc.createElement("link"); id && (cssLink.id = id); cssLink.rel = "stylesheet"; cssLink.rev = "stylesheet"; cssLink.type = "text/css"; cssLink.media = "screen"; head.appendChild(cssLink); } url && (cssLink.href = url); return cssLink.sheet || cssLink; }, insertStyleSheet: function (sheetId, rules) { var node = document.createElement("style"); node.type = "text/css"; sheetId && (node.id = sheetId); document.getElementsByTagName("head")[0].appendChild(node); if (rules) { if (node.styleSheet) { node.styleSheet.cssText = rules; } else { node.appendChild(document.createTextNode(rules)); } } return node.sheet || node; }, removeStyleSheet: function (id) { var _ss = QZFL.css.getStyleSheetById(id); _ss && QZFL.dom.removeElement(_ss.owningElement || _ss.ownerNode); }, updateClassName: function (elem, removeNames, addNames) { if (!elem || elem.nodeType != 1) { return; } var oriName = elem.className; if (removeNames && typeof (removeNames) == "string" || addNames && typeof (addNames) == "string") { if (removeNames == "*") { oriName = ""; } else { var ar = oriName.split(" "), i = 0, k, l = ar.length, n, b; oriName = {}; for (; i < l; i++) { ar[i] && (oriName[ar[i]] = true); } if (addNames) { ar = addNames.split(" "); l = ar.length; for (i = 0; i < l; i++) { (n = ar[i]) && !oriName[n] && (b = oriName[n] = true); } } if (removeNames) { ar = removeNames.split(" "); l = ar.length; for (i = 0; i < l; i++) { (n = ar[i]) && oriName[n] && (b = true) && delete oriName[n]; } } ar.length = 0; for (var k in oriName) { ar.push(k); } oriName = ar.join(" "); } if (b) { elem.className = oriName; } } return oriName; }, hasClassName: function (elem, name) { return elem && (elem = elem.className) && name && ((" " + elem + " ").indexOf(" " + name + " ") + 1); }, addClassName: function (elem, names) { QZFL.css.updateClassName(elem, null, names); }, removeClassName: function (elem, names) { QZFL.css.updateClassName(elem, names); }, replaceClassName: function (elems, a, b) { QZFL.css.swapClassName(elems, a, b, true); }, swapClassName: function (elems, a, b, _isRep) { if (elems) { if (elems.constructor != Array) { elems = [elems]; } for (var elem, i = 0, l = elems.length; i < l; i++) { if ((elem = elems[i]) && elem.nodeType == 1) { if (QZFL.css.hasClassName(elem, a)) { QZFL.css.updateClassName(elem, a, b); } else { if (!_isRep && QZFL.css.hasClassName(elem, b)) { QZFL.css.updateClassName(elem, b, a); } } } } } }, toggleClassName: function (elem, name) { if (!elem || elem.nodeType != 1) { return; } if (QZFL.css.hasClassName(elem, name)) { QZFL.css.updateClassName(elem, name); } else { QZFL.css.updateClassName(elem, null, name); } } }; QZFL.dom = { getById: function (id) { return document.getElementById(id); }, getByName: function (name, tagName, rt) { return QZFL.selector((tagName || "") + "[name="" + name + ""]", rt); }, get: function (e) { return (typeof (e) == "string") ? document.getElementById(e) : e; }, getNode: function (e) { return (e && (e.nodeType || e.item)) ? e : ((typeof (e) == "string") ? document.getElementById(e) : null); }, removeElement: function (elem) { if (elem = QZFL.dom.get(elem)) { elem.removeNode ? elem.removeNode(true) : (elem.parentNode && elem.parentNode.removeChild(elem)); } return elem = null; }, searchChain: function (elem, prop, func) { prop = prop || "parentNode"; while (elem) { if (!func || func.call(elem, elem)) { return elem; } elem = elem[prop]; } return null; }, searchElementByClassName: function (elem, className) { elem = QZFL.dom.get(elem); return QZFL.dom.searchChain(elem, "parentNode", function (el) { return QZFL.css.hasClassName(el, className); }); }, getElementsByClassName: function (className, tagName, context) { return QZFL.selector((tagName || "") + "." + className, QZFL.dom.get(context)); }, isAncestor: function (a, b) { return a && b && a != b && QZFL.dom.contains(a, b); }, getAncestorBy: function (elem, method) { elem = QZFL.dom.get(elem); return QZFL.dom.searchChain(elem.parentNode, "parentNode", function (el) { return el.nodeType == 1 && (!method || method(el)); }); }, getFirstChild: function (elem) { elem = QZFL.dom.get(elem); return QZFL.dom.searchChain(elem && elem.firstChild, "nextSibling", function (el) { return el.nodeType == 1; }); }, getLastChild: function (elem) { elem = QZFL.dom.get(elem); return QZFL.dom.searchChain(elem && elem.lastChild, "previousSibling", function (el) { return el.nodeType == 1; }); }, getNextSibling: function (elem) { elem = QZFL.dom.get(elem); return QZFL.dom.searchChain(elem && elem.nextSibling, "nextSibling", function (el) { return el.nodeType == 1; }); }, getPreviousSibling: function (elem) { elem = QZFL.dom.get(elem); return QZFL.dom.searchChain(elem && elem.previousSibling, "previousSibling", function (el) { return el.nodeType == 1; }); }, swapNode: function (node1, node2) { if (node1.swapNode) { node1.swapNode(node2); } else { var prt = node2.parentNode, next = node2.nextSibling; if (next == node1) { prt.insertBefore(node1, node2); } else { if (node2 == node1.nextSibling) { prt.insertBefore(node2, node1); } else { node1.parentNode.replaceChild(node2, node1); prt.insertBefore(node1, next); } } } }, createElementIn: function (tagName, elem, insertFirst, attrs) { var _e = (elem = QZFL.dom.get(elem) || document.body).ownerDocument.createElement(tagName || "div"), k; if (attrs) { for (k in attrs) { if (k == "class") { _e.className = attrs[k]; } else { if (k == "style") { _e.style.cssText = attrs[k]; } else { _e[k] = attrs[k]; } } } } insertFirst ? elem.insertBefore(_e, elem.firstChild) : elem.appendChild(_e); return _e; }, getStyle: function (el, property) { el = QZFL.dom.get(el); if (!el || el.nodeType == 9) { return null; } var w3cMode = document.defaultView && document.defaultView.getComputedStyle, computed = !w3cMode ? null : document.defaultView.getComputedStyle(el, ""), value = ""; switch (property) { case "float": property = w3cMode ? "cssFloat" : "styleFloat"; break; case "opacity": if (!w3cMode) { var val = 100; try { val = el.filters["DXImageTransform.Microsoft.Alpha"].opacity; } catch (e) { try { val = el.filters("alpha").opacity; } catch (e) { } } return val / 100; } else { return parseFloat((computed || el.style)[property]); } break; case "backgroundPositionX": if (w3cMode) { property = "backgroundPosition"; return ((computed || el.style)[property]).split(" ")[0]; } break; case "backgroundPositionY": if (w3cMode) { property = "backgroundPosition"; return ((computed || el.style)[property]).split(" ")[1]; } break; } if (w3cMode) { return (computed || el.style)[property]; } else { return (el.currentStyle[property] || el.style[property]); } }, setStyle: function (el, properties, value) { if (!(el = QZFL.dom.get(el)) || el.nodeType != 1) { return false; } var tmp, bRtn = true, w3cMode = (tmp = document.defaultView) && tmp.getComputedStyle, rexclude = /z-?index|font-?weight|opacity|zoom|line-?height/i; if (typeof (properties) == "string") { tmp = properties; properties = {}; properties[tmp] = value; } for (var prop in properties) { value = properties[prop]; if (prop == "float") { prop = w3cMode ? "cssFloat" : "styleFloat"; } else { if (prop == "opacity") { if (!w3cMode) { prop = "filter"; value = value >= 1 ? "" : ("alpha(opacity=" + Math.round(value * 100) + ")"); } } else { if (prop == "backgroundPositionX" || prop == "backgroundPositionY") { tmp = prop.slice(-1) == "X" ? "Y" : "X"; if (w3cMode) { var v = QZFL.dom.getStyle(el, "backgroundPosition" + tmp); prop = "backgroundPosition"; typeof (value) == "number" && (value = value + "px"); value = tmp == "Y" ? (value + " " + (v || "top")) : ((v || "left") + " " + value); } } } } if (typeof el.style[prop] != "undefined") { el.style[prop] = value + (typeof value === "number" && !rexclude.test(prop) ? "px" : ""); bRtn = bRtn && true; } else { bRtn = bRtn && false; } } return bRtn; }, createNamedElement: function (type, name, doc) { var _doc = doc || document, element; try { element = _doc.createElement("<" + type + " name="" + name + "">"); } catch (ign) { } if (!element) { element = _doc.createElement(type); } if (!element.name) { element.name = name; } return element; }, getRect: function (elem) { if (elem = QZFL.dom.get(elem)) { var box = QZFL.object.extend({}, elem.getBoundingClientRect()), s; if (typeof box.width == "undefined") { box.width = box.right - box.left; box.height = box.bottom - box.top; } return box; } }, getPosition: function (elem) { var box, s, doc; if (box = QZFL.dom.getRect(elem)) { if (s = QZFL.dom.getScrollLeft(doc = elem.ownerDocument)) { box.left += s, box.right += s; } if (s = QZFL.dom.getScrollTop(doc)) { box.top += s, box.bottom += s; } return box; } }, setPosition: function (el, pos) { QZFL.dom.setXY(el, pos["left"], pos["top"]); QZFL.dom.setSize(el, pos["width"], pos["height"]); }, getXY: function (elem, doc) { var box = QZFL.dom.getPosition(elem) || { left: 0, top: 0 }; return [box.left, box.top]; }, getSize: function (elem) { var box = QZFL.dom.getPosition(elem) || { width: -1, height: -1 }; return [box.width, box.height]; }, setXY: function (elem, x, y) { var _ml = parseInt(QZFL.dom.getStyle(elem, "marginLeft")) || 0, _mt = parseInt(QZFL.dom.getStyle(elem, "marginTop")) || 0; QZFL.dom.setStyle(elem, { left: (parseInt(x) || 0) - _ml + "px", top: (parseInt(y) || 0) - _mt + "px" }); }, getScrollLeft: function (doc) { var _doc = doc || document; return Math.max(_doc.documentElement.scrollLeft, _doc.body.scrollLeft); }, getScrollTop: function (doc) { var _doc = doc || document; return Math.max(_doc.documentElement.scrollTop, _doc.body.scrollTop); }, getScrollHeight: function (doc) { var _doc = doc || document; return Math.max(_doc.documentElement.scrollHeight, _doc.body.scrollHeight); }, getScrollWidth: function (doc) { var _doc = doc || document; return Math.max(_doc.documentElement.scrollWidth, _doc.body.scrollWidth); }, setScrollLeft: function (value, doc) { var _doc = doc || document; _doc[_doc.compatMode == "CSS1Compat" && !QZFL.userAgent.webkit ? "documentElement" : "body"].scrollLeft = value; }, setScrollTop: function (value, doc) { var _doc = doc || document; _doc[_doc.compatMode == "CSS1Compat" && !QZFL.userAgent.webkit ? "documentElement" : "body"].scrollTop = value; }, getClientHeight: function (doc) { var _doc = doc || document; return _doc.compatMode == "CSS1Compat" ? _doc.documentElement.clientHeight : _doc.body.clientHeight; }, getClientWidth: function (doc) { var _doc = doc || document; return _doc.compatMode == "CSS1Compat" ? _doc.documentElement.clientWidth : _doc.body.clientWidth; }, _SET_SIZE_RE: /^d+(?:.d*)?(px|%|em|in|cm|mm|pc|pt)?$/, setSize: function (el, w, h) { el = QZFL.dom.get(el); var _r = QZFL.dom._SET_SIZE_RE, m; QZFL.dom.setStyle(el, "width", (m = _r.exec(w)) ? (m[1] ? w : (parseInt(w, 10) + "px")) : "auto"); QZFL.dom.setStyle(el, "height", (m = _r.exec(h)) ? (m[1] ? h : (parseInt(h, 10) + "px")) : "auto"); }, getDocumentWindow: function (doc) { var _doc = doc || document; return _doc.parentWindow || _doc.defaultView; }, getElementsByTagNameNS: function (node, ns, tgn) { var res = []; if (node) { if (node.getElementsByTagNameNS) { return node.getElementsByTagName(ns + ":" + tgn); } else { if (node.getElementsByTagName) { var n = document.namespaces; if (n.length > 0) { var l = node.getElementsByTagName(tgn); for (var i = 0, len = l.length; i < len; ++i) { if (l[i].scopeName == ns) { res.push(l[i]); } } } } } } return res; }, getElementByTagNameBubble: function (elem, tagName) { var maxLv = 31; tagName = (tagName + "").toUpperCase(); elem = QZFL.dom.searchChain(elem = QZFL.dom.get(elem), "parentNode", function (el) { return el.tagName == tagName || el.tagName == "BODY" || (--maxLv) < 0; }); return !elem || elem.tagName == "BODY" || maxLv < 0 ? null : elem; }, insertAdjacent: function (elem, where, html, isText) { var range, pos = ["beforeBegin", "afterBegin", "beforeEnd", "afterEnd"], doc; if (QZFL.lang.isElement(elem) && pos[where] && (QZFL.lang.isString(html) || QZFL.lang.isElement(html))) { if (elem.insertAdjacentHTML) { elem["insertAdjacent" + (typeof (html) != "string" ? "Element" : isText ? "Text" : "HTML")](pos[where], html); } else { range = (doc = elem.ownerDocument).createRange(); range[where == 1 || where == 2 ? "selectNodeContents" : "selectNode"](elem); range.collapse(where < 2); range.insertNode(typeof (html) != "string" ? html : isText ? doc.createTextNode(html) : range.createContextualFragment(html)); } return true; } return false; } }; QZFL.event = { KEYS: { BACKSPACE: 8, TAB: 9, RETURN: 13, ESC: 27, SPACE: 32, LEFT: 37, UP: 38, RIGHT: 39, DOWN: 40, DELETE: 46 }, _eventListDictionary: {}, _fnSeqUID: 0, _objSeqUID: 0, addEvent: function (obj, eventType, fn, argArray) { var cfn, res = false, l; if (!obj) { return res; } if (!obj.eventsListUID) { obj.eventsListUID = "e" + (++QZFL.event._objSeqUID); } if (!(l = QZFL.event._eventListDictionary[obj.eventsListUID])) { l = QZFL.event._eventListDictionary[obj.eventsListUID] = {}; } if (!fn.__elUID) { fn.__elUID = "e" + (++QZFL.event._fnSeqUID) + obj.eventsListUID; } if (!l[eventType]) { l[eventType] = {}; } if (typeof (l[eventType][fn.__elUID]) == "function") { return false; } cfn = function (evt) { return fn.apply(obj, !argArray ? [QZFL.event.getEvent(evt)] : ([QZFL.event.getEvent(evt)]).concat(argArray)); }; if (obj.addEventListener) { obj.addEventListener(eventType, cfn, false); res = true; } else { if (obj.attachEvent) { res = obj.attachEvent("on" + eventType, cfn); } else { res = false; } } if (res) { l[eventType][fn.__elUID] = cfn; } return res; }, removeEvent: function (obj, eventType, fn) { var cfn = fn, res = false, l = QZFL.event._eventListDictionary, r; if (!obj) { return res; } if (!fn) { return QZFL.event.purgeEvent(obj, eventType); } if (obj.eventsListUID && l[obj.eventsListUID]) { l = l[obj.eventsListUID][eventType]; if (l && l[fn.__elUID]) { cfn = l[fn.__elUID]; r = l; } } if (obj.removeEventListener) { obj.removeEventListener(eventType, cfn, false); res = true; } else { if (obj.detachEvent) { obj.detachEvent("on" + eventType, cfn); res = true; } else { return false; } } if (res && r && r[fn.__elUID]) { delete r[fn.__elUID]; } return res; }, purgeEvent: function (obj, type) { var l; if (obj.eventsListUID && (l = QZFL.event._eventListDictionary[obj.eventsListUID]) && l[type]) { for (var k in l[type]) { if (obj.removeEventListener) { obj.removeEventListener(type, l[type][k], false); } else { if (obj.detachEvent) { obj.detachEvent("on" + type, l[type][k]); } } } } if (obj["on" + type]) { obj["on" + type] = null; } if (l) { l[type] = null; delete l[type]; } return true; }, getEvent: function (evt) { var evt = window.event || evt, c, cnt; if (!evt && window.Event) { c = arguments.callee; cnt = 0; while (c) { if ((evt = c.arguments[0]) && typeof (evt.srcElement) != "undefined") { break; } else { if (cnt > 9) { break; } } c = c.caller; ++cnt; } } return evt; }, getButton: function (evt) { var e = QZFL.event.getEvent(evt); if (!e) { return -1; } if (QZFL.userAgent.ie) { return e.button - Math.ceil(e.button / 2); } else { return e.button; } }, getTarget: function (evt) { var e = QZFL.event.getEvent(evt); if (e) { return e.srcElement || e.target; } else { return null; } }, getCurrentTarget: function (evt) { var e = QZFL.event.getEvent(evt); if (e) { return e.currentTarget || document.activeElement; } else { return null; } }, cancelBubble: function (evt) { evt = QZFL.event.getEvent(evt); if (!evt) { return false; } if (evt.stopPropagation) { evt.stopPropagation(); } else { if (!evt.cancelBubble) { evt.cancelBubble = true; } } }, preventDefault: function (evt) { evt = QZFL.event.getEvent(evt); if (!evt) { return false; } if (evt.preventDefault) { evt.preventDefault(); } else { evt.returnValue = false; } }, mouseX: function (evt) { evt = QZFL.event.getEvent(evt); return evt.pageX || (evt.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft)); }, mouseY: function (evt) { evt = QZFL.event.getEvent(evt); return evt.pageY || (evt.clientY + (document.documentElement.scrollTop || document.body.scrollTop)); }, getRelatedTarget: function (ev) { ev = QZFL.event.getEvent(ev); var t = ev.relatedTarget; if (!t) { if (ev.type == "mouseout") { t = ev.toElement; } else { if (ev.type == "mouseover") { t = ev.fromElement; } else { } } } return t; }, onDomReady: function (fn) { QZFL.event.onDomReady._fn = function () { fn(); QZFL.event.onDomReady._fn = null; }; if (document.addEventListener) { if (QZFL.userAgent.safari < 4) { var interval = setInterval(function () { if ((/loaded|complete/).test(document.readyState)) { QZFL.event.onDomReady._fn(); clearInterval(interval); } }, 50); } else { document.addEventListener("DOMContentLoaded", QZFL.event.onDomReady._fn, true); } } else { var src = window.location.protocol == "https:" ? "//:" : "javascript:void(0)"; document.write("<mce:script onreadystatechange="if(this.readyState=='complete'){this.parentNode.removeChild(this);QZFL.event.onDomReady._fn();}" defer="defer" src="" + src + ""></mce:script>"); } } }; QZFL.event.on = QZFL.event.addEvent; QZFL.event.bind = QZFL.object.bind; QZFL.queue = (function () { var _o = QZFL.object; var _queue = {}; var _Queue = function (key, queue) { if (this instanceof arguments.callee) { this._qz_queuekey = key; return this; } if (_o.getType(queue = queue || []) == "array") { _queue[key] = queue; } return new _Queue(key); }; var _extend = { push: function (key, fn) { fn = this._qz_queuekey ? key : fn; _queue[this._qz_queuekey || key].push(fn); }, shift: function (key) { var _q = _queue[this._qz_queuekey || key]; if (_q) { return QZFL.queue._exec(_q.shift()); } }, getLen: function (key) { return _queue[this._qz_queuekey || key].length; }, run: function (key) { var _q = _queue[this._qz_queuekey || key]; if (_q) { _o.each(_q, QZFL.queue._exec); } }, timedChunk: function (key, conf) { var _q = _queue[this._qz_queuekey || key], _conf; if (_q) { _conf = QZFL.lang.propertieCopy(conf, QZFL.queue._tcCof, null, true); setTimeout(function () { var _start = +new Date(); do { QZFL.queue.shift(key); } while (QZFL.queue.getLen(key) > 0 && (+new Date() - _start < _conf.runTime)); if (QZFL.queue.getLen(key) > 0) { setTimeout(arguments.callee, _conf.waitTime); _conf.onWait(); } else { _conf.onRunEnd(); } }, 0); } }, _tcCof: { "runTime": 50, "waitTime": 25, "onRunEnd": QZFL.emptyFn, "onWait": QZFL.emptyFn }, _exec: function (value, key, source) { if (!value || _o.getType(value) != "function") { if (_o.getType(key) == "number") { source[key] = null; } return false; } try { return value(); } catch (e) { QZFL.console.print("QZFL Queue Got An Error: [" + e.name + "] " + e.message, 1); } } }; _o.extend(_Queue.prototype, _extend); _o.extend(_Queue, _extend); return _Queue; })(); QZFL.string = { RegExps: { trim: /^s+|s+$/g, ltrim: /^s+/, rtrim: /s+$/, nl2br: / /g, s2nb: /[x20]{2}/g, URIencode: /[x09x0Ax0Dx20x21-x29x2Bx2Cx2Fx3A-x3Fx5B-x5Ex60x7B-x7E]/g, escHTML: { re_amp: /&/g, re_lt: /</g, re_gt: />/g, re_apos: /x27/g, re_quot: /x22/g }, escString: { bsls: ///g, nl: / /g, rt: / /g, tab: / /g }, restXHTML: { re_amp: /&/g, re_lt: /</g, re_gt: />/g, re_apos: /&(?:apos|#0?39);/g, re_quot: /"/g }, write: /{(d{1,2})(?::([xodQqb]))?}/g, isURL: /^(?:ht|f)tp(?:s)?://(?:[w-.]+).w+/i, cut: /[x00-xFF]/, getRealLen: { r0: /[^x00-xFF]/g, r1: /[x00-xFF]/g }, format: /{([dw.]+)}/g }, commonReplace: function (s, p, r) { return s.replace(p, r); }, listReplace: function (s, l) { if (QZFL.lang.isHashMap(l)) { for (var i in l) { s = QZFL.string.commonReplace(s, l[i], i); } return s; } else { return s + ""; } }, trim: function (str) { return QZFL.string.commonReplace(str + "", QZFL.string.RegExps.trim, ""); }, ltrim: function (str) { return QZFL.string.commonReplace(str + "", QZFL.string.RegExps.ltrim, ""); }, rtrim: function (str) { return QZFL.string.commonReplace(str + "", QZFL.string.RegExps.rtrim, ""); }, nl2br: function (str) { return QZFL.string.commonReplace(str + "", QZFL.string.RegExps.nl2br, "<br />"); }, s2nb: function (str) { return QZFL.string.commonReplace(str + "", QZFL.string.RegExps.s2nb, " "); }, URIencode: function (str) { var cc, ccc; return (str + "").replace(QZFL.string.RegExps.URIencode, function (a) { if (a == " ") { return "+"; } else { if (a == " ") { return ""; } } cc = a.charCodeAt(0); ccc = cc.toString(16); return "%" + ((cc < 16) ? ("0" + ccc) : ccc); }); }, escHTML: function (str) { var t = QZFL.string.RegExps.escHTML; return QZFL.string.listReplace((str + ""), { "&": t.re_amp, "<": t.re_lt, ">": t.re_gt, "'": t.re_apos, """: t.re_quot }); }, escString: function (str) { var t = QZFL.string.RegExps.escString, h = QZFL.string.RegExps.escHTML; return QZFL.string.listReplace((str + ""), { "//": t.bsls, "/n": t.nl, "": t.rt, "/t": t.tab, "/'": h.re_apos, "/"": h.re_quot }); }, restHTML: function (str) { if (!QZFL.string.restHTML.__utilDiv) { QZFL.string.restHTML.__utilDiv = document.createElement("div"); } var t = QZFL.string.restHTML.__utilDiv; t.innerHTML = (str + ""); if (typeof (t.innerText) != "undefined") { return t.innerText; } else { if (typeof (t.textContent) != "undefined") { return t.textContent; } else { if (typeof (t.text) != "undefined") { return t.text; } else { return ""; } } } }, restXHTML: function (str) { var t = QZFL.string.RegExps.restXHTML; return QZFL.string.listReplace((str + ""), { "<": t.re_lt, ">": t.re_gt, "'": t.re_apos, """: t.re_quot, "&": t.re_amp }); }, write: function (strFormat, someArgs) { if (arguments.length < 1 || !QZFL.lang.isString(strFormat)) { return ""; } var rArr = QZFL.lang.arg2arr(arguments), result = rArr.shift(), tmp; return result.replace(QZFL.string.RegExps.write, function (a, b, c) { b = parseInt(b, 10); if (b < 0 || (typeof rArr[b] == "undefined")) { return "(n/a)"; } else { if (!c) { return rArr[b]; } else { switch (c) { case "x": return "0x" + rArr[b].toString(16); case "o": return "o" + rArr[b].toString(8); case "d": return rArr[b].toString(10); case "Q": return """ + rArr[b].toString(16) + """; case "q": return "`" + rArr[b].toString(16) + "'"; case "b": return "<" + !!rArr[b] + ">"; } } } }); }, isURL: function (s) { return QZFL.string.RegExps.isURL.test(s); }, customEncode: function (s, type) { var r; if (typeof type == "undefined") { type = ""; } switch (type.toUpperCase()) { case "URICPT": r = encodeURIComponent(s); break; default: r = encodeURIComponent(s); } return r; }, escapeURI: function (s) { if (window.encodeURIComponent) { return encodeURIComponent(s); } if (window.escape) { return escape(s); } return ""; }, fillLength: function (source, length, ch, isRight) { if ((source = String(source)).length < length) { var ar = new Array(length - source.length); ar[isRight ? "unshift" : "push"](source); source = ar.join(ch == undefined ? "0" : ch); } return source; }, cut: function (str, bitLen, tails) { str = String(str); bitLen -= 0; tails = tails || ""; if (isNaN(bitLen)) { return str; } var len = str.length, i = Math.min(Math.floor(bitLen / 2), len), cnt = QZFL.string.getRealLen(str.slice(0, i)); for (; i < len && cnt < bitLen; i++) { cnt += 1 + (str.charAt(i) > 255); } return str.slice(0, cnt > bitLen ? i - 1 : i) + (i < len ? tails : ""); }, getRealLen: function (s, isUTF8) { if (typeof (s) != "string") { return 0; } if (!isUTF8) { return s.replace(QZFL.string.RegExps.getRealLen.r0, "**").length; } else { var cc = s.replace(QZFL.string.RegExps.getRealLen.r1, ""); return (s.length - cc.length) + (encodeURI(cc).length / 3); } }, format: function (str) { var args = Array.prototype.slice.call(arguments), v; str = args.shift() + ""; if (args.length == 1 && typeof (args[0]) == "object") { args = args[0]; } QZFL.string.RegExps.format.lastIndex = 0; return str.replace(QZFL.string.RegExps.format, function (m, n) { v = QZFL.object.route(args, n); return v === undefined ? m : v; }); } }; QZFL.util = { buildUri: function (s) { return new QZFL.util.URI(s); }, URI: function (s) { if (!(QZFL.object.getType(s) == "string")) { return null; } if (s.indexOf("://") < 1) { s = location.protocol + "//" + location.host + (s.indexOf("/") == 0 ? "" : location.pathname.substr(0, location.pathname.lastIndexOf("/") + 1)) + s; } var depart = s.split("://"); if (QZFL.object.getType(depart) == "array" && depart.length > 1 && (/^[a-zA-Z]+$/).test(depart[0])) { this.protocol = depart[0].toLowerCase(); var h = depart[1].split("/"); if (QZFL.object.getType(h) == "array") { this.host = h[0]; this.pathname = "/" + h.slice(1).join("/").replace(/(?|#).+/i, ""); this.href = s; var se = depart[1].lastIndexOf("?"), ha = depart[1].lastIndexOf("#"); this.search = (se >= 0) ? depart[1].substring(se) : ""; this.hash = (ha >= 0) ? depart[1].substring(ha) : ""; if (this.search.length > 0 && this.hash.length > 0) { if (ha < se) { this.search = ""; } else { this.search = depart[1].substring(se, ha); } } return this; } else { return null; } } else { return null; } } }; QZFL.lang = { isString: function (o) { return QZFL.object.getType(o) == "string"; }, isArray: function (o) { return QZFL.object.getType(o) == "array"; }, isFunction: function (o) { return QZFL.object.getType(o) == "function"; }, isHashMap: function (o) { return QZFL.object.getType(o) == "object"; }, isNode: function (o) { if (typeof (Node) == "undefined") { Node = null; } try { if (!o || !((Node != undefined && o instanceof Node) || o.nodeName)) { return false; } } catch (ignored) { return false; } return true; }, isElement: function (o) { return o && o.nodeType == 1; } }; (function () { QZFL.object.extend(QZFL.util, { copyToClip: function (text) { if (QZFL.userAgent.ie) { return clipboardData.setData("Text", text); } else { var o = QZFL.shareObject.getValidSO(); return o ? o.setClipboard(text) : false; } }, evalGlobal: function (js) { js += ""; var obj = document.createElement("script"), head = document.documentElement || document.getElementsByTagName("head")[0]; obj.type = "text/javascript"; obj.id = "__evalGlobal_" + QZFL.util.evalGlobal._counter; try { obj.innerHTML = js; } catch (e) { obj.text = js; } head.insertBefore(obj, head.firstChild); QZFL.util.evalGlobal._counter++; setTimeout(function () { QZFL.dom.removeElement(obj); }, 50); }, runStyleGlobal: function (st) { if (QZFL.userAgent.safari) { var obj = document.createElement("style"); obj.type = "text/css"; obj.id = "__runStyle_" + QZFL.util.runStyleGlobal._counter; try { obj.textContent = st; } catch (e) { alert(e.message); } var h = document.getElementsByTagName("head")[0]; if (h) { h.appendChild(obj); QZFL.util.runStyleGlobal._counter++; } } else { } }, genHttpParamString: function (o) { if (QZFL.lang.isHashMap(o)) { var r = []; try { for (var i in o) { r.push(i + "=" + QZFL.string.customEncode(o[i], "URICPT")); } } catch (ignore) { return ""; } return r.join("&"); } else { if (typeof (o) == "string") { return o; } else { return ""; } } }, splitHttpParamString: function (s) { return QZFL.util.commonDictionarySplit(s, "&"); }, commonDictionarySplit: function (s, esp, vq, eq) { var res = {}; if (!s || typeof (s) != "string") { return res; } if (typeof (esp) != "string") { esp = "&"; } if (typeof (vq) != "string") { vq = ""; } if (typeof (eq) != "string") { eq = "="; } var l = s.split(vq + esp), len = l.length, tmp, t = eq + vq, p; if (vq) { tmp = l[len - 1].split(vq); l[len - 1] = tmp.slice(0, tmp.length - 1).join(vq); } for (var i = 0, len; i < len; i++) { if (eq) { tmp = l[i].split(t); if (tmp.length > 1) { res[tmp[0]] = tmp.slice(1).join(t); continue; } } res[l[i]] = true; } return res; } }); QZFL.util.evalGlobal._counter = 0; QZFL.util.runStyleGlobal._counter = 0; })(); QZFL.lang.isValidXMLdom = function (o) { return !!(o && o.xml && /^<?xml/.test(o.xml)); }; QZFL.lang.arg2arr = function (refArgs, start) { return Array.prototype.slice.apply(refArgs, [start || 0, refArgs.length]); }; QZFL.lang.getObjByNameSpace = function (ns, setup) { if (typeof (ns) != "string") { return ns; } var l = ns.split("."), r = window; try { for (var i = 0, len = l.length; i < len; ++i) { if (typeof (r[l[i]]) == "undefined") { if (setup) { r[l[i]] = {}; } else { return void (0); } } r = r[l[i]]; } return r; } catch (ignore) { return void (0); } }; QZFL.lang.objectClone = function (obj, preventName) { if ((typeof obj) == "object") { var res = (QZFL.lang.isArray(obj)) ? [] : {}; for (var i in obj) { if (i != preventName) { res[i] = QZFL.lang.objectClone(obj[i], preventName); } } return res; } else { if ((typeof obj) == "function") { return Object; } } return obj; }; QZFL.lang.obj2str = function (obj) { var t, sw; if ((typeof obj) == "object") { if (obj === null) { return "null"; } sw = QZFL.lang.isArray(obj); t = []; for (var i in obj) { t.push((sw ? "" : (""" + QZFL.string.escString(i) + "":")) + obj2str(obj[i])); } t = t.join(); return sw ? ("[" + t + "]") : ("{" + t + "}"); } else { if ((typeof obj) == "function") { return ""; } else { if ((typeof obj) == "undefined") { return "undefined"; } else { if ((typeof obj) == "number") { return obj.toString(); } } } } return !obj ? """" : (""" + QZFL.string.escString(obj) + """); }; QZFL.lang.propertieCopy = function (s, b, propertiSet, notOverWrite) { var l = (!propertiSet || typeof (propertiSet) != "object") ? b : propertiSet; s = s || {}; for (var p in l) { if (!notOverWrite || !(p in s)) { s[p] = l[p]; } } return s; }; QZFL.lang.tryThese = function () { for (var res, i = 0, len = arguments.length; i < len; i++) { try { return arguments[i](); } catch (ignore) { } } return null; }; QZFL.lang.chain = function (u, v) { var calls = Array.prototype.slice.call(arguments); return function () { for (var i = 0, len = calls.length; i < len; i++) { if (calls[i] && calls[i].apply(null, arguments) === false) { return false; } } return true; }; }; QZFL.lang.uniqueArray = function (arr) { if (!QZFL.lang.isArray(arr)) { return arr; } var flag = {}, index = 0; while (index < arr.length) { if (flag[arr[index]] == typeof (arr[index])) { arr.splice(index, 1); continue; } flag[arr[index].toString()] = typeof (arr[index]); ++index; } return arr; }; QZFL.enviroment = (function () { var _p = {}, hookPool = {}; function envGet(kname) { return _p[kname]; } function envDel(kname) { delete _p[kname]; return true; } function envSet(kname, value) { if (typeof value == "undefined") { if (typeof kname == "undefined") { return false; } else { if (!(_p[kname] === undefined)) { return false; } } } else { _p[kname] = value; return true; } } return { get: envGet, set: envSet, del: envDel, hookPool: hookPool }; })(); QZFL.pageEvents = (function () { function _ihp() { var qs = location.search.substring(1), qh = location.hash.substring(1), s, h, n; ENV.set("_queryString", qs); ENV.set("_queryHash", qh); ENV.set("queryString", s = QZFL.util.splitHttpParamString(qs)); ENV.set("queryHash", h = QZFL.util.splitHttpParamString(qh)); if (s && s.DEBUG) { n = parseInt(s.DEBUG, 10); if (!isNaN(n)) { QZFL.config.debugLevel = n; } } } function _bootStrap() { if (document.addEventListener) { if (QZFL.userAgent.safari < 4) { var interval = setInterval(function () { if ((/loaded|complete/).test(document.readyState)) { _onloadHook(); clearInterval(interval); } }, 50); } else { document.addEventListener("DOMContentLoaded", _onloadHook, true); } } else { var src = "javascript:void(0)"; if (window.location.protocol == "https:") { src = "//:"; } document.write("<mce:script onreadystatechange="if(this.readyState=='complete'){this.parentNode.removeChild(this);QZFL.pageEvents._onloadHook();}" defer="defer" src="" + src + ""></mce:script>"); } window.onload = QZFL.lang.chain(window.onload, function () { _onloadHook(); _runHooks("onafterloadhooks"); }); window.onbeforeunload = function () { return _runHooks("onbeforeunloadhooks"); }; window.onunload = QZFL.lang.chain(window.onunload, function () { _runHooks("onunloadhooks"); }); } function _onloadHook() { _runHooks("onloadhooks"); QZFL.enviroment.loaded = true; } function _runHook(handler) { try { handler(); } catch (ex) { } } function _runHooks(hooks) { var isbeforeunload = (hooks == "onbeforeunloadhooks"), warn = null, hc = window.ENV.hookPool; do { var h = hc[hooks]; if (!isbeforeunload) { hc[hooks] = null; } if (!h) { break; } for (var ii = 0; ii < h.length; ii++) { if (isbeforeunload) { warn = warn || h[ii](); } else { h[ii](); } } if (isbeforeunload) { break; } } while (hc[hooks]); if (isbeforeunload) { if (warn) { return warn; } else { QZFL.enviroment.loaded = false; } } } function _addHook(hooks, handler) { var c = window.ENV.hookPool; (c[hooks] ? c[hooks] : (c[hooks] = [])).push(handler); } function _insertHook(hooks, handler, position) { var c = window.ENV.hookPool; if (typeof (position) == "number" && position >= 0) { if (!c[hooks]) { c[hooks] = []; } c[hooks].splice(position, 0, handler); } else { return false; } } function _lr(handler) { QZFL.enviroment.loaded ? _runHook(handler) : _addHook("onloadhooks", handler); } function _bulr(handler) { _addHook("onbeforeunloadhooks", handler); } function _ulr(handler) { _addHook("onunloadhooks", handler); } function pinit() { _bootStrap(); _ihp(); var _dt; if (_dt = document.getElementById("__DEBUG_out")) { ENV.set("dout", _dt); } var __dalert; if (!ENV.get("alertConverted")) { __dalert = alert; eval("var alert=function(msg){if(msg!=undefined){__dalert(msg);return msg;}}"); ENV.set("alertConverted", true); } var t = ENV.get("queryHash"); if (t && t.DEBUG) { QZFL.config.debugLevel = 2; } } return { onloadRegister: _lr, onbeforeunloadRegister: _bulr, onunloadRegister: _ulr, initHttpParams: _ihp, bootstrapEventHandlers: _bootStrap, _onloadHook: _onloadHook, insertHooktoHooksQueue: _insertHook, pageBaseInit: pinit }; })(); QZFL.string.parseXML = function (text) { var doc; if (window.ActiveXObject) { doc = QZFL.lang.tryThese(function () { return new ActiveXObject("MSXML2.DOMDocument.6.0"); }, function () { return new ActiveXObject("MSXML2.DOMDocument.5.0"); }, function () { return new ActiveXObject("MSXML2.DOMDocument.4.0"); }, function () { return new ActiveXObject("MSXML2.DOMDocument.3.0"); }, function () { return new ActiveXObject("MSXML2.DOMDocument"); }, function () { return new ActiveXObject("Microsoft.XMLDOM"); }); doc.async = "false"; doc.loadXML(text); if (doc.parseError.reason) { return null; } } else { var parser = new DOMParser(); doc = parser.parseFromString(text, "text/xml"); if (doc.documentElement.nodeName == "parsererror") { return null; } } return doc.documentElement; }; QZFL.string.timeFormatString = function (date, mask, baseTime) { try { date = date.getTime ? date : (new Date(date)); } catch (ign) { return ""; } var me = QZFL.string.timeFormatString, map = me._map, unt = me._units, rel = false, t, delta, v; if (!mask) { if (!(baseTime instanceof Date)) { return String(date); } else { delta = Math.abs(date - baseTime); for (var i = 0, len = unt.length; i < len; ++i) { t = map[unt[i]]; if (delta > t[1]) { return Math.floor(delta / t[1]) + t[2]; } } return "u521au521a"; } } else { return mask.replace(me._re, function (a, b, c) { (rel = b.charAt(0) == "_") && (b = b.charAt(1)); if (!map[b]) { return a; } if (!rel) { v = date[map[b][0]](); b == "y" && (v %= 100); b == "M" && v++; return v < 10 ? QZFL.string.fillLength(v, 2, c) : v.toString(); } else { return Math.floor(Math.abs(date - baseTime) / map[b][1]); } }); } }; QZFL.string.timeFormatString._re = /{([_yYMdhms]{1,2})(?::([dws]))?}/g; QZFL.string.timeFormatString._map = { y: ["getYear", 31104000000], Y: ["getFullYear", 31104000000, "u5e74u524d"], M: ["getMonth", 2592000000, "u4e2au6708u524d"], d: ["getDate", 86400000, "u5929u524d"], h: ["getHours", 3600000, "u5c0fu65f6u524d"], m: ["getMinutes", 60000, "u5206u949fu524d"], s: ["getSeconds", 1000, "u79d2u524d"] }; QZFL.string.timeFormatString._units = ["Y", "M", "d", "h", "m", "s"]; QZFL.string.StringBuilder = function () { this._strList = QZFL.lang.arg2arr(arguments); }; QZFL.string.StringBuilder.prototype = { append: function (str) { if (QZFL.lang.isString(str)) { this._strList.push(str.toString()); } }, insertFirst: function (str) { if (QZFL.lang.isString(str)) { this._strList.unshift(str.toString()); } }, appendArray: function (arr) { if (isArray(arr)) { this._strList = this._strList.concat(arr); } }, toString: function (spliter) { return this._strList.join(!spliter ? "" : spliter); }, clear: function () { this._strList.splice(0, this._strList.length); } }; (function () { var chunker = /((?:((?:([^()]+)|[^()]+)+)|[(?:[[^[]]*]|['"][^'"]*['"]|[^[]'"]+)+]|/.|[^ >+~,([/]+)+|[>+~])(s*,s*)?/g, done = 0, toString = Object.prototype.toString, hasDuplicate = false; var Sizzle = function (selector, context, results, seed) { results = results || []; var origContext = context = context || document; if (context.nodeType !== 1 && context.nodeType !== 9) { return []; } if (!selector || typeof selector !== "string") { return results; } var parts = [], m, set, checkSet, check, mode, extra, prune = true, contextXML = isXML(context); chunker.lastIndex = 0; while ((m = chunker.exec(selector)) !== null) { parts.push(m[1]); if (m[2]) { extra = RegExp.rightContext; break; } } if (parts.length > 1 && origPOS.exec(selector)) { if (parts.length === 2 && Expr.relative[parts[0]]) { set = posProcess(parts[0] + parts[1], context); } else { set = Expr.relative[parts[0]] ? [context] : Sizzle(parts.shift(), context); while (parts.length) { selector = parts.shift(); if (Expr.relative[selector]) { selector += parts.shift(); } set = posProcess(selector, set); } } } else { if (!seed && parts.length > 1 && context.nodeType === 9 && !contextXML && Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1])) { var ret = Sizzle.find(parts.shift(), context, contextXML); context = ret.expr ? Sizzle.filter(ret.expr, ret.set)[0] : ret.set[0]; } if (context) { var ret = seed ? { expr: parts.pop(), set: makeArray(seed)} : Sizzle.find(parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML); set = ret.expr ? Sizzle.filter(ret.expr, ret.set) : ret.set; if (parts.length > 0) { checkSet = makeArray(set); } else { prune = false; } while (parts.length) { var cur = parts.pop(), pop = cur; if (!Expr.relative[cur]) { cur = ""; } else { pop = parts.pop(); } if (pop == null) { pop = context; } Expr.relative[cur](checkSet, pop, contextXML); } } else { checkSet = parts = []; } } if (!checkSet) { checkSet = set; } if (!checkSet) { throw "Syntax error, unrecognized expression: " + (cur || selector); } if (toString.call(checkSet) === "[object Array]") { if (!prune) { results.push.apply(results, checkSet); } else { if (context && context.nodeType === 1) { for (var i = 0; checkSet[i] != null; i++) { if (checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i]))) { results.push(set[i]); } } } else { for (var i = 0; checkSet[i] != null; i++) { if (checkSet[i] && checkSet[i].nodeType === 1) { results.push(set[i]); } } } } } else { makeArray(checkSet, results); } if (extra) { Sizzle(extra, origContext, results, seed); Sizzle.uniqueSort(results); } return results; }; Sizzle.uniqueSort = function (results) { if (sortOrder) { hasDuplicate = false; results.sort(sortOrder); if (hasDuplicate) { for (var i = 1; i < results.length; i++) { if (results[i] === results[i - 1]) { results.splice(i--, 1); } } } } }; Sizzle.matches = function (expr, set) { return Sizzle(expr, null, null, set); }; Sizzle.find = function (expr, context, isXML) { var set, match; if (!expr) { return []; } for (var i = 0, l = Expr.order.length; i < l; i++) { var type = Expr.order[i], match; if ((match = Expr.match[type].exec(expr))) { var left = RegExp.leftContext; if (left.substr(left.length - 1) !== "/") { match[1] = (match[1] || "").replace(///g, ""); set = Expr.find[type](match, context, isXML); if (set != null) { expr = expr.replace(Expr.match[type], ""); break; } } } } if (!set) { set = context.getElementsByTagName("*"); } return { set: set, expr: expr }; }; Sizzle.filter = function (expr, set, inplace, not) { var old = expr, result = [], curLoop = set, match, anyFound, isXMLFilter = set && set[0] && isXML(set[0]); while (expr && set.length) { for (var type in Expr.filter) { if ((match = Expr.match[type].exec(expr)) != null) { var filter = Expr.filter[type], found, item; anyFound = false; if (curLoop == result) { result = []; } if (Expr.preFilter[type]) { match = Expr.preFilter[type](match, curLoop, inplace, result, not, isXMLFilter); if (!match) { anyFound = found = true; } else { if (match === true) { continue; } } } if (match) { for (var i = 0; (item = curLoop[i]) != null; i++) { if (item) { found = filter(item, match, i, curLoop); var pass = not ^ !!found; if (inplace && found != null) { if (pass) { anyFound = true; } else { curLoop[i] = false; } } else { if (pass) { result.push(item); anyFound = true; } } } } } if (found !== undefined) { if (!inplace) { curLoop = result; } expr = expr.replace(Expr.match[type], ""); if (!anyFound) { return []; } break; } } } if (expr == old) { if (anyFound == null) { throw "Syntax error, unrecognized expression: " + expr; } else { break; } } old = expr; } return curLoop; }; var Expr = Sizzle.selectors = { order: ["ID", "NAME", "TAG"], match: { ID: /#((?:[wu00c0-uFFFF_-]|/.)+)/, CLASS: /.((?:[wu00c0-uFFFF_-]|/.)+)/, NAME: /[name=['"]*((?:
QQ 空间核心JS

最新推荐文章于 2025-09-10 15:28:37 发布
