var SI_Cont_width = $("#SI_Cont").width(); (function (exports) { var Util = { byId: function (id) { return document.getElementById(id); }, byAttr: function (node, attname, attvalue) { if (typeof node == "string") { node = Util.byId(node); } var nodes = []; attvalue = attvalue || ""; var getAttr = function (node) { return node.getAttribute(attname); }; for (var i = 0, l = node.childNodes.length; i < l; i++) { if (node.childNodes[i].nodeType == 1) { var fit = false; if (attvalue) { fit = (getAttr(node.childNodes[i]) == attvalue); } else { fit = (getAttr(node.childNodes[i]) != ""); } if (fit) { nodes.push(node.childNodes[i]); } if (node.childNodes[i].childNodes.length > 0) { nodes = nodes.concat(arguments.callee.call(null, node.childNodes[i], attname, attvalue)); } } } return nodes; }, hasClass: function (ele, cls) { if (!ele) { return false; } return ele.className.match(new RegExp("(\\s|^)" + cls + "(\\s|$)")); }, addClass: function (ele, cls) { if (!this.hasClass(ele, cls)) { ele.className = ele.className.replace(/(^\s*)|(\s*$)/g, "") + " " + cls; } }, removeClass: function (ele, cls) { if (this.hasClass(ele, cls)) { var reg = new RegExp("(\\s|^)" + cls + "(\\s|$)"); ele.className = ele.className.replace(reg, " "); } }, toggleClass: function (ele, cls) { if (this.hasClass(ele, cls)) { this.removeClass(ele, cls); } else { this.addClass(ele, cls); } }, preventDefault: function (e) { if (e.preventDefault) { e.preventDefault(); } else { e.returnValue = false; } }, stopPropagation: function (e) { var e = e || window.event; if (window.event) { e.cancelBubble = true; } else { e.stopPropagation(); } }, contains: function (a, b) { try { return a.contains ? a != b && a.contains(b) : !!(a.compareDocumentPosition(b) & 16); } catch (e) { } }, addEvent: (function () { var _fun = function (e, fn) { var a = e.currentTarget, b = e.relatedTarget; if (!Util.contains(a, b) && a != b) { fn.call(e.currentTarget, e); } }; var _eventCompat = function (event) { var type = event.type; if (type == "DOMMouseScroll" || type == "mousewheel") { event.delta = (event.wheelDelta) ? event.wheelDelta / 120 : -(event.detail || 0) / 3; } if (event.srcElement && !event.target) { event.target = event.srcElement; } if (!event.preventDefault && event.returnValue !== undefined) { event.preventDefault = function () { event.returnValue = false; }; } return event; }; if (window.addEventListener) { return function (el, type, fn, capture) { if (el == null) { return; } if (type == "mouseenter") { el.addEventListener("mouseover", function (e) { _fun(e, fn); }, false); } else { if (type == "mouseleave") { el.addEventListener("mouseout", function (e) { _fun(e, fn); }, false); } else { if (type === "mousewheel" && document.mozHidden !== undefined) { type = "DOMMouseScroll"; } el.addEventListener(type, function (e) { fn.call(this, _eventCompat(e)); }, capture || false); } } }; } else { if (window.attachEvent) { return function (el, type, fn, capture) { if (el == null) { return; } el.attachEvent("on" + type, function (event) { event = event || window.event; fn.call(el, _eventCompat(event)); }); }; } } return function () {}; })(), removeEvent: function (o, s, fn) { if (o.addEventListener) { o.removeEventListener(s, fn, false); } else { if (o.attachEvent) { o.detachEvent("on" + s, fn); } } fn[s] = null; }, fixEvent: function (e) { e = window.event || e; e.target = e.target || e.srcElement; if (e.pageX == null && e.clientX != null) { var doc = document.documentElement, body = document.body; e.pageX = e.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0); e.pageY = e.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0); } else { e.pageX = null; e.pageY = null; } e.layerX = e.layerX || e.offsetX; e.layerY = e.layerY || e.offsetY; return e; }, getPosition: function (ele) { var positionX = 0; var positionY = 0; while (ele != null && ele != document.body) { positionX += ele.offsetLeft; positionY += ele.offsetTop; ele = ele.offsetParent; } return [positionX, positionY]; }, winSize: function (_target) { var w, h; if (_target) { target = _target.document; } else { target = document; } if (target.compatMode === "CSS1Compat") { w = target.documentElement.clientWidth; h = target.documentElement.clientHeight; } else { if (self.innerHeight) { if (_target) { target = _target.self; } else { target = self; } w = target.innerWidth; h = target.innerHeight; } else { if (target.documentElement && target.documentElement.clientHeight) { w = target.documentElement.clientWidth; h = target.documentElement.clientHeight; } else { if (target.body) { w = target.body.clientWidth; h = target.body.clientHeight; } } } } return { width: w, height: h }; }, delegatedEvent: (function () { var checkContains = function (list, el) { for (var i = 0, len = list.length; i < len; i += 1) { if (Util.contains(list[i], el)) { return true; } } return false; }; var isEmptyObj = function (obj) { for (var key in obj) { return false; } return true; }; return function (actEl, expEls, aType) { if (!expEls) { expEls = []; } if (Util.isArray(expEls)) { expEls = [expEls]; } var evtList = {}; var aType = aType || "action-type"; var bindEvent = function (e) { var evt = e || window.event; var el = evt.target || evt.srcElement; var type = e.type; if (checkContains(expEls, el)) { return false; } else { if (!Util.contains(actEl, el)) { return false; } else { var actionType = null; var checkBuble = function () { if (evtList[type] && evtList[type][actionType]) { return evtList[type][actionType]({ evt: evt, el: el, e: e, data: Util.queryToJson(el.getAttribute("action-data") || "") }); } else { return true; } }; while (el && el !== actEl) { if (!el.getAttribute) { break; } actionType = el.getAttribute(aType); if (checkBuble() === false) { break; } el = el.parentNode; } } } }; var that = {}; that.add = function (funcName, evtType, process) { if (!evtList[evtType]) { evtList[evtType] = {}; Util.addEvent(actEl, evtType, bindEvent); } var ns = evtList[evtType]; ns[funcName] = process; }; that.remove = function (funcName, evtType) { if (evtList[evtType]) { delete evtList[evtType][funcName]; if (isEmptyObj(evtList[evtType])) { delete evtList[evtType]; Util.removeEvent(actEl, evtType, bindEvent); } } }; that.pushExcept = function (el) { expEls.push(el); }; that.removeExcept = function (el) { if (!el) { expEls = []; } else { for (var i = 0, len = expEls.length; i < len; i += 1) { if (expEls[i] === el) { expEls.splice(i, 1); } } } }; that.clearExcept = function (el) { expEls = []; }; that.destroy = function () { for (k in evtList) { for (l in evtList[k]) { delete evtList[k][l]; } delete evtList[k]; Util.removeEvent(actEl, bindEvent, k); } }; return that; }; })(), builder: function (wrap, type) { var list, nodes, ids; wrap = (function () { if (typeof wrap == "string") { return Util.byId(wrap); } return wrap; })(); nodes = this.byAttr(wrap, type); list = {}; ids = {}; for (var i = 0, len = nodes.length; i < len; i++) { var j = nodes[i].getAttribute(type); if (!j) { continue; } list[j] || (list[j] = []); list[j].push(nodes[i]); ids[j] || (ids[j] = nodes[i]); } return { box: wrap, list: list, ids: ids }; }, strLeft: function (s, n) { var ELLIPSIS = "..."; var s2 = s.slice(0, n), i = s2.replace(/[^\x00-\xff]/g, "**").length, j = s.length, k = s2.length; if (i < n) { return s2; } else { if (i == n) { if (n == j || k == j) { return s2; } else { return s.slice(0, n - 2) + ELLIPSIS; } } } i -= s2.length; switch (i) { case 0: return s2; case n: var s4; if (n == j) { s4 = s.slice(0, (n >> 1) - 1); return s4 + ELLIPSIS; } else { s4 = s.slice(0, n >> 1); return s4; } default: var k = n - i, s3 = s.slice(k, n), j = s3.replace(/[\x00-\xff]/g, "").length; return j ? s.slice(0, k) + arguments.callee(s3, j) : s.slice(0, k); } }, strLeft2: (function () { var byteLen = function (str) { if (typeof str == "undefined") { return 0; } var aMatch = str.match(/[^\x00-\x80]/g); return (str.length + (!aMatch ? 0 : aMatch.length)); }; return function (str, len) { var s = str.replace(/\*/g, " ").replace(/[^\x00-\xff]/g, "**"); str = str.slice(0, s.slice(0, len).replace(/\*\*/g, " ").replace(/\*/g, "").length); if (byteLen(str) > len) { str = str.slice(0, str.length - 1); } return str; }; })(), numSplit: function (num) { num = num + ""; var re = /(-?\d+)(\d{3})/; while (re.test(num)) { num = num.replace(re, "$1,$2"); } return num; }, isArray: function (o) { return Object.prototype.toString.call(o) === "[object Array]"; }, getGuid: function () { return Math.abs((new Date()).getTime()) + "_" + Math.round(Math.random() * 100000000); }, extend: function (target, source, deep) { target = target || {}; var sType = typeof source, i = 1, options; if (sType === "undefined" || sType === "boolean") { deep = sType === "boolean" ? source : false; source = target; target = this; } if (typeof source !== "object" && Object.prototype.toString.call(source) !== "[object Function]") { source = {}; } while (i <= 2) { options = i === 1 ? target : source; if (options !== null) { for (var name in options) { var src = target[name], copy = options[name]; if (target === copy) { continue; } if (deep && copy && typeof copy === "object" && !copy.nodeType) { target[name] = this.extend(src || (copy.length !== null ? [] : {}), copy, deep); } else { if (copy !== undefined) { target[name] = copy; } } } } i++; } return target; }, setCSS: (function () { var doc = document; var head = doc.getElementsByTagName("head")[0]; return function (s, id) { var dom = doc.getElementById(id); if (dom) { dom.parentNode.removeChild(dom); } dom = doc.createElement("style"); dom.id = id; dom.type = "text/css"; dom.styleSheet ? (dom.styleSheet.cssText = s) : dom.appendChild(doc.createTextNode(s)); head.appendChild(dom); return dom; }; })(), getStyle: function (elem, name) { if (elem.style[name]) { return elem.style[name]; } else { if (elem.currentStyle) { return elem.currentStyle[name]; } else { if (document.defaultView && document.defaultView.getComputedStyle) { name = name.replace(/([A-Z])/g, "-$1"); name = name.toLowerCase(); var s = document.defaultView.getComputedStyle(elem, ""); return s && s.getPropertyValue(name); } else { return null; } } } }, setStyle: function (elem, prop) { if (!elem) { return; } for (var i in prop) { elem.style[i] = prop[i]; } }, cookie: (function () { var co = {}; co.getCookie = function (name) { name = name.replace(/([\.\[\]\$])/g, "\\$1"); var rep = new RegExp(name + "=([^;]*)?;", "i"); var co = document.cookie + ";"; var res = co.match(rep); if (res) { return unescape(res[1]) || ""; } else { return ""; } }; co.setCookie = function (name, value, expire, path, domain, secure) { var cstr = []; cstr.push(name + "=" + escape(value)); if (expire) { var dd = new Date(); var expires = dd.getTime() + expire * 3600000; dd.setTime(expires); cstr.push("expires=" + dd.toGMTString()); } if (path) { cstr.push("path=" + path); } if (domain) { cstr.push("domain=" + domain); } if (secure) { cstr.push(secure); } document.cookie = cstr.join(";"); }; co.deleteCookie = function (name) { document.cookie = name + "=;expires=Fri, 31 Dec 1999 23:59:59 GMT;"; }; return co; })(), jsonp: function (url, cb) { var head = document.getElementsByTagName("head")[0]; var ojs = Util.byId(url); ojs && head.removeChild(ojs); if (url.indexOf("&") == -1) { url += "?"; } else { url += "&"; } url = url + "_t" + Util.getGuid(); if (typeof cb == "function") { fun = "jsonp_" + Util.getGuid(); eval(fun + "=function(res){cb(res)}"); } url = url + "&callback=" + fun; var js = document.createElement("script"); js.src = url; js.id = url; js.type = "text/javascript"; js.language = "javascript"; head.appendChild(js); }, jsLoad: function (url, cb) { var head = document.getElementsByTagName("head")[0]; var js = document.createElement("script"), isLoaded = false; js.onload = js.onreadystatechange = function () { if (!isLoaded && (!this.readyState || this.readyState == "loaded" || this.readyState == "complete")) { isLoaded = true; js.onload = js.onreadystatechange = null; typeof cb == "function" && cb(); } }; js.src = url; try { head.appendChild(js); } catch (e) { } }, log: (function () { var trace = location.href.indexOf("log=1") != -1; var fiter = function (methods) { for (var i = 0, len = methods.length; i < len; i++) { var method = methods[i]; if (typeof method == "undefined") { method = function () {}; } } }; if (typeof console == "undefined") { console = {}; } fiter([console.log, console.time, console.timeEnd]); return function () { if (!trace) { console.time = console.timeEnd = function () {}; return; } var slice = Array.prototype.slice; var args = slice.call(arguments, 0); args.unshift("* SLIDE >>"); try { console.log.apply(console, args); } catch (e) { console.log(args); } }; })(), uaTrack: function (key, val) { if (typeof _S_uaTrack == "function") { try { _S_uaTrack(key, val); } catch (e) { } } }, throttle: function (method, context, interval) { clearTimeout(method.__tId__); method.__tId__ = setTimeout(function () { method.call(context); }, interval || 100); }, timeoutHandle: (function () { var events = []; var handle = { success: function (id) { var eve = events[id]; if (!eve) { return; } eve.isSuccess = true; clearTimeout(eve.timer); }, timeout: function (id, fn) { var eve = events[id]; if (!eve) { return; } eve.timer = setTimeout(function () { if (eve.isSuccess) { return; } Util.log(id + " " + eve.time + " time out"); if (typeof fn == "function") { fn.call(this); } }, eve.time); } }; return function (id, fn, time) { if (events[id]) { throw new Error(id + "已经被占用"); return; } events[id] = {}; events[id].time = time || 5000; events[id].isSuccess = false; if (typeof fn == "function") { fn.call(this, handle); } }; })(), queryToJson: function (query, isDecode) { var qList = query.split("&"); var json = {}; for (var i = 0, len = qList.length; i < len; i++) { if (qList[i]) { hash = qList[i].split("="); key = hash[0]; val = hash[1]; if (hash.length < 2) { val = ""; } if (!json[key]) { json[key] = val; } } } return json; }, animate: (function () { var animate = function (elem, style, duration, callback, isStyle) { this.elem = elem || this; this.style = style || {}; this.duration = duration || 400; this.callback = callback || function () {}; this.isStyle = isStyle ? true : false; this.init(); }; animate.prototype = { init: function () { this.fx(); }, ontween: function (pos) { var obj, val, from, to, name, unit, css = this.style, direction = 1; for (var i = 0, len = css.length; i < len; i++) { obj = css[i]; from = obj[0]; to = obj[1]; name = obj[2]; unit = obj[3]; if (to - from < 0) { direction = -1; } val = from + (to - from) * pos; if (direction > 0) { val = Math.min(val, to); } else { val = Math.max(val, to); } if (name == "opacity") { val = val.toString(); val = val.substring(0, val.charAt(".") + 3); val = val - 0; this.elem.style.filter = "alpha(opacity=" + 100 * val + ")"; this.elem.style.opacity = val; } else { if (this.isStyle) { this.elem.style[name] = val + unit; } else { this.elem[name] = val; } } } }, onend: function (pos) { this.ontween(pos); this.callback.call(this.elem); }, fx: function () { var pos, runTime, startTime = +new Date(), _this = this, timer = setInterval(function () { runTime = +new Date() - startTime; pos = runTime / _this.duration; if (pos >= 1) { clearInterval(timer); _this.onend(pos); } else { _this.ontween(pos); } }, 13); } }; return animate; })() }; var Clz = function (parent) { var propertyName = "___ytreporp___"; var klass = function () { this.init.apply(this, arguments); }; if (parent) { var subclass = function () {}; subclass.prototype = parent.prototype; klass.prototype = new subclass; } klass.prototype.init = function () {}; klass.prototype.set = function (k, v) { if (!this[propertyName]) { this[propertyName] = {}; } var i = 0, un = this[propertyName], ns = k.split("."), len = ns.length, upp = len - 1, key; while (i < len) { key = ns[i]; if (i == upp) { un[key] = v; } if (un[key] === undefined) { un[key] = {}; } un = un[key]; i++; } }; klass.prototype.get = function (k) { if (!this[propertyName]) { this[propertyName] = {}; } var i = 0, un = this[propertyName], ns = k.split("."), len = ns.length, upp = len - 1, key; while (i < len) { key = ns[i]; if (i == upp) { return un[key]; } if (un[key] === undefined) { un[key] = {}; } un = un[key]; i++; } }; klass.fn = klass.prototype; klass.fn.parent = klass; klass._super = klass.__proto__; klass.extend = function (obj) { var extended = obj.extended; for (var i in obj) { klass[i] = obj[i]; } if (extended) { extended(klass); } }; klass.include = function (obj) { var included = obj.included; for (var i in obj) { klass.fn[i] = obj[i]; } if (included) { included(klass); } }; return klass; }; Util.Clz = Clz; var Slide = {}; Slide.ua = (function () { var Detect = function () { var ua = navigator.userAgent.toLowerCase(); this.isIE = /msie/.test(ua); this.isOPERA = /opera/.test(ua); this.isMOZ = /gecko/.test(ua); this.isIE5 = /msie 5 /.test(ua); this.isIE55 = /msie 5.5/.test(ua); this.isIE6 = /msie 6/.test(ua); this.isIE7 = /msie 7/.test(ua); this.isSAFARI = /safari/.test(ua); this.iswinXP = /windows nt 5.1/.test(ua); this.iswinVista = /windows nt 6.0/.test(ua); this.isFF = /firefox/.test(ua); this.isIOS = /\((iPhone|iPad|iPod)/i.test(ua); }; return new Detect(); })(); Slide.register = function (namespace, method) { var i = 0, un = Slide, ns = namespace.split("."), len = ns.length, upp = len - 1, key; while (i < len) { key = ns[i]; if (i == upp) { if (un[key] !== undefined) { throw ns + ":: has registered"; } un[key] = method; } if (un[key] === undefined) { un[key] = {}; } un = un[key]; i++; } }; Slide.register("util", Util); Slide.register("Clz", Clz); var EXPORTS_NAME = "SinaSlide"; var UGLIFY_NAME = "___" + EXPORTS_NAME + "___"; exports[UGLIFY_NAME] = Slide; if (exports[EXPORTS_NAME]) { throw '个性化推荐全局变量名"' + EXPORTS_NAME + '"已经被占用,可使用' + UGLIFY_NAME; } else { exports[EXPORTS_NAME] = Slide; } })(window); (function (b) { var c = "___SinaSlide___"; var d = b[c]; var a = (function () { var h = [], g = null, f = function () { var j = 0; for (; j < h.length; j++) { h[j].end ? h.splice(j--, 1) : h[j](); } !h.length && e(); }, e = function () { clearInterval(g); g = null; }; return function (j, q, s, p) { var r, m, t, o, i; var n = new Image(); n.src = j; if (n.complete) { q.call(n); s && s.call(n); return; } m = n.width; t = n.height; n.onerror = function () { p && p.call(n); r.end = true; n = n.onload = n.onerror = null; }; r = function () { if (!n) { return; } o = n.width; i = n.height; if (o !== m || i !== t || o * i > 1024) { q.call(n); r.end = true; } }; r(); n.onload = function () { !r.end && r(); s && s.call(n); n = n.onload = n.onerror = null; }; if (!r.end) { h.push(r); if (g === null) { g = setInterval(f, 40); } } }; })(); d.register("imgReady", a); })(window); (function (a) { var b = "___SinaSlide___"; var c = a[b]; var g = c.util; var d = g.addClass; var f = g.removeClass; var e = {}; var h = typeof (a.ontouchstart) === "undefined" ? "click" : "touchstart"; //e.anchorGo = function (n) { // var j = g.byId(n); // if (!j) { // return // } // var m = g.getPosition(j); // var i = m[1] || 0; // document.documentElement.scrollTop = i; // document.body.scrollTop = i //}; })(window); (function (a) { var b = "___SinaSlide___"; var c = a[b]; var d = c.util; var e = new c.Clz; e.include({ init: function (g) { var f = this; f.setStat(); f.setOpt(g); f.getData(); }, setOpt: function (f) { this.set("opt", d.extend({ api: "", dataType: "jsonp", data: null, loadComplete: function () {}, time: 3000, error: function (g) {} }, f, true)); }, setStat: function () { var f = this; f._data = null; }, getData: function () { var g = this; var i = g.get("opt"); var h = i.api; d.log("请求地址:" + h); var f = "loader_" + d.getGuid(); d.timeoutHandle(f, function (m) { var j = function (n) { m.success(f); g._data = n; g._loadComplete(n); i.loadComplete(n); }; m.timeout(f, function () { i.error({ type: "timeout", msg: f + " " + i.time + " timeout" }); }); if (i.data) { j(i.data); } else { if (i.dataType == "js") { d.jsLoad(h, j); } else { d.jsonp(h, j); return false; } } }, i.time); }, _loadComplete: function (f) {} }); c.register("Loader", e); })(window); (function (a) { var b = "___SinaSlide___"; var d = a[b]; var e = d.util; var c = new d.Clz; c.include({ init: function (g) { var f = this; f.setOpt(g); f.render(f.wrap, f.opt.data); }, setOpt: function (f) { this.set("opt", e.extend({ wrap: null, data: null, complete: function () {}, error: function (g) {} }, f, true)); }, render: function (f, g) { this._renderComplete(); }, _renderComplete: function () {} }); d.register("Render", c); })(window); (function (a) { var b = "___SinaSlide___"; var d = a[b]; var f = d.util; var c = new d.Clz; var e = f.uaTrack; c.include({ init: function (h) { var g = this; g.setOpt(h); g.render(); }, setOpt: function (g) { this.set("opt", f.extend({ wrap: null, data: null, index: 0, status: "normal", direction: "v", pageWidth: 0, itemWidth: 0, mousemove: function (h) {}, complete: function () {}, error: function (h) {} }, g, true)); }, render: function () { var r = this; var h = r.get("opt"); var g = (function (s) { if (typeof s == "string") { return f.byId(s); } return s; })(h.wrap); var i = h.data; if (!g || !i) { return; } var o = i.images; var m = (function (t) { var v = []; for (var u = 0, s = t.length; u < s; u++) { var w = t[u]; var x = w.image_url; x = x.replace("_img", "_" + SLIDE_DATA.imgType); v .push( '
" + s.createtime + "