/*土著人开发的common组件 @土著人 (http://www.tuzhuren.com)*/ define("common:www/page/jquery/browser.js", function() { var jQuery = window.jQuery || {}; jQuery.browser = function() { var userAgent = navigator.userAgent.toLowerCase(); return { version: (userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [])[1], safari: /webkit/.test(userAgent), opera: /opera/.test(userAgent), msie: /msie/.test(userAgent) && !/opera/.test(userAgent), mozilla: /mozilla/.test(userAgent) && !/(compatible|webkit)/.test(userAgent) }; }(); return jQuery; }); define("common:www/page/controller/controller.js", function(require, obj, exp) { var controllerObj = { base: require("common:www/page/controller/base.js") }; exp.exports = { get: function(key) { return key = key.toLowerCase(), !controllerObj[key], controllerObj[key]; }, set: function(key, val) { key = key.toLowerCase(), controllerObj[key] || (controllerObj[key] = val); } }; }); define("common:www/page/controller/base.js", function(require) { var jquery = require("jquery"), events = require("common:www/page/events/events.js"), utils = require("common:www/page/utils/utils.js"), base = jquery.extend({ appendTo: function(n) { this.$el.appendTo(n); }, append: function(n, e) { var i = e ? this.$el.find(e) : this.$el; utils.isArray(n) ? this._appendChildren(n, i) : this._appendChild(n, i); }, _appendChildren: function(n, e) { for (var i, t = 0; i = n[t++];) this._appendChild(i, e); }, _appendChild: function(n, e) { n.appendTo(e[0]); } }, events); return base; }); define("common:www/page/events/events.js", function(i) { var n = i("jquery"), e = i("common:www/page/arch/EventDispatcher/EventDispatcher.js"), t = "__bdimg__events", d = "__bdimg__", s = 1e6, o = function() { return "bdimg" + s++ }, r = function() { for (var i, n = 0, e = window[t].length; e > n; n++) i = window[t][n], window[d][i].dispose(), window[d][i] = null }, w = n.extend({}, e.prototype); return w._addEventListener = w.addEventListener, w.addEventListener = function() { var i = Array.prototype.slice.call(arguments); this._addEventListener.apply(this, i), this._guid || (this._guid = o(), window[d][this._guid] = this, window[t].push(this._guid)) }, w.bindEvents = function(i, n) { var e, t; if (n) for (e in n) n.hasOwnProperty(e) && (t = n[e], this[t] && i.addEventListener(e, this[t])) }, n(window).unload(r), window[d] = {}, window[t] = [], w }); define("common:www/page/utils/utils.js", function(e, t, n) { var o = Object.prototype.toString, c = { encodeJsonForQuery: function(e) { var t = e instanceof Array ? [] : {}, n = /^(?:string|boolean|number)/i; for (var r in e) e.hasOwnProperty(r) && n.test(typeof e[r]) && (t[r] = encodeURIComponent(decodeURIComponent(e[r]))); return t }, decodeJsonForQuery: function(e) { var t = e instanceof Array ? [] : {}; for (var n in e) e.hasOwnProperty(n) && (t[n] = decodeURIComponent(e[n])); return t }, jsonToQuery: function(e) { var t = []; e = e || {}; var n = /^(?:string|boolean|number)/i; for (var r in e) e.hasOwnProperty(r) && n.test(typeof e[r]) && t.push(r + "=" + e[r]); return t.join("&") }, queryToJson: function(e) { for (var t, n, r, o, c = e.substr(e.lastIndexOf("?") + 1), i = c.split("&"), u = i.length, l = {}, a = 0; u > a; a++) i[a] && (o = i[a].split("="), t = o[0], n = o[1], r = l[t], "undefined" == typeof r ? l[t] = n : this.isArray(r) ? r.push(n) : l[t] = [r, n]); return l }, getQueryValue: function(e, t) { t = t || window.location.href; var n = new RegExp("(^|&|\\?|#)" + String(e).replace(new RegExp("([.*+?^=!:${}()|[\\]/\\\\])", "g"), "\\$1") + "=([^]*)(&|$|#)", ""), r = t.match(n); return r ? r[2] : null }, format: function(e, t) { e = String(e); var n = Array.prototype.slice.call(arguments, 1), r = Object.prototype.toString; return n.length ? (n = 1 == n.length ? null !== t && /\[object Array\]|\[object Object\]/.test(r.call(t)) ? t : n : n, e.replace(/#\{(.+?)\}/g, function(e, t) { var o = n[t]; return "[object Function]" == r.call(o) && (o = o(t)), "undefined" == typeof o ? "" : o })) : e }, throttle: function(e, t) { var n = null; return function() { var r = this, o = arguments; clearTimeout(n), n = setTimeout(function() { e.apply(r, o) }, t) } }, isArray: function(e) { return "[object Array]" === o.call(e) } }; c.getByteLength = function(e) { return String(e).replace(/[^\x00-\xff]/g, "ci").length }, c.encodeURL = function(e) { return String(e).replace(//g, ">").replace(/"/g, """).replace(/'/g, "'") }, c.encodeHTML = function(e) { return String(e).replace(/&/g, "&").replace(//g, ">").replace(/"/g, """).replace(/'/g, "'") }, c.buffer = function(e, t, n) { function r() { r.stop(), o = c.delay(e, t, n || this, arguments) } if (t = t || 150, -1 === t) return function() { e.apply(n || this, arguments) }; var o = null; return r.stop = function() { o && (o.cancel(), o = 0) }, r }, c.delay = function(e, t, n, o) { t = t || 0; var c = function() { e.apply(n, o || []) }; return r = setTimeout(c, t), { cancel: function() { clearTimeout(r) } } }, c.getCookie = function(e) { var t = new RegExp("(^| )" + e + "=([^;]*)(;|$)"), n = t.exec(document.cookie); return n ? n[2] || null : void 0 }, c.setCookie = function(e, t, n, r, o, c) { var i = new Date; i.setTime(i.getTime()), n && (n = 1e3 * n * 60 * 60 * 24); var u = new Date(i.getTime() + n); document.cookie = e + "=" + escape(String(encodeURIComponent(t))) + (n ? ";expires=" + u.toGMTString() : "") + (r ? ";path=" + r : "") + (o ? ";domain=" + o : "") + (c ? ";secure" : "") }, c.scroller = e("common:www/page/utils/scroller.js"), c.pageResizer = e("common:www/page/utils/pageresizer.js"), c.UI = { pageHeight: function() { var e = document; return Math.max(e.body.scrollHeight, e.documentElement.scrollHeight) }, pageWidth: function() { var e = document; return Math.max(e.body.scrollWidth, e.documentElement.scrollWidth) }, clientWidth: function() { var e = document, t = "BackCompat" == e.compatMode ? e.body : e.documentElement; return t.clientWidth }, clientHeight: function() { var e = document, t = "BackCompat" == e.compatMode ? e.body : e.documentElement; return t.clientHeight }, windowHeight: function() { var e = document.documentElement; return self.innerHeight || e && e.clientHeight || document.body.clientHeight }, windowWidth: function() { var e = document.documentElement; return self.innerWidth || e && e.clientWidth || document.body.clientWidth }, screenWidth: function() { return window.screen.width }, screenHeight: function() { return window.screen.height }, scrollY: function(e) { var t = document.documentElement; if (e) { var n = e.parentNode, r = e.scrollTop || 0; return e == t && (r = UI.scrollY()), n ? r + UI.scrollY(n) : r } return self.pageYOffset || t && t.scrollTop || document.body.scrollTop } }, n.exports = c }); define("common:www/page/arch/EventDispatcher/EventDispatcher.js", function() { var t = function() { this.__listeners = {} }; t.prototype = { dispatchEvent: function(t, e) { e = e || {}, e.type || (e.type = t), e.target || (e.target = this), this.__listeners || (this.__listeners = {}); var n, i = this.__listeners[t], s = []; if (i) { for (var r = 0, h = i.length; h > r; r++) n = i[r], n ? (s = n.args.slice(0), s.unshift(e), n.fn.apply(n.owner, s)) : (i.splice(r--, 1), h--); return !0 } return !1 }, addEventListeners: function(t, e, n) { if ("object" == typeof t) for (var i in t) "function" == typeof t[i] && this.addEventListener(i, t[i], e, n); return this }, addEventListener: function(t, e, n, i) { return n = n || this, i = i || [], this.__listeners || (this.__listeners = {}), this.__listeners[t] instanceof Array || (this.__listeners[t] = []), this.__listeners[t].push({ fn: e, owner: n, args: i }), this }, removeEventListener: function(t, e) { var n, i = this.__listeners[t] || []; if (!i || "function" != typeof e) return this.__listeners[t] = [], this; for (var s = 0; s < i.length; s++) n = i[s], n && n.fn === e && (i[s] = null); return this }, removeEventListeners: function(t) { if (t && "object" == typeof t) for (var e in t) this.removeEventListener(e, t[e]); else this.__listeners = {} }, dispose: function() { var t; this.dispatchEvent("disposing"); for (t in this) delete this[t] || (this.name = null) } }; var e = new t; return t.eventCenter = e, t }); define("common:www/page/model/model.js", function(e, o, t) { var n = {}; t.exports = { get: function(e) { return e = e.toLowerCase(), !n[e], n[e] }, set: function(e, o) { e = e.toLowerCase(), n[e] || (n[e] = o) } } }); define("common:www/page/databind/databind.js", function(t, n, e) { function a(t) { for (var n, e, a, i = 0, r = []; n = t[i++];) n = n.split(":"), e = n[0], a = n[1], a && e && r.push({ type: a, name: e }); return r.length ? r : null } function i(t, n, e) { var i, r, d, o, u, l, c = 0; for (i = this.$el[0] == n ? this.$el : s(n), r = i.attr("data-bind"), d = a(r.split(";")); o = d[c++];) u = o.type, l = o.name, p[u] && p[u].bind(this, l, i, this.$el, e && e[l]) } function r(t, n) { return function() { var e = Array.prototype.slice.call(arguments); e.push(n), i.apply(t, e) } } function d(t, n) { var e, a, i, d; return e = s(t), i = s.extend({ $el: e, __prop: {}, __preProp: {} }, c), a = e.find("[data-bind]"), d = r(i, n), a.each(d), e.attr("data-bind") && d(0, e[0]), i } function o(t) { s.extend(p, t) } var s = t("jquery"), u = t("common:www/page/events/events.js"), l = "databound" + (~new Date).toString(16).substr(0, 5), c = s.extend({ set: function(t, n, e) { var a, i, r; if (n != this.__prop[t]) { if ("object" == typeof n && "[object Array]" !== Object.prototype.toString.call(n)) { i = this.__prop[t], r = !1; for (a in n) if (n.hasOwnProperty(a) && (!i || !i[a] || n[a] != i[a])) { r = !0; break } if (!r) return } this.__preProp[t] = this.__prop[t], this.__prop[t] = n, e || this.dispatchEvent("set:" + t, { data: n, fromEle: e }) } }, get: function(t) { return this.__prop[t] }, appendTo: function(t) { this.$el.appendTo(t) } }, u), p = { style: { handler: function(t) { return function(n) { t.css(n.data) } }, bind: function(t, n, e, a, i) { var r = this.handler(e); i && (r.call(t, { data: i }), t.__prop[n] = i), t.addEventListener("set:" + n, r) } }, src: { handler: function(t) { return function(n) { t[0].src = n.data } }, bind: function(t, n, e, a, i) { var r = this.handler(e); i && (r.call(t, { data: i }), t.__prop[n] = i), t.addEventListener("set:" + n, r) } }, dualTxt: { getHandler: function(t) { return function(n) { n.fromEle || t.val(n.data) } }, setHandler: function(t, n) { function e() { t.set(n, t.__inputVal), t.__inputVal = "", t.__keyupTimer = null } return function(a) { t.__keyupTimer ? clearTimeout(t.__keyupTimer) : t.dispatchEvent("typing:" + n), t.__keyupTimer = setTimeout(e, 200), t.__inputVal = a.target.value } }, bind: function(t, n, e, a, i) { var r = this.getHandler(e); t.addEventListener("set:" + n, r), e.bind("keyup", this.setHandler(t, n)), i && (r.call(t, { data: i }), t.__prop[n] = i) } }, txt: { handler: function(t) { return function(n) { t.text(n.data) } }, bind: function(t, n, e, a, i) { var r = this.handler(e); t.addEventListener("set:" + n, r), i && (r.call(t, { data: i }), t.__prop[n] = i) } }, cls: { handler: function(t, n) { return function(e) { this.__preProp[t] && n.removeClass(this.__preProp[t]), n.addClass(e.data) } }, bind: function(t, n, e, a, i) { var r = this.handler(n, e); t.addEventListener("set:" + n, r), i && (r.call(t, { data: i }), t.__prop[n] = i) } }, click: { handler: function(t, n) { return function(e) { t.dispatchEvent("click:" + n, e) } }, bind: function(t, n, e, a) { var i = this.handler(t, n); e.addClass(l + "-" + n), e == a ? a.bind("click", i) : a.delegate("." + l + "-" + n, "click", i) } }, mouseenter: { handler: function(t, n) { return function(e) { t.dispatchEvent("mouseenter:" + n, e) } }, bind: function(t, n, e, a) { var i = this.handler(t, n); e.addClass(l + "-" + n), e == a ? a.bind("mouseenter", i) : a.delegate("." + l + "-" + n, "mouseenter", i) } }, mouseleave: { handler: function(t, n) { return function(e) { t.dispatchEvent("mouseleave:" + n, e) } }, bind: function(t, n, e, a) { var i = this.handler(t, n); e.addClass(l + "-" + n), e == a ? a.bind("mouseleave", i) : a.delegate("." + l + "-" + n, "mouseleave", i) } }, link: { handler: function(t) { return function(n) { t[0].href = n.data } }, bind: function(t, n, e, a, i) { var r = this.handler(e); i && (r.call(t, { data: i }), t.__prop[n] = i), t.addEventListener("set:" + n, r) } }, attr: { handler: function(t) { return function(n) { t.attr(n.data) } }, bind: function(t, n, e, a, i) { var r = this.handler(e); i && (r.call(t, { data: i }), t.__prop[n] = i), t.addEventListener("set:" + n, r) } } }; e.exports = { bind: d, mixinBoundMap: o } }); define("common:www/page/slider/slider.js", function(t, i, s) { function n(t, i, s, n) { var e = this; this.$el = t, this.$cnt, this.$slideCnt, this.duration = n.duration, this.isCycle = n.isCycle, this.curIdx = 0, this.slideWidth = this.$el.width(), this.slidesNum = i.length, this.autoAnimateInterval = n.autoAnimateInterval || 5e3, this.autoTurning = s, this._leftBtnClickHandler = function(t) { t.preventDefault(), e.turnLeft() }, this._rightBtnClickHandler = function(t) { t.preventDefault(), e.turnRight() }, this._animationFinish = function() { e.isAnimating = !1 }, this._autoTurning = function() { e._timer = null, e.turnRight(), e.startAutoAnimation() }, this._mouseEnterHandler = function() { e.stopAutoAnimation() }, this._mouseLeaveHandler = function() { e.startAutoAnimation() }, this._dotClikeHandler = function (t) { t.preventDefault(), e.dotMoveslide(this); }, this.realIdx = 0, i.addClass("slide-show-ctn"), this._buildContainer(i), i = null, s && this.startAutoAnimation() } var e = t("jquery"), h = t("common:www/page/events/events.js"); e.extend(n.prototype, h, { _buildContainer: function(t) { this.$el.append('