Guest User

Untitled

a guest
Apr 10th, 2015
437
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 214.63 KB | None | 0 0
  1. /******************************
  2. * BLOCKED-LIBS
  3. ******************************/
  4. // Underscore.js 1.3.1
  5. // (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
  6. // Underscore is freely distributable under the MIT license.
  7. // Portions of Underscore are inspired or borrowed from Prototype,
  8. // Oliver Steele's Functional, and John Resig's Micro-Templating.
  9. // For all details and documentation:
  10. // http://documentcloud.github.com/underscore
  11. function rhex(e) {
  12. str = "";
  13. for (j = 0; j <= 3; j++) str += hex_chr.charAt(e >> j * 8 + 4 & 15) + hex_chr.charAt(e >> j * 8 & 15);
  14. return str
  15. }
  16.  
  17. function str2blks_MD5(e) {
  18. nblk = (e.length + 8 >> 6) + 1, blks = new Array(nblk * 16);
  19. for (i = 0; i < nblk * 16; i++) blks[i] = 0;
  20. for (i = 0; i < e.length; i++) blks[i >> 2] |= e.charCodeAt(i) << i % 4 * 8;
  21. return blks[i >> 2] |= 128 << i % 4 * 8, blks[nblk * 16 - 2] = e.length * 8, blks
  22. }
  23.  
  24. function add(e, t) {
  25. var n = (e & 65535) + (t & 65535)
  26. , r = (e >> 16) + (t >> 16) + (n >> 16);
  27. return r << 16 | n & 65535
  28. }
  29.  
  30. function rol(e, t) {
  31. return e << t | e >>> 32 - t
  32. }
  33.  
  34. function cmn(e, t, n, r, i, s) {
  35. return add(rol(add(add(t, e), add(r, s)), i), n)
  36. }
  37.  
  38. function ff(e, t, n, r, i, s, o) {
  39. return cmn(t & n | ~t & r, e, t, i, s, o)
  40. }
  41.  
  42. function gg(e, t, n, r, i, s, o) {
  43. return cmn(t & r | n & ~r, e, t, i, s, o)
  44. }
  45.  
  46. function hh(e, t, n, r, i, s, o) {
  47. return cmn(t ^ n ^ r, e, t, i, s, o)
  48. }
  49.  
  50. function ii(e, t, n, r, i, s, o) {
  51. return cmn(n ^ (t | ~r), e, t, i, s, o)
  52. }
  53.  
  54. function calcMD5(e) {
  55. x = str2blks_MD5(e), a = 1732584193, b = -271733879, c = -1732584194, d = 271733878;
  56. for (i = 0; i < x.length; i += 16) olda = a, oldb = b, oldc = c, oldd = d, a = ff(a, b, c, d, x[i + 0], 7, -680876936), d = ff(d, a, b, c, x[i + 1], 12, -389564586), c = ff(c, d, a, b, x[i + 2], 17, 606105819), b = ff(b, c, d, a, x[i + 3], 22, -1044525330), a = ff(a, b, c, d, x[i + 4], 7, -176418897), d = ff(d, a, b, c, x[i + 5], 12, 1200080426), c = ff(c, d, a, b, x[i + 6], 17, -1473231341), b = ff(b, c, d, a, x[i + 7], 22, -45705983), a = ff(a, b, c, d, x[i + 8], 7, 1770035416), d = ff(d, a, b, c, x[i + 9], 12, -1958414417), c = ff(c, d, a, b, x[i + 10], 17, -42063), b = ff(b, c, d, a, x[i + 11], 22, -1990404162), a = ff(a, b, c, d, x[i + 12], 7, 1804603682), d = ff(d, a, b, c, x[i + 13], 12, -40341101), c = ff(c, d, a, b, x[i + 14], 17, -1502002290), b = ff(b, c, d, a, x[i + 15], 22, 1236535329), a = gg(a, b, c, d, x[i + 1], 5, -165796510), d = gg(d, a, b, c, x[i + 6], 9, -1069501632), c = gg(c, d, a, b, x[i + 11], 14, 643717713), b = gg(b, c, d, a, x[i + 0], 20, -373897302), a = gg(a, b, c, d, x[i + 5], 5, -701558691), d = gg(d, a, b, c, x[i + 10], 9, 38016083), c = gg(c, d, a, b, x[i + 15], 14, -660478335), b = gg(b, c, d, a, x[i + 4], 20, -405537848), a = gg(a, b, c, d, x[i + 9], 5, 568446438), d = gg(d, a, b, c, x[i + 14], 9, -1019803690), c = gg(c, d, a, b, x[i + 3], 14, -187363961), b = gg(b, c, d, a, x[i + 8], 20, 1163531501), a = gg(a, b, c, d, x[i + 13], 5, -1444681467), d = gg(d, a, b, c, x[i + 2], 9, -51403784), c = gg(c, d, a, b, x[i + 7], 14, 1735328473), b = gg(b, c, d, a, x[i + 12], 20, -1926607734), a = hh(a, b, c, d, x[i + 5], 4, -378558), d = hh(d, a, b, c, x[i + 8], 11, -2022574463), c = hh(c, d, a, b, x[i + 11], 16, 1839030562), b = hh(b, c, d, a, x[i + 14], 23, -35309556), a = hh(a, b, c, d, x[i + 1], 4, -1530992060), d = hh(d, a, b, c, x[i + 4], 11, 1272893353), c = hh(c, d, a, b, x[i + 7], 16, -155497632), b = hh(b, c, d, a, x[i + 10], 23, -1094730640), a = hh(a, b, c, d, x[i + 13], 4, 681279174), d = hh(d, a, b, c, x[i + 0], 11, -358537222), c = hh(c, d, a, b, x[i + 3], 16, -722521979), b = hh(b, c, d, a, x[i + 6], 23, 76029189), a = hh(a, b, c, d, x[i + 9], 4, -640364487), d = hh(d, a, b, c, x[i + 12], 11, -421815835), c = hh(c, d, a, b, x[i + 15], 16, 530742520), b = hh(b, c, d, a, x[i + 2], 23, -995338651), a = ii(a, b, c, d, x[i + 0], 6, -198630844), d = ii(d, a, b, c, x[i + 7], 10, 1126891415), c = ii(c, d, a, b, x[i + 14], 15, -1416354905), b = ii(b, c, d, a, x[i + 5], 21, -57434055), a = ii(a, b, c, d, x[i + 12], 6, 1700485571), d = ii(d, a, b, c, x[i + 3], 10, -1894986606), c = ii(c, d, a, b, x[i + 10], 15, -1051523), b = ii(b, c, d, a, x[i + 1], 21, -2054922799), a = ii(a, b, c, d, x[i + 8], 6, 1873313359), d = ii(d, a, b, c, x[i + 15], 10, -30611744), c = ii(c, d, a, b, x[i + 6], 15, -1560198380), b = ii(b, c, d, a, x[i + 13], 21, 1309151649), a = ii(a, b, c, d, x[i + 4], 6, -145523070), d = ii(d, a, b, c, x[i + 11], 10, -1120210379), c = ii(c, d, a, b, x[i + 2], 15, 718787259), b = ii(b, c, d, a, x[i + 9], 21, -343485551), a = add(a, olda), b = add(b, oldb), c = add(c, oldc), d = add(d, oldd);
  57. return rhex(a) + rhex(b) + rhex(c) + rhex(d)
  58. }(function() {
  59. function e(t, n, r) {
  60. if (t === n) return t !== 0 || 1 / t == 1 / n;
  61. if (t == null || n == null) return t === n;
  62. t._chain && (t = t._wrapped), n._chain && (n = n._wrapped);
  63. if (t.isEqual && E.isFunction(t.isEqual)) return t.isEqual(n);
  64. if (n.isEqual && E.isFunction(n.isEqual)) return n.isEqual(t);
  65. var i = a.call(t);
  66. if (i != a.call(n)) return !1;
  67. switch (i) {
  68. case "[object String]":
  69. return t == String(n);
  70. case "[object Number]":
  71. return t != +t ? n != +n : t == 0 ? 1 / t == 1 / n : t == +n;
  72. case "[object Date]":
  73. case "[object Boolean]":
  74. return +t == +n;
  75. case "[object RegExp]":
  76. return t.source == n.source && t.global == n.global && t.multiline == n.multiline && t.ignoreCase == n.ignoreCase
  77. }
  78. if (typeof t != "object" || typeof n != "object") return !1;
  79. for (var s = r.length; s--;)
  80. if (r[s] == t) return !0;
  81. r.push(t);
  82. var s = 0
  83. , o = !0;
  84. if (i == "[object Array]") {
  85. if (s = t.length, o = s == n.length)
  86. for (; s--;)
  87. if (!(o = s in t == s in n && e(t[s], n[s], r))) break
  88. } else {
  89. if ("constructor" in t != "constructor" in n || t.constructor != n.constructor) return !1;
  90. for (var u in t)
  91. if (E.has(t, u) && (s++, !(o = E.has(n, u) && e(t[u], n[u], r)))) break;
  92. if (o) {
  93. for (u in n)
  94. if (E.has(n, u) && !(s--)) break;
  95. o = !s
  96. }
  97. }
  98. return r.pop(), o
  99. }
  100. var t = this
  101. , n = t._
  102. , r = {}
  103. , i = Array.prototype
  104. , s = Object.prototype
  105. , o = i.slice
  106. , u = i.unshift
  107. , a = s.toString
  108. , f = s.hasOwnProperty
  109. , l = i.forEach
  110. , c = i.map
  111. , h = i.reduce
  112. , p = i.reduceRight
  113. , d = i.filter
  114. , v = i.every
  115. , m = i.some
  116. , g = i.indexOf
  117. , y = i.lastIndexOf
  118. , s = Array.isArray
  119. , b = Object.keys
  120. , w = Function.prototype.bind
  121. , E = function(e) {
  122. return new L(e)
  123. };
  124. typeof exports != "undefined" ? (typeof module != "undefined" && module.exports && (exports = module.exports = E), exports._ = E) : t._ = E, E.VERSION = "1.3.1";
  125. var S = E.each = E.forEach = function(e, t, n) {
  126. if (e != null)
  127. if (l && e.forEach === l) e.forEach(t, n);
  128. else if (e.length === +e.length) {
  129. for (var i = 0, s = e.length; i < s; i++)
  130. if (i in e && t.call(n, e[i], i, e) === r) break
  131. } else
  132. for (i in e)
  133. if (E.has(e, i) && t.call(n, e[i], i, e) === r) break
  134. };
  135. E.map = E.collect = function(e, t, n) {
  136. var r = [];
  137. return e == null ? r : c && e.map === c ? e.map(t, n) : (S(e, function(e, i, s) {
  138. r[r.length] = t.call(n, e, i, s)
  139. }), e.length === +e.length && (r.length = e.length), r)
  140. }, E.reduce = E.foldl = E.inject = function(e, t, n, r) {
  141. var i = arguments.length > 2;
  142. e == null && (e = []);
  143. if (h && e.reduce === h) return r && (t = E.bind(t, r)), i ? e.reduce(t, n) : e.reduce(t);
  144. S(e, function(e, s, o) {
  145. i ? n = t.call(r, n, e, s, o) : (n = e, i = !0)
  146. });
  147. if (!i) throw new TypeError("Reduce of empty array with no initial value");
  148. return n
  149. }, E.reduceRight = E.foldr = function(e, t, n, r) {
  150. var i = arguments.length > 2;
  151. e == null && (e = []);
  152. if (p && e.reduceRight === p) return r && (t = E.bind(t, r)), i ? e.reduceRight(t, n) : e.reduceRight(t);
  153. var s = E.toArray(e)
  154. .reverse();
  155. return r && !i && (t = E.bind(t, r)), i ? E.reduce(s, t, n, r) : E.reduce(s, t)
  156. }, E.find = E.detect = function(e, t, n) {
  157. var r;
  158. return x(e, function(e, i, s) {
  159. if (t.call(n, e, i, s)) return r = e, !0
  160. }), r
  161. }, E.filter = E.select = function(e, t, n) {
  162. var r = [];
  163. return e == null ? r : d && e.filter === d ? e.filter(t, n) : (S(e, function(e, i, s) {
  164. t.call(n, e, i, s) && (r[r.length] = e)
  165. }), r)
  166. }, E.reject = function(e, t, n) {
  167. var r = [];
  168. return e == null ? r : (S(e, function(e, i, s) {
  169. t.call(n, e, i, s) || (r[r.length] = e)
  170. }), r)
  171. }, E.every = E.all = function(e, t, n) {
  172. var i = !0;
  173. return e == null ? i : v && e.every === v ? e.every(t, n) : (S(e, function(e, s, o) {
  174. if (!(i = i && t.call(n, e, s, o))) return r
  175. }), i)
  176. };
  177. var x = E.some = E.any = function(e, t, n) {
  178. t || (t = E.identity);
  179. var i = !1;
  180. return e == null ? i : m && e.some === m ? e.some(t, n) : (S(e, function(e, s, o) {
  181. if (i || (i = t.call(n, e, s, o))) return r
  182. }), !!i)
  183. };
  184. E.include = E.contains = function(e, t) {
  185. var n = !1;
  186. return e == null ? n : g && e.indexOf === g ? e.indexOf(t) != -1 : n = x(e, function(e) {
  187. return e === t
  188. })
  189. }, E.invoke = function(e, t) {
  190. var n = o.call(arguments, 2);
  191. return E.map(e, function(e) {
  192. return (E.isFunction(t) ? t || e : e[t])
  193. .apply(e, n)
  194. })
  195. }, E.pluck = function(e, t) {
  196. return E.map(e, function(e) {
  197. return e[t]
  198. })
  199. }, E.max = function(e, t, n) {
  200. if (!t && E.isArray(e)) return Math.max.apply(Math, e);
  201. if (!t && E.isEmpty(e)) return -Infinity;
  202. var r = {
  203. computed: -Infinity
  204. };
  205. return S(e, function(e, i, s) {
  206. i = t ? t.call(n, e, i, s) : e, i >= r.computed && (r = {
  207. value: e
  208. , computed: i
  209. })
  210. }), r.value
  211. }, E.min = function(e, t, n) {
  212. if (!t && E.isArray(e)) return Math.min.apply(Math, e);
  213. if (!t && E.isEmpty(e)) return Infinity;
  214. var r = {
  215. computed: Infinity
  216. };
  217. return S(e, function(e, i, s) {
  218. i = t ? t.call(n, e, i, s) : e, i < r.computed && (r = {
  219. value: e
  220. , computed: i
  221. })
  222. }), r.value
  223. }, E.shuffle = function(e) {
  224. var t = []
  225. , n;
  226. return S(e, function(e, r) {
  227. r == 0 ? t[0] = e : (n = Math.floor(Math.random() * (r + 1)), t[r] = t[n], t[n] = e)
  228. }), t
  229. }, E.sortBy = function(e, t, n) {
  230. return E.pluck(E.map(e, function(e, r, i) {
  231. return {
  232. value: e
  233. , criteria: t.call(n, e, r, i)
  234. }
  235. })
  236. .sort(function(e, t) {
  237. var n = e.criteria
  238. , r = t.criteria;
  239. return n < r ? -1 : n > r ? 1 : 0
  240. }), "value")
  241. }, E.groupBy = function(e, t) {
  242. var n = {}
  243. , r = E.isFunction(t) ? t : function(e) {
  244. return e[t]
  245. };
  246. return S(e, function(e, t) {
  247. var i = r(e, t);
  248. (n[i] || (n[i] = []))
  249. .push(e)
  250. }), n
  251. }, E.sortedIndex = function(e, t, n) {
  252. n || (n = E.identity);
  253. for (var r = 0, i = e.length; r < i;) {
  254. var s = r + i >> 1;
  255. n(e[s]) < n(t) ? r = s + 1 : i = s
  256. }
  257. return r
  258. }, E.toArray = function(e) {
  259. return e ? e.toArray ? e.toArray() : E.isArray(e) ? o.call(e) : E.isArguments(e) ? o.call(e) : E.values(e) : []
  260. }, E.size = function(e) {
  261. return E.toArray(e)
  262. .length
  263. }, E.first = E.head = function(e, t, n) {
  264. return t != null && !n ? o.call(e, 0, t) : e[0]
  265. }, E.initial = function(e, t, n) {
  266. return o.call(e, 0, e.length - (t == null || n ? 1 : t))
  267. }, E.last = function(e, t, n) {
  268. return t != null && !n ? o.call(e, Math.max(e.length - t, 0)) : e[e.length - 1]
  269. }, E.rest = E.tail = function(e, t, n) {
  270. return o.call(e, t == null || n ? 1 : t)
  271. }, E.compact = function(e) {
  272. return E.filter(e, function(e) {
  273. return !!e
  274. })
  275. }, E.flatten = function(e, t) {
  276. return E.reduce(e, function(e, n) {
  277. return E.isArray(n) ? e.concat(t ? n : E.flatten(n)) : (e[e.length] = n, e)
  278. }, [])
  279. }, E.without = function(e) {
  280. return E.difference(e, o.call(arguments, 1))
  281. }, E.uniq = E.unique = function(e, t, n) {
  282. var n = n ? E.map(e, n) : e
  283. , r = [];
  284. return E.reduce(n, function(n, i, s) {
  285. if (0 == s || (t === !0 ? E.last(n) != i : !E.include(n, i))) n[n.length] = i, r[r.length] = e[s];
  286. return n
  287. }, []), r
  288. }, E.union = function() {
  289. return E.uniq(E.flatten(arguments, !0))
  290. }, E.intersection = E.intersect = function(e) {
  291. var t = o.call(arguments, 1);
  292. return E.filter(E.uniq(e), function(e) {
  293. return E.every(t, function(t) {
  294. return E.indexOf(t, e) >= 0
  295. })
  296. })
  297. }, E.difference = function(e) {
  298. var t = E.flatten(o.call(arguments, 1));
  299. return E.filter(e, function(e) {
  300. return !E.include(t, e)
  301. })
  302. }, E.zip = function() {
  303. for (var e = o.call(arguments), t = E.max(E.pluck(e, "length")), n = Array(t), r = 0; r < t; r++) n[r] = E.pluck(e, "" + r);
  304. return n
  305. }, E.indexOf = function(e, t, n) {
  306. if (e == null) return -1;
  307. var r;
  308. if (n) return n = E.sortedIndex(e, t), e[n] === t ? n : -1;
  309. if (g && e.indexOf === g) return e.indexOf(t);
  310. for (n = 0, r = e.length; n < r; n++)
  311. if (n in e && e[n] === t) return n;
  312. return -1
  313. }, E.lastIndexOf = function(e, t) {
  314. if (e == null) return -1;
  315. if (y && e.lastIndexOf === y) return e.lastIndexOf(t);
  316. for (var n = e.length; n--;)
  317. if (n in e && e[n] === t) return n;
  318. return -1
  319. }, E.range = function(e, t, n) {
  320. arguments.length <= 1 && (t = e || 0, e = 0);
  321. for (var n = arguments[2] || 1, r = Math.max(Math.ceil((t - e) / n), 0), i = 0, s = Array(r); i < r;) s[i++] = e, e += n;
  322. return s
  323. };
  324. var T = function() {};
  325. E.bind = function(e, t) {
  326. var n, r;
  327. if (e.bind === w && w) return w.apply(e, o.call(arguments, 1));
  328. if (!E.isFunction(e)) throw new TypeError;
  329. return r = o.call(arguments, 2), n = function() {
  330. if (this instanceof n) {
  331. T.prototype = e.prototype;
  332. var i = new T
  333. , s = e.apply(i, r.concat(o.call(arguments)));
  334. return Object(s) === s ? s : i
  335. }
  336. return e.apply(t, r.concat(o.call(arguments)))
  337. }
  338. }, E.bindAll = function(e) {
  339. var t = o.call(arguments, 1);
  340. return t.length == 0 && (t = E.functions(e)), S(t, function(t) {
  341. e[t] = E.bind(e[t], e)
  342. }), e
  343. }, E.memoize = function(e, t) {
  344. var n = {};
  345. return t || (t = E.identity)
  346. , function() {
  347. var r = t.apply(this, arguments);
  348. return E.has(n, r) ? n[r] : n[r] = e.apply(this, arguments)
  349. }
  350. }, E.delay = function(e, t) {
  351. var n = o.call(arguments, 2);
  352. return setTimeout(function() {
  353. return e.apply(e, n)
  354. }, t)
  355. }, E.defer = function(e) {
  356. return E.delay.apply(E, [e, 1].concat(o.call(arguments, 1)))
  357. }, E.throttle = function(e, t) {
  358. var n, r, i, s, o, u = E.debounce(function() {
  359. o = s = !1
  360. }, t);
  361. return function() {
  362. n = this, r = arguments;
  363. var a;
  364. i || (i = setTimeout(function() {
  365. i = null, o && e.apply(n, r), u()
  366. }, t)), s ? o = !0 : e.apply(n, r), u(), s = !0
  367. }
  368. }, E.debounce = function(e, t) {
  369. var n;
  370. return function() {
  371. var r = this
  372. , i = arguments;
  373. clearTimeout(n), n = setTimeout(function() {
  374. n = null, e.apply(r, i)
  375. }, t)
  376. }
  377. }, E.once = function(e) {
  378. var t = !1
  379. , n;
  380. return function() {
  381. return t ? n : (t = !0, n = e.apply(this, arguments))
  382. }
  383. }, E.wrap = function(e, t) {
  384. return function() {
  385. var n = [e].concat(o.call(arguments, 0));
  386. return t.apply(this, n)
  387. }
  388. }, E.compose = function() {
  389. var e = arguments;
  390. return function() {
  391. for (var t = arguments, n = e.length - 1; n >= 0; n--) t = [e[n].apply(this, t)];
  392. return t[0]
  393. }
  394. }, E.after = function(e, t) {
  395. return e <= 0 ? t() : function() {
  396. if (--e < 1) return t.apply(this, arguments)
  397. }
  398. }, E.keys = b || function(e) {
  399. if (e !== Object(e)) throw new TypeError("Invalid object");
  400. var t = []
  401. , n;
  402. for (n in e) E.has(e, n) && (t[t.length] = n);
  403. return t
  404. }, E.values = function(e) {
  405. return E.map(e, E.identity)
  406. }, E.functions = E.methods = function(e) {
  407. var t = []
  408. , n;
  409. for (n in e) E.isFunction(e[n]) && t.push(n);
  410. return t.sort()
  411. }, E.extend = function(e) {
  412. return S(o.call(arguments, 1), function(t) {
  413. for (var n in t) e[n] = t[n]
  414. }), e
  415. }, E.defaults = function(e) {
  416. return S(o.call(arguments, 1), function(t) {
  417. for (var n in t) e[n] == null && (e[n] = t[n])
  418. }), e
  419. }, E.clone = function(e) {
  420. return E.isObject(e) ? E.isArray(e) ? e.slice() : E.extend({}, e) : e
  421. }, E.tap = function(e, t) {
  422. return t(e), e
  423. }, E.isEqual = function(t, n) {
  424. return e(t, n, [])
  425. }, E.isEmpty = function(e) {
  426. if (E.isArray(e) || E.isString(e)) return e.length === 0;
  427. for (var t in e)
  428. if (E.has(e, t)) return !1;
  429. return !0
  430. }, E.isElement = function(e) {
  431. return !!e && e.nodeType == 1
  432. }, E.isArray = s || function(e) {
  433. return a.call(e) == "[object Array]"
  434. }, E.isObject = function(e) {
  435. return e === Object(e)
  436. }, E.isArguments = function(e) {
  437. return a.call(e) == "[object Arguments]"
  438. }, E.isArguments(arguments) || (E.isArguments = function(e) {
  439. return !!e && !!E.has(e, "callee")
  440. }), E.isFunction = function(e) {
  441. return a.call(e) == "[object Function]"
  442. }, E.isString = function(e) {
  443. return a.call(e) == "[object String]"
  444. }, E.isNumber = function(e) {
  445. return a.call(e) == "[object Number]"
  446. }, E.isNaN = function(e) {
  447. return e !== e
  448. }, E.isBoolean = function(e) {
  449. return e === !0 || e === !1 || a.call(e) == "[object Boolean]"
  450. }, E.isDate = function(e) {
  451. return a.call(e) == "[object Date]"
  452. }, E.isRegExp = function(e) {
  453. return a.call(e) == "[object RegExp]"
  454. }, E.isNull = function(e) {
  455. return e === null
  456. }, E.isUndefined = function(e) {
  457. return e === void 0
  458. }, E.has = function(e, t) {
  459. return f.call(e, t)
  460. }, E.noConflict = function() {
  461. return t._ = n, this
  462. }, E.identity = function(e) {
  463. return e
  464. }, E.times = function(e, t, n) {
  465. for (var r = 0; r < e; r++) t.call(n, r)
  466. }, E.escape = function(e) {
  467. return ("" + e)
  468. .replace(/&/g, "&amp;")
  469. .replace(/</g, "&lt;")
  470. .replace(/>/g, "&gt;")
  471. .replace(/"/g, "&quot;")
  472. .replace(/'/g, "&#x27;")
  473. .replace(/\//g, "&#x2F;")
  474. }, E.mixin = function(e) {
  475. S(E.functions(e), function(t) {
  476. O(t, E[t] = e[t])
  477. })
  478. };
  479. var N = 0;
  480. E.uniqueId = function(e) {
  481. var t = N++;
  482. return e ? e + t : t
  483. }, E.templateSettings = {
  484. evaluate: /<%([\s\S]+?)%>/g
  485. , interpolate: /<%=([\s\S]+?)%>/g
  486. , escape: /<%-([\s\S]+?)%>/g
  487. };
  488. var C = /.^/
  489. , k = function(e) {
  490. return e.replace(/\\\\/g, "\\")
  491. .replace(/\\'/g, "'")
  492. };
  493. E.template = function(e, t) {
  494. var n = E.templateSettings
  495. , n = "var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('" + e.replace(/\\/g, "\\\\")
  496. .replace(/'/g, "\\'")
  497. .replace(n.escape || C, function(e, t) {
  498. return "',_.escape(" + k(t) + "),'"
  499. })
  500. .replace(n.interpolate || C, function(e, t) {
  501. return "'," + k(t) + ",'"
  502. })
  503. .replace(n.evaluate || C, function(e, t) {
  504. return "');" + k(t)
  505. .replace(/[\r\n\t]/g, " ") + ";__p.push('"
  506. })
  507. .replace(/\r/g, "\\r")
  508. .replace(/\n/g, "\\n")
  509. .replace(/\t/g, "\\t") + "');}return __p.join('');"
  510. , r = new Function("obj", "_", n);
  511. return t ? r(t, E) : function(e) {
  512. return r.call(this, e, E)
  513. }
  514. }, E.chain = function(e) {
  515. return E(e)
  516. .chain()
  517. };
  518. var L = function(e) {
  519. this._wrapped = e
  520. };
  521. E.prototype = L.prototype;
  522. var A = function(e, t) {
  523. return t ? E(e)
  524. .chain() : e
  525. }
  526. , O = function(e, t) {
  527. L.prototype[e] = function() {
  528. var e = o.call(arguments);
  529. return u.call(e, this._wrapped), A(t.apply(E, e), this._chain)
  530. }
  531. };
  532. E.mixin(E), S("pop,push,reverse,shift,sort,splice,unshift".split(","), function(e) {
  533. var t = i[e];
  534. L.prototype[e] = function() {
  535. var n = this._wrapped;
  536. t.apply(n, arguments);
  537. var r = n.length;
  538. return (e == "shift" || e == "splice") && r === 0 && delete n[0], A(n, this._chain)
  539. }
  540. }), S(["concat", "join", "slice"], function(e) {
  541. var t = i[e];
  542. L.prototype[e] = function() {
  543. return A(t.apply(this._wrapped, arguments), this._chain)
  544. }
  545. }), L.prototype.chain = function() {
  546. return this._chain = !0, this
  547. }, L.prototype.value = function() {
  548. return this._wrapped
  549. }
  550. })
  551. .call(this)
  552. , function(e) {
  553. "use strict";
  554. var t = String.prototype.trim
  555. , n = String.prototype.trimRight
  556. , r = String.prototype.trimLeft
  557. , i = function(e) {
  558. return e * 1 || 0
  559. }
  560. , s = function(e, t, n) {
  561. e = "" + e, t = ~~t;
  562. for (var r = []; t > 0; r[--t] = e);
  563. return r.join(n == null ? "" : n)
  564. }
  565. , o = function(e) {
  566. return Array.prototype.slice.call(e)
  567. }
  568. , u = function(e) {
  569. return e != null ? "[" + f.escapeRegExp("" + e) + "]" : "\\s"
  570. }
  571. , a = function() {
  572. function e(e) {
  573. return Object.prototype.toString.call(e)
  574. .slice(8, -1)
  575. .toLowerCase()
  576. }
  577. var t = s
  578. , n = function() {
  579. return n.cache.hasOwnProperty(arguments[0]) || (n.cache[arguments[0]] = n.parse(arguments[0])), n.format.call(null, n.cache[arguments[0]], arguments)
  580. };
  581. return n.format = function(n, r) {
  582. var i = 1
  583. , s = n.length
  584. , o = ""
  585. , u, f = []
  586. , l, c, h, p, d, v;
  587. for (l = 0; l < s; l++) {
  588. o = e(n[l]);
  589. if (o === "string") f.push(n[l]);
  590. else if (o === "array") {
  591. h = n[l];
  592. if (h[2]) {
  593. u = r[i];
  594. for (c = 0; c < h[2].length; c++) {
  595. if (!u.hasOwnProperty(h[2][c])) throw new Error(a('[_.sprintf] property "%s" does not exist', h[2][c]));
  596. u = u[h[2][c]]
  597. }
  598. } else h[1] ? u = r[h[1]] : u = r[i++];
  599. if (/[^s]/.test(h[8]) && e(u) != "number") throw new Error(a("[_.sprintf] expecting number but found %s", e(u)));
  600. switch (h[8]) {
  601. case "b":
  602. u = u.toString(2);
  603. break;
  604. case "c":
  605. u = String.fromCharCode(u);
  606. break;
  607. case "d":
  608. u = parseInt(u, 10);
  609. break;
  610. case "e":
  611. u = h[7] ? u.toExponential(h[7]) : u.toExponential();
  612. break;
  613. case "f":
  614. u = h[7] ? parseFloat(u)
  615. .toFixed(h[7]) : parseFloat(u);
  616. break;
  617. case "o":
  618. u = u.toString(8);
  619. break;
  620. case "s":
  621. u = (u = String(u)) && h[7] ? u.substring(0, h[7]) : u;
  622. break;
  623. case "u":
  624. u = Math.abs(u);
  625. break;
  626. case "x":
  627. u = u.toString(16);
  628. break;
  629. case "X":
  630. u = u.toString(16)
  631. .toUpperCase()
  632. }
  633. u = /[def]/.test(h[8]) && h[3] && u >= 0 ? "+" + u : u, d = h[4] ? h[4] == "0" ? "0" : h[4].charAt(1) : " ", v = h[6] - String(u)
  634. .length, p = h[6] ? t(d, v) : "", f.push(h[5] ? u + p : p + u)
  635. }
  636. }
  637. return f.join("")
  638. }, n.cache = {}, n.parse = function(e) {
  639. var t = e
  640. , n = []
  641. , r = []
  642. , i = 0;
  643. while (t) {
  644. if ((n = /^[^\x25]+/.exec(t)) !== null) r.push(n[0]);
  645. else if ((n = /^\x25{2}/.exec(t)) !== null) r.push("%");
  646. else {
  647. if ((n = /^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(t)) === null) throw new Error("[_.sprintf] huh?");
  648. if (n[2]) {
  649. i |= 1;
  650. var s = []
  651. , o = n[2]
  652. , u = [];
  653. if ((u = /^([a-z_][a-z_\d]*)/i.exec(o)) === null) throw new Error("[_.sprintf] huh?");
  654. s.push(u[1]);
  655. while ((o = o.substring(u[0].length)) !== "")
  656. if ((u = /^\.([a-z_][a-z_\d]*)/i.exec(o)) !== null) s.push(u[1]);
  657. else {
  658. if ((u = /^\[(\d+)\]/.exec(o)) === null) throw new Error("[_.sprintf] huh?");
  659. s.push(u[1])
  660. }
  661. n[2] = s
  662. } else i |= 2;
  663. if (i === 3) throw new Error("[_.sprintf] mixing positional and named placeholders is not (yet) supported");
  664. r.push(n)
  665. }
  666. t = t.substring(n[0].length)
  667. }
  668. return r
  669. }, n
  670. }()
  671. , f = {
  672. VERSION: "2.0.0"
  673. , isBlank: function(e) {
  674. return /^\s*$/.test(e)
  675. }
  676. , stripTags: function(e) {
  677. return ("" + e)
  678. .replace(/<\/?[^>]+>/ig, "")
  679. }
  680. , capitalize: function(e) {
  681. return e = "" + e, e.charAt(0)
  682. .toUpperCase() + e.substring(1)
  683. .toLowerCase()
  684. }
  685. , chop: function(e, t) {
  686. e += "", t = ~~t || e.length;
  687. var n = [];
  688. for (var r = 0; r < e.length;) n.push(e.slice(r, r + t)), r += t;
  689. return n
  690. }
  691. , clean: function(e) {
  692. return f.strip(("" + e)
  693. .replace(/\s+/g, " "))
  694. }
  695. , count: function(e, t) {
  696. e = "" + e, t = "" + t;
  697. var n = 0
  698. , r;
  699. for (var i = 0; i < e.length;) r = e.indexOf(t, i), r >= 0 && n++, i = i + (r >= 0 ? r : 0) + t.length;
  700. return n
  701. }
  702. , chars: function(e) {
  703. return ("" + e)
  704. .split("")
  705. }
  706. , escapeHTML: function(e) {
  707. return ("" + e)
  708. .replace(/&/g, "&amp;")
  709. .replace(/</g, "&lt;")
  710. .replace(/>/g, "&gt;")
  711. .replace(/"/g, "&quot;")
  712. .replace(/'/g, "&apos;")
  713. }
  714. , unescapeHTML: function(e) {
  715. return ("" + e)
  716. .replace(/&lt;/g, "<")
  717. .replace(/&gt;/g, ">")
  718. .replace(/&quot;/g, '"')
  719. .replace(/&apos;/g, "'")
  720. .replace(/&amp;/g, "&")
  721. }
  722. , escapeRegExp: function(e) {
  723. return e.replace(/([-.*+?^${}()|[\]\/\\])/g, "\\$1")
  724. }
  725. , insert: function(e, t, n) {
  726. var r = ("" + e)
  727. .split("");
  728. return r.splice(~~t, 0, "" + n), r.join("")
  729. }
  730. , include: function(e, t) {
  731. return ("" + e)
  732. .indexOf(t) !== -1
  733. }
  734. , join: function(e) {
  735. var t = o(arguments);
  736. return t.join(t.shift())
  737. }
  738. , lines: function(e) {
  739. return ("" + e)
  740. .split("\n")
  741. }
  742. , reverse: function(e) {
  743. return Array.prototype.reverse.apply(String(e)
  744. .split(""))
  745. .join("")
  746. }
  747. , splice: function(e, t, n, r) {
  748. var i = ("" + e)
  749. .split("");
  750. return i.splice(~~t, ~~n, r), i.join("")
  751. }
  752. , startsWith: function(e, t) {
  753. return e = "" + e, t = "" + t, e.length >= t.length && e.substring(0, t.length) === t
  754. }
  755. , endsWith: function(e, t) {
  756. return e = "" + e, t = "" + t, e.length >= t.length && e.substring(e.length - t.length) === t
  757. }
  758. , succ: function(e) {
  759. e = "" + e;
  760. var t = e.split("");
  761. return t.splice(e.length - 1, 1, String.fromCharCode(e.charCodeAt(e.length - 1) + 1)), t.join("")
  762. }
  763. , titleize: function(e) {
  764. return ("" + e)
  765. .replace(/\b./g, function(e) {
  766. return e.toUpperCase()
  767. })
  768. }
  769. , camelize: function(e) {
  770. return f.trim(e)
  771. .replace(/(\-|_|\s)+(.)?/g, function(e, t, n) {
  772. return n ? n.toUpperCase() : ""
  773. })
  774. }
  775. , underscored: function(e) {
  776. return f.trim(e)
  777. .replace(/([a-z\d])([A-Z]+)/g, "$1_$2")
  778. .replace(/[-\s]+/g, "_")
  779. .toLowerCase()
  780. }
  781. , dasherize: function(e) {
  782. return f.trim(e)
  783. .replace(/[_\s]+/g, "-")
  784. .replace(/([A-Z])/g, "-$1")
  785. .replace(/-+/g, "-")
  786. .toLowerCase()
  787. }
  788. , humanize: function(e) {
  789. return f.capitalize(this.underscored(e)
  790. .replace(/_id$/, "")
  791. .replace(/_/g, " "))
  792. }
  793. , trim: function(e, n) {
  794. return e = "" + e, !n && t ? t.call(e) : (n = u(n), e.replace(new RegExp("^" + n + "+|" + n + "+$", "g"), ""))
  795. }
  796. , ltrim: function(e, t) {
  797. return !t && r ? r.call(e) : (t = u(t), ("" + e)
  798. .replace(new RegExp("^" + t + "+", "g"), ""))
  799. }
  800. , rtrim: function(e, t) {
  801. return !t && n ? n.call(e) : (t = u(t), ("" + e)
  802. .replace(new RegExp(t + "+$", "g"), ""))
  803. }
  804. , truncate: function(e, t, n) {
  805. return e = "" + e, n = n || "...", t = ~~t, e.length > t ? e.slice(0, t) + n : e
  806. }
  807. , prune: function(e, t, n) {
  808. e = "" + e, t = ~~t, n = n != null ? "" + n : "...";
  809. var r, i, s = e.replace(/\W/g, function(e) {
  810. return e.toUpperCase() !== e.toLowerCase() ? "A" : " "
  811. });
  812. return i = s[t], r = s.slice(0, t), i && i.match(/\S/) && (r = r.replace(/\s\S+$/, "")), r = f.rtrim(r), (r + n)
  813. .length > e.length ? e : e.substring(0, r.length) + n
  814. }
  815. , words: function(e, t) {
  816. return ("" + e)
  817. .split(t || " ")
  818. }
  819. , pad: function(e, t, n, r) {
  820. e = "" + e;
  821. var i = ""
  822. , o = 0;
  823. t = ~~t, n ? n.length > 1 && (n = n.charAt(0)) : n = " ";
  824. switch (r) {
  825. case "right":
  826. o = t - e.length, i = s(n, o), e += i;
  827. break;
  828. case "both":
  829. o = t - e.length, i = {
  830. left: s(n, Math.ceil(o / 2))
  831. , right: s(n, Math.floor(o / 2))
  832. }, e = i.left + e + i.right;
  833. break;
  834. default:
  835. o = t - e.length, i = s(n, o), e = i + e
  836. }
  837. return e
  838. }
  839. , lpad: function(e, t, n) {
  840. return f.pad(e, t, n)
  841. }
  842. , rpad: function(e, t, n) {
  843. return f.pad(e, t, n, "right")
  844. }
  845. , lrpad: function(e, t, n) {
  846. return f.pad(e, t, n, "both")
  847. }
  848. , sprintf: a
  849. , vsprintf: function(e, t) {
  850. return t.unshift(e), a.apply(null, t)
  851. }
  852. , toNumber: function(e, t) {
  853. var n = i(i(e)
  854. .toFixed(~~t));
  855. return n === 0 && "" + e != "0" ? Number.NaN : n
  856. }
  857. , strRight: function(e, t) {
  858. e = "" + e, t = t != null ? "" + t : t;
  859. var n = t ? e.indexOf(t) : -1;
  860. return n != -1 ? e.slice(n + t.length, e.length) : e
  861. }
  862. , strRightBack: function(e, t) {
  863. e = "" + e, t = t != null ? "" + t : t;
  864. var n = t ? e.lastIndexOf(t) : -1;
  865. return n != -1 ? e.slice(n + t.length, e.length) : e
  866. }
  867. , strLeft: function(e, t) {
  868. e = "" + e, t = t != null ? "" + t : t;
  869. var n = t ? e.indexOf(t) : -1;
  870. return n != -1 ? e.slice(0, n) : e
  871. }
  872. , strLeftBack: function(e, t) {
  873. e = "" + e, t = t != null ? "" + t : t;
  874. var n = e.lastIndexOf(t);
  875. return n != -1 ? e.slice(0, n) : e
  876. }
  877. , toSentence: function(e, t, n) {
  878. t || (t = ", "), n || (n = " and ");
  879. var r = e.length
  880. , i = "";
  881. for (var s = 0; s < r; s++) i += e[s], s === r - 2 ? i += n : s < r - 1 && (i += t);
  882. return i
  883. }
  884. , slugify: function(e) {
  885. var t = "àáäâèéëêìíïîòóöôùúüûñç·/_:;"
  886. , n = "aaaaeeeeiiiioooouuuunc"
  887. , r = new RegExp(u(t), "g");
  888. return e = ("" + e)
  889. .toLowerCase(), e = e.replace(r, function(e) {
  890. return n[t.indexOf(e)] || "-"
  891. }), f.trim(e.replace(/[^\w\s-]/g, "")
  892. .replace(/[-\s]+/g, "-"), "-")
  893. }
  894. , exports: function() {
  895. var e = {};
  896. for (var t in this) {
  897. if (!this.hasOwnProperty(t) || t == "include" || t == "contains" || t == "reverse") continue;
  898. e[t] = this[t]
  899. }
  900. return e
  901. }
  902. , repeat: s
  903. };
  904. f.strip = f.trim, f.lstrip = f.ltrim, f.rstrip = f.rtrim, f.center = f.lrpad, f.rjust = f.lpad, f.ljust = f.rpad, f.contains = f.include, typeof exports != "undefined" ? (typeof module != "undefined" && module.exports && (module.exports = f), exports._s = f) : typeof define == "function" && define.amd ? define("underscore.string", function() {
  905. return f
  906. }) : typeof e._ != "undefined" ? (e._.string = f, e._.str = e._.string) : e._ = {
  907. string: f
  908. , str: f
  909. }
  910. }(this || window)
  911. , function() {
  912. var e = this
  913. , t = e.Backbone
  914. , n = Array.prototype.slice
  915. , r = Array.prototype.splice
  916. , i;
  917. i = "undefined" != typeof exports ? exports : e.Backbone = {}, i.VERSION = "0.9.2";
  918. var s = e._;
  919. !s && "undefined" != typeof require && (s = require("underscore"));
  920. var o = e.jQuery || e.Zepto || e.ender;
  921. i.setDomLibrary = function(e) {
  922. o = e
  923. }, i.noConflict = function() {
  924. return e.Backbone = t, this
  925. }, i.emulateHTTP = !1, i.emulateJSON = !1;
  926. var u = /\s+/
  927. , a = i.Events = {
  928. on: function(e, t, n) {
  929. var r, i, s, o, a;
  930. if (!t) return this;
  931. e = e.split(u);
  932. for (r = this._callbacks || (this._callbacks = {}); i = e.shift();) s = (a = r[i]) ? a.tail : {}, s.next = o = {}, s.context = n, s.callback = t, r[i] = {
  933. tail: o
  934. , next: a ? a.next : s
  935. };
  936. return this
  937. }
  938. , off: function(e, t, n) {
  939. var r, i, o, a, f, l;
  940. if (i = this._callbacks) {
  941. if (!e && !t && !n) return delete this._callbacks, this;
  942. for (e = e ? e.split(u) : s.keys(i); r = e.shift();)
  943. if (o = i[r], delete i[r], o && (t || n))
  944. for (a = o.tail;
  945. (o = o.next) !== a;)(f = o.callback, l = o.context, t && f !== t || n && l !== n) && this.on(r, f, l);
  946. return this
  947. }
  948. }
  949. , trigger: function(e) {
  950. var t, r, i, s, o, a;
  951. if (!(i = this._callbacks)) return this;
  952. o = i.all, e = e.split(u);
  953. for (a = n.call(arguments, 1); t = e.shift();) {
  954. if (r = i[t])
  955. for (s = r.tail;
  956. (r = r.next) !== s;) r.callback.apply(r.context || this, a);
  957. if (r = o) {
  958. s = r.tail;
  959. for (t = [t].concat(a);
  960. (r = r.next) !== s;) r.callback.apply(r.context || this, t)
  961. }
  962. }
  963. return this
  964. }
  965. };
  966. a.bind = a.on, a.unbind = a.off;
  967. var f = i.Model = function(e, t) {
  968. var n;
  969. e || (e = {}), t && t.parse && (e = this.parse(e));
  970. if (n = T(this, "defaults")) e = s.extend({}, n, e);
  971. t && t.collection && (this.collection = t.collection), this.attributes = {}, this._escapedAttributes = {}, this.cid = s.uniqueId("c"), this.changed = {}, this._silent = {}, this._pending = {}, this.set(e, {
  972. silent: !0
  973. }), this.changed = {}, this._silent = {}, this._pending = {}, this._previousAttributes = s.clone(this.attributes), this.initialize.apply(this, arguments)
  974. };
  975. s.extend(f.prototype, a, {
  976. changed: null
  977. , _silent: null
  978. , _pending: null
  979. , idAttribute: "id"
  980. , initialize: function() {}
  981. , toJSON: function() {
  982. return s.clone(this.attributes)
  983. }
  984. , get: function(e) {
  985. return this.attributes[e]
  986. }
  987. , escape: function(e) {
  988. var t;
  989. return (t = this._escapedAttributes[e]) ? t : (t = this.get(e), this._escapedAttributes[e] = s.escape(null == t ? "" : "" + t))
  990. }
  991. , has: function(e) {
  992. return null != this.get(e)
  993. }
  994. , set: function(e, t, n) {
  995. var r, i;
  996. s.isObject(e) || null == e ? (r = e, n = t) : (r = {}, r[e] = t), n || (n = {});
  997. if (!r) return this;
  998. r instanceof f && (r = r.attributes);
  999. if (n.unset)
  1000. for (i in r) r[i] = void 0;
  1001. if (!this._validate(r, n)) return !1;
  1002. this.idAttribute in r && (this.id = r[this.idAttribute]);
  1003. var t = n.changes = {}
  1004. , o = this.attributes
  1005. , u = this._escapedAttributes
  1006. , a = this._previousAttributes || {};
  1007. for (i in r) {
  1008. e = r[i];
  1009. if (!s.isEqual(o[i], e) || n.unset && s.has(o, i)) delete u[i], (n.silent ? this._silent : t)[i] = !0;
  1010. n.unset ? delete o[i] : o[i] = e, !s.isEqual(a[i], e) || s.has(o, i) != s.has(a, i) ? (this.changed[i] = e, n.silent || (this._pending[i] = !0)) : (delete this.changed[i], delete this._pending[i])
  1011. }
  1012. return n.silent || this.change(n), this
  1013. }
  1014. , unset: function(e, t) {
  1015. return (t || (t = {}))
  1016. .unset = !0, this.set(e, null, t)
  1017. }
  1018. , clear: function(e) {
  1019. return (e || (e = {}))
  1020. .unset = !0, this.set(s.clone(this.attributes), e)
  1021. }
  1022. , fetch: function(e) {
  1023. var e = e ? s.clone(e) : {}
  1024. , t = this
  1025. , n = e.success;
  1026. return e.success = function(r, i, s) {
  1027. if (!t.set(t.parse(r, s), e)) return !1;
  1028. n && n(t, r)
  1029. }, e.error = i.wrapError(e.error, t, e), (this.sync || i.sync)
  1030. .call(this, "read", this, e)
  1031. }
  1032. , save: function(e, t, n) {
  1033. var r, o;
  1034. s.isObject(e) || null == e ? (r = e, n = t) : (r = {}, r[e] = t), n = n ? s.clone(n) : {};
  1035. if (n.wait) {
  1036. if (!this._validate(r, n)) return !1;
  1037. o = s.clone(this.attributes)
  1038. }
  1039. e = s.extend({}, n, {
  1040. silent: !0
  1041. });
  1042. if (r && !this.set(r, n.wait ? e : n)) return !1;
  1043. var u = this
  1044. , a = n.success;
  1045. return n.success = function(e, t, i) {
  1046. t = u.parse(e, i), n.wait && (delete n.wait, t = s.extend(r || {}, t));
  1047. if (!u.set(t, n)) return !1;
  1048. a ? a(u, e) : u.trigger("sync", u, e, n)
  1049. }, n.error = i.wrapError(n.error, u, n), t = this.isNew() ? "create" : "update", t = (this.sync || i.sync)
  1050. .call(this, t, this, n), n.wait && this.set(o, e), t
  1051. }
  1052. , destroy: function(e) {
  1053. var e = e ? s.clone(e) : {}
  1054. , t = this
  1055. , n = e.success
  1056. , r = function() {
  1057. t.trigger("destroy", t, t.collection, e)
  1058. };
  1059. if (this.isNew()) return r(), !1;
  1060. e.success = function(i) {
  1061. e.wait && r(), n ? n(t, i) : t.trigger("sync", t, i, e)
  1062. }, e.error = i.wrapError(e.error, t, e);
  1063. var o = (this.sync || i.sync)
  1064. .call(this, "delete", this, e);
  1065. return e.wait || r(), o
  1066. }
  1067. , url: function() {
  1068. var e = T(this, "urlRoot") || T(this.collection, "url") || N();
  1069. return this.isNew() ? e : e + ("/" == e.charAt(e.length - 1) ? "" : "/") + encodeURIComponent(this.id)
  1070. }
  1071. , parse: function(e) {
  1072. return e
  1073. }
  1074. , clone: function() {
  1075. return new this.constructor(this.attributes)
  1076. }
  1077. , isNew: function() {
  1078. return null == this.id
  1079. }
  1080. , change: function(e) {
  1081. e || (e = {});
  1082. var t = this._changing;
  1083. this._changing = !0;
  1084. for (var n in this._silent) this._pending[n] = !0;
  1085. var r = s.extend({}, e.changes, this._silent);
  1086. this._silent = {};
  1087. for (n in r) this.trigger("change:" + n, this, this.get(n), e);
  1088. if (t) return this;
  1089. for (; !s.isEmpty(this._pending);) {
  1090. this._pending = {}, this.trigger("change", this, e);
  1091. for (n in this.changed) !this._pending[n] && !this._silent[n] && delete this.changed[n];
  1092. this._previousAttributes = s.clone(this.attributes)
  1093. }
  1094. return this._changing = !1, this
  1095. }
  1096. , hasChanged: function(e) {
  1097. return arguments.length ? s.has(this.changed, e) : !s.isEmpty(this.changed)
  1098. }
  1099. , changedAttributes: function(e) {
  1100. if (!e) return this.hasChanged() ? s.clone(this.changed) : !1;
  1101. var t, n = !1
  1102. , r = this._previousAttributes
  1103. , i;
  1104. for (i in e) s.isEqual(r[i], t = e[i]) || ((n || (n = {}))[i] = t);
  1105. return n
  1106. }
  1107. , previous: function(e) {
  1108. return !arguments.length || !this._previousAttributes ? null : this._previousAttributes[e]
  1109. }
  1110. , previousAttributes: function() {
  1111. return s.clone(this._previousAttributes)
  1112. }
  1113. , isValid: function() {
  1114. return !this.validate(this.attributes)
  1115. }
  1116. , _validate: function(e, t) {
  1117. if (t.silent || !this.validate) return !0;
  1118. var e = s.extend({}, this.attributes, e)
  1119. , n = this.validate(e, t);
  1120. return n ? (t && t.error ? t.error(this, n, t) : this.trigger("error", this, n, t), !1) : !0
  1121. }
  1122. });
  1123. var l = i.Collection = function(e, t) {
  1124. t || (t = {}), t.model && (this.model = t.model), t.comparator && (this.comparator = t.comparator), this._reset(), this.initialize.apply(this, arguments), e && this.reset(e, {
  1125. silent: !0
  1126. , parse: t.parse
  1127. })
  1128. };
  1129. s.extend(l.prototype, a, {
  1130. model: f
  1131. , initialize: function() {}
  1132. , toJSON: function(e) {
  1133. return this.map(function(t) {
  1134. return t.toJSON(e)
  1135. })
  1136. }
  1137. , add: function(e, t) {
  1138. var n, i, o, u, a, f = {}
  1139. , l = {}
  1140. , c = [];
  1141. t || (t = {}), e = s.isArray(e) ? e.slice() : [e], n = 0;
  1142. for (i = e.length; n < i; n++) {
  1143. if (!(o = e[n] = this._prepareModel(e[n], t))) throw Error("Can't add an invalid model to a collection");
  1144. u = o.cid, a = o.id, f[u] || this._byCid[u] || null != a && (l[a] || this._byId[a]) ? c.push(n) : f[u] = l[a] = o
  1145. }
  1146. for (n = c.length; n--;) e.splice(c[n], 1);
  1147. n = 0;
  1148. for (i = e.length; n < i; n++)(o = e[n])
  1149. .on("all", this._onModelEvent, this), this._byCid[o.cid] = o, null != o.id && (this._byId[o.id] = o);
  1150. this.length += i, r.apply(this.models, [null != t.at ? t.at : this.models.length, 0].concat(e)), this.comparator && this.sort({
  1151. silent: !0
  1152. });
  1153. if (t.silent) return this;
  1154. n = 0;
  1155. for (i = this.models.length; n < i; n++) f[(o = this.models[n])
  1156. .cid] && (t.index = n, o.trigger("add", o, this, t));
  1157. return this
  1158. }
  1159. , remove: function(e, t) {
  1160. var n, r, i, o;
  1161. t || (t = {}), e = s.isArray(e) ? e.slice() : [e], n = 0;
  1162. for (r = e.length; n < r; n++)
  1163. if (o = this.getByCid(e[n]) || this.get(e[n])) delete this._byId[o.id], delete this._byCid[o.cid], i = this.indexOf(o), this.models.splice(i, 1), this.length--, t.silent || (t.index = i, o.trigger("remove", o, this, t)), this._removeReference(o);
  1164. return this
  1165. }
  1166. , push: function(e, t) {
  1167. return e = this._prepareModel(e, t), this.add(e, t), e
  1168. }
  1169. , pop: function(e) {
  1170. var t = this.at(this.length - 1);
  1171. return this.remove(t, e), t
  1172. }
  1173. , unshift: function(e, t) {
  1174. return e = this._prepareModel(e, t), this.add(e, s.extend({
  1175. at: 0
  1176. }, t)), e
  1177. }
  1178. , shift: function(e) {
  1179. var t = this.at(0);
  1180. return this.remove(t, e), t
  1181. }
  1182. , get: function(e) {
  1183. return null == e ? void 0 : this._byId[null != e.id ? e.id : e]
  1184. }
  1185. , getByCid: function(e) {
  1186. return e && this._byCid[e.cid || e]
  1187. }
  1188. , at: function(e) {
  1189. return this.models[e]
  1190. }
  1191. , where: function(e) {
  1192. return s.isEmpty(e) ? [] : this.filter(function(t) {
  1193. for (var n in e)
  1194. if (e[n] !== t.get(n)) return !1;
  1195. return !0
  1196. })
  1197. }
  1198. , sort: function(e) {
  1199. e || (e = {});
  1200. if (!this.comparator) throw Error("Cannot sort a set without a comparator");
  1201. var t = s.bind(this.comparator, this);
  1202. return 1 == this.comparator.length ? this.models = this.sortBy(t) : this.models.sort(t), e.silent || this.trigger("reset", this, e), this
  1203. }
  1204. , pluck: function(e) {
  1205. return s.map(this.models, function(t) {
  1206. return t.get(e)
  1207. })
  1208. }
  1209. , reset: function(e, t) {
  1210. e || (e = []), t || (t = {});
  1211. for (var n = 0, r = this.models.length; n < r; n++) this._removeReference(this.models[n]);
  1212. return this._reset(), this.add(e, s.extend({
  1213. silent: !0
  1214. }, t)), t.silent || this.trigger("reset", this, t), this
  1215. }
  1216. , fetch: function(e) {
  1217. e = e ? s.clone(e) : {}, void 0 === e.parse && (e.parse = !0);
  1218. var t = this
  1219. , n = e.success;
  1220. return e.success = function(r, i, s) {
  1221. t[e.add ? "add" : "reset"](t.parse(r, s), e), n && n(t, r)
  1222. }, e.error = i.wrapError(e.error, t, e), (this.sync || i.sync)
  1223. .call(this, "read", this, e)
  1224. }
  1225. , create: function(e, t) {
  1226. var n = this
  1227. , t = t ? s.clone(t) : {}
  1228. , e = this._prepareModel(e, t);
  1229. if (!e) return !1;
  1230. t.wait || n.add(e, t);
  1231. var r = t.success;
  1232. return t.success = function(i, s) {
  1233. t.wait && n.add(i, t), r ? r(i, s) : i.trigger("sync", e, s, t)
  1234. }, e.save(null, t), e
  1235. }
  1236. , parse: function(e) {
  1237. return e
  1238. }
  1239. , chain: function() {
  1240. return s(this.models)
  1241. .chain()
  1242. }
  1243. , _reset: function() {
  1244. this.length = 0, this.models = [], this._byId = {}, this._byCid = {}
  1245. }
  1246. , _prepareModel: function(e, t) {
  1247. return t || (t = {}), e instanceof f ? e.collection || (e.collection = this) : (t.collection = this, e = new this.model(e, t), e._validate(e.attributes, t) || (e = !1)), e
  1248. }
  1249. , _removeReference: function(e) {
  1250. this == e.collection && delete e.collection, e.off("all", this._onModelEvent, this)
  1251. }
  1252. , _onModelEvent: function(e, t, n, r) {
  1253. ("add" == e || "remove" == e) && n != this || ("destroy" == e && this.remove(t, r), t && e === "change:" + t.idAttribute && (delete this._byId[t.previous(t.idAttribute)], this._byId[t.id] = t), this.trigger.apply(this, arguments))
  1254. }
  1255. }), s.each("forEach,each,map,reduce,reduceRight,find,detect,filter,select,reject,every,all,some,any,include,contains,invoke,max,min,sortBy,sortedIndex,toArray,size,first,initial,rest,last,without,indexOf,shuffle,lastIndexOf,isEmpty,groupBy".split(","), function(e) {
  1256. l.prototype[e] = function() {
  1257. return s[e].apply(s, [this.models].concat(s.toArray(arguments)))
  1258. }
  1259. });
  1260. var c = i.Router = function(e) {
  1261. e || (e = {}), e.routes && (this.routes = e.routes), this._bindRoutes(), this.initialize.apply(this, arguments)
  1262. }
  1263. , h = /:\w+/g
  1264. , p = /\*\w+/g
  1265. , d = /[-[\]{}()+?.,\\^$|#\s]/g;
  1266. s.extend(c.prototype, a, {
  1267. initialize: function() {}
  1268. , route: function(e, t, n) {
  1269. return i.history || (i.history = new v), s.isRegExp(e) || (e = this._routeToRegExp(e)), n || (n = this[t]), i.history.route(e, s.bind(function(r) {
  1270. r = this._extractParameters(e, r), n && n.apply(this, r), this.trigger.apply(this, ["route:" + t].concat(r)), i.history.trigger("route", this, t, r)
  1271. }, this)), this
  1272. }
  1273. , navigate: function(e, t) {
  1274. i.history.navigate(e, t)
  1275. }
  1276. , _bindRoutes: function() {
  1277. if (this.routes) {
  1278. var e = []
  1279. , t;
  1280. for (t in this.routes) e.unshift([t, this.routes[t]]);
  1281. t = 0;
  1282. for (var n = e.length; t < n; t++) this.route(e[t][0], e[t][1], this[e[t][1]])
  1283. }
  1284. }
  1285. , _routeToRegExp: function(e) {
  1286. return e = e.replace(d, "\\$&")
  1287. .replace(h, "([^/]+)")
  1288. .replace(p, "(.*?)"), RegExp("^" + e + "$")
  1289. }
  1290. , _extractParameters: function(e, t) {
  1291. return e.exec(t)
  1292. .slice(1)
  1293. }
  1294. });
  1295. var v = i.History = function() {
  1296. this.handlers = [], s.bindAll(this, "checkUrl")
  1297. }
  1298. , m = /^[#\/]/
  1299. , g = /msie [\w.]+/;
  1300. v.started = !1, s.extend(v.prototype, a, {
  1301. interval: 50
  1302. , getHash: function(e) {
  1303. return (e = (e ? e.location : window.location)
  1304. .href.match(/#(.*)$/)) ? e[1] : ""
  1305. }
  1306. , getFragment: function(e, t) {
  1307. if (null == e)
  1308. if (this._hasPushState || t) {
  1309. var e = window.location.pathname
  1310. , n = window.location.search;
  1311. n && (e += n)
  1312. } else e = this.getHash();
  1313. return e.indexOf(this.options.root) || (e = e.substr(this.options.root.length)), e.replace(m, "")
  1314. }
  1315. , start: function(e) {
  1316. if (v.started) throw Error("Backbone.history has already been started");
  1317. v.started = !0, this.options = s.extend({}, {
  1318. root: "/"
  1319. }, this.options, e), this._wantsHashChange = !1 !== this.options.hashChange, this._wantsPushState = !!this.options.pushState, this._hasPushState = !(!this.options.pushState || !window.history || !window.history.pushState);
  1320. var e = this.getFragment()
  1321. , t = document.documentMode;
  1322. if (t = g.exec(navigator.userAgent.toLowerCase()) && (!t || 7 >= t)) this.iframe = o('<iframe src="javascript:0" tabindex="-1" />')
  1323. .hide()
  1324. .appendTo("body")[0].contentWindow, this.navigate(e);
  1325. this._hasPushState ? o(window)
  1326. .bind("popstate", this.checkUrl) : this._wantsHashChange && "onhashchange" in window && !t ? o(window)
  1327. .bind("hashchange", this.checkUrl) : this._wantsHashChange && (this._checkUrlInterval = setInterval(this.checkUrl, this.interval)), this.fragment = e, e = window.location, t = e.pathname == this.options.root;
  1328. if (this._wantsHashChange && this._wantsPushState && !this._hasPushState && !t) return this.fragment = this.getFragment(null, !0), window.location.replace(this.options.root + "#" + this.fragment), !0;
  1329. this._wantsPushState && this._hasPushState && t && e.hash && (this.fragment = this.getHash()
  1330. .replace(m, ""), window.history.replaceState({}, document.title, e.protocol + "//" + e.host + this.options.root + this.fragment));
  1331. if (!this.options.silent) return this.loadUrl()
  1332. }
  1333. , stop: function() {
  1334. o(window)
  1335. .unbind("popstate", this.checkUrl)
  1336. .unbind("hashchange", this.checkUrl), clearInterval(this._checkUrlInterval), v.started = !1
  1337. }
  1338. , route: function(e, t) {
  1339. this.handlers.unshift({
  1340. route: e
  1341. , callback: t
  1342. })
  1343. }
  1344. , checkUrl: function() {
  1345. var e = this.getFragment();
  1346. e == this.fragment && this.iframe && (e = this.getFragment(this.getHash(this.iframe)));
  1347. if (e == this.fragment) return !1;
  1348. this.iframe && this.navigate(e), this.loadUrl() || this.loadUrl(this.getHash())
  1349. }
  1350. , loadUrl: function(e) {
  1351. var t = this.fragment = this.getFragment(e);
  1352. return s.any(this.handlers, function(e) {
  1353. if (e.route.test(t)) return e.callback(t), !0
  1354. })
  1355. }
  1356. , navigate: function(e, t) {
  1357. if (!v.started) return !1;
  1358. if (!t || !0 === t) t = {
  1359. trigger: t
  1360. };
  1361. var n = (e || "")
  1362. .replace(m, "");
  1363. this.fragment != n && (this._hasPushState ? (0 != n.indexOf(this.options.root) && (n = this.options.root + n), this.fragment = n, window.history[t.replace ? "replaceState" : "pushState"]({}, document.title, n)) : this._wantsHashChange ? (this.fragment = n, this._updateHash(window.location, n, t.replace), this.iframe && n != this.getFragment(this.getHash(this.iframe)) && (t.replace || this.iframe.document.open()
  1364. .close(), this._updateHash(this.iframe.location, n, t.replace))) : window.location.assign(this.options.root + e), t.trigger && this.loadUrl(e))
  1365. }
  1366. , _updateHash: function(e, t, n) {
  1367. n ? e.replace(e.toString()
  1368. .replace(/(javascript:|#).*$/, "") + "#" + t) : e.hash = t
  1369. }
  1370. });
  1371. var y = i.View = function(e) {
  1372. this.cid = s.uniqueId("view"), this._configure(e || {}), this._ensureElement(), this.initialize.apply(this, arguments), this.delegateEvents()
  1373. }
  1374. , b = /^(\S+)\s*(.*)$/
  1375. , w = "model,collection,el,id,attributes,className,tagName".split(",");
  1376. s.extend(y.prototype, a, {
  1377. tagName: "div"
  1378. , $: function(e) {
  1379. return this.$el.find(e)
  1380. }
  1381. , initialize: function() {}
  1382. , render: function() {
  1383. return this
  1384. }
  1385. , remove: function() {
  1386. return this.$el.remove(), this
  1387. }
  1388. , make: function(e, t, n) {
  1389. return e = document.createElement(e), t && o(e)
  1390. .attr(t), n && o(e)
  1391. .html(n), e
  1392. }
  1393. , setElement: function(e, t) {
  1394. return this.$el && this.undelegateEvents(), this.$el = e instanceof o ? e : o(e), this.el = this.$el[0], !1 !== t && this.delegateEvents(), this
  1395. }
  1396. , delegateEvents: function(e) {
  1397. if (e || (e = T(this, "events"))) {
  1398. this.undelegateEvents();
  1399. for (var t in e) {
  1400. var n = e[t];
  1401. s.isFunction(n) || (n = this[e[t]]);
  1402. if (!n) throw Error('Method "' + e[t] + '" does not exist');
  1403. var r = t.match(b)
  1404. , i = r[1]
  1405. , r = r[2]
  1406. , n = s.bind(n, this)
  1407. , i = i + (".delegateEvents" + this.cid);
  1408. "" === r ? this.$el.bind(i, n) : this.$el.delegate(r, i, n)
  1409. }
  1410. }
  1411. }
  1412. , undelegateEvents: function() {
  1413. this.$el.unbind(".delegateEvents" + this.cid)
  1414. }
  1415. , _configure: function(e) {
  1416. this.options && (e = s.extend({}, this.options, e));
  1417. for (var t = 0, n = w.length; t < n; t++) {
  1418. var r = w[t];
  1419. e[r] && (this[r] = e[r])
  1420. }
  1421. this.options = e
  1422. }
  1423. , _ensureElement: function() {
  1424. if (this.el) this.setElement(this.el, !1);
  1425. else {
  1426. var e = T(this, "attributes") || {};
  1427. this.id && (e.id = this.id), this.className && (e["class"] = this.className), this.setElement(this.make(this.tagName, e), !1)
  1428. }
  1429. }
  1430. }), f.extend = l.extend = c.extend = y.extend = function(e, t) {
  1431. var n = x(this, e, t);
  1432. return n.extend = this.extend, n
  1433. };
  1434. var E = {
  1435. create: "POST"
  1436. , update: "PUT"
  1437. , "delete": "DELETE"
  1438. , read: "GET"
  1439. };
  1440. i.sync = function(e, t, n) {
  1441. var r = E[e];
  1442. n || (n = {});
  1443. var u = {
  1444. type: r
  1445. , dataType: "json"
  1446. };
  1447. return n.url || (u.url = T(t, "url") || N()), !n.data && t && ("create" == e || "update" == e) && (u.contentType = "application/json", u.data = JSON.stringify(t.toJSON())), i.emulateJSON && (u.contentType = "application/x-www-form-urlencoded", u.data = u.data ? {
  1448. model: u.data
  1449. } : {}), i.emulateHTTP && ("PUT" === r || "DELETE" === r) && (i.emulateJSON && (u.data._method = r), u.type = "POST", u.beforeSend = function(e) {
  1450. e.setRequestHeader("X-HTTP-Method-Override", r)
  1451. }), "GET" !== u.type && !i.emulateJSON && (u.processData = !1), o.ajax(s.extend(u, n))
  1452. }, i.wrapError = function(e, t, n) {
  1453. return function(r, i) {
  1454. i = r === t ? i : r, e ? e(t, i, n) : t.trigger("error", t, i, n)
  1455. }
  1456. };
  1457. var S = function() {}
  1458. , x = function(e, t, n) {
  1459. var r;
  1460. return r = t && t.hasOwnProperty("constructor") ? t.constructor : function() {
  1461. e.apply(this, arguments)
  1462. }, s.extend(r, e), S.prototype = e.prototype, r.prototype = new S, t && s.extend(r.prototype, t), n && s.extend(r, n), r.prototype.constructor = r, r.__super__ = e.prototype, r
  1463. }
  1464. , T = function(e, t) {
  1465. return !e || !e[t] ? null : s.isFunction(e[t]) ? e[t]() : e[t]
  1466. }
  1467. , N = function() {
  1468. throw Error('A "url" property or function must be specified')
  1469. }
  1470. }.call(this)
  1471. , function() {
  1472. "use strict";
  1473.  
  1474. function t(e) {
  1475. for (var t in e) e.hasOwnProperty(t) && (this[t] = e[t])
  1476. }
  1477. var e = this
  1478. , n = new t;
  1479. e.locache = n, t.prototype.VERSION = "0.2.0", t.prototype.supportsLocalStorage = function() {
  1480. try {
  1481. var e = "___locache___";
  1482. return window.localStorage.setItem(e, e), window.localStorage.getItem(e), window.localStorage.removeItem(e), !0
  1483. } catch (t) {
  1484. return !1
  1485. }
  1486. }(), t.prototype.supportsSessionStorage = function() {
  1487. try {
  1488. var e = "___locache___";
  1489. return window.sessionStorage.setItem(e, e), window.sessionStorage.getItem(e), window.sessionStorage.removeItem(e), !0
  1490. } catch (t) {
  1491. return !1
  1492. }
  1493. }(), t.prototype.supportsNativeJSON = !!window.JSON, t.prototype.cachePrefix = "___locache___", t.prototype.expirePrefix = "___locacheExpire___", t.prototype.backends = {
  1494. local: {
  1495. set: function(e, t) {
  1496. return window.localStorage.setItem(e, t)
  1497. }
  1498. , get: function(e, t) {
  1499. return window.localStorage.getItem(e)
  1500. }
  1501. , remove: function(e) {
  1502. return window.localStorage.removeItem(e)
  1503. }
  1504. , length: function(e) {
  1505. return window.localStorage.length
  1506. }
  1507. , key: function(e) {
  1508. if (e < 0 || e >= this.length()) return;
  1509. return window.localStorage.key(e)
  1510. }
  1511. , enabled: function() {
  1512. return n.supportsLocalStorage
  1513. }
  1514. }
  1515. , session: {
  1516. set: function(e, t) {
  1517. return window.sessionStorage.setItem(e, t)
  1518. }
  1519. , get: function(e, t) {
  1520. return window.sessionStorage.getItem(e)
  1521. }
  1522. , remove: function(e) {
  1523. return window.sessionStorage.removeItem(e)
  1524. }
  1525. , length: function(e) {
  1526. return window.sessionStorage.length
  1527. }
  1528. , key: function(e) {
  1529. if (e < 0 || e >= this.length()) return;
  1530. return window.sessionStorage.key(e)
  1531. }
  1532. , enabled: function() {
  1533. return n.supportsSessionStorage
  1534. }
  1535. }
  1536. }, t.prototype.storage = n.backends.local;
  1537. var r = function() {
  1538. return (new Date)
  1539. .getTime()
  1540. };
  1541. t.prototype.key = function(e) {
  1542. return this.cachePrefix + e
  1543. }, t.prototype.expirekey = function(e) {
  1544. return this.expirePrefix + e
  1545. }, t.prototype.hasExpired = function(e) {
  1546. var t = this.expirekey(e)
  1547. , n = parseInt(this.storage.get(t), 10);
  1548. return n && n < r() ? !0 : !1
  1549. }, t.prototype.set = function(e, t, n) {
  1550. if (!this.storage.enabled() || !e) return;
  1551. var i = this.expirekey(e)
  1552. , s = this.key(e);
  1553. if (n) {
  1554. var o = n * 1e3;
  1555. this.storage.set(i, r() + o)
  1556. }
  1557. t = JSON.stringify(t), this.storage.set(s, t)
  1558. }, t.prototype.get = function(e) {
  1559. if (!this.storage.enabled() || !e) return null;
  1560. if (this.hasExpired(e)) return this.remove(this.key(e)), null;
  1561. var t = this.key(e)
  1562. , n = this.storage.get(t);
  1563. if (n) try {
  1564. return JSON.parse(n)
  1565. } catch (r) {
  1566. return null
  1567. }
  1568. return n
  1569. }, t.prototype.remove = function(e) {
  1570. if (!this.storage.enabled()) return;
  1571. var t = this.expirekey(e)
  1572. , n = this.key(e);
  1573. this.storage.remove(t), this.storage.remove(n)
  1574. }, t.prototype.incr = function(e) {
  1575. if (!this.storage.enabled()) return;
  1576. var t = parseInt(this.get(e), 10);
  1577. return t || (t = 0), t++, this.set(e, t), t
  1578. }, t.prototype.decr = function(e) {
  1579. if (!this.storage.enabled()) return;
  1580. var t = parseInt(this.get(e), 10);
  1581. return t || (t = 0), t--, this.set(e, t), t
  1582. }, t.prototype.setMany = function(e, t) {
  1583. if (!this.storage.enabled()) return;
  1584. for (var n in e) e.hasOwnProperty(n) && this.set(n, e[n], t)
  1585. }, t.prototype.getMany = function(e) {
  1586. var t = {};
  1587. for (var n = 0; n < e.length; n++) this.storage.enabled() ? t[e[n]] = this.get(e[n]) : t[e[n]] = null;
  1588. return t
  1589. }, t.prototype.getManyValues = function(e) {
  1590. var t = [];
  1591. for (var n = 0; n < e.length; n++) this.storage.enabled() ? t.push(this.get(e[n])) : t.push(null);
  1592. return t
  1593. }, t.prototype.removeMany = function(e) {
  1594. if (!this.storage.enabled()) return;
  1595. for (var t = 0; t < e.length; t++) this.remove(e[t])
  1596. }, t.prototype.flush = function() {
  1597. if (!this.storage.enabled()) return;
  1598. var e = this.storage.length()
  1599. , t = this.cachePrefix;
  1600. for (var n = 0; n < e; n++) {
  1601. var r = this.storage.key(n);
  1602. r && r.indexOf(t) === 0 && this.storage.remove(r)
  1603. }
  1604. }, t.prototype.length = function() {
  1605. if (!this.storage.enabled()) return 0;
  1606. var e = 0
  1607. , t = this.storage.length()
  1608. , n = this.cachePrefix;
  1609. for (var r = 0; r < t; r++) this.storage.key(r)
  1610. .indexOf(n) === 0 && e++;
  1611. return e
  1612. }, t.prototype.cleanup = function() {
  1613. if (!this.storage.enabled()) return;
  1614. var e = this.storage.length()
  1615. , t = this.cachePrefix;
  1616. for (var n = 0; n < e; n++) {
  1617. var r = this.storage.key(n);
  1618. if (r && r.indexOf(t) === 0) {
  1619. var i = r.substring(t.length, r.length);
  1620. this.hasExpired(i) && this.remove(i)
  1621. }
  1622. }
  1623. }, t.prototype.createCache = function(e) {
  1624. return new t(e)
  1625. }, n.session = new t({
  1626. storage: n.backends.session
  1627. })
  1628. }.call(this);
  1629. var JSON;
  1630. JSON || (JSON = {})
  1631. , function() {
  1632. function f(e) {
  1633. return e < 10 ? "0" + e : e
  1634. }
  1635.  
  1636. function quote(e) {
  1637. return escapable.lastIndex = 0, escapable.test(e) ? '"' + e.replace(escapable, function(e) {
  1638. var t = meta[e];
  1639. return typeof t == "string" ? t : "\\u" + ("0000" + e.charCodeAt(0)
  1640. .toString(16))
  1641. .slice(-4)
  1642. }) + '"' : '"' + e + '"'
  1643. }
  1644.  
  1645. function str(e, t) {
  1646. var n, r, i, s, o = gap
  1647. , u, a = t[e];
  1648. a && typeof a == "object" && typeof a.toJSON == "function" && (a = a.toJSON(e)), typeof rep == "function" && (a = rep.call(t, e, a));
  1649. switch (typeof a) {
  1650. case "string":
  1651. return quote(a);
  1652. case "number":
  1653. return isFinite(a) ? String(a) : "null";
  1654. case "boolean":
  1655. case "null":
  1656. return String(a);
  1657. case "object":
  1658. if (!a) return "null";
  1659. gap += indent, u = [];
  1660. if (Object.prototype.toString.apply(a) === "[object Array]") {
  1661. s = a.length;
  1662. for (n = 0; n < s; n += 1) u[n] = str(n, a) || "null";
  1663. return i = u.length === 0 ? "[]" : gap ? "[\n" + gap + u.join(",\n" + gap) + "\n" + o + "]" : "[" + u.join(",") + "]", gap = o, i
  1664. }
  1665. if (rep && typeof rep == "object") {
  1666. s = rep.length;
  1667. for (n = 0; n < s; n += 1) typeof rep[n] == "string" && (r = rep[n], i = str(r, a), i && u.push(quote(r) + (gap ? ": " : ":") + i))
  1668. } else
  1669. for (r in a) Object.prototype.hasOwnProperty.call(a, r) && (i = str(r, a), i && u.push(quote(r) + (gap ? ": " : ":") + i));
  1670. return i = u.length === 0 ? "{}" : gap ? "{\n" + gap + u.join(",\n" + gap) + "\n" + o + "}" : "{" + u.join(",") + "}", gap = o, i
  1671. }
  1672. }
  1673. "use strict", typeof Date.prototype.toJSON != "function" && (Date.prototype.toJSON = function(e) {
  1674. return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + f(this.getUTCMonth() + 1) + "-" + f(this.getUTCDate()) + "T" + f(this.getUTCHours()) + ":" + f(this.getUTCMinutes()) + ":" + f(this.getUTCSeconds()) + "Z" : null
  1675. }, String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function(e) {
  1676. return this.valueOf()
  1677. });
  1678. var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g
  1679. , escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g
  1680. , gap, indent, meta = {
  1681. "\b": "\\b"
  1682. , " ": "\\t"
  1683. , "\n": "\\n"
  1684. , "\f": "\\f"
  1685. , "\r": "\\r"
  1686. , '"': '\\"'
  1687. , "\\": "\\\\"
  1688. }
  1689. , rep;
  1690. typeof JSON.stringify != "function" && (JSON.stringify = function(e, t, n) {
  1691. var r;
  1692. gap = "", indent = "";
  1693. if (typeof n == "number")
  1694. for (r = 0; r < n; r += 1) indent += " ";
  1695. else typeof n == "string" && (indent = n);
  1696. rep = t;
  1697. if (!t || typeof t == "function" || typeof t == "object" && typeof t.length == "number") return str("", {
  1698. "": e
  1699. });
  1700. throw new Error("JSON.stringify")
  1701. }), typeof JSON.parse != "function" && (JSON.parse = function(text, reviver) {
  1702. function walk(e, t) {
  1703. var n, r, i = e[t];
  1704. if (i && typeof i == "object")
  1705. for (n in i) Object.prototype.hasOwnProperty.call(i, n) && (r = walk(i, n), r !== undefined ? i[n] = r : delete i[n]);
  1706. return reviver.call(e, t, i)
  1707. }
  1708. var j;
  1709. text = String(text), cx.lastIndex = 0, cx.test(text) && (text = text.replace(cx, function(e) {
  1710. return "\\u" + ("0000" + e.charCodeAt(0)
  1711. .toString(16))
  1712. .slice(-4)
  1713. }));
  1714. if (/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@")
  1715. .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]")
  1716. .replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) return j = eval("(" + text + ")"), typeof reviver == "function" ? walk({
  1717. "": j
  1718. }, "") : j;
  1719. throw new SyntaxError("JSON.parse")
  1720. })
  1721. }(), jQuery.base64 = function(e) {
  1722. function t(e, t) {
  1723. var n = o.indexOf(e.charAt(t));
  1724. if (n === -1) throw "Cannot decode base64";
  1725. return n
  1726. }
  1727.  
  1728. function n(e) {
  1729. var n = 0
  1730. , r, i, o = e.length
  1731. , u = [];
  1732. e = String(e);
  1733. if (o === 0) return e;
  1734. if (o % 4 !== 0) throw "Cannot decode base64";
  1735. e.charAt(o - 1) === s && (n = 1, e.charAt(o - 2) === s && (n = 2), o -= 4);
  1736. for (r = 0; r < o; r += 4) i = t(e, r) << 18 | t(e, r + 1) << 12 | t(e, r + 2) << 6 | t(e, r + 3), u.push(String.fromCharCode(i >> 16, i >> 8 & 255, i & 255));
  1737. switch (n) {
  1738. case 1:
  1739. i = t(e, r) << 18 | t(e, r + 1) << 12 | t(e, r + 2) << 6, u.push(String.fromCharCode(i >> 16, i >> 8 & 255));
  1740. break;
  1741. case 2:
  1742. i = t(e, r) << 18 | t(e, r + 1) << 12, u.push(String.fromCharCode(i >> 16))
  1743. }
  1744. return u.join("")
  1745. }
  1746.  
  1747. function r(e, t) {
  1748. var n = e.charCodeAt(t);
  1749. if (n > 255) throw "INVALID_CHARACTER_ERR: DOM Exception 5";
  1750. return n
  1751. }
  1752.  
  1753. function i(e) {
  1754. if (arguments.length !== 1) throw "SyntaxError: exactly one argument required";
  1755. e = String(e);
  1756. var t, n, i = []
  1757. , u = e.length - e.length % 3;
  1758. if (e.length === 0) return e;
  1759. for (t = 0; t < u; t += 3) n = r(e, t) << 16 | r(e, t + 1) << 8 | r(e, t + 2), i.push(o.charAt(n >> 18)), i.push(o.charAt(n >> 12 & 63)), i.push(o.charAt(n >> 6 & 63)), i.push(o.charAt(n & 63));
  1760. switch (e.length - u) {
  1761. case 1:
  1762. n = r(e, t) << 16, i.push(o.charAt(n >> 18) + o.charAt(n >> 12 & 63) + s + s);
  1763. break;
  1764. case 2:
  1765. n = r(e, t) << 16 | r(e, t + 1) << 8, i.push(o.charAt(n >> 18) + o.charAt(n >> 12 & 63) + o.charAt(n >> 6 & 63) + s)
  1766. }
  1767. return i.join("")
  1768. }
  1769. var s = "="
  1770. , o = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
  1771. , u = "1.0";
  1772. return {
  1773. decode: n
  1774. , encode: i
  1775. , VERSION: u
  1776. }
  1777. }(jQuery), jQuery.easing.jswing = jQuery.easing.swing, jQuery.extend(jQuery.easing, {
  1778. def: "easeOutQuad"
  1779. , swing: function(e, t, n, r, i) {
  1780. return jQuery.easing[jQuery.easing.def](e, t, n, r, i)
  1781. }
  1782. , easeInQuad: function(e, t, n, r, i) {
  1783. return r * (t /= i) * t + n
  1784. }
  1785. , easeOutQuad: function(e, t, n, r, i) {
  1786. return -r * (t /= i) * (t - 2) + n
  1787. }
  1788. , easeInOutQuad: function(e, t, n, r, i) {
  1789. return (t /= i / 2) < 1 ? r / 2 * t * t + n : -r / 2 * (--t * (t - 2) - 1) + n
  1790. }
  1791. , easeInCubic: function(e, t, n, r, i) {
  1792. return r * (t /= i) * t * t + n
  1793. }
  1794. , easeOutCubic: function(e, t, n, r, i) {
  1795. return r * ((t = t / i - 1) * t * t + 1) + n
  1796. }
  1797. , easeInOutCubic: function(e, t, n, r, i) {
  1798. return (t /= i / 2) < 1 ? r / 2 * t * t * t + n : r / 2 * ((t -= 2) * t * t + 2) + n
  1799. }
  1800. , easeInQuart: function(e, t, n, r, i) {
  1801. return r * (t /= i) * t * t * t + n
  1802. }
  1803. , easeOutQuart: function(e, t, n, r, i) {
  1804. return -r * ((t = t / i - 1) * t * t * t - 1) + n
  1805. }
  1806. , easeInOutQuart: function(e, t, n, r, i) {
  1807. return (t /= i / 2) < 1 ? r / 2 * t * t * t * t + n : -r / 2 * ((t -= 2) * t * t * t - 2) + n
  1808. }
  1809. , easeInQuint: function(e, t, n, r, i) {
  1810. return r * (t /= i) * t * t * t * t + n
  1811. }
  1812. , easeOutQuint: function(e, t, n, r, i) {
  1813. return r * ((t = t / i - 1) * t * t * t * t + 1) + n
  1814. }
  1815. , easeInOutQuint: function(e, t, n, r, i) {
  1816. return (t /= i / 2) < 1 ? r / 2 * t * t * t * t * t + n : r / 2 * ((t -= 2) * t * t * t * t + 2) + n
  1817. }
  1818. , easeInSine: function(e, t, n, r, i) {
  1819. return -r * Math.cos(t / i * (Math.PI / 2)) + r + n
  1820. }
  1821. , easeOutSine: function(e, t, n, r, i) {
  1822. return r * Math.sin(t / i * (Math.PI / 2)) + n
  1823. }
  1824. , easeInOutSine: function(e, t, n, r, i) {
  1825. return -r / 2 * (Math.cos(Math.PI * t / i) - 1) + n
  1826. }
  1827. , easeInExpo: function(e, t, n, r, i) {
  1828. return t == 0 ? n : r * Math.pow(2, 10 * (t / i - 1)) + n
  1829. }
  1830. , easeOutExpo: function(e, t, n, r, i) {
  1831. return t == i ? n + r : r * (-Math.pow(2, -10 * t / i) + 1) + n
  1832. }
  1833. , easeInOutExpo: function(e, t, n, r, i) {
  1834. return t == 0 ? n : t == i ? n + r : (t /= i / 2) < 1 ? r / 2 * Math.pow(2, 10 * (t - 1)) + n : r / 2 * (-Math.pow(2, -10 * --t) + 2) + n
  1835. }
  1836. , easeInCirc: function(e, t, n, r, i) {
  1837. return -r * (Math.sqrt(1 - (t /= i) * t) - 1) + n
  1838. }
  1839. , easeOutCirc: function(e, t, n, r, i) {
  1840. return r * Math.sqrt(1 - (t = t / i - 1) * t) + n
  1841. }
  1842. , easeInOutCirc: function(e, t, n, r, i) {
  1843. return (t /= i / 2) < 1 ? -r / 2 * (Math.sqrt(1 - t * t) - 1) + n : r / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + n
  1844. }
  1845. , easeInElastic: function(e, t, n, r, i) {
  1846. var s = 1.70158
  1847. , o = 0
  1848. , u = r;
  1849. if (t == 0) return n;
  1850. if ((t /= i) == 1) return n + r;
  1851. o || (o = i * .3);
  1852. if (u < Math.abs(r)) {
  1853. u = r;
  1854. var s = o / 4
  1855. } else var s = o / (2 * Math.PI) * Math.asin(r / u);
  1856. return -(u * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * i - s) * 2 * Math.PI / o)) + n
  1857. }
  1858. , easeOutElastic: function(e, t, n, r, i) {
  1859. var s = 1.70158
  1860. , o = 0
  1861. , u = r;
  1862. if (t == 0) return n;
  1863. if ((t /= i) == 1) return n + r;
  1864. o || (o = i * .3);
  1865. if (u < Math.abs(r)) {
  1866. u = r;
  1867. var s = o / 4
  1868. } else var s = o / (2 * Math.PI) * Math.asin(r / u);
  1869. return u * Math.pow(2, -10 * t) * Math.sin((t * i - s) * 2 * Math.PI / o) + r + n
  1870. }
  1871. , easeInOutElastic: function(e, t, n, r, i) {
  1872. var s = 1.70158
  1873. , o = 0
  1874. , u = r;
  1875. if (t == 0) return n;
  1876. if ((t /= i / 2) == 2) return n + r;
  1877. o || (o = i * .3 * 1.5);
  1878. if (u < Math.abs(r)) {
  1879. u = r;
  1880. var s = o / 4
  1881. } else var s = o / (2 * Math.PI) * Math.asin(r / u);
  1882. return t < 1 ? -0.5 * u * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * i - s) * 2 * Math.PI / o) + n : u * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * i - s) * 2 * Math.PI / o) * .5 + r + n
  1883. }
  1884. , easeInBack: function(e, t, n, r, i, s) {
  1885. return s == undefined && (s = 1.70158), r * (t /= i) * t * ((s + 1) * t - s) + n
  1886. }
  1887. , easeOutBack: function(e, t, n, r, i, s) {
  1888. return s == undefined && (s = 1.70158), r * ((t = t / i - 1) * t * ((s + 1) * t + s) + 1) + n
  1889. }
  1890. , easeInOutBack: function(e, t, n, r, i, s) {
  1891. return s == undefined && (s = 1.70158), (t /= i / 2) < 1 ? r / 2 * t * t * (((s *= 1.525) + 1) * t - s) + n : r / 2 * ((t -= 2) * t * (((s *= 1.525) + 1) * t + s) + 2) + n
  1892. }
  1893. , easeInBounce: function(e, t, n, r, i) {
  1894. return r - jQuery.easing.easeOutBounce(e, i - t, 0, r, i) + n
  1895. }
  1896. , easeOutBounce: function(e, t, n, r, i) {
  1897. return (t /= i) < 1 / 2.75 ? r * 7.5625 * t * t + n : t < 2 / 2.75 ? r * (7.5625 * (t -= 1.5 / 2.75) * t + .75) + n : t < 2.5 / 2.75 ? r * (7.5625 * (t -= 2.25 / 2.75) * t + .9375) + n : r * (7.5625 * (t -= 2.625 / 2.75) * t + .984375) + n
  1898. }
  1899. , easeInOutBounce: function(e, t, n, r, i) {
  1900. return t < i / 2 ? jQuery.easing.easeInBounce(e, t * 2, 0, r, i) * .5 + n : jQuery.easing.easeOutBounce(e, t * 2 - i, 0, r, i) * .5 + r * .5 + n
  1901. }
  1902. })
  1903. , function(e) {
  1904. e.fn.touchwipe = function(t) {
  1905. var n = {
  1906. min_move_x: 20
  1907. , min_move_y: 20
  1908. , wipeLeft: function() {}
  1909. , wipeRight: function() {}
  1910. , wipeUp: function() {}
  1911. , wipeDown: function() {}
  1912. , preventDefaultEvents: !0
  1913. };
  1914. return t && e.extend(n, t), this.each(function() {
  1915. function i() {
  1916. this.removeEventListener("touchmove", s), e = null, r = !1
  1917. }
  1918.  
  1919. function s(s) {
  1920. n.preventDefaultEvents && s.preventDefault();
  1921. if (r) {
  1922. var o = s.touches[0].pageX
  1923. , u = s.touches[0].pageY
  1924. , a = e - o
  1925. , f = t - u;
  1926. Math.abs(a) >= n.min_move_x ? (i(), a > 0 ? n.wipeLeft() : n.wipeRight()) : Math.abs(f) >= n.min_move_y && (i(), f > 0 ? n.wipeDown() : n.wipeUp())
  1927. }
  1928. }
  1929.  
  1930. function o(n) {
  1931. n.touches.length == 1 && (e = n.touches[0].pageX, t = n.touches[0].pageY, r = !0, this.addEventListener("touchmove", s, !1))
  1932. }
  1933. var e, t, r = !1;
  1934. "ontouchstart" in document.documentElement && this.addEventListener("touchstart", o, !1)
  1935. }), this
  1936. }
  1937. }(jQuery)
  1938. , function(e) {
  1939. function t() {
  1940. var t = e("script:first")
  1941. , n = t.css("color")
  1942. , r = !1;
  1943. if (/^rgba/.test(n)) r = !0;
  1944. else try {
  1945. r = n != t.css("color", "rgba(0, 0, 0, 0.5)")
  1946. .css("color"), t.css("color", n)
  1947. } catch (i) {}
  1948. return r
  1949. }
  1950.  
  1951. function n(t, n, r) {
  1952. var i = "rgb" + (e.support.rgba ? "a" : "") + "(" + parseInt(t[0] + r * (n[0] - t[0]), 10) + "," + parseInt(t[1] + r * (n[1] - t[1]), 10) + "," + parseInt(t[2] + r * (n[2] - t[2]), 10);
  1953. return e.support.rgba && (i += "," + (t && n ? parseFloat(t[3] + r * (n[3] - t[3])) : 1)), i += ")", i
  1954. }
  1955.  
  1956. function r(e) {
  1957. var t, n;
  1958. if (t = /#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})/.exec(e)) n = [parseInt(t[1], 16), parseInt(t[2], 16), parseInt(t[3], 16), 1];
  1959. else if (t = /#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/.exec(e)) n = [parseInt(t[1], 16) * 17, parseInt(t[2], 16) * 17, parseInt(t[3], 16) * 17, 1];
  1960. else if (t = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(e)) n = [parseInt(t[1]), parseInt(t[2]), parseInt(t[3]), 1];
  1961. else if (t = /rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9\.]*)\s*\)/.exec(e)) n = [parseInt(t[1], 10), parseInt(t[2], 10), parseInt(t[3], 10), parseFloat(t[4])];
  1962. return n
  1963. }
  1964. e.extend(!0, e, {
  1965. support: {
  1966. rgba: t()
  1967. }
  1968. });
  1969. var i = ["color", "backgroundColor", "borderBottomColor", "borderLeftColor", "borderRightColor", "borderTopColor", "outlineColor"];
  1970. e.each(i, function(t, i) {
  1971. e.Tween.propHooks[i] = {
  1972. get: function(t) {
  1973. return e(t.elem)
  1974. .css(i)
  1975. }
  1976. , set: function(t) {
  1977. var s = t.elem.style
  1978. , o = r(e(t.elem)
  1979. .css(i))
  1980. , u = r(t.end);
  1981. t.run = function(e) {
  1982. s[i] = n(o, u, e)
  1983. }
  1984. }
  1985. }
  1986. }), e.Tween.propHooks.borderColor = {
  1987. set: function(t) {
  1988. var s = t.elem.style
  1989. , o = []
  1990. , u = i.slice(2, 6);
  1991. e.each(u, function(n, i) {
  1992. o[i] = r(e(t.elem)
  1993. .css(i))
  1994. });
  1995. var a = r(t.end);
  1996. t.run = function(t) {
  1997. e.each(u, function(e, r) {
  1998. s[r] = n(o[r], a, t)
  1999. })
  2000. }
  2001. }
  2002. }
  2003. }(jQuery)
  2004. , function(e) {
  2005. typeof String.prototype.trim == "undefined" && (String.prototype.trim = function() {
  2006. return e.trim(this)
  2007. }), e.fn.dataOrTitle = function() {
  2008. return this.data("title") || this.attr("title") || ""
  2009. }, e.getWrappedObject = function(t, n) {
  2010. if (typeof t == "object") {
  2011. var r = t.__self;
  2012. return r && typeof r == "object" && r.constructor === e ? r : (t.__self = e(t), typeof n == "object" && (t.__self = _.extend(t.__self, n)), t.__self)
  2013. }
  2014. return null
  2015. }, e.fn.switchClass = function(e, t) {
  2016. return this.hasClass(e) ? this.removeClass(e)
  2017. .addClass(t) : this.removeClass(t)
  2018. .addClass(e)
  2019. }, e.fn.wrapEach = function(t, n, r) {
  2020. var i = this
  2021. , s = i.children(n)
  2022. , r = e(r);
  2023. for (var o, u, a = 0, f = s.length; a < f; a++) o = s.eq(a), a % t === 0 ? (u = r.clone(), o.before(u)
  2024. .appendTo(u)) : o.appendTo(u)
  2025. }
  2026. }.call(window, jQuery)
  2027. , function(e) {
  2028. function t() {
  2029. return url = location.href, hashtag = url.indexOf("#prettyPhoto") !== -1 ? decodeURI(url.substring(url.indexOf("#prettyPhoto") + 1, url.length)) : !1, hashtag
  2030. }
  2031.  
  2032. function n() {
  2033. if (typeof theRel == "undefined") return;
  2034. location.hash = theRel + "/" + rel_index + "/"
  2035. }
  2036.  
  2037. function r() {
  2038. location.href.indexOf("#prettyPhoto") !== -1 && (location.hash = "prettyPhoto")
  2039. }
  2040.  
  2041. function i(e, t) {
  2042. e = e.replace(/[\[]/, "\\[")
  2043. .replace(/[\]]/, "\\]");
  2044. var n = "[\\?&]" + e + "=([^&#]*)"
  2045. , r = new RegExp(n)
  2046. , i = r.exec(t);
  2047. return i == null ? "" : i[1]
  2048. }
  2049. e.prettyPhoto = {
  2050. version: "3.1.4"
  2051. }, e.fn.prettyPhoto = function(s) {
  2052. function g() {
  2053. e(".pp_loaderIcon")
  2054. .hide(), projectedTop = scroll_pos.scrollTop + (d / 2 - a.containerHeight / 2), projectedTop < 0 && (projectedTop = 0), $ppt.fadeTo(settings.animation_speed, 1), $pp_pic_holder.find(".pp_content")
  2055. .animate({
  2056. height: a.contentHeight
  2057. , width: a.contentWidth
  2058. }, settings.animation_speed), $pp_pic_holder.animate({
  2059. top: projectedTop
  2060. , left: v / 2 - a.containerWidth / 2 < 0 ? 0 : v / 2 - a.containerWidth / 2
  2061. , width: a.containerWidth
  2062. }, settings.animation_speed, function() {
  2063. $pp_pic_holder.find(".pp_hoverContainer,#fullResImage")
  2064. .height(a.height)
  2065. .width(a.width), $pp_pic_holder.find(".pp_fade")
  2066. .fadeIn(settings.animation_speed), isSet && S(pp_images[set_position]) == "image" ? $pp_pic_holder.find(".pp_hoverContainer")
  2067. .show() : $pp_pic_holder.find(".pp_hoverContainer")
  2068. .hide(), settings.allow_expand && (a.resized ? e("a.pp_expand,a.pp_contract")
  2069. .show() : e("a.pp_expand")
  2070. .hide()), settings.autoplay_slideshow && !m && !f && e.prettyPhoto.startSlideshow(), settings.changepicturecallback(), f = !0
  2071. }), C(), s.ajaxcallback()
  2072. }
  2073.  
  2074. function y(t) {
  2075. $pp_pic_holder.find("#pp_full_res object,#pp_full_res embed")
  2076. .css("visibility", "hidden"), $pp_pic_holder.find(".pp_fade")
  2077. .fadeOut(settings.animation_speed, function() {
  2078. e(".pp_loaderIcon")
  2079. .show(), t()
  2080. })
  2081. }
  2082.  
  2083. function b(t) {
  2084. t > 1 ? e(".pp_nav")
  2085. .show() : e(".pp_nav")
  2086. .hide()
  2087. }
  2088.  
  2089. function w(e, t) {
  2090. resized = !1, E(e, t), imageWidth = e, imageHeight = t;
  2091. if ((p > v || h > d) && doresize && settings.allow_resize && !u) {
  2092. resized = !0, fitting = !1;
  2093. while (!fitting) p > v ? (imageWidth = v - 200, imageHeight = t / e * imageWidth) : h > d ? (imageHeight = d - 200, imageWidth = e / t * imageHeight) : fitting = !0, h = imageHeight, p = imageWidth;
  2094. E(imageWidth, imageHeight), (p > v || h > d) && w(p, h)
  2095. }
  2096. return {
  2097. width: Math.floor(imageWidth)
  2098. , height: Math.floor(imageHeight)
  2099. , containerHeight: Math.floor(h)
  2100. , containerWidth: Math.floor(p) + settings.horizontal_padding * 2
  2101. , contentHeight: Math.floor(l)
  2102. , contentWidth: Math.floor(c)
  2103. , resized: resized
  2104. }
  2105. }
  2106.  
  2107. function E(t, n) {
  2108. t = parseFloat(t), n = parseFloat(n), $pp_details = $pp_pic_holder.find(".pp_details"), $pp_details.width(t), detailsHeight = parseFloat($pp_details.css("marginTop")) + parseFloat($pp_details.css("marginBottom")), $pp_details = $pp_details.clone()
  2109. .addClass(settings.theme)
  2110. .width(t)
  2111. .appendTo(e("body"))
  2112. .css({
  2113. position: "absolute"
  2114. , top: -1e4
  2115. }), detailsHeight += $pp_details.height(), detailsHeight = detailsHeight <= 34 ? 36 : detailsHeight, e.browser.msie && e.browser.version == 7 && (detailsHeight += 8), $pp_details.remove(), $pp_title = $pp_pic_holder.find(".ppt"), $pp_title.width(t), titleHeight = parseFloat($pp_title.css("marginTop")) + parseFloat($pp_title.css("marginBottom")), $pp_title = $pp_title.clone()
  2116. .appendTo(e("body"))
  2117. .css({
  2118. position: "absolute"
  2119. , top: -1e4
  2120. }), titleHeight += $pp_title.height(), $pp_title.remove(), l = n + detailsHeight, c = t, h = l + titleHeight + $pp_pic_holder.find(".pp_top")
  2121. .height() + $pp_pic_holder.find(".pp_bottom")
  2122. .height(), p = t
  2123. }
  2124.  
  2125. function S(e) {
  2126. return e.match(/youtube\.com\/watch/i) || e.match(/youtu\.be/i) ? "youtube" : e.match(/vimeo\.com/i) ? "vimeo" : e.match(/\b.mov\b/i) ? "quicktime" : e.match(/\b.swf\b/i) ? "flash" : e.match(/\biframe=true\b/i) ? "iframe" : e.match(/\bajax=true\b/i) ? "ajax" : e.match(/\bcustom=true\b/i) ? "custom" : e.substr(0, 1) == "#" ? "inline" : "image"
  2127. }
  2128.  
  2129. function x() {
  2130. if (doresize && typeof $pp_pic_holder != "undefined") {
  2131. scroll_pos = T(), contentHeight = $pp_pic_holder.height(), contentwidth = $pp_pic_holder.width(), projectedTop = d / 2 + scroll_pos.scrollTop - contentHeight / 2, projectedTop < 0 && (projectedTop = 0);
  2132. if (contentHeight > d) return;
  2133. $pp_pic_holder.css({
  2134. top: projectedTop
  2135. , left: v / 2 + scroll_pos.scrollLeft - contentwidth / 2
  2136. })
  2137. }
  2138. }
  2139.  
  2140. function T() {
  2141. if (self.pageYOffset) return {
  2142. scrollTop: self.pageYOffset
  2143. , scrollLeft: self.pageXOffset
  2144. };
  2145. if (document.documentElement && document.documentElement.scrollTop) return {
  2146. scrollTop: document.documentElement.scrollTop
  2147. , scrollLeft: document.documentElement.scrollLeft
  2148. };
  2149. if (document.body) return {
  2150. scrollTop: document.body.scrollTop
  2151. , scrollLeft: document.body.scrollLeft
  2152. }
  2153. }
  2154.  
  2155. function N() {
  2156. d = e(window)
  2157. .height(), v = e(window)
  2158. .width(), typeof $pp_overlay != "undefined" && $pp_overlay.height(e(document)
  2159. .height())
  2160. .width(v)
  2161. }
  2162.  
  2163. function C() {
  2164. isSet && settings.overlay_gallery && S(pp_images[set_position]) == "image" && settings.ie6_fallback && (!e.browser.msie || parseInt(e.browser.version) != 6) ? (itemWidth = 57, navWidth = settings.theme == "facebook" || settings.theme == "pp_default" ? 50 : 30, itemsPerPage = Math.floor((a.containerWidth - 100 - navWidth) / itemWidth), itemsPerPage = itemsPerPage < pp_images.length ? itemsPerPage : pp_images.length, totalPage = Math.ceil(pp_images.length / itemsPerPage) - 1, totalPage == 0 ? (navWidth = 0, $pp_gallery.find(".pp_arrow_next,.pp_arrow_previous")
  2165. .hide()) : $pp_gallery.find(".pp_arrow_next,.pp_arrow_previous")
  2166. .show(), galleryWidth = itemsPerPage * itemWidth, fullGalleryWidth = pp_images.length * itemWidth, $pp_gallery.css("margin-left", -(galleryWidth / 2 + navWidth / 2))
  2167. .find("div:first")
  2168. .width(galleryWidth + 5)
  2169. .find("ul")
  2170. .width(fullGalleryWidth)
  2171. .find("li.selected")
  2172. .removeClass("selected"), goToPage = Math.floor(set_position / itemsPerPage) < totalPage ? Math.floor(set_position / itemsPerPage) : totalPage, e.prettyPhoto.changeGalleryPage(goToPage), $pp_gallery_li.filter(":eq(" + set_position + ")")
  2173. .addClass("selected")) : $pp_pic_holder.find(".pp_content")
  2174. .unbind("mouseenter mouseleave")
  2175. }
  2176.  
  2177. function k(t) {
  2178. settings.social_tools && (facebook_like_link = settings.social_tools.replace("{location_href}", encodeURIComponent(location.href))), settings.markup = settings.markup.replace("{pp_social}", ""), e("body")
  2179. .append(settings.markup), $pp_pic_holder = e(".pp_pic_holder"), $ppt = e(".ppt"), $pp_overlay = e("div.pp_overlay");
  2180. if (isSet && settings.overlay_gallery) {
  2181. currentGalleryPage = 0, toInject = "";
  2182. for (var n = 0; n < pp_images.length; n++) pp_images[n].match(/\b(jpg|jpeg|png|gif)\b/gi) ? (classname = "", img_src = pp_images[n]) : (classname = "default", img_src = ""), toInject += "<li class='" + classname + "'><a href='#'><img src='" + img_src + "' width='50' alt='' /></a></li>";
  2183. toInject = settings.gallery_markup.replace(/{gallery}/g, toInject), $pp_pic_holder.find("#pp_full_res")
  2184. .after(toInject), $pp_gallery = e(".pp_pic_holder .pp_gallery"), $pp_gallery_li = $pp_gallery.find("li"), $pp_gallery.find(".pp_arrow_next")
  2185. .click(function() {
  2186. return e.prettyPhoto.changeGalleryPage("next"), e.prettyPhoto.stopSlideshow(), !1
  2187. }), $pp_gallery.find(".pp_arrow_previous")
  2188. .click(function() {
  2189. return e.prettyPhoto.changeGalleryPage("previous"), e.prettyPhoto.stopSlideshow(), !1
  2190. }), $pp_pic_holder.find(".pp_content")
  2191. .hover(function() {
  2192. $pp_pic_holder.find(".pp_gallery:not(.disabled)")
  2193. .fadeIn()
  2194. }, function() {
  2195. $pp_pic_holder.find(".pp_gallery:not(.disabled)")
  2196. .fadeOut()
  2197. }), itemWidth = 57, $pp_gallery_li.each(function(t) {
  2198. e(this)
  2199. .find("a")
  2200. .click(function() {
  2201. return e.prettyPhoto.changePage(t), e.prettyPhoto.stopSlideshow(), !1
  2202. })
  2203. })
  2204. }
  2205. settings.slideshow && ($pp_pic_holder.find(".pp_nav")
  2206. .prepend('<a href="#" class="pp_play">Play</a>'), $pp_pic_holder.find(".pp_nav .pp_play")
  2207. .click(function() {
  2208. return e.prettyPhoto.startSlideshow(), !1
  2209. })), $pp_pic_holder.attr("class", "pp_pic_holder " + settings.theme), $pp_overlay.css({
  2210. opacity: 0
  2211. , height: e(document)
  2212. .height()
  2213. , width: e(window)
  2214. .width()
  2215. })
  2216. .bind("click", function() {
  2217. settings.modal || e.prettyPhoto.close()
  2218. }), e("a.pp_close")
  2219. .bind("click", function() {
  2220. return e.prettyPhoto.close(), !1
  2221. }), settings.allow_expand && e("a.pp_expand")
  2222. .bind("click", function(t) {
  2223. return e(this)
  2224. .hasClass("pp_expand") ? (e(this)
  2225. .removeClass("pp_expand")
  2226. .addClass("pp_contract"), doresize = !1) : (e(this)
  2227. .removeClass("pp_contract")
  2228. .addClass("pp_expand"), doresize = !0), y(function() {
  2229. e.prettyPhoto.open()
  2230. }), !1
  2231. }), $pp_pic_holder.find(".pp_previous, .pp_nav .pp_arrow_previous")
  2232. .bind("click", function() {
  2233. return e.prettyPhoto.changePage("previous"), e.prettyPhoto.stopSlideshow(), !1
  2234. }), $pp_pic_holder.find(".pp_next, .pp_nav .pp_arrow_next")
  2235. .bind("click", function() {
  2236. return e.prettyPhoto.changePage("next"), e.prettyPhoto.stopSlideshow(), !1
  2237. }), x()
  2238. }
  2239. s = jQuery.extend({
  2240. hook: "rel"
  2241. , animation_speed: "fast"
  2242. , ajaxcallback: function() {}
  2243. , slideshow: 5e3
  2244. , autoplay_slideshow: !1
  2245. , opacity: .8
  2246. , show_title: !0
  2247. , allow_resize: !0
  2248. , allow_expand: !0
  2249. , default_width: 500
  2250. , default_height: 344
  2251. , counter_separator_label: "/"
  2252. , theme: "pp_default"
  2253. , horizontal_padding: 20
  2254. , hideflash: !1
  2255. , wmode: "opaque"
  2256. , autoplay: !0
  2257. , modal: !1
  2258. , deeplinking: !0
  2259. , overlay_gallery: !0
  2260. , overlay_gallery_max: 30
  2261. , keyboard_shortcuts: !0
  2262. , changepicturecallback: function() {}
  2263. , callback: function() {}
  2264. , ie6_fallback: !0
  2265. , markup: '<div class="pp_pic_holder"> <div class="ppt">&nbsp;</div> <div class="pp_top"> <div class="pp_left"></div> <div class="pp_middle"></div> <div class="pp_right"></div> </div> <div class="pp_content_container"> <div class="pp_left"> <div class="pp_right"> <div class="pp_content"> <div class="pp_loaderIcon"></div> <div class="pp_fade"> <a href="#" class="pp_expand" title="Expand the image">Expand</a> <div class="pp_hoverContainer"> <a class="pp_next" href="#">next</a> <a class="pp_previous" href="#">previous</a> </div> <div id="pp_full_res"></div> <div class="pp_details"> <div class="pp_nav"> <a href="#" class="pp_arrow_previous">Previous</a> <p class="currentTextHolder">0/0</p> <a href="#" class="pp_arrow_next">Next</a> </div> <p class="pp_description"></p> <div class="pp_social">{pp_social}</div> <a class="pp_close" href="#">Close</a> </div> </div> </div> </div> </div> </div> <div class="pp_bottom"> <div class="pp_left"></div> <div class="pp_middle"></div> <div class="pp_right"></div> </div> </div> <div class="pp_overlay"></div>'
  2266. , gallery_markup: '<div class="pp_gallery"> <a href="#" class="pp_arrow_previous">Previous</a> <div> <ul> {gallery} </ul> </div> <a href="#" class="pp_arrow_next">Next</a> </div>'
  2267. , image_markup: '<img id="fullResImage" src="{path}" />'
  2268. , flash_markup: '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{width}" height="{height}"><param name="wmode" value="{wmode}" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{path}" /><embed src="{path}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="{width}" height="{height}" wmode="{wmode}"></embed></object>'
  2269. , quicktime_markup: '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="{height}" width="{width}"><param name="src" value="{path}"><param name="autoplay" value="{autoplay}"><param name="type" value="video/quicktime"><embed src="{path}" height="{height}" width="{width}" autoplay="{autoplay}" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>'
  2270. , iframe_markup: '<iframe src ="{path}" width="{width}" height="{height}" frameborder="no"></iframe>'
  2271. , inline_markup: '<div class="pp_inline">{content}</div>'
  2272. , custom_markup: ""
  2273. , social_tools: '<div class="twitter"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="facebook"><iframe src="//www.facebook.com/plugins/like.php?locale=en_US&href={location_href}&amp;layout=button_count&amp;show_faces=true&amp;width=500&amp;action=like&amp;font&amp;colorscheme=light&amp;height=23" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:23px;" allowTransparency="true"></iframe></div>'
  2274. }, s);
  2275. var o = this
  2276. , u = !1
  2277. , a, f, l, c, h, p, d = e(window)
  2278. .height()
  2279. , v = e(window)
  2280. .width()
  2281. , m;
  2282. return doresize = !0, scroll_pos = T(), e(window)
  2283. .unbind("resize.prettyphoto")
  2284. .bind("resize.prettyphoto", function() {
  2285. x(), N()
  2286. }), s.keyboard_shortcuts && e(document)
  2287. .unbind("keydown.prettyphoto")
  2288. .bind("keydown.prettyphoto", function(t) {
  2289. if (typeof $pp_pic_holder != "undefined" && $pp_pic_holder.is(":visible")) switch (t.keyCode) {
  2290. case 37:
  2291. e.prettyPhoto.changePage("previous"), t.preventDefault();
  2292. break;
  2293. case 39:
  2294. e.prettyPhoto.changePage("next"), t.preventDefault();
  2295. break;
  2296. case 27:
  2297. settings.modal || e.prettyPhoto.close(), t.preventDefault()
  2298. }
  2299. }), e.prettyPhoto.initialize = function() {
  2300. return settings = s, settings.theme == "pp_default" && (settings.horizontal_padding = 16), settings.ie6_fallback && e.browser.msie && parseInt(e.browser.version) == 6 && (settings.theme = "light_square"), theRel = e(this)
  2301. .attr(settings.hook), galleryRegExp = /\[(?:.*)\]/, isSet = galleryRegExp.exec(theRel) ? !0 : !1, pp_images = isSet ? jQuery.map(o, function(t, n) {
  2302. if (e(t)
  2303. .attr(settings.hook)
  2304. .indexOf(theRel) != -1) return e(t)
  2305. .attr("href")
  2306. }) : e.makeArray(e(this)
  2307. .attr("href")), pp_titles = isSet ? jQuery.map(o, function(t, n) {
  2308. if (e(t)
  2309. .attr(settings.hook)
  2310. .indexOf(theRel) != -1) return e(t)
  2311. .find("img")
  2312. .attr("alt") ? e(t)
  2313. .find("img")
  2314. .attr("alt") : ""
  2315. }) : e.makeArray(e(this)
  2316. .find("img")
  2317. .attr("alt")), pp_descriptions = isSet ? jQuery.map(o, function(t, n) {
  2318. if (e(t)
  2319. .attr(settings.hook)
  2320. .indexOf(theRel) != -1) return e(t)
  2321. .dataOrTitle("title") ? e(t)
  2322. .dataOrTitle("title") : ""
  2323. }) : e.makeArray(e(this)
  2324. .dataOrTitle("title")), pp_images.length > settings.overlay_gallery_max && (settings.overlay_gallery = !1), set_position = jQuery.inArray(e(this)
  2325. .attr("href"), pp_images), rel_index = isSet ? set_position : e("a[" + settings.hook + "^='" + theRel + "']")
  2326. .index(e(this)), k(this), settings.allow_resize && e(window)
  2327. .bind("scroll.prettyphoto", function() {
  2328. x()
  2329. }), e.prettyPhoto.open(), !1
  2330. }, e.prettyPhoto.open = function(t) {
  2331. return typeof settings == "undefined" && (settings = s, e.browser.msie && e.browser.version == 6 && (settings.theme = "light_square"), pp_images = e.makeArray(arguments[0]), pp_titles = arguments[1] ? e.makeArray(arguments[1]) : e.makeArray(""), pp_descriptions = arguments[2] ? e.makeArray(arguments[2]) : e.makeArray(""), isSet = pp_images.length > 1 ? !0 : !1, set_position = arguments[3] ? arguments[3] : 0, k(t.target)), e.browser.msie && e.browser.version == 6 && e("select")
  2332. .css("visibility", "hidden"), settings.hideflash && e("object,embed,iframe[src*=youtube],iframe[src*=vimeo]")
  2333. .css("visibility", "hidden"), b(e(pp_images)
  2334. .size()), e(".pp_loaderIcon")
  2335. .show(), settings.deeplinking && n(), settings.social_tools && (facebook_like_link = settings.social_tools.replace("{location_href}", encodeURIComponent(location.href)), $pp_pic_holder.find(".pp_social")
  2336. .html(facebook_like_link)), $ppt.is(":hidden") && $ppt.css("opacity", 0)
  2337. .show(), $pp_overlay.show()
  2338. .fadeTo(settings.animation_speed, settings.opacity), $pp_pic_holder.find(".currentTextHolder")
  2339. .text(set_position + 1 + settings.counter_separator_label + e(pp_images)
  2340. .size()), typeof pp_descriptions[set_position] != "undefined" && pp_descriptions[set_position] != "" ? $pp_pic_holder.find(".pp_description")
  2341. .show()
  2342. .html(unescape(pp_descriptions[set_position])) : $pp_pic_holder.find(".pp_description")
  2343. .hide(), movie_width = parseFloat(i("width", pp_images[set_position])) ? i("width", pp_images[set_position]) : settings.default_width.toString(), movie_height = parseFloat(i("height", pp_images[set_position])) ? i("height", pp_images[set_position]) : settings.default_height.toString(), u = !1, movie_height.indexOf("%") != -1 && (movie_height = parseFloat(e(window)
  2344. .height() * parseFloat(movie_height) / 100 - 150), u = !0), movie_width.indexOf("%") != -1 && (movie_width = parseFloat(e(window)
  2345. .width() * parseFloat(movie_width) / 100 - 150), u = !0), $pp_pic_holder.fadeIn(function() {
  2346. settings.show_title && pp_titles[set_position] != "" && typeof pp_titles[set_position] != "undefined" ? $ppt.html(unescape(pp_titles[set_position])) : $ppt.html("&nbsp;"), imgPreloader = "", skipInjection = !1;
  2347. switch (S(pp_images[set_position])) {
  2348. case "image":
  2349. imgPreloader = new Image, nextImage = new Image, isSet && set_position < e(pp_images)
  2350. .size() - 1 && (nextImage.src = pp_images[set_position + 1]), prevImage = new Image, isSet && pp_images[set_position - 1] && (prevImage.src = pp_images[set_position - 1]), $pp_pic_holder.find("#pp_full_res")[0].innerHTML = settings.image_markup.replace(/{path}/g, pp_images[set_position]), imgPreloader.onload = function() {
  2351. a = w(imgPreloader.width, imgPreloader.height), g()
  2352. }, imgPreloader.onerror = function() {
  2353. alert("Image cannot be loaded. Make sure the path is correct and image exist."), e.prettyPhoto.close()
  2354. }, imgPreloader.src = pp_images[set_position];
  2355. break;
  2356. case "youtube":
  2357. a = w(movie_width, movie_height), movie_id = i("v", pp_images[set_position]), movie_id == "" && (movie_id = pp_images[set_position].split("youtu.be/"), movie_id = movie_id[1], movie_id.indexOf("?") > 0 && (movie_id = movie_id.substr(0, movie_id.indexOf("?"))), movie_id.indexOf("&") > 0 && (movie_id = movie_id.substr(0, movie_id.indexOf("&")))), movie = "http://www.youtube.com/embed/" + movie_id, i("rel", pp_images[set_position]) ? movie += "?rel=" + i("rel", pp_images[set_position]) : movie += "?rel=1", settings.autoplay && (movie += "&autoplay=1"), toInject = settings.iframe_markup.replace(/{width}/g, a.width)
  2358. .replace(/{height}/g, a.height)
  2359. .replace(/{wmode}/g, settings.wmode)
  2360. .replace(/{path}/g, movie);
  2361. break;
  2362. case "vimeo":
  2363. a = w(movie_width, movie_height), movie_id = pp_images[set_position];
  2364. var t = /http:\/\/(www\.)?vimeo.com\/(\d+)/
  2365. , n = movie_id.match(t);
  2366. movie = "http://player.vimeo.com/video/" + n[2] + "?title=0&amp;byline=0&amp;portrait=0", settings.autoplay && (movie += "&autoplay=1;"), vimeo_width = a.width + "/embed/?moog_width=" + a.width, toInject = settings.iframe_markup.replace(/{width}/g, vimeo_width)
  2367. .replace(/{height}/g, a.height)
  2368. .replace(/{path}/g, movie);
  2369. break;
  2370. case "quicktime":
  2371. a = w(movie_width, movie_height), a.height += 15, a.contentHeight += 15, a.containerHeight += 15, toInject = settings.quicktime_markup.replace(/{width}/g, a.width)
  2372. .replace(/{height}/g, a.height)
  2373. .replace(/{wmode}/g, settings.wmode)
  2374. .replace(/{path}/g, pp_images[set_position])
  2375. .replace(/{autoplay}/g, settings.autoplay);
  2376. break;
  2377. case "flash":
  2378. a = w(movie_width, movie_height), flash_vars = pp_images[set_position], flash_vars = flash_vars.substring(pp_images[set_position].indexOf("flashvars") + 10, pp_images[set_position].length), filename = pp_images[set_position], filename = filename.substring(0, filename.indexOf("?")), toInject = settings.flash_markup.replace(/{width}/g, a.width)
  2379. .replace(/{height}/g, a.height)
  2380. .replace(/{wmode}/g, settings.wmode)
  2381. .replace(/{path}/g, filename + "?" + flash_vars);
  2382. break;
  2383. case "iframe":
  2384. a = w(movie_width, movie_height), frame_url = pp_images[set_position], frame_url = frame_url.substr(0, frame_url.indexOf("iframe") - 1), toInject = settings.iframe_markup.replace(/{width}/g, a.width)
  2385. .replace(/{height}/g, a.height)
  2386. .replace(/{path}/g, frame_url);
  2387. break;
  2388. case "ajax":
  2389. doresize = !1, a = w(movie_width, movie_height), doresize = !0, skipInjection = !0, e.get(pp_images[set_position], function(e) {
  2390. toInject = settings.inline_markup.replace(/{content}/g, e), $pp_pic_holder.find("#pp_full_res")[0].innerHTML = toInject, g()
  2391. });
  2392. break;
  2393. case "custom":
  2394. a = w(movie_width, movie_height), toInject = settings.custom_markup;
  2395. break;
  2396. case "inline":
  2397. myClone = e(pp_images[set_position])
  2398. .clone()
  2399. .append('<br clear="all" />')
  2400. .css({
  2401. width: settings.default_width
  2402. })
  2403. .wrapInner('<div id="pp_full_res"><div class="pp_inline"></div></div>')
  2404. .appendTo(e("body"))
  2405. .show(), doresize = !1, a = w(e(myClone)
  2406. .width(), e(myClone)
  2407. .height()), doresize = !0, e(myClone)
  2408. .remove(), toInject = settings.inline_markup.replace(/{content}/g, e(pp_images[set_position])
  2409. .html())
  2410. }!imgPreloader && !skipInjection && ($pp_pic_holder.find("#pp_full_res")[0].innerHTML = toInject, g())
  2411. }), !1
  2412. }, e.prettyPhoto.changePage = function(t) {
  2413. currentGalleryPage = 0, t == "previous" ? (set_position--, set_position < 0 && (set_position = e(pp_images)
  2414. .size() - 1)) : t == "next" ? (set_position++, set_position > e(pp_images)
  2415. .size() - 1 && (set_position = 0)) : set_position = t, rel_index = set_position, doresize || (doresize = !0), settings.allow_expand && e(".pp_contract")
  2416. .removeClass("pp_contract")
  2417. .addClass("pp_expand"), y(function() {
  2418. e.prettyPhoto.open()
  2419. })
  2420. }, e.prettyPhoto.changeGalleryPage = function(e) {
  2421. e == "next" ? (currentGalleryPage++, currentGalleryPage > totalPage && (currentGalleryPage = 0)) : e == "previous" ? (currentGalleryPage--, currentGalleryPage < 0 && (currentGalleryPage = totalPage)) : currentGalleryPage = e, slide_speed = e == "next" || e == "previous" ? settings.animation_speed : 0, slide_to = currentGalleryPage * itemsPerPage * itemWidth, $pp_gallery.find("ul")
  2422. .animate({
  2423. left: -slide_to
  2424. }, slide_speed)
  2425. }, e.prettyPhoto.startSlideshow = function() {
  2426. typeof m == "undefined" ? ($pp_pic_holder.find(".pp_play")
  2427. .unbind("click")
  2428. .removeClass("pp_play")
  2429. .addClass("pp_pause")
  2430. .click(function() {
  2431. return e.prettyPhoto.stopSlideshow(), !1
  2432. }), m = setInterval(e.prettyPhoto.startSlideshow, settings.slideshow)) : e.prettyPhoto.changePage("next")
  2433. }, e.prettyPhoto.stopSlideshow = function() {
  2434. $pp_pic_holder.find(".pp_pause")
  2435. .unbind("click")
  2436. .removeClass("pp_pause")
  2437. .addClass("pp_play")
  2438. .click(function() {
  2439. return e.prettyPhoto.startSlideshow(), !1
  2440. }), clearInterval(m), m = undefined
  2441. }, e.prettyPhoto.close = function() {
  2442. if ($pp_overlay.is(":animated")) return;
  2443. e.prettyPhoto.stopSlideshow(), $pp_pic_holder.stop()
  2444. .find("object,embed")
  2445. .css("visibility", "hidden"), e("div.pp_pic_holder,div.ppt,.pp_fade")
  2446. .fadeOut(settings.animation_speed, function() {
  2447. e(this)
  2448. .remove()
  2449. }), $pp_overlay.fadeOut(settings.animation_speed, function() {
  2450. e.browser.msie && e.browser.version == 6 && e("select")
  2451. .css("visibility", "visible"), settings.hideflash && e("object,embed,iframe[src*=youtube],iframe[src*=vimeo]")
  2452. .css("visibility", "visible"), e(this)
  2453. .remove(), e(window)
  2454. .unbind("scroll.prettyphoto"), r(), settings.callback(), doresize = !0, f = !1, delete settings
  2455. })
  2456. }, !pp_alreadyInitialized && t() && (pp_alreadyInitialized = !0, hashIndex = t(), hashRel = hashIndex, hashIndex = hashIndex.substring(hashIndex.indexOf("/") + 1, hashIndex.length - 1), hashRel = hashRel.substring(0, hashRel.indexOf("/")), setTimeout(function() {
  2457. e("a[" + s.hook + "^='" + hashRel + "']:eq(" + hashIndex + ")")
  2458. .trigger("click")
  2459. }, 50)), this.unbind("click.prettyphoto")
  2460. .bind("click.prettyphoto", e.prettyPhoto.initialize)
  2461. }
  2462. }(jQuery);
  2463. var pp_alreadyInitialized = !1
  2464. , hex_chr = "0123456789abcdef";
  2465. (function(e) {
  2466. e.extend(e.fn, {
  2467. validate: function(t) {
  2468. if (this.length) {
  2469. var n = e.data(this[0], "validator");
  2470. return n ? n : (this.attr("novalidate", "novalidate"), n = new e.validator(t, this[0]), e.data(this[0], "validator", n), n.settings.onsubmit && (t = this.find("input, button"), t.filter(".cancel")
  2471. .click(function() {
  2472. n.cancelSubmit = !0
  2473. }), n.settings.submitHandler && t.filter(":submit")
  2474. .click(function() {
  2475. n.submitButton = this
  2476. }), this.submit(function(t) {
  2477. function r() {
  2478. if (n.settings.submitHandler) {
  2479. if (n.submitButton) var t = e("<input type='hidden'/>")
  2480. .attr("name", n.submitButton.name)
  2481. .val(n.submitButton.value)
  2482. .appendTo(n.currentForm);
  2483. return n.settings.submitHandler.call(n, n.currentForm), n.submitButton && t.remove(), !1
  2484. }
  2485. return !0
  2486. }
  2487. return n.settings.debug && t.preventDefault(), n.cancelSubmit ? (n.cancelSubmit = !1, r()) : n.form() ? n.pendingRequest ? (n.formSubmitted = !0, !1) : r() : (n.focusInvalid(), !1)
  2488. })), n)
  2489. }
  2490. t && t.debug && window.console && console.warn("nothing selected, can't validate, returning nothing")
  2491. }
  2492. , valid: function() {
  2493. if (e(this[0])
  2494. .is("form")) return this.validate()
  2495. .form();
  2496. var t = !0
  2497. , n = e(this[0].form)
  2498. .validate();
  2499. return this.each(function() {
  2500. t &= n.element(this)
  2501. }), t
  2502. }
  2503. , removeAttrs: function(t) {
  2504. var n = {}
  2505. , r = this;
  2506. return e.each(t.split(/\s/), function(e, t) {
  2507. n[t] = r.attr(t), r.removeAttr(t)
  2508. }), n
  2509. }
  2510. , rules: function(t, n) {
  2511. var r = this[0];
  2512. if (t) {
  2513. var i = e.data(r.form, "validator")
  2514. .settings
  2515. , s = i.rules
  2516. , o = e.validator.staticRules(r);
  2517. switch (t) {
  2518. case "add":
  2519. e.extend(o, e.validator.normalizeRule(n)), s[r.name] = o, n.messages && (i.messages[r.name] = e.extend(i.messages[r.name], n.messages));
  2520. break;
  2521. case "remove":
  2522. if (!n) return delete s[r.name], o;
  2523. var u = {};
  2524. return e.each(n.split(/\s/), function(e, t) {
  2525. u[t] = o[t], delete o[t]
  2526. }), u
  2527. }
  2528. }
  2529. return r = e.validator.normalizeRules(e.extend({}, e.validator.metadataRules(r), e.validator.classRules(r), e.validator.attributeRules(r), e.validator.staticRules(r)), r), r.required && (i = r.required, delete r.required, r = e.extend({
  2530. required: i
  2531. }, r)), r
  2532. }
  2533. }), e.extend(e.expr[":"], {
  2534. blank: function(t) {
  2535. return !e.trim("" + t.value)
  2536. }
  2537. , filled: function(t) {
  2538. return !!e.trim("" + t.value)
  2539. }
  2540. , unchecked: function(e) {
  2541. return !e.checked
  2542. }
  2543. }), e.validator = function(t, n) {
  2544. this.settings = e.extend(!0, {}, e.validator.defaults, t), this.currentForm = n, this.init()
  2545. }, e.validator.format = function(t, n) {
  2546. return arguments.length == 1 ? function() {
  2547. var n = e.makeArray(arguments);
  2548. return n.unshift(t), e.validator.format.apply(this, n)
  2549. } : (arguments.length > 2 && n.constructor != Array && (n = e.makeArray(arguments)
  2550. .slice(1)), n.constructor != Array && (n = [n]), e.each(n, function(e, n) {
  2551. t = t.replace(RegExp("\\{" + e + "\\}", "g"), n)
  2552. }), t)
  2553. }, e.extend(e.validator, {
  2554. defaults: {
  2555. messages: {}
  2556. , groups: {}
  2557. , rules: {}
  2558. , errorClass: "error"
  2559. , validClass: "valid"
  2560. , errorElement: "label"
  2561. , focusInvalid: !0
  2562. , errorContainer: e([])
  2563. , errorLabelContainer: e([])
  2564. , onsubmit: !0
  2565. , ignore: ":hidden"
  2566. , ignoreTitle: !1
  2567. , onfocusin: function(e) {
  2568. this.lastActive = e, this.settings.focusCleanup && !this.blockFocusCleanup && (this.settings.unhighlight && this.settings.unhighlight.call(this, e, this.settings.errorClass, this.settings.validClass), this.addWrapper(this.errorsFor(e))
  2569. .hide())
  2570. }
  2571. , onfocusout: function(e) {
  2572. !this.checkable(e) && (e.name in this.submitted || !this.optional(e)) && this.element(e)
  2573. }
  2574. , onkeyup: function(e) {
  2575. (e.name in this.submitted || e == this.lastElement) && this.element(e)
  2576. }
  2577. , onclick: function(e) {
  2578. e.name in this.submitted ? this.element(e) : e.parentNode.name in this.submitted && this.element(e.parentNode)
  2579. }
  2580. , highlight: function(t, n, r) {
  2581. t.type === "radio" ? this.findByName(t.name)
  2582. .addClass(n)
  2583. .removeClass(r) : e(t)
  2584. .addClass(n)
  2585. .removeClass(r)
  2586. }
  2587. , unhighlight: function(t, n, r) {
  2588. t.type === "radio" ? this.findByName(t.name)
  2589. .removeClass(n)
  2590. .addClass(r) : e(t)
  2591. .removeClass(n)
  2592. .addClass(r)
  2593. }
  2594. }
  2595. , setDefaults: function(t) {
  2596. e.extend(e.validator.defaults, t)
  2597. }
  2598. , messages: {
  2599. required: "This field is required."
  2600. , remote: "Please fix this field."
  2601. , email: "Please enter a valid email address."
  2602. , url: "Please enter a valid URL."
  2603. , date: "Please enter a valid date."
  2604. , dateISO: "Please enter a valid date (ISO)."
  2605. , number: "Please enter a valid number."
  2606. , digits: "Please enter only digits."
  2607. , creditcard: "Please enter a valid credit card number."
  2608. , equalTo: "Please enter the same value again."
  2609. , accept: "Please enter a value with a valid extension."
  2610. , maxlength: e.validator.format("Please enter no more than {0} characters.")
  2611. , minlength: e.validator.format("Please enter at least {0} characters.")
  2612. , rangelength: e.validator.format("Please enter a value between {0} and {1} characters long.")
  2613. , range: e.validator.format("Please enter a value between {0} and {1}.")
  2614. , max: e.validator.format("Please enter a value less than or equal to {0}.")
  2615. , min: e.validator.format("Please enter a value greater than or equal to {0}.")
  2616. }
  2617. , autoCreateRanges: !1
  2618. , prototype: {
  2619. init: function() {
  2620. function t(t) {
  2621. var n = e.data(this[0].form, "validator")
  2622. , r = "on" + t.type.replace(/^validate/, "");
  2623. n.settings[r] && n.settings[r].call(n, this[0], t)
  2624. }
  2625. this.labelContainer = e(this.settings.errorLabelContainer), this.errorContext = this.labelContainer.length && this.labelContainer || e(this.currentForm), this.containers = e(this.settings.errorContainer)
  2626. .add(this.settings.errorLabelContainer), this.submitted = {}, this.valueCache = {}, this.pendingRequest = 0, this.pending = {}, this.invalid = {}, this.reset();
  2627. var n = this.groups = {};
  2628. e.each(this.settings.groups, function(t, r) {
  2629. e.each(r.split(/\s/), function(e, r) {
  2630. n[r] = t
  2631. })
  2632. });
  2633. var r = this.settings.rules;
  2634. e.each(r, function(t, n) {
  2635. r[t] = e.validator.normalizeRule(n)
  2636. }), e(this.currentForm)
  2637. .validateDelegate("[type='text'], [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'] ", "focusin focusout keyup", t)
  2638. .validateDelegate("[type='radio'], [type='checkbox'], select, option", "click", t), this.settings.invalidHandler && e(this.currentForm)
  2639. .bind("invalid-form.validate", this.settings.invalidHandler)
  2640. }
  2641. , form: function() {
  2642. return this.checkForm(), e.extend(this.submitted, this.errorMap), this.invalid = e.extend({}, this.errorMap), this.valid() || e(this.currentForm)
  2643. .triggerHandler("invalid-form", [this]), this.showErrors(), this.valid()
  2644. }
  2645. , checkForm: function() {
  2646. this.prepareForm();
  2647. for (var e = 0, t = this.currentElements = this.elements(); t[e]; e++) this.check(t[e]);
  2648. return this.valid()
  2649. }
  2650. , element: function(t) {
  2651. this.lastElement = t = this.validationTargetFor(this.clean(t)), this.prepareElement(t), this.currentElements = e(t);
  2652. var n = this.check(t);
  2653. return n ? delete this.invalid[t.name] : this.invalid[t.name] = !0, this.numberOfInvalids() || (this.toHide = this.toHide.add(this.containers)), this.showErrors(), n
  2654. }
  2655. , showErrors: function(t) {
  2656. if (t) {
  2657. e.extend(this.errorMap, t), this.errorList = [];
  2658. for (var n in t) this.errorList.push({
  2659. message: t[n]
  2660. , element: this.findByName(n)[0]
  2661. });
  2662. this.successList = e.grep(this.successList, function(e) {
  2663. return !(e.name in t)
  2664. })
  2665. }
  2666. this.settings.showErrors ? this.settings.showErrors.call(this, this.errorMap, this.errorList) : this.defaultShowErrors()
  2667. }
  2668. , resetForm: function() {
  2669. e.fn.resetForm && e(this.currentForm)
  2670. .resetForm(), this.submitted = {}, this.lastElement = null, this.prepareForm(), this.hideErrors(), this.elements()
  2671. .removeClass(this.settings.errorClass)
  2672. }
  2673. , numberOfInvalids: function() {
  2674. return this.objectLength(this.invalid)
  2675. }
  2676. , objectLength: function(e) {
  2677. var t = 0
  2678. , n;
  2679. for (n in e) t++;
  2680. return t
  2681. }
  2682. , hideErrors: function() {
  2683. this.addWrapper(this.toHide)
  2684. .hide()
  2685. }
  2686. , valid: function() {
  2687. return this.size() == 0
  2688. }
  2689. , size: function() {
  2690. return this.errorList.length
  2691. }
  2692. , focusInvalid: function() {
  2693. if (this.settings.focusInvalid) try {
  2694. e(this.findLastActive() || this.errorList.length && this.errorList[0].element || [])
  2695. .filter(":visible")
  2696. .focus()
  2697. .trigger("focusin")
  2698. } catch (t) {}
  2699. }
  2700. , findLastActive: function() {
  2701. var t = this.lastActive;
  2702. return t && e.grep(this.errorList, function(e) {
  2703. return e.element.name == t.name
  2704. })
  2705. .length == 1 && t
  2706. }
  2707. , elements: function() {
  2708. var t = this
  2709. , n = {};
  2710. return e(this.currentForm)
  2711. .find("input, select, textarea")
  2712. .not(":submit, :reset, :image, [disabled]")
  2713. .not(this.settings.ignore)
  2714. .filter(function() {
  2715. return !this.name && t.settings.debug && window.console && console.error("%o has no name assigned", this), this.name in n || !t.objectLength(e(this)
  2716. .rules()) ? !1 : n[this.name] = !0
  2717. })
  2718. }
  2719. , clean: function(t) {
  2720. return e(t)[0]
  2721. }
  2722. , errors: function() {
  2723. return e(this.settings.errorElement + "." + this.settings.errorClass, this.errorContext)
  2724. }
  2725. , reset: function() {
  2726. this.successList = [], this.errorList = [], this.errorMap = {}, this.toShow = e([]), this.toHide = e([]), this.currentElements = e([])
  2727. }
  2728. , prepareForm: function() {
  2729. this.reset(), this.toHide = this.errors()
  2730. .add(this.containers)
  2731. }
  2732. , prepareElement: function(e) {
  2733. this.reset(), this.toHide = this.errorsFor(e)
  2734. }
  2735. , check: function(t) {
  2736. t = this.validationTargetFor(this.clean(t));
  2737. var n = e(t)
  2738. .rules()
  2739. , r = !1
  2740. , i;
  2741. for (i in n) {
  2742. var s = {
  2743. method: i
  2744. , parameters: n[i]
  2745. };
  2746. try {
  2747. var o = e.validator.methods[i].call(this, t.value.replace(/\r/g, ""), t, s.parameters);
  2748. if (o == "dependency-mismatch") r = !0;
  2749. else {
  2750. r = !1;
  2751. if (o == "pending") {
  2752. this.toHide = this.toHide.not(this.errorsFor(t));
  2753. return
  2754. }
  2755. if (!o) return this.formatAndAdd(t, s), !1
  2756. }
  2757. } catch (u) {
  2758. throw this.settings.debug && window.console && console.log("exception occured when checking element " + t.id + ", check the '" + s.method + "' method", u), u
  2759. }
  2760. }
  2761. if (!r) return this.objectLength(n) && this.successList.push(t), !0
  2762. }
  2763. , customMetaMessage: function(t, n) {
  2764. if (e.metadata) {
  2765. var r = this.settings.meta ? e(t)
  2766. .metadata()[this.settings.meta] : e(t)
  2767. .metadata();
  2768. return r && r.messages && r.messages[n]
  2769. }
  2770. }
  2771. , customMessage: function(e, t) {
  2772. var n = this.settings.messages[e];
  2773. return n && (n.constructor == String ? n : n[t])
  2774. }
  2775. , findDefined: function() {
  2776. for (var e = 0; e < arguments.length; e++)
  2777. if (arguments[e] !== undefined) return arguments[e]
  2778. }
  2779. , defaultMessage: function(t, n) {
  2780. return this.findDefined(this.customMessage(t.name, n), this.customMetaMessage(t, n), !this.settings.ignoreTitle && t.title || undefined, e.validator.messages[n], "<strong>Warning: No message defined for " + t.name + "</strong>")
  2781. }
  2782. , formatAndAdd: function(e, t) {
  2783. var n = this.defaultMessage(e, t.method)
  2784. , r = /\$?\{(\d+)\}/g;
  2785. typeof n == "function" ? n = n.call(this, t.parameters, e) : r.test(n) && (n = jQuery.format(n.replace(r, "{$1}"), t.parameters)), this.errorList.push({
  2786. message: n
  2787. , element: e
  2788. }), this.errorMap[e.name] = n, this.submitted[e.name] = n
  2789. }
  2790. , addWrapper: function(e) {
  2791. return this.settings.wrapper && (e = e.add(e.parent(this.settings.wrapper))), e
  2792. }
  2793. , defaultShowErrors: function() {
  2794. for (var e = 0; this.errorList[e]; e++) {
  2795. var t = this.errorList[e];
  2796. this.settings.highlight && this.settings.highlight.call(this, t.element, this.settings.errorClass, this.settings.validClass), this.showLabel(t.element, t.message)
  2797. }
  2798. this.errorList.length && (this.toShow = this.toShow.add(this.containers));
  2799. if (this.settings.success)
  2800. for (e = 0; this.successList[e]; e++) this.showLabel(this.successList[e]);
  2801. if (this.settings.unhighlight) {
  2802. e = 0;
  2803. for (t = this.validElements(); t[e]; e++) this.settings.unhighlight.call(this, t[e], this.settings.errorClass, this.settings.validClass)
  2804. }
  2805. this.toHide = this.toHide.not(this.toShow), this.hideErrors(), this.addWrapper(this.toShow)
  2806. .show()
  2807. }
  2808. , validElements: function() {
  2809. return this.currentElements.not(this.invalidElements())
  2810. }
  2811. , invalidElements: function() {
  2812. return e(this.errorList)
  2813. .map(function() {
  2814. return this.element
  2815. })
  2816. }
  2817. , showLabel: function(t, n) {
  2818. var r = this.errorsFor(t);
  2819. r.length ? (r.removeClass(this.settings.validClass)
  2820. .addClass(this.settings.errorClass), r.attr("generated") && r.html(n)) : (r = e("<" + this.settings.errorElement + "/>")
  2821. .attr({
  2822. "for": this.idOrName(t)
  2823. , generated: !0
  2824. })
  2825. .addClass(this.settings.errorClass)
  2826. .html(n || ""), this.settings.wrapper && (r = r.hide()
  2827. .show()
  2828. .wrap("<" + this.settings.wrapper + "/>")
  2829. .parent()), this.labelContainer.append(r)
  2830. .length || (this.settings.errorPlacement ? this.settings.errorPlacement(r, e(t)) : r.insertAfter(t))), !n && this.settings.success && (r.text(""), typeof this.settings.success == "string" ? r.addClass(this.settings.success) : this.settings.success(r)), this.toShow = this.toShow.add(r)
  2831. }
  2832. , errorsFor: function(t) {
  2833. var n = this.idOrName(t);
  2834. return this.errors()
  2835. .filter(function() {
  2836. return e(this)
  2837. .attr("for") == n
  2838. })
  2839. }
  2840. , idOrName: function(e) {
  2841. return this.groups[e.name] || (this.checkable(e) ? e.name : e.id || e.name)
  2842. }
  2843. , validationTargetFor: function(e) {
  2844. return this.checkable(e) && (e = this.findByName(e.name)
  2845. .not(this.settings.ignore)[0]), e
  2846. }
  2847. , checkable: function(e) {
  2848. return /radio|checkbox/i.test(e.type)
  2849. }
  2850. , findByName: function(t) {
  2851. var n = this.currentForm;
  2852. return e(document.getElementsByName(t))
  2853. .map(function(e, r) {
  2854. return r.form == n && r.name == t && r || null
  2855. })
  2856. }
  2857. , getLength: function(t, n) {
  2858. switch (n.nodeName.toLowerCase()) {
  2859. case "select":
  2860. return e("option:selected", n)
  2861. .length;
  2862. case "input":
  2863. if (this.checkable(n)) return this.findByName(n.name)
  2864. .filter(":checked")
  2865. .length
  2866. }
  2867. return t.length
  2868. }
  2869. , depend: function(e, t) {
  2870. return this.dependTypes[typeof e] ? this.dependTypes[typeof e](e, t) : !0
  2871. }
  2872. , dependTypes: {
  2873. "boolean": function(e) {
  2874. return e
  2875. }
  2876. , string: function(t, n) {
  2877. return !!e(t, n.form)
  2878. .length
  2879. }
  2880. , "function": function(e, t) {
  2881. return e(t)
  2882. }
  2883. }
  2884. , optional: function(t) {
  2885. return !e.validator.methods.required.call(this, e.trim(t.value), t) && "dependency-mismatch"
  2886. }
  2887. , startRequest: function(e) {
  2888. this.pending[e.name] || (this.pendingRequest++, this.pending[e.name] = !0)
  2889. }
  2890. , stopRequest: function(t, n) {
  2891. this.pendingRequest--, this.pendingRequest < 0 && (this.pendingRequest = 0), delete this.pending[t.name], n && this.pendingRequest == 0 && this.formSubmitted && this.form() ? (e(this.currentForm)
  2892. .submit(), this.formSubmitted = !1) : !n && this.pendingRequest == 0 && this.formSubmitted && (e(this.currentForm)
  2893. .triggerHandler("invalid-form", [this]), this.formSubmitted = !1)
  2894. }
  2895. , previousValue: function(t) {
  2896. return e.data(t, "previousValue") || e.data(t, "previousValue", {
  2897. old: null
  2898. , valid: !0
  2899. , message: this.defaultMessage(t, "remote")
  2900. })
  2901. }
  2902. }
  2903. , classRuleSettings: {
  2904. required: {
  2905. required: !0
  2906. }
  2907. , email: {
  2908. email: !0
  2909. }
  2910. , url: {
  2911. url: !0
  2912. }
  2913. , date: {
  2914. date: !0
  2915. }
  2916. , dateISO: {
  2917. dateISO: !0
  2918. }
  2919. , dateDE: {
  2920. dateDE: !0
  2921. }
  2922. , number: {
  2923. number: !0
  2924. }
  2925. , numberDE: {
  2926. numberDE: !0
  2927. }
  2928. , digits: {
  2929. digits: !0
  2930. }
  2931. , creditcard: {
  2932. creditcard: !0
  2933. }
  2934. }
  2935. , addClassRules: function(t, n) {
  2936. t.constructor == String ? this.classRuleSettings[t] = n : e.extend(this.classRuleSettings, t)
  2937. }
  2938. , classRules: function(t) {
  2939. var n = {};
  2940. return (t = e(t)
  2941. .attr("class")) && e.each(t.split(" "), function() {
  2942. this in e.validator.classRuleSettings && e.extend(n, e.validator.classRuleSettings[this])
  2943. }), n
  2944. }
  2945. , attributeRules: function(t) {
  2946. var n = {};
  2947. t = e(t);
  2948. for (var r in e.validator.methods) {
  2949. var i;
  2950. (i = r === "required" && typeof e.fn.prop == "function" ? t.prop(r) : t.attr(r)) ? n[r] = i: t[0].getAttribute("type") === r && (n[r] = !0)
  2951. }
  2952. return n.maxlength && /-1|2147483647|524288/.test(n.maxlength) && delete n.maxlength, n
  2953. }
  2954. , metadataRules: function(t) {
  2955. if (!e.metadata) return {};
  2956. var n = e.data(t.form, "validator")
  2957. .settings.meta;
  2958. return n ? e(t)
  2959. .metadata()[n] : e(t)
  2960. .metadata()
  2961. }
  2962. , staticRules: function(t) {
  2963. var n = {}
  2964. , r = e.data(t.form, "validator");
  2965. return r.settings.rules && (n = e.validator.normalizeRule(r.settings.rules[t.name]) || {}), n
  2966. }
  2967. , normalizeRules: function(t, n) {
  2968. return e.each(t, function(r, i) {
  2969. if (i === !1) delete t[r];
  2970. else if (i.param || i.depends) {
  2971. var s = !0;
  2972. switch (typeof i.depends) {
  2973. case "string":
  2974. s = !!e(i.depends, n.form)
  2975. .length;
  2976. break;
  2977. case "function":
  2978. s = i.depends.call(n, n)
  2979. }
  2980. s ? t[r] = i.param !== undefined ? i.param : !0 : delete t[r]
  2981. }
  2982. }), e.each(t, function(r, i) {
  2983. t[r] = e.isFunction(i) ? i(n) : i
  2984. }), e.each(["minlength", "maxlength", "min", "max"], function() {
  2985. t[this] && (t[this] = Number(t[this]))
  2986. }), e.each(["rangelength", "range"], function() {
  2987. t[this] && (t[this] = [Number(t[this][0]), Number(t[this][1])])
  2988. }), e.validator.autoCreateRanges && (t.min && t.max && (t.range = [t.min, t.max], delete t.min, delete t.max), t.minlength && t.maxlength && (t.rangelength = [t.minlength, t.maxlength], delete t.minlength, delete t.maxlength)), t.messages && delete t.messages, t
  2989. }
  2990. , normalizeRule: function(t) {
  2991. if (typeof t == "string") {
  2992. var n = {};
  2993. e.each(t.split(/\s/), function() {
  2994. n[this] = !0
  2995. }), t = n
  2996. }
  2997. return t
  2998. }
  2999. , addMethod: function(t, n, r) {
  3000. e.validator.methods[t] = n, e.validator.messages[t] = r != undefined ? r : e.validator.messages[t], n.length < 3 && e.validator.addClassRules(t, e.validator.normalizeRule(t))
  3001. }
  3002. , methods: {
  3003. required: function(t, n, r) {
  3004. if (!this.depend(r, n)) return "dependency-mismatch";
  3005. switch (n.nodeName.toLowerCase()) {
  3006. case "select":
  3007. return (t = e(n)
  3008. .val()) && t.length > 0;
  3009. case "input":
  3010. if (this.checkable(n)) return this.getLength(t, n) > 0;
  3011. default:
  3012. return e.trim(t)
  3013. .length > 0
  3014. }
  3015. }
  3016. , remote: function(t, n, r) {
  3017. if (this.optional(n)) return "dependency-mismatch";
  3018. var i = this.previousValue(n);
  3019. this.settings.messages[n.name] || (this.settings.messages[n.name] = {}), i.originalMessage = this.settings.messages[n.name].remote, this.settings.messages[n.name].remote = i.message, r = typeof r == "string" && {
  3020. url: r
  3021. } || r;
  3022. if (this.pending[n.name]) return "pending";
  3023. if (i.old === t) return i.valid;
  3024. i.old = t;
  3025. var s = this;
  3026. this.startRequest(n);
  3027. var o = {};
  3028. return o[n.name] = t, e.ajax(e.extend(!0, {
  3029. url: r
  3030. , mode: "abort"
  3031. , port: "validate" + n.name
  3032. , dataType: "json"
  3033. , data: o
  3034. , success: function(r) {
  3035. s.settings.messages[n.name].remote = i.originalMessage;
  3036. var o = r === !0;
  3037. if (o) {
  3038. var u = s.formSubmitted;
  3039. s.prepareElement(n), s.formSubmitted = u, s.successList.push(n), s.showErrors()
  3040. } else u = {}, r = r || s.defaultMessage(n, "remote"), u[n.name] = i.message = e.isFunction(r) ? r(t) : r, s.showErrors(u);
  3041. i.valid = o, s.stopRequest(n, o)
  3042. }
  3043. }, r)), "pending"
  3044. }
  3045. , minlength: function(t, n, r) {
  3046. return this.optional(n) || this.getLength(e.trim(t), n) >= r
  3047. }
  3048. , maxlength: function(t, n, r) {
  3049. return this.optional(n) || this.getLength(e.trim(t), n) <= r
  3050. }
  3051. , rangelength: function(t, n, r) {
  3052. return t = this.getLength(e.trim(t), n), this.optional(n) || t >= r[0] && t <= r[1]
  3053. }
  3054. , min: function(e, t, n) {
  3055. return this.optional(t) || e >= n
  3056. }
  3057. , max: function(e, t, n) {
  3058. return this.optional(t) || e <= n
  3059. }
  3060. , range: function(e, t, n) {
  3061. return this.optional(t) || e >= n[0] && e <= n[1]
  3062. }
  3063. , email: function(e, t) {
  3064. return this.optional(t) || /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(e)
  3065. }
  3066. , url: function(e, t) {
  3067. return this.optional(t) || /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(e)
  3068. }
  3069. , date: function(e, t) {
  3070. return this.optional(t) || !/Invalid|NaN/.test(new Date(e))
  3071. }
  3072. , dateISO: function(e, t) {
  3073. return this.optional(t) || /^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(e)
  3074. }
  3075. , number: function(e, t) {
  3076. return this.optional(t) || /^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(e)
  3077. }
  3078. , digits: function(e, t) {
  3079. return this.optional(t) || /^\d+$/.test(e)
  3080. }
  3081. , creditcard: function(e, t) {
  3082. if (this.optional(t)) return "dependency-mismatch";
  3083. if (/[^0-9 -]+/.test(e)) return !1;
  3084. var n = 0
  3085. , r = 0
  3086. , i = !1;
  3087. e = e.replace(/\D/g, "");
  3088. for (var s = e.length - 1; s >= 0; s--) r = e.charAt(s), r = parseInt(r, 10), i && (r *= 2) > 9 && (r -= 9), n += r, i = !i;
  3089. return n % 10 == 0
  3090. }
  3091. , accept: function(e, t, n) {
  3092. return n = typeof n == "string" ? n.replace(/,/g, "|") : "png|jpe?g|gif", this.optional(t) || e.match(RegExp(".(" + n + ")$", "i"))
  3093. }
  3094. , equalTo: function(t, n, r) {
  3095. return r = e(r)
  3096. .unbind(".validate-equalTo")
  3097. .bind("blur.validate-equalTo", function() {
  3098. e(n)
  3099. .valid()
  3100. }), t == r.val()
  3101. }
  3102. }
  3103. }), e.format = e.validator.format
  3104. })(jQuery)
  3105. , function(e) {
  3106. var t = {};
  3107. if (e.ajaxPrefilter) e.ajaxPrefilter(function(e, n, r) {
  3108. n = e.port, e.mode == "abort" && (t[n] && t[n].abort(), t[n] = r)
  3109. });
  3110. else {
  3111. var n = e.ajax;
  3112. e.ajax = function(r) {
  3113. var i = ("port" in r ? r : e.ajaxSettings)
  3114. .port;
  3115. return ("mode" in r ? r : e.ajaxSettings)
  3116. .mode == "abort" ? (t[i] && t[i].abort(), t[i] = n.apply(this, arguments)) : n.apply(this, arguments)
  3117. }
  3118. }
  3119. }(jQuery)
  3120. , function(e) {
  3121. !jQuery.event.special.focusin && !jQuery.event.special.focusout && document.addEventListener && e.each({
  3122. focus: "focusin"
  3123. , blur: "focusout"
  3124. }, function(t, n) {
  3125. function r(t) {
  3126. return t = e.event.fix(t), t.type = n, e.event.handle.call(this, t)
  3127. }
  3128. e.event.special[n] = {
  3129. setup: function() {
  3130. this.addEventListener(t, r, !0)
  3131. }
  3132. , teardown: function() {
  3133. this.removeEventListener(t, r, !0)
  3134. }
  3135. , handler: function(t) {
  3136. return arguments[0] = e.event.fix(t), arguments[0].type = n, e.event.handle.apply(this, arguments)
  3137. }
  3138. }
  3139. }), e.extend(e.fn, {
  3140. validateDelegate: function(t, n, r) {
  3141. return this.bind(n, function(n) {
  3142. var i = e(n.target);
  3143. if (i.is(t)) return r.apply(i, arguments)
  3144. })
  3145. }
  3146. })
  3147. }(jQuery)
  3148. , function(e, t) {
  3149. function s(e) {
  3150. return Core.vars.html.hasClass(e)
  3151. }
  3152. var n = /#debug$/.test(t.location + "") && console && console.log instanceof Function;
  3153. Backbone.Events.emit = Backbone.Events.trigger;
  3154. var r = _.extend({}, Backbone.Events)
  3155. , i = {};
  3156. t.Core = {
  3157. vars: {
  3158. window: e(t)
  3159. }
  3160. , colors: {}
  3161. , classes: {}
  3162. , on: function(e, t, n) {
  3163. return r.on(e, t, n)
  3164. }
  3165. , once: function(e, t, n) {
  3166. var i = function() {
  3167. t.apply(this, arguments), r.off(e, i)
  3168. };
  3169. return r.on(e, i, n)
  3170. }
  3171. , emit: function() {
  3172. return r.emit.apply(r, arguments)
  3173. }
  3174. , debug: function() {
  3175. n && console.log(this.util.format.apply(null, arguments))
  3176. }
  3177. , setVar: function(e, t) {
  3178. this.vars[e] = t
  3179. }
  3180. , getVar: function(e) {
  3181. return this.vars[e]
  3182. }
  3183. , eventEmitter: function() {
  3184. return _.extend({}, Backbone.Events)
  3185. }
  3186. , mobile: {
  3187. isIphone: function() {
  3188. return s("iphone")
  3189. }
  3190. , isIpad: function() {
  3191. return s("ipad")
  3192. }
  3193. , isAndroid: function() {
  3194. return s("android")
  3195. }
  3196. }
  3197. , initialize: function() {
  3198. this.emit(":ready"), this.emit("ready"), this.emit("ready:")
  3199. }
  3200. }
  3201. }(jQuery, window)
  3202. , function(e, t) {
  3203. function i(t) {
  3204. var n = 0
  3205. , r = t.length;
  3206. this.data = t, this.reset = function() {
  3207. n = 0
  3208. }, this.get = function(i) {
  3209. return n = (n + i) % r, n < 0 && (n = (r + n) % r), t.eq === e.fn.eq ? t.eq(n) : t[n]
  3210. }
  3211. }
  3212. var n = {
  3213. commaSplit: /(\s+)?,(\s+)?/g
  3214. , dash: /(-)+/g
  3215. , booleanVal: /^(true|false)$/i
  3216. , numberVal: /^[0-9]+$/
  3217. , nullVal: /^null$/i
  3218. }
  3219. , r;
  3220. t.util = {
  3221. format: _.string.sprintf
  3222. , camelize: function(e) {
  3223. return (r || (r = _.string.camelize))
  3224. .call(null, "-" + e)
  3225. }
  3226. , typecast: function(e) {
  3227. return typeof e == "string" ? (e = e.trim(), n.booleanVal.test(e) ? e.toLowerCase() == "true" : n.numberVal.test(e) ? parseInt(e, 10) : n.nullVal.test(e) ? null : e == "undefined" ? undefined : e) : e
  3228. }
  3229. , getConfig: function(r, i) {
  3230. var s = {}
  3231. , o = (typeof r == "string" ? e(r) : r)
  3232. .data(i || "config");
  3233. if (o) {
  3234. o = o.split(n.commaSplit);
  3235. for (var u, a = 0, f = o.length; a < f; a++) u = o[a], u && (u = u.trim()) && (u = u.split(":")) && (s[u[0]] = t.util.typecast(u[1]));
  3236. return s
  3237. }
  3238. return s
  3239. }
  3240. , createCycle: function(e) {
  3241. return new i(e)
  3242. }
  3243. , vendorPrefix: function(t) {
  3244. var n = "";
  3245. return e.browser.webkit ? n = "-webkit-" : e.browser.mozilla ? n = "-moz-" : e.browser.msie ? n = "-ms-" : e.browser.opera && (n = "-o-"), n + t
  3246. }
  3247. }
  3248. }(jQuery, window.Core)
  3249. , function(e, t) {
  3250. function r(e) {
  3251. return e ? (e = e.split(","), new google.maps.LatLng(parseFloat(e[0]), parseFloat(e[1]))) : null
  3252. }
  3253. t.on("ready", function() {
  3254. var n = 1;
  3255. e(".google-map")
  3256. .each(function(r, i) {
  3257. var s = e.getWrappedObject(
  3258. i);
  3259. s.addClass("google-map-" + n), s.data("index", n);
  3260. var o = s.find("span.map-data")
  3261. .html()
  3262. .trim();
  3263. o = o.slice(0, o.lastIndexOf("}") + 1);
  3264. var u = JSON.parse(o)
  3265. , a = s.find(".infobox-content");
  3266. a.length > 0 && (u.contentString = a.html()), n++, t.maps.create(s, u)
  3267. })
  3268. });
  3269. var n;
  3270. t.maps = {
  3271. create: function(i, s) {
  3272. var o = t.mobile.isIphone();
  3273. n = n || t.vars.body || e("body"), s = _.extend({
  3274. latLong: "48.858391,2.294083"
  3275. , mapType: "ROADMAP"
  3276. , zoom: 16
  3277. , contentTitle: ""
  3278. , contentTitleLink: ""
  3279. , contentTooltip: ""
  3280. , contentString: ""
  3281. , contentWidth: 250
  3282. , allowFullScreen: !0
  3283. , extraOptions: {}
  3284. }, s || {});
  3285. var u = r(s.latLong)
  3286. , a = _.extend({
  3287. zoom: s.zoom
  3288. , scrollwheel: !1
  3289. , center: u
  3290. , mapTypeId: google.maps.MapTypeId[s.mapType]
  3291. }, s.extraOptions)
  3292. , f = new google.maps.Map(i.get(0), a);
  3293. if (s.contentTitle && s.contentString) {
  3294. var l = s.contentTitleLink ? t.util.format('<h3><a class="title" href="%s">%s</a></h3>\n%s', s.contentTitleLink, s.contentTitle, s.contentString) : t.util.format("<h3>%s</h3>\n%s", s.contentTitle, s.contentString)
  3295. , c = new google.maps.InfoWindow({
  3296. maxWidth: s.contentWidth
  3297. , content: l
  3298. })
  3299. , h = new google.maps.Marker({
  3300. title: s.contentTooltip || s.contentTitle
  3301. , position: u
  3302. , map: f
  3303. });
  3304. google.maps.event.addListener(h, "click", function() {
  3305. c.open(f, h)
  3306. })
  3307. }
  3308. var p = t.eventEmitter();
  3309. t.ui.resizeEvent.call(p, i, "resize"), p.on("resize", function(e) {
  3310. google.maps.event.trigger(f, "resize"), f.setCenter(u)
  3311. });
  3312. if (s.allowFullScreen && !o) {
  3313. var d = e('<span class="fw-button">Full Screen</span>');
  3314. d.data("parent", i);
  3315. var v = {
  3316. top: 60
  3317. , right: 5
  3318. };
  3319. d.css(v)
  3320. .css({
  3321. display: "block"
  3322. , padding: "0 8px"
  3323. , position: "absolute"
  3324. , height: "20px"
  3325. , lineHeight: "20px"
  3326. , background: "white"
  3327. , border: "solid 1px #707a84"
  3328. , boxShadow: "0 2px 4px rgba(0,0,0,0.39)"
  3329. , zIndex: 999999999
  3330. , fontFamily: "Arial, sans-serif"
  3331. , textRendering: "none"
  3332. , fontSize: "12px"
  3333. , userSelect: "none"
  3334. , webkitUserSelect: "none"
  3335. , mozUserSelect: "none"
  3336. });
  3337. var m = f.getStreetView();
  3338. google.maps.event.addListener(m, "visible_changed", function() {
  3339. m.getVisible() ? d.css({
  3340. top: 2
  3341. , right: 34
  3342. }) : d.css(v)
  3343. }), t.vars.modernBrowser ? d.hover(function(n) {
  3344. var r = e.getWrappedObject(this);
  3345. switch (n.type) {
  3346. case "mouseenter":
  3347. r.css({
  3348. cursor: "pointer"
  3349. , background: t.util.vendorPrefix("linear-gradient(top, white, #e6e6e6)")
  3350. , color: "black"
  3351. });
  3352. break;
  3353. case "mouseleave":
  3354. r.css({
  3355. cursor: "default"
  3356. , background: "white"
  3357. , color: "#323232"
  3358. })
  3359. }
  3360. }) : d.hover(function(t) {
  3361. var n = e.getWrappedObject(this);
  3362. switch (t.type) {
  3363. case "mouseenter":
  3364. n.css({
  3365. cursor: "pointer"
  3366. });
  3367. break;
  3368. case "mouseleave":
  3369. n.css({
  3370. cursor: "default"
  3371. })
  3372. }
  3373. }), d.click(function(t) {
  3374. var r = e.getWrappedObject(this)
  3375. , s = r.data("parent")
  3376. , o = s.data("index");
  3377. i.hasClass("full-screen") ? (r.html("Full Screen"), i.removeClass("full-screen"), n.unbind("keyup", g), e("section.google-map.full-width")
  3378. .not(".google-map" + o)
  3379. .show()) : (r.html("Normal"), i.addClass("full-screen"), i.css("width: 100% !important;"), n.keyup(g), e("section.google-map.full-width")
  3380. .not(".google-map-" + o)
  3381. .hide()), p.emit("resize")
  3382. });
  3383. var g = function(e) {
  3384. e.keyCode === 27 && d.click()
  3385. };
  3386. i.append(d)
  3387. }
  3388. return i.data("map", f), i
  3389. }
  3390. }
  3391. }(jQuery, window.Core)
  3392. , function(e, t) {
  3393. function n() {
  3394. o(), r(), s()
  3395. }
  3396.  
  3397. function r() {
  3398. var n = e(".refineslide");
  3399. if (n.length > 0) {
  3400. t.getVar("body")
  3401. .css({
  3402. "-webkit-backface-visibility": "hidden"
  3403. });
  3404. var r = document.root + "/core/js/jquery.refineslide.min.js";
  3405. head.js(r)
  3406. .ready(function() {
  3407. n.each(function(n, r) {
  3408. var i = e.getWrappedObject(r)
  3409. , s, o = 0
  3410. , u = t.util.getConfig(i.find("ul.rs-slider"), "options");
  3411. u.fallback3d = "sliceV", u.keyNav = !1, u.onInit = function() {
  3412. var n = this.slider
  3413. , r = [];
  3414. for (var s = 0; s < n.totalSlides; s++) r.push('<li data-index="' + s + '"></li>');
  3415. r = e('<ul class="controls hfloat">' + r.join("\n") + "</ul><!-- .controls -->");
  3416. for (s = 0; s < n.totalSlides; s++) {
  3417. var u = r.clone();
  3418. u.find("> li:eq(" + s + ")")
  3419. .addClass("active"), a.find(".slider-meta:eq(" + s + ")")
  3420. .append(u)
  3421. }
  3422. a.find(".slider-meta ul.controls li")
  3423. .click(function() {
  3424. var t = e.getWrappedObject(this)
  3425. , r = t.data("index")
  3426. , i = r > o;
  3427. n.transition(r, i), o = r
  3428. });
  3429. var f = t.getVar("body")
  3430. , l = function(e) {
  3431. e.keyCode == 37 ? n.prev() : e.keyCode == 39 && n.next()
  3432. };
  3433. i.hover(function(e) {
  3434. switch (e.type) {
  3435. case "mouseenter":
  3436. f.bind("keyup", l);
  3437. break;
  3438. case "mouseleave":
  3439. f.unbind("keyup", l)
  3440. }
  3441. }), i.touchwipe({
  3442. wipeLeft: function() {
  3443. n.next()
  3444. }
  3445. , wipeRight: function() {
  3446. n.prev()
  3447. }
  3448. , min_move_x: 50
  3449. , preventDefaultEvents: !1
  3450. })
  3451. }, u.onChange = function() {
  3452. var e = this.slider
  3453. , t = e.$currentSlide
  3454. , n = t.__meta || (t.__meta = t.find(".slider-meta"));
  3455. o = parseInt(t.attr("class")
  3456. .split("-")[2]), (s = n)
  3457. .fadeOut(e.settings.transitionDuration)
  3458. }, u.afterChange = function() {
  3459. s.show()
  3460. }, u.controls = "arrows", u.keyNav = !1;
  3461. var a = i.find("> ul.rs-slider");
  3462. a.refineSlide(u)
  3463. })
  3464. })
  3465. }
  3466. }
  3467.  
  3468. function i(e) {
  3469. return _.extend({
  3470. effect: "fade"
  3471. , slices: 8
  3472. , boxCols: 8
  3473. , boxRows: 4
  3474. , animSpeed: 500
  3475. , pauseTime: 3e3
  3476. , startSlide: 0
  3477. , directionNav: !0
  3478. , directionNavHide: !0
  3479. , controlNav: !0
  3480. , controlNavThumbs: !1
  3481. , pauseOnHover: !0
  3482. , manualAdvance: !0
  3483. }, e || {})
  3484. }
  3485.  
  3486. function s() {
  3487. var n = t.getVar("body")
  3488. .find(".slider .images")
  3489. , r = []
  3490. , s = [];
  3491. n.each(function(t, n) {
  3492. var i = e.getWrappedObject(n);
  3493. i.find("img")
  3494. .length > 1 && r.push(t)
  3495. });
  3496. if (r.length > 0) {
  3497. var o = document.root + "/core/js/jquery.nivo-slider.min.js";
  3498. head.js(o)
  3499. .ready(function() {
  3500. n.each(function(n, s) {
  3501. if (r.indexOf(n) >= 0) {
  3502. var o = e.getWrappedObject(s)
  3503. , u = o.find("> img.slide")
  3504. , a = o.siblings(".slider-meta")
  3505. , f = a.find("ul.controls")
  3506. , l = t.util.getConfig(o, "nivo-options")
  3507. , c = i(l);
  3508. c.beforeChange = function() {
  3509. var e = E.currentSlide + 1;
  3510. e < 0 ? e = b - 1 : e == b && (e = 0);
  3511. var t = g[e];
  3512. t.description ? S.removeClass("no-desc") : S.addClass("no-desc"), x.text(t.title), T.text(t.description), x.attr("href", t.url), T.attr("href", t.url), w.eq(e)
  3513. .addClass("active")
  3514. .siblings(".active")
  3515. .removeClass("active")
  3516. }, o.nivoSlider(c), o.find(".nivo-slice, .nivo-main-image")
  3517. .live("hover", function(t) {
  3518. var n = g[E.currentSlide]
  3519. , r = e.getWrappedObject(this);
  3520. if (r.data("done") || !n.url) return;
  3521. r.is(".nivo-slice") ? r.find("> img")
  3522. .wrap('<a href="' + n.url + '"></a>') : r.wrap('<a href="' + n.url + '"></a>'), r.data("done", !0)
  3523. });
  3524. var h = t.getVar("body")
  3525. , p = o.find("a.nivo-nextNav")
  3526. , d = o.find("a.nivo-prevNav");
  3527. if (p.length > 0 && d.length > 0) {
  3528. o.touchwipe({
  3529. wipeLeft: function() {
  3530. p.trigger("click")
  3531. }
  3532. , wipeRight: function() {
  3533. d.trigger("click")
  3534. }
  3535. , min_move_x: 50
  3536. , preventDefaultEvents: !1
  3537. });
  3538. var v = function(e) {
  3539. e.keyCode == 37 ? d.trigger("click") : e.keyCode == 39 && p.trigger("click")
  3540. };
  3541. o.parent()
  3542. .hover(function(e) {
  3543. switch (e.type) {
  3544. case "mouseenter":
  3545. h.bind("keyup", v);
  3546. break;
  3547. case "mouseleave":
  3548. h.unbind("keyup", v)
  3549. }
  3550. })
  3551. }
  3552. var m = o.siblings(".nivo-controlNav")
  3553. .find("a.nivo-control")
  3554. , g = [];
  3555. o.find("img")
  3556. .each(function(t, n) {
  3557. var r = e.getWrappedObject(n);
  3558. g.push({
  3559. url: r.data("permalink")
  3560. , title: r.data("title")
  3561. , description: r.data("description")
  3562. })
  3563. });
  3564. for (var y, b = m.length, n = 0; n < b; n++) y = n === 0 ? ' class="active"' : "", f.append("<li" + y + ' data-index="' + n + '"></li>');
  3565. var w = f.find("> li")
  3566. , E = o.data("nivo:vars")
  3567. , S = a.find("> .info")
  3568. , x = S.find("> h3 > a")
  3569. , T = S.find("> small > a");
  3570. f.find("li")
  3571. .click(function() {
  3572. E.running || m.eq(e.getWrappedObject(this)
  3573. .data("index"))
  3574. .trigger("click")
  3575. }), a.fadeIn(1500)
  3576. }
  3577. })
  3578. })
  3579. }
  3580. }
  3581.  
  3582. function o() {
  3583. var n = []
  3584. , r = []
  3585. , i = e(".unique-slider")
  3586. .each(function(i, s) {
  3587. var o = s.__self = e(s)
  3588. , u = o.data("slider-manager");
  3589. n.indexOf(u) === -1 && (n.push(u), r.push(document.root + t.util.format("/core/js/core.slider.%s.js", u)))
  3590. });
  3591. if (r.length === 0) return;
  3592. head.js(r)
  3593. .ready(function() {
  3594. i.each(function(e, n) {
  3595. var r = n.__self
  3596. , i = r.data("slider-manager")
  3597. , s = t.util.camelize(i + "-slider")
  3598. , o = t.classes[s];
  3599. new o(r)
  3600. })
  3601. })
  3602. }
  3603.  
  3604. function u() {
  3605. var n = e("#header");
  3606. t.setVar("html", e("html")), t.setVar("body", e("body")), t.setVar("topbar", e("#topbar")), t.setVar("header", n), t.setVar("footer", e("footer[role=contentinfo]")), t.setVar("social", n.find("ul.social-icons")), t.setVar("navigation", n.find("ul.navigation")), t.setVar("oldBrowser", t.vars.html.hasClass("ie8")), t.setVar("modernBrowser", !t.vars.oldBrowser)
  3607. }
  3608.  
  3609. function a() {
  3610. c(), h(), p(), d(), v(), m(), g(), y(), b()
  3611. }
  3612.  
  3613. function f() {
  3614. var n = t.getVar("body");
  3615. n.find("section.block > .mobile-behavior")
  3616. .each(function(t, n) {
  3617. var r = e.getWrappedObject(this);
  3618. if (r.find("article.one-third.column")
  3619. .length > 0) {
  3620. r.removeClass(".mobile-behavior")
  3621. .removeAttr("data-mobile-behavior");
  3622. return
  3623. }
  3624. var i = r.data("mobile-behavior");
  3625. switch (i) {
  3626. case "mobile-dual":
  3627. r.parents("section.block.container")
  3628. .attr("data-mobile-dual", "true");
  3629. break;
  3630. case "mobile-landscape-dual":
  3631. r.parents("section.block.container")
  3632. .addClass("mobile-landscape-dual")
  3633. }
  3634. })
  3635. }
  3636.  
  3637. function l() {
  3638. var n = t.ui.selectNav(t.vars.navigation, {
  3639. id: "mobile-nav"
  3640. });
  3641. t.vars.header.find("#mobile-nav")
  3642. .replaceWith(n);
  3643. var r = '<form id="search-box" class="clearfix" action="%s" method="get">\n<p class="clearfix hfloat">\n<input type="text" name="s" placeholder="%s" value="" autocomplete="off" />\n<input class="hoverable" type="submit" value="" />\n<span class="close hoverable"></span>\n</p>\n</form><!-- search-form -->';
  3644. e("#header")
  3645. .append(t.util.format(r, document.wp_home, document.i18n.enterSearchCriteria));
  3646. var i = '<hr class="section-sep" />';
  3647. e("section.block + section.block")
  3648. .before(i), e("section.sep-after")
  3649. .after(i), e(".container[data-mobile-dual=true]")
  3650. .each(function(t, n) {
  3651. var r = e.getWrappedObject(n)
  3652. .removeAttr("data-mobile-dual")
  3653. , i = r.find("> div[data-mobile-behavior=mobile-dual]");
  3654. i.addClass("mobile-dual"), i.wrapEach(2, ".columns, .column", '<div class="mobile-dual-container"></div>'), i.removeAttr("data-mobile-behavior")
  3655. }), e(".container.mobile-landscape-dual")
  3656. .each(function(t, n) {
  3657. var r = e.getWrappedObject(n)
  3658. , i = r.find("> div[data-mobile-behavior=mobile-landscape-dual]");
  3659. i.wrapEach(2, ".columns, .column", '<div class="mobile-dual-container"></div>')
  3660. })
  3661. }
  3662.  
  3663. function c() {
  3664. var n = t.vars.header.find("ul.navigation")
  3665. , r = t.vars.html.hasClass("ipad");
  3666. n.find("ul")
  3667. .each(function(t, n) {
  3668. var r = e.getWrappedObject(n);
  3669. r.before()
  3670. .parent()
  3671. .addClass("submenu")
  3672. });
  3673. var i;
  3674. n.find("> li > ul")
  3675. .addClass("first-ul"), n.find("li")
  3676. .hover(function(t) {
  3677. var n = e.getWrappedObject(this)
  3678. , s = n.find("ul:first");
  3679. n.__show || (n.__show = function() {
  3680. s.fadeIn(300, "easeOutQuad")
  3681. });
  3682. switch (t.type) {
  3683. case "mouseenter":
  3684. s.hasClass("first-ul") ? i = setTimeout(n.__show, r ? 0 : 150) : n.__show();
  3685. break;
  3686. case "mouseleave":
  3687. clearTimeout(i), s.hide()
  3688. }
  3689. })
  3690. }
  3691.  
  3692. function h() {
  3693. e("form input.placeholder")
  3694. .each(function(t, n) {
  3695. var r = e.getWrappedObject(n);
  3696. r.data("text", r.val())
  3697. })
  3698. .focus(function() {
  3699. var t = e.getWrappedObject(this);
  3700. t.val()
  3701. .trim() === t.data("text") && t.val("")
  3702. })
  3703. .blur(function() {
  3704. var t = e.getWrappedObject(this);
  3705. t.val()
  3706. .trim()
  3707. .length === 0 && t.val(t.data("text"))
  3708. })
  3709. }
  3710.  
  3711. function p() {
  3712. var e = t.vars.body
  3713. , n = t.vars.header
  3714. , r = n.find("ul.navigation")
  3715. , i = n.find("ul.social-icons")
  3716. , s = n.find("#search-box")
  3717. , o = s.find("input")
  3718. , u = s.find("input:text")
  3719. , a = s.find("span.close")
  3720. , f = n.find("div.logo")
  3721. , l = r.find("li.search");
  3722. f.addClass("hover");
  3723. var c = t.vars.oldBrowser ? 0 : 410
  3724. , h = !1
  3725. , p = n.hasClass("logo-center")
  3726. , d = n.hasClass("logo-left") || p
  3727. , v = "easeInOutQuad"
  3728. , m = function(e) {
  3729. e.keyCode === 27 && a.click()
  3730. }
  3731. , g = d ? {
  3732. left: 0
  3733. } : {
  3734. right: 0
  3735. }
  3736. , y = d ? {
  3737. left: 30
  3738. } : {
  3739. right: 30
  3740. }
  3741. , b, w, E;
  3742. l.click(function(t) {
  3743. if (h) return;
  3744. h = !0, p && f.removeClass("hover"), b = s.css("top"), w = i.css("top"), E || (E = function() {
  3745. s.stop();
  3746. if (p) {
  3747. var t = (n.width() - r.width()) * .5;
  3748. s.css({
  3749. right: t
  3750. })
  3751. }
  3752. s.animate({
  3753. top: "50%"
  3754. }, c * .3, v, function() {
  3755. o.stop()
  3756. .animate(g, c * .3, v, function() {
  3757. h = !1, e.keyup(m)
  3758. })
  3759. })
  3760. }), p ? (f.stop()
  3761. .animate({
  3762. opacity: .2
  3763. }, c, v), i.stop()
  3764. .animate({
  3765. top: "-50px"
  3766. }, c * .8, v), r.stop()
  3767. .animate({
  3768. top: -1 * n.height()
  3769. }, c * .6, v, E)) : (i.stop()
  3770. .animate({
  3771. top: "-100%"
  3772. }, c * .8, v), r.stop()
  3773. .animate({
  3774. bottom: "100%"
  3775. }, c * .6, v, E))
  3776. });
  3777. var S = function() {
  3778. h = !1
  3779. };
  3780. a.click(function() {
  3781. if (h) return;
  3782. h = !0;
  3783. var t = !0;
  3784. e.unbind("keyup", m), o.stop()
  3785. .animate(y, c * .3, v, function() {
  3786. t && (s.stop()
  3787. .animate({
  3788. top: "-100%"
  3789. }, c * .5, v, function() {
  3790. i.stop()
  3791. .animate({
  3792. top: w
  3793. }, c * .8, v), p ? (r.stop()
  3794. .animate({
  3795. top: 0
  3796. }, c * .6, v, S), f.stop()
  3797. .animate({
  3798. opacity: 1
  3799. }, c * .6, v), f.addClass("hover")) : r.stop()
  3800. .animate({
  3801. bottom: 0
  3802. }, c * .6, v, S)
  3803. }), t = !1)
  3804. })
  3805. })
  3806. }
  3807.  
  3808. function d() {
  3809. e(".blocked-latest-posts")
  3810. .each(function(n, r) {
  3811. var i = !1
  3812. , s = t.eventEmitter()
  3813. , o = e.getWrappedObject(r)
  3814. , u = o
  3815. , a = o.find("> .scroller")
  3816. , f = a.children();
  3817. f.each(function(t, n) {
  3818. e(n)
  3819. .attr("data-index", t)
  3820. });
  3821. if (f.length === 0) return;
  3822. u.append('<div class="controls clearfix">\n <span class="next hoverable"></span>\n <span class="prev hoverable"></span>\n</div><!-- .controls -->');
  3823. var l = a.find("a.frame:first")
  3824. , c = o.find(".controls")
  3825. , h = c.find("span.next")
  3826. , p = c.find("span.prev");
  3827. c.addClass(o.data("controls"));
  3828. var d = t.util.createCycle(f);
  3829. s.on("layout:resize", function(e) {
  3830. d.reset(), a.css("marginLeft", 0)
  3831. }), t.ui.resizeEvent.call(s, u, "layout:resize", !0);
  3832. var v, m, g, y = function() {
  3833. i = !1
  3834. };
  3835. h.add(p)
  3836. .click(function() {
  3837. if (i) return;
  3838. i = !0, v = e.getWrappedObject(this)
  3839. .hasClass("next") ? 1 : -1, m = d.get(v)
  3840. .data("index"), g = -1 * m * (l.width() + 20), a.stop()
  3841. .animate({
  3842. marginLeft: g
  3843. }, 400, "easeInOutQuart", y)
  3844. }), u.touchwipe({
  3845. wipeLeft: function() {
  3846. h.click()
  3847. }
  3848. , wipeRight: function() {
  3849. p.click()
  3850. }
  3851. , min_move_x: 50
  3852. , preventDefaultEvents: !1
  3853. });
  3854. var b = t.getVar("body")
  3855. , w = function(e) {
  3856. e.keyCode == 37 ? p.trigger("click") : e.keyCode == 39 && h.trigger("click")
  3857. };
  3858. u.hover(function(e) {
  3859. switch (e.type) {
  3860. case "mouseenter":
  3861. b.keyup(w);
  3862. break;
  3863. case "mouseleave":
  3864. b.unbind("keyup", w)
  3865. }
  3866. })
  3867. })
  3868. }
  3869.  
  3870. function v() {
  3871. var n = t.vars.oldBrowser
  3872. , r = t.colors.brandColor
  3873. , i = 240;
  3874. e("article a.frame, li a.frame")
  3875. .live("hover", function(s) {
  3876. var o = e.getWrappedObject(this)
  3877. , u = o.__overlay || (o.__overlay = o.append('<span class="overlay"></span>')
  3878. .find("> span.overlay"))
  3879. , a = o.__format || (o.__format = o.find("span.format"))
  3880. , f = o.__borderColor || (o.__borderColor = o.css("border-bottom-color"));
  3881. switch (s.type) {
  3882. case "mouseenter":
  3883. a.stop()
  3884. .animate({
  3885. bottom: 0
  3886. , right: 0
  3887. }, i, "easeOutQuad"), n ? (u.css("opacity", 1)
  3888. .show(), o.css("borderBottomColor", r)) : (u.stop()
  3889. .animate({
  3890. opacity: 1
  3891. }, 200), o.stop()
  3892. .animate({
  3893. borderBottomColor: t.colors.brandColor
  3894. }, 200));
  3895. break;
  3896. case "mouseleave":
  3897. a.stop()
  3898. .animate({
  3899. bottom: -26
  3900. , right: -26
  3901. }, i, "easeInOutQuad"), n ? (u.hide(), o.css("borderBottomColor", f)) : (u.stop()
  3902. .animate({
  3903. opacity: 0
  3904. }, 300), o.stop()
  3905. .animate({
  3906. borderBottomColor: f
  3907. }, 300))
  3908. }
  3909. }), e(".latest-posts-component")
  3910. .each(function(t, n) {
  3911. var r = e(this);
  3912. r.parents("footer")
  3913. .length === 0 && r.addClass("hover-enabled")
  3914. })
  3915. }
  3916.  
  3917. function m() {
  3918. var n = 600
  3919. , r = "easeInOutSine"
  3920. , i = t.vars.body
  3921. , s = e.browser.opera || e.browser.msie ? e("html") : e("html, body");
  3922. t.vars.footer.find("> .copyright a.back-to-top")
  3923. .click(function() {
  3924. return s.stop()
  3925. .animate({
  3926. scrollTop: 0
  3927. }, n, r), !1
  3928. })
  3929. }
  3930.  
  3931. function g() {
  3932. var t = 300
  3933. , n = "easeOutQuad"
  3934. , r = !1
  3935. , i = function() {
  3936. r = !1
  3937. };
  3938. e("ul.accordion-boxes")
  3939. .each(function(s, o) {
  3940. var u = e.getWrappedObject(o)
  3941. , a = u.find("> li.unit.active")
  3942. .length === 0;
  3943. u.find("> li.unit")
  3944. .each(function(t, n) {
  3945. var r = e.getWrappedObject(n);
  3946. t === 0 && a && r.addClass("active");
  3947. var i = r.find("> .content");
  3948. r.data("content", i), r.hasClass("active") || i.hide()
  3949. }), u.find("> li.unit > h3.title")
  3950. .click(function() {
  3951. if (r) return;
  3952. var s = e.getWrappedObject(this);
  3953. s.__unit = s.__unit || (s.__unit = s.parent()), s.__unit.hasClass("active") || (r = !0, u.find("> li.unit.active")
  3954. .removeClass("active")
  3955. .data("content")
  3956. .slideToggle(t, n), s.__unit.addClass("active")
  3957. .data("content")
  3958. .slideToggle(t, n, i))
  3959. })
  3960. }), e(".toggle-box")
  3961. .each(function(s, o) {
  3962. var u = e.getWrappedObject(o)
  3963. , a = u.find("> .content")
  3964. , f = u.find("> h3.title");
  3965. f.data("content", a), u.hasClass("active") || a.hide(), f.click(function() {
  3966. if (r) return;
  3967. r = !0, u.hasClass("active") ? u.removeClass("active") : u.addClass("active"), a.slideToggle(t, n, i)
  3968. })
  3969. })
  3970. }
  3971.  
  3972. function y() {
  3973. var n = 200
  3974. , r = t.vars.window;
  3975. e(".ibox.collapse")
  3976. .append('<span class="close">&times;</span>')
  3977. .find("> span.close")
  3978. .click(function() {
  3979. var t = this.__parent || (this.__parent = e(this)
  3980. .parent());
  3981. t.stop()
  3982. .animate({
  3983. opacity: 0
  3984. }, n, function() {
  3985. t.slideToggle(n, function() {
  3986. t.remove(), r.trigger("resize")
  3987. })
  3988. })
  3989. })
  3990. }
  3991.  
  3992. function b() {
  3993. e("ul.tabs")
  3994. .each(function(n, r) {
  3995. var i = ""
  3996. , s = e.getWrappedObject(r)
  3997. .addClass("enabled")
  3998. , o = s.children(".tab");
  3999. o.each(function(n, r) {
  4000. var s = e.getWrappedObject(r)
  4001. , o = s.find("> h3.title")
  4002. , u = s.hasClass("active");
  4003. i += t.util.format('<span class="tab-title %s">%s</span>', u ? " active" : "", o.html()), o.remove()
  4004. }), s.prepend(t.util.format('<li class="tabs-head clearfix">%s</li>', i)), s.find("> li.tabs-head span.tab-title")
  4005. .each(function(t, n) {
  4006. e.getWrappedObject(n)
  4007. .data("index", t)
  4008. })
  4009. .click(function() {
  4010. var t = e.getWrappedObject(this);
  4011. if (t.hasClass("active")) return;
  4012. t.addClass("active")
  4013. .siblings("span.tab-title")
  4014. .removeClass("active");
  4015. var n = t.data("index");
  4016. o.eq(n)
  4017. .addClass("active")
  4018. .siblings(".tab")
  4019. .removeClass("active")
  4020. })
  4021. })
  4022. }
  4023. t.once(":ready", function() {
  4024. u(), f(), l(), n()
  4025. }), t.once("ready", function() {
  4026. a()
  4027. }), t.ui = {
  4028. resizeEvent: function(e, n, r) {
  4029. var i, s = e.width()
  4030. , o = this.trigger === Backbone.Events.trigger ? this : t;
  4031. t.vars.window.resize(function() {
  4032. i = e.width(), s !== i && (s = i, o.emit(n, s))
  4033. }), r && o.emit(n, s, e)
  4034. }
  4035. , selectNav: function(n, r) {
  4036. var i = /android/i.test(window.navigator.userAgent + "")
  4037. , s, o = e("<select></select>")
  4038. , u = n.find("> li")
  4039. , a = [];
  4040. if (t.vars.modernBrowser && !i) s = n.html()
  4041. .replace(/(alt|title|class|id)(\s+)?\=(\s+)?(\'|\")(.*?)(\'|\")/g, "")
  4042. .replace(/href/g, "value")
  4043. .replace(/<(\/)?ul>/g, "<$1optgroup>")
  4044. .replace(/<li(\s)?>(\s+)?<a|<a/g, "<option")
  4045. .replace(/(<\/a\>)?<\/li>/g, "</option>")
  4046. .replace(/<\/a>/g, "")
  4047. .replace(/[ ]+/g, " ");
  4048. else {
  4049. var f, l = n.find("a");
  4050. l.each(function(n) {
  4051. f = e(l[n]), s += t.util.format('<option value="%s">%s</option>', f.attr("href"), f.html())
  4052. })
  4053. }
  4054. o.html(s)
  4055. .change(function() {
  4056. window.location = e(this)
  4057. .attr("value")
  4058. });
  4059. var c = n.find("li.current-menu-item > a, li.current_page_item > a")
  4060. .attr("href")
  4061. , h = o.find("optgroup");
  4062. return n.find("ul")
  4063. .each(function(t, n) {
  4064. var r = e(n)
  4065. .prev();
  4066. h.eq(t)
  4067. .attr("label", " ↳ " + r.text() + " ⌄")
  4068. }), o.find("option")
  4069. .each(function() {
  4070. var t = e(this);
  4071. if (t.attr("value") == c) return t.attr("selected", "true"), !1
  4072. }), r && o.attr(r), o
  4073. }
  4074. }
  4075. }(jQuery, window.Core)
  4076. , function(e, t) {
  4077. function o() {
  4078. i = t.vars.body, s = t.vars.footer, n = t.vars.window, r = t.vars.html
  4079. }
  4080.  
  4081. function u() {
  4082. e("form input:text[placeholder]")
  4083. .each(function(t, n) {
  4084. var r = this.__self = e(this)
  4085. , i = r.hasClass("required") ? " *" : "";
  4086. r.val(r.attr("placeholder") + i)
  4087. })
  4088. .focus(function() {
  4089. var t = this.__self;
  4090. e.trim(t.val()) == t.attr("placeholder") && t.val("")
  4091. })
  4092. .blur(function() {
  4093. var t = this.__self;
  4094. e.trim(t.val()) == "" && t.val(t.attr("placeholder"))
  4095. })
  4096. }
  4097.  
  4098. function a() {
  4099. var e, n, r = window.navigator.userAgent + "";
  4100. r && (e = t.vars.html, /iphone/i.test(r) ? n = "iphone" : /ipad/i.test(r) ? n = "ipad" : /android/i.test(r) && (n = "android"), e.addClass(n))
  4101. }
  4102.  
  4103. function f() {
  4104. if (!document.DISABLE_AUTO_LIGHTBOX) {
  4105. var t = document.LIGHTBOX_MINIMUM_DIMENSION || 100
  4106. , n = /\.(jpg|jpeg|gif|png|tiff|bmp)$/i;
  4107. e("article.post .content a > img")
  4108. .each(function(r, i) {
  4109. var s = e(i)
  4110. , o = s.parent()
  4111. , u = e.trim(o.attr("href"));
  4112. if (n.test(u)) {
  4113. var a = s.width() || s.attr("width") || 0
  4114. , f = s.height() || s.attr("height") || 0;
  4115. (a >= t || f >= t) && s.parent()
  4116. .attr("rel", "lightbox")
  4117. }
  4118. }), e("article.post")
  4119. .each(function(t, n) {
  4120. var r = e.getWrappedObject(n)
  4121. , i = "lightbox[gallery-" + Math.floor(Math.random() * 1e4) + "]";
  4122. r.find("> a.frame[rel^=lightbox]")
  4123. .attr("rel", i), r.find("> .content a[rel^=lightbox]")
  4124. .each(function(t, n) {
  4125. n = e.getWrappedObject(n), n.attr("rel") === "lightbox" && n.attr("rel", i)
  4126. })
  4127. })
  4128. }
  4129. e("a[rel^=lightbox]")
  4130. .prettyPhoto({
  4131. social_tools: null
  4132. , theme: "light_rounded"
  4133. , opacity: 0
  4134. , slideshow: 4e3
  4135. , deeplinking: !1
  4136. , overlay_gallery: !1
  4137. })
  4138. }
  4139.  
  4140. function c() {
  4141. e(".flickr-gallery")
  4142. .each(function(t, n) {
  4143. var r = e(n)
  4144. , i = r.data("query")
  4145. , s = r.data("cache-timeout")
  4146. , o = calcMD5(i)
  4147. , u = locache.get(o);
  4148. u ? r.replaceWith(u) : e.getJSON(i, function(e) {
  4149. var t = [];
  4150. for (var n, i, u = e.length, a = 0; a < u; a++) n = e[a], t.push('<li><a class="frame" href="' + n.url + '"><img width="200" height="200" alt="" src="' + n.image + '" /></a></li>');
  4151. t.unshift('<ul class="resp-gallery three-cols hover-effect clearfix">'), t.push("</ul>"), t = '<div class="ovh">\n' + t.join("\n") + "</div><!-- .ovh -->", locache.set(o, t, s * 60), r.replaceWith(t)
  4152. })
  4153. })
  4154. }
  4155.  
  4156. function h() {
  4157. e("#twitter-feed .tweet")
  4158. .each(function(n, r) {
  4159. var i = e(r)
  4160. , s = i.parent()
  4161. , o = i.data("username")
  4162. , u = i.data("count")
  4163. , a = i.data("interval") || 5e3;
  4164. if (o && u) {
  4165. var f = function(n) {
  4166. var r = e('<span class="nav prev hoverable" data-incr="-1"></span>')
  4167. , o = e('<span class="nav next hoverable" data-incr="1"></span>');
  4168. s.before(r), s.after(o);
  4169. var u, f, l = !1
  4170. , c = !1;
  4171. r.add(o)
  4172. .click(function() {
  4173. if (l) return;
  4174. l = !0;
  4175. var t = e.getWrappedObject(this);
  4176. clearInterval(u), f(t.data("incr"))
  4177. }), s.touchwipe({
  4178. wipeLeft: function() {
  4179. o.trigger("click")
  4180. }
  4181. , wipeRight: function() {
  4182. r.trigger("click")
  4183. }
  4184. , min_move_x: 50
  4185. , preventDefaultEvents: !1
  4186. });
  4187. var h = t.getVar("body")
  4188. , p = function(e) {
  4189. e.keyCode == 37 ? r.trigger("click") : e.keyCode == 39 && o.trigger("click")
  4190. };
  4191. s.add(r)
  4192. .add(o)
  4193. .hover(function(e) {
  4194. switch (e.type) {
  4195. case "mouseenter":
  4196. clearInterval(u), h.keyup(p);
  4197. break;
  4198. case "mouseleave":
  4199. u = setInterval(f, a), h.unbind("keyup", p)
  4200. }
  4201. });
  4202. var d = t.util.createCycle(n)
  4203. , v = i.find("p");
  4204. v.css({
  4205. opacity: 0
  4206. })
  4207. .html(d.get(1)
  4208. .text)
  4209. .animate({
  4210. opacity: 1
  4211. }, 400);
  4212. if (n.length === 1) return;
  4213. u = setInterval(f = function(e) {
  4214. v.animate({
  4215. opacity: 0
  4216. }, 400, function() {
  4217. v.html(d.get(e || 1)
  4218. .text)
  4219. .animate({
  4220. opacity: 1
  4221. }, 300), l = !1
  4222. })
  4223. }, a)
  4224. }
  4225. , l = locache.get(o + "_twitter_cache");
  4226. l ? f(l) : v(o, u, "twitter-feed", function(e) {
  4227. f(e)
  4228. })
  4229. }
  4230. })
  4231. }
  4232.  
  4233. function v(n, r, i, s) {
  4234. try {
  4235. var o = t.util.format("%s/%s/%d", i, n, r)
  4236. , u = locache.get(o);
  4237. if (u) s(u);
  4238. else {
  4239. var a = t.util.format("%s/framework/twitter-api.php?username=%s&count=%d", document.root, n, r);
  4240. e.getJSON(a, function(e) {
  4241. for (var r = e.length, i = 0; i < r; i++) e[i] = {
  4242. text: e[i].text.replace(p.link, d.link)
  4243. .replace(p.mention, d.mention)
  4244. .replace(p.hash, d.hash)
  4245. , timestamp: e[i].created_at
  4246. , link: t.util.format("https://twitter.com/%s/status/%s", n, e[i].id_str)
  4247. };
  4248. locache.set(o, e, document.TWEET_CACHE_EXPIRE || 300), s(e)
  4249. })
  4250. }
  4251. } catch (f) {
  4252. typeof window.console == "object" && (console.log("Unable to retrieve tweets. Error below"), console.log(f))
  4253. }
  4254. }
  4255.  
  4256. function m() {
  4257. var t = e(".blocked-form")
  4258. , n = /^ERR: /;
  4259. if (t.length > 0) {
  4260. var r = document.site_url + "/wp-includes/js/jquery/jquery.form.js";
  4261. head.js(r)
  4262. .ready(function() {
  4263. t.each(function(t, r) {
  4264. var i = e(r)
  4265. , s = i.find(".required")
  4266. .each(function(t, n) {
  4267. var r = e(n)
  4268. , i = r.data("validation")
  4269. , s = r.attr("placeholder");
  4270. r.attr("placeholder", s + " *"), r.removeAttr("data-validation"), i && r.addClass(i)
  4271. })
  4272. , o = {
  4273. errorPlacement: function() {}
  4274. , highlight: function(t) {
  4275. e.getWrappedObject(t)
  4276. .addClass("invalid")
  4277. }
  4278. , unhighlight: function(t) {
  4279. var n = e.getWrappedObject(t);
  4280. e.getWrappedObject(t)
  4281. .removeClass("invalid")
  4282. }
  4283. };
  4284. i.hasClass("no-ajax") || (o.submitHandler = function() {
  4285. i.hasClass("no-ajax") ? i.submit() : i.data("sent-message") ? alert(i.find(".ibox")
  4286. .html()) : i.ajaxSubmit({
  4287. success: function(e) {
  4288. i.find(".ibox")
  4289. .remove(), n.test(e) ? (e = e.replace(n, ""), i.find("input:submit")
  4290. .before('<div class="ibox warning">' + e + "</div>")) : (i.find("input:submit")
  4291. .before('<div class="ibox success">' + e + "</div>"), i.data("sent-message", !0))
  4292. }
  4293. })
  4294. }), i.validate(o)
  4295. })
  4296. })
  4297. }
  4298. }
  4299.  
  4300. function g() {
  4301. var t = e(".multimedia.media-type-audio");
  4302. if (t.length) {
  4303. var n = document.root + "/core/js/mejs/mediaelement-and-player.min.js";
  4304. head.js(n)
  4305. .ready(function() {
  4306. var n = {
  4307. audioWidth: "100%"
  4308. };
  4309. t.find("> audio")
  4310. .each(function(t, r) {
  4311. var i = e(r)
  4312. , s = i.parent()
  4313. .prev()
  4314. .css("marginBottom", 0);
  4315. i.mediaelementplayer(n)
  4316. }), t.addClass("loaded")
  4317. })
  4318. }
  4319. }
  4320.  
  4321. function y() {
  4322. var t = /\.(jpg|jpeg|png|gif|tiff|tga|pic|ico)$/i;
  4323. e("a.frame.lightbox")
  4324. .each(function(n, r) {
  4325. var i = e.getWrappedObject(r)
  4326. , s = i.data("img")
  4327. , o = i.data("gallery")
  4328. , u = i.siblings("h3:first");
  4329. if (s) {
  4330. s = s.replace(/(\?|&|&amp;)a=[a-z]{1,2}$/, "");
  4331. var a = t.test(e.trim(s)) ? "image" : "video";
  4332. i.removeClass("lightbox")
  4333. .attr("href", s), i.append('<span class="format ' + a + '"></span>'), o ? i.attr("rel", "lightbox[gallery-" + o + "]") : i.attr("rel", "lightbox")
  4334. }
  4335. })
  4336. }
  4337.  
  4338. function b() {
  4339. var t = e("body > footer[role=contentinfo] .widget-column")
  4340. , n = t.length;
  4341. if (n % 2 == 0) {
  4342. var r = t.parent()
  4343. .addClass("mobile-landscape-dual");
  4344. switch (n) {
  4345. case 4:
  4346. var i = e('<div class="mobile-dual-container"></div>')
  4347. , s = i.clone();
  4348. i.appendTo(r), s.appendTo(r), t.eq(0)
  4349. .appendTo(i), t.eq(1)
  4350. .appendTo(i), t.eq(2)
  4351. .appendTo(s), t.eq(3)
  4352. .appendTo(s);
  4353. break;
  4354. case 2:
  4355. var i = e('<div class="mobile-dual-container"></div>');
  4356. i.appendTo(r), t.eq(0)
  4357. .appendTo(i), t.eq(1)
  4358. .appendTo(i)
  4359. }
  4360. }
  4361. }
  4362.  
  4363. function w() {
  4364. e(".blog-posts.singular article.post ul.tags-list")
  4365. .each(function(t, n) {
  4366. var r = e.getWrappedObject(n);
  4367. r.siblings()
  4368. .length === 0 && r.css("max-width", "none")
  4369. }), e("p.slogan.cta")
  4370. .each(function(t, n) {
  4371. var r = e(n)
  4372. , i = r.find("a");
  4373. if (i.length === 1) {
  4374. var s = i.width() + parseInt(i.css("paddingRight"), 10) * 2
  4375. , o = i.height() + parseInt(i.css("paddingTop"), 10) * 2
  4376. , u = parseInt(r.css("paddingRight"), 10);
  4377. i.detach()
  4378. .css({
  4379. position: "absolute"
  4380. , top: "50%"
  4381. , marginTop: -(o / 2)
  4382. , right: u
  4383. });
  4384. var a = e("<span>" + r.html() + "</span>");
  4385. r.css("paddingRight", u + s + 10), r.html(a)
  4386. .append(i)
  4387. }
  4388. })
  4389. }
  4390. t.once(":ready", function() {
  4391. a(), b(), m(), g(), y(), t.colors = t.util.getConfig("body", "branding")
  4392. }), t.once("ready", function() {
  4393. o(), f(), c(), h(), w()
  4394. }), t.once("ready:", function() {
  4395. e.browser.msie && u()
  4396. });
  4397. var n, r, i, s, l = /_s\.jpg$/
  4398. , p = {
  4399. link: /((https?|s?ftp|ssh)\:\/\/[^"\s<>]*[^.,;'">\:\s<>\)\]\!])/ig
  4400. , mention: /@([a-z0-9_]+)/ig
  4401. , hash: /#([a-z0-9_]+)/ig
  4402. }
  4403. , d = {
  4404. link: '<a class="ext-link" target="_blank" href="$&">$&</a> '
  4405. , mention: '<a class="user" target="_blank" href="http://twitter.com/$1">@$1</a>'
  4406. , hash: '<a class="hashtag" target="_blank" href="http://twitter.com/search/$1">#$1</a>'
  4407. }
  4408. }(jQuery, window.Core);
Add Comment
Please, Sign In to add comment