/*
 * jQuery JavaScript Library v1.6.2
 * http://jquery.com/
 *
 * Copyright 2011, John Resig
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 * Copyright 2011, The Dojo Foundation
 * Released under the MIT, BSD, and GPL Licenses.
 *
 * Date: Thu Jun 30 14:16:56 2011 -0400
 */
(function(a,b){function cv(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1;}function cs(a){if(!cg[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ch||(ch=c.createElement("iframe"),ch.frameBorder=ch.width=ch.height=0),b.appendChild(ch);if(!ci||!ch.createElement){ci=(ch.contentWindow||ch.contentDocument).document,ci.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),ci.close();}d=ci.createElement(a),ci.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ch);}cg[a]=e;}return cg[a];}function cr(a,b){var c={};f.each(cm.concat.apply([],cm.slice(0,b)),function(){c[this]=a;});return c;}function cq(){cn=b;}function cp(){setTimeout(cq,0);return cn=f.now();}function cf(){try{return new a.ActiveXObject("Microsoft.XMLHTTP");}catch(b){}}function ce(){try{return new a.XMLHttpRequest;}catch(b){}}function b$(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var 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 in a.converters){typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);}}l=k,k=d[g];if(k==="*"){k=l;}else{if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break;}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)));}}}return c;}function bZ(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g){i in d&&(c[g[i]]=d[i]);}while(f[0]==="*"){f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));}if(h){for(i in e){if(e[i]&&e[i].test(h)){f.unshift(i);break;}}}if(f[0] in d){j=f[0];}else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break;}k||(k=i);}j=j||k;}if(j){j!==f[0]&&f.unshift(j);return d[j];}}function bY(a,b,c,d){if(f.isArray(b)){f.each(b,function(b,e){c||bC.test(a)?d(a,e):bY(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d);});}else{if(!c&&b!=null&&typeof b=="object"){for(var e in b){bY(a+"["+e+"]",b[e],c,d);}}else{d(a,b);}}}function bX(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bR,l;for(;i<j&&(k||!l);i++){l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bX(a,c,d,e,l,g)));}(k||!l)&&!g["*"]&&(l=bX(a,c,d,e,"*",g));return l;}function bW(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bN),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 bA(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bv:bw;if(d>0){c!=="border"&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0;});return d+"px";}d=bx(a,b,b);if(d<0||d==null){d=a.style[b]||0;}d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0);});return d+"px";}function bm(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(be,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b);}function bl(a){f.nodeName(a,"input")?bk(a):"getElementsByTagName" in a&&f.grep(a.getElementsByTagName("input"),bk);}function bk(a){if(a.type==="checkbox"||a.type==="radio"){a.defaultChecked=a.checked;}}function bj(a){return"getElementsByTagName" in a?a.getElementsByTagName("*"):"querySelectorAll" in a?a.querySelectorAll("*"):[];}function bi(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object"){b.outerHTML=a.outerHTML;}else{if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option"){b.selected=a.defaultSelected;}else{if(c==="input"||c==="textarea"){b.defaultValue=a.defaultValue;}}}else{a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);}}b.removeAttribute(f.expando);}}function bh(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c=f.expando,d=f.data(a),e=f.data(b,d);if(d=d[c]){var g=d.events;e=e[c]=f.extend({},d);if(g){delete e.handle,e.events={};for(var h in g){for(var i=0,j=g[h].length;i<j;i++){f.event.add(b,h+(g[h][i].namespace?".":"")+g[h][i].namespace,g[h][i],g[h][i].data);}}}}}}function bg(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a;}function W(a,b,c){b=b||0;if(f.isFunction(b)){return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c;});}if(b.nodeType){return f.grep(a,function(a,d){return a===b===c;});}if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1;});if(R.test(b)){return f.filter(b,d,!c);}b=f.filter(b,d);}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c;});}function V(a){return !a||!a.parentNode||a.parentNode.nodeType===11;}function N(a,b){return(a&&a!=="*"?a+".":"")+b.replace(z,"`").replace(A,"&");}function M(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;i<s.length;i++){g=s[i],g.origType.replace(x,"")===a.type?q.push(g.selector):s.splice(i--,1);}e=f(a.target).closest(q,a.currentTarget);for(j=0,k=e.length;j<k;j++){m=e[j];for(i=0;i<s.length;i++){g=s[i];if(m.selector===g.selector&&(!n||n.test(g.namespace))&&!m.elem.disabled){h=m.elem,d=null;if(g.preType==="mouseenter"||g.preType==="mouseleave"){a.type=g.preType,d=f(a.relatedTarget).closest(g.selector)[0],d&&f.contains(h,d)&&(d=h);}(!d||d!==h)&&p.push({elem:h,handleObj:g,level:m.level});}}}for(j=0,k=p.length;j<k;j++){e=p[j];if(c&&e.level>c){break;}a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped()){break;}}}return b;}}function K(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault();}function E(){return !0;}function D(){return !1;}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve());},0);}function l(a){for(var b in a){if(b!=="toJSON"){return !1;}}return !0;}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"$1-$2").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d);}catch(g){}f.data(a,c,d);}else{d=b;}}return d;}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left");}catch(a){setTimeout(J,1);return;}e.ready();}}var e=function(a,b){return new e.fn.init(a,b,h);},f=a.jQuery,g=a.$,h,i=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z])/ig,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 g,h,j,k;if(!a){return this;}if(a.nodeType){this.context=this[0]=a,this.length=1;return this;}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this;}if(typeof 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 instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.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 e.merge(this,a);}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2]){return f.find(a);}this.length=1,this[0]=h;}this.context=c,this.selector=a;return this;}return !d||d.jquery?(d||f).find(a):this.constructor(d).find(a);}if(e.isFunction(a)){return f.ready(a);}a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this);},selector:"",jquery:"1.6.2",length:0,size:function(){return this.length;},toArray:function(){return F.call(this,0);},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a];},pushStack:function(a,b,c){var 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?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d;},each:function(a,b){return e.each(this,a,b);},ready:function(a){e.bindReady(),A.done(a);return this;},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1);},first:function(){return this.eq(0);},last:function(){return this.eq(-1);},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","));},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b);}));},end:function(){return this.prevObject||this.constructor(null);},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++){if((a=arguments[j])!=null){for(c in 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 i;},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return 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 setTimeout(e.ready,1);}e.isReady=!0;if(a!==!0&&--e.readyWait>0){return;}A.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready");}},bindReady:function(){if(!A){A=e._Deferred();if(c.readyState==="complete"){return setTimeout(e.ready,1);}if(c.addEventListener){c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);}else{if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null;}catch(d){}c.documentElement.doScroll&&b&&J();}}}},isFunction:function(a){return e.type(a)==="function";},isArray:Array.isArray||function(a){return e.type(a)==="array";},isWindow:function(a){return a&&typeof a=="object"&&"setInterval" in a;},isNaN:function(a){return a==null||!m.test(a)||isNaN(a);},type:function(a){return 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;}if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf")){return !1;}var c;for(c in a){}return c===b||D.call(a,c);},isEmptyObject:function(a){for(var b in a){return !1;}return !0;},error:function(a){throw a;},parseJSON:function(b){if(typeof b!="string"||!b){return null;}b=e.trim(b);if(a.JSON&&a.JSON.parse){return a.JSON.parse(b);}if(o.test(b.replace(p,"@").replace(q,"]").replace(r,""))){return(new Function("return "+b))();}e.error("Invalid JSON: "+b);},parseXML:function(b,c,d){a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),d=c.documentElement,(!d||!d.nodeName||d.nodeName==="parsererror")&&e.error("Invalid XML: "+b);return c;},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b);})(b);},camelCase:function(a){return a.replace(w,x);},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase();},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a){if(c.apply(a[f],d)===!1){break;}}}else{for(;g<h;){if(c.apply(a[g++],d)===!1){break;}}}}else{if(i){for(f in a){if(c.call(a[f],f,a[f])===!1){break;}}}else{for(;g<h;){if(c.call(a[g],g,a[g++])===!1){break;}}}}return a;},trim:G?function(a){return a==null?"":G.call(a);}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"");},makeArray:function(a,b){var c=b||[];if(a!=null){var 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 c;},inArray:function(a,b){if(H){return H.call(b,a);}for(var c=0,d=b.length;c<d;c++){if(b[c]===a){return c;}}return -1;},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number"){for(var f=c.length;e<f;e++){a[d++]=c[e];}}else{while(c[e]!==b){a[d++]=c[e++];}}a.length=d;return a;},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++){e=!!b(a[f],f),c!==e&&d.push(a[f]);}return d;},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof 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{for(g in a){f=c(a[g],g,d),f!=null&&(h[h.length]=f);}}return h.concat.apply([],h);},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d;}if(!e.isFunction(a)){return b;}var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)));};g.guid=a.guid=a.guid||g.guid||e.guid++;return g;},access:function(a,c,d,f,g,h){var i=a.length;if(typeof c=="object"){for(var j in c){e.access(a,j,c[j],f,g,d);}return a;}if(d!==b){f=!h&&f&&e.isFunction(d);for(var k=0;k<i;k++){g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h);}return a;}return i?g(a[0],c):b;},now:function(){return(new Date).getTime();},uaMatch:function(a){a=a.toLowerCase();var b=s.exec(a)||t.exec(a)||u.exec(a)||a.indexOf("compatible")<0&&v.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"};},sub:function(){function a(b,c){return new 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 instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b);},a.fn.init.prototype=a.fn;var b=a(c);return a;},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+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(" ")&&(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 e;}(),g="done fail isResolved isRejected promise then always pipe".split(" "),h=[].slice;f.extend({_Deferred:function(){var a=[],b,c,d,e={done:function(){if(!d){var c=arguments,g,h,i,j,k;b&&(k=b,b=0);for(g=0,h=c.length;g<h;g++){i=c[g],j=f.type(i),j==="array"?e.done.apply(e,i):j==="function"&&a.push(i);}k&&e.resolveWith(k[0],k[1]);}return this;},resolveWith:function(e,f){if(!d&&!b&&!c){f=f||[],c=1;try{while(a[0]){a.shift().apply(e,f);}}finally{b=[e,f],c=0;}}return this;},resolve:function(){e.resolveWith(this,arguments);return this;},isResolved:function(){return !!c||!!b;},cancel:function(){d=1,a=[];return this;}};return e;},Deferred:function(a){var b=f._Deferred(),c=f._Deferred(),d;f.extend(b,{then:function(a,c){b.done(a).fail(c);return this;},always:function(){return b.done.apply(b,arguments).fail.apply(this,arguments);},fail:c.done,rejectWith:c.resolveWith,reject:c.resolve,isRejected:c.isResolved,pipe:function(a,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[c,"reject"]},function(a,c){var e=c[0],g=c[1],h;f.isFunction(e)?b[a](function(){h=e.apply(this,arguments),h&&f.isFunction(h.promise)?h.promise().then(d.resolve,d.reject):d[g](h);}):b[a](d[g]);});}).promise();},promise:function(a){if(a==null){if(d){return d;}d=a={};}var c=g.length;while(c--){a[g[c]]=b[g[c]];}return a;}}),b.done(c.cancel).fail(b.cancel),delete b.cancel,a&&a.call(b,b);return b;},when:function(a){function i(a){return function(c){b[a]=arguments.length>1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0));};}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c<d;c++){b[c]&&f.isFunction(b[c].promise)?b[c].promise().then(i(c),g.reject):--e;}e||g.resolveWith(g,b);}else{g!==a&&g.resolveWith(g,d?[a]:[]);}return g.promise();}}),f.support=function(){var a=c.createElement("div"),b=c.documentElement,d,e,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;a.setAttribute("className","t"),a.innerHTML="   <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e){return{};}g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.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:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;try{delete a.test;}catch(v){k.deleteExpando=!1;}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1;}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.firstChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0},m&&f.extend(p,{position:"absolute",left:-1000,top:-1000});for(t in p){o.style[t]=p[t];}o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom" in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="<div style='width:4px;'></div>",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0),o.innerHTML="",n.removeChild(o);if(a.attachEvent){for(t in {submit:1,change:1,focusin:1}){s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u;}}o=l=g=h=m=j=a=i=null;return k;}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([a-z])([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&&!l(a);},data:function(a,c,d,e){if(!!f.acceptData(a)){var g=f.expando,h=typeof c=="string",i,j=a.nodeType,k=j?f.cache:a,l=j?a[f.expando]:a[f.expando]&&f.expando;if((!l||e&&l&&!k[l][g])&&h&&d===b){return;}l||(j?a[f.expando]=l=++f.uuid:l=f.expando),k[l]||(k[l]={},j||(k[l].toJSON=f.noop));if(typeof c=="object"||typeof c=="function"){e?k[l][g]=f.extend(k[l][g],c):k[l]=f.extend(k[l],c);}i=k[l],e&&(i[g]||(i[g]={}),i=i[g]),d!==b&&(i[f.camelCase(c)]=d);if(c==="events"&&!i[c]){return i[g]&&i[g].events;}return h?i[f.camelCase(c)]||i[c]:i;}},removeData:function(b,c,d){if(!!f.acceptData(b)){var e=f.expando,g=b.nodeType,h=g?f.cache:b,i=g?b[f.expando]:f.expando;if(!h[i]){return;}if(c){var j=d?h[i][e]:h[i];if(j){delete j[c];if(!l(j)){return;}}}if(d){delete h[i][e];if(!l(h[i])){return;}}var k=h[i][e];f.support.deleteExpando||h!=a?delete h[i]:h[i]=null,k?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=k):g&&(f.support.deleteExpando?delete b[f.expando]:b.removeAttribute?b.removeAttribute(f.expando):b[f.expando]=null);}},_data:function(a,b,c){return f.data(a,b,c,!0);},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b){return b!==!0&&a.getAttribute("classid")===b;}}return !0;}}),f.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h<i;h++){g=e[h].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),k(this[0],g,d[g]));}}}return d;}if(typeof a=="object"){return this.each(function(){f.data(this,a);});}var j=a.split(".");j[1]=j[1]?"."+j[1]:"";if(c===b){d=this.triggerHandler("getData"+j[1]+"!",[j[0]]),d===b&&this.length&&(d=f.data(this[0],a),d=k(this[0],a,d));return d===b&&j[1]?this.data(j[0]):d;}return this.each(function(){var b=f(this),d=[j[0],c];b.triggerHandler("setData"+j[1]+"!",d),f.data(this,a,c),b.triggerHandler("changeData"+j[1]+"!",d);});},removeData:function(a){return this.each(function(){f.removeData(this,a);});}}),f.extend({_mark:function(a,c){a&&(c=(c||"fx")+"mark",f.data(a,c,(f.data(a,c,b,!0)||0)+1,!0));},_unmark:function(a,c,d){a!==!0&&(d=c,c=a,a=!1);if(c){d=d||"fx";var e=d+"mark",g=a?0:(f.data(c,e,b,!0)||1)-1;g?f.data(c,e,g,!0):(f.removeData(c,e,!0),m(c,d,"mark"));}},queue:function(a,c,d){if(a){c=(c||"fx")+"queue";var e=f.data(a,c,b,!0);d&&(!e||f.isArray(d)?e=f.data(a,c,f.makeArray(d),!0):e.push(d));return e||[];}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e;d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),d.call(a,function(){f.dequeue(a,b);})),c.length||(f.removeData(a,b+"queue",!0),m(a,b,"queue"));}}),f.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");if(c===b){return f.queue(this[0],a);}return this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a);});},dequeue:function(a){return this.each(function(){f.dequeue(this,a);});},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(){var c=this;setTimeout(function(){f.dequeue(c,b);},a);});},clearQueue:function(a){return this.queue(a||"fx",[]);},promise:function(a,c){function m(){--h||d.resolveWith(e,[e]);}typeof a!="string"&&(c=a,a=b),a=a||"fx";var 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._Deferred(),!0)){h++,l.done(m);}}m();return d.promise();}});var n=/[\n\t\r]/g,o=/\s+/,p=/\r/g,q=/^(?:button|input)$/i,r=/^(?:button|input|object|select|textarea)$/i,s=/^a(?:rea)?$/i,t=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,u=/\:|^on/,v,w;f.fn.extend({attr:function(a,b){return f.access(this,a,b,!0,f.attr);},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a);});},prop:function(a,b){return f.access(this,a,b,!0,f.prop);},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a];}catch(c){}});},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a)){return this.each(function(b){f(this).addClass(a.call(this,b,this.className));});}if(a&&typeof a=="string"){b=a.split(o);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=" "+e.className+" ";for(h=0,i=b.length;h<i;h++){~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");}e.className=f.trim(g);}}}}return this;},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a)){return this.each(function(b){f(this).removeClass(a.call(this,b,this.className));});}if(a&&typeof a=="string"||a===b){c=(a||"").split(o);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className){if(a){h=(" "+g.className+" ").replace(n," ");for(i=0,j=c.length;i<j;i++){h=h.replace(" "+c[i]+" "," ");}g.className=f.trim(h);}else{g.className="";}}}}return this;},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a)){return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b);});}return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(o);while(e=j[g++]){i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e);}}else{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 b=" "+a+" ";for(var c=0,d=this.length;c<d;c++){if((" "+this[c].className+" ").replace(n," ").indexOf(b)>-1){return !0;}}return !1;},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get" in c&&(d=c.get(e,"value"))!==b){return d;}d=e.value;return typeof d=="string"?d.replace(p,""):d==null?"":d;}return b;}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+"";})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set" in c)||c.set(this,h,"value")===b){this.value=h;}}});}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return !b||b.specified?a.value:a.text;}},select:{get:function(a){var b,c=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0){return null;}for(var h=g?c:0,i=g?c+1:e.length;h<i;h++){var j=e[h];if(j.selected&&(f.support.optDisabled?!j.disabled:j.getAttribute("disabled")===null)&&(!j.parentNode.disabled||!f.nodeName(j.parentNode,"optgroup"))){b=f(j).val();if(g){return b;}d.push(b);}}if(g&&!d.length&&e.length){return f(e[c]).val();}return d;},set:function(a,b){var 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 c;}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2){return b;}if(e&&c in f.attrFn){return f(a)[c](d);}if(!("getAttribute" in a)){return f.prop(a,c,d);}var h,i,j=g!==1||!f.isXMLDoc(a);j&&(c=f.attrFix[c]||c,i=f.attrHooks[c],i||(t.test(c)?i=w:v&&c!=="className"&&(f.nodeName(a,"form")||u.test(c))&&(i=v)));if(d!==b){if(d===null){f.removeAttr(a,c);return b;}if(i&&"set" in i&&j&&(h=i.set(a,d,c))!==b){return h;}a.setAttribute(c,""+d);return d;}if(i&&"get" in i&&j&&(h=i.get(a,c))!==null){return h;}h=a.getAttribute(c);return h===null?b:h;},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.support.getSetAttribute?a.removeAttribute(b):(f.attr(a,b,""),a.removeAttributeNode(a.getAttributeNode(b))),t.test(b)&&(c=f.propFix[b]||b) in a&&(a[c]=!1));},attrHooks:{type:{set:function(a,b){if(q.test(a.nodeName)&&a.parentNode){f.error("type property can't be changed");}else{if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b;}}}},tabIndex:{get:function(a){var c=a.getAttributeNode("tabIndex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0:b;}},value:{get:function(a,b){if(v&&f.nodeName(a,"button")){return v.get(a,b);}return b in a?a.value:null;},set:function(a,b,c){if(v&&f.nodeName(a,"button")){return v.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 e=a.nodeType;if(!a||e===3||e===8||e===2){return b;}var g,h,i=e!==1||!f.isXMLDoc(a);i&&(c=f.propFix[c]||c,h=f.propHooks[c]);return d!==b?h&&"set" in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get" in h&&(g=h.get(a,c))!==b?g:a[c];},propHooks:{}}),w={get:function(a,c){return f.prop(a,c)?c.toLowerCase():b;},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c;}},f.support.getSetAttribute||(f.attrFix=f.propFix,v=f.attrHooks.name=f.attrHooks.title=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b;},set:function(a,b,c){var d=a.getAttributeNode(c);if(d){d.nodeValue=b;return b;}}},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 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 d=a.getAttribute(c,2);return d===null?b:d;}});}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b;},set:function(a,b){return a.style.cssText=""+b;}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return 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 a.checked=f.inArray(f(a).val(),b)>=0;}}});});var x=/\.(.*)$/,y=/^(?:textarea|input|select)$/i,z=/\./g,A=/ /g,B=/[^\w\s.|`]/g,C=function(a){return a.replace(B,"\\$&");};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1){d=D;}else{if(!d){return;}}var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i){return;}var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b;}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1){a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k);}}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0;}a=null;}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=D);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t){return;}c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t){f.event.remove(a,h+c);}return;}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),C).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p){continue;}if(!d){for(j=0;j<p.length;j++){q=p[j];if(l||n.test(q.namespace)){f.event.remove(a,r,q.handler,j),p.splice(j--,1);}}continue;}o=f.event.special[h]||{};for(j=e||0;j<p.length;j++){q=p[j];if(d.guid===q.guid){if(l||n.test(q.namespace)){e==null&&p.splice(j--,1),o.remove&&o.remove.call(a,q);}if(e!=null){break;}}}if(p.length===0||e!=null&&p.length===1){(!o.teardown||o.teardown.call(a,m)===!1)&&f.removeEvent(a,h,s.handle),g=null,delete t[h];}}if(f.isEmptyObject(t)){var u=s.handle;u&&(u.elem=null),delete s.events,delete s.handle,f.isEmptyObject(s)&&f.removeData(a,b,!0);}}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){var h=c.type||c,i=[],j;h.indexOf("!")>=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e){c.preventDefault(),c.stopPropagation();}if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem);});return;}if(e.nodeType===3||e.nodeType===8){return;}c.result=b,c.target=e,d=d!=null?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a;}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]());}catch(p){}n&&(e[l]=n),f.event.triggered=b;}}return c.result;}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h<i;h++){var j=d[h];if(e||c.namespace_re.test(j.namespace)){c.handler=j.handler,c.data=j.data,c.handleObj=j;var k=j.handler.apply(this,g);k!==b&&(c.result=k,k===!1&&(c.preventDefault(),c.stopPropagation()));if(c.isImmediatePropagationStopped()){break;}}}return c.result;},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[f.expando]){return a;}var d=a;a=f.Event(d);for(var e=this.props.length,g;e;){g=this.props[--e],a[g]=d[g];}a.target||(a.target=a.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),!a.relatedTarget&&a.fromElement&&(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement);if(a.pageX==null&&a.clientX!=null){var h=a.target.ownerDocument||c,i=h.documentElement,j=h.body;a.pageX=a.clientX+(i&&i.scrollLeft||j&&j.scrollLeft||0)-(i&&i.clientLeft||j&&j.clientLeft||0),a.pageY=a.clientY+(i&&i.scrollTop||j&&j.scrollTop||0)-(i&&i.clientTop||j&&j.clientTop||0);}a.which==null&&(a.charCode!=null||a.keyCode!=null)&&(a.which=a.charCode!=null?a.charCode:a.keyCode),!a.metaKey&&a.ctrlKey&&(a.metaKey=a.ctrlKey),!a.which&&a.button!==b&&(a.which=a.button&1?1:a.button&2?3:a.button&4?2:0);return a;},guid:100000000,proxy:f.proxy,special:{ready:{setup:f.bindReady,teardown:f.noop},live:{add:function(a){f.event.add(this,N(a.origType,a.selector),f.extend({},a,{handler:M,guid:a.handler.guid}));},remove:function(a){f.event.remove(this,N(a.origType,a.selector),a);}},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c);},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null);}}}},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.preventDefault){return new 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()?E:D):this.type=a,b&&f.extend(this,b),this.timeStamp=f.now(),this[f.expando]=!0;},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=E;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1);},stopPropagation:function(){this.isPropagationStopped=E;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0);},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=E,this.stopPropagation();},isDefaultPrevented:D,isPropagationStopped:D,isImmediatePropagationStopped:D};var F=function(a){var b=a.relatedTarget,c=!1,d=a.type;a.type=a.data,b!==this&&(b&&(c=f.contains(this,b)),c||(f.event.handle.apply(this,arguments),a.type=d));},G=function(a){a.type=a.data,f.event.handle.apply(this,arguments);};f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={setup:function(c){f.event.add(this,b,c&&c.selector?G:F,a);},teardown:function(a){f.event.remove(this,b,a&&a.selector?G:F);}};}),f.support.submitBubbles||(f.event.special.submit={setup:function(a,b){if(!f.nodeName(this,"form")){f.event.add(this,"click.specialSubmit",function(a){var b=a.target,c=b.type;(c==="submit"||c==="image")&&f(b).closest("form").length&&K("submit",this,arguments);}),f.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,c=b.type;(c==="text"||c==="password")&&f(b).closest("form").length&&a.keyCode===13&&K("submit",this,arguments);});}else{return !1;}},teardown:function(a){f.event.remove(this,".specialSubmit");}});if(!f.support.changeBubbles){var H,I=function(a){var b=a.type,c=a.value;b==="radio"||b==="checkbox"?c=a.checked:b==="select-multiple"?c=a.selectedIndex>-1?f.map(a.options,function(a){return a.selected;}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c;},J=function(c){var d=c.target,e,g;if(!!y.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=I(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e){return;}if(e!=null||g){c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d);}}};f.event.special.change={filters:{focusout:J,beforedeactivate:J,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&J.call(this,a);},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&J.call(this,a);},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",I(b));}},setup:function(a,b){if(this.type==="file"){return !1;}for(var c in H){f.event.add(this,c+".specialChange",H[c]);}return y.test(this.nodeName);},teardown:function(a){f.event.remove(this,".specialChange");return y.test(this.nodeName);}},H=f.event.special.change.filters,H.focus=H.beforeactivate;}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault();}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0);},teardown:function(){--d===0&&c.removeEventListener(a,e,!0);}};}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a){this[c](h,d,a[h],e);}return this;}if(arguments.length===2||d===!1){e=d,d=b;}c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments);},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one"){this.one(a,d,e);}else{for(var i=0,j=this.length;i<j;i++){f.event.add(this[i],a,g,d);}}return this;};}),f.fn.extend({unbind:function(a,b){if(typeof a=="object"&&!a.preventDefault){for(var c in a){this.unbind(c,a[c]);}}else{for(var d=0,e=this.length;d<e;d++){f.event.remove(this[d],a,b);}}return this;},delegate:function(a,b,c,d){return this.live(b,c,d,a);},undelegate:function(a,b,c){return arguments.length===0?this.unbind("live"):this.die(b,null,c,a);},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this);});},triggerHandler:function(a,b){if(this[0]){return f.event.trigger(a,b,this[0],!0);}},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f.data(this,"lastToggle"+a.guid)||0)%d;f.data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1;};e.guid=c;while(d<b.length){b[d++].guid=c;}return this.click(e);},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a);}});var L={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};f.each(["live","die"],function(a,c){f.fn[c]=function(a,d,e,g){var h,i=0,j,k,l,m=g||this.selector,n=g?this:f(this.context);if(typeof a=="object"&&!a.preventDefault){for(var o in a){n[c](o,d,a[o],m);}return this;}if(c==="die"&&!a&&g&&g.charAt(0)==="."){n.unbind(g);return this;}if(d===!1||f.isFunction(d)){e=d||D,d=b;}a=(a||"").split(" ");while((h=a[i++])!=null){j=x.exec(h),k="",j&&(k=j[0],h=h.replace(x,""));if(h==="hover"){a.push("mouseenter"+k,"mouseleave"+k);continue;}l=h,L[h]?(a.push(L[h]+k),h=h+k):h=(L[h]||h)+k;if(c==="live"){for(var p=0,q=n.length;p<q;p++){f.event.add(n[p],"live."+N(h,m),{data:d,selector:m,handler:e,origType:h,origHandler:e,preType:l});}}else{n.unbind("live."+N(h,m),e);}}return this;};}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.bind(b,a,c):this.trigger(b);},f.attrFn&&(f.attrFn[b]=!0);}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break;}if(i.nodeType===1){f||(i.sizcache=c,i.sizset=g);if(typeof b!="string"){if(i===b){j=!0;break;}}else{if(k.filter(b,[i]).length>0){j=i;break;}}}i=i[a];}d[g]=j;}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break;}i.nodeType===1&&!f&&(i.sizcache=c,i.sizset=g);if(i.nodeName.toLowerCase()===b){j=i;break;}i=i[a];}d[g]=j;}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0;});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9){return[];}if(!b||typeof b!="string"){return f;}var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break;}}}while(i);if(x.length>1&&m.exec(b)){if(x.length===2&&l.relative[x[0]]){j=v(x[0]+x[1],d);}else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length){b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j);}}}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length){r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w);}}else{n=x=[];}}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]"){if(!u){f.push.apply(f,n);}else{if(d&&d.nodeType===1){for(t=0;n[t]!=null;t++){n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);}}else{for(t=0;n[t]!=null;t++){n[t]&&n[t].nodeType===1&&f.push(j[t]);}}}}else{p(n,f);}o&&(k(o,h,f,g),k.uniqueSort(f));return f;};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g){for(var b=1;b<a.length;b++){a[b]===a[b-1]&&a.splice(b--,1);}}}return a;},k.matches=function(a,b){return k(a,null,null,b);},k.matchesSelector=function(a,b){return k(b,null,null,[a]).length>0;},k.find=function(a,b,c){var d;if(!a){return[];}for(var e=0,f=l.order.length;e<f;e++){var g,h=l.order[e];if(g=l.leftMatch[h].exec(a)){var j=g[1];g.splice(1,1);if(j.substr(j.length-1)!=="\\"){g[1]=(g[1]||"").replace(i,""),d=l.find[h](g,b,c);if(d!=null){a=a.replace(l.match[h],"");break;}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a};},k.filter=function(a,c,d,e){var f,g,h=a,i=[],j=c,m=c&&c[0]&&k.isXML(c[0]);while(a&&c.length){for(var n in l.filter){if((f=l.leftMatch[n].exec(a))!=null&&f[2]){var o,p,q=l.filter[n],r=f[1];g=!1,f.splice(1,1);if(r.substr(r.length-1)==="\\"){continue;}j===i&&(i=[]);if(l.preFilter[n]){f=l.preFilter[n](f,j,d,i,e,m);if(!f){g=o=!0;}else{if(f===!0){continue;}}}if(f){for(var s=0;(p=j[s])!=null;s++){if(p){o=q(p,f,s,j);var t=e^!!o;d&&o!=null?t?g=!0:j[s]=!1:t&&(i.push(p),g=!0);}}}if(o!==b){d||(j=i),a=a.replace(l.match[n],"");if(!g){return[];}break;}}}if(a===h){if(g==null){k.error(a);}else{break;}}h=a;}return j;},k.error=function(a){throw"Syntax error, unrecognized expression: "+a;};var l=k.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 a.getAttribute("href");},type:function(a){return a.getAttribute("type");}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!j.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var 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&&k.filter(b,a,!0);},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var 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&&k.filter(b,a,!0);}},"":function(a,b,c){var e,f=d++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("parentNode",b,f,a,e,c);},"~":function(a,b,c){var e,f=d++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("previousSibling",b,f,a,e,c);}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[];}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++){d[e].getAttribute("name")===a[1]&&c.push(d[e]);}return c.length===0?null:c;}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined"){return b.getElementsByTagName(a[1]);}}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(i,"")+" ";if(f){return a;}for(var g=0,h;(h=b[g])!=null;g++){h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));}return !1;},ID:function(a){return a[1].replace(i,"");},TAG:function(a,b){return a[1].replace(i,"").toLowerCase();},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var 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{a[2]&&k.error(a[0]);}a[0]=d++;return a;},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return 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]=k(b[3],null,null,c);}else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return !1;}}else{if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0])){return !0;}}return b;},POS:function(a){a.unshift(!0);return a;}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden";},disabled:function(a){return a.disabled===!0;},checked:function(a){return a.checked===!0;},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0;},parent:function(a){return !!a.firstChild;},empty:function(a){return !a.firstChild;},has:function(a,b,c){return !!k(c[3],a).length;},header:function(a){return/h\d/i.test(a.nodeName);},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null);},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type;},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type;},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type;},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type;},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type;},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type;},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type;},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button";},input:function(a){return/input|select|textarea|button/i.test(a.nodeName);},focus:function(a){return a===a.ownerDocument.activeElement;}},setFilters:{first:function(a,b){return b===0;},last:function(a,b,c,d){return b===d.length-1;},even:function(a,b){return b%2===0;},odd:function(a,b){return b%2===1;},lt:function(a,b,c){return b<c[3]-0;},gt:function(a,b,c){return b>c[3]-0;},nth:function(a,b,c){return c[3]-0===b;},eq:function(a,b,c){return c[3]-0===b;}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f){return f(a,c,b,d);}if(e==="contains"){return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;}if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++){if(g[h]===a){return !1;}}return !0;}k.error(e);},CHILD:function(a,b){var c=b[1],d=a;switch(c){case"only":case"first":while(d=d.previousSibling){if(d.nodeType===1){return !1;}}if(c==="first"){return !0;}d=a;case"last":while(d=d.nextSibling){if(d.nodeType===1){return !1;}}return !0;case"nth":var e=b[2],f=b[3];if(e===1&&f===0){return !0;}var g=b[0],h=a.parentNode;if(h&&(h.sizcache!==g||!a.nodeIndex)){var i=0;for(d=h.firstChild;d;d=d.nextSibling){d.nodeType===1&&(d.nodeIndex=++i);}h.sizcache=g;}var j=a.nodeIndex-f;return e===0?j===0:j%e===0&&j/e>=0;}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b;},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b;},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1;},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").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 e=b[2],f=l.setFilters[e];if(f){return f(a,c,b,d);}}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1);};for(var o in l.match){l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));}var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b;}return a;};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType;}catch(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]"){Array.prototype.push.apply(d,a);}else{if(typeof a.length=="number"){for(var f=a.length;c<f;c++){d.push(a[c]);}}else{for(;a[c];c++){d.push(a[c]);}}}return d;};}var r,s;c.documentElement.compareDocumentPosition?r=function(a,b){if(a===b){g=!0;return 0;}if(!a.compareDocumentPosition||!b.compareDocumentPosition){return a.compareDocumentPosition?-1:1;}return a.compareDocumentPosition(b)&4?-1:1;}:(r=function(a,b){if(a===b){g=!0;return 0;}if(a.sourceIndex&&b.sourceIndex){return a.sourceIndex-b.sourceIndex;}var c,d,e=[],f=[],h=a.parentNode,i=b.parentNode,j=h;if(h===i){return s(a,b);}if(!h){return -1;}if(!i){return 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 k=0;k<c&&k<d;k++){if(e[k]!==f[k]){return s(e[k],f[k]);}}return k===c?s(a,f[k],-1):s(e[k],b,1);},s=function(a,b,c){if(a===b){return c;}var d=a.nextSibling;while(d){if(d===b){return -1;}d=d.nextSibling;}return 1;}),k.getText=function(a){var b="",c;for(var d=0;a[d];d++){c=a[d],c.nodeType===3||c.nodeType===4?b+=c.nodeValue:c.nodeType!==8&&(b+=k.getText(c.childNodes));}return b;},function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[];}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b;}),e.removeChild(a),e=a=null;}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++){c[e].nodeType===1&&d.push(c[e]);}c=d;}return c;}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2);}),a=null;}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1]){return p(e.getElementsByTagName(b),f);}if(h[2]&&l.find.CLASS&&e.getElementsByClassName){return p(e.getElementsByClassName(h[2]),f);}}if(e.nodeType===9){if(b==="body"&&e.body){return p([e.body],f);}if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode){return p([],f);}if(i.id===h[3]){return p([i],f);}}try{return p(e.querySelectorAll(b),f);}catch(j){}}else{if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q){return p(e.querySelectorAll("[id='"+o+"'] "+b),f);}}catch(s){}finally{n||m.removeAttribute("id");}}}}return a(b,e,f,g);};for(var e in a){k[e]=a[e];}b=null;}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle");}catch(f){e=!0;}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a)){try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11){return f;}}}catch(g){}}return k(c,null,null,[a]).length>0;};}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1){return;}l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c){return b.getElementsByClassName(a[1]);}},a=null;}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0);}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return !!(a.compareDocumentPosition(b)&16);}:k.contains=function(){return !1;},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1;};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a)){e+=c[0],a=a.replace(l.match.PSEUDO,"");}a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g<h;g++){k(a,f[g],d);}return k.filter(e,d);};f.find=k,f.expr=k.selectors,f.expr[":"]=f.expr.filters,f.unique=k.uniqueSort,f.text=k.getText,f.isXMLDoc=k.isXML,f.contains=k.contains;}();var O=/Until$/,P=/^(?:parents|prevUntil|prevAll)/,Q=/,/,R=/^.[^:#\[\.,]*$/,S=Array.prototype.slice,T=f.expr.match.POS,U={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string"){return f(a).filter(function(){for(c=0,d=b.length;c<d;c++){if(f.contains(b[c],this)){return !0;}}});}var 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 e;},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++){if(f.contains(this,b[a])){return !0;}}});},not:function(a){return this.pushStack(W(this,a,!1),"not",a);},filter:function(a){return this.pushStack(W(this,a,!0),"filter",a);},is:function(a){return !!a&&(typeof a=="string"?f.filter(a,this).length>0:this.filter(a).length>0);},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d<e;d++){i=a[d],j[i]||(j[i]=T.test(i)?f(i,b||this.context):i);}while(g&&g.ownerDocument&&g!==b){for(i in j){h=j[i],(h.jquery?h.index(g)>-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});}g=g.parentNode,k++;}}return c;}var l=T.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(l?l.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 this.pushStack(c,"closest",a);},index:function(a){if(!a||typeof a=="string"){return f.inArray(this[0],a?f(a):this.parent().children());}return f.inArray(a.jquery?a[0]:a,this);},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(V(c[0])||V(d[0])?d:f.unique(d));},andSelf:function(){return this.add(this.prevObject);}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null;},parents:function(a){return f.dir(a,"parentNode");},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c);},next:function(a){return f.nth(a,2,"nextSibling");},prev:function(a){return f.nth(a,2,"previousSibling");},nextAll:function(a){return f.dir(a,"nextSibling");},prevAll:function(a){return f.dir(a,"previousSibling");},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c);},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c);},siblings:function(a){return f.sibling(a.parentNode.firstChild,a);},children:function(a){return f.sibling(a.firstChild);},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes);}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=S.call(arguments);O.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!U[a]?f.unique(e):e,(this.length>1||Q.test(d))&&P.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","));};}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b);},dir:function(a,c,d){var 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 e;},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c]){if(a.nodeType===1&&++e===b){break;}}return a;},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling){a.nodeType===1&&a!==b&&c.push(a);}return c;}});var X=/ jQuery\d+="(?:\d+|null)"/g,Y=/^\s+/,Z=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,$=/<([\w:]+)/,_=/<tbody/i,ba=/<|&#?\w+;/,bb=/<(?:script|object|embed|option|style)/i,bc=/checked\s*(?:[^=]|=\s*.checked.)/i,bd=/\/(java|ecma)script/i,be=/^\s*<!(?:\[CDATA\[|\-\-)/,bf={option:[1,"<select 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,"",""]};bf.optgroup=bf.option,bf.tbody=bf.tfoot=bf.colgroup=bf.caption=bf.thead,bf.th=bf.td,f.support.htmlSerialize||(bf._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){if(f.isFunction(a)){return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()));});}if(typeof a!="object"&&a!==b){return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));}return f.text(this);},wrapAll:function(a){if(f.isFunction(a)){return this.each(function(b){f(this).wrapAll(a.call(this,b));});}if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1){a=a.firstChild;}return a;}).append(this);}return this;},wrapInner:function(a){if(f.isFunction(a)){return this.each(function(b){f(this).wrapInner(a.call(this,b));});}return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a);});},wrap:function(a){return this.each(function(){f(this).wrapAll(a);});},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes);}).end();},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a);});},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild);});},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this);});}if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments);}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling);});}if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f(arguments[0]).toArray());return a;}},remove:function(a,b){for(var 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 this;},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild){b.removeChild(b.firstChild);}}return this;},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b);});},html:function(a){if(a===b){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(X,""):null;}if(typeof a=="string"&&!bb.test(a)&&(f.support.leadingWhitespace||!Y.test(a))&&!bf[($.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Z,"<$1></$2>");try{for(var c=0,d=this.length;c<d;c++){this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a);}}catch(e){this.empty().append(a);}}else{f.isFunction(a)?this.each(function(b){var c=f(this);c.html(a.call(this,b,c.html()));}):this.empty().append(a);}return this;},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a)){return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d));});}typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a);});}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this;},detach:function(a){return this.remove(a,!0);},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bc.test(j)){return this.each(function(){f(this).domManip(a,c,d,!0);});}if(f.isFunction(j)){return this.each(function(e){var 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 l=0,m=this.length,n=m-1;l<m;l++){d.call(c?bg(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h);}}k.length&&f.each(k,bm);}return this;}}),f.buildFragment=function(a,b,d){var e,g,h,i;b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof a[0]=="string"&&a[0].length<512&&i===c&&a[0].charAt(0)==="<"&&!bb.test(a[0])&&(f.support.checkClone||!bc.test(a[0]))&&(g=!0,h=f.fragments[a[0]],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[a[0]]=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 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 this;}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j);}return this.pushStack(d,a,e.selector);};}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bi(a,d),e=bj(a),g=bj(d);for(h=0;e[h];++h){bi(e[h],g[h]);}}if(b){bh(a,d);if(c){e=bj(a),g=bj(d);for(h=0;e[h];++h){bh(e[h],g[h]);}}}e=g=null;return d;},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k){continue;}if(typeof k=="string"){if(!ba.test(k)){k=b.createTextNode(k);}else{k=k.replace(Z,"<$1></$2>");var l=($.exec(k)||["",""])[1].toLowerCase(),m=bf[l]||bf._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--){o=o.lastChild;}if(!f.support.tbody){var p=_.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i){f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i]);}}!f.support.leadingWhitespace&&Y.test(k)&&o.insertBefore(b.createTextNode(Y.exec(k)[0]),o.firstChild),k=o.childNodes;}}var r;if(!f.support.appendChecked){if(k[0]&&typeof(r=k.length)=="number"){for(i=0;i<r;i++){bl(k[i]);}}else{bl(k);}}k.nodeType?h.push(k):h=f.merge(h,k);}if(d){g=function(a){return !a.type||bd.test(a.type);};for(j=0;h[j];j++){if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript")){e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j]);}else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);h.splice.apply(h,[j+1,0].concat(s));}d.appendChild(h[j]);}}}return h;},cleanData:function(a){var b,c,d=f.cache,e=f.expando,g=f.event.special,h=f.support.deleteExpando;for(var i=0,j;(j=a[i])!=null;i++){if(j.nodeName&&f.noData[j.nodeName.toLowerCase()]){continue;}c=j[f.expando];if(c){b=d[c]&&d[c][e];if(b&&b.events){for(var k in b.events){g[k]?f.event.remove(j,k):f.removeEvent(j,k,b.handle);}b.handle&&(b.handle.elem=null);}h?delete j[f.expando]:j.removeAttribute&&j.removeAttribute(f.expando),delete d[c];}}}});var bn=/alpha\([^)]*\)/i,bo=/opacity=([^)]*)/,bp=/([A-Z]|^ms)/g,bq=/^-?\d+(?:px)?$/i,br=/^-?\d/,bs=/^[+\-]=/,bt=/[^+\-\.\de]+/g,bu={position:"absolute",visibility:"hidden",display:"block"},bv=["Left","Right"],bw=["Top","Bottom"],bx,by,bz;f.fn.css=function(a,c){if(arguments.length===2&&c===b){return this;}return f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c);});},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bx(a,"opacity","opacity");return c===""?"1":c;}return 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 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 k&&(g=k.get(a,!1,e))!==b){return g;}return j[c];}h=typeof d;if(h==="number"&&isNaN(d)||d==null){return;}h==="string"&&bs.test(d)&&(d=+d.replace(bt,"")+parseFloat(f.css(a,c)),h="number"),h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set" in k)||(d=k.set(a,d))!==b){try{j[c]=d;}catch(l){}}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get" in g&&(e=g.get(a,!0,d))!==b){return e;}if(bx){return bx(a,c);}},swap:function(a,b,c){var d={};for(var e in b){d[e]=a.style[e],a.style[e]=b[e];}c.call(a);for(e in b){a.style[e]=d[e];}}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;if(c){if(a.offsetWidth!==0){return bA(a,b,d);}f.swap(a,bu,function(){e=bA(a,b,d);});return e;}},set:function(a,b){if(!bq.test(b)){return b;}b=parseFloat(b);if(b>=0){return b+"px";}}};}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bo.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":"";},set:function(a,b){var c=a.style,d=a.currentStyle;c.zoom=1;var e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.filter=bn.test(g)?g.replace(bn,e):g+" "+e;}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bx(a,"margin-right","marginRight"):c=a.style.marginRight;});return c;}});}),c.defaultView&&c.defaultView.getComputedStyle&&(by=function(a,c){var d,e,g;c=c.replace(bp,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView)){return b;}if(g=e.getComputedStyle(a,null)){d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));}return d;}),c.documentElement.currentStyle&&(bz=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bq.test(d)&&br.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d;}),bx=by||bz,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style.display||f.css(a,"display"))==="none";},f.expr.filters.visible=function(a){return !f.expr.filters.hidden(a);});var bB=/%20/g,bC=/\[\]$/,bD=/\r?\n/g,bE=/#.*$/,bF=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bG=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bH=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,bI=/^(?:GET|HEAD)$/,bJ=/^\/\//,bK=/\?/,bL=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bM=/^(?:select|textarea)/i,bN=/\s+/,bO=/([?&])_=[^&]*/,bP=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bQ=f.fn.load,bR={},bS={},bT,bU;try{bT=e.href;}catch(bV){bT=c.createElement("a"),bT.href="",bT=bT.href;}bU=bP.exec(bT.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bQ){return bQ.apply(this,arguments);}if(!this.length){return this;}var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e);}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var 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(bL,"")).find(g):c)),d&&i.each(d,[c,b,a]);}});return this;},serialize:function(){return f.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||bM.test(this.nodeName)||bG.test(this.type));}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bD,"\r\n")};}):{name:b.name,value:c.replace(bD,"\r\n")};}).get();}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(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 f.ajax({type:c,url:a,data:d,success:e,dataType:g});};}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script");},getJSON:function(a,b,c){return f.get(a,b,c,"json");},ajaxSetup:function(a,b){b?f.extend(!0,a,f.ajaxSettings,b):(b=a,a=f.extend(!0,f.ajaxSettings,b));for(var c in {context:1,url:1}){c in b?a[c]=b[c]:c in f.ajaxSettings&&(a[c]=f.ajaxSettings[c]);}return a;},ajaxSettings:{url:bT,isLocal:bH.test(bU[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML}},ajaxPrefilter:bW(bR),ajaxTransport:bW(bS),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a?4:0;var o,r,u,w=l?bZ(d,v,l):b,x,y;if(a>=200&&a<300||a===304){if(d.ifModified){if(x=v.getResponseHeader("Last-Modified")){f.lastModified[k]=x;}if(y=v.getResponseHeader("Etag")){f.etag[k]=y;}}if(a===304){c="notmodified",o=!0;}else{try{r=b$(d,w),c="success",o=!0;}catch(z){c="parsererror",u=z;}}}else{u=c;if(!c||a){c="error",a<0&&(a=0);}}v.status=a,v.statusText=c,o?h.resolveWith(e,[r,c,v]):h.rejectWith(e,[v,c,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,c]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"));}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),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 c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b;}return this;},getAllResponseHeaders:function(){return s===2?n:null;},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bF.exec(n)){o[c[1].toLowerCase()]=c[2];}}c=o[a.toLowerCase()];}return c===b?null:c;},overrideMimeType:function(a){s||(d.mimeType=a);return this;},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this;}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;if(s<2){for(b in a){j[b]=[j[b],a[b]];}}else{b=a[v.status],v.then(b,b);}}return this;},d.url=((a||d.url)+"").replace(bE,"").replace(bJ,bU[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bN),d.crossDomain==null&&(r=bP.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bU[1]&&r[2]==bU[2]&&(r[3]||(r[1]==="http:"?80:443))==(bU[3]||(bU[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bX(bR,d,c,v);if(s===2){return !1;}t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bI.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bK.test(d.url)?"&":"?")+d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bO,"$1_="+x);d.url=y+(y===d.url?(bK.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]!=="*"?", */*; q=0.01":""):d.accepts["*"]);for(u in 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 in {success:1,error:1,complete:1}){v[u](d[u]);}p=bX(bS,d,c,v);if(!p){w(-1,"No 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){status<2?w(-1,z):f.error(z);}}return v;},param:function(a,c){var 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(this.name,this.value);});}else{for(var g in a){bY(g,a[g],c,e);}}return d.join("&").replace(bB,"+");}}),f.extend({active:0,lastModified:{},etag:{}});var b_=f.now(),ca=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+b_++;}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ca.test(b.url)||e&&ca.test(b.data))){var 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(ca,l),b.url===j&&(e&&(k=k.replace(ca,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 json"]=function(){g||f.error(h+" was not called");return g[0];},b.dataTypes[0]="json";return"script";}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return 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 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 cb=a.ActiveXObject?function(){for(var a in cd){cd[a](0,1);}}:!1,cc=0,cd;f.ajaxSettings.xhr=a.ActiveXObject?function(){return !this.isLocal&&ce()||cf();}:ce,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials" in a});}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var 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 in 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 in e){h.setRequestHeader(j,e[j]);}}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cb&&delete cd[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),m.text=h.responseText;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=++cc,cb&&(cd||(cd={},f(a).unload(cb)),cd[i]=d),h.onreadystatechange=d);},abort:function(){d&&d(0,1);}};}});var cg={},ch,ci,cj=/^(?:toggle|show|hide)$/,ck=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cl,cm=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cn,co=a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0){return this.animate(cr("show",3),a,b,c);}for(var 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._data(d,"olddisplay",cs(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 this;},hide:function(a,b,c){if(a||a===0){return this.animate(cr("hide",3),a,b,c);}for(var d=0,e=this.length;d<e;d++){if(this[d].style){var g=f.css(this[d],"display");g!=="none"&&!f._data(this[d],"olddisplay")&&f._data(this[d],"olddisplay",g);}}for(d=0;d<e;d++){this[d].style&&(this[d].style.display="none");}return this;},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]();}):this.animate(cr("toggle",3),a,b,c);return this;},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d);},animate:function(a,b,c,d){var e=f.speed(b,c,d);if(f.isEmptyObject(a)){return this.each(e.complete,[!1]);}a=f.extend({},a);return this[e.queue===!1?"each":"queue"](function(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),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 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?(j=cs(this.nodeName),j==="inline"?this.style.display="inline-block":(this.style.display="inline",this.style.zoom=1)):this.style.display="inline-block"));}b.overflow!=null&&(this.style.overflow="hidden");for(i in a){k=new f.fx(this,b,i),h=a[i],cj.test(h)?k[h==="toggle"?d?"show":"hide":h]():(l=ck.exec(h),m=k.cur(),l?(n=parseFloat(l[2]),o=l[3]||(f.cssNumber[i]?"":"px"),o!=="px"&&(f.style(this,i,(n||1)+o),m=(n||1)/k.cur()*m,f.style(this,i,m+o)),l[1]&&(n=(l[1]==="-="?-1:1)*n+m),k.custom(m,n,o)):k.custom(m,h,""));}return !0;});},stop:function(a,b){a&&this.queue([]),this.each(function(){var a=f.timers,c=a.length;b||f._unmark(!0,this);while(c--){a[c].elem===this&&(b&&a[c](!0),a.splice(c,1));}}),b||this.dequeue();return this;}}),f.each({slideDown:cr("show",1),slideUp:cr("hide",1),slideToggle:cr("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d);};}),f.extend({speed:function(a,b,c){var d=a&&typeof 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 d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default,d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue!==!1?f.dequeue(this):a!==!1&&f._unmark(this);};return d;},easing:{linear:function(a,b,c,d){return c+d*a;},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+0.5)*d+c;}},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 this.elem[this.prop];}var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a;},custom:function(a,b,c){function h(a){return d.step(a);}var d=this,e=f.fx,g;this.startTime=cn||cp(),this.start=a,this.end=b,this.unit=c||this.unit||(f.cssNumber[this.prop]?"":"px"),this.now=this.start,this.pos=this.state=0,h.elem=this.elem,h()&&f.timers.push(h)&&!cl&&(co?(cl=!0,g=function(){cl&&(co(g),e.tick());},co(g)):cl=setInterval(e.tick,e.interval));},show:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.show=!0,this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show();},hide:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0);},step:function(a){var b=cn||cp(),c=!0,d=this.elem,e=this.options,g,h;if(a||b>=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties){e.animatedProperties[g]!==!0&&(c=!1);}if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a];}),e.hide&&f(d).hide();if(e.hide||e.show){for(var i in e.animatedProperties){f.style(d,i,e.orig[i]);}}e.complete.call(d);}return !1;}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return !0;}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b<a.length;++b){a[b]()||a.splice(b--,1);}a.length||f.fx.stop();},interval:13,stop:function(){clearInterval(cl),cl=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.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit:a.elem[a.prop]=a.now;}}}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem;}).length;});var ct=/^t(?:able|d|h)$/i,cu=/^(?:body|html)$/i;"getBoundingClientRect" in c.documentElement?f.fn.offset=function(a){var b=this[0],c;if(a){return this.each(function(b){f.offset.setOffset(this,a,b);});}if(!b||!b.ownerDocument){return null;}if(b===b.ownerDocument.body){return f.offset.bodyOffset(b);}try{c=b.getBoundingClientRect();}catch(d){}var e=b.ownerDocument,g=e.documentElement;if(!c||!f.contains(g,b)){return c?{top:c.top,left:c.left}:{top:0,left:0};}var h=e.body,i=cv(e),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||f.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||f.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o};}:f.fn.offset=function(a){var b=this[0];if(a){return this.each(function(b){f.offset.setOffset(this,a,b);});}if(!b||!b.ownerDocument){return null;}if(b===b.ownerDocument.body){return f.offset.bodyOffset(b);}f.offset.initialize();var c,d=b.offsetParent,e=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(f.offset.supportsFixedPosition&&k.position==="fixed"){break;}c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===d&&(l+=b.offsetTop,m+=b.offsetLeft,f.offset.doesNotAddBorder&&(!f.offset.doesAddBorderForTableAndCells||!ct.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.offset.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c;}if(k.position==="relative"||k.position==="static"){l+=i.offsetTop,m+=i.offsetLeft;}f.offset.supportsFixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m};},f.offset={initialize:function(){var a=c.body,b=c.createElement("div"),d,e,g,h,i=parseFloat(f.css(a,"marginTop"))||0,j="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop;},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.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 d=f.css(a,"position");d==="static"&&(a.style.position="relative");var 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 b?b.using.call(a,k):e.css(k);}},f.fn.extend({position:function(){if(!this[0]){return null;}var a=this[0],b=this.offsetParent(),c=this.offset(),d=cu.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 this.map(function(){var a=this.offsetParent||c.body;while(a&&!cu.test(a.nodeName)&&f.css(a,"position")==="static"){a=a.offsetParent;}return a;});}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e){return null;}g=cv(e);return g?"pageXOffset" in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d];}return this.each(function(){g=cv(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c;});};}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a&&a.style?parseFloat(f.css(a,d,"padding")):null;},f.fn["outer"+c]=function(a){var b=this[0];return b&&b.style?parseFloat(f.css(b,d,a?"margin":"border")):null;},f.fn[d]=function(a){var e=this[0];if(!e){return a==null?null:this;}if(f.isFunction(a)){return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()));});}if(f.isWindow(e)){var g=e.document.documentElement["client"+c];return e.document.compatMode==="CSS1Compat"&&g||e.document.body["client"+c]||g;}if(e.nodeType===9){return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);}if(a===b){var h=f.css(e,d),i=parseFloat(h);return f.isNaN(i)?h:i;}return this.css(d,typeof a=="string"?a:a+"px");};}),a.jQuery=a.$=f;})(window);
/*
 * jQuery UI 1.8.16
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI
 */
(function(g,f){function e(k,c){var l=k.nodeName.toLowerCase();if("area"===l){c=k.parentNode;l=c.name;if(!k.href||!l||c.nodeName.toLowerCase()!=="map"){return false;}k=g("img[usemap=#"+l+"]")[0];return !!k&&d(k);}return(/input|select|textarea|button|object/.test(l)?!k.disabled:"a"==l?k.href||c:c)&&d(k);}function d(c){return !g(c).parents().andSelf().filter(function(){return g.curCSS(this,"visibility")==="hidden"||g.expr.filters.hidden(this);}).length;}g.ui=g.ui||{};if(!g.ui.version){g.extend(g.ui,{version:"1.8.16",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});g.fn.extend({propAttr:g.fn.prop||g.fn.attr,_focus:g.fn.focus,focus:function(k,c){return typeof k==="number"?this.each(function(){var l=this;setTimeout(function(){g(l).focus();c&&c.call(l);},k);}):this._focus.apply(this,arguments);},scrollParent:function(){var c;c=g.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(g.curCSS(this,"position",1))&&/(auto|scroll)/.test(g.curCSS(this,"overflow",1)+g.curCSS(this,"overflow-y",1)+g.curCSS(this,"overflow-x",1));}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(g.curCSS(this,"overflow",1)+g.curCSS(this,"overflow-y",1)+g.curCSS(this,"overflow-x",1));}).eq(0);return/fixed/.test(this.css("position"))||!c.length?g(document):c;},zIndex:function(k){if(k!==f){return this.css("zIndex",k);}if(this.length){k=g(this[0]);for(var c;k.length&&k[0]!==document;){c=k.css("position");if(c==="absolute"||c==="relative"||c==="fixed"){c=parseInt(k.css("zIndex"),10);if(!isNaN(c)&&c!==0){return c;}}k=k.parent();}}return 0;},disableSelection:function(){return this.bind((g.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(c){c.preventDefault();});},enableSelection:function(){return this.unbind(".ui-disableSelection");}});g.each(["Width","Height"],function(k,c){function q(u,s,r,v){g.each(o,function(){s-=parseFloat(g.curCSS(u,"padding"+this,true))||0;if(r){s-=parseFloat(g.curCSS(u,"border"+this+"Width",true))||0;}if(v){s-=parseFloat(g.curCSS(u,"margin"+this,true))||0;}});return s;}var o=c==="Width"?["Left","Right"]:["Top","Bottom"],m=c.toLowerCase(),l={innerWidth:g.fn.innerWidth,innerHeight:g.fn.innerHeight,outerWidth:g.fn.outerWidth,outerHeight:g.fn.outerHeight};g.fn["inner"+c]=function(r){if(r===f){return l["inner"+c].call(this);}return this.each(function(){g(this).css(m,q(this,r)+"px");});};g.fn["outer"+c]=function(s,r){if(typeof s!=="number"){return l["outer"+c].call(this,s);}return this.each(function(){g(this).css(m,q(this,s,true,r)+"px");});};});g.extend(g.expr[":"],{data:function(k,c,l){return !!g.data(k,l[3]);},focusable:function(c){return e(c,!isNaN(g.attr(c,"tabindex")));},tabbable:function(k){var c=g.attr(k,"tabindex"),l=isNaN(c);return(l||c>=0)&&e(k,!l);}});g(function(){var k=document.body,c=k.appendChild(c=document.createElement("div"));g.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});g.support.minHeight=c.offsetHeight===100;g.support.selectstart="onselectstart" in c;k.removeChild(c).style.display="none";});g.extend(g.ui,{plugin:{add:function(k,c,m){k=g.ui[k].prototype;for(var l in m){k.plugins[l]=k.plugins[l]||[];k.plugins[l].push([c,m[l]]);}},call:function(k,c,m){if((c=k.plugins[c])&&k.element[0].parentNode){for(var l=0;l<c.length;l++){k.options[c[l][0]]&&c[l][1].apply(k.element,m);}}}},contains:function(k,c){return document.compareDocumentPosition?k.compareDocumentPosition(c)&16:k!==c&&k.contains(c);},hasScroll:function(k,c){if(g(k).css("overflow")==="hidden"){return false;}c=c&&c==="left"?"scrollLeft":"scrollTop";var l=false;if(k[c]>0){return true;}k[c]=1;l=k[c]>0;k[c]=0;return l;},isOverAxis:function(k,c,l){return k>c&&k<c+l;},isOver:function(k,c,q,o,m,l){return g.ui.isOverAxis(k,q,m)&&g.ui.isOverAxis(c,o,l);}});}})(jQuery);
/*
 * jQuery UI Widget 1.8.16
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Widget
 */
(function(c,f){if(c.cleanData){var e=c.cleanData;c.cleanData=function(g){for(var m=0,l;(l=g[m])!=null;m++){try{c(l).triggerHandler("remove");}catch(k){}}e(g);};}else{var d=c.fn.remove;c.fn.remove=function(g,k){return this.each(function(){if(!k){if(!g||c.filter(g,[this]).length){c("*",this).add([this]).each(function(){try{c(this).triggerHandler("remove");}catch(l){}});}}return d.call(c(this),g,k);});};}c.widget=function(g,o,m){var l=g.split(".")[0],k;g=g.split(".")[1];k=l+"-"+g;if(!m){m=o;o=c.Widget;}c.expr[":"][k]=function(q){return !!c.data(q,g);};c[l]=c[l]||{};c[l][g]=function(q,r){arguments.length&&this._createWidget(q,r);};o=new o;o.options=c.extend(true,{},o.options);c[l][g].prototype=c.extend(true,o,{namespace:l,widgetName:g,widgetEventPrefix:c[l][g].prototype.widgetEventPrefix||g,widgetBaseClass:k},m);c.widget.bridge(g,c[l][g]);};c.widget.bridge=function(g,k){c.fn[g]=function(q){var o=typeof q==="string",m=Array.prototype.slice.call(arguments,1),l=this;q=!o&&m.length?c.extend.apply(null,[true,q].concat(m)):q;if(o&&q.charAt(0)==="_"){return l;}o?this.each(function(){var s=c.data(this,g),r=s&&c.isFunction(s[q])?s[q].apply(s,m):s;if(r!==s&&r!==f){l=r;return false;}}):this.each(function(){var r=c.data(this,g);r?r.option(q||{})._init():c.data(this,g,new k(q,this));});return l;};};c.Widget=function(g,k){arguments.length&&this._createWidget(g,k);};c.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(g,l){c.data(l,this.widgetName,this);this.element=c(l);this.options=c.extend(true,{},this.options,this._getCreateOptions(),g);var k=this;this.element.bind("remove."+this.widgetName,function(){k.destroy();});this._create();this._trigger("create");this._init();},_getCreateOptions:function(){return c.metadata&&c.metadata.get(this.element[0])[this.widgetName];},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled");},widget:function(){return this.element;},option:function(g,l){var k=g;if(arguments.length===0){return c.extend({},this.options);}if(typeof g==="string"){if(l===f){return this.options[g];}k={};k[g]=l;}this._setOptions(k);return this;},_setOptions:function(g){var k=this;c.each(g,function(m,l){k._setOption(m,l);});return this;},_setOption:function(g,k){this.options[g]=k;if(g==="disabled"){this.widget()[k?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",k);}return this;},enable:function(){return this._setOption("disabled",false);},disable:function(){return this._setOption("disabled",true);},_trigger:function(g,o,m){var l=this.options[g];o=c.Event(o);o.type=(g===this.widgetEventPrefix?g:this.widgetEventPrefix+g).toLowerCase();m=m||{};if(o.originalEvent){g=c.event.props.length;for(var k;g;){k=c.event.props[--g];o[k]=o.originalEvent[k];}}this.element.trigger(o,m);return !(c.isFunction(l)&&l.call(this.element[0],o,m)===false||o.isDefaultPrevented());}};})(jQuery);
/*
 * jQuery UI Mouse 1.8.16
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Mouse
 *
 * Depends:
 *	jquery.ui.widget.js
 */
(function(c){var e=false;c(document).mouseup(function(){e=false;});c.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var d=this;this.element.bind("mousedown."+this.widgetName,function(f){return d._mouseDown(f);}).bind("click."+this.widgetName,function(f){if(true===c.data(f.target,d.widgetName+".preventClickEvent")){c.removeData(f.target,d.widgetName+".preventClickEvent");f.stopImmediatePropagation();return false;}});this.started=false;},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);},_mouseDown:function(d){if(!e){this._mouseStarted&&this._mouseUp(d);this._mouseDownEvent=d;var m=this,l=d.which==1,k=typeof this.options.cancel=="string"&&d.target.nodeName?c(d.target).closest(this.options.cancel).length:false;if(!l||k||!this._mouseCapture(d)){return true;}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){m.mouseDelayMet=true;},this.options.delay);}if(this._mouseDistanceMet(d)&&this._mouseDelayMet(d)){this._mouseStarted=this._mouseStart(d)!==false;if(!this._mouseStarted){d.preventDefault();return true;}}true===c.data(d.target,this.widgetName+".preventClickEvent")&&c.removeData(d.target,this.widgetName+".preventClickEvent");this._mouseMoveDelegate=function(f){return m._mouseMove(f);};this._mouseUpDelegate=function(f){return m._mouseUp(f);};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);d.preventDefault();return e=true;}},_mouseMove:function(d){if(c.browser.msie&&!(document.documentMode>=9)&&!d.button){return this._mouseUp(d);}if(this._mouseStarted){this._mouseDrag(d);return d.preventDefault();}if(this._mouseDistanceMet(d)&&this._mouseDelayMet(d)){(this._mouseStarted=this._mouseStart(this._mouseDownEvent,d)!==false)?this._mouseDrag(d):this._mouseUp(d);}return !this._mouseStarted;},_mouseUp:function(d){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;d.target==this._mouseDownEvent.target&&c.data(d.target,this.widgetName+".preventClickEvent",true);this._mouseStop(d);}return false;},_mouseDistanceMet:function(d){return Math.max(Math.abs(this._mouseDownEvent.pageX-d.pageX),Math.abs(this._mouseDownEvent.pageY-d.pageY))>=this.options.distance;},_mouseDelayMet:function(){return this.mouseDelayMet;},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true;}});})(jQuery);(function(k){k.ui=k.ui||{};var g=/left|center|right/,f=/top|center|bottom/,e=k.fn.position,d=k.fn.offset;k.fn.position=function(c){if(!c||!c.of){return e.apply(this,arguments);}c=k.extend({},c);var l=k(c.of),u=l[0],r=(c.collision||"flip").split(" "),s=c.offset?c.offset.split(" "):[0,0],q,m,o;if(u.nodeType===9){q=l.width();m=l.height();o={top:0,left:0};}else{if(u.setTimeout){q=l.width();m=l.height();o={top:l.scrollTop(),left:l.scrollLeft()};}else{if(u.preventDefault){c.at="left top";q=m=0;o={top:c.of.pageY,left:c.of.pageX};}else{q=l.outerWidth();m=l.outerHeight();o=l.offset();}}}k.each(["my","at"],function(){var v=(c[this]||"").split(" ");if(v.length===1){v=g.test(v[0])?v.concat(["center"]):f.test(v[0])?["center"].concat(v):["center","center"];}v[0]=g.test(v[0])?v[0]:"center";v[1]=f.test(v[1])?v[1]:"center";c[this]=v;});if(r.length===1){r[1]=r[0];}s[0]=parseInt(s[0],10)||0;if(s.length===1){s[1]=s[0];}s[1]=parseInt(s[1],10)||0;if(c.at[0]==="right"){o.left+=q;}else{if(c.at[0]==="center"){o.left+=q/2;}}if(c.at[1]==="bottom"){o.top+=m;}else{if(c.at[1]==="center"){o.top+=m/2;}}o.left+=s[0];o.top+=s[1];return this.each(function(){var F=k(this),D=F.outerWidth(),C=F.outerHeight(),B=parseInt(k.curCSS(this,"marginLeft",true))||0,A=parseInt(k.curCSS(this,"marginTop",true))||0,H=D+B+(parseInt(k.curCSS(this,"marginRight",true))||0),G=C+A+(parseInt(k.curCSS(this,"marginBottom",true))||0),E=k.extend({},o),y;if(c.my[0]==="right"){E.left-=D;}else{if(c.my[0]==="center"){E.left-=D/2;}}if(c.my[1]==="bottom"){E.top-=C;}else{if(c.my[1]==="center"){E.top-=C/2;}}E.left=Math.round(E.left);E.top=Math.round(E.top);y={left:E.left-B,top:E.top-A};k.each(["left","top"],function(w,v){k.ui.position[r[w]]&&k.ui.position[r[w]][v](E,{targetWidth:q,targetHeight:m,elemWidth:D,elemHeight:C,collisionPosition:y,collisionWidth:H,collisionHeight:G,offset:s,my:c.my,at:c.at});});k.fn.bgiframe&&F.bgiframe();F.offset(k.extend(E,{using:c.using}));});};k.ui.position={fit:{left:function(c,l){var m=k(window);m=l.collisionPosition.left+l.collisionWidth-m.width()-m.scrollLeft();c.left=m>0?c.left-m:Math.max(c.left-l.collisionPosition.left,c.left);},top:function(c,l){var m=k(window);m=l.collisionPosition.top+l.collisionHeight-m.height()-m.scrollTop();c.top=m>0?c.top-m:Math.max(c.top-l.collisionPosition.top,c.top);}},flip:{left:function(c,l){if(l.at[0]!=="center"){var r=k(window);r=l.collisionPosition.left+l.collisionWidth-r.width()-r.scrollLeft();var o=l.my[0]==="left"?-l.elemWidth:l.my[0]==="right"?l.elemWidth:0,q=l.at[0]==="left"?l.targetWidth:-l.targetWidth,m=-2*l.offset[0];c.left+=l.collisionPosition.left<0?o+q+m:r>0?o+q+m:0;}},top:function(c,l){if(l.at[1]!=="center"){var r=k(window);r=l.collisionPosition.top+l.collisionHeight-r.height()-r.scrollTop();var o=l.my[1]==="top"?-l.elemHeight:l.my[1]==="bottom"?l.elemHeight:0,q=l.at[1]==="top"?l.targetHeight:-l.targetHeight,m=-2*l.offset[1];c.top+=l.collisionPosition.top<0?o+q+m:r>0?o+q+m:0;}}}};if(!k.offset.setOffset){k.offset.setOffset=function(c,l){if(/static/.test(k.curCSS(c,"position"))){c.style.position="relative";}var r=k(c),o=r.offset(),q=parseInt(k.curCSS(c,"top",true),10)||0,m=parseInt(k.curCSS(c,"left",true),10)||0;o={top:l.top-o.top+q,left:l.left-o.left+m};"using" in l?l.using.call(c,o):r.css(o);};k.fn.offset=function(c){var l=this[0];if(!l||!l.ownerDocument){return null;}if(c){return this.each(function(){k.offset.setOffset(this,c);});}return d.call(this);};}})(jQuery);(function(c){c.widget("ui.draggable",c.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))){this.element[0].style.position="relative";}this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit();},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this;}},_mouseCapture:function(e){var d=this.options;if(this.helper||d.disabled||c(e.target).is(".ui-resizable-handle")){return false;}this.handle=this._getHandle(e);if(!this.handle){return false;}if(d.iframeFix){c(d.iframeFix===true?"iframe":d.iframeFix).each(function(){c('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(c(this).offset()).appendTo("body");});}return true;},_mouseStart:function(e){var d=this.options;this.helper=this._createHelper(e);this._cacheHelperProportions();if(c.ui.ddmanager){c.ui.ddmanager.current=this;}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};c.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(e);this.originalPageX=e.pageX;this.originalPageY=e.pageY;d.cursorAt&&this._adjustOffsetFromHelper(d.cursorAt);d.containment&&this._setContainment();if(this._trigger("start",e)===false){this._clear();return false;}this._cacheHelperProportions();c.ui.ddmanager&&!d.dropBehaviour&&c.ui.ddmanager.prepareOffsets(this,e);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(e,true);c.ui.ddmanager&&c.ui.ddmanager.dragStart(this,e);return true;},_mouseDrag:function(e,d){this.position=this._generatePosition(e);this.positionAbs=this._convertPositionTo("absolute");if(!d){d=this._uiHash();if(this._trigger("drag",e,d)===false){this._mouseUp({});return false;}this.position=d.position;}if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px";}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px";}c.ui.ddmanager&&c.ui.ddmanager.drag(this,e);return false;},_mouseStop:function(e){var d=false;if(c.ui.ddmanager&&!this.options.dropBehaviour){d=c.ui.ddmanager.drop(this,e);}if(this.dropped){d=this.dropped;this.dropped=false;}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original"){return false;}if(this.options.revert=="invalid"&&!d||this.options.revert=="valid"&&d||this.options.revert===true||c.isFunction(this.options.revert)&&this.options.revert.call(this.element,d)){var f=this;c(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){f._trigger("stop",e)!==false&&f._clear();});}else{this._trigger("stop",e)!==false&&this._clear();}return false;},_mouseUp:function(d){this.options.iframeFix===true&&c("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this);});c.ui.ddmanager&&c.ui.ddmanager.dragStop(this,d);return c.ui.mouse.prototype._mouseUp.call(this,d);},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this;},_getHandle:function(e){var d=!this.options.handle||!c(this.options.handle,this.element).length?true:false;c(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==e.target){d=true;}});return d;},_createHelper:function(e){var d=this.options;e=c.isFunction(d.helper)?c(d.helper.apply(this.element[0],[e])):d.helper=="clone"?this.element.clone().removeAttr("id"):this.element;e.parents("body").length||e.appendTo(d.appendTo=="parent"?this.element[0].parentNode:d.appendTo);e[0]!=this.element[0]&&!/(fixed|absolute)/.test(e.css("position"))&&e.css("position","absolute");return e;},_adjustOffsetFromHelper:function(d){if(typeof d=="string"){d=d.split(" ");}if(c.isArray(d)){d={left:+d[0],top:+d[1]||0};}if("left" in d){this.offset.click.left=d.left+this.margins.left;}if("right" in d){this.offset.click.left=this.helperProportions.width-d.right+this.margins.left;}if("top" in d){this.offset.click.top=d.top+this.margins.top;}if("bottom" in d){this.offset.click.top=this.helperProportions.height-d.bottom+this.margins.top;}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var d=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&c.ui.contains(this.scrollParent[0],this.offsetParent[0])){d.left+=this.scrollParent.scrollLeft();d.top+=this.scrollParent.scrollTop();}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&c.browser.msie){d={top:0,left:0};}return{top:d.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:d.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var d=this.element.position();return{top:d.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:d.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()};}else{return{top:0,left:0};}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0};},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};},_setContainment:function(){var e=this.options;if(e.containment=="parent"){e.containment=this.helper[0].parentNode;}if(e.containment=="document"||e.containment=="window"){this.containment=[e.containment=="document"?0:c(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,e.containment=="document"?0:c(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(e.containment=="document"?0:c(window).scrollLeft())+c(e.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(e.containment=="document"?0:c(window).scrollTop())+(c(e.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];}if(!/^(document|window|parent)$/.test(e.containment)&&e.containment.constructor!=Array){e=c(e.containment);var d=e[0];if(d){e.offset();var f=c(d).css("overflow")!="hidden";this.containment=[(parseInt(c(d).css("borderLeftWidth"),10)||0)+(parseInt(c(d).css("paddingLeft"),10)||0),(parseInt(c(d).css("borderTopWidth"),10)||0)+(parseInt(c(d).css("paddingTop"),10)||0),(f?Math.max(d.scrollWidth,d.offsetWidth):d.offsetWidth)-(parseInt(c(d).css("borderLeftWidth"),10)||0)-(parseInt(c(d).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(f?Math.max(d.scrollHeight,d.offsetHeight):d.offsetHeight)-(parseInt(c(d).css("borderTopWidth"),10)||0)-(parseInt(c(d).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relative_container=e;}}else{if(e.containment.constructor==Array){this.containment=e.containment;}}},_convertPositionTo:function(e,d){if(!d){d=this.position;}e=e=="absolute"?1:-1;var k=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&c.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(k[0].tagName);return{top:d.top+this.offset.relative.top*e+this.offset.parent.top*e-(c.browser.safari&&c.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:k.scrollTop())*e),left:d.left+this.offset.relative.left*e+this.offset.parent.left*e-(c.browser.safari&&c.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:k.scrollLeft())*e)};},_generatePosition:function(k){var d=this.options,r=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&c.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,o=/(html|body)/i.test(r[0].tagName),q=k.pageX,l=k.pageY;if(this.originalPosition){var m;if(this.containment){if(this.relative_container){m=this.relative_container.offset();m=[this.containment[0]+m.left,this.containment[1]+m.top,this.containment[2]+m.left,this.containment[3]+m.top];}else{m=this.containment;}if(k.pageX-this.offset.click.left<m[0]){q=m[0]+this.offset.click.left;}if(k.pageY-this.offset.click.top<m[1]){l=m[1]+this.offset.click.top;}if(k.pageX-this.offset.click.left>m[2]){q=m[2]+this.offset.click.left;}if(k.pageY-this.offset.click.top>m[3]){l=m[3]+this.offset.click.top;}}if(d.grid){l=d.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/d.grid[1])*d.grid[1]:this.originalPageY;l=m?!(l-this.offset.click.top<m[1]||l-this.offset.click.top>m[3])?l:!(l-this.offset.click.top<m[1])?l-d.grid[1]:l+d.grid[1]:l;q=d.grid[0]?this.originalPageX+Math.round((q-this.originalPageX)/d.grid[0])*d.grid[0]:this.originalPageX;q=m?!(q-this.offset.click.left<m[0]||q-this.offset.click.left>m[2])?q:!(q-this.offset.click.left<m[0])?q-d.grid[0]:q+d.grid[0]:q;}}return{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(c.browser.safari&&c.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():o?0:r.scrollTop()),left:q-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(c.browser.safari&&c.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():o?0:r.scrollLeft())};},_clear:function(){this.helper.removeClass("ui-draggable-dragging");this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove();this.helper=null;this.cancelHelperRemoval=false;},_trigger:function(e,d,f){f=f||this._uiHash();c.ui.plugin.call(this,e,[d,f]);if(e=="drag"){this.positionAbs=this._convertPositionTo("absolute");}return c.Widget.prototype._trigger.call(this,e,d,f);},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs};}});c.extend(c.ui.draggable,{version:"1.8.16"});c.ui.plugin.add("draggable","connectToSortable",{start:function(g,d){var m=c(this).data("draggable"),k=m.options,l=c.extend({},d,{item:m.element});m.sortables=[];c(k.connectToSortable).each(function(){var e=c.data(this,"sortable");if(e&&!e.options.disabled){m.sortables.push({instance:e,shouldRevert:e.options.revert});e.refreshPositions();e._trigger("activate",g,l);}});},stop:function(e,d){var k=c(this).data("draggable"),g=c.extend({},d,{item:k.element});c.each(k.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;k.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert){this.instance.options.revert=true;}this.instance._mouseStop(e);this.instance.options.helper=this.instance.options._helper;k.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"});}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",e,g);}});},drag:function(e,d){var k=c(this).data("draggable"),g=this;c.each(k.sortables,function(){this.instance.positionAbs=k.positionAbs;this.instance.helperProportions=k.helperProportions;this.instance.offset.click=k.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=c(g).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return d.helper[0];};e.target=this.instance.currentItem[0];this.instance._mouseCapture(e,true);this.instance._mouseStart(e,true,true);this.instance.offset.click.top=k.offset.click.top;this.instance.offset.click.left=k.offset.click.left;this.instance.offset.parent.left-=k.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=k.offset.parent.top-this.instance.offset.parent.top;k._trigger("toSortable",e);k.dropped=this.instance.element;k.currentItem=k.element;this.instance.fromOutside=k;}this.instance.currentItem&&this.instance._mouseDrag(e);}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",e,this.instance._uiHash(this.instance));this.instance._mouseStop(e,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();this.instance.placeholder&&this.instance.placeholder.remove();k._trigger("fromSortable",e);k.dropped=false;}}});}});c.ui.plugin.add("draggable","cursor",{start:function(){var e=c("body"),d=c(this).data("draggable").options;if(e.css("cursor")){d._cursor=e.css("cursor");}e.css("cursor",d.cursor);},stop:function(){var d=c(this).data("draggable").options;d._cursor&&c("body").css("cursor",d._cursor);}});c.ui.plugin.add("draggable","opacity",{start:function(e,d){e=c(d.helper);d=c(this).data("draggable").options;if(e.css("opacity")){d._opacity=e.css("opacity");}e.css("opacity",d.opacity);},stop:function(e,d){e=c(this).data("draggable").options;e._opacity&&c(d.helper).css("opacity",e._opacity);}});c.ui.plugin.add("draggable","scroll",{start:function(){var d=c(this).data("draggable");if(d.scrollParent[0]!=document&&d.scrollParent[0].tagName!="HTML"){d.overflowOffset=d.scrollParent.offset();}},drag:function(e){var d=c(this).data("draggable"),k=d.options,g=false;if(d.scrollParent[0]!=document&&d.scrollParent[0].tagName!="HTML"){if(!k.axis||k.axis!="x"){if(d.overflowOffset.top+d.scrollParent[0].offsetHeight-e.pageY<k.scrollSensitivity){d.scrollParent[0].scrollTop=g=d.scrollParent[0].scrollTop+k.scrollSpeed;}else{if(e.pageY-d.overflowOffset.top<k.scrollSensitivity){d.scrollParent[0].scrollTop=g=d.scrollParent[0].scrollTop-k.scrollSpeed;}}}if(!k.axis||k.axis!="y"){if(d.overflowOffset.left+d.scrollParent[0].offsetWidth-e.pageX<k.scrollSensitivity){d.scrollParent[0].scrollLeft=g=d.scrollParent[0].scrollLeft+k.scrollSpeed;}else{if(e.pageX-d.overflowOffset.left<k.scrollSensitivity){d.scrollParent[0].scrollLeft=g=d.scrollParent[0].scrollLeft-k.scrollSpeed;}}}}else{if(!k.axis||k.axis!="x"){if(e.pageY-c(document).scrollTop()<k.scrollSensitivity){g=c(document).scrollTop(c(document).scrollTop()-k.scrollSpeed);}else{if(c(window).height()-(e.pageY-c(document).scrollTop())<k.scrollSensitivity){g=c(document).scrollTop(c(document).scrollTop()+k.scrollSpeed);}}}if(!k.axis||k.axis!="y"){if(e.pageX-c(document).scrollLeft()<k.scrollSensitivity){g=c(document).scrollLeft(c(document).scrollLeft()-k.scrollSpeed);}else{if(c(window).width()-(e.pageX-c(document).scrollLeft())<k.scrollSensitivity){g=c(document).scrollLeft(c(document).scrollLeft()+k.scrollSpeed);}}}}g!==false&&c.ui.ddmanager&&!k.dropBehaviour&&c.ui.ddmanager.prepareOffsets(d,e);}});c.ui.plugin.add("draggable","snap",{start:function(){var e=c(this).data("draggable"),d=e.options;e.snapElements=[];c(d.snap.constructor!=String?d.snap.items||":data(draggable)":d.snap).each(function(){var k=c(this),g=k.offset();this!=e.element[0]&&e.snapElements.push({item:this,width:k.outerWidth(),height:k.outerHeight(),top:g.top,left:g.left});});},drag:function(N,M){for(var L=c(this).data("draggable"),J=L.options,K=J.snapTolerance,H=M.offset.left,I=H+L.helperProportions.width,B=M.offset.top,A=B+L.helperProportions.height,G=L.snapElements.length-1;G>=0;G--){var F=L.snapElements[G].left,D=F+L.snapElements[G].width,E=L.snapElements[G].top,C=E+L.snapElements[G].height;if(F-K<H&&H<D+K&&E-K<B&&B<C+K||F-K<H&&H<D+K&&E-K<A&&A<C+K||F-K<I&&I<D+K&&E-K<B&&B<C+K||F-K<I&&I<D+K&&E-K<A&&A<C+K){if(J.snapMode!="inner"){var y=Math.abs(E-A)<=K,w=Math.abs(C-B)<=K,v=Math.abs(F-I)<=K,u=Math.abs(D-H)<=K;if(y){M.position.top=L._convertPositionTo("relative",{top:E-L.helperProportions.height,left:0}).top-L.margins.top;}if(w){M.position.top=L._convertPositionTo("relative",{top:C,left:0}).top-L.margins.top;}if(v){M.position.left=L._convertPositionTo("relative",{top:0,left:F-L.helperProportions.width}).left-L.margins.left;}if(u){M.position.left=L._convertPositionTo("relative",{top:0,left:D}).left-L.margins.left;}}var d=y||w||v||u;if(J.snapMode!="outer"){y=Math.abs(E-B)<=K;w=Math.abs(C-A)<=K;v=Math.abs(F-H)<=K;u=Math.abs(D-I)<=K;if(y){M.position.top=L._convertPositionTo("relative",{top:E,left:0}).top-L.margins.top;}if(w){M.position.top=L._convertPositionTo("relative",{top:C-L.helperProportions.height,left:0}).top-L.margins.top;}if(v){M.position.left=L._convertPositionTo("relative",{top:0,left:F}).left-L.margins.left;}if(u){M.position.left=L._convertPositionTo("relative",{top:0,left:D-L.helperProportions.width}).left-L.margins.left;}}if(!L.snapElements[G].snapping&&(y||w||v||u||d)){L.options.snap.snap&&L.options.snap.snap.call(L.element,N,c.extend(L._uiHash(),{snapItem:L.snapElements[G].item}));}L.snapElements[G].snapping=y||w||v||u||d;}else{L.snapElements[G].snapping&&L.options.snap.release&&L.options.snap.release.call(L.element,N,c.extend(L._uiHash(),{snapItem:L.snapElements[G].item}));L.snapElements[G].snapping=false;}}}});c.ui.plugin.add("draggable","stack",{start:function(){var e=c(this).data("draggable").options;e=c.makeArray(c(e.stack)).sort(function(k,g){return(parseInt(c(k).css("zIndex"),10)||0)-(parseInt(c(g).css("zIndex"),10)||0);});if(e.length){var d=parseInt(e[0].style.zIndex)||0;c(e).each(function(f){this.style.zIndex=d+f;});this[0].style.zIndex=d+e.length;}}});c.ui.plugin.add("draggable","zIndex",{start:function(e,d){e=c(d.helper);d=c(this).data("draggable").options;if(e.css("zIndex")){d._zIndex=e.css("zIndex");}e.css("zIndex",d.zIndex);},stop:function(e,d){e=c(this).data("draggable").options;e._zIndex&&c(d.helper).css("zIndex",e._zIndex);}});})(jQuery);(function(c){c.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect"},_create:function(){var e=this.options,d=e.accept;this.isover=0;this.isout=1;this.accept=c.isFunction(d)?d:function(f){return f.is(d);};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};c.ui.ddmanager.droppables[e.scope]=c.ui.ddmanager.droppables[e.scope]||[];c.ui.ddmanager.droppables[e.scope].push(this);e.addClasses&&this.element.addClass("ui-droppable");},destroy:function(){for(var e=c.ui.ddmanager.droppables[this.options.scope],d=0;d<e.length;d++){e[d]==this&&e.splice(d,1);}this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable");return this;},_setOption:function(e,d){if(e=="accept"){this.accept=c.isFunction(d)?d:function(f){return f.is(d);};}c.Widget.prototype._setOption.apply(this,arguments);},_activate:function(e){var d=c.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass);d&&this._trigger("activate",e,this.ui(d));},_deactivate:function(e){var d=c.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass);d&&this._trigger("deactivate",e,this.ui(d));},_over:function(e){var d=c.ui.ddmanager.current;if(!(!d||(d.currentItem||d.element)[0]==this.element[0])){if(this.accept.call(this.element[0],d.currentItem||d.element)){this.options.hoverClass&&this.element.addClass(this.options.hoverClass);this._trigger("over",e,this.ui(d));}}},_out:function(e){var d=c.ui.ddmanager.current;if(!(!d||(d.currentItem||d.element)[0]==this.element[0])){if(this.accept.call(this.element[0],d.currentItem||d.element)){this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("out",e,this.ui(d));}}},_drop:function(f,d){var k=d||c.ui.ddmanager.current;if(!k||(k.currentItem||k.element)[0]==this.element[0]){return false;}var g=false;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var e=c.data(this,"droppable");if(e.options.greedy&&!e.options.disabled&&e.options.scope==k.options.scope&&e.accept.call(e.element[0],k.currentItem||k.element)&&c.ui.intersect(k,c.extend(e,{offset:e.element.offset()}),e.options.tolerance)){g=true;return false;}});if(g){return false;}if(this.accept.call(this.element[0],k.currentItem||k.element)){this.options.activeClass&&this.element.removeClass(this.options.activeClass);this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("drop",f,this.ui(k));return this.element;}return false;},ui:function(d){return{draggable:d.currentItem||d.element,helper:d.helper,position:d.position,offset:d.positionAbs};}});c.extend(c.ui.droppable,{version:"1.8.16"});c.ui.intersect=function(A,y,w){if(!y.offset){return false;}var v=(A.positionAbs||A.position.absolute).left,s=v+A.helperProportions.width,u=(A.positionAbs||A.position.absolute).top,r=u+A.helperProportions.height,q=y.offset.left,m=q+y.proportions.width,o=y.offset.top,d=o+y.proportions.height;switch(w){case"fit":return q<=v&&s<=m&&o<=u&&r<=d;case"intersect":return q<v+A.helperProportions.width/2&&s-A.helperProportions.width/2<m&&o<u+A.helperProportions.height/2&&r-A.helperProportions.height/2<d;case"pointer":return c.ui.isOver((A.positionAbs||A.position.absolute).top+(A.clickOffset||A.offset.click).top,(A.positionAbs||A.position.absolute).left+(A.clickOffset||A.offset.click).left,o,q,y.proportions.height,y.proportions.width);case"touch":return(u>=o&&u<=d||r>=o&&r<=d||u<o&&r>d)&&(v>=q&&v<=m||s>=q&&s<=m||v<q&&s>m);default:return false;}};c.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(k,d){var r=c.ui.ddmanager.droppables[k.options.scope]||[],q=d?d.type:null,m=(k.currentItem||k.element).find(":data(droppable)").andSelf(),o=0;k:for(;o<r.length;o++){if(!(r[o].options.disabled||k&&!r[o].accept.call(r[o].element[0],k.currentItem||k.element))){for(var l=0;l<m.length;l++){if(m[l]==r[o].element[0]){r[o].proportions.height=0;continue k;}}r[o].visible=r[o].element.css("display")!="none";if(r[o].visible){q=="mousedown"&&r[o]._activate.call(r[o],d);r[o].offset=r[o].element.offset();r[o].proportions={width:r[o].element[0].offsetWidth,height:r[o].element[0].offsetHeight};}}}},drop:function(e,d){var f=false;c.each(c.ui.ddmanager.droppables[e.options.scope]||[],function(){if(this.options){if(!this.options.disabled&&this.visible&&c.ui.intersect(e,this,this.options.tolerance)){f=f||this._drop.call(this,d);}if(!this.options.disabled&&this.visible&&this.accept.call(this.element[0],e.currentItem||e.element)){this.isout=1;this.isover=0;this._deactivate.call(this,d);}}});return f;},dragStart:function(e,d){e.element.parents(":not(body,html)").bind("scroll.droppable",function(){e.options.refreshPositions||c.ui.ddmanager.prepareOffsets(e,d);});},drag:function(e,d){e.options.refreshPositions&&c.ui.ddmanager.prepareOffsets(e,d);c.each(c.ui.ddmanager.droppables[e.options.scope]||[],function(){if(!(this.options.disabled||this.greedyChild||!this.visible)){var l=c.ui.intersect(e,this,this.options.tolerance);if(l=!l&&this.isover==1?"isout":l&&this.isover==0?"isover":null){var k;if(this.options.greedy){var f=this.element.parents(":data(droppable):eq(0)");if(f.length){k=c.data(f[0],"droppable");k.greedyChild=l=="isover"?1:0;}}if(k&&l=="isover"){k.isover=0;k.isout=1;k._out.call(k,d);}this[l]=1;this[l=="isout"?"isover":"isout"]=0;this[l=="isover"?"_over":"_out"].call(this,d);if(k&&l=="isout"){k.isout=0;k.isover=1;k._over.call(k,d);}}}});},dragStop:function(e,d){e.element.parents(":not(body,html)").unbind("scroll.droppable");e.options.refreshPositions||c.ui.ddmanager.prepareOffsets(e,d);}};})(jQuery);(function(f){f.widget("ui.resizable",f.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000},_create:function(){var e=this,k=this.options;this.element.addClass("ui-resizable");f.extend(this,{_aspectRatio:!!k.aspectRatio,aspectRatio:k.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:k.helper||k.ghost||k.animate?k.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){/relative/.test(this.element.css("position"))&&f.browser.opera&&this.element.css({position:"relative",top:"auto",left:"auto"});this.element.wrap(f('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize();}this.handles=k.handles||(!f(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all"){this.handles="n,e,s,w,se,sw,ne,nw";}var q=this.handles.split(",");this.handles={};for(var o=0;o<q.length;o++){var m=f.trim(q[o]),l=f('<div class="ui-resizable-handle '+("ui-resizable-"+m)+'"></div>');/sw|se|ne|nw/.test(m)&&l.css({zIndex:++k.zIndex});"se"==m&&l.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[m]=".ui-resizable-"+m;this.element.append(l);}}this._renderAxis=function(u){u=u||this.element;for(var s in this.handles){if(this.handles[s].constructor==String){this.handles[s]=f(this.handles[s],this.element).show();}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var r=f(this.handles[s],this.element),g=0;g=/sw|ne|nw|se|n|s/.test(s)?r.outerHeight():r.outerWidth();r=["padding",/ne|nw|n/.test(s)?"Top":/se|sw|s/.test(s)?"Bottom":/^e$/.test(s)?"Right":"Left"].join("");u.css(r,g);this._proportionallyResize();}f(this.handles[s]);}};this._renderAxis(this.element);this._handles=f(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!e.resizing){if(this.className){var g=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);}e.axis=g&&g[1]?g[1]:"se";}});if(k.autoHide){this._handles.hide();f(this.element).addClass("ui-resizable-autohide").hover(function(){if(!k.disabled){f(this).removeClass("ui-resizable-autohide");e._handles.show();}},function(){if(!k.disabled){if(!e.resizing){f(this).addClass("ui-resizable-autohide");e._handles.hide();}}});}this._mouseInit();},destroy:function(){this._mouseDestroy();var e=function(k){f(k).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove();};if(this.elementIsWrapper){e(this.element);var g=this.element;g.after(this.originalElement.css({position:g.css("position"),width:g.outerWidth(),height:g.outerHeight(),top:g.css("top"),left:g.css("left")})).remove();}this.originalElement.css("resize",this.originalResizeStyle);e(this.originalElement);return this;},_mouseCapture:function(e){var g=false;for(var k in this.handles){if(f(this.handles[k])[0]==e.target){g=true;}}return !this.options.disabled&&g;},_mouseStart:function(e){var g=this.options,m=this.element.position(),l=this.element;this.resizing=true;this.documentScroll={top:f(document).scrollTop(),left:f(document).scrollLeft()};if(l.is(".ui-draggable")||/absolute/.test(l.css("position"))){l.css({position:"absolute",top:m.top,left:m.left});}f.browser.opera&&/relative/.test(l.css("position"))&&l.css({position:"relative",top:"auto",left:"auto"});this._renderProxy();m=c(this.helper.css("left"));var k=c(this.helper.css("top"));if(g.containment){m+=f(g.containment).scrollLeft()||0;k+=f(g.containment).scrollTop()||0;}this.offset=this.helper.offset();this.position={left:m,top:k};this.size=this._helper?{width:l.outerWidth(),height:l.outerHeight()}:{width:l.width(),height:l.height()};this.originalSize=this._helper?{width:l.outerWidth(),height:l.outerHeight()}:{width:l.width(),height:l.height()};this.originalPosition={left:m,top:k};this.sizeDiff={width:l.outerWidth()-l.width(),height:l.outerHeight()-l.height()};this.originalMousePosition={left:e.pageX,top:e.pageY};this.aspectRatio=typeof g.aspectRatio=="number"?g.aspectRatio:this.originalSize.width/this.originalSize.height||1;g=f(".ui-resizable-"+this.axis).css("cursor");f("body").css("cursor",g=="auto"?this.axis+"-resize":g);l.addClass("ui-resizable-resizing");this._propagate("start",e);return true;},_mouseDrag:function(e){var g=this.helper,l=this.originalMousePosition,k=this._change[this.axis];if(!k){return false;}l=k.apply(this,[e,e.pageX-l.left||0,e.pageY-l.top||0]);this._updateVirtualBoundaries(e.shiftKey);if(this._aspectRatio||e.shiftKey){l=this._updateRatio(l,e);}l=this._respectSize(l,e);this._propagate("resize",e);g.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(l);this._trigger("resize",e,this.ui());return false;},_mouseStop:function(e){this.resizing=false;var k=this.options,q=this;if(this._helper){var o=this._proportionallyResizeElements,m=o.length&&/textarea/i.test(o[0].nodeName);o=m&&f.ui.hasScroll(o[0],"left")?0:q.sizeDiff.height;m=m?0:q.sizeDiff.width;m={width:q.helper.width()-m,height:q.helper.height()-o};o=parseInt(q.element.css("left"),10)+(q.position.left-q.originalPosition.left)||null;var l=parseInt(q.element.css("top"),10)+(q.position.top-q.originalPosition.top)||null;k.animate||this.element.css(f.extend(m,{top:l,left:o}));q.helper.height(q.size.height);q.helper.width(q.size.width);this._helper&&!k.animate&&this._proportionallyResize();}f("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",e);this._helper&&this.helper.remove();return false;},_updateVirtualBoundaries:function(e){var g=this.options,m,l,k;g={minWidth:d(g.minWidth)?g.minWidth:0,maxWidth:d(g.maxWidth)?g.maxWidth:Infinity,minHeight:d(g.minHeight)?g.minHeight:0,maxHeight:d(g.maxHeight)?g.maxHeight:Infinity};if(this._aspectRatio||e){e=g.minHeight*this.aspectRatio;l=g.minWidth/this.aspectRatio;m=g.maxHeight*this.aspectRatio;k=g.maxWidth/this.aspectRatio;if(e>g.minWidth){g.minWidth=e;}if(l>g.minHeight){g.minHeight=l;}if(m<g.maxWidth){g.maxWidth=m;}if(k<g.maxHeight){g.maxHeight=k;}}this._vBoundaries=g;},_updateCache:function(e){this.offset=this.helper.offset();if(d(e.left)){this.position.left=e.left;}if(d(e.top)){this.position.top=e.top;}if(d(e.height)){this.size.height=e.height;}if(d(e.width)){this.size.width=e.width;}},_updateRatio:function(e){var g=this.position,l=this.size,k=this.axis;if(d(e.height)){e.width=e.height*this.aspectRatio;}else{if(d(e.width)){e.height=e.width/this.aspectRatio;}}if(k=="sw"){e.left=g.left+(l.width-e.width);e.top=null;}if(k=="nw"){e.top=g.top+(l.height-e.height);e.left=g.left+(l.width-e.width);}return e;},_respectSize:function(v){var w=this._vBoundaries,u=this.axis,s=d(v.width)&&w.maxWidth&&w.maxWidth<v.width,r=d(v.height)&&w.maxHeight&&w.maxHeight<v.height,q=d(v.width)&&w.minWidth&&w.minWidth>v.width,o=d(v.height)&&w.minHeight&&w.minHeight>v.height;if(q){v.width=w.minWidth;}if(o){v.height=w.minHeight;}if(s){v.width=w.maxWidth;}if(r){v.height=w.maxHeight;}var m=this.originalPosition.left+this.originalSize.width,k=this.position.top+this.size.height,e=/sw|nw|w/.test(u);u=/nw|ne|n/.test(u);if(q&&e){v.left=m-w.minWidth;}if(s&&e){v.left=m-w.maxWidth;}if(o&&u){v.top=k-w.minHeight;}if(r&&u){v.top=k-w.maxHeight;}if((w=!v.width&&!v.height)&&!v.left&&v.top){v.top=null;}else{if(w&&!v.top&&v.left){v.left=null;}}return v;},_proportionallyResize:function(){if(this._proportionallyResizeElements.length){for(var e=this.helper||this.element,g=0;g<this._proportionallyResizeElements.length;g++){var m=this._proportionallyResizeElements[g];if(!this.borderDif){var l=[m.css("borderTopWidth"),m.css("borderRightWidth"),m.css("borderBottomWidth"),m.css("borderLeftWidth")],k=[m.css("paddingTop"),m.css("paddingRight"),m.css("paddingBottom"),m.css("paddingLeft")];this.borderDif=f.map(l,function(q,o){q=parseInt(q,10)||0;o=parseInt(k[o],10)||0;return q+o;});}f.browser.msie&&(f(e).is(":hidden")||f(e).parents(":hidden").length)||m.css({height:e.height()-this.borderDif[0]-this.borderDif[2]||0,width:e.width()-this.borderDif[1]-this.borderDif[3]||0});}}},_renderProxy:function(){var e=this.options;this.elementOffset=this.element.offset();if(this._helper){this.helper=this.helper||f('<div style="overflow:hidden;"></div>');var g=f.browser.msie&&f.browser.version<7,k=g?1:0;g=g?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+g,height:this.element.outerHeight()+g,position:"absolute",left:this.elementOffset.left-k+"px",top:this.elementOffset.top-k+"px",zIndex:++e.zIndex});this.helper.appendTo("body").disableSelection();}else{this.helper=this.element;}},_change:{e:function(e,g){return{width:this.originalSize.width+g};},w:function(e,g){return{left:this.originalPosition.left+g,width:this.originalSize.width-g};},n:function(e,g,k){return{top:this.originalPosition.top+k,height:this.originalSize.height-k};},s:function(e,g,k){return{height:this.originalSize.height+k};},se:function(e,g,k){return f.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,g,k]));},sw:function(e,g,k){return f.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,g,k]));},ne:function(e,g,k){return f.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,g,k]));},nw:function(e,g,k){return f.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,g,k]));}},_propagate:function(e,g){f.ui.plugin.call(this,e,[g,this.ui()]);e!="resize"&&this._trigger(e,g,this.ui());},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition};}});f.extend(f.ui.resizable,{version:"1.8.16"});f.ui.plugin.add("resizable","alsoResize",{start:function(){var e=f(this).data("resizable").options,g=function(k){f(k).each(function(){var l=f(this);l.data("resizable-alsoresize",{width:parseInt(l.width(),10),height:parseInt(l.height(),10),left:parseInt(l.css("left"),10),top:parseInt(l.css("top"),10),position:l.css("position")});});};if(typeof e.alsoResize=="object"&&!e.alsoResize.parentNode){if(e.alsoResize.length){e.alsoResize=e.alsoResize[0];g(e.alsoResize);}else{f.each(e.alsoResize,function(k){g(k);});}}else{g(e.alsoResize);}},resize:function(e,k){var r=f(this).data("resizable");e=r.options;var q=r.originalSize,o=r.originalPosition,m={height:r.size.height-q.height||0,width:r.size.width-q.width||0,top:r.position.top-o.top||0,left:r.position.left-o.left||0},l=function(s,g){f(s).each(function(){var u=f(this),w=f(this).data("resizable-alsoresize"),y={},v=g&&g.length?g:u.parents(k.originalElement[0]).length?["width","height"]:["width","height","top","left"];f.each(v,function(B,A){if((B=(w[A]||0)+(m[A]||0))&&B>=0){y[A]=B||null;}});if(f.browser.opera&&/relative/.test(u.css("position"))){r._revertToRelativePosition=true;u.css({position:"absolute",top:"auto",left:"auto"});}u.css(y);});};typeof e.alsoResize=="object"&&!e.alsoResize.nodeType?f.each(e.alsoResize,function(s,g){l(s,g);}):l(e.alsoResize);},stop:function(){var e=f(this).data("resizable"),g=e.options,k=function(l){f(l).each(function(){var m=f(this);m.css({position:m.data("resizable-alsoresize").position});});};if(e._revertToRelativePosition){e._revertToRelativePosition=false;typeof g.alsoResize=="object"&&!g.alsoResize.nodeType?f.each(g.alsoResize,function(l){k(l);}):k(g.alsoResize);}f(this).removeData("resizable-alsoresize");}});f.ui.plugin.add("resizable","animate",{stop:function(e){var k=f(this).data("resizable"),r=k.options,q=k._proportionallyResizeElements,o=q.length&&/textarea/i.test(q[0].nodeName),m=o&&f.ui.hasScroll(q[0],"left")?0:k.sizeDiff.height;o={width:k.size.width-(o?0:k.sizeDiff.width),height:k.size.height-m};m=parseInt(k.element.css("left"),10)+(k.position.left-k.originalPosition.left)||null;var l=parseInt(k.element.css("top"),10)+(k.position.top-k.originalPosition.top)||null;k.element.animate(f.extend(o,l&&m?{top:l,left:m}:{}),{duration:r.animateDuration,easing:r.animateEasing,step:function(){var g={width:parseInt(k.element.css("width"),10),height:parseInt(k.element.css("height"),10),top:parseInt(k.element.css("top"),10),left:parseInt(k.element.css("left"),10)};q&&q.length&&f(q[0]).css({width:g.width,height:g.height});k._updateCache(g);k._propagate("resize",e);}});}});f.ui.plugin.add("resizable","containment",{start:function(){var e=f(this).data("resizable"),k=e.element,r=e.options.containment;if(k=r instanceof f?r.get(0):/parent/.test(r)?k.parent().get(0):r){e.containerElement=f(k);if(/document/.test(r)||r==document){e.containerOffset={left:0,top:0};e.containerPosition={left:0,top:0};e.parentData={element:f(document),left:0,top:0,width:f(document).width(),height:f(document).height()||document.body.parentNode.scrollHeight};}else{var q=f(k),o=[];f(["Top","Right","Left","Bottom"]).each(function(s,g){o[s]=c(q.css("padding"+g));});e.containerOffset=q.offset();e.containerPosition=q.position();e.containerSize={height:q.innerHeight()-o[3],width:q.innerWidth()-o[1]};r=e.containerOffset;var m=e.containerSize.height,l=e.containerSize.width;l=f.ui.hasScroll(k,"left")?k.scrollWidth:l;m=f.ui.hasScroll(k)?k.scrollHeight:m;e.parentData={element:k,left:r.left,top:r.top,width:l,height:m};}}},resize:function(e){var k=f(this).data("resizable"),r=k.options,q=k.containerOffset,o=k.position;e=k._aspectRatio||e.shiftKey;var m={top:0,left:0},l=k.containerElement;if(l[0]!=document&&/static/.test(l.css("position"))){m=q;}if(o.left<(k._helper?q.left:0)){k.size.width+=k._helper?k.position.left-q.left:k.position.left-m.left;if(e){k.size.height=k.size.width/r.aspectRatio;}k.position.left=r.helper?q.left:0;}if(o.top<(k._helper?q.top:0)){k.size.height+=k._helper?k.position.top-q.top:k.position.top;if(e){k.size.width=k.size.height*r.aspectRatio;}k.position.top=k._helper?q.top:0;}k.offset.left=k.parentData.left+k.position.left;k.offset.top=k.parentData.top+k.position.top;r=Math.abs((k._helper?k.offset.left-m.left:k.offset.left-m.left)+k.sizeDiff.width);q=Math.abs((k._helper?k.offset.top-m.top:k.offset.top-q.top)+k.sizeDiff.height);o=k.containerElement.get(0)==k.element.parent().get(0);m=/relative|absolute/.test(k.containerElement.css("position"));if(o&&m){r-=k.parentData.left;}if(r+k.size.width>=k.parentData.width){k.size.width=k.parentData.width-r;if(e){k.size.height=k.size.width/k.aspectRatio;}}if(q+k.size.height>=k.parentData.height){k.size.height=k.parentData.height-q;if(e){k.size.width=k.size.height*k.aspectRatio;}}},stop:function(){var e=f(this).data("resizable"),k=e.options,s=e.containerOffset,r=e.containerPosition,q=e.containerElement,o=f(e.helper),m=o.offset(),l=o.outerWidth()-e.sizeDiff.width;o=o.outerHeight()-e.sizeDiff.height;e._helper&&!k.animate&&/relative/.test(q.css("position"))&&f(this).css({left:m.left-r.left-s.left,width:l,height:o});e._helper&&!k.animate&&/static/.test(q.css("position"))&&f(this).css({left:m.left-r.left-s.left,width:l,height:o});}});f.ui.plugin.add("resizable","ghost",{start:function(){var e=f(this).data("resizable"),g=e.options,k=e.size;e.ghost=e.originalElement.clone();e.ghost.css({opacity:0.25,display:"block",position:"relative",height:k.height,width:k.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof g.ghost=="string"?g.ghost:"");e.ghost.appendTo(e.helper);},resize:function(){var e=f(this).data("resizable");e.ghost&&e.ghost.css({position:"relative",height:e.size.height,width:e.size.width});},stop:function(){var e=f(this).data("resizable");e.ghost&&e.helper&&e.helper.get(0).removeChild(e.ghost.get(0));}});f.ui.plugin.add("resizable","grid",{resize:function(){var e=f(this).data("resizable"),k=e.options,r=e.size,q=e.originalSize,o=e.originalPosition,m=e.axis;k.grid=typeof k.grid=="number"?[k.grid,k.grid]:k.grid;var l=Math.round((r.width-q.width)/(k.grid[0]||1))*(k.grid[0]||1);k=Math.round((r.height-q.height)/(k.grid[1]||1))*(k.grid[1]||1);if(/^(se|s|e)$/.test(m)){e.size.width=q.width+l;e.size.height=q.height+k;}else{if(/^(ne)$/.test(m)){e.size.width=q.width+l;e.size.height=q.height+k;e.position.top=o.top-k;}else{if(/^(sw)$/.test(m)){e.size.width=q.width+l;e.size.height=q.height+k;}else{e.size.width=q.width+l;e.size.height=q.height+k;e.position.top=o.top-k;}e.position.left=o.left-l;}}}});var c=function(e){return parseInt(e,10)||0;},d=function(e){return !isNaN(parseInt(e,10));};})(jQuery);(function(c){c.widget("ui.selectable",c.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var e=this;this.element.addClass("ui-selectable");this.dragged=false;var d;this.refresh=function(){d=c(e.options.filter,e.element[0]);d.each(function(){var g=c(this),f=g.offset();c.data(this,"selectable-item",{element:this,$element:g,left:f.left,top:f.top,right:f.left+g.outerWidth(),bottom:f.top+g.outerHeight(),startselected:false,selected:g.hasClass("ui-selected"),selecting:g.hasClass("ui-selecting"),unselecting:g.hasClass("ui-unselecting")});});};this.refresh();this.selectees=d.addClass("ui-selectee");this._mouseInit();this.helper=c("<div class='ui-selectable-helper'></div>");},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this;},_mouseStart:function(k){var e=this;this.opos=[k.pageX,k.pageY];if(!this.options.disabled){var g=this.options;this.selectees=c(g.filter,this.element[0]);this._trigger("start",k);c(g.appendTo).append(this.helper);this.helper.css({left:k.clientX,top:k.clientY,width:0,height:0});g.autoRefresh&&this.refresh();this.selectees.filter(".ui-selected").each(function(){var d=c.data(this,"selectable-item");d.startselected=true;if(!k.metaKey){d.$element.removeClass("ui-selected");d.selected=false;d.$element.addClass("ui-unselecting");d.unselecting=true;e._trigger("unselecting",k,{unselecting:d.element});}});c(k.target).parents().andSelf().each(function(){var d=c.data(this,"selectable-item");if(d){var f=!k.metaKey||!d.$element.hasClass("ui-selected");d.$element.removeClass(f?"ui-unselecting":"ui-selected").addClass(f?"ui-selecting":"ui-unselecting");d.unselecting=!f;d.selecting=f;(d.selected=f)?e._trigger("selecting",k,{selecting:d.element}):e._trigger("unselecting",k,{unselecting:d.element});return false;}});}},_mouseDrag:function(s){var q=this;this.dragged=true;if(!this.options.disabled){var r=this.options,e=this.opos[0],o=this.opos[1],m=s.pageX,l=s.pageY;if(e>m){var k=m;m=e;e=k;}if(o>l){k=l;l=o;o=k;}this.helper.css({left:e,top:o,width:m-e,height:l-o});this.selectees.each(function(){var d=c.data(this,"selectable-item");if(!(!d||d.element==q.element[0])){var f=false;if(r.tolerance=="touch"){f=!(d.left>m||d.right<e||d.top>l||d.bottom<o);}else{if(r.tolerance=="fit"){f=d.left>e&&d.right<m&&d.top>o&&d.bottom<l;}}if(f){if(d.selected){d.$element.removeClass("ui-selected");d.selected=false;}if(d.unselecting){d.$element.removeClass("ui-unselecting");d.unselecting=false;}if(!d.selecting){d.$element.addClass("ui-selecting");d.selecting=true;q._trigger("selecting",s,{selecting:d.element});}}else{if(d.selecting){if(s.metaKey&&d.startselected){d.$element.removeClass("ui-selecting");d.selecting=false;d.$element.addClass("ui-selected");d.selected=true;}else{d.$element.removeClass("ui-selecting");d.selecting=false;if(d.startselected){d.$element.addClass("ui-unselecting");d.unselecting=true;}q._trigger("unselecting",s,{unselecting:d.element});}}if(d.selected){if(!s.metaKey&&!d.startselected){d.$element.removeClass("ui-selected");d.selected=false;d.$element.addClass("ui-unselecting");d.unselecting=true;q._trigger("unselecting",s,{unselecting:d.element});}}}}});return false;}},_mouseStop:function(e){var d=this;this.dragged=false;c(".ui-unselecting",this.element[0]).each(function(){var f=c.data(this,"selectable-item");f.$element.removeClass("ui-unselecting");f.unselecting=false;f.startselected=false;d._trigger("unselected",e,{unselected:f.element});});c(".ui-selecting",this.element[0]).each(function(){var f=c.data(this,"selectable-item");f.$element.removeClass("ui-selecting").addClass("ui-selected");f.selecting=false;f.selected=true;f.startselected=true;d._trigger("selected",e,{selected:f.element});});this._trigger("stop",e);this.helper.remove();return false;}});c.extend(c.ui.selectable,{version:"1.8.16"});})(jQuery);(function(c){c.widget("ui.sortable",c.ui.mouse,{widgetEventPrefix:"sort",options:{appendTo:"parent",axis:false,connectWith:false,containment:false,cursor:"auto",cursorAt:false,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1000},_create:function(){var d=this.options;this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=this.items.length?d.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):false;this.offset=this.element.offset();this._mouseInit();},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var d=this.items.length-1;d>=0;d--){this.items[d].item.removeData("sortable-item");}return this;},_setOption:function(e,d){if(e==="disabled"){this.options[e]=d;this.widget()[d?"addClass":"removeClass"]("ui-sortable-disabled");}else{c.Widget.prototype._setOption.apply(this,arguments);}},_mouseCapture:function(g,d){if(this.reverting){return false;}if(this.options.disabled||this.options.type=="static"){return false;}this._refreshItems(g);var m=null,l=this;c(g.target).parents().each(function(){if(c.data(this,"sortable-item")==l){m=c(this);return false;}});if(c.data(g.target,"sortable-item")==l){m=c(g.target);}if(!m){return false;}if(this.options.handle&&!d){var k=false;c(this.options.handle,m).find("*").andSelf().each(function(){if(this==g.target){k=true;}});if(!k){return false;}}this.currentItem=m;this._removeCurrentsFromItems();return true;},_mouseStart:function(f,d,k){d=this.options;var g=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(f);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");c.extend(this.offset,{click:{left:f.pageX-this.offset.left,top:f.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(f);this.originalPageX=f.pageX;this.originalPageY=f.pageY;d.cursorAt&&this._adjustOffsetFromHelper(d.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();d.containment&&this._setContainment();if(d.cursor){if(c("body").css("cursor")){this._storedCursor=c("body").css("cursor");}c("body").css("cursor",d.cursor);}if(d.opacity){if(this.helper.css("opacity")){this._storedOpacity=this.helper.css("opacity");}this.helper.css("opacity",d.opacity);}if(d.zIndex){if(this.helper.css("zIndex")){this._storedZIndex=this.helper.css("zIndex");}this.helper.css("zIndex",d.zIndex);}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){this.overflowOffset=this.scrollParent.offset();}this._trigger("start",f,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!k){for(k=this.containers.length-1;k>=0;k--){this.containers[k]._trigger("activate",f,g._uiHash(this));}}if(c.ui.ddmanager){c.ui.ddmanager.current=this;}c.ui.ddmanager&&!d.dropBehaviour&&c.ui.ddmanager.prepareOffsets(this,f);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(f);return true;},_mouseDrag:function(g){this.position=this._generatePosition(g);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs;}if(this.options.scroll){var d=this.options,m=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-g.pageY<d.scrollSensitivity){this.scrollParent[0].scrollTop=m=this.scrollParent[0].scrollTop+d.scrollSpeed;}else{if(g.pageY-this.overflowOffset.top<d.scrollSensitivity){this.scrollParent[0].scrollTop=m=this.scrollParent[0].scrollTop-d.scrollSpeed;}}if(this.overflowOffset.left+this.scrollParent[0].offsetWidth-g.pageX<d.scrollSensitivity){this.scrollParent[0].scrollLeft=m=this.scrollParent[0].scrollLeft+d.scrollSpeed;}else{if(g.pageX-this.overflowOffset.left<d.scrollSensitivity){this.scrollParent[0].scrollLeft=m=this.scrollParent[0].scrollLeft-d.scrollSpeed;}}}else{if(g.pageY-c(document).scrollTop()<d.scrollSensitivity){m=c(document).scrollTop(c(document).scrollTop()-d.scrollSpeed);}else{if(c(window).height()-(g.pageY-c(document).scrollTop())<d.scrollSensitivity){m=c(document).scrollTop(c(document).scrollTop()+d.scrollSpeed);}}if(g.pageX-c(document).scrollLeft()<d.scrollSensitivity){m=c(document).scrollLeft(c(document).scrollLeft()-d.scrollSpeed);}else{if(c(window).width()-(g.pageX-c(document).scrollLeft())<d.scrollSensitivity){m=c(document).scrollLeft(c(document).scrollLeft()+d.scrollSpeed);}}}m!==false&&c.ui.ddmanager&&!d.dropBehaviour&&c.ui.ddmanager.prepareOffsets(this,g);}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px";}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px";}for(d=this.items.length-1;d>=0;d--){m=this.items[d];var l=m.item[0],k=this._intersectsWithPointer(m);if(k){if(l!=this.currentItem[0]&&this.placeholder[k==1?"next":"prev"]()[0]!=l&&!c.ui.contains(this.placeholder[0],l)&&(this.options.type=="semi-dynamic"?!c.ui.contains(this.element[0],l):true)){this.direction=k==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(m)){this._rearrange(g,m);}else{break;}this._trigger("change",g,this._uiHash());break;}}}this._contactContainers(g);c.ui.ddmanager&&c.ui.ddmanager.drag(this,g);this._trigger("sort",g,this._uiHash());this.lastPositionAbs=this.positionAbs;return false;},_mouseStop:function(e,d){if(e){c.ui.ddmanager&&!this.options.dropBehaviour&&c.ui.ddmanager.drop(this,e);if(this.options.revert){var f=this;d=f.placeholder.offset();f.reverting=true;c(this.helper).animate({left:d.left-this.offset.parent.left-f.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:d.top-this.offset.parent.top-f.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){f._clear(e);});}else{this._clear(e,d);}return false;}},cancel:function(){var e=this;if(this.dragging){this._mouseUp({target:null});this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var d=this.containers.length-1;d>=0;d--){this.containers[d]._trigger("deactivate",null,e._uiHash(this));if(this.containers[d].containerCache.over){this.containers[d]._trigger("out",null,e._uiHash(this));this.containers[d].containerCache.over=0;}}}if(this.placeholder){this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();c.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});this.domPosition.prev?c(this.domPosition.prev).after(this.currentItem):c(this.domPosition.parent).prepend(this.currentItem);}return this;},serialize:function(e){var d=this._getItemsAsjQuery(e&&e.connected),f=[];e=e||{};c(d).each(function(){var g=(c(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[-=_](.+)/);if(g){f.push((e.key||g[1]+"[]")+"="+(e.key&&e.expression?g[1]:g[2]));}});!f.length&&e.key&&f.push(e.key+"=");return f.join("&");},toArray:function(e){var d=this._getItemsAsjQuery(e&&e.connected),f=[];e=e||{};d.each(function(){f.push(c(e.item||this).attr(e.attribute||"id")||"");});return f;},_intersectsWith:function(A){var y=this.positionAbs.left,w=y+this.helperProportions.width,v=this.positionAbs.top,u=v+this.helperProportions.height,s=A.left,r=s+A.width,q=A.top,m=q+A.height,o=this.offset.click.top,d=this.offset.click.left;o=v+o>q&&v+o<m&&y+d>s&&y+d<r;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>A[this.floating?"width":"height"]?o:s<y+this.helperProportions.width/2&&w-this.helperProportions.width/2<r&&q<v+this.helperProportions.height/2&&u-this.helperProportions.height/2<m;},_intersectsWithPointer:function(e){var d=c.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,e.top,e.height);e=c.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,e.left,e.width);d=d&&e;e=this._getDragVerticalDirection();var f=this._getDragHorizontalDirection();if(!d){return false;}return this.floating?f&&f=="right"||e=="down"?2:1:e&&(e=="down"?2:1);},_intersectsWithSides:function(f){var d=c.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,f.top+f.height/2,f.height);f=c.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,f.left+f.width/2,f.width);var k=this._getDragVerticalDirection(),g=this._getDragHorizontalDirection();return this.floating&&g?g=="right"&&f||g=="left"&&!f:k&&(k=="down"&&d||k=="up"&&!d);},_getDragVerticalDirection:function(){var d=this.positionAbs.top-this.lastPositionAbs.top;return d!=0&&(d>0?"down":"up");},_getDragHorizontalDirection:function(){var d=this.positionAbs.left-this.lastPositionAbs.left;return d!=0&&(d>0?"right":"left");},refresh:function(d){this._refreshItems(d);this.refreshPositions();return this;},_connectWith:function(){var d=this.options;return d.connectWith.constructor==String?[d.connectWith]:d.connectWith;},_getItemsAsjQuery:function(k){var d=[],r=[],q=this._connectWith();if(q&&k){for(k=q.length-1;k>=0;k--){for(var o=c(q[k]),m=o.length-1;m>=0;m--){var l=c.data(o[m],"sortable");if(l&&l!=this&&!l.options.disabled){r.push([c.isFunction(l.options.items)?l.options.items.call(l.element):c(l.options.items,l.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),l]);}}}}r.push([c.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):c(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(k=r.length-1;k>=0;k--){r[k][0].each(function(){d.push(this);});}return c(d);},_removeCurrentsFromItems:function(){for(var e=this.currentItem.find(":data(sortable-item)"),d=0;d<this.items.length;d++){for(var f=0;f<e.length;f++){e[f]==this.items[d].item[0]&&this.items.splice(d,1);}}},_refreshItems:function(k){this.items=[];this.containers=[this];var d=this.items,s=[[c.isFunction(this.options.items)?this.options.items.call(this.element[0],k,{item:this.currentItem}):c(this.options.items,this.element),this]],r=this._connectWith();if(r){for(var q=r.length-1;q>=0;q--){for(var o=c(r[q]),m=o.length-1;m>=0;m--){var l=c.data(o[m],"sortable");if(l&&l!=this&&!l.options.disabled){s.push([c.isFunction(l.options.items)?l.options.items.call(l.element[0],k,{item:this.currentItem}):c(l.options.items,l.element),l]);this.containers.push(l);}}}}for(q=s.length-1;q>=0;q--){k=s[q][1];r=s[q][0];m=0;for(o=r.length;m<o;m++){l=c(r[m]);l.data("sortable-item",k);d.push({item:l,instance:k,width:0,height:0,left:0,top:0});}}},refreshPositions:function(f){if(this.offsetParent&&this.helper){this.offset.parent=this._getParentOffset();}for(var d=this.items.length-1;d>=0;d--){var k=this.items[d];if(!(k.instance!=this.currentContainer&&this.currentContainer&&k.item[0]!=this.currentItem[0])){var g=this.options.toleranceElement?c(this.options.toleranceElement,k.item):k.item;if(!f){k.width=g.outerWidth();k.height=g.outerHeight();}g=g.offset();k.left=g.left;k.top=g.top;}}if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this);}else{for(d=this.containers.length-1;d>=0;d--){g=this.containers[d].element.offset();this.containers[d].containerCache.left=g.left;this.containers[d].containerCache.top=g.top;this.containers[d].containerCache.width=this.containers[d].element.outerWidth();this.containers[d].containerCache.height=this.containers[d].element.outerHeight();}}return this;},_createPlaceholder:function(f){var d=f||this,k=d.options;if(!k.placeholder||k.placeholder.constructor==String){var g=k.placeholder;k.placeholder={element:function(){var e=c(document.createElement(d.currentItem[0].nodeName)).addClass(g||d.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!g){e.style.visibility="hidden";}return e;},update:function(l,e){if(!(g&&!k.forcePlaceholderSize)){e.height()||e.height(d.currentItem.innerHeight()-parseInt(d.currentItem.css("paddingTop")||0,10)-parseInt(d.currentItem.css("paddingBottom")||0,10));e.width()||e.width(d.currentItem.innerWidth()-parseInt(d.currentItem.css("paddingLeft")||0,10)-parseInt(d.currentItem.css("paddingRight")||0,10));}}};}d.placeholder=c(k.placeholder.element.call(d.element,d.currentItem));d.currentItem.after(d.placeholder);k.placeholder.update(d,d.placeholder);},_contactContainers:function(k){for(var d=null,r=null,q=this.containers.length-1;q>=0;q--){if(!c.ui.contains(this.currentItem[0],this.containers[q].element[0])){if(this._intersectsWith(this.containers[q].containerCache)){if(!(d&&c.ui.contains(this.containers[q].element[0],d.element[0]))){d=this.containers[q];r=q;}}else{if(this.containers[q].containerCache.over){this.containers[q]._trigger("out",k,this._uiHash(this));this.containers[q].containerCache.over=0;}}}}if(d){if(this.containers.length===1){this.containers[r]._trigger("over",k,this._uiHash(this));this.containers[r].containerCache.over=1;}else{if(this.currentContainer!=this.containers[r]){d=10000;q=null;for(var o=this.positionAbs[this.containers[r].floating?"left":"top"],m=this.items.length-1;m>=0;m--){if(c.ui.contains(this.containers[r].element[0],this.items[m].item[0])){var l=this.items[m][this.containers[r].floating?"left":"top"];if(Math.abs(l-o)<d){d=Math.abs(l-o);q=this.items[m];}}}if(q||this.options.dropOnEmpty){this.currentContainer=this.containers[r];q?this._rearrange(k,q,null,true):this._rearrange(k,null,this.containers[r].element,true);this._trigger("change",k,this._uiHash());this.containers[r]._trigger("change",k,this._uiHash(this));this.options.placeholder.update(this.currentContainer,this.placeholder);this.containers[r]._trigger("over",k,this._uiHash(this));this.containers[r].containerCache.over=1;}}}}},_createHelper:function(e){var d=this.options;e=c.isFunction(d.helper)?c(d.helper.apply(this.element[0],[e,this.currentItem])):d.helper=="clone"?this.currentItem.clone():this.currentItem;e.parents("body").length||c(d.appendTo!="parent"?d.appendTo:this.currentItem[0].parentNode)[0].appendChild(e[0]);if(e[0]==this.currentItem[0]){this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")};}if(e[0].style.width==""||d.forceHelperSize){e.width(this.currentItem.width());}if(e[0].style.height==""||d.forceHelperSize){e.height(this.currentItem.height());}return e;},_adjustOffsetFromHelper:function(d){if(typeof d=="string"){d=d.split(" ");}if(c.isArray(d)){d={left:+d[0],top:+d[1]||0};}if("left" in d){this.offset.click.left=d.left+this.margins.left;}if("right" in d){this.offset.click.left=this.helperProportions.width-d.right+this.margins.left;}if("top" in d){this.offset.click.top=d.top+this.margins.top;}if("bottom" in d){this.offset.click.top=this.helperProportions.height-d.bottom+this.margins.top;}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var d=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&c.ui.contains(this.scrollParent[0],this.offsetParent[0])){d.left+=this.scrollParent.scrollLeft();d.top+=this.scrollParent.scrollTop();}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&c.browser.msie){d={top:0,left:0};}return{top:d.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:d.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var d=this.currentItem.position();return{top:d.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:d.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()};}else{return{top:0,left:0};}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0};},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};},_setContainment:function(){var e=this.options;if(e.containment=="parent"){e.containment=this.helper[0].parentNode;}if(e.containment=="document"||e.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,c(e.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(c(e.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];}if(!/^(document|window|parent)$/.test(e.containment)){var d=c(e.containment)[0];e=c(e.containment).offset();var f=c(d).css("overflow")!="hidden";this.containment=[e.left+(parseInt(c(d).css("borderLeftWidth"),10)||0)+(parseInt(c(d).css("paddingLeft"),10)||0)-this.margins.left,e.top+(parseInt(c(d).css("borderTopWidth"),10)||0)+(parseInt(c(d).css("paddingTop"),10)||0)-this.margins.top,e.left+(f?Math.max(d.scrollWidth,d.offsetWidth):d.offsetWidth)-(parseInt(c(d).css("borderLeftWidth"),10)||0)-(parseInt(c(d).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,e.top+(f?Math.max(d.scrollHeight,d.offsetHeight):d.offsetHeight)-(parseInt(c(d).css("borderTopWidth"),10)||0)-(parseInt(c(d).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top];}},_convertPositionTo:function(f,d){if(!d){d=this.position;}f=f=="absolute"?1:-1;var k=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&c.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(k[0].tagName);return{top:d.top+this.offset.relative.top*f+this.offset.parent.top*f-(c.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:k.scrollTop())*f),left:d.left+this.offset.relative.left*f+this.offset.parent.left*f-(c.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:k.scrollLeft())*f)};},_generatePosition:function(k){var d=this.options,q=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&c.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,o=/(html|body)/i.test(q[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset();}var m=k.pageX,l=k.pageY;if(this.originalPosition){if(this.containment){if(k.pageX-this.offset.click.left<this.containment[0]){m=this.containment[0]+this.offset.click.left;}if(k.pageY-this.offset.click.top<this.containment[1]){l=this.containment[1]+this.offset.click.top;}if(k.pageX-this.offset.click.left>this.containment[2]){m=this.containment[2]+this.offset.click.left;}if(k.pageY-this.offset.click.top>this.containment[3]){l=this.containment[3]+this.offset.click.top;}}if(d.grid){l=this.originalPageY+Math.round((l-this.originalPageY)/d.grid[1])*d.grid[1];l=this.containment?!(l-this.offset.click.top<this.containment[1]||l-this.offset.click.top>this.containment[3])?l:!(l-this.offset.click.top<this.containment[1])?l-d.grid[1]:l+d.grid[1]:l;m=this.originalPageX+Math.round((m-this.originalPageX)/d.grid[0])*d.grid[0];m=this.containment?!(m-this.offset.click.left<this.containment[0]||m-this.offset.click.left>this.containment[2])?m:!(m-this.offset.click.left<this.containment[0])?m-d.grid[0]:m+d.grid[0]:m;}}return{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(c.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():o?0:q.scrollTop()),left:m-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(c.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():o?0:q.scrollLeft())};},_rearrange:function(k,d,q,o){q?q[0].appendChild(this.placeholder[0]):d.item[0].parentNode.insertBefore(this.placeholder[0],this.direction=="down"?d.item[0]:d.item[0].nextSibling);this.counter=this.counter?++this.counter:1;var m=this,l=this.counter;window.setTimeout(function(){l==m.counter&&m.refreshPositions(!o);},0);},_clear:function(f,d){this.reverting=false;var k=[];!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem);this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var g in this._storedCSS){if(this._storedCSS[g]=="auto"||this._storedCSS[g]=="static"){this._storedCSS[g]="";}}this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");}else{this.currentItem.show();}this.fromOutside&&!d&&k.push(function(e){this._trigger("receive",e,this._uiHash(this.fromOutside));});if((this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!d){k.push(function(e){this._trigger("update",e,this._uiHash());});}if(!c.ui.contains(this.element[0],this.currentItem[0])){d||k.push(function(e){this._trigger("remove",e,this._uiHash());});for(g=this.containers.length-1;g>=0;g--){if(c.ui.contains(this.containers[g].element[0],this.currentItem[0])&&!d){k.push(function(e){return function(l){e._trigger("receive",l,this._uiHash(this));};}.call(this,this.containers[g]));k.push(function(e){return function(l){e._trigger("update",l,this._uiHash(this));};}.call(this,this.containers[g]));}}}for(g=this.containers.length-1;g>=0;g--){d||k.push(function(e){return function(l){e._trigger("deactivate",l,this._uiHash(this));};}.call(this,this.containers[g]));if(this.containers[g].containerCache.over){k.push(function(e){return function(l){e._trigger("out",l,this._uiHash(this));};}.call(this,this.containers[g]));this.containers[g].containerCache.over=0;}}this._storedCursor&&c("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);if(this._storedZIndex){this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);}this.dragging=false;if(this.cancelHelperRemoval){if(!d){this._trigger("beforeStop",f,this._uiHash());for(g=0;g<k.length;g++){k[g].call(this,f);}this._trigger("stop",f,this._uiHash());}return false;}d||this._trigger("beforeStop",f,this._uiHash());this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.helper[0]!=this.currentItem[0]&&this.helper.remove();this.helper=null;if(!d){for(g=0;g<k.length;g++){k[g].call(this,f);}this._trigger("stop",f,this._uiHash());}this.fromOutside=false;return true;},_trigger:function(){c.Widget.prototype._trigger.apply(this,arguments)===false&&this.cancel();},_uiHash:function(e){var d=e||this;return{helper:d.helper,placeholder:d.placeholder||c([]),position:d.position,originalPosition:d.originalPosition,offset:d.positionAbs,item:d.currentItem,sender:e?e.element:null};}});c.extend(c.ui.sortable,{version:"1.8.16"});})(jQuery);(function(d){d.widget("ui.accordion",{options:{active:0,animated:"slide",autoHeight:true,clearStyle:false,collapsible:false,event:"click",fillSpace:false,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase();}},_create:function(){var e=this,c=e.options;e.running=0;e.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix");e.headers=e.element.find(c.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){c.disabled||d(this).addClass("ui-state-hover");}).bind("mouseleave.accordion",function(){c.disabled||d(this).removeClass("ui-state-hover");}).bind("focus.accordion",function(){c.disabled||d(this).addClass("ui-state-focus");}).bind("blur.accordion",function(){c.disabled||d(this).removeClass("ui-state-focus");});e.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");if(c.navigation){var g=e.element.find("a").filter(c.navigationFilter).eq(0);if(g.length){var f=g.closest(".ui-accordion-header");e.active=f.length?f:g.closest(".ui-accordion-content").prev();}}e.active=e._findActive(e.active||c.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");e.active.next().addClass("ui-accordion-content-active");e._createIcons();e.resize();e.element.attr("role","tablist");e.headers.attr("role","tab").bind("keydown.accordion",function(k){return e._keydown(k);}).next().attr("role","tabpanel");e.headers.not(e.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide();e.active.length?e.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}):e.headers.eq(0).attr("tabIndex",0);d.browser.safari||e.headers.find("a").attr("tabIndex",-1);c.event&&e.headers.bind(c.event.split(" ").join(".accordion ")+".accordion",function(k){e._clickHandler.call(e,k,this);k.preventDefault();});},_createIcons:function(){var c=this.options;if(c.icons){d("<span></span>").addClass("ui-icon "+c.icons.header).prependTo(this.headers);this.active.children(".ui-icon").toggleClass(c.icons.header).toggleClass(c.icons.headerSelected);this.element.addClass("ui-accordion-icons");}},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this.element.removeClass("ui-accordion-icons");},destroy:function(){var e=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex");this.headers.find("a").removeAttr("tabIndex");this._destroyIcons();var c=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");if(e.autoHeight||e.fillHeight){c.css("height","");}return d.Widget.prototype.destroy.call(this);},_setOption:function(e,c){d.Widget.prototype._setOption.apply(this,arguments);e=="active"&&this.activate(c);if(e=="icons"){this._destroyIcons();c&&this._createIcons();}if(e=="disabled"){this.headers.add(this.headers.next())[c?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled");}},_keydown:function(e){if(!(this.options.disabled||e.altKey||e.ctrlKey)){var c=d.ui.keyCode,l=this.headers.length,g=this.headers.index(e.target),k=false;switch(e.keyCode){case c.RIGHT:case c.DOWN:k=this.headers[(g+1)%l];break;case c.LEFT:case c.UP:k=this.headers[(g-1+l)%l];break;case c.SPACE:case c.ENTER:this._clickHandler({target:e.target},e.target);e.preventDefault();}if(k){d(e.target).attr("tabIndex",-1);d(k).attr("tabIndex",0);k.focus();return false;}return true;}},resize:function(){var e=this.options,c;if(e.fillSpace){if(d.browser.msie){var f=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden");}c=this.element.parent().height();d.browser.msie&&this.element.parent().css("overflow",f);this.headers.each(function(){c-=d(this).outerHeight(true);});this.headers.next().each(function(){d(this).height(Math.max(0,c-d(this).innerHeight()+d(this).height()));}).css("overflow","auto");}else{if(e.autoHeight){c=0;this.headers.next().each(function(){c=Math.max(c,d(this).height("").height());}).height(c);}}return this;},activate:function(c){this.options.active=c;c=this._findActive(c)[0];this._clickHandler({target:c},c);return this;},_findActive:function(c){return c?typeof c==="number"?this.headers.filter(":eq("+c+")"):this.headers.not(this.headers.not(c)):c===false?d([]):this.headers.filter(":eq(0)");},_clickHandler:function(k,c){var s=this.options;if(!s.disabled){if(k.target){k=d(k.currentTarget||c);c=k[0]===this.active[0];s.active=s.collapsible&&c?false:this.headers.index(k);if(!(this.running||!s.collapsible&&c)){var m=this.active;l=k.next();o=this.active.next();r={options:s,newHeader:c&&s.collapsible?d([]):k,oldHeader:this.active,newContent:c&&s.collapsible?d([]):l,oldContent:o};var q=this.headers.index(this.active[0])>this.headers.index(k[0]);this.active=c?d([]):k;this._toggle(l,o,r,c,q);m.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(s.icons.headerSelected).addClass(s.icons.header);if(!c){k.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(s.icons.header).addClass(s.icons.headerSelected);k.next().addClass("ui-accordion-content-active");}}}else{if(s.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(s.icons.headerSelected).addClass(s.icons.header);this.active.next().addClass("ui-accordion-content-active");var o=this.active.next(),r={options:s,newHeader:d([]),oldHeader:s.active,newContent:d([]),oldContent:o},l=this.active=d([]);this._toggle(l,o,r);}}}},_toggle:function(w,v,u,o,r){var q=this,s=q.options;q.toShow=w;q.toHide=v;q.data=u;var l=function(){if(q){return q._completed.apply(q,arguments);}};q._trigger("changestart",null,q.data);q.running=v.size()===0?w.size():v.size();if(s.animated){u={};u=s.collapsible&&o?{toShow:d([]),toHide:v,complete:l,down:r,autoHeight:s.autoHeight||s.fillSpace}:{toShow:w,toHide:v,complete:l,down:r,autoHeight:s.autoHeight||s.fillSpace};if(!s.proxied){s.proxied=s.animated;}if(!s.proxiedDuration){s.proxiedDuration=s.duration;}s.animated=d.isFunction(s.proxied)?s.proxied(u):s.proxied;s.duration=d.isFunction(s.proxiedDuration)?s.proxiedDuration(u):s.proxiedDuration;o=d.ui.accordion.animations;var m=s.duration,c=s.animated;if(c&&!o[c]&&!d.easing[c]){c="slide";}o[c]||(o[c]=function(e){this.slide(e,{easing:c,duration:m||700});});o[c](u);}else{if(s.collapsible&&o){w.toggle();}else{v.hide();w.show();}l(true);}v.prev().attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).blur();w.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus();},_completed:function(c){this.running=c?0:--this.running;if(!this.running){this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""});this.toHide.removeClass("ui-accordion-content-active");if(this.toHide.length){this.toHide.parent()[0].className=this.toHide.parent()[0].className;}this._trigger("change",null,this.data);}}});d.extend(d.ui.accordion,{version:"1.8.16",animations:{slide:function(k,c){k=d.extend({easing:"swing",duration:300},k,c);if(k.toHide.size()){if(k.toShow.size()){var r=k.toShow.css("overflow"),l=0,o={},m={},q;c=k.toShow;q=c[0].style.width;c.width(parseInt(c.parent().width(),10)-parseInt(c.css("paddingLeft"),10)-parseInt(c.css("paddingRight"),10)-(parseInt(c.css("borderLeftWidth"),10)||0)-(parseInt(c.css("borderRightWidth"),10)||0));d.each(["height","paddingTop","paddingBottom"],function(e,f){m[f]="hide";e=(""+d.css(k.toShow[0],f)).match(/^([\d+-.]+)(.*)$/);o[f]={value:e[1],unit:e[2]||"px"};});k.toShow.css({height:0,overflow:"hidden"}).show();k.toHide.filter(":hidden").each(k.complete).end().filter(":visible").animate(m,{step:function(e,f){if(f.prop=="height"){l=f.end-f.start===0?0:(f.now-f.start)/(f.end-f.start);}k.toShow[0].style[f.prop]=l*o[f.prop].value+o[f.prop].unit;},duration:k.duration,easing:k.easing,complete:function(){k.autoHeight||k.toShow.css("height","");k.toShow.css({width:q,overflow:r});k.complete();}});}else{k.toHide.animate({height:"hide",paddingTop:"hide",paddingBottom:"hide"},k);}}else{k.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},k);}},bounceslide:function(c){this.slide(c,{easing:c.down?"easeOutBounce":"swing",duration:c.down?1000:200});}}});})(jQuery);(function(f){var c=0;f.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:false,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var e=this,d=this.element[0].ownerDocument,k;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(l){if(!(e.options.disabled||e.element.propAttr("readOnly"))){k=false;var g=f.ui.keyCode;switch(l.keyCode){case g.PAGE_UP:e._move("previousPage",l);break;case g.PAGE_DOWN:e._move("nextPage",l);break;case g.UP:e._move("previous",l);l.preventDefault();break;case g.DOWN:e._move("next",l);l.preventDefault();break;case g.ENTER:case g.NUMPAD_ENTER:if(e.menu.active){k=true;l.preventDefault();}case g.TAB:if(!e.menu.active){return;}e.menu.select(l);break;case g.ESCAPE:e.element.val(e.term);e.close(l);break;default:clearTimeout(e.searching);e.searching=setTimeout(function(){if(e.term!=e.element.val()){e.selectedItem=null;e.search(null,l);}},e.options.delay);break;}}}).bind("keypress.autocomplete",function(g){if(k){k=false;g.preventDefault();}}).bind("focus.autocomplete",function(){if(!e.options.disabled){e.selectedItem=null;e.previous=e.element.val();}}).bind("blur.autocomplete",function(g){if(!e.options.disabled){clearTimeout(e.searching);e.closing=setTimeout(function(){e.close(g);e._change(g);},150);}});this._initSource();this.response=function(){return e._response.apply(e,arguments);};this.menu=f("<ul></ul>").addClass("ui-autocomplete").appendTo(f(this.options.appendTo||"body",d)[0]).mousedown(function(l){var g=e.menu.element[0];f(l.target).closest(".ui-menu-item").length||setTimeout(function(){f(document).one("mousedown",function(m){m.target!==e.element[0]&&m.target!==g&&!f.ui.contains(g,m.target)&&e.close();});},1);setTimeout(function(){clearTimeout(e.closing);},13);}).menu({focus:function(l,g){g=g.item.data("item.autocomplete");false!==e._trigger("focus",l,{item:g})&&/^key/.test(l.originalEvent.type)&&e.element.val(g.value);},selected:function(o,m){var l=m.item.data("item.autocomplete"),g=e.previous;if(e.element[0]!==d.activeElement){e.element.focus();e.previous=g;setTimeout(function(){e.previous=g;e.selectedItem=l;},1);}false!==e._trigger("select",o,{item:l})&&e.element.val(l.value);e.term=e.element.val();e.close(o);e.selectedItem=l;},blur:function(){e.menu.element.is(":visible")&&e.element.val()!==e.term&&e.element.val(e.term);}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");f.fn.bgiframe&&this.menu.element.bgiframe();},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup");this.menu.element.remove();f.Widget.prototype.destroy.call(this);},_setOption:function(e,d){f.Widget.prototype._setOption.apply(this,arguments);e==="source"&&this._initSource();if(e==="appendTo"){this.menu.element.appendTo(f(d||"body",this.element[0].ownerDocument)[0]);}e==="disabled"&&d&&this.xhr&&this.xhr.abort();},_initSource:function(){var e=this,d,k;if(f.isArray(this.options.source)){d=this.options.source;this.source=function(l,g){g(f.ui.autocomplete.filter(d,l.term));};}else{if(typeof this.options.source==="string"){k=this.options.source;this.source=function(l,g){e.xhr&&e.xhr.abort();e.xhr=f.ajax({url:k,data:l,dataType:"json",autocompleteRequest:++c,success:function(m){this.autocompleteRequest===c&&g(m);},error:function(){this.autocompleteRequest===c&&g([]);}});};}else{this.source=this.options.source;}}},search:function(e,d){e=e!=null?e:this.element.val();this.term=this.element.val();if(e.length<this.options.minLength){return this.close(d);}clearTimeout(this.closing);if(this._trigger("search",d)!==false){return this._search(e);}},_search:function(d){this.pending++;this.element.addClass("ui-autocomplete-loading");this.source({term:d},this.response);},_response:function(d){if(!this.options.disabled&&d&&d.length){d=this._normalize(d);this._suggest(d);this._trigger("open");}else{this.close();}this.pending--;this.pending||this.element.removeClass("ui-autocomplete-loading");},close:function(d){clearTimeout(this.closing);if(this.menu.element.is(":visible")){this.menu.element.hide();this.menu.deactivate();this._trigger("close",d);}},_change:function(d){this.previous!==this.element.val()&&this._trigger("change",d,{item:this.selectedItem});},_normalize:function(d){if(d.length&&d[0].label&&d[0].value){return d;}return f.map(d,function(e){if(typeof e==="string"){return{label:e,value:e};}return f.extend({label:e.label||e.value,value:e.value||e.label},e);});},_suggest:function(e){var d=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(d,e);this.menu.deactivate();this.menu.refresh();d.show();this._resizeMenu();d.position(f.extend({of:this.element},this.options.position));this.options.autoFocus&&this.menu.next(new f.Event("mouseover"));},_resizeMenu:function(){var d=this.menu.element;d.outerWidth(Math.max(d.width("").outerWidth(),this.element.outerWidth()));},_renderMenu:function(e,d){var k=this;f.each(d,function(l,g){k._renderItem(e,g);});},_renderItem:function(e,d){return f("<li></li>").data("item.autocomplete",d).append(f("<a></a>").text(d.label)).appendTo(e);},_move:function(e,d){if(this.menu.element.is(":visible")){if(this.menu.first()&&/^previous/.test(e)||this.menu.last()&&/^next/.test(e)){this.element.val(this.term);this.menu.deactivate();}else{this.menu[e](d);}}else{this.search(null,d);}},widget:function(){return this.menu.element;}});f.extend(f.ui.autocomplete,{escapeRegex:function(d){return d.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");},filter:function(e,d){var k=new RegExp(f.ui.autocomplete.escapeRegex(d),"i");return f.grep(e,function(g){return k.test(g.label||g.value||g);});}});})(jQuery);(function(c){c.widget("ui.menu",{_create:function(){var d=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(e){if(c(e.target).closest(".ui-menu-item a").length){e.preventDefault();d.select(e);}});this.refresh();},refresh:function(){var d=this;this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem").children("a").addClass("ui-corner-all").attr("tabindex",-1).mouseenter(function(e){d.activate(e,c(this).parent());}).mouseleave(function(){d.deactivate();});},activate:function(l,f){this.deactivate();if(this.hasScroll()){var d=f.offset().top-this.element.offset().top,k=this.element.scrollTop(),m=this.element.height();if(d<0){this.element.scrollTop(k+d);}else{d>=m&&this.element.scrollTop(k+d-m+f.height());}}this.active=f.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",l,{item:f});},deactivate:function(){if(this.active){this.active.children("a").removeClass("ui-state-hover").removeAttr("id");this._trigger("blur");this.active=null;}},next:function(d){this.move("next",".ui-menu-item:first",d);},previous:function(d){this.move("prev",".ui-menu-item:last",d);},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length;},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length;},move:function(g,f,d){if(this.active){g=this.active[g+"All"](".ui-menu-item").eq(0);g.length?this.activate(d,g):this.activate(d,this.element.children(f));}else{this.activate(d,this.element.children(f));}},nextPage:function(l){if(this.hasScroll()){if(!this.active||this.last()){this.activate(l,this.element.children(".ui-menu-item:first"));}else{var f=this.active.offset().top,d=this.element.height(),k=this.element.children(".ui-menu-item").filter(function(){var e=c(this).offset().top-f-d+c(this).height();return e<10&&e>-10;});k.length||(k=this.element.children(".ui-menu-item:last"));this.activate(l,k);}}else{this.activate(l,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"));}},previousPage:function(g){if(this.hasScroll()){if(!this.active||this.first()){this.activate(g,this.element.children(".ui-menu-item:last"));}else{var f=this.active.offset().top,d=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var e=c(this).offset().top-f+d-c(this).height();return e<10&&e>-10;});result.length||(result=this.element.children(".ui-menu-item:first"));this.activate(g,result);}}else{this.activate(g,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"));}},hasScroll:function(){return this.element.height()<this.element[c.fn.prop?"prop":"attr"]("scrollHeight");},select:function(d){this._trigger("selected",d,{item:this.active});}});})(jQuery);(function(c){var o,m,f,q,d=function(){var g=c(this).find(":ui-button");setTimeout(function(){g.button("refresh");},1);},e=function(g){var r=g.name,l=g.form,k=c([]);if(r){k=l?c(l).find("[name='"+r+"']"):c("[name='"+r+"']",g.ownerDocument).filter(function(){return !this.form;});}return k;};c.widget("ui.button",{options:{disabled:null,text:true,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset.button").bind("reset.button",d);if(typeof this.options.disabled!=="boolean"){this.options.disabled=this.element.propAttr("disabled");}this._determineButtonType();this.hasTitle=!!this.buttonElement.attr("title");var g=this,r=this.options,l=this.type==="checkbox"||this.type==="radio",k="ui-state-hover"+(!l?" ui-state-active":"");if(r.label===null){r.label=this.buttonElement.html();}if(this.element.is(":disabled")){r.disabled=true;}this.buttonElement.addClass("ui-button ui-widget ui-state-default ui-corner-all").attr("role","button").bind("mouseenter.button",function(){if(!r.disabled){c(this).addClass("ui-state-hover");this===o&&c(this).addClass("ui-state-active");}}).bind("mouseleave.button",function(){r.disabled||c(this).removeClass(k);}).bind("click.button",function(s){if(r.disabled){s.preventDefault();s.stopImmediatePropagation();}});this.element.bind("focus.button",function(){g.buttonElement.addClass("ui-state-focus");}).bind("blur.button",function(){g.buttonElement.removeClass("ui-state-focus");});if(l){this.element.bind("change.button",function(){q||g.refresh();});this.buttonElement.bind("mousedown.button",function(s){if(!r.disabled){q=false;m=s.pageX;f=s.pageY;}}).bind("mouseup.button",function(s){if(!r.disabled){if(m!==s.pageX||f!==s.pageY){q=true;}}});}if(this.type==="checkbox"){this.buttonElement.bind("click.button",function(){if(r.disabled||q){return false;}c(this).toggleClass("ui-state-active");g.buttonElement.attr("aria-pressed",g.element[0].checked);});}else{if(this.type==="radio"){this.buttonElement.bind("click.button",function(){if(r.disabled||q){return false;}c(this).addClass("ui-state-active");g.buttonElement.attr("aria-pressed","true");var s=g.element[0];e(s).not(s).map(function(){return c(this).button("widget")[0];}).removeClass("ui-state-active").attr("aria-pressed","false");});}else{this.buttonElement.bind("mousedown.button",function(){if(r.disabled){return false;}c(this).addClass("ui-state-active");o=this;c(document).one("mouseup",function(){o=null;});}).bind("mouseup.button",function(){if(r.disabled){return false;}c(this).removeClass("ui-state-active");}).bind("keydown.button",function(s){if(r.disabled){return false;}if(s.keyCode==c.ui.keyCode.SPACE||s.keyCode==c.ui.keyCode.ENTER){c(this).addClass("ui-state-active");}}).bind("keyup.button",function(){c(this).removeClass("ui-state-active");});this.buttonElement.is("a")&&this.buttonElement.keyup(function(s){s.keyCode===c.ui.keyCode.SPACE&&c(this).click();});}}this._setOption("disabled",r.disabled);this._resetButton();},_determineButtonType:function(){this.type=this.element.is(":checkbox")?"checkbox":this.element.is(":radio")?"radio":this.element.is("input")?"input":"button";if(this.type==="checkbox"||this.type==="radio"){var g=this.element.parents().filter(":last"),k="label[for='"+this.element.attr("id")+"']";this.buttonElement=g.find(k);if(!this.buttonElement.length){g=g.length?g.siblings():this.element.siblings();this.buttonElement=g.filter(k);if(!this.buttonElement.length){this.buttonElement=g.find(k);}}this.element.addClass("ui-helper-hidden-accessible");(g=this.element.is(":checked"))&&this.buttonElement.addClass("ui-state-active");this.buttonElement.attr("aria-pressed",g);}else{this.buttonElement=this.element;}},widget:function(){return this.buttonElement;},destroy:function(){this.element.removeClass("ui-helper-hidden-accessible");this.buttonElement.removeClass("ui-button ui-widget ui-state-default ui-corner-all ui-state-hover ui-state-active  ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only").removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html());this.hasTitle||this.buttonElement.removeAttr("title");c.Widget.prototype.destroy.call(this);},_setOption:function(g,k){c.Widget.prototype._setOption.apply(this,arguments);if(g==="disabled"){k?this.element.propAttr("disabled",true):this.element.propAttr("disabled",false);}else{this._resetButton();}},refresh:function(){var g=this.element.is(":disabled");g!==this.options.disabled&&this._setOption("disabled",g);if(this.type==="radio"){e(this.element[0]).each(function(){c(this).is(":checked")?c(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):c(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false");});}else{if(this.type==="checkbox"){this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false");}}},_resetButton:function(){if(this.type==="input"){this.options.label&&this.element.val(this.options.label);}else{var g=this.buttonElement.removeClass("ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only"),s=c("<span></span>").addClass("ui-button-text").html(this.options.label).appendTo(g.empty()).text(),l=this.options.icons,k=l.primary&&l.secondary,r=[];if(l.primary||l.secondary){if(this.options.text){r.push("ui-button-text-icon"+(k?"s":l.primary?"-primary":"-secondary"));}l.primary&&g.prepend("<span class='ui-button-icon-primary ui-icon "+l.primary+"'></span>");l.secondary&&g.append("<span class='ui-button-icon-secondary ui-icon "+l.secondary+"'></span>");if(!this.options.text){r.push(k?"ui-button-icons-only":"ui-button-icon-only");this.hasTitle||g.attr("title",s);}}else{r.push("ui-button-text-only");}g.addClass(r.join(" "));}}});c.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset");},_init:function(){this.refresh();},_setOption:function(g,k){g==="disabled"&&this.buttons.button("option",g,k);c.Widget.prototype._setOption.apply(this,arguments);},refresh:function(){var g=this.element.css("direction")==="ltr";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return c(this).button("widget")[0];}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(g?"ui-corner-left":"ui-corner-right").end().filter(":last").addClass(g?"ui-corner-right":"ui-corner-left").end().end();},destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return c(this).button("widget")[0];}).removeClass("ui-corner-left ui-corner-right").end().button("destroy");c.Widget.prototype.destroy.call(this);}});})(jQuery);(function(k,e){var d={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},g={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true},f=k.attrFn||{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true,click:true};k.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:{my:"center",at:"center",collision:"fit",using:function(l){var c=k(this).css(l).offset().top;c<0&&k(this).css("top",l.top-c);}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1000},_create:function(){this.originalTitle=this.element.attr("title");if(typeof this.originalTitle!=="string"){this.originalTitle="";}this.options.title=this.options.title||this.originalTitle;var l=this,c=l.options,s=c.title||"&#160;",r=k.ui.dialog.getTitleId(l.element),o=(l.uiDialog=k("<div></div>")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+c.dialogClass).css({zIndex:c.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(u){if(c.closeOnEscape&&!u.isDefaultPrevented()&&u.keyCode&&u.keyCode===k.ui.keyCode.ESCAPE){l.close(u);u.preventDefault();}}).attr({role:"dialog","aria-labelledby":r}).mousedown(function(u){l.moveToTop(false,u);});l.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(o);var q=(l.uiDialogTitlebar=k("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(o),m=k('<a href="#"></a>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){m.addClass("ui-state-hover");},function(){m.removeClass("ui-state-hover");}).focus(function(){m.addClass("ui-state-focus");}).blur(function(){m.removeClass("ui-state-focus");}).click(function(u){l.close(u);return false;}).appendTo(q);(l.uiDialogTitlebarCloseText=k("<span></span>")).addClass("ui-icon ui-icon-closethick").text(c.closeText).appendTo(m);k("<span></span>").addClass("ui-dialog-title").attr("id",r).html(s).prependTo(q);if(k.isFunction(c.beforeclose)&&!k.isFunction(c.beforeClose)){c.beforeClose=c.beforeclose;}q.find("*").add(q).disableSelection();c.draggable&&k.fn.draggable&&l._makeDraggable();c.resizable&&k.fn.resizable&&l._makeResizable();l._createButtons(c.buttons);l._isOpen=false;k.fn.bgiframe&&o.bgiframe();},_init:function(){this.options.autoOpen&&this.open();},destroy:function(){var c=this;c.overlay&&c.overlay.destroy();c.uiDialog.hide();c.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");c.uiDialog.remove();c.originalTitle&&c.element.attr("title",c.originalTitle);return c;},widget:function(){return this.uiDialog;},close:function(l){var c=this,o,m;if(false!==c._trigger("beforeClose",l)){c.overlay&&c.overlay.destroy();c.uiDialog.unbind("keypress.ui-dialog");c._isOpen=false;if(c.options.hide){c.uiDialog.hide(c.options.hide,function(){c._trigger("close",l);});}else{c.uiDialog.hide();c._trigger("close",l);}k.ui.dialog.overlay.resize();if(c.options.modal){o=0;k(".ui-dialog").each(function(){if(this!==c.uiDialog[0]){m=k(this).css("z-index");isNaN(m)||(o=Math.max(o,m));}});k.ui.dialog.maxZ=o;}return c;}},isOpen:function(){return this._isOpen;},moveToTop:function(l,c){var o=this,m=o.options;if(m.modal&&!l||!m.stack&&!m.modal){return o._trigger("focus",c);}if(m.zIndex>k.ui.dialog.maxZ){k.ui.dialog.maxZ=m.zIndex;}if(o.overlay){k.ui.dialog.maxZ+=1;o.overlay.$el.css("z-index",k.ui.dialog.overlay.maxZ=k.ui.dialog.maxZ);}l={scrollTop:o.element.scrollTop(),scrollLeft:o.element.scrollLeft()};k.ui.dialog.maxZ+=1;o.uiDialog.css("z-index",k.ui.dialog.maxZ);o.element.attr(l);o._trigger("focus",c);return o;},open:function(){if(!this._isOpen){var l=this,c=l.options,m=l.uiDialog;l.overlay=c.modal?new k.ui.dialog.overlay(l):null;l._size();l._position(c.position);m.show(c.show);l.moveToTop(true);c.modal&&m.bind("keypress.ui-dialog",function(r){if(r.keyCode===k.ui.keyCode.TAB){var o=k(":tabbable",this),q=o.filter(":first");o=o.filter(":last");if(r.target===o[0]&&!r.shiftKey){q.focus(1);return false;}else{if(r.target===q[0]&&r.shiftKey){o.focus(1);return false;}}}});k(l.element.find(":tabbable").get().concat(m.find(".ui-dialog-buttonpane :tabbable").get().concat(m.get()))).eq(0).focus();l._isOpen=true;l._trigger("open");return l;}},_createButtons:function(l){var c=this,q=false,o=k("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),m=k("<div></div>").addClass("ui-dialog-buttonset").appendTo(o);c.uiDialog.find(".ui-dialog-buttonpane").remove();typeof l==="object"&&l!==null&&k.each(l,function(){return !(q=true);});if(q){k.each(l,function(u,s){s=k.isFunction(s)?{click:s,text:u}:s;var r=k('<button type="button"></button>').click(function(){s.click.apply(c.element[0],arguments);}).appendTo(m);k.each(s,function(w,v){if(w!=="click"){w in f?r[w](v):r.attr(w,v);}});k.fn.button&&r.button();});o.appendTo(c.uiDialog);}},_makeDraggable:function(){function l(r){return{position:r.position,offset:r.offset};}var c=this,q=c.options,o=k(document),m;c.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(s,r){m=q.height==="auto"?"auto":k(this).height();k(this).height(k(this).height()).addClass("ui-dialog-dragging");c._trigger("dragStart",s,l(r));},drag:function(s,r){c._trigger("drag",s,l(r));},stop:function(s,r){q.position=[r.position.left-o.scrollLeft(),r.position.top-o.scrollTop()];k(this).removeClass("ui-dialog-dragging").height(m);c._trigger("dragStop",s,l(r));k.ui.dialog.overlay.resize();}});},_makeResizable:function(l){function c(r){return{originalPosition:r.originalPosition,originalSize:r.originalSize,position:r.position,size:r.size};}l=l===e?this.options.resizable:l;var q=this,o=q.options,m=q.uiDialog.css("position");l=typeof l==="string"?l:"n,e,s,w,se,sw,ne,nw";q.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:q.element,maxWidth:o.maxWidth,maxHeight:o.maxHeight,minWidth:o.minWidth,minHeight:q._minHeight(),handles:l,start:function(s,r){k(this).addClass("ui-dialog-resizing");q._trigger("resizeStart",s,c(r));},resize:function(s,r){q._trigger("resize",s,c(r));},stop:function(s,r){k(this).removeClass("ui-dialog-resizing");o.height=k(this).height();o.width=k(this).width();q._trigger("resizeStop",s,c(r));k.ui.dialog.overlay.resize();}}).css("position",m).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se");},_minHeight:function(){var c=this.options;return c.height==="auto"?c.minHeight:Math.min(c.minHeight,c.height);},_position:function(l){var c=[],o=[0,0],m;if(l){if(typeof l==="string"||typeof l==="object"&&"0" in l){c=l.split?l.split(" "):[l[0],l[1]];if(c.length===1){c[1]=c[0];}k.each(["left","top"],function(q,r){if(+c[q]===c[q]){o[q]=c[q];c[q]=r;}});l={my:c.join(" "),at:c.join(" "),offset:o.join(" ")};}l=k.extend({},k.ui.dialog.prototype.options.position,l);}else{l=k.ui.dialog.prototype.options.position;}(m=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position(k.extend({of:window},l));m||this.uiDialog.hide();},_setOptions:function(l){var c=this,o={},m=false;k.each(l,function(q,r){c._setOption(q,r);if(q in d){m=true;}if(q in g){o[q]=r;}});m&&this._size();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",o);},_setOption:function(l,c){var q=this,o=q.uiDialog;switch(l){case"beforeclose":l="beforeClose";break;case"buttons":q._createButtons(c);break;case"closeText":q.uiDialogTitlebarCloseText.text(""+c);break;case"dialogClass":o.removeClass(q.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+c);break;case"disabled":c?o.addClass("ui-dialog-disabled"):o.removeClass("ui-dialog-disabled");break;case"draggable":var m=o.is(":data(draggable)");m&&!c&&o.draggable("destroy");!m&&c&&q._makeDraggable();break;case"position":q._position(c);break;case"resizable":(m=o.is(":data(resizable)"))&&!c&&o.resizable("destroy");m&&typeof c==="string"&&o.resizable("option","handles",c);!m&&c!==false&&q._makeResizable(c);break;case"title":k(".ui-dialog-title",q.uiDialogTitlebar).html(""+(c||"&#160;"));break;}k.Widget.prototype._setOption.apply(q,arguments);},_size:function(){var l=this.options,c,o,m=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0});if(l.minWidth>l.width){l.width=l.minWidth;}c=this.uiDialog.css({height:"auto",width:l.width}).height();o=Math.max(0,l.minHeight-c);if(l.height==="auto"){if(k.support.minHeight){this.element.css({minHeight:o,height:"auto"});}else{this.uiDialog.show();l=this.element.css("height","auto").height();m||this.uiDialog.hide();this.element.height(Math.max(l,o));}}else{this.element.height(Math.max(l.height-c,0));}this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight());}});k.extend(k.ui.dialog,{version:"1.8.16",uuid:0,maxZ:0,getTitleId:function(c){c=c.attr("id");if(!c){this.uuid+=1;c=this.uuid;}return"ui-dialog-title-"+c;},overlay:function(c){this.$el=k.ui.dialog.overlay.create(c);}});k.extend(k.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:k.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(c){return c+".dialog-overlay";}).join(" "),create:function(l){if(this.instances.length===0){setTimeout(function(){k.ui.dialog.overlay.instances.length&&k(document).bind(k.ui.dialog.overlay.events,function(m){if(k(m.target).zIndex()<k.ui.dialog.overlay.maxZ){return false;}});},1);k(document).bind("keydown.dialog-overlay",function(m){if(l.options.closeOnEscape&&!m.isDefaultPrevented()&&m.keyCode&&m.keyCode===k.ui.keyCode.ESCAPE){l.close(m);m.preventDefault();}});k(window).bind("resize.dialog-overlay",k.ui.dialog.overlay.resize);}var c=(this.oldInstances.pop()||k("<div></div>").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});k.fn.bgiframe&&c.bgiframe();this.instances.push(c);return c;},destroy:function(l){var c=k.inArray(l,this.instances);c!=-1&&this.oldInstances.push(this.instances.splice(c,1)[0]);this.instances.length===0&&k([document,window]).unbind(".dialog-overlay");l.remove();var m=0;k.each(this.instances,function(){m=Math.max(m,this.css("z-index"));});this.maxZ=m;},height:function(){var l,c;if(k.browser.msie&&k.browser.version<7){l=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);c=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return l<c?k(window).height()+"px":l+"px";}else{return k(document).height()+"px";}},width:function(){var l,c;if(k.browser.msie){l=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);c=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);return l<c?k(window).width()+"px":l+"px";}else{return k(document).width()+"px";}},resize:function(){var c=k([]);k.each(k.ui.dialog.overlay.instances,function(){c=c.add(this);});c.css({width:0,height:0}).css({width:k.ui.dialog.overlay.width(),height:k.ui.dialog.overlay.height()});}});k.extend(k.ui.dialog.overlay.prototype,{destroy:function(){k.ui.dialog.overlay.destroy(this.$el);}});})(jQuery);(function(c){c.widget("ui.slider",c.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null},_create:function(){var g=this,d=this.options,o=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),l=d.values&&d.values.length||1,m=[];this._mouseSliding=this._keySliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all"+(d.disabled?" ui-slider-disabled ui-disabled":""));this.range=c([]);if(d.range){if(d.range===true){if(!d.values){d.values=[this._valueMin(),this._valueMin()];}if(d.values.length&&d.values.length!==2){d.values=[d.values[0],d.values[0]];}}this.range=c("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(d.range==="min"||d.range==="max"?" ui-slider-range-"+d.range:""));}for(var k=o.length;k<l;k+=1){m.push("<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>");}this.handles=o.add(c(m.join("")).appendTo(g.element));this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(e){e.preventDefault();}).hover(function(){d.disabled||c(this).addClass("ui-state-hover");},function(){c(this).removeClass("ui-state-hover");}).focus(function(){if(d.disabled){c(this).blur();}else{c(".ui-slider .ui-state-focus").removeClass("ui-state-focus");c(this).addClass("ui-state-focus");}}).blur(function(){c(this).removeClass("ui-state-focus");});this.handles.each(function(e){c(this).data("index.ui-slider-handle",e);});this.handles.keydown(function(u){var q=true,f=c(this).data("index.ui-slider-handle"),r,s,e;if(!g.options.disabled){switch(u.keyCode){case c.ui.keyCode.HOME:case c.ui.keyCode.END:case c.ui.keyCode.PAGE_UP:case c.ui.keyCode.PAGE_DOWN:case c.ui.keyCode.UP:case c.ui.keyCode.RIGHT:case c.ui.keyCode.DOWN:case c.ui.keyCode.LEFT:q=false;if(!g._keySliding){g._keySliding=true;c(this).addClass("ui-state-active");r=g._start(u,f);if(r===false){return;}}break;}e=g.options.step;r=g.options.values&&g.options.values.length?(s=g.values(f)):(s=g.value());switch(u.keyCode){case c.ui.keyCode.HOME:s=g._valueMin();break;case c.ui.keyCode.END:s=g._valueMax();break;case c.ui.keyCode.PAGE_UP:s=g._trimAlignValue(r+(g._valueMax()-g._valueMin())/5);break;case c.ui.keyCode.PAGE_DOWN:s=g._trimAlignValue(r-(g._valueMax()-g._valueMin())/5);break;case c.ui.keyCode.UP:case c.ui.keyCode.RIGHT:if(r===g._valueMax()){return;}s=g._trimAlignValue(r+e);break;case c.ui.keyCode.DOWN:case c.ui.keyCode.LEFT:if(r===g._valueMin()){return;}s=g._trimAlignValue(r-e);break;}g._slide(u,f,s);return q;}}).keyup(function(f){var e=c(this).data("index.ui-slider-handle");if(g._keySliding){g._keySliding=false;g._stop(f,e);g._change(f,e);c(this).removeClass("ui-state-active");}});this._refreshValue();this._animateOff=false;},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy();return this;},_mouseCapture:function(k){var d=this.options,r,o,q,l,m;if(d.disabled){return false;}this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();r=this._normValueFromMouse({x:k.pageX,y:k.pageY});o=this._valueMax()-this._valueMin()+1;l=this;this.handles.each(function(f){var e=Math.abs(r-l.values(f));if(o>e){o=e;q=c(this);m=f;}});if(d.range===true&&this.values(1)===d.min){m+=1;q=c(this.handles[m]);}if(this._start(k,m)===false){return false;}this._mouseSliding=true;l._handleIndex=m;q.addClass("ui-state-active").focus();d=q.offset();this._clickOffset=!c(k.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:k.pageX-d.left-q.width()/2,top:k.pageY-d.top-q.height()/2-(parseInt(q.css("borderTopWidth"),10)||0)-(parseInt(q.css("borderBottomWidth"),10)||0)+(parseInt(q.css("marginTop"),10)||0)};this.handles.hasClass("ui-state-hover")||this._slide(k,m,r);return this._animateOff=true;},_mouseStart:function(){return true;},_mouseDrag:function(e){var d=this._normValueFromMouse({x:e.pageX,y:e.pageY});this._slide(e,this._handleIndex,d);return false;},_mouseStop:function(d){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(d,this._handleIndex);this._change(d,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false;},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal";},_normValueFromMouse:function(e){var d;if(this.orientation==="horizontal"){d=this.elementSize.width;e=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0);}else{d=this.elementSize.height;e=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0);}d=e/d;if(d>1){d=1;}if(d<0){d=0;}if(this.orientation==="vertical"){d=1-d;}e=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+d*e);},_start:function(e,d){var f={handle:this.handles[d],value:this.value()};if(this.options.values&&this.options.values.length){f.value=this.values(d);f.values=this.values();}return this._trigger("start",e,f);},_slide:function(e,d,k){var g;if(this.options.values&&this.options.values.length){g=this.values(d?0:1);if(this.options.values.length===2&&this.options.range===true&&(d===0&&k>g||d===1&&k<g)){k=g;}if(k!==this.values(d)){g=this.values();g[d]=k;e=this._trigger("slide",e,{handle:this.handles[d],value:k,values:g});this.values(d?0:1);e!==false&&this.values(d,k,true);}}else{if(k!==this.value()){e=this._trigger("slide",e,{handle:this.handles[d],value:k});e!==false&&this.value(k);}}},_stop:function(e,d){var f={handle:this.handles[d],value:this.value()};if(this.options.values&&this.options.values.length){f.value=this.values(d);f.values=this.values();}this._trigger("stop",e,f);},_change:function(e,d){if(!this._keySliding&&!this._mouseSliding){var f={handle:this.handles[d],value:this.value()};if(this.options.values&&this.options.values.length){f.value=this.values(d);f.values=this.values();}this._trigger("change",e,f);}},value:function(d){if(arguments.length){this.options.value=this._trimAlignValue(d);this._refreshValue();this._change(null,0);}else{return this._value();}},values:function(g,d){var m,k,l;if(arguments.length>1){this.options.values[g]=this._trimAlignValue(d);this._refreshValue();this._change(null,g);}else{if(arguments.length){if(c.isArray(arguments[0])){m=this.options.values;k=arguments[0];for(l=0;l<m.length;l+=1){m[l]=this._trimAlignValue(k[l]);this._change(null,l);}this._refreshValue();}else{return this.options.values&&this.options.values.length?this._values(g):this.value();}}else{return this._values();}}},_setOption:function(e,d){var k,g=0;if(c.isArray(this.options.values)){g=this.options.values.length;}c.Widget.prototype._setOption.apply(this,arguments);switch(e){case"disabled":if(d){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.propAttr("disabled",true);this.element.addClass("ui-disabled");}else{this.handles.propAttr("disabled",false);this.element.removeClass("ui-disabled");}break;case"orientation":this._detectOrientation();this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();break;case"value":this._animateOff=true;this._refreshValue();this._change(null,0);this._animateOff=false;break;case"values":this._animateOff=true;this._refreshValue();for(k=0;k<g;k+=1){this._change(null,k);}this._animateOff=false;break;}},_value:function(){var d=this.options.value;return d=this._trimAlignValue(d);},_values:function(e){var d,f;if(arguments.length){d=this.options.values[e];return d=this._trimAlignValue(d);}else{d=this.options.values.slice();for(f=0;f<d.length;f+=1){d[f]=this._trimAlignValue(d[f]);}return d;}},_trimAlignValue:function(e){if(e<=this._valueMin()){return this._valueMin();}if(e>=this._valueMax()){return this._valueMax();}var d=this.options.step>0?this.options.step:1,f=(e-this._valueMin())%d;e=e-f;if(Math.abs(f)*2>=d){e+=f>0?d:-d;}return parseFloat(e.toFixed(5));},_valueMin:function(){return this.options.min;},_valueMax:function(){return this.options.max;},_refreshValue:function(){var y=this.options.range,w=this.options,v=this,s=!this._animateOff?w.animate:false,u,o={},r,m,d,q;if(this.options.values&&this.options.values.length){this.handles.each(function(e){u=(v.values(e)-v._valueMin())/(v._valueMax()-v._valueMin())*100;o[v.orientation==="horizontal"?"left":"bottom"]=u+"%";c(this).stop(1,1)[s?"animate":"css"](o,w.animate);if(v.options.range===true){if(v.orientation==="horizontal"){if(e===0){v.range.stop(1,1)[s?"animate":"css"]({left:u+"%"},w.animate);}if(e===1){v.range[s?"animate":"css"]({width:u-r+"%"},{queue:false,duration:w.animate});}}else{if(e===0){v.range.stop(1,1)[s?"animate":"css"]({bottom:u+"%"},w.animate);}if(e===1){v.range[s?"animate":"css"]({height:u-r+"%"},{queue:false,duration:w.animate});}}}r=u;});}else{m=this.value();d=this._valueMin();q=this._valueMax();u=q!==d?(m-d)/(q-d)*100:0;o[v.orientation==="horizontal"?"left":"bottom"]=u+"%";this.handle.stop(1,1)[s?"animate":"css"](o,w.animate);if(y==="min"&&this.orientation==="horizontal"){this.range.stop(1,1)[s?"animate":"css"]({width:u+"%"},w.animate);}if(y==="max"&&this.orientation==="horizontal"){this.range[s?"animate":"css"]({width:100-u+"%"},{queue:false,duration:w.animate});}if(y==="min"&&this.orientation==="vertical"){this.range.stop(1,1)[s?"animate":"css"]({height:u+"%"},w.animate);}if(y==="max"&&this.orientation==="vertical"){this.range[s?"animate":"css"]({height:100-u+"%"},{queue:false,duration:w.animate});}}}});c.extend(c.ui.slider,{version:"1.8.16"});})(jQuery);(function(l,k){function g(){return ++f;}function e(){return ++c;}var f=0,c=0;l.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"<div></div>",remove:null,select:null,show:null,spinner:"<em>Loading&#8230;</em>",tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},_create:function(){this._tabify(true);},_setOption:function(d,m){if(d=="selected"){this.options.collapsible&&m==this.options.selected||this.select(m);}else{this.options[d]=m;this._tabify();}},_tabId:function(d){return d.title&&d.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+g();},_sanitizeSelector:function(d){return d.replace(/:/g,"\\:");},_cookie:function(){var d=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+e());return l.cookie.apply(null,[d].concat(l.makeArray(arguments)));},_ui:function(d,m){return{tab:d,panel:m,index:this.anchors.index(d)};},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var d=l(this);d.html(d.data("label.tabs")).removeData("label.tabs");});},_tabify:function(D){function B(m,o){m.css("display","");!l.support.opacity&&o.opacity&&m[0].style.removeAttribute("filter");}var E=this,C=this.options,A=/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=l(" > li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return l("a",this)[0];});this.panels=l([]);this.anchors.each(function(r,G){var o=l(G).attr("href"),m=o.split("#")[0],s;if(m&&(m===location.toString().split("#")[0]||(s=l("base")[0])&&m===s.href)){o=G.hash;G.href=o;}if(A.test(o)){E.panels=E.panels.add(E.element.find(E._sanitizeSelector(o)));}else{if(o&&o!=="#"){l.data(G,"href.tabs",o);l.data(G,"load.tabs",o.replace(/#.*$/,""));o=E._tabId(G);G.href="#"+o;G=E.element.find("#"+o);if(!G.length){G=l(C.panelTemplate).attr("id",o).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(E.panels[r-1]||E.list);G.data("destroy.tabs",true);}E.panels=E.panels.add(G);}else{C.disabled.push(r);}}});if(D){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all");this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(C.selected===k){location.hash&&this.anchors.each(function(m,o){if(o.hash==location.hash){C.selected=m;return false;}});if(typeof C.selected!=="number"&&C.cookie){C.selected=parseInt(E._cookie(),10);}if(typeof C.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length){C.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"));}C.selected=C.selected||(this.lis.length?0:-1);}else{if(C.selected===null){C.selected=-1;}}C.selected=C.selected>=0&&this.anchors[C.selected]||C.selected<0?C.selected:0;C.disabled=l.unique(C.disabled.concat(l.map(this.lis.filter(".ui-state-disabled"),function(m){return E.lis.index(m);}))).sort();l.inArray(C.selected,C.disabled)!=-1&&C.disabled.splice(l.inArray(C.selected,C.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");if(C.selected>=0&&this.anchors.length){E.element.find(E._sanitizeSelector(E.anchors[C.selected].hash)).removeClass("ui-tabs-hide");this.lis.eq(C.selected).addClass("ui-tabs-selected ui-state-active");E.element.queue("tabs",function(){E._trigger("show",null,E._ui(E.anchors[C.selected],E.element.find(E._sanitizeSelector(E.anchors[C.selected].hash))[0]));});this.load(C.selected);}l(window).bind("unload",function(){E.lis.add(E.anchors).unbind(".tabs");E.lis=E.anchors=E.panels=null;});}else{C.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"));}this.element[C.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");C.cookie&&this._cookie(C.selected,C.cookie);D=0;for(var y;y=this.lis[D];D++){l(y)[l.inArray(D,C.disabled)!=-1&&!l(y).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");}C.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(C.event!=="mouseover"){var w=function(m,o){o.is(":not(.ui-state-disabled)")&&o.addClass("ui-state-"+m);},u=function(m,o){o.removeClass("ui-state-"+m);};this.lis.bind("mouseover.tabs",function(){w("hover",l(this));});this.lis.bind("mouseout.tabs",function(){u("hover",l(this));});this.anchors.bind("focus.tabs",function(){w("focus",l(this).closest("li"));});this.anchors.bind("blur.tabs",function(){u("focus",l(this).closest("li"));});}var v,q;if(C.fx){if(l.isArray(C.fx)){v=C.fx[0];q=C.fx[1];}else{v=q=C.fx;}}var d=q?function(m,o){l(m).closest("li").addClass("ui-tabs-selected ui-state-active");o.hide().removeClass("ui-tabs-hide").animate(q,q.duration||"normal",function(){B(o,q);E._trigger("show",null,E._ui(m,o[0]));});}:function(m,o){l(m).closest("li").addClass("ui-tabs-selected ui-state-active");o.removeClass("ui-tabs-hide");E._trigger("show",null,E._ui(m,o[0]));},F=v?function(m,o){o.animate(v,v.duration||"normal",function(){E.lis.removeClass("ui-tabs-selected ui-state-active");o.addClass("ui-tabs-hide");B(o,v);E.element.dequeue("tabs");});}:function(m,o){E.lis.removeClass("ui-tabs-selected ui-state-active");o.addClass("ui-tabs-hide");E.element.dequeue("tabs");};this.anchors.bind(C.event+".tabs",function(){var r=this,s=l(r).closest("li"),o=E.panels.filter(":not(.ui-tabs-hide)"),m=E.element.find(E._sanitizeSelector(r.hash));if(s.hasClass("ui-tabs-selected")&&!C.collapsible||s.hasClass("ui-state-disabled")||s.hasClass("ui-state-processing")||E.panels.filter(":animated").length||E._trigger("select",null,E._ui(this,m[0]))===false){this.blur();return false;}C.selected=E.anchors.index(this);E.abort();if(C.collapsible){if(s.hasClass("ui-tabs-selected")){C.selected=-1;C.cookie&&E._cookie(C.selected,C.cookie);E.element.queue("tabs",function(){F(r,o);}).dequeue("tabs");this.blur();return false;}else{if(!o.length){C.cookie&&E._cookie(C.selected,C.cookie);E.element.queue("tabs",function(){d(r,m);});E.load(E.anchors.index(this));this.blur();return false;}}}C.cookie&&E._cookie(C.selected,C.cookie);if(m.length){o.length&&E.element.queue("tabs",function(){F(r,o);});E.element.queue("tabs",function(){d(r,m);});E.load(E.anchors.index(this));}else{throw"jQuery UI Tabs: Mismatching fragment identifier.";}l.browser.msie&&this.blur();});this.anchors.bind("click.tabs",function(){return false;});},_getIndex:function(d){if(typeof d=="string"){d=this.anchors.index(this.anchors.filter("[href$="+d+"]"));}return d;},destroy:function(){var d=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var o=l.data(this,"href.tabs");if(o){this.href=o;}var m=l(this).unbind(".tabs");l.each(["href","load","cache"],function(r,q){m.removeData(q+".tabs");});});this.lis.unbind(".tabs").add(this.panels).each(function(){l.data(this,"destroy.tabs")?l(this).remove():l(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");});d.cookie&&this._cookie(null,d.cookie);return this;},add:function(d,r,m){if(m===k){m=this.anchors.length;}var s=this,q=this.options;r=l(q.tabTemplate.replace(/#\{href\}/g,d).replace(/#\{label\}/g,r));d=!d.indexOf("#")?d.replace("#",""):this._tabId(l("a",r)[0]);r.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var o=s.element.find("#"+d);o.length||(o=l(q.panelTemplate).attr("id",d).data("destroy.tabs",true));o.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(m>=this.lis.length){r.appendTo(this.list);o.appendTo(this.list[0].parentNode);}else{r.insertBefore(this.lis[m]);o.insertBefore(this.panels[m]);}q.disabled=l.map(q.disabled,function(u){return u>=m?++u:u;});this._tabify();if(this.anchors.length==1){q.selected=0;r.addClass("ui-tabs-selected ui-state-active");o.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){s._trigger("show",null,s._ui(s.anchors[0],s.panels[0]));});this.load(0);}this._trigger("add",null,this._ui(this.anchors[m],this.panels[m]));return this;},remove:function(d){d=this._getIndex(d);var o=this.options,m=this.lis.eq(d).remove(),q=this.panels.eq(d).remove();if(m.hasClass("ui-tabs-selected")&&this.anchors.length>1){this.select(d+(d+1<this.anchors.length?1:-1));}o.disabled=l.map(l.grep(o.disabled,function(r){return r!=d;}),function(r){return r>=d?--r:r;});this._tabify();this._trigger("remove",null,this._ui(m.find("a")[0],q[0]));return this;},enable:function(d){d=this._getIndex(d);var m=this.options;if(l.inArray(d,m.disabled)!=-1){this.lis.eq(d).removeClass("ui-state-disabled");m.disabled=l.grep(m.disabled,function(o){return o!=d;});this._trigger("enable",null,this._ui(this.anchors[d],this.panels[d]));return this;}},disable:function(d){d=this._getIndex(d);var m=this.options;if(d!=m.selected){this.lis.eq(d).addClass("ui-state-disabled");m.disabled.push(d);m.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[d],this.panels[d]));}return this;},select:function(d){d=this._getIndex(d);if(d==-1){if(this.options.collapsible&&this.options.selected!=-1){d=this.options.selected;}else{return this;}}this.anchors.eq(d).trigger(this.options.event+".tabs");return this;},load:function(d){d=this._getIndex(d);var r=this,m=this.options,s=this.anchors.eq(d)[0],q=l.data(s,"load.tabs");this.abort();if(!q||this.element.queue("tabs").length!==0&&l.data(s,"cache.tabs")){this.element.dequeue("tabs");}else{this.lis.eq(d).addClass("ui-state-processing");if(m.spinner){var o=l("span",s);o.data("label.tabs",o.html()).html(m.spinner);}this.xhr=l.ajax(l.extend({},m.ajaxOptions,{url:q,success:function(v,w){r.element.find(r._sanitizeSelector(s.hash)).html(v);r._cleanup();m.cache&&l.data(s,"cache.tabs",true);r._trigger("load",null,r._ui(r.anchors[d],r.panels[d]));try{m.ajaxOptions.success(v,w);}catch(u){}},error:function(v,w){r._cleanup();r._trigger("load",null,r._ui(r.anchors[d],r.panels[d]));try{m.ajaxOptions.error(v,w,d,s);}catch(u){}}}));r.element.dequeue("tabs");return this;}},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr;}this._cleanup();return this;},url:function(d,m){this.anchors.eq(d).removeData("cache.tabs").data("load.tabs",m);return this;},length:function(){return this.anchors.length;}});l.extend(l.ui.tabs,{version:"1.8.16"});l.extend(l.ui.tabs.prototype,{rotation:null,rotate:function(d,q){var m=this,r=this.options,o=m._rotate||(m._rotate=function(s){clearTimeout(m.rotation);m.rotation=setTimeout(function(){var u=r.selected;m.select(++u<m.anchors.length?u:0);},d);s&&s.stopPropagation();});q=m._unrotate||(m._unrotate=!q?function(s){s.clientX&&m.rotate(null);}:function(){t=r.selected;o();});if(d){this.element.bind("tabsshow",o);this.anchors.bind(r.event+".tabs",q);o();}else{clearTimeout(m.rotation);this.element.unbind("tabsshow",o);this.anchors.unbind(r.event+".tabs",q);delete this._rotate;delete this._unrotate;}return this;}});})(jQuery);(function(d,C){function M(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._inDialog=this._datepickerShowing=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass="ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false,autoSize:false,disabled:false};d.extend(this._defaults,this.regional[""]);this.dpDiv=N(d('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'));}function N(a){return a.bind("mouseout",function(b){b=d(b.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");b.length&&b.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover");}).bind("mouseover",function(b){b=d(b.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");if(!(d.datepicker._isDisabledDatepicker(J.inline?a.parent()[0]:J.input[0])||!b.length)){b.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");b.addClass("ui-state-hover");b.hasClass("ui-datepicker-prev")&&b.addClass("ui-datepicker-prev-hover");b.hasClass("ui-datepicker-next")&&b.addClass("ui-datepicker-next-hover");}});}function H(a,b){d.extend(a,b);for(var c in b){if(b[c]==null||b[c]==C){a[c]=b[c];}}return a;}d.extend(d.ui,{datepicker:{version:"1.8.16"}});var B=(new Date).getTime(),J;d.extend(M.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments);},_widgetDatepicker:function(){return this.dpDiv;},setDefaults:function(a){H(this._defaults,a||{});return this;},_attachDatepicker:function(a,b){var c=null;for(var e in this._defaults){var f=a.getAttribute("date:"+e);if(f){c=c||{};try{c[e]=eval(f);}catch(h){c[e]=f;}}}e=a.nodeName.toLowerCase();f=e=="div"||e=="span";if(!a.id){this.uuid+=1;a.id="dp"+this.uuid;}var i=this._newInst(d(a),f);i.settings=d.extend({},b||{},c||{});if(e=="input"){this._connectDatepicker(a,i);}else{f&&this._inlineDatepicker(a,i);}},_newInst:function(a,b){return{id:a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1"),input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:N(d('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))};},_connectDatepicker:function(a,b){var c=d(a);b.append=d([]);b.trigger=d([]);if(!c.hasClass(this.markerClassName)){this._attachments(c,b);c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(e,f,h){b.settings[f]=h;}).bind("getData.datepicker",function(e,f){return this._get(b,f);});this._autoSize(b);d.data(a,"datepicker",b);b.settings.disabled&&this._disableDatepicker(a);}},_attachments:function(a,b){var c=this._get(b,"appendText"),e=this._get(b,"isRTL");b.append&&b.append.remove();if(c){b.append=d('<span class="'+this._appendClass+'">'+c+"</span>");a[e?"before":"after"](b.append);}a.unbind("focus",this._showDatepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");if(c=="focus"||c=="both"){a.focus(this._showDatepicker);}if(c=="button"||c=="both"){c=this._get(b,"buttonText");var f=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonImageOnly")?d("<img/>").addClass(this._triggerClass).attr({src:f,alt:c,title:c}):d('<button type="button"></button>').addClass(this._triggerClass).html(f==""?c:d("<img/>").attr({src:f,alt:c,title:c})));a[e?"before":"after"](b.trigger);b.trigger.click(function(){d.datepicker._datepickerShowing&&d.datepicker._lastInput==a[0]?d.datepicker._hideDatepicker():d.datepicker._showDatepicker(a[0]);return false;});}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var e=function(f){for(var h=0,i=0,g=0;g<f.length;g++){if(f[g].length>h){h=f[g].length;i=g;}}return i;};b.setMonth(e(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(e(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay());}a.input.attr("size",this._formatDate(a,b).length);}},_inlineDatepicker:function(a,b){var c=d(a);if(!c.hasClass(this.markerClassName)){c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(e,f,h){b.settings[f]=h;}).bind("getData.datepicker",function(e,f){return this._get(b,f);});d.data(a,"datepicker",b);this._setDate(b,this._getDefaultDate(b),true);this._updateDatepicker(b);this._updateAlternate(b);b.settings.disabled&&this._disableDatepicker(a);b.dpDiv.css("display","block");}},_dialogDatepicker:function(a,b,c,e,f){a=this._dialogInst;if(!a){this.uuid+=1;this._dialogInput=d('<input type="text" id="'+("dp"+this.uuid)+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>');this._dialogInput.keydown(this._doKeyDown);d("body").append(this._dialogInput);a=this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};d.data(this._dialogInput[0],"datepicker",a);}H(a.settings,e||{});b=b&&b.constructor==Date?this._formatDate(a,b):b;this._dialogInput.val(b);this._pos=f?f.length?f:[f.pageX,f.pageY]:null;if(!this._pos){this._pos=[document.documentElement.clientWidth/2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];}this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=c;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);d.blockUI&&d.blockUI(this.dpDiv);d.data(this._dialogInput[0],"datepicker",a);return this;},_destroyDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();d.removeData(a,"datepicker");if(e=="input"){c.append.remove();c.trigger.remove();b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp);}else{if(e=="div"||e=="span"){b.removeClass(this.markerClassName).empty();}}}},_enableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=false;c.trigger.filter("button").each(function(){this.disabled=false;}).end().filter("img").css({opacity:"1.0",cursor:""});}else{if(e=="div"||e=="span"){b=b.children("."+this._inlineClass);b.children().removeClass("ui-state-disabled");b.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled");}}this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f;});}},_disableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=true;c.trigger.filter("button").each(function(){this.disabled=true;}).end().filter("img").css({opacity:"0.5",cursor:"default"});}else{if(e=="div"||e=="span"){b=b.children("."+this._inlineClass);b.children().addClass("ui-state-disabled");b.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled");}}this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f;});this._disabledInputs[this._disabledInputs.length]=a;}},_isDisabledDatepicker:function(a){if(!a){return false;}for(var b=0;b<this._disabledInputs.length;b++){if(this._disabledInputs[b]==a){return true;}}return false;},_getInst:function(a){try{return d.data(a,"datepicker");}catch(b){throw"Missing instance data for this datepicker";}},_optionDatepicker:function(a,b,c){var e=this._getInst(a);if(arguments.length==2&&typeof b=="string"){return b=="defaults"?d.extend({},d.datepicker._defaults):e?b=="all"?d.extend({},e.settings):this._get(e,b):null;}var f=b||{};if(typeof b=="string"){f={};f[b]=c;}if(e){this._curInst==e&&this._hideDatepicker();var h=this._getDateDatepicker(a,true),i=this._getMinMaxDate(e,"min"),g=this._getMinMaxDate(e,"max");H(e.settings,f);if(i!==null&&f.dateFormat!==C&&f.minDate===C){e.settings.minDate=this._formatDate(e,i);}if(g!==null&&f.dateFormat!==C&&f.maxDate===C){e.settings.maxDate=this._formatDate(e,g);}this._attachments(d(a),e);this._autoSize(e);this._setDate(e,h);this._updateAlternate(e);this._updateDatepicker(e);}},_changeDatepicker:function(a,b,c){this._optionDatepicker(a,b,c);},_refreshDatepicker:function(a){(a=this._getInst(a))&&this._updateDatepicker(a);},_setDateDatepicker:function(a,b){if(a=this._getInst(a)){this._setDate(a,b);this._updateDatepicker(a);this._updateAlternate(a);}},_getDateDatepicker:function(a,b){(a=this._getInst(a))&&!a.inline&&this._setDateFromField(a,b);return a?this._getDate(a):null;},_doKeyDown:function(a){var b=d.datepicker._getInst(a.target),c=true,e=b.dpDiv.is(".ui-datepicker-rtl");b._keyEvent=true;if(d.datepicker._datepickerShowing){switch(a.keyCode){case 9:d.datepicker._hideDatepicker();c=false;break;case 13:c=d("td."+d.datepicker._dayOverClass+":not(."+d.datepicker._currentClass+")",b.dpDiv);c[0]&&d.datepicker._selectDay(a.target,b.selectedMonth,b.selectedYear,c[0]);if(a=d.datepicker._get(b,"onSelect")){c=d.datepicker._formatDate(b);a.apply(b.input?b.input[0]:null,[c,b]);}else{d.datepicker._hideDatepicker();}return false;case 27:d.datepicker._hideDatepicker();break;case 33:d.datepicker._adjustDate(a.target,a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 34:d.datepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,"stepMonths"),"M");break;case 35:if(a.ctrlKey||a.metaKey){d.datepicker._clearDate(a.target);}c=a.ctrlKey||a.metaKey;break;case 36:if(a.ctrlKey||a.metaKey){d.datepicker._gotoToday(a.target);}c=a.ctrlKey||a.metaKey;break;case 37:if(a.ctrlKey||a.metaKey){d.datepicker._adjustDate(a.target,e?+1:-1,"D");}c=a.ctrlKey||a.metaKey;if(a.originalEvent.altKey){d.datepicker._adjustDate(a.target,a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");}break;case 38:if(a.ctrlKey||a.metaKey){d.datepicker._adjustDate(a.target,-7,"D");}c=a.ctrlKey||a.metaKey;break;case 39:if(a.ctrlKey||a.metaKey){d.datepicker._adjustDate(a.target,e?-1:+1,"D");}c=a.ctrlKey||a.metaKey;if(a.originalEvent.altKey){d.datepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,"stepMonths"),"M");}break;case 40:if(a.ctrlKey||a.metaKey){d.datepicker._adjustDate(a.target,+7,"D");}c=a.ctrlKey||a.metaKey;break;default:c=false;}}else{if(a.keyCode==36&&a.ctrlKey){d.datepicker._showDatepicker(this);}else{c=false;}}if(c){a.preventDefault();a.stopPropagation();}},_doKeyPress:function(a){var b=d.datepicker._getInst(a.target);if(d.datepicker._get(b,"constrainInput")){b=d.datepicker._possibleChars(d.datepicker._get(b,"dateFormat"));var c=String.fromCharCode(a.charCode==C?a.keyCode:a.charCode);return a.ctrlKey||a.metaKey||c<" "||!b||b.indexOf(c)>-1;}},_doKeyUp:function(a){a=d.datepicker._getInst(a.target);if(a.input.val()!=a.lastVal){try{if(d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a))){d.datepicker._setDateFromField(a);d.datepicker._updateAlternate(a);d.datepicker._updateDatepicker(a);}}catch(b){d.datepicker.log(b);}}return true;},_showDatepicker:function(a){a=a.target||a;if(a.nodeName.toLowerCase()!="input"){a=d("input",a.parentNode)[0];}if(!(d.datepicker._isDisabledDatepicker(a)||d.datepicker._lastInput==a)){var b=d.datepicker._getInst(a);if(d.datepicker._curInst&&d.datepicker._curInst!=b){d.datepicker._datepickerShowing&&d.datepicker._triggerOnClose(d.datepicker._curInst);d.datepicker._curInst.dpDiv.stop(true,true);}var c=d.datepicker._get(b,"beforeShow");c=c?c.apply(a,[a,b]):{};if(c!==false){H(b.settings,c);b.lastVal=null;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);if(d.datepicker._inDialog){a.value="";}if(!d.datepicker._pos){d.datepicker._pos=d.datepicker._findPos(a);d.datepicker._pos[1]+=a.offsetHeight;}var e=false;d(a).parents().each(function(){e|=d(this).css("position")=="fixed";return !e;});if(e&&d.browser.opera){d.datepicker._pos[0]-=document.documentElement.scrollLeft;d.datepicker._pos[1]-=document.documentElement.scrollTop;}c={left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos=null;b.dpDiv.empty();b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b);c=d.datepicker._checkOffset(b,c,e);b.dpDiv.css({position:d.datepicker._inDialog&&d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){c=d.datepicker._get(b,"showAnim");var f=d.datepicker._get(b,"duration"),h=function(){var i=b.dpDiv.find("iframe.ui-datepicker-cover");if(i.length){var g=d.datepicker._getBorders(b.dpDiv);i.css({left:-g[0],top:-g[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()});}};b.dpDiv.zIndex(d(a).zIndex()+1);d.datepicker._datepickerShowing=true;d.effects&&d.effects[c]?b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f,h):b.dpDiv[c||"show"](c?f:null,h);if(!c||!f){h();}b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curInst=b;}}}},_updateDatepicker:function(a){this.maxRows=4;var b=d.datepicker._getBorders(a.dpDiv);J=a;a.dpDiv.empty().append(this._generateHTML(a));var c=a.dpDiv.find("iframe.ui-datepicker-cover");c.length&&c.css({left:-b[0],top:-b[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()});a.dpDiv.find("."+this._dayOverClass+" a").mouseover();b=this._getNumberOfMonths(a);c=b[1];a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");c>1&&a.dpDiv.addClass("ui-datepicker-multi-"+c).css("width",17*c+"em");a.dpDiv[(b[0]!=1||b[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");a==d.datepicker._curInst&&d.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var e=a.yearshtml;setTimeout(function(){e===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml);e=a.yearshtml=null;},0);}},_getBorders:function(a){var b=function(c){return{thin:1,medium:2,thick:3}[c]||c;};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))];},_checkOffset:function(a,b,c){var e=a.dpDiv.outerWidth(),f=a.dpDiv.outerHeight(),h=a.input?a.input.outerWidth():0,i=a.input?a.input.outerHeight():0,g=document.documentElement.clientWidth+d(document).scrollLeft(),j=document.documentElement.clientHeight+d(document).scrollTop();b.left-=this._get(a,"isRTL")?e-h:0;b.left-=c&&b.left==a.input.offset().left?d(document).scrollLeft():0;b.top-=c&&b.top==a.input.offset().top+i?d(document).scrollTop():0;b.left-=Math.min(b.left,b.left+e>g&&g>e?Math.abs(b.left+e-g):0);b.top-=Math.min(b.top,b.top+f>j&&j>f?Math.abs(f+i):0);return b;},_findPos:function(a){for(var b=this._get(this._getInst(a),"isRTL");a&&(a.type=="hidden"||a.nodeType!=1||d.expr.filters.hidden(a));){a=a[b?"previousSibling":"nextSibling"];}a=d(a).offset();return[a.left,a.top];},_triggerOnClose:function(a){var b=this._get(a,"onClose");if(b){b.apply(a.input?a.input[0]:null,[a.input?a.input.val():"",a]);}},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=d.data(a,"datepicker"))){if(this._datepickerShowing){a=this._get(b,"showAnim");var c=this._get(b,"duration"),e=function(){d.datepicker._tidyDialog(b);this._curInst=null;};d.effects&&d.effects[a]?b.dpDiv.hide(a,d.datepicker._get(b,"showOptions"),c,e):b.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"?"fadeOut":"hide"](a?c:null,e);a||e();d.datepicker._triggerOnClose(b);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(d.blockUI){d.unblockUI();d("body").append(this.dpDiv);}}this._inDialog=false;}}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar");},_checkExternalClick:function(a){if(d.datepicker._curInst){a=d(a.target);a[0].id!=d.datepicker._mainDivId&&a.parents("#"+d.datepicker._mainDivId).length==0&&!a.hasClass(d.datepicker.markerClassName)&&!a.hasClass(d.datepicker._triggerClass)&&d.datepicker._datepickerShowing&&!(d.datepicker._inDialog&&d.blockUI)&&d.datepicker._hideDatepicker();}},_adjustDate:function(a,b,c){a=d(a);var e=this._getInst(a[0]);if(!this._isDisabledDatepicker(a[0])){this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c);this._updateDatepicker(e);}},_gotoToday:function(a){a=d(a);var b=this._getInst(a[0]);if(this._get(b,"gotoCurrent")&&b.currentDay){b.selectedDay=b.currentDay;b.drawMonth=b.selectedMonth=b.currentMonth;b.drawYear=b.selectedYear=b.currentYear;}else{var c=new Date;b.selectedDay=c.getDate();b.drawMonth=b.selectedMonth=c.getMonth();b.drawYear=b.selectedYear=c.getFullYear();}this._notifyChange(b);this._adjustDate(a);},_selectMonthYear:function(a,b,c){a=d(a);var e=this._getInst(a[0]);e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(a);},_selectDay:function(a,b,c,e){var f=d(a);if(!(d(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(f[0]))){f=this._getInst(f[0]);f.selectedDay=f.currentDay=d("a",e).html();f.selectedMonth=f.currentMonth=b;f.selectedYear=f.currentYear=c;this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear));}},_clearDate:function(a){a=d(a);this._getInst(a[0]);this._selectDate(a,"");},_selectDate:function(a,b){a=this._getInst(d(a)[0]);b=b!=null?b:this._formatDate(a);a.input&&a.input.val(b);this._updateAlternate(a);var c=this._get(a,"onSelect");if(c){c.apply(a.input?a.input[0]:null,[b,a]);}else{a.input&&a.input.trigger("change");}if(a.inline){this._updateDatepicker(a);}else{this._hideDatepicker();this._lastInput=a.input[0];typeof a.input[0]!="object"&&a.input.focus();this._lastInput=null;}},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),e=this._getDate(a),f=this.formatDate(c,e,this._getFormatConfig(a));d(b).each(function(){d(this).val(f);});}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6,""];},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b=a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((b-a)/86400000)/7)+1;},parseDate:function(a,b,c){if(a==null||b==null){throw"Invalid arguments";}b=typeof b=="object"?b.toString():b+"";if(b==""){return null;}var e=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;e=typeof e!="string"?e:(new Date).getFullYear()%100+parseInt(e,10);for(var f=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,h=(c?c.dayNames:null)||this._defaults.dayNames,i=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,j=c=-1,l=-1,u=-1,k=false,o=function(p){(p=A+1<a.length&&a.charAt(A+1)==p)&&A++;return p;},m=function(p){var D=o(p);p=new RegExp("^\\d{1,"+(p=="@"?14:p=="!"?20:p=="y"&&D?4:p=="o"?3:2)+"}");p=b.substring(q).match(p);if(!p){throw"Missing number at position "+q;}q+=p[0].length;return parseInt(p[0],10);},n=function(p,D,K){p=d.map(o(p)?K:D,function(w,x){return[[x,w]];}).sort(function(w,x){return -(w[1].length-x[1].length);});var E=-1;d.each(p,function(w,x){w=x[1];if(b.substr(q,w.length).toLowerCase()==w.toLowerCase()){E=x[0];q+=w.length;return false;}});if(E!=-1){return E+1;}else{throw"Unknown name at position "+q;}},s=function(){if(b.charAt(q)!=a.charAt(A)){throw"Unexpected literal at position "+q;}q++;},q=0,A=0;A<a.length;A++){if(k){if(a.charAt(A)=="'"&&!o("'")){k=false;}else{s();}}else{switch(a.charAt(A)){case"d":l=m("d");break;case"D":n("D",f,h);break;case"o":u=m("o");break;case"m":j=m("m");break;case"M":j=n("M",i,g);break;case"y":c=m("y");break;case"@":var v=new Date(m("@"));c=v.getFullYear();j=v.getMonth()+1;l=v.getDate();break;case"!":v=new Date((m("!")-this._ticksTo1970)/10000);c=v.getFullYear();j=v.getMonth()+1;l=v.getDate();break;case"'":if(o("'")){s();}else{k=true;}break;default:s();}}}if(q<b.length){throw"Extra/unparsed characters found in date: "+b.substring(q);}if(c==-1){c=(new Date).getFullYear();}else{if(c<100){c+=(new Date).getFullYear()-(new Date).getFullYear()%100+(c<=e?0:-100);}}if(u>-1){j=1;l=u;do{e=this._getDaysInMonth(c,j-1);if(l<=e){break;}j++;l-=e;}while(1);}v=this._daylightSavingAdjust(new Date(c,j-1,l));if(v.getFullYear()!=c||v.getMonth()+1!=j||v.getDate()!=l){throw"Invalid date";}return v;},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*10000000,formatDate:function(a,b,c){if(!b){return"";}var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,h=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;c=(c?c.monthNames:null)||this._defaults.monthNames;var i=function(o){(o=k+1<a.length&&a.charAt(k+1)==o)&&k++;return o;},g=function(o,m,n){m=""+m;if(i(o)){for(;m.length<n;){m="0"+m;}}return m;},j=function(o,m,n,s){return i(o)?s[m]:n[m];},l="",u=false;if(b){for(var k=0;k<a.length;k++){if(u){if(a.charAt(k)=="'"&&!i("'")){u=false;}else{l+=a.charAt(k);}}else{switch(a.charAt(k)){case"d":l+=g("d",b.getDate(),2);break;case"D":l+=j("D",b.getDay(),e,f);break;case"o":l+=g("o",Math.round(((new Date(b.getFullYear(),b.getMonth(),b.getDate())).getTime()-(new Date(b.getFullYear(),0,0)).getTime())/86400000),3);break;case"m":l+=g("m",b.getMonth()+1,2);break;case"M":l+=j("M",b.getMonth(),h,c);break;case"y":l+=i("y")?b.getFullYear():(b.getYear()%100<10?"0":"")+b.getYear()%100;break;case"@":l+=b.getTime();break;case"!":l+=b.getTime()*10000+this._ticksTo1970;break;case"'":if(i("'")){l+="'";}else{u=true;}break;default:l+=a.charAt(k);}}}}return l;},_possibleChars:function(a){for(var b="",c=false,e=function(h){(h=f+1<a.length&&a.charAt(f+1)==h)&&f++;return h;},f=0;f<a.length;f++){if(c){if(a.charAt(f)=="'"&&!e("'")){c=false;}else{b+=a.charAt(f);}}else{switch(a.charAt(f)){case"d":case"m":case"y":case"@":b+="0123456789";break;case"D":case"M":return null;case"'":if(e("'")){b+="'";}else{c=true;}break;default:b+=a.charAt(f);}}}return b;},_get:function(a,b){return a.settings[b]!==C?a.settings[b]:this._defaults[b];},_setDateFromField:function(a,b){if(a.input.val()!=a.lastVal){var c=this._get(a,"dateFormat"),e=a.lastVal=a.input?a.input.val():null,f,h;f=h=this._getDefaultDate(a);var i=this._getFormatConfig(a);try{f=this.parseDate(c,e,i)||h;}catch(g){this.log(g);e=b?"":e;}a.selectedDay=f.getDate();a.drawMonth=a.selectedMonth=f.getMonth();a.drawYear=a.selectedYear=f.getFullYear();a.currentDay=e?f.getDate():0;a.currentMonth=e?f.getMonth():0;a.currentYear=e?f.getFullYear():0;this._adjustInstDate(a);}},_getDefaultDate:function(a){return this._restrictMinMax(a,this._determineDate(a,this._get(a,"defaultDate"),new Date));},_determineDate:function(a,b,c){var e=function(h){var i=new Date;i.setDate(i.getDate()+h);return i;},f=function(h){try{return d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),h,d.datepicker._getFormatConfig(a));}catch(i){}var g=(h.toLowerCase().match(/^c/)?d.datepicker._getDate(a):null)||new Date,j=g.getFullYear(),l=g.getMonth();g=g.getDate();for(var u=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,k=u.exec(h);k;){switch(k[2]||"d"){case"d":case"D":g+=parseInt(k[1],10);break;case"w":case"W":g+=parseInt(k[1],10)*7;break;case"m":case"M":l+=parseInt(k[1],10);g=Math.min(g,d.datepicker._getDaysInMonth(j,l));break;case"y":case"Y":j+=parseInt(k[1],10);g=Math.min(g,d.datepicker._getDaysInMonth(j,l));break;}k=u.exec(h);}return new Date(j,l,g);};if(b=(b=b==null||b===""?c:typeof b=="string"?f(b):typeof b=="number"?isNaN(b)?c:e(b):new Date(b.getTime()))&&b.toString()=="Invalid Date"?c:b){b.setHours(0);b.setMinutes(0);b.setSeconds(0);b.setMilliseconds(0);}return this._daylightSavingAdjust(b);},_daylightSavingAdjust:function(a){if(!a){return null;}a.setHours(a.getHours()>12?a.getHours()+2:0);return a;},_setDate:function(a,b,c){var e=!b,f=a.selectedMonth,h=a.selectedYear;b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();if((f!=a.selectedMonth||h!=a.selectedYear)&&!c){this._notifyChange(a);}this._adjustInstDate(a);if(a.input){a.input.val(e?"":this._formatDate(a));}},_getDate:function(a){return !a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),e=this._get(a,"showButtonPanel"),f=this._get(a,"hideIfNoPrevNext"),h=this._get(a,"navigationAsDateFormat"),i=this._getNumberOfMonths(a),g=this._get(a,"showCurrentAtPos"),j=this._get(a,"stepMonths"),l=i[0]!=1||i[1]!=1,u=this._daylightSavingAdjust(!a.currentDay?new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),k=this._getMinMaxDate(a,"min"),o=this._getMinMaxDate(a,"max");g=a.drawMonth-g;var m=a.drawYear;if(g<0){g+=12;m--;}if(o){var n=this._daylightSavingAdjust(new Date(o.getFullYear(),o.getMonth()-i[0]*i[1]+1,o.getDate()));for(n=k&&n<k?k:n;this._daylightSavingAdjust(new Date(m,g,1))>n;){g--;if(g<0){g=11;m--;}}}a.drawMonth=g;a.drawYear=m;n=this._get(a,"prevText");n=!h?n:this.formatDate(n,this._daylightSavingAdjust(new Date(m,g-j,1)),this._getFormatConfig(a));n=this._canAdjustMonth(a,-1,m,g)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+B+".datepicker._adjustDate('#"+a.id+"', -"+j+", 'M');\" title=\""+n+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+n+"</span></a>":f?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+n+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+n+"</span></a>";var s=this._get(a,"nextText");s=!h?s:this.formatDate(s,this._daylightSavingAdjust(new Date(m,g+j,1)),this._getFormatConfig(a));f=this._canAdjustMonth(a,+1,m,g)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+B+".datepicker._adjustDate('#"+a.id+"', +"+j+", 'M');\" title=\""+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>":f?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>";j=this._get(a,"currentText");s=this._get(a,"gotoCurrent")&&a.currentDay?u:b;j=!h?j:this.formatDate(j,s,this._getFormatConfig(a));h=!a.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+B+'.datepicker._hideDatepicker();">'+this._get(a,"closeText")+"</button>":"";e=e?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(c?h:"")+(this._isInRange(a,s)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+B+".datepicker._gotoToday('#"+a.id+"');\">"+j+"</button>":"")+(c?"":h)+"</div>":"";h=parseInt(this._get(a,"firstDay"),10);h=isNaN(h)?0:h;j=this._get(a,"showWeek");s=this._get(a,"dayNames");this._get(a,"dayNamesShort");var q=this._get(a,"dayNamesMin"),A=this._get(a,"monthNames"),v=this._get(a,"monthNamesShort"),p=this._get(a,"beforeShowDay"),D=this._get(a,"showOtherMonths"),K=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var E=this._getDefaultDate(a),w="",x=0;x<i[0];x++){var O="";this.maxRows=4;for(var G=0;G<i[1];G++){var P=this._daylightSavingAdjust(new Date(m,g,a.selectedDay)),t=" ui-corner-all",y="";if(l){y+='<div class="ui-datepicker-group';if(i[1]>1){switch(G){case 0:y+=" ui-datepicker-group-first";t=" ui-corner-"+(c?"right":"left");break;case i[1]-1:y+=" ui-datepicker-group-last";t=" ui-corner-"+(c?"left":"right");break;default:y+=" ui-datepicker-group-middle";t="";break;}}y+='">';}y+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+t+'">'+(/all|left/.test(t)&&x==0?c?f:n:"")+(/all|right/.test(t)&&x==0?c?n:f:"")+this._generateMonthYearHeader(a,g,m,k,o,x>0||G>0,A,v)+'</div><table class="ui-datepicker-calendar"><thead><tr>';var z=j?'<th class="ui-datepicker-week-col">'+this._get(a,"weekHeader")+"</th>":"";for(t=0;t<7;t++){var r=(t+h)%7;z+="<th"+((t+h+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+s[r]+'">'+q[r]+"</span></th>";}y+=z+"</tr></thead><tbody>";z=this._getDaysInMonth(m,g);if(m==a.selectedYear&&g==a.selectedMonth){a.selectedDay=Math.min(a.selectedDay,z);}t=(this._getFirstDayOfMonth(m,g)-h+7)%7;z=Math.ceil((t+z)/7);this.maxRows=z=l?this.maxRows>z?this.maxRows:z:z;r=this._daylightSavingAdjust(new Date(m,g,1-t));for(var Q=0;Q<z;Q++){y+="<tr>";var R=!j?"":'<td class="ui-datepicker-week-col">'+this._get(a,"calculateWeek")(r)+"</td>";for(t=0;t<7;t++){var I=p?p.apply(a.input?a.input[0]:null,[r]):[true,""],F=r.getMonth()!=g,L=F&&!K||!I[0]||k&&r<k||o&&r>o;R+='<td class="'+((t+h+6)%7>=5?" ui-datepicker-week-end":"")+(F?" ui-datepicker-other-month":"")+(r.getTime()==P.getTime()&&g==a.selectedMonth&&a._keyEvent||E.getTime()==r.getTime()&&E.getTime()==P.getTime()?" "+this._dayOverClass:"")+(L?" "+this._unselectableClass+" ui-state-disabled":"")+(F&&!D?"":" "+I[1]+(r.getTime()==u.getTime()?" "+this._currentClass:"")+(r.getTime()==b.getTime()?" ui-datepicker-today":""))+'"'+((!F||D)&&I[2]?' title="'+I[2]+'"':"")+(L?"":' onclick="DP_jQuery_'+B+".datepicker._selectDay('#"+a.id+"',"+r.getMonth()+","+r.getFullYear()+', this);return false;"')+">"+(F&&!D?"&#xa0;":L?'<span class="ui-state-default">'+r.getDate()+"</span>":'<a class="ui-state-default'+(r.getTime()==b.getTime()?" ui-state-highlight":"")+(r.getTime()==u.getTime()?" ui-state-active":"")+(F?" ui-priority-secondary":"")+'" href="#">'+r.getDate()+"</a>")+"</td>";r.setDate(r.getDate()+1);r=this._daylightSavingAdjust(r);}y+=R+"</tr>";}g++;if(g>11){g=0;m++;}y+="</tbody></table>"+(l?"</div>"+(i[0]>0&&G==i[1]-1?'<div class="ui-datepicker-row-break"></div>':""):"");O+=y;}w+=O;}w+=e+(d.browser.msie&&parseInt(d.browser.version,10)<7&&!a.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':"");a._keyEvent=false;return w;},_generateMonthYearHeader:function(a,b,c,e,f,h,i,g){var j=this._get(a,"changeMonth"),l=this._get(a,"changeYear"),u=this._get(a,"showMonthAfterYear"),k='<div class="ui-datepicker-title">',o="";if(h||!j){o+='<span class="ui-datepicker-month">'+i[b]+"</span>";}else{i=e&&e.getFullYear()==c;var m=f&&f.getFullYear()==c;o+='<select class="ui-datepicker-month" onchange="DP_jQuery_'+B+".datepicker._selectMonthYear('#"+a.id+"', this, 'M');\" >";for(var n=0;n<12;n++){if((!i||n>=e.getMonth())&&(!m||n<=f.getMonth())){o+='<option value="'+n+'"'+(n==b?' selected="selected"':"")+">"+g[n]+"</option>";}}o+="</select>";}u||(k+=o+(h||!(j&&l)?"&#xa0;":""));if(!a.yearshtml){a.yearshtml="";if(h||!l){k+='<span class="ui-datepicker-year">'+c+"</span>";}else{g=this._get(a,"yearRange").split(":");var s=(new Date).getFullYear();i=function(q){q=q.match(/c[+-].*/)?c+parseInt(q.substring(1),10):q.match(/[+-].*/)?s+parseInt(q,10):parseInt(q,10);return isNaN(q)?s:q;};b=i(g[0]);g=Math.max(b,i(g[1]||""));b=e?Math.max(b,e.getFullYear()):b;g=f?Math.min(g,f.getFullYear()):g;for(a.yearshtml+='<select class="ui-datepicker-year" onchange="DP_jQuery_'+B+".datepicker._selectMonthYear('#"+a.id+"', this, 'Y');\" >";b<=g;b++){a.yearshtml+='<option value="'+b+'"'+(b==c?' selected="selected"':"")+">"+b+"</option>";}a.yearshtml+="</select>";k+=a.yearshtml;a.yearshtml=null;}}k+=this._get(a,"yearSuffix");if(u){k+=(h||!(j&&l)?"&#xa0;":"")+o;}k+="</div>";return k;},_adjustInstDate:function(a,b,c){var e=a.drawYear+(c=="Y"?b:0),f=a.drawMonth+(c=="M"?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(c=="D"?b:0);e=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,b)));a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();if(c=="M"||c=="Y"){this._notifyChange(a);}},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&b<c?c:b;return b=a&&b>a?a:b;},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");if(b){b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a]);}},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a;},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null);},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate();},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay();},_canAdjustMonth:function(a,b,c,e){var f=this._getNumberOfMonths(a);c=this._daylightSavingAdjust(new Date(c,e+(b<0?b:f[0]*f[1]),1));b<0&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c);},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime());},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")};},_formatDate:function(a,b,c,e){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear;}b=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(e,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a));}});d.fn.datepicker=function(a){if(!this.length){return this;}if(!d.datepicker.initialized){d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv);d.datepicker.initialized=true;}var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget")){return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));}if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string"){return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));}return this.each(function(){typeof a=="string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a);});};d.datepicker=new M;d.datepicker.initialized=false;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.8.16";window["DP_jQuery_"+B]=d;})(jQuery);(function(c,e){c.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()});this.valueDiv=c("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element);this.oldValue=this._value();this._refreshValue();},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow");this.valueDiv.remove();c.Widget.prototype.destroy.apply(this,arguments);},value:function(d){if(d===e){return this._value();}this._setOption("value",d);return this;},_setOption:function(d,f){if(d==="value"){this.options.value=f;this._refreshValue();this._value()===this.options.max&&this._trigger("complete");}c.Widget.prototype._setOption.apply(this,arguments);},_value:function(){var d=this.options.value;if(typeof d!=="number"){d=0;}return Math.min(this.options.max,Math.max(this.min,d));},_percentage:function(){return 100*this._value()/this.options.max;},_refreshValue:function(){var d=this.value(),f=this._percentage();if(this.oldValue!==d){this.oldValue=d;this._trigger("change");}this.valueDiv.toggle(d>this.min).toggleClass("ui-corner-right",d===this.options.max).width(f.toFixed(0)+"%");this.element.attr("aria-valuenow",d);}});c.extend(c.ui.progressbar,{version:"1.8.16"});})(jQuery);jQuery.effects||function(A,y){function r(k){var f;if(k&&k.constructor==Array&&k.length==3){return k;}if(f=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(k)){return[parseInt(f[1],10),parseInt(f[2],10),parseInt(f[3],10)];}if(f=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(k)){return[parseFloat(f[1])*2.55,parseFloat(f[2])*2.55,parseFloat(f[3])*2.55];}if(f=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(k)){return[parseInt(f[1],16),parseInt(f[2],16),parseInt(f[3],16)];}if(f=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(k)){return[parseInt(f[1]+f[1],16),parseInt(f[2]+f[2],16),parseInt(f[3]+f[3],16)];}if(/rgba\(0, 0, 0, 0\)/.exec(k)){return g.transparent;}return g[A.trim(k).toLowerCase()];}function D(l,k){var f;do{f=A.curCSS(l,k);if(f!=""&&f!="transparent"||A.nodeName(l,"body")){break;}k="backgroundColor";}while(l=l.parentNode);return r(f);}function e(){var o=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,k={},f,m;if(o&&o.length&&o[0]&&o[o[0]]){for(var l=o.length;l--;){f=o[l];if(typeof o[f]=="string"){m=f.replace(/\-(\w)/g,function(s,q){return q.toUpperCase();});k[m]=o[f];}}}else{for(f in o){if(typeof o[f]==="string"){k[f]=o[f];}}}return k;}function d(l){var k,f;for(k in l){f=l[k];if(f==null||A.isFunction(f)||k in C||/scrollbar/.test(k)||!/color/i.test(k)&&isNaN(parseFloat(f))){delete l[k];}}return l;}function B(m,k){var f={_:0},l;for(l in k){if(m[l]!=k[l]){f[l]=k[l];}}return f;}function w(m,k,f,l){if(typeof m=="object"){l=k;f=null;k=m;m=k.effect;}if(A.isFunction(k)){l=k;f=null;k={};}if(typeof k=="number"||A.fx.speeds[k]){l=f;f=k;k={};}if(A.isFunction(f)){l=f;f=null;}k=k||{};f=f||k.duration;f=A.fx.off?0:typeof f=="number"?f:f in A.fx.speeds?A.fx.speeds[f]:A.fx.speeds._default;l=l||k.complete;return[m,k,f,l];}function v(f){if(!f||typeof f==="number"||A.fx.speeds[f]){return true;}if(typeof f==="string"&&!A.effects[f]){return true;}return false;}A.effects={};A.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","borderColor","color","outlineColor"],function(k,f){A.fx.step[f]=function(l){if(!l.colorInit){l.start=D(l.elem,f);l.end=r(l.end);l.colorInit=true;}l.elem.style[f]="rgb("+Math.max(Math.min(parseInt(l.pos*(l.end[0]-l.start[0])+l.start[0],10),255),0)+","+Math.max(Math.min(parseInt(l.pos*(l.end[1]-l.start[1])+l.start[1],10),255),0)+","+Math.max(Math.min(parseInt(l.pos*(l.end[2]-l.start[2])+l.start[2],10),255),0)+")";};});var g={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},c=["add","remove","toggle"],C={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};A.effects.animateClass=function(m,k,f,l){if(A.isFunction(f)){l=f;f=null;}return this.queue(function(){var E=A(this),u=E.attr("style")||" ",q=d(e.call(this)),s,o=E.attr("class");A.each(c,function(F,G){m[G]&&E[G+"Class"](m[G]);});s=d(e.call(this));E.attr("class",o);E.animate(B(q,s),{queue:false,duration:k,easing:f,complete:function(){A.each(c,function(F,G){m[G]&&E[G+"Class"](m[G]);});if(typeof E.attr("style")=="object"){E.attr("style").cssText="";E.attr("style").cssText=u;}else{E.attr("style",u);}l&&l.apply(this,arguments);A.dequeue(this);}});});};A.fn.extend({_addClass:A.fn.addClass,addClass:function(m,k,f,l){return k?A.effects.animateClass.apply(this,[{add:m},k,f,l]):this._addClass(m);},_removeClass:A.fn.removeClass,removeClass:function(m,k,f,l){return k?A.effects.animateClass.apply(this,[{remove:m},k,f,l]):this._removeClass(m);},_toggleClass:A.fn.toggleClass,toggleClass:function(o,k,f,m,l){return typeof k=="boolean"||k===y?f?A.effects.animateClass.apply(this,[k?{add:o}:{remove:o},f,m,l]):this._toggleClass(o,k):A.effects.animateClass.apply(this,[{toggle:o},k,f,m]);},switchClass:function(o,k,f,m,l){return A.effects.animateClass.apply(this,[{add:k,remove:o},f,m,l]);}});A.extend(A.effects,{version:"1.8.16",save:function(l,k){for(var f=0;f<k.length;f++){k[f]!==null&&l.data("ec.storage."+k[f],l[0].style[k[f]]);}},restore:function(l,k){for(var f=0;f<k.length;f++){k[f]!==null&&l.css(k[f],l.data("ec.storage."+k[f]));}},setMode:function(k,f){if(f=="toggle"){f=k.is(":hidden")?"show":"hide";}return f;},getBaseline:function(l,k){var f;switch(l[0]){case"top":f=0;break;case"middle":f=0.5;break;case"bottom":f=1;break;default:f=l[0]/k.height;}switch(l[1]){case"left":l=0;break;case"center":l=0.5;break;case"right":l=1;break;default:l=l[1]/k.width;}return{x:l,y:f};},createWrapper:function(m){if(m.parent().is(".ui-effects-wrapper")){return m.parent();}var k={width:m.outerWidth(true),height:m.outerHeight(true),"float":m.css("float")},f=A("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),l=document.activeElement;m.wrap(f);if(m[0]===l||A.contains(m[0],l)){A(l).focus();}f=m.parent();if(m.css("position")=="static"){f.css({position:"relative"});m.css({position:"relative"});}else{A.extend(k,{position:m.css("position"),zIndex:m.css("z-index")});A.each(["top","left","bottom","right"],function(q,o){k[o]=m.css(o);if(isNaN(parseInt(k[o],10))){k[o]="auto";}});m.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"});}return f.css(k).show();},removeWrapper:function(l){var k,f=document.activeElement;if(l.parent().is(".ui-effects-wrapper")){k=l.parent().replaceWith(l);if(l[0]===f||A.contains(l[0],f)){A(f).focus();}return k;}return l;},setTransition:function(m,k,f,l){l=l||{};A.each(k,function(q,o){unit=m.cssUnit(o);if(unit[0]>0){l[o]=unit[0]*f+unit[1];}});return l;}});A.fn.extend({effect:function(m){var k=w.apply(this,arguments),f={options:k[1],duration:k[2],callback:k[3]};k=f.options.mode;var l=A.effects[m];if(A.fx.off||!l){return k?this[k](f.duration,f.callback):this.each(function(){f.callback&&f.callback.call(this);});}return l.call(this,f);},_show:A.fn.show,show:function(k){if(v(k)){return this._show.apply(this,arguments);}else{var f=w.apply(this,arguments);f[1].mode="show";return this.effect.apply(this,f);}},_hide:A.fn.hide,hide:function(k){if(v(k)){return this._hide.apply(this,arguments);}else{var f=w.apply(this,arguments);f[1].mode="hide";return this.effect.apply(this,f);}},__toggle:A.fn.toggle,toggle:function(k){if(v(k)||typeof k==="boolean"||A.isFunction(k)){return this.__toggle.apply(this,arguments);}else{var f=w.apply(this,arguments);f[1].mode="toggle";return this.effect.apply(this,f);}},cssUnit:function(l){var k=this.css(l),f=[];A.each(["em","px","%","pt"],function(o,m){if(k.indexOf(m)>0){f=[parseFloat(k),m];}});return f;}});A.easing.jswing=A.easing.swing;A.extend(A.easing,{def:"easeOutQuad",swing:function(o,k,f,m,l){return A.easing[A.easing.def](o,k,f,m,l);},easeInQuad:function(o,k,f,m,l){return m*(k/=l)*k+f;},easeOutQuad:function(o,k,f,m,l){return -m*(k/=l)*(k-2)+f;},easeInOutQuad:function(o,k,f,m,l){if((k/=l/2)<1){return m/2*k*k+f;}return -m/2*(--k*(k-2)-1)+f;},easeInCubic:function(o,k,f,m,l){return m*(k/=l)*k*k+f;},easeOutCubic:function(o,k,f,m,l){return m*((k=k/l-1)*k*k+1)+f;},easeInOutCubic:function(o,k,f,m,l){if((k/=l/2)<1){return m/2*k*k*k+f;}return m/2*((k-=2)*k*k+2)+f;},easeInQuart:function(o,k,f,m,l){return m*(k/=l)*k*k*k+f;},easeOutQuart:function(o,k,f,m,l){return -m*((k=k/l-1)*k*k*k-1)+f;},easeInOutQuart:function(o,k,f,m,l){if((k/=l/2)<1){return m/2*k*k*k*k+f;}return -m/2*((k-=2)*k*k*k-2)+f;},easeInQuint:function(o,k,f,m,l){return m*(k/=l)*k*k*k*k+f;},easeOutQuint:function(o,k,f,m,l){return m*((k=k/l-1)*k*k*k*k+1)+f;},easeInOutQuint:function(o,k,f,m,l){if((k/=l/2)<1){return m/2*k*k*k*k*k+f;}return m/2*((k-=2)*k*k*k*k+2)+f;},easeInSine:function(o,k,f,m,l){return -m*Math.cos(k/l*(Math.PI/2))+m+f;},easeOutSine:function(o,k,f,m,l){return m*Math.sin(k/l*(Math.PI/2))+f;},easeInOutSine:function(o,k,f,m,l){return -m/2*(Math.cos(Math.PI*k/l)-1)+f;},easeInExpo:function(o,k,f,m,l){return k==0?f:m*Math.pow(2,10*(k/l-1))+f;},easeOutExpo:function(o,k,f,m,l){return k==l?f+m:m*(-Math.pow(2,-10*k/l)+1)+f;},easeInOutExpo:function(o,k,f,m,l){if(k==0){return f;}if(k==l){return f+m;}if((k/=l/2)<1){return m/2*Math.pow(2,10*(k-1))+f;}return m/2*(-Math.pow(2,-10*--k)+2)+f;},easeInCirc:function(o,k,f,m,l){return -m*(Math.sqrt(1-(k/=l)*k)-1)+f;},easeOutCirc:function(o,k,f,m,l){return m*Math.sqrt(1-(k=k/l-1)*k)+f;},easeInOutCirc:function(o,k,f,m,l){if((k/=l/2)<1){return -m/2*(Math.sqrt(1-k*k)-1)+f;}return m/2*(Math.sqrt(1-(k-=2)*k)+1)+f;},easeInElastic:function(s,k,f,q,o){s=1.70158;var m=0,l=q;if(k==0){return f;}if((k/=o)==1){return f+q;}m||(m=o*0.3);if(l<Math.abs(q)){l=q;s=m/4;}else{s=m/(2*Math.PI)*Math.asin(q/l);}return -(l*Math.pow(2,10*(k-=1))*Math.sin((k*o-s)*2*Math.PI/m))+f;},easeOutElastic:function(s,k,f,q,o){s=1.70158;var m=0,l=q;if(k==0){return f;}if((k/=o)==1){return f+q;}m||(m=o*0.3);if(l<Math.abs(q)){l=q;s=m/4;}else{s=m/(2*Math.PI)*Math.asin(q/l);}return l*Math.pow(2,-10*k)*Math.sin((k*o-s)*2*Math.PI/m)+q+f;},easeInOutElastic:function(s,k,f,q,o){s=1.70158;var m=0,l=q;if(k==0){return f;}if((k/=o/2)==2){return f+q;}m||(m=o*0.3*1.5);if(l<Math.abs(q)){l=q;s=m/4;}else{s=m/(2*Math.PI)*Math.asin(q/l);}if(k<1){return -0.5*l*Math.pow(2,10*(k-=1))*Math.sin((k*o-s)*2*Math.PI/m)+f;}return l*Math.pow(2,-10*(k-=1))*Math.sin((k*o-s)*2*Math.PI/m)*0.5+q+f;},easeInBack:function(q,k,f,o,m,l){if(l==y){l=1.70158;}return o*(k/=m)*k*((l+1)*k-l)+f;},easeOutBack:function(q,k,f,o,m,l){if(l==y){l=1.70158;}return o*((k=k/m-1)*k*((l+1)*k+l)+1)+f;},easeInOutBack:function(q,k,f,o,m,l){if(l==y){l=1.70158;}if((k/=m/2)<1){return o/2*k*k*(((l*=1.525)+1)*k-l)+f;}return o/2*((k-=2)*k*(((l*=1.525)+1)*k+l)+2)+f;},easeInBounce:function(o,k,f,m,l){return m-A.easing.easeOutBounce(o,l-k,0,m,l)+f;},easeOutBounce:function(o,k,f,m,l){return(k/=l)<1/2.75?m*7.5625*k*k+f:k<2/2.75?m*(7.5625*(k-=1.5/2.75)*k+0.75)+f:k<2.5/2.75?m*(7.5625*(k-=2.25/2.75)*k+0.9375)+f:m*(7.5625*(k-=2.625/2.75)*k+0.984375)+f;},easeInOutBounce:function(o,k,f,m,l){if(k<l/2){return A.easing.easeInBounce(o,k*2,0,m,l)*0.5+f;}return A.easing.easeOutBounce(o,k*2-l,0,m,l)*0.5+m*0.5+f;}});}(jQuery);(function(c){c.effects.blind=function(d){return this.queue(function(){var k=c(this),o=["position","top","bottom","left","right"],q=c.effects.setMode(k,d.options.mode||"hide"),s=d.options.direction||"vertical";c.effects.save(k,o);k.show();var r=c.effects.createWrapper(k).css({overflow:"hidden"}),m=s=="vertical"?"height":"width";s=s=="vertical"?r.height():r.width();q=="show"&&r.css(m,0);var l={};l[m]=q=="show"?s:0;r.animate(l,d.duration,d.options.easing,function(){q=="hide"&&k.hide();c.effects.restore(k,o);c.effects.removeWrapper(k);d.callback&&d.callback.apply(k[0],arguments);k.dequeue();});});};})(jQuery);(function(c){c.effects.bounce=function(d){return this.queue(function(){var B=c(this),o=["position","top","bottom","left","right"],u=c.effects.setMode(B,d.options.mode||"effect"),y=d.options.direction||"up",A=d.options.distance||20,e=d.options.times||5,s=d.duration||250;/show|hide/.test(u)&&o.push("opacity");c.effects.save(B,o);B.show();c.effects.createWrapper(B);var w=y=="up"||y=="down"?"top":"left";y=y=="up"||y=="left"?"pos":"neg";A=d.options.distance||(w=="top"?B.outerHeight({margin:true})/3:B.outerWidth({margin:true})/3);if(u=="show"){B.css("opacity",0).css(w,y=="pos"?-A:A);}if(u=="hide"){A/=e*2;}u!="hide"&&e--;if(u=="show"){var v={opacity:1};v[w]=(y=="pos"?"+=":"-=")+A;B.animate(v,s/2,d.options.easing);A/=2;e--;}for(v=0;v<e;v++){var r={},q={};r[w]=(y=="pos"?"-=":"+=")+A;q[w]=(y=="pos"?"+=":"-=")+A;B.animate(r,s/2,d.options.easing).animate(q,s/2,d.options.easing);A=u=="hide"?A*2:A/2;}if(u=="hide"){v={opacity:0};v[w]=(y=="pos"?"-=":"+=")+A;B.animate(v,s/2,d.options.easing,function(){B.hide();c.effects.restore(B,o);c.effects.removeWrapper(B);d.callback&&d.callback.apply(this,arguments);});}else{r={};q={};r[w]=(y=="pos"?"-=":"+=")+A;q[w]=(y=="pos"?"+=":"-=")+A;B.animate(r,s/2,d.options.easing).animate(q,s/2,d.options.easing,function(){c.effects.restore(B,o);c.effects.removeWrapper(B);d.callback&&d.callback.apply(this,arguments);});}B.queue("fx",function(){B.dequeue();});B.dequeue();});};})(jQuery);(function(c){c.effects.clip=function(d){return this.queue(function(){var e=c(this),k=["position","top","bottom","left","right","height","width"],o=c.effects.setMode(e,d.options.mode||"hide"),r=d.options.direction||"vertical";c.effects.save(e,k);e.show();var q=c.effects.createWrapper(e).css({overflow:"hidden"});q=e[0].tagName=="IMG"?q:e;var m={size:r=="vertical"?"height":"width",position:r=="vertical"?"top":"left"};r=r=="vertical"?q.height():q.width();if(o=="show"){q.css(m.size,0);q.css(m.position,r/2);}var l={};l[m.size]=o=="show"?r:0;l[m.position]=o=="show"?0:r/2;q.animate(l,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){o=="hide"&&e.hide();c.effects.restore(e,k);c.effects.removeWrapper(e);d.callback&&d.callback.apply(e[0],arguments);e.dequeue();}});});};})(jQuery);(function(d){d.effects.drop=function(c){return this.queue(function(){var l=d(this),o=["position","top","bottom","left","right","opacity"],s=d.effects.setMode(l,c.options.mode||"hide"),k=c.options.direction||"left";d.effects.save(l,o);l.show();d.effects.createWrapper(l);var r=k=="up"||k=="down"?"top":"left";k=k=="up"||k=="left"?"pos":"neg";var q=c.options.distance||(r=="top"?l.outerHeight({margin:true})/2:l.outerWidth({margin:true})/2);if(s=="show"){l.css("opacity",0).css(r,k=="pos"?-q:q);}var m={opacity:s=="show"?1:0};m[r]=(s=="show"?k=="pos"?"+=":"-=":k=="pos"?"-=":"+=")+q;l.animate(m,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){s=="hide"&&l.hide();d.effects.restore(l,o);d.effects.removeWrapper(l);c.callback&&c.callback.apply(this,arguments);l.dequeue();}});});};})(jQuery);(function(c){c.effects.explode=function(d){return this.queue(function(){var u=d.options.pieces?Math.round(Math.sqrt(d.options.pieces)):3,s=d.options.pieces?Math.round(Math.sqrt(d.options.pieces)):3;d.options.mode=d.options.mode=="toggle"?c(this).is(":visible")?"hide":"show":d.options.mode;var k=c(this).show().css("visibility","hidden"),o=k.offset();o.top-=parseInt(k.css("marginTop"),10)||0;o.left-=parseInt(k.css("marginLeft"),10)||0;for(var m=k.outerWidth(true),l=k.outerHeight(true),r=0;r<u;r++){for(var q=0;q<s;q++){k.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-q*(m/s),top:-r*(l/u)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:m/s,height:l/u,left:o.left+q*(m/s)+(d.options.mode=="show"?(q-Math.floor(s/2))*(m/s):0),top:o.top+r*(l/u)+(d.options.mode=="show"?(r-Math.floor(u/2))*(l/u):0),opacity:d.options.mode=="show"?0:1}).animate({left:o.left+q*(m/s)+(d.options.mode=="show"?0:(q-Math.floor(s/2))*(m/s)),top:o.top+r*(l/u)+(d.options.mode=="show"?0:(r-Math.floor(u/2))*(l/u)),opacity:d.options.mode=="show"?1:0},d.duration||500);}}setTimeout(function(){d.options.mode=="show"?k.css({visibility:"visible"}):k.css({visibility:"visible"}).hide();d.callback&&d.callback.apply(k[0]);k.dequeue();c("div.ui-effects-explode").remove();},d.duration||500);});};})(jQuery);(function(c){c.effects.fade=function(d){return this.queue(function(){var f=c(this),e=c.effects.setMode(f,d.options.mode||"hide");f.animate({opacity:e},{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){d.callback&&d.callback.apply(this,arguments);f.dequeue();}});});};})(jQuery);(function(d){d.effects.fold=function(c){return this.queue(function(){var A=d(this),q=["position","top","bottom","left","right"],y=d.effects.setMode(A,c.options.mode||"hide"),u=c.options.size||15,s=!!c.options.horizFirst,o=c.duration?c.duration/2:d.fx.speeds._default/2;d.effects.save(A,q);A.show();var w=d.effects.createWrapper(A).css({overflow:"hidden"}),v=y=="show"!=s,m=v?["width","height"]:["height","width"];v=v?[w.width(),w.height()]:[w.height(),w.width()];var r=/([0-9]+)%/.exec(u);if(r){u=parseInt(r[1],10)/100*v[y=="hide"?0:1];}if(y=="show"){w.css(s?{height:0,width:u}:{height:u,width:0});}s={};r={};s[m[0]]=y=="show"?v[0]:u;r[m[1]]=y=="show"?v[1]:0;w.animate(s,o,c.options.easing).animate(r,o,c.options.easing,function(){y=="hide"&&A.hide();d.effects.restore(A,q);d.effects.removeWrapper(A);c.callback&&c.callback.apply(A[0],arguments);A.dequeue();});});};})(jQuery);(function(c){c.effects.highlight=function(d){return this.queue(function(){var g=c(this),l=["backgroundImage","backgroundColor","opacity"],m=c.effects.setMode(g,d.options.mode||"show"),k={backgroundColor:g.css("backgroundColor")};if(m=="hide"){k.opacity=0;}c.effects.save(g,l);g.show().css({backgroundImage:"none",backgroundColor:d.options.color||"#ffff99"}).animate(k,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){m=="hide"&&g.hide();c.effects.restore(g,l);m=="show"&&!c.support.opacity&&this.style.removeAttribute("filter");d.callback&&d.callback.apply(this,arguments);g.dequeue();}});});};})(jQuery);(function(c){c.effects.pulsate=function(d){return this.queue(function(){var e=c(this),f=c.effects.setMode(e,d.options.mode||"show");times=(d.options.times||5)*2-1;duration=d.duration?d.duration/2:c.fx.speeds._default/2;isVisible=e.is(":visible");animateTo=0;if(!isVisible){e.css("opacity",0).show();animateTo=1;}if(f=="hide"&&isVisible||f=="show"&&!isVisible){times--;}for(f=0;f<times;f++){e.animate({opacity:animateTo},duration,d.options.easing);animateTo=(animateTo+1)%2;}e.animate({opacity:animateTo},duration,d.options.easing,function(){animateTo==0&&e.hide();d.callback&&d.callback.apply(this,arguments);});e.queue("fx",function(){e.dequeue();}).dequeue();});};})(jQuery);(function(d){d.effects.puff=function(c){return this.queue(function(){var f=d(this),o=d.effects.setMode(f,c.options.mode||"hide"),m=parseInt(c.options.percent,10)||150,l=m/100,k={height:f.height(),width:f.width()};d.extend(c.options,{fade:true,mode:o,percent:o=="hide"?m:100,from:o=="hide"?k:{height:k.height*l,width:k.width*l}});f.effect("scale",c.options,c.duration,c.callback);f.dequeue();});};d.effects.scale=function(c){return this.queue(function(){var k=d(this),r=d.extend(true,{},c.options),o=d.effects.setMode(k,c.options.mode||"effect"),m=parseInt(c.options.percent,10)||(parseInt(c.options.percent,10)==0?0:o=="hide"?0:100),l=c.options.direction||"both",q=c.options.origin;if(o!="effect"){r.origin=q||["middle","center"];r.restore=true;}q={height:k.height(),width:k.width()};k.from=c.options.from||(o=="show"?{height:0,width:0}:q);m={y:l!="horizontal"?m/100:1,x:l!="vertical"?m/100:1};k.to={height:q.height*m.y,width:q.width*m.x};if(c.options.fade){if(o=="show"){k.from.opacity=0;k.to.opacity=1;}if(o=="hide"){k.from.opacity=1;k.to.opacity=0;}}r.from=k.from;r.to=k.to;r.mode=o;k.effect("size",r,c.duration,c.callback);k.dequeue();});};d.effects.size=function(c){return this.queue(function(){var E=d(this),C=["position","top","bottom","left","right","width","height","overflow","opacity"],A=["position","top","bottom","left","right","overflow","opacity"],y=["width","height","overflow"],w=["fontSize"],B=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],u=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],o=d.effects.setMode(E,c.options.mode||"effect"),q=c.options.restore||false,r=c.options.scale||"both",s=c.options.origin,v={height:E.height(),width:E.width()};E.from=c.options.from||v;E.to=c.options.to||v;if(s){s=d.effects.getBaseline(s,v);E.from.top=(v.height-E.from.height)*s.y;E.from.left=(v.width-E.from.width)*s.x;E.to.top=(v.height-E.to.height)*s.y;E.to.left=(v.width-E.to.width)*s.x;}var D={from:{y:E.from.height/v.height,x:E.from.width/v.width},to:{y:E.to.height/v.height,x:E.to.width/v.width}};if(r=="box"||r=="both"){if(D.from.y!=D.to.y){C=C.concat(B);E.from=d.effects.setTransition(E,B,D.from.y,E.from);E.to=d.effects.setTransition(E,B,D.to.y,E.to);}if(D.from.x!=D.to.x){C=C.concat(u);E.from=d.effects.setTransition(E,u,D.from.x,E.from);E.to=d.effects.setTransition(E,u,D.to.x,E.to);}}if(r=="content"||r=="both"){if(D.from.y!=D.to.y){C=C.concat(w);E.from=d.effects.setTransition(E,w,D.from.y,E.from);E.to=d.effects.setTransition(E,w,D.to.y,E.to);}}d.effects.save(E,q?C:A);E.show();d.effects.createWrapper(E);E.css("overflow","hidden").css(E.from);if(r=="content"||r=="both"){B=B.concat(["marginTop","marginBottom"]).concat(w);u=u.concat(["marginLeft","marginRight"]);y=C.concat(B).concat(u);E.find("*[width]").each(function(){child=d(this);q&&d.effects.save(child,y);var e={height:child.height(),width:child.width()};child.from={height:e.height*D.from.y,width:e.width*D.from.x};child.to={height:e.height*D.to.y,width:e.width*D.to.x};if(D.from.y!=D.to.y){child.from=d.effects.setTransition(child,B,D.from.y,child.from);child.to=d.effects.setTransition(child,B,D.to.y,child.to);}if(D.from.x!=D.to.x){child.from=d.effects.setTransition(child,u,D.from.x,child.from);child.to=d.effects.setTransition(child,u,D.to.x,child.to);}child.css(child.from);child.animate(child.to,c.duration,c.options.easing,function(){q&&d.effects.restore(child,y);});});}E.animate(E.to,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){E.to.opacity===0&&E.css("opacity",E.from.opacity);o=="hide"&&E.hide();d.effects.restore(E,q?C:A);d.effects.removeWrapper(E);c.callback&&c.callback.apply(this,arguments);E.dequeue();}});});};})(jQuery);(function(c){c.effects.shake=function(d){return this.queue(function(){var A=c(this),q=["position","top","bottom","left","right"];c.effects.setMode(A,d.options.mode||"effect");var y=d.options.direction||"left",w=d.options.distance||20,m=d.options.times||3,v=d.duration||d.options.duration||140;c.effects.save(A,q);A.show();c.effects.createWrapper(A);var u=y=="up"||y=="down"?"top":"left",s=y=="up"||y=="left"?"pos":"neg";y={};var r={},o={};y[u]=(s=="pos"?"-=":"+=")+w;r[u]=(s=="pos"?"+=":"-=")+w*2;o[u]=(s=="pos"?"-=":"+=")+w*2;A.animate(y,v,d.options.easing);for(w=1;w<m;w++){A.animate(r,v,d.options.easing).animate(o,v,d.options.easing);}A.animate(r,v,d.options.easing).animate(y,v/2,d.options.easing,function(){c.effects.restore(A,q);c.effects.removeWrapper(A);d.callback&&d.callback.apply(this,arguments);});A.queue("fx",function(){A.dequeue();});A.dequeue();});};})(jQuery);(function(d){d.effects.slide=function(c){return this.queue(function(){var l=d(this),o=["position","top","bottom","left","right"],r=d.effects.setMode(l,c.options.mode||"show"),k=c.options.direction||"left";d.effects.save(l,o);l.show();d.effects.createWrapper(l).css({overflow:"hidden"});var q=k=="up"||k=="down"?"top":"left";k=k=="up"||k=="left"?"pos":"neg";var s=c.options.distance||(q=="top"?l.outerHeight({margin:true}):l.outerWidth({margin:true}));if(r=="show"){l.css(q,k=="pos"?isNaN(s)?"-"+s:-s:s);}var m={};m[q]=(r=="show"?k=="pos"?"+=":"-=":k=="pos"?"-=":"+=")+s;l.animate(m,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){r=="hide"&&l.hide();d.effects.restore(l,o);d.effects.removeWrapper(l);c.callback&&c.callback.apply(this,arguments);l.dequeue();}});});};})(jQuery);(function(c){c.effects.transfer=function(d){return this.queue(function(){var e=c(this),l=c(d.options.to),k=l.offset();l={top:k.top,left:k.left,height:l.innerHeight(),width:l.innerWidth()};k=e.offset();var g=c('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(d.options.className).css({top:k.top,left:k.left,height:e.innerHeight(),width:e.innerWidth(),position:"absolute"}).animate(l,d.duration,d.options.easing,function(){g.remove();d.callback&&d.callback.apply(e[0],arguments);e.dequeue();});});};})(jQuery);(function(c){var d=function(e){var k=null;var g=c("#"+e);var f=c("input[name="+e+"]");if(g!=undefined){k=g;}else{if(f!=undefined){k=f;}}return k;};c.fn.autotab_magic=function(e){for(var f=0;f<this.length;f++){var k=f+1;var g=f-1;if(f>0&&k<this.length){c(this[f]).autotab({target:c(this[k]),previous:c(this[g])});}else{if(f>0){c(this[f]).autotab({previous:c(this[g])});}else{c(this[f]).autotab({target:c(this[k])});}}if(e!=null&&(isNaN(e)&&e==c(this[f]).attr("id"))||(!isNaN(e)&&e==f)){c(this[f]).focus();}}};c.fn.autotab_filter=function(e){var g={format:"all",uppercase:false,lowercase:false,nospace:false,pattern:null};if(typeof e=="string"||typeof e=="function"){g.format=e;}else{c.extend(g,e);}for(var f=0;f<this.length;f++){c(this[f]).bind("keyup",function(l){var m=this.value;switch(g.format){case"text":var k=new RegExp("[0-9]+","g");m=m.replace(k,"");break;case"alpha":var k=new RegExp("[^a-zA-Z]+","g");m=m.replace(k,"");break;case"number":case"numeric":var k=new RegExp("[^0-9]+","g");m=m.replace(k,"");break;case"alphanumeric":var k=new RegExp("[^0-9a-zA-Z]+","g");m=m.replace(k,"");break;case"custom":var k=new RegExp(g.pattern,"g");var m=m.replace(k,"");break;case"all":default:if(typeof g.format=="function"){var m=g.format(m);}break;}if(g.nospace){var k=new RegExp("[ ]+","g");m=m.replace(k,"");}if(g.uppercase){m=m.toUpperCase();}if(g.lowercase){m=m.toLowerCase();}if(m!=this.value){this.value=m;}});}};c.fn.autotab=function(e){var g={format:"all",maxlength:2147483647,uppercase:false,lowercase:false,nospace:false,target:null,previous:null,pattern:null};c.extend(g,e);if(typeof g.target=="string"){g.target=d(g.target);}if(typeof g.previous=="string"){g.previous=d(g.previous);}var f=c(this).attr("maxlength");if(g.maxlength==2147483647&&f!=2147483647){g.maxlength=f;}else{if(g.maxlength>0){c(this).attr("maxlength",g.maxlength);}else{g.target=null;}}if(g.format!="all"){c(this).autotab_filter(g);}return c(this).bind("keydown",function(k){if(k.which==8&&this.value.length==0&&g.previous){g.previous.focus().val(g.previous.val());}}).bind("keyup",function(l){var k=[8,9,16,17,18,19,20,27,33,34,35,36,37,38,39,40,45,46,144,145];if(l.which!=8){var m=c(this).val();if(c.inArray(l.which,k)==-1&&m.length==g.maxlength&&g.target){g.target.focus();}}});};})(jQuery);(function(d){d.fn.ajaxSubmit=function(w){if(!this.length){c("ajaxSubmit: skipping submit process - no element selected");return this;}if(typeof w=="function"){w={success:w};}w=d.extend({url:this.attr("action")||window.location.toString(),type:this.attr("method")||"GET"},w||{});var A={};this.trigger("form-pre-serialize",[this,w,A]);if(A.veto){c("ajaxSubmit: submit vetoed via form-pre-serialize trigger");return this;}if(w.beforeSerialize&&w.beforeSerialize(this,w)===false){c("ajaxSubmit: submit aborted via beforeSerialize callback");return this;}var r=this.formToArray(w.semantic);if(w.data){w.extraData=w.data;for(var g in w.data){if(w.data[g] instanceof Array){for(var l in w.data[g]){r.push({name:g,value:w.data[g][l]});}}else{r.push({name:g,value:w.data[g]});}}}if(w.beforeSubmit&&w.beforeSubmit(r,this,w)===false){c("ajaxSubmit: submit aborted via beforeSubmit callback");return this;}this.trigger("form-submit-validate",[r,this,w,A]);if(A.veto){c("ajaxSubmit: submit vetoed via form-submit-validate trigger");return this;}var f=d.param(r);if(w.type.toUpperCase()=="GET"){w.url+=(w.url.indexOf("?")>=0?"&":"?")+f;w.data=null;}else{w.data=f;}var y=this,o=[];if(w.resetForm){o.push(function(){y.resetForm();});}if(w.clearForm){o.push(function(){y.clearForm();});}if(!w.dataType&&w.target){var u=w.success||function(){};o.push(function(k){d(w.target).html(k).each(u,arguments);});}else{if(w.success){o.push(w.success);}}w.success=function(C,q){for(var B=0,k=o.length;B<k;B++){o[B].apply(w,[C,q,y]);}};var e=d("input:file",this).fieldValue();var v=false;for(var m=0;m<e.length;m++){if(e[m]){v=true;}}if(w.iframe||v){if(d.browser.safari&&w.closeKeepAlive){d.get(w.closeKeepAlive,s);}else{s();}}else{d.ajax(w);}this.trigger("form-submit-notify",[this,w]);return this;function s(){var D=y[0];if(d(":input[name=submit]",D).length){alert('Error: Form elements must not be named "submit".');return;}var B=d.extend({},d.ajaxSettings,w);var N=jQuery.extend(true,{},d.extend(true,{},d.ajaxSettings),B);var C="jqFormIO"+(new Date().getTime());var J=d('<iframe id="'+C+'" name="'+C+'" />');var L=J[0];if(d.browser.msie||d.browser.opera){L.src='javascript:false;document.write("");';}J.css({position:"absolute",top:"-1000px",left:"-1000px"});var M={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(){this.aborted=1;J.attr("src","about:blank");}};var K=B.global;if(K&&!d.active++){d.event.trigger("ajaxStart");}if(K){d.event.trigger("ajaxSend",[M,B]);}if(N.beforeSend&&N.beforeSend(M,N)===false){N.global&&jQuery.active--;return;}if(M.aborted){return;}var q=0;var F=0;var k=D.clk;if(k){var E=k.name;if(E&&!k.disabled){w.extraData=w.extraData||{};w.extraData[E]=k.value;if(k.type=="image"){w.extraData[name+".x"]=D.clk_x;w.extraData[name+".y"]=D.clk_y;}}}setTimeout(function(){var Q=y.attr("target"),O=y.attr("action");D.setAttribute("target",C);if(D.getAttribute("method")!="POST"){D.setAttribute("method","POST");}if(D.getAttribute("action")!=B.url){D.setAttribute("action",B.url);}if(!w.skipEncodingOverride){y.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"});}if(B.timeout){setTimeout(function(){F=true;G();},B.timeout);}var P=[];try{if(w.extraData){for(var R in w.extraData){P.push(d('<input type="hidden" name="'+R+'" value="'+w.extraData[R]+'" />').appendTo(D)[0]);}}J.appendTo("body");L.attachEvent?L.attachEvent("onload",G):L.addEventListener("load",G,false);D.submit();}finally{D.setAttribute("action",O);Q?D.setAttribute("target",Q):y.removeAttr("target");d(P).remove();}},10);var H=0;function G(){if(q++){return;}L.detachEvent?L.detachEvent("onload",G):L.removeEventListener("load",G,false);var P=true;try{if(F){throw"timeout";}var Q,S;S=L.contentWindow?L.contentWindow.document:L.contentDocument?L.contentDocument:L.document;if(S.body==null&&!H&&d.browser.opera){H=1;q--;setTimeout(G,100);return;}M.responseText=S.body?S.body.innerHTML:null;M.responseXML=S.XMLDocument?S.XMLDocument:S;M.getResponseHeader=function(U){var T={"content-type":B.dataType};return T[U];};if(B.dataType=="json"||B.dataType=="script"){var O=S.getElementsByTagName("textarea")[0];M.responseText=O?O.value:M.responseText;}else{if(B.dataType=="xml"&&!M.responseXML&&M.responseText!=null){M.responseXML=I(M.responseText);}}Q=d.httpData(M,B.dataType);}catch(R){P=false;d.handleError(B,M,"error",R);}if(P){B.success(Q,"success");if(K){d.event.trigger("ajaxSuccess",[M,B]);}}if(K){d.event.trigger("ajaxComplete",[M,B]);}if(K&&!--d.active){d.event.trigger("ajaxStop");}if(B.complete){B.complete(M,P?"success":"error");}setTimeout(function(){J.remove();M.responseXML=null;},100);}function I(O,P){if(window.ActiveXObject){P=new ActiveXObject("Microsoft.XMLDOM");P.async="false";P.loadXML(O);}else{P=(new DOMParser()).parseFromString(O,"text/xml");}return(P&&P.documentElement&&P.documentElement.tagName!="parsererror")?P:null;}}};d.fn.ajaxForm=function(e){return this.ajaxFormUnbind().bind("submit.form-plugin",function(){d(this).ajaxSubmit(e);return false;}).each(function(){d(":submit,input:image",this).bind("click.form-plugin",function(g){var f=this.form;f.clk=this;if(this.type=="image"){if(g.offsetX!=undefined){f.clk_x=g.offsetX;f.clk_y=g.offsetY;}else{if(typeof d.fn.offset=="function"){var k=d(this).offset();f.clk_x=g.pageX-k.left;f.clk_y=g.pageY-k.top;}else{f.clk_x=g.pageX-this.offsetLeft;f.clk_y=g.pageY-this.offsetTop;}}}setTimeout(function(){f.clk=f.clk_x=f.clk_y=null;},10);});});};d.fn.ajaxFormUnbind=function(){this.unbind("submit.form-plugin");return this.each(function(){d(":submit,input:image",this).unbind("click.form-plugin");});};d.fn.formToArray=function(w){var u=[];if(this.length==0){return u;}var f=this[0];var m=w?f.getElementsByTagName("*"):f.elements;if(!m){return u;}for(var o=0,r=m.length;o<r;o++){var g=m[o];var k=g.name;if(!k){continue;}if(w&&f.clk&&g.type=="image"){if(!g.disabled&&f.clk==g){u.push({name:k+".x",value:f.clk_x},{name:k+".y",value:f.clk_y});}continue;}var y=d.fieldValue(g,true);if(y&&y.constructor==Array){for(var l=0,e=y.length;l<e;l++){u.push({name:k,value:y[l]});}}else{if(y!==null&&typeof y!="undefined"){u.push({name:k,value:y});}}}if(!w&&f.clk){var q=f.getElementsByTagName("input");for(var o=0,r=q.length;o<r;o++){var s=q[o];var k=s.name;if(k&&!s.disabled&&s.type=="image"&&f.clk==s){u.push({name:k+".x",value:f.clk_x},{name:k+".y",value:f.clk_y});}}}return u;};d.fn.formSerialize=function(e){return d.param(this.formToArray(e));};d.fn.fieldSerialize=function(f){var e=[];this.each(function(){var m=this.name;if(!m){return;}var k=d.fieldValue(this,f);if(k&&k.constructor==Array){for(var l=0,g=k.length;l<g;l++){e.push({name:m,value:k[l]});}}else{if(k!==null&&typeof k!="undefined"){e.push({name:this.name,value:k});}}});return d.param(e);};d.fn.fieldValue=function(m){for(var l=[],g=0,e=this.length;g<e;g++){var k=this[g];var f=d.fieldValue(k,m);if(f===null||typeof f=="undefined"||(f.constructor==Array&&!f.length)){continue;}f.constructor==Array?d.merge(l,f):l.push(f);}return l;};d.fieldValue=function(e,o){var g=e.name,w=e.type,y=e.tagName.toLowerCase();if(typeof o=="undefined"){o=true;}if(o&&(!g||e.disabled||w=="reset"||w=="button"||(w=="checkbox"||w=="radio")&&!e.checked||(w=="submit"||w=="image")&&e.form&&e.form.clk!=e||y=="select"&&e.selectedIndex==-1)){return null;}if(y=="select"){var q=e.selectedIndex;if(q<0){return null;}var s=[],f=e.options;var l=(w=="select-one");var r=(l?q+1:f.length);for(var k=(l?q:0);k<r;k++){var m=f[k];if(m.selected){var u=(d.browser.msie&&m.attributes&&m.attributes.value&&!(m.attributes.value.specified))?m.text:m.value;if(l){return u;}s.push(u);}}return s;}return e.value;};d.fn.clearForm=function(){return this.each(function(){d("input,select,textarea",this).clearFields();});};d.fn.clearFields=d.fn.clearInputs=function(){return this.each(function(){var f=this.type,e=this.tagName.toLowerCase();if(f=="text"||f=="password"||e=="textarea"){this.value="";}else{if(f=="checkbox"||f=="radio"){this.checked=false;}else{if(e=="select"){this.selectedIndex=-1;}}}});};d.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset();}});};d.fn.enable=function(e){if(e==undefined){e=true;}return this.each(function(){this.disabled=!e;});};d.fn.selected=function(e){if(e==undefined){e=true;}return this.each(function(){var f=this.type;if(f=="checkbox"||f=="radio"){this.checked=e;}else{if(this.tagName.toLowerCase()=="option"){var g=d(this).parent("select");if(e&&g[0]&&g[0].type=="select-one"){g.find("option").selected(false);}this.selected=e;}}});};function c(){if(d.fn.ajaxSubmit.debug&&window.console&&window.console.log){window.console.log("[jquery.form] "+Array.prototype.join.call(arguments,""));}}})(jQuery);jQuery.cookie=function(d,q,u){if(typeof q!="undefined"){u=u||{};if(q===null){q="";u.expires=-1;}var k="";if(u.expires&&(typeof u.expires=="number"||u.expires.toUTCString)){var l;if(typeof u.expires=="number"){l=new Date();l.setTime(l.getTime()+(u.expires*24*60*60*1000));}else{l=u.expires;}k="; expires="+l.toUTCString();}var s="; path=/";var m=u.domain?"; domain="+(u.domain):"";var c=u.secure?"; secure":"";var g;if(typeof u.noEncoding=="boolean"){g=q;}else{g=encodeURIComponent(q);}document.cookie=[d,"=",g,k,s,m,c].join("");}else{var f=null;if(document.cookie&&document.cookie!=""){var r=document.cookie.split(";");for(var o=0;o<r.length;o++){var e=jQuery.trim(r[o]);if(e.substring(0,d.length+1)==(d+"=")){f=decodeURIComponent(e.substring(d.length+1));break;}}}return f;}};(function(c){c.fn.bgIframe=c.fn.bgiframe=function(e){if(c.browser.msie&&/6.0/.test(navigator.userAgent)){e=c.extend({top:"auto",left:"auto",width:"auto",height:"auto",opacity:true,src:"javascript:false;"},e||{});var f=function(g){return g&&g.constructor==Number?g+"px":g;},d='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+e.src+'"style="display:block;position:absolute;z-index:-1;'+(e.opacity!==false?"filter:Alpha(Opacity='0');":"")+"top:"+(e.top=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+'px')":f(e.top))+";left:"+(e.left=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+'px')":f(e.left))+";width:"+(e.width=="auto"?"expression(this.parentNode.offsetWidth+'px')":f(e.width))+";height:"+(e.height=="auto"?"expression(this.parentNode.offsetHeight+'px')":f(e.height))+';"/>';return this.each(function(){if(c("> iframe.bgiframe",this).length==0){this.insertBefore(document.createElement(d),this.firstChild);}});}return this;};})(jQuery);if($.browser.msie&&/9.0/.test(navigator.userAgent)){$.fn.bgIframe=$.fn.bgiframe=function(d){d=$.extend({top:"auto",left:"auto",width:"auto",height:"auto",opacity:true,src:"javascript:false;"},d||{});var e=function(f){return f&&f.constructor==Number?f+"px":f;},c=document.createElement("iframe");c.setAttribute("class","bgiframe");c.setAttribute("frameborder","0");c.setAttribute("tabindex","-1");c.setAttribute("src",d.src);c.setAttribute("style","display:block;position:absolute;z-index:-1;"+(d.opacity!==false?"filter:Alpha(Opacity='0');":"")+"top:"+(d.top=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+'px')":e(d.top))+";left:"+(d.left=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+'px')":e(d.left))+";width:"+(d.width=="auto"?"expression(this.parentNode.offsetWidth+'px')":e(d.width))+";height:"+(d.height=="auto"?"expression(this.parentNode.offsetHeight+'px')":e(d.height))+";");return this.each(function(){if($("> iframe.bgiframe",this).length==0){this.insertBefore(c,this.firstChild);}});};
/* Copyright (c) 2006 Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 */
}(function(c){c.fn.outerHTML=function(){return c("<div>").append(this.eq(0).clone()).html();};})(jQuery);(function(g){var d={},r,u,w,q=g.browser.msie&&/MSIE\s(5\.5|6\.)/.test(navigator.userAgent),c=false;g.tooltip={blocked:false,defaults:{delay:200,fade:false,showURL:true,extraClass:"",top:15,left:15,id:"tooltip"},block:function(){g.tooltip.blocked=!g.tooltip.blocked;}};g.fn.extend({tooltip:function(y){y=g.extend({},g.tooltip.defaults,y);m(y);return this.each(function(){g.data(this,"tooltip",y);this.tOpacity=d.parent.css("opacity");this.tooltipText=this.title;g(this).removeAttr("title");this.alt="";}).mouseover(s).mouseout(k).click(k);},fixPNG:q?function(){return this.each(function(){var y=g(this).css("backgroundImage");if(y.match(/^url\(["']?(.*\.png)["']?\)$/i)){y=RegExp.$1;g(this).css({backgroundImage:"none",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='"+y+"')"}).each(function(){var A=g(this).css("position");if(A!="absolute"&&A!="relative"){g(this).css("position","relative");}});}});}:function(){return this;},unfixPNG:q?function(){return this.each(function(){g(this).css({filter:"",backgroundImage:""});});}:function(){return this;},hideWhenEmpty:function(){return this.each(function(){g(this)[g(this).html()?"show":"hide"]();});},url:function(){return this.attr("href")||this.attr("src");}});function m(y){if(d.parent){return;}d.parent=g('<div id="'+y.id+'"><h3></h3><div class="body"></div><div class="url"></div></div>').appendTo(document.body).hide();if(g.fn.bgiframe){d.parent.bgiframe();}d.title=g("h3",d.parent);d.body=g("div.body",d.parent);d.url=g("div.url",d.parent);}function e(y){return g.data(y,"tooltip");}function l(y){if(e(this).delay){w=setTimeout(v,e(this).delay);}else{v();}c=!!e(this).track;g(document.body).bind("mousemove",f);f(y);}function s(){if(g.tooltip.blocked||this==r||(!this.tooltipText&&!e(this).bodyHandler)){return;}r=this;u=this.tooltipText;if(e(this).bodyHandler){d.title.hide();var C=e(this).bodyHandler.call(this);if(C.nodeType||C.jquery){d.body.empty().append(C);}else{d.body.html(C);}d.body.show();}else{if(e(this).showBody){var B=u.split(e(this).showBody);d.title.html(B.shift()).show();d.body.empty();for(var A=0,y;(y=B[A]);A++){if(A>0){d.body.append("<br/>");}d.body.append(y);}d.body.hideWhenEmpty();}else{d.title.html(u).show();d.body.hide();}}if(e(this).showURL&&g(this).url()){d.url.html(g(this).url().replace("http://","")).show();}else{d.url.hide();}d.parent.addClass(e(this).extraClass);if(e(this).fixPNG){d.parent.fixPNG();}l.apply(this,arguments);}function v(){w=null;if((!q||!g.fn.bgiframe)&&e(r).fade){if(d.parent.is(":animated")){d.parent.stop().show().fadeTo(e(r).fade,r.tOpacity);}else{d.parent.is(":visible")?d.parent.fadeTo(e(r).fade,r.tOpacity):d.parent.fadeIn(e(r).fade);}}else{d.parent.show();}f();}function f(C){if(g.tooltip.blocked){return;}if(C&&C.target.tagName=="OPTION"){return;}if(!c&&d.parent.is(":visible")){g(document.body).unbind("mousemove",f);}if(r==null){g(document.body).unbind("mousemove",f);return;}d.parent.removeClass("viewport-right").removeClass("viewport-bottom");var E=d.parent[0].offsetLeft;var D=d.parent[0].offsetTop;if(C){E=C.pageX+e(r).left;D=C.pageY+e(r).top;var A="auto";if(e(r).positionLeft){A=g(window).width()-E;E="auto";}d.parent.css({left:E,right:A,top:D});}var y=o(),B=d.parent[0];if(y.x+y.cx<B.offsetLeft+B.offsetWidth){E-=B.offsetWidth+20+e(r).left;d.parent.css({left:E+"px"}).addClass("viewport-right");}if(y.y+y.cy<B.offsetTop+B.offsetHeight){D-=B.offsetHeight+20+e(r).top;d.parent.css({top:D+"px"}).addClass("viewport-bottom");}}function o(){return{x:g(window).scrollLeft(),y:g(window).scrollTop(),cx:g(window).width(),cy:g(window).height()};}function k(B){if(g.tooltip.blocked){return;}if(w){clearTimeout(w);}r=null;var A=e(this);function y(){d.parent.removeClass(A.extraClass).hide().css("opacity","");}if((!q||!g.fn.bgiframe)&&A.fade){if(d.parent.is(":animated")){d.parent.stop().fadeTo(A.fade,0,y);}else{d.parent.stop().fadeOut(A.fade,y);}}else{y();}if(e(this).fixPNG){d.parent.unfixPNG();}}})(jQuery);jQuery.fn.extend({everyTime:function(d,e,f,g,c){return this.each(function(){jQuery.timer.add(this,d,e,f,g,c);});},oneTime:function(c,d,e){return this.each(function(){jQuery.timer.add(this,c,d,e,1);});},stopTime:function(c,d){return this.each(function(){jQuery.timer.remove(this,c,d);});}});jQuery.extend({timer:{guid:1,global:{},regex:/^([0-9]+)\s*(.*s)?$/,powers:{ms:1,cs:10,ds:100,s:1000,das:10000,hs:100000,ks:1000000},timeParse:function(e){if(e==undefined||e==null){return null;}var c=this.regex.exec(jQuery.trim(e.toString()));if(c[2]){var d=parseInt(c[1],10);var f=this.powers[c[2]]||1;return d*f;}else{return e;}},add:function(g,e,f,l,m,d){var c=0;if(jQuery.isFunction(f)){if(!m){m=l;}l=f;f=e;}e=jQuery.timer.timeParse(e);if(typeof e!="number"||isNaN(e)||e<=0){return;}if(m&&m.constructor!=Number){d=!!m;m=0;}m=m||0;d=d||false;if(!g.$timers){g.$timers={};}if(!g.$timers[f]){g.$timers[f]={};}l.$timerID=l.$timerID||this.guid++;var k=function(){if(d&&this.inProgress){return;}this.inProgress=true;if((++c>m&&m!==0)||l.call(g,c)===false){jQuery.timer.remove(g,f,l);}this.inProgress=false;};k.$timerID=l.$timerID;if(!g.$timers[f][l.$timerID]){g.$timers[f][l.$timerID]=window.setInterval(k,e);}if(!this.global[f]){this.global[f]=[];}this.global[f].push(g);},remove:function(e,d,f){var g=e.$timers,c;if(g){if(!d){for(d in g){this.remove(e,d,f);}}else{if(g[d]){if(f){if(f.$timerID){window.clearInterval(g[d][f.$timerID]);delete g[d][f.$timerID];}}else{for(var f in g[d]){window.clearInterval(g[d][f]);delete g[d][f];}}for(c in g[d]){break;}if(!c){c=null;delete g[d];}}}for(c in g){break;}if(!c){e.$timers=null;}}}}});if(jQuery.browser.msie){jQuery(window).one("unload",function(){var f=jQuery.timer.global;for(var c in f){var e=f[c],d=e.length;while(--d){jQuery.timer.remove(e[d],c);}}});}(function(g){g.tools=g.tools||{};g.tools.tabs={version:"1.0.4",conf:{tabs:"a",current:"current",onBeforeClick:null,onClick:null,effect:"default",initialIndex:0,event:"click",api:false,rotate:false},addEffect:function(d,c){k[d]=c;}};var k={"default":function(c,d){this.getPanes().hide().eq(c).show();d.call();},fade:function(l,o){var m=this.getConf(),c=m.fadeOutSpeed,d=this.getPanes();if(c){d.fadeOut(c);}else{d.hide();}d.eq(l).fadeIn(m.fadeInSpeed,o);},slide:function(c,d){this.getPanes().slideUp(200);this.getPanes().eq(c).slideDown(400,d);},ajax:function(c,d){this.getPanes().eq(0).load(this.getTabs().eq(c).attr("href"),d);}};var e;g.tools.tabs.addEffect("horizontal",function(c,d){if(!e){e=this.getPanes().eq(0).width();}this.getCurrentPane().animate({width:0},function(){g(this).hide();});this.getPanes().eq(c).animate({width:e},function(){g(this).show();d.call();});});function f(m,l,o){var q=this,c=g(this),d;g.each(o,function(s,r){if(g.isFunction(r)){c.bind(s,r);}});g.extend(this,{click:function(u,w){var v=q.getCurrentPane();var s=m.eq(u);if(typeof u=="string"&&u.replace("#","")){s=m.filter("[href*="+u.replace("#","")+"]");u=Math.max(m.index(s),0);}if(o.rotate){var r=m.length-1;if(u<0){return q.click(r,w);}if(u>r){return q.click(0,w);}}if(!s.length){if(d>=0){return q;}u=o.initialIndex;s=m.eq(u);}if(u===d){return q;}w=w||g.Event();w.type="onBeforeClick";c.trigger(w,[u]);if(w.isDefaultPrevented()){return;}k[o.effect].call(q,u,function(){w.type="onClick";c.trigger(w,[u]);});w.type="onStart";c.trigger(w,[u]);if(w.isDefaultPrevented()){return;}d=u;m.removeClass(o.current);s.addClass(o.current);return q;},getConf:function(){return o;},getTabs:function(){return m;},getPanes:function(){return l;},getCurrentPane:function(){return l.eq(d);},getCurrentTab:function(){return m.eq(d);},getIndex:function(){return d;},next:function(){return q.click(d+1);},prev:function(){return q.click(d-1);},bind:function(s,r){c.bind(s,r);return q;},onBeforeClick:function(r){return this.bind("onBeforeClick",r);},onClick:function(r){return this.bind("onClick",r);},unbind:function(r){c.unbind(r);return q;}});m.each(function(r){g(this).bind(o.event,function(s){q.click(r,s);return false;});});if(location.hash){q.click(location.hash);}else{if(o.initialIndex===0||o.initialIndex>0){q.click(o.initialIndex);}}l.find("a[href^=#]").click(function(r){q.click(g(this).attr("href"),r);});}g.fn.tabs=function(c,m){var l=this.eq(typeof m=="number"?m:0).data("tabs");if(l){return l;}if(g.isFunction(m)){m={onBeforeClick:m};}var d=g.extend({},g.tools.tabs.conf),o=this.length;m=g.extend(d,m);this.each(function(r){var u=g(this);var s=u.find(m.tabs);if(!s.length){s=u.children();}var q=c.jquery?c:u.children(c);if(!q.length){q=o==1?g(c):u.parent().find(c);}l=new f(s,q,m);u.data("tabs",l);});return m.api?l:this;};})(jQuery);function SB_Tabs(d,e){var c=e;var k=jQuery(d);var l=k.find("a");var g=0;var f=function(q){var o=l.eq(g);var m=c.children().eq(g);o.removeClass("tabSelected");o.parent().removeClass("tabSelected");m.hide();o=l.eq(q);m=c.children().eq(q);o.addClass("tabSelected");o.parent().addClass("tabSelected");m.show();g=q;};l.click(function(){f(l.index(this));});f(g);}jQuery.fn.sbet_tabs=function(d){var c=jQuery(d);if(this.length==c.length){this.each(function(e){new SB_Tabs(this,c.eq(e));});}else{alert("");}};
/*
* jQuery doTimeout: Like setTimeout, but better! - v0.4 - 7/15/2009
* http://benalman.com/projects/jquery-dotimeout-plugin/
* 
* Copyright (c) 2009 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
(function($){var c={},e="doTimeout",f=Array.prototype.slice;$[e]=function(){return d.apply(window,[0].concat(f.call(arguments)));};$.fn[e]=function(){var k=f.call(arguments),g=d.apply(this,[e+k[0]].concat(k));return typeof k[0]==="number"||typeof k[1]==="number"?this:g;};function d(r){var s=this,l,o={},u=arguments,m=4,k=u[1],q=u[2],w=u[3];if(typeof k!=="string"){m--;k=r=0;q=u[1];w=u[2];}if(r){l=s.eq(0);l.data(r,o=l.data(r)||{});}else{if(k){o=c[k]||(c[k]={});}}o.id&&clearTimeout(o.id);delete o.id;function g(){if(r){l.removeData(r);}else{if(k){delete c[k];}}}function v(){o.id=setTimeout(function(){o.fn();},q);}if(w){o.fn=function(y){w.apply(s,f.call(u,m))&&!y?v():g();};v();}else{if(o.fn){q===undefined?g():o.fn(q===false);return true;}else{g();}}}})(jQuery);(function(e){var c=(e.browser.msie?"paste":"input")+".mask";var d=(window.orientation!=undefined);e.mask={definitions:{"9":"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},dataName:"rawMaskFn"};e.fn.extend({caret:function(k,f){if(this.length==0){return;}if(typeof k=="number"){f=(typeof f=="number")?f:k;return this.each(function(){if(this.setSelectionRange){this.setSelectionRange(k,f);}else{if(this.createTextRange){var l=this.createTextRange();l.collapse(true);l.moveEnd("character",f);l.moveStart("character",k);l.select();}}});}else{if(this[0].setSelectionRange){k=this[0].selectionStart;f=this[0].selectionEnd;}else{if(document.selection&&document.selection.createRange){var g=document.selection.createRange();k=0-g.duplicate().moveStart("character",-100000);f=k+g.text.length;}}return{begin:k,end:f};}},unmask:function(){return this.trigger("unmask");},mask:function(k,q){if(!k&&this.length>0){var l=e(this[0]);return l.data(e.mask.dataName)();}q=e.extend({placeholder:"_",completed:null},q);var g=e.mask.definitions;var o=[];var r=k.length;var m=null;var f=k.length;e.each(k.split(""),function(s,u){if(u=="?"){f--;r=s;}else{if(g[u]){o.push(new RegExp(g[u]));if(m==null){m=o.length-1;}}else{o.push(null);}}});return this.trigger("unmask").each(function(){var E=e(this);var y=e.map(k.split(""),function(I,H){if(I!="?"){return g[I]?q.placeholder:I;}});var G=E.val();function D(H){while(++H<=f&&!o[H]){}return H;}function A(H){while(--H>=0&&!o[H]){}return H;}function w(K,H){if(K<0){return;}for(var J=K,I=D(H);J<f;J++){if(o[J]){if(I<f&&o[J].test(y[I])){y[J]=y[I];y[I]=q.placeholder;}else{break;}I=D(I);}}C();E.caret(Math.max(m,K));}function s(L){for(var J=L,K=q.placeholder;J<f;J++){if(o[J]){var H=D(J);var I=y[J];y[J]=K;if(H<f&&o[H].test(I)){K=I;}else{break;}}}}function B(K){var I=K.which;if(I==8||I==46||(d&&I==127)){var L=E.caret(),J=L.begin,H=L.end;if(H-J==0){J=I!=46?A(J):(H=D(J-1));H=I==46?D(H):H;}u(J,H);w(J,H-1);return false;}else{if(I==27){E.val(G);E.caret(0,v());return false;}}}function F(K){var H=K.which,M=E.caret();if(K.ctrlKey||K.altKey||K.metaKey||H<32){return true;}else{if(H){if(M.end-M.begin!=0){u(M.begin,M.end);w(M.begin,M.end-1);}var J=D(M.begin-1);if(J<f){var L=String.fromCharCode(H);if(o[J].test(L)){s(J);y[J]=L;C();var I=D(J);E.caret(I);if(q.completed&&I>=f){q.completed.call(E);}}}return false;}}}function u(J,H){for(var I=J;I<H&&I<f;I++){if(o[I]){y[I]=q.placeholder;}}}function C(){return E.val(y.join("")).val();}function v(I){var M=E.val();var L=-1;for(var H=0,K=0;H<f;H++){if(o[H]){y[H]=q.placeholder;while(K++<M.length){var J=M.charAt(K-1);if(o[H].test(J)){y[H]=J;L=H;break;}}if(K>M.length){break;}}else{if(y[H]==M.charAt(K)&&H!=r){K++;L=H;}}}if(!I&&L+1<r){E.val("");u(0,f);}else{if(I||L+1>=r){C();if(!I){E.val(E.val().substring(0,L+1));}}}return(r?H:m);}E.data(e.mask.dataName,function(){return e.map(y,function(I,H){return o[H]&&I!=q.placeholder?I:null;}).join("");});if(!E.attr("readonly")){E.one("unmask",function(){E.unbind(".mask").removeData(e.mask.dataName);}).bind("focus.mask",function(){G=E.val();var I=v();C();var H=function(){if(I==k.length){E.caret(0,I);}else{E.caret(I);}};(e.browser.msie?H:function(){setTimeout(H,0);})();}).bind("blur.mask",function(){v();if(E.val()!=G){E.change();}}).bind("keydown.mask",B).bind("keypress.mask",F).bind(c,function(){setTimeout(function(){E.caret(v(true));},0);});}v();});}});})(jQuery);(function(c){var d=[];c.fn.editableSelect=function(g){var l={bg_iframe:false,onSelect:false,items_then_scroll:10,case_sensitive:false,numeric:false,optionalParent:null,optionalClass:false,useRelativeOffset:false,autoComplete:false};var k=c.extend(l,g);if(k.bg_iframe&&!c.browser.msie){k.bg_iframe=false;}var f=false;c(this).each(function(){var m=d.length;if(typeof c(this).data("editable-selecter")=="undefined"){d[m]=new e(this,k);c(this).data("editable-selecter",m);}});return c(this);};c.fn.editableSelectInstances=function(){var f=[];c(this).each(function(){if(typeof c(this).data("editable-selecter")!="undefined"){f[f.length]=d[c(this).data("editable-selecter")];}else{if(typeof c(this).data("editableSelecter")!="undefined"){f[f.length]=d[c(this).data("editableSelecter")];}}});return f;};c.fn.clearEditableSelectInstances=function(){d=[];};var e=function(f,g){this.init(f,g);};e.prototype={settings:false,text:false,select:false,wrapper:false,list_item_height:20,list_height:0,list_is_visible:false,hide_on_blur_timeout:false,bg_iframe:false,current_value:"",init:function(f,g){this.settings=g;this.select=c(f);this.text=c('<input type="text">');this.text.attr("name",this.select.attr("name"));this.text.data("editable-selecter",this.select.data("editable-selecter"));this.select.attr("disabled","disabled");var k=this.select.attr("id");if(!k){k="editable-select"+d.length;}this.text.attr("id",k);this.text.attr("autocomplete","off");this.text.addClass("editable-select");this.select.attr("id",k+"_hidden_select");this.initInputEvents(this.text);this.duplicateOptions();this.positionElements();this.setWidths();if(this.settings.numeric){this.text.numeric();}if(this.settings.bg_iframe){this.createBackgroundIframe();}},duplicateOptions:function(){var k=this;var l=c(document.createElement("div"));l.addClass("editable-select-options");if(k.settings.optionalClass){l.addClass(k.settings.optionalClass);}var f=c(document.createElement("ul"));l.append(f);var g=this.select.find("option");g.each(function(){if(c(this).attr("selected")){k.text.val(c(this).val());k.current_value=c(this).val();}var m=c("<li>"+c(this).val()+"</li>");k.initListItemEvents(m);f.append(m);});this.wrapper=l;this.checkScroll();},checkScroll:function(){var f=this.wrapper.find("li");if(f.length>this.settings.items_then_scroll){this.list_height=this.list_item_height*this.settings.items_then_scroll;this.wrapper.css("height",this.list_height+"px");this.wrapper.css("overflow","auto");}else{this.wrapper.css("height","auto");this.wrapper.css("overflow","visible");}},addOption:function(k){var f=c("<li>"+k+"</li>");var g=c("<option>"+k+"</option>");this.select.append(g);this.initListItemEvents(f);this.wrapper.find("ul").append(f);this.setWidths();this.checkScroll();},initInputEvents:function(g){var f=this;var k=false;c(document.body).click(function(){f.clearSelectedListItem();f.hideList();});g.focus(function(){f.showList();f.highlightSelected();}).click(function(l){l.stopPropagation();f.showList();f.highlightSelected();}).change(function(){f.pickListItem(f.selectedListItem());return false;}).keydown(function(l){switch(l.keyCode){case 40:if(!f.listIsVisible()){f.showList();f.highlightSelected();}else{l.preventDefault();f.selectNewListItem("down");}break;case 38:l.preventDefault();f.selectNewListItem("up");break;case 9:break;case 27:l.preventDefault();f.clearSelectedListItem();f.hideList();return false;break;case 13:l.preventDefault();f.pickListItem(f.selectedListItem());return false;}f.clearSelectedListItem();}).keyup(function(l){if(k!==false){clearTimeout(k);k=false;}k=setTimeout(function(){if(f.settings.autoComplete&&(f.text.val()!=f.current_value)){f.current_value=f.text.val();f.highlightSelected();}},200);}).keypress(function(l){if(l.keyCode==13){l.preventDefault();return false;}});},initListItemEvents:function(f){var g=this;f.mouseover(function(){g.clearSelectedListItem();g.selectListItem(f);}).mousedown(function(k){k.stopPropagation();g.pickListItem(g.selectedListItem());});},selectNewListItem:function(k){var f=this.selectedListItem();if(!f.length){f=this.selectFirstListItem();}if(k=="down"){var g=f.next();}else{var g=f.prev();}if(g.length){this.selectListItem(g);this.scrollToListItem(g);this.unselectListItem(f);}},selectListItem:function(f){this.clearSelectedListItem();f.addClass("selected");},selectFirstListItem:function(){this.clearSelectedListItem();var f=this.wrapper.find("li:first");f.addClass("selected");return f;},unselectListItem:function(f){f.removeClass("selected");},selectedListItem:function(){return this.wrapper.find("li.selected");},clearSelectedListItem:function(){this.wrapper.find("li.selected").removeClass("selected");},pickListItem:function(f){if(f.length){this.text.val(f.text());this.current_value=this.text.val();}if(typeof this.settings.onSelect=="function"){this.settings.onSelect.call(this,f);}this.hideList();},listIsVisible:function(){return this.list_is_visible;},showList:function(){this.wrapper.show();this.hideOtherLists();this.list_is_visible=true;if(this.settings.bg_iframe){this.bg_iframe.show();}},highlightSelected:function(){var m=this;var k=this.text.val();if(k.length<0){if(highlight_first){this.selectFirstListItem();}return;}if(!m.settings.case_sensitive){k=k.toLowerCase();}var l=false;var g=false;var f=this.wrapper.find("li");f.each(function(){if(!g){var o=c(this).text();if(!m.settings.case_sensitive){o=o.toLowerCase();}if(o==k){g=true;m.clearSelectedListItem();m.selectListItem(c(this));m.scrollToListItem(c(this));return false;}else{if(o.indexOf(k)===0&&!l){l=c(this);}}}});if(l&&!g){m.clearSelectedListItem();m.selectListItem(l);m.scrollToListItem(l);}else{if(!l&&!g){}}},scrollToListItem:function(f){if(this.list_height){this.wrapper.scrollTop(f[0].offsetTop-(this.list_height/2));}},hideList:function(){this.wrapper.hide();this.list_is_visible=false;if(this.settings.bg_iframe){this.bg_iframe.hide();}},hideOtherLists:function(){var g=this.select.data(typeof this.select.data("editable-selecter")=="undefined"?"editableSelecter":"editable-selecter");for(var f=0;f<d.length;f++){if(f!=g){d[f].hideList();}}},positionElements:function(){this.select.css("visibility","hidden");this.select.show();var g=this.settings.useRelativeOffset?this.select.position():this.select.offset();g.top+=this.select[0].offsetHeight;this.select.after(this.text);this.select.css("visibility","visible");this.select.hide();this.wrapper.css({top:g.top+"px",left:g.left+"px"});var f=this.settings.optionalParent;if(f==null||f.length==0){f=c(document.body);}f.append(this.wrapper);this.wrapper.css("visibility","hidden");this.wrapper.show();this.list_item_height=this.wrapper.find("li")[0].offsetHeight;this.wrapper.css("visibility","visible");this.wrapper.hide();},setWidths:function(){var f=parseInt(this.select.css("width").replace(/px/,""),10)+2;if(isNaN(f)){f=this.select.width()+2;}var g=parseInt(this.text.css("padding-right").replace(/px/,""),10);this.text.width(f-g);this.wrapper.width(f);if(this.bg_iframe){this.bg_iframe.width(f+4);}},createBackgroundIframe:function(){var f=c('<iframe frameborder="0" class="editable-select-iframe" src="about:blank;"></iframe>');c(document.body).append(f);f.width(this.select.width()+2);f.height(this.wrapper.height());f.css({top:this.wrapper.css("top"),left:this.wrapper.css("left")});this.bg_iframe=f;}};})(jQuery);jQuery.fn.numeric=function(c,d){c=c||".";d=typeof d=="function"?d:function(){};this.keypress(function(k){var f=k.charCode?k.charCode:k.keyCode?k.keyCode:0;if(f==13&&this.nodeName.toLowerCase()=="input"){return true;}else{if(f==13){return false;}}var g=false;if((k.ctrlKey&&f==97)||(k.ctrlKey&&f==65)){return true;}if((k.ctrlKey&&f==120)||(k.ctrlKey&&f==88)){return true;}if((k.ctrlKey&&f==99)||(k.ctrlKey&&f==67)){return true;}if((k.ctrlKey&&f==122)||(k.ctrlKey&&f==90)){return true;}if((k.ctrlKey&&f==118)||(k.ctrlKey&&f==86)||(k.shiftKey&&f==45)){return true;}if(f<48||f>57){if(f==45&&this.value.length==0){return true;}if(f==c.charCodeAt(0)&&this.value.indexOf(c)!=-1){g=false;}if(f!=8&&f!=9&&f!=13&&f!=35&&f!=36&&f!=37&&f!=39&&f!=46){g=false;}else{if(typeof k.charCode!="undefined"){if(k.keyCode==k.which&&k.which!=0){g=true;}else{if(k.keyCode!=0&&k.charCode==0&&k.which==0){g=true;}}}}if(f==c.charCodeAt(0)&&this.value.indexOf(c)==-1){g=true;}}else{g=true;}return g;}).blur(function(){var f=jQuery(this).val();if(f!=""){var e=new RegExp("^\\d+$|\\d*"+c+"\\d+");if(!e.exec(f)){d.apply(this);}}});return this;};var XRegExp;if(XRegExp){throw Error("can't load XRegExp twice in the same frame");}(function(){XRegExp=function(G,B){var A=[],E=XRegExp.OUTSIDE_CLASS,H=0,y,C,F,D,I;if(XRegExp.isRegExp(G)){if(B!==undefined){throw TypeError("can't supply flags when constructing one RegExp from another");}return q(G);}if(l){throw Error("can't call the XRegExp constructor within token definition functions");}B=B||"";y={hasNamedCapture:false,captureNames:[],hasFlag:function(J){return B.indexOf(J)>-1;},setFlag:function(J){B+=J;}};while(H<G.length){C=w(G,H,E,y);if(C){A.push(C.output);H+=(C.match[0].length||1);}else{if(F=u.exec.call(o[E],G.slice(H))){A.push(F[0]);H+=F[0].length;}else{D=G.charAt(H);if(D==="["){E=XRegExp.INSIDE_CLASS;}else{if(D==="]"){E=XRegExp.OUTSIDE_CLASS;}}A.push(D);H++;}}}I=RegExp(A.join(""),u.replace.call(B,m,""));I._xregexp={source:G,captureNames:y.hasNamedCapture?y.captureNames:null};return I;};XRegExp.version="1.5.0";XRegExp.INSIDE_CLASS=1;XRegExp.OUTSIDE_CLASS=2;var e=/\$(?:(\d\d?|[$&`'])|{([$\w]+)})/g,m=/[^gimy]+|([\s\S])(?=[\s\S]*\1)/g,v=/^(?:[?*+]|{\d+(?:,\d*)?})\??/,l=false,r=[],u={exec:RegExp.prototype.exec,test:RegExp.prototype.test,match:String.prototype.match,replace:String.prototype.replace,split:String.prototype.split},c=u.exec.call(/()??/,"")[1]===undefined,g=function(){var y=/^/g;u.test.call(y,"");return !y.lastIndex;}(),k=function(){var y=/x/g;u.replace.call("x",y,"");return !y.lastIndex;}(),d=RegExp.prototype.sticky!==undefined,o={};o[XRegExp.INSIDE_CLASS]=/^(?:\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S]))/;o[XRegExp.OUTSIDE_CLASS]=/^(?:\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S])|\(\?[:=!]|[?*+]\?|{\d+(?:,\d*)?}\??)/;XRegExp.addToken=function(C,B,A,y){r.push({pattern:q(C,"g"+(d?"y":"")),handler:B,scope:A||XRegExp.OUTSIDE_CLASS,trigger:y||null});};XRegExp.cache=function(B,y){var A=B+"/"+(y||"");return XRegExp.cache[A]||(XRegExp.cache[A]=XRegExp(B,y));};XRegExp.copyAsGlobal=function(y){return q(y,"g");};XRegExp.escape=function(y){return y.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");};XRegExp.execAt=function(C,B,D,A){B=q(B,"g"+((A&&d)?"y":""));B.lastIndex=D=D||0;var y=B.exec(C);if(A){return(y&&y.index===D)?y:null;}else{return y;}};XRegExp.freezeTokens=function(){XRegExp.addToken=function(){throw Error("can't run addToken after freezeTokens");};};XRegExp.isRegExp=function(y){return Object.prototype.toString.call(y)==="[object RegExp]";};XRegExp.iterate=function(E,y,F,C){var D=q(y,"g"),B=-1,A;while(A=D.exec(E)){F.call(C,A,++B,E,D);if(D.lastIndex===A.index){D.lastIndex++;}}if(y.global){y.lastIndex=0;}};XRegExp.matchChain=function(A,y){return function B(C,H){var F=y[H].regex?y[H]:{regex:y[H]},E=q(F.regex,"g"),G=[],D;for(D=0;D<C.length;D++){XRegExp.iterate(C[D],E,function(I){G.push(F.backref?(I[F.backref]||""):I[0]);});}return((H===y.length-1)||!G.length)?G:B(G,H+1);}([A],0);};RegExp.prototype.apply=function(A,y){return this.exec(y[0]);};RegExp.prototype.call=function(y,A){return this.exec(A);};RegExp.prototype.exec=function(D){var B=u.exec.apply(this,arguments),A,y;if(B){if(!c&&B.length>1&&s(B,"")>-1){y=RegExp(this.source,u.replace.call(f(this),"g",""));u.replace.call(D.slice(B.index),y,function(){for(var E=1;E<arguments.length-2;E++){if(arguments[E]===undefined){B[E]=undefined;}}});}if(this._xregexp&&this._xregexp.captureNames){for(var C=1;C<B.length;C++){A=this._xregexp.captureNames[C-1];if(A){B[A]=B[C];}}}if(!g&&this.global&&!B[0].length&&(this.lastIndex>B.index)){this.lastIndex--;}}return B;};if(!g){RegExp.prototype.test=function(A){var y=u.exec.call(this,A);if(y&&this.global&&!y[0].length&&(this.lastIndex>y.index)){this.lastIndex--;}return !!y;};}String.prototype.match=function(A){if(!XRegExp.isRegExp(A)){A=RegExp(A);}if(A.global){var y=u.match.apply(this,arguments);A.lastIndex=0;return y;}return A.exec(this);};String.prototype.replace=function(B,C){var D=XRegExp.isRegExp(B),A,y,E;if(D&&typeof C.valueOf()==="string"&&C.indexOf("${")===-1&&k){return u.replace.apply(this,arguments);}if(!D){B=B+"";}else{if(B._xregexp){A=B._xregexp.captureNames;}}if(typeof C==="function"){y=u.replace.call(this,B,function(){if(A){arguments[0]=new String(arguments[0]);for(var F=0;F<A.length;F++){if(A[F]){arguments[0][A[F]]=arguments[F+1];}}}if(D&&B.global){B.lastIndex=arguments[arguments.length-2]+arguments[0].length;}return C.apply(null,arguments);});}else{E=this+"";y=u.replace.call(E,B,function(){var F=arguments;return u.replace.call(C,e,function(H,G,K){if(G){switch(G){case"$":return"$";case"&":return F[0];case"`":return F[F.length-1].slice(0,F[F.length-2]);case"'":return F[F.length-1].slice(F[F.length-2]+F[0].length);default:var I="";G=+G;if(!G){return H;}while(G>F.length-3){I=String.prototype.slice.call(G,-1)+I;G=Math.floor(G/10);}return(G?F[G]||"":"$")+I;}}else{var J=+K;if(J<=F.length-3){return F[J];}J=A?s(A,K):-1;return J>-1?F[J+1]:H;}});});}if(D&&B.global){B.lastIndex=0;}return y;};String.prototype.split=function(D,y){if(!XRegExp.isRegExp(D)){return u.split.apply(this,arguments);}var F=this+"",B=[],E=0,C,A;if(y===undefined||+y<0){y=Infinity;}else{y=Math.floor(+y);if(!y){return[];}}D=XRegExp.copyAsGlobal(D);while(C=D.exec(F)){if(D.lastIndex>E){B.push(F.slice(E,C.index));if(C.length>1&&C.index<F.length){Array.prototype.push.apply(B,C.slice(1));}A=C[0].length;E=D.lastIndex;if(B.length>=y){break;}}if(D.lastIndex===C.index){D.lastIndex++;}}if(E===F.length){if(!u.test.call(D,"")||A){B.push("");}}else{B.push(F.slice(E));}return B.length>y?B.slice(0,y):B;};function q(B,A){if(!XRegExp.isRegExp(B)){throw TypeError("type RegExp expected");}var y=B._xregexp;B=XRegExp(B.source,f(B)+(A||""));if(y){B._xregexp={source:y.source,captureNames:y.captureNames?y.captureNames.slice(0):null};}return B;}function f(y){return(y.global?"g":"")+(y.ignoreCase?"i":"")+(y.multiline?"m":"")+(y.extended?"x":"")+(y.sticky?"y":"");}function w(E,D,F,y){var B=r.length,H,C,G;l=true;try{while(B--){G=r[B];if((F&G.scope)&&(!G.trigger||G.trigger.call(y))){G.pattern.lastIndex=D;C=G.pattern.exec(E);if(C&&C.index===D){H={output:G.handler.call(y,C,F),match:C};break;}}}}catch(A){throw A;}finally{l=false;}return H;}function s(C,A,B){if(Array.prototype.indexOf){return C.indexOf(A,B);}for(var y=B||0;y<C.length;y++){if(C[y]===A){return y;}}return -1;}XRegExp.addToken(/\(\?#[^)]*\)/,function(y){return u.test.call(v,y.input.slice(y.index+y[0].length))?"":"(?:)";});XRegExp.addToken(/\((?!\?)/,function(){this.captureNames.push(null);return"(";});XRegExp.addToken(/\(\?<([$\w]+)>/,function(y){this.captureNames.push(y[1]);this.hasNamedCapture=true;return"(";});XRegExp.addToken(/\\k<([\w$]+)>/,function(A){var y=s(this.captureNames,A[1]);return y>-1?"\\"+(y+1)+(isNaN(A.input.charAt(A.index+A[0].length))?"":"(?:)"):A[0];});XRegExp.addToken(/\[\^?]/,function(y){return y[0]==="[]"?"\\b\\B":"[\\s\\S]";});XRegExp.addToken(/^\(\?([imsx]+)\)/,function(y){this.setFlag(y[1]);return"";});XRegExp.addToken(/(?:\s+|#.*)+/,function(y){return u.test.call(v,y.input.slice(y.index+y[0].length))?"":"(?:)";},XRegExp.OUTSIDE_CLASS,function(){return this.hasFlag("x");});XRegExp.addToken(/\./,function(){return"[\\s\\S]";},XRegExp.OUTSIDE_CLASS,function(){return this.hasFlag("s");});})();var XRegExp;if(!XRegExp){throw ReferenceError("XRegExp must be loaded before the Unicode plugin");}(function(){var c={};XRegExp.addUnicodePackage=function(f){var e=/\w{4}/g,g=/[- _]+/g,d,k;for(k in f){if(f.hasOwnProperty(k)){d=k.replace(g,"").toLowerCase();if(!c.hasOwnProperty(d)){c[d]=f[k].replace(e,"\\u$&");}}}};XRegExp.addToken(/\\([pP]){(\^?)([^}]*)}/,function(d,e){var g=(d[1]==="P"||d[2]),f=d[3].replace(/[- _]+/g,"").toLowerCase();if(d[1]==="P"&&d[2]){throw SyntaxError("erroneous characters: "+d[0]);}if(g&&e===XRegExp.INSIDE_CLASS){throw SyntaxError("not supported in character classes: \\"+d[1]+"{"+d[2]+"...}");}if(!c.hasOwnProperty(f)){throw SyntaxError("invalid or unsupported Unicode item: "+d[0]);}return e===XRegExp.OUTSIDE_CLASS?"["+(g?"^":"")+c[f]+"]":c[f];},XRegExp.INSIDE_CLASS|XRegExp.OUTSIDE_CLASS);XRegExp.addUnicodePackage({L:"0041-005A0061-007A00AA00B500BA00C0-00D600D8-00F600F8-02C102C6-02D102E0-02E402EC02EE0370-037403760377037A-037D03860388-038A038C038E-03A103A3-03F503F7-0481048A-05250531-055605590561-058705D0-05EA05F0-05F20621-064A066E066F0671-06D306D506E506E606EE06EF06FA-06FC06FF07100712-072F074D-07A507B107CA-07EA07F407F507FA0800-0815081A082408280904-0939093D09500958-0961097109720979-097F0985-098C098F09900993-09A809AA-09B009B209B6-09B909BD09CE09DC09DD09DF-09E109F009F10A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A59-0A5C0A5E0A72-0A740A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABD0AD00AE00AE10B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3D0B5C0B5D0B5F-0B610B710B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BD00C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D0C580C590C600C610C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBD0CDE0CE00CE10D05-0D0C0D0E-0D100D12-0D280D2A-0D390D3D0D600D610D7A-0D7F0D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60E01-0E300E320E330E40-0E460E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB00EB20EB30EBD0EC0-0EC40EC60EDC0EDD0F000F40-0F470F49-0F6C0F88-0F8B1000-102A103F1050-1055105A-105D106110651066106E-10701075-1081108E10A0-10C510D0-10FA10FC1100-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A1380-138F13A0-13F41401-166C166F-167F1681-169A16A0-16EA1700-170C170E-17111720-17311740-17511760-176C176E-17701780-17B317D717DC1820-18771880-18A818AA18B0-18F51900-191C1950-196D1970-19741980-19AB19C1-19C71A00-1A161A20-1A541AA71B05-1B331B45-1B4B1B83-1BA01BAE1BAF1C00-1C231C4D-1C4F1C5A-1C7D1CE9-1CEC1CEE-1CF11D00-1DBF1E00-1F151F18-1F1D1F20-1F451F48-1F4D1F50-1F571F591F5B1F5D1F5F-1F7D1F80-1FB41FB6-1FBC1FBE1FC2-1FC41FC6-1FCC1FD0-1FD31FD6-1FDB1FE0-1FEC1FF2-1FF41FF6-1FFC2071207F2090-209421022107210A-211321152119-211D212421262128212A-212D212F-2139213C-213F2145-2149214E218321842C00-2C2E2C30-2C5E2C60-2CE42CEB-2CEE2D00-2D252D30-2D652D6F2D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE2E2F300530063031-3035303B303C3041-3096309D-309F30A1-30FA30FC-30FF3105-312D3131-318E31A0-31B731F0-31FF3400-4DB54E00-9FCBA000-A48CA4D0-A4FDA500-A60CA610-A61FA62AA62BA640-A65FA662-A66EA67F-A697A6A0-A6E5A717-A71FA722-A788A78BA78CA7FB-A801A803-A805A807-A80AA80C-A822A840-A873A882-A8B3A8F2-A8F7A8FBA90A-A925A930-A946A960-A97CA984-A9B2A9CFAA00-AA28AA40-AA42AA44-AA4BAA60-AA76AA7AAA80-AAAFAAB1AAB5AAB6AAB9-AABDAAC0AAC2AADB-AADDABC0-ABE2AC00-D7A3D7B0-D7C6D7CB-D7FBF900-FA2DFA30-FA6DFA70-FAD9FB00-FB06FB13-FB17FB1DFB1F-FB28FB2A-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBB1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFBFE70-FE74FE76-FEFCFF21-FF3AFF41-FF5AFF66-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC"});})();var XRegExp;if(!(XRegExp&&XRegExp.addUnicodePackage)){throw ReferenceError("XRegExp's Unicode plugin must be loaded before adding categories");}XRegExp.addUnicodePackage({Ll:"0061-007A00AA00B500BA00DF-00F600F8-00FF01010103010501070109010B010D010F01110113011501170119011B011D011F01210123012501270129012B012D012F01310133013501370138013A013C013E014001420144014601480149014B014D014F01510153015501570159015B015D015F01610163016501670169016B016D016F0171017301750177017A017C017E-0180018301850188018C018D019201950199-019B019E01A101A301A501A801AA01AB01AD01B001B401B601B901BA01BD-01BF01C601C901CC01CE01D001D201D401D601D801DA01DC01DD01DF01E101E301E501E701E901EB01ED01EF01F001F301F501F901FB01FD01FF02010203020502070209020B020D020F02110213021502170219021B021D021F02210223022502270229022B022D022F02310233-0239023C023F0240024202470249024B024D024F-02930295-02AF037103730377037B-037D039003AC-03CE03D003D103D5-03D703D903DB03DD03DF03E103E303E503E703E903EB03ED03EF-03F303F503F803FB03FC0430-045F04610463046504670469046B046D046F04710473047504770479047B047D047F0481048B048D048F04910493049504970499049B049D049F04A104A304A504A704A904AB04AD04AF04B104B304B504B704B904BB04BD04BF04C204C404C604C804CA04CC04CE04CF04D104D304D504D704D904DB04DD04DF04E104E304E504E704E904EB04ED04EF04F104F304F504F704F904FB04FD04FF05010503050505070509050B050D050F05110513051505170519051B051D051F0521052305250561-05871D00-1D2B1D62-1D771D79-1D9A1E011E031E051E071E091E0B1E0D1E0F1E111E131E151E171E191E1B1E1D1E1F1E211E231E251E271E291E2B1E2D1E2F1E311E331E351E371E391E3B1E3D1E3F1E411E431E451E471E491E4B1E4D1E4F1E511E531E551E571E591E5B1E5D1E5F1E611E631E651E671E691E6B1E6D1E6F1E711E731E751E771E791E7B1E7D1E7F1E811E831E851E871E891E8B1E8D1E8F1E911E931E95-1E9D1E9F1EA11EA31EA51EA71EA91EAB1EAD1EAF1EB11EB31EB51EB71EB91EBB1EBD1EBF1EC11EC31EC51EC71EC91ECB1ECD1ECF1ED11ED31ED51ED71ED91EDB1EDD1EDF1EE11EE31EE51EE71EE91EEB1EED1EEF1EF11EF31EF51EF71EF91EFB1EFD1EFF-1F071F10-1F151F20-1F271F30-1F371F40-1F451F50-1F571F60-1F671F70-1F7D1F80-1F871F90-1F971FA0-1FA71FB0-1FB41FB61FB71FBE1FC2-1FC41FC61FC71FD0-1FD31FD61FD71FE0-1FE71FF2-1FF41FF61FF7210A210E210F2113212F21342139213C213D2146-2149214E21842C30-2C5E2C612C652C662C682C6A2C6C2C712C732C742C76-2C7C2C812C832C852C872C892C8B2C8D2C8F2C912C932C952C972C992C9B2C9D2C9F2CA12CA32CA52CA72CA92CAB2CAD2CAF2CB12CB32CB52CB72CB92CBB2CBD2CBF2CC12CC32CC52CC72CC92CCB2CCD2CCF2CD12CD32CD52CD72CD92CDB2CDD2CDF2CE12CE32CE42CEC2CEE2D00-2D25A641A643A645A647A649A64BA64DA64FA651A653A655A657A659A65BA65DA65FA663A665A667A669A66BA66DA681A683A685A687A689A68BA68DA68FA691A693A695A697A723A725A727A729A72BA72DA72F-A731A733A735A737A739A73BA73DA73FA741A743A745A747A749A74BA74DA74FA751A753A755A757A759A75BA75DA75FA761A763A765A767A769A76BA76DA76FA771-A778A77AA77CA77FA781A783A785A787A78CFB00-FB06FB13-FB17FF41-FF5A",Lu:"0041-005A00C0-00D600D8-00DE01000102010401060108010A010C010E01100112011401160118011A011C011E01200122012401260128012A012C012E01300132013401360139013B013D013F0141014301450147014A014C014E01500152015401560158015A015C015E01600162016401660168016A016C016E017001720174017601780179017B017D018101820184018601870189-018B018E-0191019301940196-0198019C019D019F01A001A201A401A601A701A901AC01AE01AF01B1-01B301B501B701B801BC01C401C701CA01CD01CF01D101D301D501D701D901DB01DE01E001E201E401E601E801EA01EC01EE01F101F401F6-01F801FA01FC01FE02000202020402060208020A020C020E02100212021402160218021A021C021E02200222022402260228022A022C022E02300232023A023B023D023E02410243-02460248024A024C024E03700372037603860388-038A038C038E038F0391-03A103A3-03AB03CF03D2-03D403D803DA03DC03DE03E003E203E403E603E803EA03EC03EE03F403F703F903FA03FD-042F04600462046404660468046A046C046E04700472047404760478047A047C047E0480048A048C048E04900492049404960498049A049C049E04A004A204A404A604A804AA04AC04AE04B004B204B404B604B804BA04BC04BE04C004C104C304C504C704C904CB04CD04D004D204D404D604D804DA04DC04DE04E004E204E404E604E804EA04EC04EE04F004F204F404F604F804FA04FC04FE05000502050405060508050A050C050E05100512051405160518051A051C051E0520052205240531-055610A0-10C51E001E021E041E061E081E0A1E0C1E0E1E101E121E141E161E181E1A1E1C1E1E1E201E221E241E261E281E2A1E2C1E2E1E301E321E341E361E381E3A1E3C1E3E1E401E421E441E461E481E4A1E4C1E4E1E501E521E541E561E581E5A1E5C1E5E1E601E621E641E661E681E6A1E6C1E6E1E701E721E741E761E781E7A1E7C1E7E1E801E821E841E861E881E8A1E8C1E8E1E901E921E941E9E1EA01EA21EA41EA61EA81EAA1EAC1EAE1EB01EB21EB41EB61EB81EBA1EBC1EBE1EC01EC21EC41EC61EC81ECA1ECC1ECE1ED01ED21ED41ED61ED81EDA1EDC1EDE1EE01EE21EE41EE61EE81EEA1EEC1EEE1EF01EF21EF41EF61EF81EFA1EFC1EFE1F08-1F0F1F18-1F1D1F28-1F2F1F38-1F3F1F48-1F4D1F591F5B1F5D1F5F1F68-1F6F1FB8-1FBB1FC8-1FCB1FD8-1FDB1FE8-1FEC1FF8-1FFB21022107210B-210D2110-211221152119-211D212421262128212A-212D2130-2133213E213F214521832C00-2C2E2C602C62-2C642C672C692C6B2C6D-2C702C722C752C7E-2C802C822C842C862C882C8A2C8C2C8E2C902C922C942C962C982C9A2C9C2C9E2CA02CA22CA42CA62CA82CAA2CAC2CAE2CB02CB22CB42CB62CB82CBA2CBC2CBE2CC02CC22CC42CC62CC82CCA2CCC2CCE2CD02CD22CD42CD62CD82CDA2CDC2CDE2CE02CE22CEB2CEDA640A642A644A646A648A64AA64CA64EA650A652A654A656A658A65AA65CA65EA662A664A666A668A66AA66CA680A682A684A686A688A68AA68CA68EA690A692A694A696A722A724A726A728A72AA72CA72EA732A734A736A738A73AA73CA73EA740A742A744A746A748A74AA74CA74EA750A752A754A756A758A75AA75CA75EA760A762A764A766A768A76AA76CA76EA779A77BA77DA77EA780A782A784A786A78BFF21-FF3A",Lt:"01C501C801CB01F21F88-1F8F1F98-1F9F1FA8-1FAF1FBC1FCC1FFC",Lm:"02B0-02C102C6-02D102E0-02E402EC02EE0374037A0559064006E506E607F407F507FA081A0824082809710E460EC610FC17D718431AA71C78-1C7D1D2C-1D611D781D9B-1DBF2071207F2090-20942C7D2D6F2E2F30053031-3035303B309D309E30FC-30FEA015A4F8-A4FDA60CA67FA717-A71FA770A788A9CFAA70AADDFF70FF9EFF9F",Lo:"01BB01C0-01C3029405D0-05EA05F0-05F20621-063F0641-064A066E066F0671-06D306D506EE06EF06FA-06FC06FF07100712-072F074D-07A507B107CA-07EA0800-08150904-0939093D09500958-096109720979-097F0985-098C098F09900993-09A809AA-09B009B209B6-09B909BD09CE09DC09DD09DF-09E109F009F10A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A59-0A5C0A5E0A72-0A740A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABD0AD00AE00AE10B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3D0B5C0B5D0B5F-0B610B710B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BD00C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D0C580C590C600C610C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBD0CDE0CE00CE10D05-0D0C0D0E-0D100D12-0D280D2A-0D390D3D0D600D610D7A-0D7F0D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60E01-0E300E320E330E40-0E450E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB00EB20EB30EBD0EC0-0EC40EDC0EDD0F000F40-0F470F49-0F6C0F88-0F8B1000-102A103F1050-1055105A-105D106110651066106E-10701075-1081108E10D0-10FA1100-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A1380-138F13A0-13F41401-166C166F-167F1681-169A16A0-16EA1700-170C170E-17111720-17311740-17511760-176C176E-17701780-17B317DC1820-18421844-18771880-18A818AA18B0-18F51900-191C1950-196D1970-19741980-19AB19C1-19C71A00-1A161A20-1A541B05-1B331B45-1B4B1B83-1BA01BAE1BAF1C00-1C231C4D-1C4F1C5A-1C771CE9-1CEC1CEE-1CF12135-21382D30-2D652D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE3006303C3041-3096309F30A1-30FA30FF3105-312D3131-318E31A0-31B731F0-31FF3400-4DB54E00-9FCBA000-A014A016-A48CA4D0-A4F7A500-A60BA610-A61FA62AA62BA66EA6A0-A6E5A7FB-A801A803-A805A807-A80AA80C-A822A840-A873A882-A8B3A8F2-A8F7A8FBA90A-A925A930-A946A960-A97CA984-A9B2AA00-AA28AA40-AA42AA44-AA4BAA60-AA6FAA71-AA76AA7AAA80-AAAFAAB1AAB5AAB6AAB9-AABDAAC0AAC2AADBAADCABC0-ABE2AC00-D7A3D7B0-D7C6D7CB-D7FBF900-FA2DFA30-FA6DFA70-FAD9FB1DFB1F-FB28FB2A-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBB1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFBFE70-FE74FE76-FEFCFF66-FF6FFF71-FF9DFFA0-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC",M:"0300-036F0483-04890591-05BD05BF05C105C205C405C505C70610-061A064B-065E067006D6-06DC06DE-06E406E706E806EA-06ED07110730-074A07A6-07B007EB-07F30816-0819081B-08230825-08270829-082D0900-0903093C093E-094E0951-0955096209630981-098309BC09BE-09C409C709C809CB-09CD09D709E209E30A01-0A030A3C0A3E-0A420A470A480A4B-0A4D0A510A700A710A750A81-0A830ABC0ABE-0AC50AC7-0AC90ACB-0ACD0AE20AE30B01-0B030B3C0B3E-0B440B470B480B4B-0B4D0B560B570B620B630B820BBE-0BC20BC6-0BC80BCA-0BCD0BD70C01-0C030C3E-0C440C46-0C480C4A-0C4D0C550C560C620C630C820C830CBC0CBE-0CC40CC6-0CC80CCA-0CCD0CD50CD60CE20CE30D020D030D3E-0D440D46-0D480D4A-0D4D0D570D620D630D820D830DCA0DCF-0DD40DD60DD8-0DDF0DF20DF30E310E34-0E3A0E47-0E4E0EB10EB4-0EB90EBB0EBC0EC8-0ECD0F180F190F350F370F390F3E0F3F0F71-0F840F860F870F90-0F970F99-0FBC0FC6102B-103E1056-1059105E-10601062-10641067-106D1071-10741082-108D108F109A-109D135F1712-17141732-1734175217531772177317B6-17D317DD180B-180D18A91920-192B1930-193B19B0-19C019C819C91A17-1A1B1A55-1A5E1A60-1A7C1A7F1B00-1B041B34-1B441B6B-1B731B80-1B821BA1-1BAA1C24-1C371CD0-1CD21CD4-1CE81CED1CF21DC0-1DE61DFD-1DFF20D0-20F02CEF-2CF12DE0-2DFF302A-302F3099309AA66F-A672A67CA67DA6F0A6F1A802A806A80BA823-A827A880A881A8B4-A8C4A8E0-A8F1A926-A92DA947-A953A980-A983A9B3-A9C0AA29-AA36AA43AA4CAA4DAA7BAAB0AAB2-AAB4AAB7AAB8AABEAABFAAC1ABE3-ABEAABECABEDFB1EFE00-FE0FFE20-FE26",Mn:"0300-036F0483-04870591-05BD05BF05C105C205C405C505C70610-061A064B-065E067006D6-06DC06DF-06E406E706E806EA-06ED07110730-074A07A6-07B007EB-07F30816-0819081B-08230825-08270829-082D0900-0902093C0941-0948094D0951-095509620963098109BC09C1-09C409CD09E209E30A010A020A3C0A410A420A470A480A4B-0A4D0A510A700A710A750A810A820ABC0AC1-0AC50AC70AC80ACD0AE20AE30B010B3C0B3F0B41-0B440B4D0B560B620B630B820BC00BCD0C3E-0C400C46-0C480C4A-0C4D0C550C560C620C630CBC0CBF0CC60CCC0CCD0CE20CE30D41-0D440D4D0D620D630DCA0DD2-0DD40DD60E310E34-0E3A0E47-0E4E0EB10EB4-0EB90EBB0EBC0EC8-0ECD0F180F190F350F370F390F71-0F7E0F80-0F840F860F870F90-0F970F99-0FBC0FC6102D-10301032-10371039103A103D103E10581059105E-10601071-1074108210851086108D109D135F1712-17141732-1734175217531772177317B7-17BD17C617C9-17D317DD180B-180D18A91920-19221927192819321939-193B1A171A181A561A58-1A5E1A601A621A65-1A6C1A73-1A7C1A7F1B00-1B031B341B36-1B3A1B3C1B421B6B-1B731B801B811BA2-1BA51BA81BA91C2C-1C331C361C371CD0-1CD21CD4-1CE01CE2-1CE81CED1DC0-1DE61DFD-1DFF20D0-20DC20E120E5-20F02CEF-2CF12DE0-2DFF302A-302F3099309AA66FA67CA67DA6F0A6F1A802A806A80BA825A826A8C4A8E0-A8F1A926-A92DA947-A951A980-A982A9B3A9B6-A9B9A9BCAA29-AA2EAA31AA32AA35AA36AA43AA4CAAB0AAB2-AAB4AAB7AAB8AABEAABFAAC1ABE5ABE8ABEDFB1EFE00-FE0FFE20-FE26",Mc:"0903093E-09400949-094C094E0982098309BE-09C009C709C809CB09CC09D70A030A3E-0A400A830ABE-0AC00AC90ACB0ACC0B020B030B3E0B400B470B480B4B0B4C0B570BBE0BBF0BC10BC20BC6-0BC80BCA-0BCC0BD70C01-0C030C41-0C440C820C830CBE0CC0-0CC40CC70CC80CCA0CCB0CD50CD60D020D030D3E-0D400D46-0D480D4A-0D4C0D570D820D830DCF-0DD10DD8-0DDF0DF20DF30F3E0F3F0F7F102B102C10311038103B103C105610571062-10641067-106D108310841087-108C108F109A-109C17B617BE-17C517C717C81923-19261929-192B193019311933-193819B0-19C019C819C91A19-1A1B1A551A571A611A631A641A6D-1A721B041B351B3B1B3D-1B411B431B441B821BA11BA61BA71BAA1C24-1C2B1C341C351CE11CF2A823A824A827A880A881A8B4-A8C3A952A953A983A9B4A9B5A9BAA9BBA9BD-A9C0AA2FAA30AA33AA34AA4DAA7BABE3ABE4ABE6ABE7ABE9ABEAABEC",Me:"0488048906DE20DD-20E020E2-20E4A670-A672",N:"0030-003900B200B300B900BC-00BE0660-066906F0-06F907C0-07C90966-096F09E6-09EF09F4-09F90A66-0A6F0AE6-0AEF0B66-0B6F0BE6-0BF20C66-0C6F0C78-0C7E0CE6-0CEF0D66-0D750E50-0E590ED0-0ED90F20-0F331040-10491090-10991369-137C16EE-16F017E0-17E917F0-17F91810-18191946-194F19D0-19DA1A80-1A891A90-1A991B50-1B591BB0-1BB91C40-1C491C50-1C5920702074-20792080-20892150-21822185-21892460-249B24EA-24FF2776-27932CFD30073021-30293038-303A3192-31953220-32293251-325F3280-328932B1-32BFA620-A629A6E6-A6EFA830-A835A8D0-A8D9A900-A909A9D0-A9D9AA50-AA59ABF0-ABF9FF10-FF19",Nd:"0030-00390660-066906F0-06F907C0-07C90966-096F09E6-09EF0A66-0A6F0AE6-0AEF0B66-0B6F0BE6-0BEF0C66-0C6F0CE6-0CEF0D66-0D6F0E50-0E590ED0-0ED90F20-0F291040-10491090-109917E0-17E91810-18191946-194F19D0-19DA1A80-1A891A90-1A991B50-1B591BB0-1BB91C40-1C491C50-1C59A620-A629A8D0-A8D9A900-A909A9D0-A9D9AA50-AA59ABF0-ABF9FF10-FF19",Nl:"16EE-16F02160-21822185-218830073021-30293038-303AA6E6-A6EF",No:"00B200B300B900BC-00BE09F4-09F90BF0-0BF20C78-0C7E0D70-0D750F2A-0F331369-137C17F0-17F920702074-20792080-20892150-215F21892460-249B24EA-24FF2776-27932CFD3192-31953220-32293251-325F3280-328932B1-32BFA830-A835",P:"0021-00230025-002A002C-002F003A003B003F0040005B-005D005F007B007D00A100AB00B700BB00BF037E0387055A-055F0589058A05BE05C005C305C605F305F40609060A060C060D061B061E061F066A-066D06D40700-070D07F7-07F90830-083E0964096509700DF40E4F0E5A0E5B0F04-0F120F3A-0F3D0F850FD0-0FD4104A-104F10FB1361-13681400166D166E169B169C16EB-16ED1735173617D4-17D617D8-17DA1800-180A1944194519DE19DF1A1E1A1F1AA0-1AA61AA8-1AAD1B5A-1B601C3B-1C3F1C7E1C7F1CD32010-20272030-20432045-20512053-205E207D207E208D208E2329232A2768-277527C527C627E6-27EF2983-299829D8-29DB29FC29FD2CF9-2CFC2CFE2CFF2E00-2E2E2E302E313001-30033008-30113014-301F3030303D30A030FBA4FEA4FFA60D-A60FA673A67EA6F2-A6F7A874-A877A8CEA8CFA8F8-A8FAA92EA92FA95FA9C1-A9CDA9DEA9DFAA5C-AA5FAADEAADFABEBFD3EFD3FFE10-FE19FE30-FE52FE54-FE61FE63FE68FE6AFE6BFF01-FF03FF05-FF0AFF0C-FF0FFF1AFF1BFF1FFF20FF3B-FF3DFF3FFF5BFF5DFF5F-FF65",Pd:"002D058A05BE140018062010-20152E172E1A301C303030A0FE31FE32FE58FE63FF0D",Ps:"0028005B007B0F3A0F3C169B201A201E2045207D208D23292768276A276C276E27702772277427C527E627E827EA27EC27EE2983298529872989298B298D298F299129932995299729D829DA29FC2E222E242E262E283008300A300C300E3010301430163018301A301DFD3EFE17FE35FE37FE39FE3BFE3DFE3FFE41FE43FE47FE59FE5BFE5DFF08FF3BFF5BFF5FFF62",Pe:"0029005D007D0F3B0F3D169C2046207E208E232A2769276B276D276F27712773277527C627E727E927EB27ED27EF298429862988298A298C298E2990299229942996299829D929DB29FD2E232E252E272E293009300B300D300F3011301530173019301B301E301FFD3FFE18FE36FE38FE3AFE3CFE3EFE40FE42FE44FE48FE5AFE5CFE5EFF09FF3DFF5DFF60FF63",Pi:"00AB2018201B201C201F20392E022E042E092E0C2E1C2E20",Pf:"00BB2019201D203A2E032E052E0A2E0D2E1D2E21",Pc:"005F203F20402054FE33FE34FE4D-FE4FFF3F",Po:"0021-00230025-0027002A002C002E002F003A003B003F0040005C00A100B700BF037E0387055A-055F058905C005C305C605F305F40609060A060C060D061B061E061F066A-066D06D40700-070D07F7-07F90830-083E0964096509700DF40E4F0E5A0E5B0F04-0F120F850FD0-0FD4104A-104F10FB1361-1368166D166E16EB-16ED1735173617D4-17D617D8-17DA1800-18051807-180A1944194519DE19DF1A1E1A1F1AA0-1AA61AA8-1AAD1B5A-1B601C3B-1C3F1C7E1C7F1CD3201620172020-20272030-2038203B-203E2041-20432047-205120532055-205E2CF9-2CFC2CFE2CFF2E002E012E06-2E082E0B2E0E-2E162E182E192E1B2E1E2E1F2E2A-2E2E2E302E313001-3003303D30FBA4FEA4FFA60D-A60FA673A67EA6F2-A6F7A874-A877A8CEA8CFA8F8-A8FAA92EA92FA95FA9C1-A9CDA9DEA9DFAA5C-AA5FAADEAADFABEBFE10-FE16FE19FE30FE45FE46FE49-FE4CFE50-FE52FE54-FE57FE5F-FE61FE68FE6AFE6BFF01-FF03FF05-FF07FF0AFF0CFF0EFF0FFF1AFF1BFF1FFF20FF3CFF61FF64FF65",S:"0024002B003C-003E005E0060007C007E00A2-00A900AC00AE-00B100B400B600B800D700F702C2-02C502D2-02DF02E5-02EB02ED02EF-02FF03750384038503F604820606-0608060B060E060F06E906FD06FE07F609F209F309FA09FB0AF10B700BF3-0BFA0C7F0CF10CF20D790E3F0F01-0F030F13-0F170F1A-0F1F0F340F360F380FBE-0FC50FC7-0FCC0FCE0FCF0FD5-0FD8109E109F13601390-139917DB194019E0-19FF1B61-1B6A1B74-1B7C1FBD1FBF-1FC11FCD-1FCF1FDD-1FDF1FED-1FEF1FFD1FFE20442052207A-207C208A-208C20A0-20B8210021012103-21062108210921142116-2118211E-2123212521272129212E213A213B2140-2144214A-214D214F2190-2328232B-23E82400-24262440-244A249C-24E92500-26CD26CF-26E126E326E8-26FF2701-27042706-2709270C-27272729-274B274D274F-27522756-275E2761-276727942798-27AF27B1-27BE27C0-27C427C7-27CA27CC27D0-27E527F0-29822999-29D729DC-29FB29FE-2B4C2B50-2B592CE5-2CEA2E80-2E992E9B-2EF32F00-2FD52FF0-2FFB300430123013302030363037303E303F309B309C319031913196-319F31C0-31E33200-321E322A-32503260-327F328A-32B032C0-32FE3300-33FF4DC0-4DFFA490-A4C6A700-A716A720A721A789A78AA828-A82BA836-A839AA77-AA79FB29FDFCFDFDFE62FE64-FE66FE69FF04FF0BFF1C-FF1EFF3EFF40FF5CFF5EFFE0-FFE6FFE8-FFEEFFFCFFFD",Sm:"002B003C-003E007C007E00AC00B100D700F703F60606-060820442052207A-207C208A-208C2140-2144214B2190-2194219A219B21A021A321A621AE21CE21CF21D221D421F4-22FF2308-230B23202321237C239B-23B323DC-23E125B725C125F8-25FF266F27C0-27C427C7-27CA27CC27D0-27E527F0-27FF2900-29822999-29D729DC-29FB29FE-2AFF2B30-2B442B47-2B4CFB29FE62FE64-FE66FF0BFF1C-FF1EFF5CFF5EFFE2FFE9-FFEC",Sc:"002400A2-00A5060B09F209F309FB0AF10BF90E3F17DB20A0-20B8A838FDFCFE69FF04FFE0FFE1FFE5FFE6",Sk:"005E006000A800AF00B400B802C2-02C502D2-02DF02E5-02EB02ED02EF-02FF0375038403851FBD1FBF-1FC11FCD-1FCF1FDD-1FDF1FED-1FEF1FFD1FFE309B309CA700-A716A720A721A789A78AFF3EFF40FFE3",So:"00A600A700A900AE00B000B60482060E060F06E906FD06FE07F609FA0B700BF3-0BF80BFA0C7F0CF10CF20D790F01-0F030F13-0F170F1A-0F1F0F340F360F380FBE-0FC50FC7-0FCC0FCE0FCF0FD5-0FD8109E109F13601390-1399194019E0-19FF1B61-1B6A1B74-1B7C210021012103-21062108210921142116-2118211E-2123212521272129212E213A213B214A214C214D214F2195-2199219C-219F21A121A221A421A521A7-21AD21AF-21CD21D021D121D321D5-21F32300-2307230C-231F2322-2328232B-237B237D-239A23B4-23DB23E2-23E82400-24262440-244A249C-24E92500-25B625B8-25C025C2-25F72600-266E2670-26CD26CF-26E126E326E8-26FF2701-27042706-2709270C-27272729-274B274D274F-27522756-275E2761-276727942798-27AF27B1-27BE2800-28FF2B00-2B2F2B452B462B50-2B592CE5-2CEA2E80-2E992E9B-2EF32F00-2FD52FF0-2FFB300430123013302030363037303E303F319031913196-319F31C0-31E33200-321E322A-32503260-327F328A-32B032C0-32FE3300-33FF4DC0-4DFFA490-A4C6A828-A82BA836A837A839AA77-AA79FDFDFFE4FFE8FFEDFFEEFFFCFFFD",Z:"002000A01680180E2000-200A20282029202F205F3000",Zs:"002000A01680180E2000-200A202F205F3000",Zl:"2028",Zp:"2029",C:"0000-001F007F-009F00AD03780379037F-0383038B038D03A20526-05300557055805600588058B-059005C8-05CF05EB-05EF05F5-0605061C061D0620065F06DD070E070F074B074C07B2-07BF07FB-07FF082E082F083F-08FF093A093B094F095609570973-097809800984098D098E0991099209A909B109B3-09B509BA09BB09C509C609C909CA09CF-09D609D8-09DB09DE09E409E509FC-0A000A040A0B-0A0E0A110A120A290A310A340A370A3A0A3B0A3D0A43-0A460A490A4A0A4E-0A500A52-0A580A5D0A5F-0A650A76-0A800A840A8E0A920AA90AB10AB40ABA0ABB0AC60ACA0ACE0ACF0AD1-0ADF0AE40AE50AF00AF2-0B000B040B0D0B0E0B110B120B290B310B340B3A0B3B0B450B460B490B4A0B4E-0B550B58-0B5B0B5E0B640B650B72-0B810B840B8B-0B8D0B910B96-0B980B9B0B9D0BA0-0BA20BA5-0BA70BAB-0BAD0BBA-0BBD0BC3-0BC50BC90BCE0BCF0BD1-0BD60BD8-0BE50BFB-0C000C040C0D0C110C290C340C3A-0C3C0C450C490C4E-0C540C570C5A-0C5F0C640C650C70-0C770C800C810C840C8D0C910CA90CB40CBA0CBB0CC50CC90CCE-0CD40CD7-0CDD0CDF0CE40CE50CF00CF3-0D010D040D0D0D110D290D3A-0D3C0D450D490D4E-0D560D58-0D5F0D640D650D76-0D780D800D810D840D97-0D990DB20DBC0DBE0DBF0DC7-0DC90DCB-0DCE0DD50DD70DE0-0DF10DF5-0E000E3B-0E3E0E5C-0E800E830E850E860E890E8B0E8C0E8E-0E930E980EA00EA40EA60EA80EA90EAC0EBA0EBE0EBF0EC50EC70ECE0ECF0EDA0EDB0EDE-0EFF0F480F6D-0F700F8C-0F8F0F980FBD0FCD0FD9-0FFF10C6-10CF10FD-10FF1249124E124F12571259125E125F1289128E128F12B112B612B712BF12C112C612C712D7131113161317135B-135E137D-137F139A-139F13F5-13FF169D-169F16F1-16FF170D1715-171F1737-173F1754-175F176D17711774-177F17B417B517DE17DF17EA-17EF17FA-17FF180F181A-181F1878-187F18AB-18AF18F6-18FF191D-191F192C-192F193C-193F1941-1943196E196F1975-197F19AC-19AF19CA-19CF19DB-19DD1A1C1A1D1A5F1A7D1A7E1A8A-1A8F1A9A-1A9F1AAE-1AFF1B4C-1B4F1B7D-1B7F1BAB-1BAD1BBA-1BFF1C38-1C3A1C4A-1C4C1C80-1CCF1CF3-1CFF1DE7-1DFC1F161F171F1E1F1F1F461F471F4E1F4F1F581F5A1F5C1F5E1F7E1F7F1FB51FC51FD41FD51FDC1FF01FF11FF51FFF200B-200F202A-202E2060-206F20722073208F2095-209F20B9-20CF20F1-20FF218A-218F23E9-23FF2427-243F244B-245F26CE26E226E4-26E727002705270A270B2728274C274E2753-2755275F27602795-279727B027BF27CB27CD-27CF2B4D-2B4F2B5A-2BFF2C2F2C5F2CF2-2CF82D26-2D2F2D66-2D6E2D70-2D7F2D97-2D9F2DA72DAF2DB72DBF2DC72DCF2DD72DDF2E32-2E7F2E9A2EF4-2EFF2FD6-2FEF2FFC-2FFF3040309730983100-3104312E-3130318F31B8-31BF31E4-31EF321F32FF4DB6-4DBF9FCC-9FFFA48D-A48FA4C7-A4CFA62C-A63FA660A661A674-A67BA698-A69FA6F8-A6FFA78D-A7FAA82C-A82FA83A-A83FA878-A87FA8C5-A8CDA8DA-A8DFA8FC-A8FFA954-A95EA97D-A97FA9CEA9DA-A9DDA9E0-A9FFAA37-AA3FAA4EAA4FAA5AAA5BAA7C-AA7FAAC3-AADAAAE0-ABBFABEEABEFABFA-ABFFD7A4-D7AFD7C7-D7CAD7FC-F8FFFA2EFA2FFA6EFA6FFADA-FAFFFB07-FB12FB18-FB1CFB37FB3DFB3FFB42FB45FBB2-FBD2FD40-FD4FFD90FD91FDC8-FDEFFDFEFDFFFE1A-FE1FFE27-FE2FFE53FE67FE6C-FE6FFE75FEFD-FF00FFBF-FFC1FFC8FFC9FFD0FFD1FFD8FFD9FFDD-FFDFFFE7FFEF-FFFBFFFEFFFF",Cc:"0000-001F007F-009F",Cf:"00AD0600-060306DD070F17B417B5200B-200F202A-202E2060-2064206A-206FFEFFFFF9-FFFB",Co:"E000-F8FF",Cs:"D800-DFFF",Cn:"03780379037F-0383038B038D03A20526-05300557055805600588058B-059005C8-05CF05EB-05EF05F5-05FF06040605061C061D0620065F070E074B074C07B2-07BF07FB-07FF082E082F083F-08FF093A093B094F095609570973-097809800984098D098E0991099209A909B109B3-09B509BA09BB09C509C609C909CA09CF-09D609D8-09DB09DE09E409E509FC-0A000A040A0B-0A0E0A110A120A290A310A340A370A3A0A3B0A3D0A43-0A460A490A4A0A4E-0A500A52-0A580A5D0A5F-0A650A76-0A800A840A8E0A920AA90AB10AB40ABA0ABB0AC60ACA0ACE0ACF0AD1-0ADF0AE40AE50AF00AF2-0B000B040B0D0B0E0B110B120B290B310B340B3A0B3B0B450B460B490B4A0B4E-0B550B58-0B5B0B5E0B640B650B72-0B810B840B8B-0B8D0B910B96-0B980B9B0B9D0BA0-0BA20BA5-0BA70BAB-0BAD0BBA-0BBD0BC3-0BC50BC90BCE0BCF0BD1-0BD60BD8-0BE50BFB-0C000C040C0D0C110C290C340C3A-0C3C0C450C490C4E-0C540C570C5A-0C5F0C640C650C70-0C770C800C810C840C8D0C910CA90CB40CBA0CBB0CC50CC90CCE-0CD40CD7-0CDD0CDF0CE40CE50CF00CF3-0D010D040D0D0D110D290D3A-0D3C0D450D490D4E-0D560D58-0D5F0D640D650D76-0D780D800D810D840D97-0D990DB20DBC0DBE0DBF0DC7-0DC90DCB-0DCE0DD50DD70DE0-0DF10DF5-0E000E3B-0E3E0E5C-0E800E830E850E860E890E8B0E8C0E8E-0E930E980EA00EA40EA60EA80EA90EAC0EBA0EBE0EBF0EC50EC70ECE0ECF0EDA0EDB0EDE-0EFF0F480F6D-0F700F8C-0F8F0F980FBD0FCD0FD9-0FFF10C6-10CF10FD-10FF1249124E124F12571259125E125F1289128E128F12B112B612B712BF12C112C612C712D7131113161317135B-135E137D-137F139A-139F13F5-13FF169D-169F16F1-16FF170D1715-171F1737-173F1754-175F176D17711774-177F17DE17DF17EA-17EF17FA-17FF180F181A-181F1878-187F18AB-18AF18F6-18FF191D-191F192C-192F193C-193F1941-1943196E196F1975-197F19AC-19AF19CA-19CF19DB-19DD1A1C1A1D1A5F1A7D1A7E1A8A-1A8F1A9A-1A9F1AAE-1AFF1B4C-1B4F1B7D-1B7F1BAB-1BAD1BBA-1BFF1C38-1C3A1C4A-1C4C1C80-1CCF1CF3-1CFF1DE7-1DFC1F161F171F1E1F1F1F461F471F4E1F4F1F581F5A1F5C1F5E1F7E1F7F1FB51FC51FD41FD51FDC1FF01FF11FF51FFF2065-206920722073208F2095-209F20B9-20CF20F1-20FF218A-218F23E9-23FF2427-243F244B-245F26CE26E226E4-26E727002705270A270B2728274C274E2753-2755275F27602795-279727B027BF27CB27CD-27CF2B4D-2B4F2B5A-2BFF2C2F2C5F2CF2-2CF82D26-2D2F2D66-2D6E2D70-2D7F2D97-2D9F2DA72DAF2DB72DBF2DC72DCF2DD72DDF2E32-2E7F2E9A2EF4-2EFF2FD6-2FEF2FFC-2FFF3040309730983100-3104312E-3130318F31B8-31BF31E4-31EF321F32FF4DB6-4DBF9FCC-9FFFA48D-A48FA4C7-A4CFA62C-A63FA660A661A674-A67BA698-A69FA6F8-A6FFA78D-A7FAA82C-A82FA83A-A83FA878-A87FA8C5-A8CDA8DA-A8DFA8FC-A8FFA954-A95EA97D-A97FA9CEA9DA-A9DDA9E0-A9FFAA37-AA3FAA4EAA4FAA5AAA5BAA7C-AA7FAAC3-AADAAAE0-ABBFABEEABEFABFA-ABFFD7A4-D7AFD7C7-D7CAD7FC-D7FFFA2EFA2FFA6EFA6FFADA-FAFFFB07-FB12FB18-FB1CFB37FB3DFB3FFB42FB45FBB2-FBD2FD40-FD4FFD90FD91FDC8-FDEFFDFEFDFFFE1A-FE1FFE27-FE2FFE53FE67FE6C-FE6FFE75FEFDFEFEFF00FFBF-FFC1FFC8FFC9FFD0FFD1FFD8FFD9FFDD-FFDFFFE7FFEF-FFF8FFFEFFFF"});var swfobject=function(){var aq="undefined",aD="object",ab="Shockwave Flash",X="ShockwaveFlash.ShockwaveFlash",aE="application/x-shockwave-flash",ac="SWFObjectExprInst",ax="onreadystatechange",af=window,aL=document,aB=navigator,aa=false,Z=[aN],aG=[],ag=[],al=[],aJ,ad,ap,at,ak=false,aU=false,aH,an,aI=true,ah=function(){var c=typeof aL.getElementById!=aq&&typeof aL.getElementsByTagName!=aq&&typeof aL.createElement!=aq,g=aB.userAgent.toLowerCase(),e=aB.platform.toLowerCase(),m=e?/win/.test(e):/win/.test(g),q=e?/mac/.test(e):/mac/.test(g),l=/webkit/.test(g)?parseFloat(g.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,f=!+"\v1",k=[0,0,0],r=null;if(typeof aB.plugins!=aq&&typeof aB.plugins[ab]==aD){r=aB.plugins[ab].description;if(r&&!(typeof aB.mimeTypes!=aq&&aB.mimeTypes[aE]&&!aB.mimeTypes[aE].enabledPlugin)){aa=true;f=false;r=r.replace(/^.*\s+(\S+\s+\S+$)/,"$1");k[0]=parseInt(r.replace(/^(.*)\..*$/,"$1"),10);k[1]=parseInt(r.replace(/^.*\.(.*)\s.*$/,"$1"),10);k[2]=/[a-zA-Z]/.test(r)?parseInt(r.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0;}}else{if(typeof af.ActiveXObject!=aq){try{var o=new ActiveXObject(X);if(o){r=o.GetVariable("$version");if(r){f=true;r=r.split(" ")[1].split(",");k=[parseInt(r[0],10),parseInt(r[1],10),parseInt(r[2],10)];}}}catch(d){}}}return{w3:c,pv:k,wk:l,ie:f,win:m,mac:q};}(),aK=function(){if(!ah.w3){return;}if((typeof aL.readyState!=aq&&aL.readyState=="complete")||(typeof aL.readyState==aq&&(aL.getElementsByTagName("body")[0]||aL.body))){aP();}if(!ak){if(typeof aL.addEventListener!=aq){aL.addEventListener("DOMContentLoaded",aP,false);}if(ah.ie&&ah.win){aL.attachEvent(ax,function(){if(aL.readyState=="complete"){aL.detachEvent(ax,arguments.callee);aP();}});if(af==top){(function(){if(ak){return;}try{aL.documentElement.doScroll("left");}catch(c){setTimeout(arguments.callee,0);return;}aP();})();}}if(ah.wk){(function(){if(ak){return;}if(!/loaded|complete/.test(aL.readyState)){setTimeout(arguments.callee,0);return;}aP();})();}aC(aP);}}();function aP(){if(ak){return;}try{var d=aL.getElementsByTagName("body")[0].appendChild(ar("span"));d.parentNode.removeChild(d);}catch(c){return;}ak=true;var f=Z.length;for(var e=0;e<f;e++){Z[e]();}}function aj(c){if(ak){c();}else{Z[Z.length]=c;}}function aC(c){if(typeof af.addEventListener!=aq){af.addEventListener("load",c,false);}else{if(typeof aL.addEventListener!=aq){aL.addEventListener("load",c,false);}else{if(typeof af.attachEvent!=aq){aM(af,"onload",c);}else{if(typeof af.onload=="function"){var d=af.onload;af.onload=function(){d();c();};}else{af.onload=c;}}}}}function aN(){if(aa){Y();}else{am();}}function Y(){var f=aL.getElementsByTagName("body")[0];var d=ar(aD);d.setAttribute("type",aE);var c=f.appendChild(d);if(c){var e=0;(function(){if(typeof c.GetVariable!=aq){var g=c.GetVariable("$version");if(g){g=g.split(" ")[1].split(",");ah.pv=[parseInt(g[0],10),parseInt(g[1],10),parseInt(g[2],10)];}}else{if(e<10){e++;setTimeout(arguments.callee,10);return;}}f.removeChild(d);c=null;am();})();}else{am();}}function am(){var l=aG.length;if(l>0){for(var m=0;m<l;m++){var e=aG[m].id;var s=aG[m].callbackFn;var c={success:false,id:e};if(ah.pv[0]>0){var o=aS(e);if(o){if(ao(aG[m].swfVersion)&&!(ah.wk&&ah.wk<312)){ay(e,true);if(s){c.success=true;c.ref=av(e);s(c);}}else{if(aG[m].expressInstall&&au()){var g={};g.data=aG[m].expressInstall;g.width=o.getAttribute("width")||"0";g.height=o.getAttribute("height")||"0";if(o.getAttribute("class")){g.styleclass=o.getAttribute("class");}if(o.getAttribute("align")){g.align=o.getAttribute("align");}var k={};var f=o.getElementsByTagName("param");var r=f.length;for(var q=0;q<r;q++){if(f[q].getAttribute("name").toLowerCase()!="movie"){k[f[q].getAttribute("name")]=f[q].getAttribute("value");}}ae(g,k,e,s);}else{aF(o);if(s){s(c);}}}}}else{ay(e,true);if(s){var d=av(e);if(d&&typeof d.SetVariable!=aq){c.success=true;c.ref=d;}s(c);}}}}}function av(d){var f=null;var e=aS(d);if(e&&e.nodeName=="OBJECT"){if(typeof e.SetVariable!=aq){f=e;}else{var c=e.getElementsByTagName(aD)[0];if(c){f=c;}}}return f;}function au(){return !aU&&ao("6.0.65")&&(ah.win||ah.mac)&&!(ah.wk&&ah.wk<312);}function ae(k,f,m,g){aU=true;ap=g||null;at={success:false,id:m};var c=aS(m);if(c){if(c.nodeName=="OBJECT"){aJ=aO(c);ad=null;}else{aJ=c;ad=m;}k.id=ac;if(typeof k.width==aq||(!/%$/.test(k.width)&&parseInt(k.width,10)<310)){k.width="310";}if(typeof k.height==aq||(!/%$/.test(k.height)&&parseInt(k.height,10)<137)){k.height="137";}aL.title=aL.title.slice(0,47)+" - Flash Player Installation";var d=ah.ie&&ah.win?"ActiveX":"PlugIn",e="MMredirectURL="+af.location.toString().replace(/&/g,"%26")+"&MMplayerType="+d+"&MMdoctitle="+aL.title;if(typeof f.flashvars!=aq){f.flashvars+="&"+e;}else{f.flashvars=e;}if(ah.ie&&ah.win&&c.readyState!=4){var l=ar("div");m+="SWFObjectNew";l.setAttribute("id",m);c.parentNode.insertBefore(l,c);c.style.display="none";(function(){if(c.readyState==4){c.parentNode.removeChild(c);}else{setTimeout(arguments.callee,10);}})();}aA(k,f,m);}}function aF(c){if(ah.ie&&ah.win&&c.readyState!=4){var d=ar("div");c.parentNode.insertBefore(d,c);d.parentNode.replaceChild(aO(c),d);c.style.display="none";(function(){if(c.readyState==4){c.parentNode.removeChild(c);}else{setTimeout(arguments.callee,10);}})();}else{c.parentNode.replaceChild(aO(c),c);}}function aO(d){var f=ar("div");if(ah.win&&ah.ie){f.innerHTML=d.innerHTML;}else{var g=d.getElementsByTagName(aD)[0];if(g){var c=g.childNodes;if(c){var k=c.length;for(var e=0;e<k;e++){if(!(c[e].nodeType==1&&c[e].nodeName=="PARAM")&&!(c[e].nodeType==8)){f.appendChild(c[e].cloneNode(true));}}}}}return f;}function aA(g,l,e){var f,c=aS(e);if(ah.wk&&ah.wk<312){return f;}if(c){if(typeof g.id==aq){g.id=e;}if(ah.ie&&ah.win){var k="";for(var o in g){if(g[o]!=Object.prototype[o]){if(o.toLowerCase()=="data"){l.movie=g[o];}else{if(o.toLowerCase()=="styleclass"){k+=' class="'+g[o]+'"';}else{if(o.toLowerCase()!="classid"){k+=" "+o+'="'+g[o]+'"';}}}}}var m="";for(var q in l){if(l[q]!=Object.prototype[q]){m+='<param name="'+q+'" value="'+l[q]+'" />';}}c.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+k+">"+m+"</object>";ag[ag.length]=g.id;f=aS(g.id);}else{var d=ar(aD);d.setAttribute("type",aE);for(var r in g){if(g[r]!=Object.prototype[r]){if(r.toLowerCase()=="styleclass"){d.setAttribute("class",g[r]);}else{if(r.toLowerCase()!="classid"){d.setAttribute(r,g[r]);}}}}for(var s in l){if(l[s]!=Object.prototype[s]&&s.toLowerCase()!="movie"){aQ(d,s,l[s]);}}c.parentNode.replaceChild(d,c);f=d;}}return f;}function aQ(d,f,e){var c=ar("param");c.setAttribute("name",f);c.setAttribute("value",e);d.appendChild(c);}function aw(c){var d=aS(c);if(d&&d.nodeName=="OBJECT"){if(ah.ie&&ah.win){d.style.display="none";(function(){if(d.readyState==4){aT(c);}else{setTimeout(arguments.callee,10);}})();}else{d.parentNode.removeChild(d);}}}function aT(c){var d=aS(c);if(d){for(var e in d){if(typeof d[e]=="function"){d[e]=null;}}d.parentNode.removeChild(d);}}function aS(c){var e=null;try{e=aL.getElementById(c);}catch(d){}return e;}function ar(c){return aL.createElement(c);}function aM(c,e,d){c.attachEvent(e,d);al[al.length]=[c,e,d];}function ao(c){var d=ah.pv,e=c.split(".");e[0]=parseInt(e[0],10);e[1]=parseInt(e[1],10)||0;e[2]=parseInt(e[2],10)||0;return(d[0]>e[0]||(d[0]==e[0]&&d[1]>e[1])||(d[0]==e[0]&&d[1]==e[1]&&d[2]>=e[2]))?true:false;}function az(d,k,c,e){if(ah.ie&&ah.mac){return;}var g=aL.getElementsByTagName("head")[0];if(!g){return;}var l=(c&&typeof c=="string")?c:"screen";if(e){aH=null;an=null;}if(!aH||an!=l){var f=ar("style");f.setAttribute("type","text/css");f.setAttribute("media",l);aH=g.appendChild(f);if(ah.ie&&ah.win&&typeof aL.styleSheets!=aq&&aL.styleSheets.length>0){aH=aL.styleSheets[aL.styleSheets.length-1];}an=l;}if(ah.ie&&ah.win){if(aH&&typeof aH.addRule==aD){aH.addRule(d,k);}}else{if(aH&&typeof aL.createTextNode!=aq){aH.appendChild(aL.createTextNode(d+" {"+k+"}"));}}}function ay(c,e){if(!aI){return;}var d=e?"visible":"hidden";if(ak&&aS(c)){aS(c).style.visibility=d;}else{az("#"+c,"visibility:"+d);}}function ai(d){var c=/[\\\"<>\.;]/;var e=c.exec(d)!=null;return e&&typeof encodeURIComponent!=aq?encodeURIComponent(d):d;}var aR=function(){if(ah.ie&&ah.win){window.attachEvent("onunload",function(){var c=al.length;for(var d=0;d<c;d++){al[d][0].detachEvent(al[d][1],al[d][2]);}var f=ag.length;for(var e=0;e<f;e++){aw(ag[e]);}for(var g in ah){ah[g]=null;}ah=null;for(var k in swfobject){swfobject[k]=null;}swfobject=null;});}}();return{registerObject:function(c,g,e,d){if(ah.w3&&c&&g){var f={};f.id=c;f.swfVersion=g;f.expressInstall=e;f.callbackFn=d;aG[aG.length]=f;ay(c,false);}else{if(d){d({success:false,id:c});}}},getObjectById:function(c){if(ah.w3){return av(c);}},embedSWF:function(r,g,m,k,e,c,d,o,l,q){var f={success:false,id:g};if(ah.w3&&!(ah.wk&&ah.wk<312)&&r&&g&&m&&k&&e){ay(g,false);aj(function(){m+="";k+="";var A={};if(l&&typeof l===aD){for(var w in l){A[w]=l[w];}}A.data=r;A.width=m;A.height=k;var v={};if(o&&typeof o===aD){for(var y in o){v[y]=o[y];}}if(d&&typeof d===aD){for(var s in d){if(typeof v.flashvars!=aq){v.flashvars+="&"+s+"="+d[s];}else{v.flashvars=s+"="+d[s];}}}if(ao(e)){var u=aA(A,v,g);if(A.id==g){ay(g,true);}f.success=true;f.ref=u;}else{if(c&&au()){A.data=c;ae(A,v,g,q);return;}else{ay(g,true);}}if(q){q(f);}});}else{if(q){q(f);}}},switchOffAutoHideShow:function(){aI=false;},ua:ah,getFlashPlayerVersion:function(){return{major:ah.pv[0],minor:ah.pv[1],release:ah.pv[2]};},hasFlashPlayerVersion:ao,createSWF:function(c,d,e){if(ah.w3){return aA(c,d,e);}else{return undefined;}},showExpressInstall:function(d,c,f,e){if(ah.w3&&au()){ae(d,c,f,e);}},removeSWF:function(c){if(ah.w3){aw(c);}},createCSS:function(d,c,e,f){if(ah.w3){az(d,c,e,f);}},addDomLoadEvent:aj,addLoadEvent:aC,getQueryParamValue:function(d){var c=aL.location.search||aL.location.hash;if(c){if(/\?/.test(c)){c=c.split("?")[1];}if(d==null){return ai(c);}var e=c.split("&");for(var f=0;f<e.length;f++){if(e[f].substring(0,e[f].indexOf("="))==d){return ai(e[f].substring((e[f].indexOf("=")+1)));}}}return"";},expressInstallCallback:function(){if(aU){var c=aS(ac);if(c&&aJ){c.parentNode.replaceChild(aJ,c);if(ad){ay(ad,true);if(ah.ie&&ah.win){aJ.style.display="block";}}if(ap){ap(at);}}aU=false;}}};}();if(typeof SB=="undefined"){var SB=new Object();}if(typeof SB.framework=="undefined"){SB.framework=new Object();}SB.framework.UtilityClass=function(){this.isNullOrEmpty=function(c){if(c==""||typeof(c)=="undefined"){return true;}return false;};};SB.framework.Utility=new SB.framework.UtilityClass();SB.framework.StringBuilder=function(){this.buffer=[];};SB.framework.StringBuilder.prototype.append=function(c){this.buffer.push(c);return this;};SB.framework.StringBuilder.prototype.toString=function(c){return this.buffer.join(c||"");};SB.framework.Logger=function(){};SB.framework.Logger.instance=null;SB.framework.Logger.getInstance=function(){if(!SB.framework.Logger.instance){SB.framework.Logger.instance=new SB.framework.Logger();}return SB.framework.Logger.instance;};SB.framework.Logger.prototype={logInit:function(){if(this.isEnabled()){log4javascript.getLogger().setLevel(log4javascript.Level.ALL);var c=new log4javascript.PopUpAppender();c.setFocusPopUp(true);c.setReopenWhenClosed(true);log4javascript.getLogger().addAppender(c);}},isEnabled:function(){return($.cookie("JsLog")!=null&&$.cookie("JsLog")!=""&&$.cookie("JsLog")=="1");},debug:function(c){if(this.isEnabled()){log4javascript.getLogger().debug(c);}},trace:function(c){if(this.isEnabled()){log4javascript.getLogger().trace(c);}},info:function(c){if(this.isEnabled()){log4javascript.getLogger().info(c);}},warn:function(c){if(this.isEnabled()){log4javascript.getLogger().warn(c);}},error:function(c){if(this.isEnabled()){log4javascript.getLogger().error(c);}},fatal:function(c){if(this.isEnabled()){log4javascript.getLogger().fatal(c);}}};SB.framework.RequestType={HTML:0,JSON:1,XML:2,SCRIPT:3};SB.framework.RequestMethod={GET:0,POST:1};SB.framework.ConnectionManager=function(c){this.url=(!SB.framework.Utility.isNullOrEmpty(c))?c:"";this.method=SB.framework.RequestMethod.POST;this.data="sportingbet";this.requestType=SB.framework.RequestType.HTML;this.contentType="application/x-www-form-urlencoded";this.successHandler="";this.errorHandler="";this.timeout="300000";this.timeoutHandler="";this.useCached=false;this.isAsync=true;this._className="SB.framework.ConnectionManager";};SB.framework.ConnectionManager.prototype.defaultSuccessHandler=function(c,d){if(SB.framework.Utility.isNullOrEmpty(d.successHandler)){}else{d.successHandler(c);}};SB.framework.ConnectionManager.prototype.defaultErrorHandler=function(e,k,f,g){if(k=="timeout"){if(SB.framework.Utility.isNullOrEmpty(g.timeoutHandler)){var d="Timeout while executing ConnectionManager for url "+g.url;SB.framework.Logger.getInstance().fatal(d);}else{g.timeoutHandler(e,k,f);}}else{if(!SB.framework.Utility.isNullOrEmpty(g.errorHandler)){g.errorHandler(e,k,f);}else{if(e.readyState==4&&(e.status==404||e.status==500)){g.displayServerError(e.status,e.responseText);}else{var c="Error while executing ConnectionManager for url "+g.url;c+="\nError returned from server "+e.responseText;c+="\nError category "+k;}}}};SB.framework.ConnectionManager.prototype.processSuccessResponse=function(c,d){d.defaultSuccessHandler(c,d);};SB.framework.ConnectionManager.prototype.connectToServer=function(){var c=this;$.ajax({dataType:this.requestType,async:this.isAsync,url:this.url,data:this.data,type:this.method,contentType:this.contentType,beforeSend:function(d){d.setRequestHeader("SB-Request-Source","ConnectionManager");},success:function(d){c.processSuccessResponse(d,c);},error:function(d,f,e){c.defaultErrorHandler(d,f,e,c);},timeout:this.timeout,cache:this.useCached});};SB.framework.ConnectionManager.prototype.setRequestMethodString=function(){switch(this.method){case SB.framework.RequestMethod.GET:this.method="GET";break;case SB.framework.RequestMethod.POST:this.method="POST";break;}};SB.framework.ConnectionManager.prototype.setRequestAndContentType=function(){switch(this.requestType){case SB.framework.RequestType.HTML:this.requestType="html";this.contentType="application/x-www-form-urlencoded";break;case SB.framework.RequestType.SCRIPT:this.requestType="script";this.contentType="application/x-www-form-urlencoded";break;default:var c=new Error();c.source=this._className+".setRequestAndContentType";c.message=this._className+".execute called with wrong requestType ("+this.requestType+")";throw c;}};SB.framework.ConnectionManager.prototype.execute=function(){if(SB.framework.Utility.isNullOrEmpty(this.url)){SB.framework.Logger.getInstance().fatal(this._className+": url is not set before executing!!!");var c=new Error();c.source=this._className+".execute";c.message=this._className+": url is not set before executing!!!";throw c;}this.setRequestAndContentType();this.setRequestMethodString();this.connectToServer();};SB.framework.ConnectionManager.prototype.displayServerError=function(d,c){alert(c);};SB.framework.JsonConnectionManager=function(c){SB.framework.ConnectionManager.call(this,c);this._className="SB.framework.JsonConnectionManager";this.requestType="json";this.contentType="application/json; charset=utf-8";};SB.framework.JsonConnectionManager.prototype=new SB.framework.ConnectionManager();SB.framework.JsonConnectionManager.prototype.constructor=SB.framework.JsonConnectionManager;SB.framework.JsonConnectionManager.prototype.parseJsonResponse=function(c){if(typeof(c.d)!="undefined"){return c.d;}};SB.framework.JsonConnectionManager.prototype.processSuccessResponse=function(c,d){var e=c;e=d.parseJsonResponse(c);d.defaultSuccessHandler(e,d);};SB.framework.JsonConnectionManager.prototype.setRequestAndContentType=function(){if(this.requestType!="json"){var c=new Error();c.source=this._className+".execute";c.message=this._className+".execute called with wrong requestType ("+this.requestType+")";throw c;}};SB.framework.XmlConnectionManager=function(c){SB.framework.ConnectionManager.call(this,c);this._className="SB.framework.XmlConnectionManager";this.requestType="xml";this.contentType="application/x-www-form-urlencoded";};SB.framework.XmlConnectionManager.prototype=new SB.framework.ConnectionManager();SB.framework.XmlConnectionManager.prototype.constructor=SB.framework.XmlConnectionManager;SB.framework.XmlConnectionManager.prototype.parseXmlResponse=function(e){if($.browser.msie){var c=e.getElementsByTagName("string");if(c.length>0){return c[0].text;}}else{if(e.contentType=="text/xml"){return e.documentElement.firstChild.nodeValue;}}var d=new Error();d.source=this._className+".parseXmlResponse";d.message="Missing <string> root node from response XML";throw d;};SB.framework.XmlConnectionManager.prototype.processSuccessResponse=function(c,d){var e=c;e=d.parseXmlResponse(c);d.defaultSuccessHandler(e,d);};SB.framework.XmlConnectionManager.prototype.setRequestAndContentType=function(){if(this.requestType!="xml"){var c=new Error();c.source=this._className+".execute";c.message=this._className+".execute called with wrong requestType ("+this.requestType+")";throw c;}};SB.framework.CreateConnectionManager=function(d,c){switch(c){case SB.framework.RequestType.JSON:return new SB.framework.JsonConnectionManager(d);case SB.framework.RequestType.XML:return new SB.framework.XmlConnectionManager(d);default:return new SB.framework.ConnectionManager(d);}};SB.framework.ConnectionManagerFactory=function(d,c){if(this==SB.framework){return SB.framework.CreateConnectionManager(d,c);}else{this.baseUrl=d;this.requestType=c;}};SB.framework.ConnectionManagerFactory.prototype.create=function(d,c){var e=this.baseUrl+d;return SB.framework.CreateConnectionManager(e,(c!=null?c:this.requestType));};if(typeof SB=="undefined"){var SB=new Object();}if(typeof SB.ui=="undefined"){SB.ui=new Object();}Number.prototype.toFixed=function(c){return toFixed(c,".");};Number.prototype.toFixed=function(d,k){var g=Math.pow(10,d||0);var c=String(Math.round(this*g)/g);var e=c.indexOf(".");if(e>-1){var l=d-(c.length-e)+1;for(var f=0;f<l;f++){c+="0";}}else{if(k!=""){c+=".00";}}return c;};SB.ui.FormattingUtil=function(d,c){this.currencyFormat=d;this.currencyCode=c;};SB.ui.FormattingUtil.prototype.formatNumeric=function(d){var c=0;if((d!="")&&(!isNaN(d))){c=parseFloat(d);}var e=this.createNfi(this.currencyFormat);if(e.decimalDigits>0){c=(c!=0?c.toFixed(e.decimalDigits,e.decimalSeparator):0);}else{c=(c!=0?parseInt(c):0);}return c;};SB.ui.FormattingUtil.prototype.formatCurrency=function(c){if(isNaN(c)){return c;}else{return this.formatCurrencyWithoutCode(c)+" "+this.currencyCode;}};SB.ui.FormattingUtil.prototype.formatCurrencyWithoutCode=function(f){if(isNaN(f)){return"SP";}else{var m=this.createNfi(this.currencyFormat);var k=parseFloat(f).toFixed(m.decimalDigits,m.decimalSeparator);var c=k.toString();var d=c.lastIndexOf(".");var e="";if(d!=-1){var l=c.substring(0,d);var g=c.substring(d+1);if(l.length>3){e=this.addGroupSeperators(l,m)+m.decimalSeparator+g;}else{e=l+m.decimalSeparator+g;}}else{if(c.length>3){e=this.addGroupSeperators(c,m);}else{e=c;}}return e;}};SB.ui.FormattingUtil.prototype.createNfi=function(e){var d=/^\#(([,. ])(\#{2}))?([,. '])(\#{3})([,. ]?)(\#{2,3})?$/;var f=new String(e);var c=f.match(d);var g=new Object();if(c!=null){if((c[7]!=undefined)&&(c[7]!="")){g.decimalDigits=c[7].length;}else{g.decimalDigits=0;}g.decimalSeparator=c[6];g.groupSeparator=c[4];g.groupSize0=c[5].length;if((c[3]!=undefined)&&(c[3]!="")){g.groupSize1=c[3].length;}else{g.groupSize1=c[5].length;}}return g;};SB.ui.FormattingUtil.prototype.addGroupSeperators=function(k,g){var e="(-?[0-9]+)([0-9]{"+g.groupSize0+"})";var f=new RegExp(e);k=k.replace(f,"$1"+g.groupSeparator+"$2");var c=k.substr(k.length-4);var d=k.lastIndexOf(g.groupSeparator);k=k.substring(0,d);e="(-?[0-9]+)([0-9]{"+g.groupSize1+"})";f=new RegExp(e);while(f.test(k)){k=k.replace(f,"$1"+g.groupSeparator+"$2");}return k+c;};SB.EventHub={events:{},bind:function(d,e){var c=SB.EventHub.getCallBacks(d);c.push(e);},getCallBacks:function(c){if(!window.top.SB.EventHub.events[c]){window.top.SB.EventHub.events[c]=[];}return window.top.SB.EventHub.events[c];},trigger:function(c,d){try{this.triggerDirect(c,d);}catch(f){this.triggerViaIframe(c,d);}},triggerDirect:function(d,e){var c=SB.EventHub.getCallBacks(d);jQuery.each(c,function(){try{this(e);}catch(f){}});},triggerViaIframe:function(c,d){$("head").append('<iframe style="display:none;" src="http://'+window.location.host+"/modules/s/event-hub.html?event="+encodeURIComponent(c)+"&data="+encodeURIComponent(d)+'"></iframe>');}};SB.alert=function(d){var c=this;var g=$("div#alert");g.html(d);var f=SB.Mouse.lastSavedPosition.x-g.get(0).scrollWidth-20;var e=SB.Mouse.lastSavedPosition.y+$(window).scrollTop();g.css("left",f+"px").css("top",e+"px").css("visibility","visible");setTimeout(function(){g.css("visibility","hidden");},1500);};SB.AlertTimeout={};SB.Mouse={lastSavedPosition:{x:20,y:0},position:{x:20,y:0},savePosition:function(){this.lastSavedPosition=this.position;}};jQuery().mousemove(function(c){SB.Mouse.position={x:c.clientX,y:c.clientY};});$(document).ready(function(){$("select.oddsFormat").change(function(){$("form#ChangeOddsFormat").submit();});});if(typeof(SB)=="undefined"||SB==null){var SB=new Object();SB.promotions=new Object();}if(typeof(SB.promotions)=="undefined"||SB.promotions==null){SB.promotions=new Object();}SB.promotions.subscription=new Object();$(document).ready(function(){$("a.purchaseEventSubscriptionButton").click(function(){var d=$('input[type="hidden"]',this).get(0).value;var e=$('input[type="hidden"]',this).get(1).value;var c=$("#hiddenPopupUrl").val()+"?action=Confirm&eventId="+d+"&packageId="+e;SB.base.OpenDivCheckLoginStatus(c+"","popBadSelect1","popVeil1","popLayer1",true);});$("a.purchaseSubscriptionButton").click(function(){var d=$('input[type="hidden"]',this).get(0).value;var c=$("#hiddenPopupUrl").val()+"?action=Confirm&packageId="+d;SB.base.OpenDivCheckLoginStatus(c+"","popBadSelect1","popVeil1","popLayer1",true);});$("div.redirectableSubscribedButton a.subscribedButton").click(function(){var c=$('input[type="hidden"]',this).get(1).value;SB.promotions.subscription.RedirectToInplay(c);});});SB.promotions.subscription.Subscribe=function(c){var d=$("#hiddenPopupUrl").val()+"?action=Subscribe&eventId="+$("#hiddenEventId").val()+"&packageId="+$("#hiddenPackageId").val();SB.base.OpenDivCheckLoginStatus(d+"","popBadSelect1","popVeil1","popLayer1",true);};SB.promotions.subscription.RedirectToInplay=function(c){SB.base.divPopUp(1,"hide");location.href="/t/inplay/InPlay.aspx?eventId="+c;};if(typeof(SB)=="undefined"||SB==null){var SB=new Object();SB.promotions=new Object();}if(typeof(SB.promotions)=="undefined"||SB.promotions==null){SB.promotions=new Object();}SB.promotions.FreeBetVoucher=new Object();SB.promotions.FreeBetVoucher.selectFreeBetVoucher=function(f,d,e,c){if(c==null&&top.document.getElementById("inplayFlashApp")!=null){top.SB.promotions.FreeBetVoucher.selectFreeBetVoucher(f,d,e,false);}$("div#betBasket").each(function(){var k=new SB.betBasket.Basket(this);try{k.selectFreeBetVoucher(e,f,[]);}catch(g){}if(top.topNav==null){SB.base.divPopUp(1,"hide");}else{top.topNav.SB.base.divPopUp(1,"hide");}});};SB.promotions.FreeBetVoucher.initializeTooltip=function(){var c=$("#basketSlip a.freeBetsLink").not(".tooltipAdded");c.tooltip({showURL:false});c.addClass("tooltipAdded");};$.fn.uncheck=function(){this.removeAttr("checked");return this;};$.fn.check=function(){this.attr("checked","checked");return this;};$.fn.disable=function(){this.attr("disabled","disabled");return this;};$.fn.enable=function(){this.removeAttr("disabled");return this;};SB.eventBrowsing={};SB.eventBrowsing.MultiRaceTable=function(d,c){this.div=d;this.basket=c;this.setupBindings();};SB.eventBrowsing.MultiRaceTable.prototype={submit:function(){var c=this;$("form.multiRaceForm",this.div).ajaxSubmit({target:"#betBasket",beforeSubmit:function(){return c.validateForm();},success:function(e,d){c.basket.updateHtml(e,d);c.reset();}});},reset:function(){$("td.legNumber input:checkbox:checked",this.div).not(":radio").uncheck();},setupBindings:function(){this.setupAddBetButton();this.setupResetButton();},setupAddBetButton:function(){var c=this;$("div.multiRaceActions a.multiRacePlaceBet",this.div).click(function(){SB.Mouse.savePosition();c.submit();});},setupResetButton:function(){var c=this;$("div.multiRaceActions a.multiRaceReset",this.div).click(function(){c.reset();});},validateForm:function(){var c=false;$("tr.participants:first td.legNumber input:checkbox",this.div).each(function(){var e=$(this).attr("class");var f=$("input."+e+":checked").length;if(f==0){c=true;}});if(c){var d=$("#errorMessageToteMultiRace").val();alert(d);return false;}return true;}};SB.eventBrowsing.RaceCastTable=function(c,d){this.form=c;this.basket=d;this.minSelections=$("input[name=minSelections]",c).val();this.maxNumberOfSelections=parseInt($("input.maxNumberOfAnyPlaceSelections",this.Form).val());this.calculationMethod=$("input[name=calculationMethod]",c).val();this.isBound=false;this.setupBindings();};SB.eventBrowsing.RaceCastTable.prototype={setupValidationGroup:function(){this.validationGroup=new SB.eventBrowsing.ValidationGroup(this.form,this.basket,this.minSelections,SB.BetCountCalculator[this.calculationMethod],this.maxNumberOfSelections);},setupBindings:function(){if(!this.isBound){this.setupValidationGroup();this.isBound=true;}},recalculateNoOfBets:function(){this.validationGroup.recalculateNoOfBets();}};SB.eventBrowsing.ValidationGroup=function(f,g,e,d,c){this.form=f;this.basket=g;this.numberOfSelectionsNeed=e;this.betCalcalculationMethod=d;this.showHideCheckboxesForBetTypeOption();this.maxNumberOfSelectionsForAnyPlace=c;this.bindEvents();};SB.eventBrowsing.ValidationGroup.prototype={bindEvents:function(){this.setupResetButton();this.setupAddBetButton();this.setupCheckBoxEvents();this.setupBetTypeOptions();this.recalculateNoOfBets();},submit:function(){var c=this;$(this.form).ajaxSubmit({target:"#betBasket",beforeSubmit:function(){return c.validateForm();},success:function(e,d){c.basket.updateHtml(e,d);c.reset();}});},reset:function(){$(":checkbox:checked",this.form).not(":radio").uncheck();$(".numberOfBets",this.form).html("0");},validateForm:function(){var c=this;var e=$(":checkbox:checked",this.form);if(e.length==0){return false;}var d=this.getErrorMessage();if(this.isNotValidForBanker()){alert(d);return false;}if(e.length>0&&e.length<c.numberOfSelectionsNeed){alert(d);return false;}if(c.maxNumberOfSelectionsForAnyPlace>=0&&e.length>c.maxNumberOfSelectionsForAnyPlace){alert(d);return false;}return true;},getErrorMessage:function(){if(this.isInBankerMode()){return $("input.validationBankerErrorMessage",this.form).val();}return $("input.validationErrorMessage",this.form).val();},isNotValidForBanker:function(c){if(!this.isInBankerMode()){return false;}var d=$("input.placed:checked",this.form).length;return(d==0);},setupResetButton:function(){var c=this;$("a.resetTable",this.form).click(function(){c.reset();});},setupAddBetButton:function(){var c=this;$("a.addBet",this.form).click(function(){SB.Mouse.savePosition();c.submit();});},setupCheckBoxEvents:function(){var c=this;$(":checkbox",c.form).click(function(){var d=$(this);c.onlyOneSelectionPerRowFor(d);c.onlyOneSelectionPerLegFor(d);c.recalculateNoOfBets();});},setupBetTypeOptions:function(){var d=this;var c=$(":radio",d.form);if(c.length==1){c.parent().hide();return;}$(":radio",d.form).click(function(){d.showHideCheckboxesForBetTypeOption();});},disableNonRunners:function(){$("tr.nonRunner :checkbox",this.form).disable();},showHideCheckboxesForBetTypeOption:function(){var c=$(":radio:checked",this.form).val();$(":checkbox",this.form).not("."+c).disable().uncheck();$("input."+c,this.form).enable();this.disableNonRunners();this.recalculateNoOfBets();},onlyOneSelectionPerLegFor:function(d){if(d.hasClass("any-place")){return;}var c=d.attr("name");$(":checkbox[name="+c+"]",this.form).not(d).uncheck();},onlyOneSelectionPerRowFor:function(d){var c=d.parents("tr").find(":checkbox");c.not(d).uncheck();},calculateNumberOfBets:function(){var d=$("input.placed:checked",this.form).length;if(d==this.numberOfSelectionsNeed){return 1;}var c=$("input.any-place:checked",this.form).length;if(this.isInBankerMode()){if(d==0){return 0;}return this.betCalcalculationMethod(c,this.numberOfSelectionsNeed-1);}return this.betCalcalculationMethod(c,this.numberOfSelectionsNeed);},isInBankerMode:function(){return $(":radio:checked",this.form).val()=="BANKER";},recalculateNoOfBets:function(){var c=this.calculateNumberOfBets();$(".numberOfBets",this.form).text(c);}};SB.BetCountCalculator={permutation:function(c,f){if(c<f){return 0;}var e=1;for(var d=c;d>(c-f);d--){e*=d;}return e;},combination:function(c,d){if(c<d){return 0;}if(c==d){return 1;}return SB.BetCountCalculator.permutation(c,d)/d;}};SB.eventBrowsing.ToteMultipleDialog=function(c,d){this.intSelectedLeg=1;if(d){this.intSelectedLeg=d;}this.intNumLegs=null;this.multipleTableSelector=c;this.columnsPerLeg=3;this.initialize();return this;};SB.eventBrowsing.ToteMultipleDialog.prototype={initialize:function(){this.table=$(this.multipleTableSelector);this.intNumLegs=$("tr.header td",this.table).size()/this.columnsPerLeg;this.ammendHeaderRows(this.table);this.registerEventHandlers(this.table);this.showLeg(this.intSelectedLeg,this.table);this.bindArrowNavigation(this.table);},rebind:function(){this.initialize();},ammendHeaderRows:function(c){$("tr.titleRow:first td:first",c).remove();$("tr.titleRow:last td:last",c).remove();},applyStyling:function(c){$("tr td.lastColumn ",c).removeClass("lastColumn");$("tr td:last-child",c).addClass("lastColumn");$("tr td.lastRow",c).removeClass("lastRow");$("tr:last-child td",c).addClass("lastRow");},registerEventHandlers:function(e){var d=null;var c=this;$("input",e).click(function(){d=($(this).parent().parent().children().index($(this).parent())+1)/c.columnsPerLeg;c.showLeg(d,e);});$("tr.header td.legNumber",e).click(function(){var f=parseInt($(":hidden",this).val());c.showLeg(f,e);});},bindArrowNavigation:function(d){var c=this;$("a.moveLeft",d).each(function(e,f){$(f).click(function(){if(e>0){c.showLeg(e,d);}return false;});});$("a.moveRight",d).each(function(e,f){$(f).click(function(){if(e<c.intNumLegs-1){c.showLeg(e+2,d);}return false;});});},selectHeaderByLeg:function(d,e){$("tr.titleRow",d).hide();var c=$("tr.titleRow:eq("+(e-1)+")",d).show();var f=$("td:eq(0)",c);if(e>1){f.attr("colSpan",(e-1));}},showLeg:function(k,e){var d=this;this.intSelectedLeg=k;var f=(k*this.columnsPerLeg-1)-3;var g=k*this.columnsPerLeg-1;var c=$("tbody tr",e).not("tr.titleRow");c.each(function(l){$(this).children().each(function(m){if((m<f||m>g)&&!((m+1)%d.columnsPerLeg==0)){$(this).hide();}else{$(this).show();}isUnderHeaderWindow=m>f&&m<g+1;if(isUnderHeaderWindow&&l==0){$(this).addClass("activeHeader");}else{if(isUnderHeaderWindow&&l>0){$(this).addClass("active");}else{$(this).removeClass("active");$(this).removeClass("activeHeader");}}});});this.selectHeaderByLeg(e,k);this.applyStyling(e);this.showHideNavigationArrows(e,k);},showHideNavigationArrows:function(d,c){if(c==1){this.hideLeftArrow(d);this.showRightArrow(d);}else{if(c==this.intNumLegs){this.hideRightArrow(d);this.showLeftArrow(d);}else{this.showLeftArrow(d);this.showRightArrow(d);}}},hideLeftArrow:function(c){$("a.moveLeft img",c).hide();},showLeftArrow:function(c){$("a.moveLeft img",c).show();},hideRightArrow:function(c){$("a.moveRight img",c).hide();},showRightArrow:function(c){$("a.moveRight img",c).show();}};$("#frmCountries").ready(function(){$("#countriesList").change(function(){var d=$("#countriesList > option:selected").attr("value");var e=$("#countriesList");var c=$("option",e);if(d=="All"){location.reload();}else{c.each(function(){$("#"+$(this).val()).hide();});}$("#"+d).show();});});$.ajaxSetup({cache:false});SB.eventBrowsing.CouponTemplateController=function(c){this.parentDiv=c;this.couponUrl=null;this.eventGroups=[];this.layoutController=null;this.loadParameters();this.bindCoupons();this.setupEventFilters();this.bindHeartbeat();};SB.eventBrowsing.CouponTemplateController.prototype={bindCoupons:function(){var d=this;d.layoutController=new SB.eventBrowsing.Layouts(d.parentDiv);d.parentDiv.find("#eventGroups div.eventGroup").each(function(){var f=new SB.eventBrowsing.EventGroup($(this),d);d.eventGroups.push(f);});var e=this.getAutoLoadingEventGroups();if(e.length==0){d.layoutController.setupPageLoadBindings();}else{for(var c=0;c<e.length;c++){e[c].load();}}},setupEventFilters:function(){var c=this;$("#templateFilters #evtGroup").unbind().change(function(){var d=c.getAutoLoadingEventGroups();var f=d.length==1?d[0]:d[1];var e=this.options[this.selectedIndex];c.processCoupon(f,null,e.value);f.setData(e.value,e.text);});},getAutoLoadingEventGroups:function(){var c=[];for(var d=0;d<this.eventGroups.length;d++){var e=this.eventGroups[d];if(e.isAutoLoading){c.push(e);}}return c;},processCoupon:function(e,d,c){if(d==null){d=this.createParameters();}d.eventTimeGroup=c;this.loadCoupon(this.couponUrl,d,e);},loadCoupon:function(c,f,e){if(c==null||c==""){return;}var d={type:"GET",dataType:"html",async:false,cache:true,url:c,data:f,timeout:45000,success:function(g){if(g.substr(0,5)=="ERROR"){document.location=g.substr(6,g.length-6);}else{e.afterLoading(g);}},error:function(){e.hideProgress();}};e.beforeLoading();jQuery.ajax(d);},loadParameters:function(){this.paramContainer=this.parentDiv.find("#couponTemplate-params");this.couponUrl=this.paramContainer.find("#displayCouponUrl").val();if(this.couponUrl=="undefined"){throw"couponUrl is empty!";}},createParameters:function(){var l=this;var g=$("#action",this.paramContainer).val();var e=$("#sportIds",this.paramContainer).val();var d=$("#marketTypeId",this.paramContainer).val();var c=$("#eventId",this.paramContainer).val();var o=$("#bookId",this.paramContainer).val();var q=$("#eventClassId",l.paramContainer).val();var m=$("#sportId",this.paramContainer).val();var f=$("#oddsFormat",this.paramContainer).val();var k={couponAction:g,sportIds:e,marketTypeId:d,eventId:c,bookId:o,eventClassId:q,sportId:m,oddsFormat:f,eventTimeGroup:null};return k;},bindHeartbeat:function(){var c=this;$.doTimeout("couponHeartbeat",false);$.doTimeout("couponHeartbeat",1000,function(){var d=c.parentDiv.find('div.eventGroup:has(input[name="hasInplayEvents"])');if(d.length>0){c.onHeartbeat(d);}return true;});},onHeartbeat:function(c){this.layoutController.doEventCountUp(c);}};$(window).ready(function(){var c=$("div.templateContainer");c.each(function(){new SB.eventBrowsing.CouponTemplateController($(this));});if(c.length>1){$("#markettypes").hide();}});SB.eventBrowsing.Layouts=function(c){this.parentDiv=c;};SB.eventBrowsing.Layouts.prototype={setupMediaCoverage:function(c){$("div.mediaCoverageButton",c).each(function(){var d=$(this);var e=$("div.mediaCoveragePopup",this);e.css("left",(-e.width()/2));e.css("top",(-e.height()/2));d.hover(function(){e.css("visibility","visible");},function(){e.css("visibility","hidden");});});},setupStatsButton:function(c){$("a.matchStatsButton",c).each(function(){var e=$(this);var d=$('input[type="hidden"]',e).val();if(d!=null){e.click(function(){window.open(d,"stats");});}});},setupBetButtons:function(e){var d=$("#betBasket").get(0).basket;try{$("a.addBetButton",e).unbind().each(function(){new SB.betBasket.AddButton(this,d);});}catch(c){}},setupEventClassSelector:function(){$("#eventClassSelector").change(function(){document.location.href=this.value;});},setupOddsFormatSelector:function(){$("#oddsFormat").change(function(){$("#ChangeOddsFormat").submit();});},setupPageLoadBindings:function(){this.setupEventClassSelector();this.setupEventLoadBindings();},setupEventLoadBindings:function(){var c=this;$("div.event",c.parentDiv).each(function(){c.setupEventRowBindings(this);});},setupEventRowBindings:function(c){this.setupMediaCoverage(c);this.setupStatsButton(c);this.setupBetButtons(c);this.setupOtbs(c);},setupSorters:function(d){var c=this;$("div.couponHeader div.sortable div.sorter",d).each(function(){$(this).unbind().click(function(){c.sortCoupon(d,$(this));});});},doEventCountUp:function(d){var c=this;$("div.event div.ElapsedTime",d).each(function(){var l=$(this);var q=$("span",l).text();if(q!=""){var f=new Number(q.split(":")[0]);var o=new Number(q.split(":")[1]);var k=(f*60)+o+1;var m=Math.floor(k/60);var g=k-(m*60);var e=c.formatTime(m)+":"+c.formatTime(g);l.find("span").html(e);}});},formatTime:function(c){if(c<10){return"0"+String(c);}else{return String(c);}},sortCoupon:function(g,k){var e=[];var m="asc";if(k.hasClass("asc")){m="desc";}$("div.couponHeader div.sorter",g).removeClass("asc").removeClass("desc");k.addClass(m);var d=k.find("input.sortingBy").val();$("div.event",g).each(function(){var o=$(this).clone();var q=o.find("div."+d).find("input.decValue").val();e.push({html:o,value:q});});var c=this.internalSortEvents(e,m);var l=g.find("div.couponEvents");l.unbind().html("");for(var f=0;f<c.length;f++){l.append(c[f].html);}this.setupPageLoadBindings();},internalSortEvents:function(d,e){if(d==null||d.length==0){return[];}var c=this;var f=e=="asc"?c.sortAsc:c.sortDesc;return d.sort(f);},sortAsc:function(d,c){return d.value-c.value;},sortDesc:function(d,c){return c.value-d.value;},setupOtbs:function(c){$("div.selections",c).each(function(){var e=this;var g=$("div.market",e);var d=$("div.usa",e);if(d.length<3&&d.length>0){for(var f=0;f<3-d.length;f++){g.append("<div class='usa'>OTB<br/></div>");}}});}};SB.eventBrowsing.Layouts.WebRacingBook=function(){var c=$("#betBasket").get(0).basket;SB.betBasket.SetupForecastTables(c);SB.betBasket.SetupRaceCastTables(c);};SB.eventBrowsing.Layouts.initializeOverUnderCoupon=function(d){var c=$("#"+d);if(c.length>0){c.find("div.selections").each(function(){var f=$(this);var k=false;var g=false;var e=f.find("div.overUnderMarketCell");if(e.length>3){if(!$(e[0]).hasClass("start-book")){k=true;}if(!$(e[3]).hasClass("start-book")){g=true;}}f.find("div.backButton").css("display",k?"block":"none");f.find("div.forwardButton").css("display",g?"block":"none");});}};SB.eventBrowsing.Layouts.scrollBack=function(e){var f=$(e).parent("div.selections");var d=f.find("div.overUnderMarketCell");var g=false;if(d.length>3){var c=$(d[0]);var k=$(d[d.length-1]);if(!c.hasClass("start-book")){k.remove();f.prepend(k);$(e).show();if(k.hasClass("start-book")){g=true;}}else{g=true;}if(g){$(e).hide();}f.find("div.forwardButton").show();var l="OUSP_"+f.attr("id");$.cookie(l,$(f.find("div.overUnderMarketCell")[0]).attr("id"));SB.eventBrowsing.Layouts.deleteUnusedScrollPositionCookies(l);}return false;};SB.eventBrowsing.Layouts.scrollForward=function(e){var f=$(e).parent("div.selections");var d=f.find("div.overUnderMarketCell");var g=false;if(d.length>3){var c=$(d[3]);var k=$(d[0]);if(!c.hasClass("start-book")){k.remove();f.append(k);$(e).show();if($(f.find("div.overUnderMarketCell")[3]).hasClass("start-book")){g=true;}}else{g=true;}if(g){$(e).hide();}f.find("div.backButton").show();var l="OUSP_"+f.attr("id");$.cookie(l,$(f.find("div.overUnderMarketCell")[0]).attr("id"));SB.eventBrowsing.Layouts.deleteUnusedScrollPositionCookies(l);}return false;};SB.eventBrowsing.Layouts.deleteUnusedScrollPositionCookies=function(g){if(document.cookie&&document.cookie!=""){var f=document.cookie.split(";");for(var e=0;e<f.length;e++){var c=f[e].split("=");var k=c[0].replace(/^ /,"");if(k!=g&&k.substr(0,5)=="OUSP_"){var d=k.substr(5);if($("#"+d).length==0){$.cookie(k,null);}}}}};SB.eventBrowsing.Layouts.initializeScoreCastSelector=function(d,f){var c=$("#"+d);var e=c.find("select.goalScorers");e.unbind().change(function(){var g=this.options[this.selectedIndex];SB.eventBrowsing.Layouts.goalScorerSelected(g,c,f);});};SB.eventBrowsing.Layouts.goalScorerSelected=function(f,c,g){if(!f.value||f.value==""){var e=c.find("select.correctScores");e.find(".first")[0].selected=true;e.change();e.unbind().hide();c.find("div.odds").hide();c.find("div.odds:first").show();return;}var d={type:"GET",dataType:"html",cache:true,url:"/ScoreCastTemplate.mvc/GetCorrectScore",data:{key:f.value,source:g},timeout:45000,success:function(k){var l=c.find("select.correctScores");l.find(".first")[0].selected=true;l.change();c.find("div.correctScore, div.correctScoreOdds").remove();c.append($(k));l=c.find("select.correctScores");l.show();l.unbind().change(function(){SB.eventBrowsing.Layouts.correctScoreSelected(this.options[this.selectedIndex],c);});c.find("div.odds:first").show();new SB.eventBrowsing.Layouts(c).setupBetButtons(c);new SB.diffusion.PriceUpdater().onScorecastCorrectScoreChange(false);},error:function(){var k=c.find("select.correctScores");k.find(".first")[0].selected=true;k.change();k.unbind().hide();c.find("div.odds").hide();c.find("div.odds:first").show();}};jQuery.ajax(d);};SB.eventBrowsing.Layouts.correctScoreSelected=function(e,c){var d;c.find("div.odds").hide();if(!e.value||e.value==""){d=c.find("div.odds:first");}else{d=c.find("div."+e.value);if(d.length==0){d=c.find("div.odds:first");}}d.show();};SB.eventBrowsing.EventGroup=function(d,c){this.parentDiv=d;this.controller=c;this.isAutoLoading=false;this.key=null;this.isLoaded=false;this.header=null;this.events=null;this.setup();};SB.eventBrowsing.EventGroup.prototype={setup:function(){this.header=this.parentDiv;this.events=$("div.coupon-events",this.parentDiv);this.isAutoLoading=this.header.find('input[name="isAutoLoading"]').val()=="True";this.key=this.header.find('input[name="groupKey"]').val();this.setupHeader();},setupHeader:function(){var c=this;var d=$("a.OpenCloseLabel",c.parentDiv);c.header.find("div.eventGroupHeader:not(.disabled)").unbind().click(function(){if(!c.isLoaded){c.load();$(d[0]).text("[-] Close");}else{if(c.isClosed()){c.open();$(d[0]).text("[-] Close");}else{c.close();$(d[0]).text("[+] Open");}}return false;});},setupToolTip:function(){this.events.find("a.Helpquestion").hover(function(c){var d=$(".helpText",$(this).parent()).text();HelpTip.Show(this,d,c);},function(){HelpTip.Hide(this);});},load:function(){this.clear();this.controller.processCoupon(this,null,this.key);this.open();},beforeLoading:function(){this.isLoaded=false;this.clear();this.showProgress();},afterLoading:function(c){this.isLoaded=true;this.hideProgress();this.displayCouponSuccessHandler(c);if(this.isClosed()){this.open();}this.setupToolTip();new SB.diffusion.PriceUpdater().resubscribeDiffusion();},isClosed:function(){return this.events.css("display")=="none";},clear:function(){this.events.html("");},open:function(){this.events.show();this.header.addClass("selected");return false;},close:function(){this.events.hide();this.header.removeClass("selected");return false;},setData:function(c,d){this.parentDiv.find(".groupName")[0].innerHTML=d;this.header.find('input[name="groupKey"]').val(c);this.key=c;},displayCouponSuccessHandler:function(c){this.events.unbind();this.updateCoupon(c);this.controller.layoutController.setupPageLoadBindings();this.controller.layoutController.setupSorters(this.events);},updateCoupon:function(c){this.events.html(c);},showProgress:function(){this.parentDiv.find("div.processing").show();},hideProgress:function(){this.parentDiv.find("div.processing").hide();}};if(typeof SB=="undefined"){var SB={};}if(typeof SB.results=="undefined"){SB.results={};}SB.results.viewData=function(c,e,d){this.name=c;this.id=e;this.type=d;this.endDate=undefined;this.children=[];};SB.results.viewData.prototype={addChild:function(c){this.children=this.children.concat(c);},hasChildren:function(){var c=(typeof this.children!="undefined");if(c){c=this.children.length>0;}return c;}};SB.results.searchCriteria=function(f,c,g,e,d){this.siteId=f;this.sportId=c;this.endDateUtc=g;this.duration=e;this.isTodayIncluded=(d==g);};SB.results.marketViewData=function(c,f,e,d){this.name=c;this.id=f;this.type="market";this.subType=e;this.resultArray=d;};SB.results.marketViewData.prototype=new SB.results.viewData();SB.results.marketViewData.prototype.constructor=SB.results.marketViewData;SB.results.marketViewData.prototype.baseClass=SB.results.viewData.prototype.constructor;SB.results.position=function(c,d){this.position=c;this.name=d;};SB.results.resultUI=function(e,k,d,g,c,l){this.resultId=e;this.dateFromId=k;this.dateToId=d;this.fromToTimePeriodId=g;var f=this.convertToUtc(new Date());this.todayUtc=new Date(f.getFullYear(),f.getMonth(),f.getDate());f=new Date();this.today=new Date(f.getFullYear(),f.getMonth(),f.getDate());this.timeZoneOffsetInMilliseconds=(new Date()).getTimezoneOffset()*-1*60*1000;this.maxCalendarIntervalInDays=c;this.minCalendarDateInDays=l;};SB.results.resultUI.prototype={hideErrorMessage:function(c){jQuery(c).empty();},showErrorMessage:function(c,d){this.hideErrorMessage(d);var e=jQuery("<div id='commonErrMsg' class='errormsg'><div class='errorheader'><span>Error</span></div><span id='errorStr' class='error'></span></div>");jQuery(d).append(e);e.children("span").remove();e.append(jQuery(c).clone());},showDropDown:function(c,e,d){if(d){jQuery(c).children("option").remove();}jQuery.each(e,function(f,g){jQuery(c).append(jQuery("<option></option>").attr("value",g.id).text(g.name));});},InitialiseIntervalDatePickers:function(k,f,g,d){var c=this;var e=function(){if(f!=undefined){f();}var l=jQuery("#dtpFrom").datepicker("getDate");var m=new Date(l);m.setDate(m.getDate()+c.maxCalendarIntervalInDays-1);if(m>resultUI.today){m=resultUI.today;}jQuery("#dtpTo").datepicker("enable");jQuery("#dtpTo").datepicker("option","minDate",l);jQuery("#dtpTo").datepicker("option","maxDate",m);jQuery("#dtpTo").datepicker("setDate",m);};jQuery(k).datepicker({showOn:"button",buttonImage:"/modules/s/images/calendar.gif",buttonImageOnly:true,maxDate:c.today,minDate:(-1*c.minCalendarDateInDays+1)+"d",disabled:false,dateFormat:"dd/mm/yy",onSelect:e});jQuery(g).datepicker({showOn:"button",buttonImage:"/modules/s/images/calendar.gif",buttonImageOnly:true,maxDate:c.today,minDate:(-1*c.minCalendarDateInDays+1)+"d",disabled:true,dateFormat:"dd/mm/yy",onSelect:d});},setupSearchCriteria:function(e,c,f,d){this.criteria=new SB.results.searchCriteria(e,c,f,d,this.todayUtc);},clearSearchCriteria:function(f,d,c,e){this.criteria=undefined;},removeResults:function(){jQuery(this.resultId).empty();},showResults:function(f){var e=function(k,g){jQuery.each(k,function(l,m){var q=jQuery("<li></li>").attr("data-toggle","box");q.append(jQuery("<h4></h4>").html(m.name).attr("class","innerHeader").attr("data-toggle","head"));var o=jQuery("<li></li>");q.append(jQuery("<ul></ul>").attr("data-toggle","body").append(o));if(m.hasChildren()){d(m.children,o);}g.append(q);});};var d=function(l,g){var k=jQuery("<ul></ul>").attr("class","groups");e(l,k);g.append(k);};this.removeResults();var c=jQuery(this.resultId);d(f,c);},convertMarketData:function(d){var c=this;var e=[];var f;if(d.type=="WINLOSE"){f="WinLoseResult";jQuery.each(d.selections,function(g,k){var l;if(k.band!=null){l="("+k.band.lower+")";if(k.band.lower!=k.band.upper){l=l+" - ("+k.band.upper+")";}}else{l=c.escapeText(k.name);if(k.handicap!=0){l=l+" ("+k.handicap+")";}}e=e.concat(l);});}else{if(d.type=="FINISHING_ORDER"){f="finishingOrder";jQuery.each(d.selections,function(g,l){if(l.position!=0){var k=new SB.results.position(l.position,c.escapeText(l.name));e=e.concat(k);}});}}return new SB.results.marketViewData(d.name,d.id,f,e);},escapeText:function(c){return jQuery("<div></div>").text(c).html();},convertToViewData:function(c,g,e){var d=this;var k=function(m){var l;if(m.indexOf("Date(")>0){l=m.replace("/Date(","").replace(")","").split("+")[0]*1;}else{l=m*1;}return new Date(l+d.timeZoneOffsetInMilliseconds);};var f=function(l,o,m){jQuery.each(l,function(q,r){var s=new SB.results.viewData(d.escapeText(r.name),r.id,m);if(m=="event"){s.endDate=k(r["end-date"].toString());}if(m=="market"){s=d.convertMarketData(r);}if(s!=null){o.addChild(s);}if(null!=r.folder){f(r.folder,s,m);}});};f(c,g,e);},getElementById:function(d,g){var c=null;for(var e=0;e<d.length;++e){var f=d[e];if(f.id==g){c=f;break;}}return c;},mergeViewData:function(g,f){if(f.children!=undefined){for(var d=0;d<f.children.length;++d){var e=f.children[d];var c=this.getElementById(g.children,e.id);if(c!=null){this.mergeViewData(c,e);}else{g.addChild(e);}}}},toIsoLikeString:function(c){var d=function(f){var e=""+f;if(f<=9){e="0"+e;}return e;};return c.getFullYear()+"-"+(d(c.getMonth()+1))+"-"+d(c.getDate())+"T"+d(c.getHours())+":"+d(c.getMinutes())+":"+d(c.getSeconds());},stringToDateTime:function(e){var d=e.split("T")[0].split("-");var c=e.split("T")[1].split(":");return new Date(d[0],(1*d[1])-1,d[2],c[0],c[1],0);},formatDateTime:function(g,k){var c;var e=function(m){var o=function(r){var q=""+r;if(r<=9){q="0"+q;}return q;};return m.getFullYear()+"-"+(o(m.getMonth()+1))+"-"+o(m.getDate())+"T"+o(m.getHours())+":"+o(m.getMinutes())+":"+o(m.getSeconds());};var l=e(g).split("T");var d=l[0].split("-");if(k){c=d[2]+d[1]+d[0];}else{var f=l[1].split(":");c=d[2]+"/"+d[1]+"/"+d[0]+" "+f[0]+":"+f[1];}return c;},isTodayDate:function(d){var c=false;if((d.getDay()==this.today.getDay())&&(d.getMonth()==this.today.getMonth())&&(d.getFullYear()==this.today.getFullYear())){c=true;}return c;},convertToUtc:function(c){return new Date(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate(),c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds());},getUrlArray:function(f,k,m,l){var d=[];var c=f;var g=l;var e;if(this.isTodayDate(f)){if(l>0){e=k+this.formatDateTime(f,true)+m+"0";d=d.concat(e);g--;c=new Date(c.getTime()-1*(24*60*60*1000));}}e=k+this.formatDateTime(c,true)+m+g;d=d.concat(e);return d;},callJsonUrlArray:function(e,d,k,c){var f=this;var l=function(o){var m;switch(o){case"folders":m="folder";break;case"sports":m="sport";break;case"events":m="event";break;case"markets":m="market";break;}return m;};var g=function(q,o,u,m,r){if(r){jQuery("body").css("cursor","progress");}if(q.length>0){var v=q[0];var s=[];jQuery.each(q,function(y,w){if(v!=w){s=s.concat(w);}});jQuery.ajax({type:"GET",url:v,dataType:"json",cache:true,error:function(){jQuery("body").css("cursor","auto");u();},success:function(w){try{jQuery.each(w,function(C,D){var B=l(C);var A=new SB.results.viewData("root","root","root");f.convertToViewData(D,A,B);if(A.hasChildren()){f.mergeViewData(o,A);}});g(s,o,u,m,false);}catch(y){jQuery("body").css("cursor","auto");u();}},complete:function(){}});}else{m(o);jQuery("body").css("cursor","auto");}};g(e,d,k,c,true);},CreateNode:function(l,y,m,r,q,E,u,B,C,v,e,w){var s="accordion-state";var g="accordionState-uncollapsable";var D=function(){var F=jQuery(this).next();var G=F.attr(s);if(G==q){F.attr("class",r);jQuery(this).attr("class",r+"Title");F.attr(s,r);if(!(typeof w==="undefined")){w(F);}}else{if(G==r){if(!(typeof e==="undefined")){e(F);}jQuery(this).attr("class",q+"Title");F.attr("class",q);F.attr(s,q);}}};var A=function(){var F=jQuery(this);F.attr("class",E+"Title");};var f=function(){var F=jQuery(this);var G=F.next().attr(s);if(g==G){F.attr("class",q+"Title");}else{F.attr("class",G+"Title");}};var k=(typeof u==="undefined")?r:u;var c=jQuery("<div></div>").attr("data-results",m).attr("class",k+"Title");var o=jQuery("<div></div>").attr("data-results",m+"Container").attr(s,k).attr("class",k);if(!(typeof v==="undefined")){c.attr("id",v);o.attr("id",v);}if(B){c.bind("click",D);if(!(typeof E==="undefined")){c.bind("mouseenter",A);c.bind("mouseleave",f);}}if(typeof y==="undefined"){l.append(c);}else{l.append(c.append(y));}if(C){var d=jQuery("<span></span>").attr("class","arrow");c.append(d);}l.append(o);},generateAccordionForResults:function(e,g,d,o,k){var f=this;var m=function(u,s,v,r){var w=jQuery("<span></span>").html(u.name);if(!u.hasChildren()){f.CreateNode(s,w,"resultsFolder","resultscollapsed","resultsexpanded","resultshovered","resultscollapsed",true,true,u.id,v,r);}else{f.CreateNode(s,w,"resultsFolder","resultscollapsed","resultsexpanded","resultshovered","resultscollapsed",true,true);var q=w.parent().next();jQuery.each(u.children,function(A,y){m(y,q,v,r);});}};var l=jQuery("<span></span>");f.CreateNode(jQuery(g),l,"resultsFolder","resultscollapsed","resultsexpanded","resultshovered","accordionState-uncollapsable",true,true);var c=l.parent().next();if(e.hasChildren()){jQuery.each(e.children,function(r,q){m(q,c,o,k);});}}};(function(c){c.extend(c.fn,{validate:function(d){if(!this.length){d&&d.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing");return;}var e=c.data(this[0],"validator");if(e){return e;}e=new c.validator(d,this[0]);c.data(this[0],"validator",e);if(e.settings.onsubmit){this.find("input, button").filter(".cancel").click(function(){e.cancelSubmit=true;});if(e.settings.submitHandler){this.find("input, button").filter(":submit").click(function(){e.submitButton=this;});}this.submit(function(f){if(e.settings.debug){f.preventDefault();}function g(){if(e.settings.submitHandler){if(e.submitButton){var k=c("<input type='hidden'/>").attr("name",e.submitButton.name).val(e.submitButton.value).appendTo(e.currentForm);}e.settings.submitHandler.call(e,e.currentForm);if(e.submitButton){k.remove();}return false;}return true;}if(e.cancelSubmit){e.cancelSubmit=false;return g();}if(e.form()){if(e.pendingRequest){e.formSubmitted=true;return false;}return g();}else{e.focusInvalid();return false;}});}return e;},valid:function(){if(c(this[0]).is("form")){return this.validate().form();}else{var e=true;var d=c(this[0].form).validate();this.each(function(){e&=d.element(this);});return e;}},removeAttrs:function(f){var d={},e=this;c.each(f.split(/\s/),function(g,k){d[k]=e.attr(k);e.removeAttr(k);});return d;},rules:function(g,d){var l=this[0];if(g){var f=c.data(l.form,"validator").settings;var o=f.rules;var q=c.validator.staticRules(l);switch(g){case"add":c.extend(q,c.validator.normalizeRule(d));o[l.name]=q;if(d.messages){f.messages[l.name]=c.extend(f.messages[l.name],d.messages);}break;case"remove":if(!d){delete o[l.name];return q;}var m={};c.each(d.split(/\s/),function(r,s){m[s]=q[s];delete q[s];});return m;}}var k=c.validator.normalizeRules(c.extend({},c.validator.metadataRules(l),c.validator.classRules(l),c.validator.attributeRules(l),c.validator.staticRules(l)),l);if(k.required){var e=k.required;delete k.required;k=c.extend({required:e},k);}return k;}});c.extend(c.expr[":"],{blank:function(d){return !c.trim(""+d.value);},filled:function(d){return !!c.trim(""+d.value);},unchecked:function(d){return !d.checked;}});c.validator=function(d,e){this.settings=c.extend(true,{},c.validator.defaults,d);this.currentForm=e;this.init();};c.validator.format=function(d,e){if(arguments.length==1){return function(){var f=c.makeArray(arguments);f.unshift(d);return c.validator.format.apply(this,f);};}if(arguments.length>2&&e.constructor!=Array){e=c.makeArray(arguments).slice(1);}if(e.constructor!=Array){e=[e];}c.each(e,function(f,g){d=d.replace(new RegExp("\\{"+f+"\\}","g"),g);});return d;};c.extend(c.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:true,errorContainer:c([]),errorLabelContainer:c([]),onsubmit:true,ignore:[],ignoreTitle:false,onfocusin:function(d){this.lastActive=d;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,d,this.settings.errorClass,this.settings.validClass);this.errorsFor(d).hide();}},onfocusout:function(d){if((!this.checkable(d)&&(d.name in this.submitted||!this.optional(d)))||this.settings.forcevalidate){this.element(d);}},onkeyup:function(d){if(d.name in this.submitted||d==this.lastElement){this.element(d);}},onclick:function(d){if(d.name in this.submitted){this.element(d);}else{if(d.parentNode.name in this.submitted){this.element(d.parentNode);}}},highlight:function(f,d,e){c(f).addClass(d).removeClass(e);},unhighlight:function(f,d,e){c(f).removeClass(d).addClass(e);}},setDefaults:function(d){c.extend(c.validator.defaults,d);},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalto:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxlength:c.validator.format("Please enter no more than {0} characters."),minlength:c.validator.format("Please enter at least {0} characters."),rangelength:c.validator.format("Please enter a value between {0} and {1} characters long."),range:c.validator.format("Please enter a value between {0} and {1}."),max:c.validator.format("Please enter a value less than or equal to {0}."),min:c.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){this.labelContainer=c(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||c(this.currentForm);this.containers=c(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var d=(this.groups={});c.each(this.settings.groups,function(g,k){c.each(k.split(/\s/),function(m,l){d[l]=g;});});var f=this.settings.rules;c.each(f,function(g,k){f[g]=c.validator.normalizeRule(k);});function e(l){var k=c.data(this[0].form,"validator"),g="on"+l.type.replace(/^validate/,"");k.settings[g]&&k.settings[g].call(k,this[0]);}c(this.currentForm).validateDelegate(":text, :password, :file, select, textarea","focusin focusout keyup",e).validateDelegate(":radio, :checkbox, select, option","click",e);if(this.settings.invalidHandler){c(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler);}},form:function(){this.checkForm();c.extend(this.submitted,this.errorMap);this.invalid=c.extend({},this.errorMap);if(!this.valid()){c(this.currentForm).triggerHandler("invalid-form",[this]);}this.showErrors();return this.valid();},checkForm:function(){this.prepareForm();for(var d=0,e=(this.currentElements=this.elements());e[d];d++){this.check(e[d]);}return this.valid();},element:function(d){return this.checkElement(d,true);},checkElement:function(e,f){e=this.clean(e);this.lastElement=e;this.prepareElement(e);this.currentElements=c(e);var d=c(e).is(this.settings.ignore)||this.check(e);if(d){delete this.invalid[e.name];}else{this.invalid[e.name]=true;}if(!this.numberOfInvalids()){this.toHide=this.toHide.add(this.containers);}if(f){this.showErrors();}return d;},showErrors:function(e){if(e){c.extend(this.errorMap,e);this.errorList=[];for(var d in e){this.errorList.push({message:e[d],element:this.findByName(d)[0]});}this.successList=c.grep(this.successList,function(f){return !(f.name in e);});}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors();},resetForm:function(){if(c.fn.resetForm){c(this.currentForm).resetForm();}this.submitted={};this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass);},excludeElement:function(d,e){d.removeClass(this.settings.errorClass);d.addClass(e);d.rules("remove");jQuery.removeData(d,"metadata");delete this.invalid[d.name];d.detachValidateDelegate(".validator");if(this.settings.success){this.showLabel(d);}},numberOfInvalids:function(){return this.objectLength(this.invalid);},objectLength:function(f){var e=0;for(var d in f){e++;}return e;},hideErrors:function(){this.addWrapper(this.toHide).hide();},valid:function(){return this.size()==0;},size:function(){return this.errorList.length;},focusInvalid:function(){if(this.settings.focusInvalid){try{c(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin");}catch(d){}}},findLastActive:function(){var d=this.lastActive;return d&&c.grep(this.errorList,function(e){return e.element.name==d.name;}).length==1&&d;},elements:function(){var f=this,d={};var e=c("[class~='forceValidate']",this.currentForm).filter(":hidden");return c(":input",this.currentForm).not(":submit, :reset, :image, [disabled], :hidden").not(this.settings.ignore).add(e).filter(function(){!this.name&&f.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in d||!f.objectLength(c(this).rules())){return false;}d[this.name]=true;return true;});},clean:function(d){return c(d)[0];},errors:function(){return c(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext);},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=c([]);this.toHide=c([]);this.currentElements=c([]);},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers);},prepareElement:function(d){this.reset();this.toHide=this.errorsFor(d);},check:function(f){f=this.clean(f);if(this.checkable(f)){f=this.findByName(f.name)[0];}var m=c(f).rules();var g=false;for(method in m){var l={method:method,parameters:m[method]};try{var d=c.validator.methods[method].call(this,f.value.replace(/\r/g,""),f,l.parameters);if(d=="dependency-mismatch"){g=true;continue;}g=false;if(d=="pending"){this.toHide=this.toHide.not(this.errorsFor(f));return;}if(!d){this.formatAndAdd(f,l);return false;}}catch(k){this.settings.debug&&window.console&&console.log("exception occured when checking element "+f.id+", check the '"+l.method+"' method",k);throw k;}}if(g){return;}if(this.objectLength(m)){this.successList.push(f);}return true;},customMetaMessage:function(d,f){if(!c.metadata){return;}var e=this.settings.meta?c(d).metadata()[this.settings.meta]:c(d).metadata();return e&&e.messages&&e.messages[f];},customMessage:function(e,f){var d=this.settings.messages[e];return d&&(d.constructor==String?d:d[f]);},findDefined:function(){for(var d=0;d<arguments.length;d++){if(arguments[d]!==undefined){return arguments[d];}}return undefined;},defaultMessage:function(d,e){return this.findDefined(this.customMetaMessage(d,e),this.customMessage(d.name,e),!this.settings.ignoreTitle&&d.title||undefined,c.validator.messages[e],"<strong>Warning: No message defined for "+d.name+"</strong>");},formatAndAdd:function(e,g){var f=this.defaultMessage(e,g.method),d=/\$?\{(\d+)\}/g;if(typeof f=="function"){f=f.call(this,g.parameters,e);}else{if(d.test(f)){f=jQuery.format(f.replace(d,"{$1}"),g.parameters);}}this.errorList.push({message:f,element:e});this.errorMap[e.name]=f;this.submitted[e.name]=f;},addWrapper:function(d){if(this.settings.wrapper){d=d.add(d.parent(this.settings.wrapper));}return d;},defaultShowErrors:function(){for(var e=0;this.errorList[e];e++){var d=this.errorList[e];this.settings.highlight&&this.settings.highlight.call(this,d.element,this.settings.errorClass,this.settings.validClass);this.showLabel(d.element,d.message);}if(this.errorList.length){this.toShow=this.toShow.add(this.containers);}if(this.settings.success){for(var e=0;this.successList[e];e++){this.showLabel(this.successList[e]);}}if(this.settings.unhighlight){for(var e=0,f=this.validElements();f[e];e++){this.settings.unhighlight.call(this,f[e],this.settings.errorClass,this.settings.validClass);}}this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show();},validElements:function(){return this.currentElements.not(this.invalidElements());},invalidElements:function(){return c(this.errorList).map(function(){return this.element;});},showLabel:function(e,f){var d=this.errorsFor(e);if(d.length){d.removeClass().addClass(this.settings.errorClass);d.attr("generated")&&d.html(f);}else{d=c("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(e),generated:true}).addClass(this.settings.errorClass).html(f||"");if(this.settings.wrapper){d=d.hide().show().wrap("<"+this.settings.wrapper+"/>").parent();}if(!this.labelContainer.append(d).length){this.settings.errorPlacement?this.settings.errorPlacement(d,c(e),f):d.insertAfter(e);}}if(!f&&this.settings.success){d.text("");typeof this.settings.success=="string"?d.addClass(this.settings.success):this.settings.success(d,c(e));}this.toShow=this.toShow.add(d);},errorsFor:function(e){var d=this.idOrName(e);return this.errors().filter(function(){return c(this).attr("for")==d;});},idOrName:function(d){return this.groups[d.name]||(this.checkable(d)?d.name:d.id||d.name);},checkable:function(d){return/radio|checkbox/i.test(d.type);},findByName:function(d){var e=this.currentForm;return c(document.getElementsByName(d)).map(function(f,g){return g.form==e&&g.name==d&&g||null;});},getLength:function(e,d){switch(d.nodeName.toLowerCase()){case"select":return c("option:selected",d).length;case"input":if(this.checkable(d)){return this.findByName(d.name).filter(":checked").length;}}return e.length;},depend:function(e,d){return this.dependTypes[typeof e]?this.dependTypes[typeof e](e,d):true;},dependTypes:{"boolean":function(e,d){return e;},string:function(e,d){return !!c(e,d.form).length;},"function":function(e,d){return e(d);}},optional:function(d){return !c.validator.methods.required.call(this,c.trim(d.value),d);},startRequest:function(d){if(!this.pending[d.name]){this.pendingRequest++;this.pending[d.name]=true;}},stopRequest:function(d,e){this.pendingRequest--;if(this.pendingRequest<0){this.pendingRequest=0;}delete this.pending[d.name];if(e&&this.pendingRequest==0&&this.formSubmitted&&this.form()){c(this.currentForm).submit();this.formSubmitted=false;}else{if(!e&&this.pendingRequest==0&&this.formSubmitted){c(this.currentForm).triggerHandler("invalid-form",[this]);this.formSubmitted=false;}}},previousValue:function(d){return c.data(d,"previousValue")||c.data(d,"previousValue",{old:null,valid:true,message:this.defaultMessage(d,"remote")});}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(d,e){d.constructor==String?this.classRuleSettings[d]=e:c.extend(this.classRuleSettings,d);},classRules:function(e){var f={};var d=c(e).attr("class");d&&c.each(d.split(" "),function(){if(this in c.validator.classRuleSettings){c.extend(f,c.validator.classRuleSettings[this]);}});return f;},attributeRules:function(e){var g={};var d=c(e);for(method in c.validator.methods){var f=d.attr(method);if(f){g[method]=f;}}if(g.maxlength&&/-1|2147483647|524288/.test(g.maxlength)){delete g.maxlength;}return g;},metadataRules:function(d){if(!c.metadata){return{};}var e=c.data(d.form,"validator").settings.meta;return e?c(d).metadata()[e]:c(d).metadata();},staticRules:function(e){var f={};var d=c.data(e.form,"validator");if(d.settings.rules){f=c.validator.normalizeRule(d.settings.rules[e.name])||{};}return f;},normalizeRules:function(e,d){c.each(e,function(k,g){if(g===false){delete e[k];return;}if(g.param||g.depends){var f=true;switch(typeof g.depends){case"string":f=!!c(g.depends,d.form).length;break;case"function":f=g.depends.call(d,d);break;}if(f){e[k]=g.param!==undefined?g.param:true;}else{delete e[k];}}});c.each(e,function(f,g){e[f]=c.isFunction(g)?g(d):g;});c.each(["minlength","maxlength","min","max"],function(){if(e[this]){e[this]=Number(e[this]);}});c.each(["rangelength","range"],function(){if(e[this]){e[this]=[Number(e[this][0]),Number(e[this][1])];}});if(c.validator.autoCreateRanges){if(e.min&&e.max){e.range=[e.min,e.max];delete e.min;delete e.max;}if(e.minlength&&e.maxlength){e.rangelength=[e.minlength,e.maxlength];delete e.minlength;delete e.maxlength;}}if(e.messages){delete e.messages;}return e;},normalizeRule:function(e){if(typeof e=="string"){var d={};c.each(e.split(/\s/),function(){d[this]=true;});e=d;}return e;},addMethod:function(d,f,e){c.validator.methods[d]=f;c.validator.messages[d]=e!=undefined?e:c.validator.messages[d];if(f.length<3){c.validator.addClassRules(d,c.validator.normalizeRule(d));}},methods:{required:function(e,d,g){if(!this.depend(g,d)){return"dependency-mismatch";}switch(d.nodeName.toLowerCase()){case"select":var f=c(d).val();return f&&f.length>0;case"input":if(this.checkable(d)){return this.getLength(e,d)>0;}default:return c.trim(e).length>0;}},remote:function(k,e,l){if(this.optional(e)){return"dependency-mismatch";}var f=this.previousValue(e);if(!this.settings.messages[e.name]){this.settings.messages[e.name]={};}f.originalMessage=this.settings.messages[e.name].remote;this.settings.messages[e.name].remote=f.message;l=typeof l=="string"&&{url:l}||l;if(f.old!==k){f.old=k;var d=this;this.startRequest(e);var g={};g[e.name]=k;c.ajax(c.extend(true,{url:l,mode:"abort",port:"validate"+e.name,dataType:"json",data:g,success:function(o){d.settings.messages[e.name].remote=f.originalMessage;var r=o===true;if(r){var m=d.formSubmitted;d.prepareElement(e);d.formSubmitted=m;d.successList.push(e);d.showErrors();}else{var s={};var q=(f.message=o||d.defaultMessage(e,"remote"));s[e.name]=c.isFunction(q)?q(k):q;d.showErrors(s);}f.valid=r;d.stopRequest(e,r);}},l));return"pending";}else{if(this.pending[e.name]){return"pending";}}return f.valid;},minlength:function(e,d,f){return this.optional(d)||this.getLength(c.trim(e),d)>=f;},maxlength:function(e,d,f){return this.optional(d)||this.getLength(c.trim(e),d)<=f;},rangelength:function(f,d,g){var e=this.getLength(c.trim(f),d);return this.optional(d)||(e>=g[0]&&e<=g[1]);},min:function(e,d,f){return this.optional(d)||e>=f;},max:function(e,d,f){return this.optional(d)||e<=f;},range:function(e,d,f){return this.optional(d)||(e>=f[0]&&e<=f[1]);},pattern:function(f,e,g){var d=new RegExp(g);return this.optional(e)||d.test(f);},email:function(e,d){return this.optional(d)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(e);},url:function(e,d){return this.optional(d)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(e);},date:function(e,d){return this.optional(d)||!/Invalid|NaN/.test(new Date(e));},dateISO:function(e,d){return this.optional(d)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(e);},number:function(e,d){return this.optional(d)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(e);},digits:function(e,d){return this.optional(d)||/^\d+$/.test(e);},creditcard:function(k,e){if(this.optional(e)){return"dependency-mismatch";}if(/[^0-9-]+/.test(k)){return false;}var l=0,g=0,d=false;k=k.replace(/\D/g,"");for(var m=k.length-1;m>=0;m--){var f=k.charAt(m);var g=parseInt(f,10);if(d){if((g*=2)>9){g-=9;}}l+=g;d=!d;}return(l%10)==0;},accept:function(e,d,f){f=typeof f=="string"?f.replace(/,/g,"|"):"png|jpe?g|gif";return this.optional(d)||e.match(new RegExp(".("+f+")$","i"));},equalto:function(e,d,g){var f=c(g).unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){c(d).valid();});return e==f.val();},notequalto:function(e,d,g){var f=c(g).unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){c(d).valid();});return e!=f.val();}}});c.format=c.validator.format;})(jQuery);(function(e){var d=e.ajax;var c={};e.ajax=function(g){g=e.extend(g,e.extend({},e.ajaxSettings,g));var f=g.port;if(g.mode=="abort"){if(c[f]){c[f].abort();}return(c[f]=d.apply(this,arguments));}return d.apply(this,arguments);};})(jQuery);(function(c){if(!jQuery.event.special.focusin&&!jQuery.event.special.focusout&&document.addEventListener){c.each({focus:"focusin",blur:"focusout"},function(e,d){c.event.special[d]={setup:function(){this.addEventListener(e,f,true);},teardown:function(){this.removeEventListener(e,f,true);},handler:function(g){arguments[0]=c.event.fix(g);arguments[0].type=d;return c.event.handle.apply(this,arguments);}};function f(g){g=c.event.fix(g);g.type=d;return c.event.handle.call(this,g);}});}c.extend(c.fn,{validateDelegate:function(f,e,d){return this.bind(e,function(g){var k=c(g.target);if(k.is(f)){return d.apply(k,arguments);}});}});c.extend(c.fn,{detachValidateDelegate:function(e,d){return this.unbind(e);}});})(jQuery);(function($){$.extend({metadata:{defaults:{type:"class",name:"metadata",cre:/({.*})/,single:"metadata"},setType:function(type,name){this.defaults.type=type;this.defaults.name=name;},get:function(elem,opts){var settings=$.extend({},this.defaults,opts);if(!settings.single.length){settings.single="metadata";}var data=$.data(elem,settings.single);if(data){return data;}data="{}";if(settings.type=="class"){var m=settings.cre.exec(elem.className);if(m){data=m[1];}}else{if(settings.type=="elem"){if(!elem.getElementsByTagName){return undefined;}var e=elem.getElementsByTagName(settings.name);if(e.length){data=$.trim(e[0].innerHTML);}}else{if(elem.getAttribute!=undefined){var attr=elem.getAttribute(settings.name);if(attr){data=attr;}}}}if(data.indexOf("{")<0){data="{"+data+"}";}data=eval("("+data+")");$.data(elem,settings.single,data);return data;}}});$.fn.metadata=function(opts){return $.metadata.get(this[0],opts);};})(jQuery);if(typeof(SB)=="undefined"){SB={};}if(typeof(SB.ui)=="undefined"){SB.ui={};}if(typeof(SB.ui.sessionTimeout)=="undefined"){SB.ui.sessionTimeout={};}SB.ui.sessionTimeout.timer=function(){this.enableLog=false;};SB.ui.sessionTimeout.timer.prototype={timerName:"sessionTimer",expireTimerName:"sessionTimerExpire",timerWarningDelayMins:19,timerExpireDelayMins:1,renewUrl:"/Login.mvc/KeepAliveSession",expiredUrl:"/Logout.mvc/Relogin",layer:2,changeTimeouts:function(d,c){this.timerWarningDelayMins=d;this.timerExpireDelayMins=c;this.init();},init:function(){var c=this;c.log("INIT");if($("#sessionTimeoutPopup").length>0&&c.isLoggedIn()){c.hookAjaxEvents();c.setupWarningTimer(c.timerWarningDelayMins);}},hookAjaxEvents:function(){var c=this;$(document).ajaxComplete(function(f,e,d){d&&d.url&&d.url.charAt(0)==="/"&&c.resetWarningTimer();});},setupWarningTimer:function(d){var c=this;$.doTimeout(c.timerName,d*60000,function(){});c.log("Warning timeout set to "+d+" mins");},resetWarningTimer:function(){var c=this;if($("#sessionTimeoutPopup").length>0&&c.isLoggedIn()){c.setupWarningTimer(c.timerWarningDelayMins);}},setupExpireTimer:function(d){var c=this;$.doTimeout(c.expireTimerName,d*60000,function(){c.showExpired();});c.log("Expire timeout set to "+d+" mins");},showWarning:function(){var c=this;c.log("showWarning");c.setupExpireTimer(c.timerExpireDelayMins);c.showPopup("#sessionTimeoutPopup");$("#renewSessionButton",popLayer).click(function(){$.doTimeout(c.expireTimerName);c.hidePopup();c.updateSession();});$("#logoutButton",popLayer).click(function(){c.logoff();});},logoff:function(){var c=this;c.log("logoff");$("form[name='logout']").submit();c.hidePopup();},showExpired:function(){var c=this;c.log("showExpired");c.hidePopup();window.top.location=c.expiredUrl+"?currentPageUrl="+encodeURIComponent(window.top.location);},updateSession:function(){var c=this;$.ajax({url:c.renewUrl});c.log("updateSession");},log:function(d){var c=this;c.enableLog&&console&&console.log&&console.log("sessionTimer: ",arguments);},isLoggedIn:function(){var c=this;return($.cookie("ili")=="yes")&&($("#loginBox .welcomeBox").length>0);},hidePopup:function(){SB.base.divPopUp(2,"hide");},showPopup:function(c){var d=$("#popLayer2");d.html($(c).html());SB.base.divPopUp(2,"show");}};var sessionTimer;$(document).ready(function(){sessionTimer=new SB.ui.sessionTimeout.timer();sessionTimer.init();});if(typeof(SB)=="undefined"||SB==null){var SB=new Object();}if(typeof(SB.base)=="undefined"||SB.base==null){SB.base=new Object();}if(typeof service=="undefined"){var service=new Object();}if(typeof service.labels=="undefined"){service.labels=new Object();}if(typeof service.data=="undefined"){service.data=new Object();}if(typeof util=="undefined"){var util={};}util.getCookie=function(c){return getCookie(c);};util.setCookie=function(c,d){setCookie(c,d,"/");};var is_ie=(navigator.userAgent.indexOf("MSIE")>=0)?1:0;var is_ie5=(navigator.appVersion.indexOf("MSIE 5.5")!=-1)?1:0;var is_ie6=(navigator.appVersion.indexOf("MSIE 6.")!=-1)?1:0;var is_opera=((navigator.userAgent.indexOf("Opera6")!=-1)||(navigator.userAgent.indexOf("Opera/6")!=-1))?1:0;var is_netscape=(navigator.userAgent.indexOf("Netscape")>=0)?1:0;ResponseHandlerBase=function(){this.avoidCaching=true;this.traceLevel=3;this.verify=function(c){};this.processNode=function(d,e,c){};this.execute=function(){};this.process=function(d){if(!this.verify(d.xmlHttp.responseText)){this.onError(d.getUrl,d.xmlHttp.responseText);}else{if(d.xmlHttp.responseXML!=null){var c=new SB.base.XmlParser(false);c.processXml(d.xmlHttp.responseXML,this);c=null;this.execute();}}};this.onError=function(c,d){if(control!="undefined"){control.betBasket.onWebServiceError();}};};function AjaxService(c){this.responseHandler=c;}AjaxService.prototype.queueEmpty=true;AjaxService.prototype.onStateChange=function(){var d="";try{if(this.xmlHttp.readyState==4||this.xmlHttp.readyState=="complete"){if(sessionTimer){sessionTimer.resetWarningTimer();}if(this.xmlHttp.responseText!=""){d+=this.xmlHttp.responseText;AjaxService.prototype.busy=false;this.responseHandler.process(this);this.getUrl=null;this.responseHandler=null;this.xmlHttp=null;}}}catch(c){alert(c.message);}};AjaxService.prototype.GetRequest=function(c,d){AjaxService.prototype.busy=true;this.xmlHttp=this.GetXmlHttpObject(this);this.getUrl=c;this.content=d;if(this.responseHandler.avoidCaching){this.getUrl+=(this.getUrl.indexOf("?")>-1?"&":"?")+"basketVersion="+service.data.basketVersion;this.getUrl+="&serverIP="+service.data.serverIP;this.getUrl+="&sessionID="+service.data.sessionID;this.getUrl+="&time="+(new Date()).getTime();}if(this.content==null){this.xmlHttp.open("GET",this.getUrl,true);this.xmlHttp.send(null);}else{this.xmlHttp.open("POST",this.getUrl,true);this.xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");this.xmlHttp.send(d);}};AjaxService.prototype.GetXmlHttpObject=function(c){var d=null;if(window.XMLHttpRequest){d=new XMLHttpRequest();if(is_ie){d.onreadystatechange=function(){c.onStateChange();};}else{d.onload=function(){c.onStateChange();};d.onerror=function(){c.onStateChange();};}}else{if(window.ActiveXObject){try{var g=(is_ie6)?"Msxml2.XMLHTTP":"Microsoft.XMLHTTP";d=new ActiveXObject(g);d.onreadystatechange=function(){c.onStateChange();};}catch(f){alert("IE detected, but object could not be created. Verify that active scripting and activeX controls are enabled");return;}}else{if(is_opera){alert("Opera detected. The page may not behave as expected.");return;}}}return d;};SB.base.XmlParser=function(c){this.debugInfo="";this.debugMode=c;this.processXml=function(e,d){this.nodeHandler=d;this.processNode(e);if(this.debugMode){alert(this.debugInfo);}this.nodeHandler=null;this.debugInfo=null;};this.getNodeTextValue=function(e){var d="";if(e.hasChildNodes()){if(e.firstChild.nodeType==3){d=e.firstChild.nodeValue;}}return d;};this.processNode=function(g){if(g.nodeType==1){var k=g.nodeName.toLowerCase();var d=this.getNodeTextValue(g);this.nodeHandler.processNode(g,k,d);k=null;d=null;if(c){this.debugInfo+="[PROCESS]";}}if(c){this.debugInfo+="Parent Node: "+(g.parentNode!=null?g.parentNode.nodeName:"")+", NodeName: "+g.nodeName+", NodeType: "+g.nodeType+", nodeValue = "+this.getNodeTextValue(g)+"\n";}for(var f=0;f<g.childNodes.length;f++){var e=g.childNodes[f];if(e.nodeType!=3){this.processNode(e);}}};};function LabelsHandler(){this.inheritFrom=ResponseHandlerBase;this.inheritFrom();this.avoidCaching=false;this.traceLevel=4;this.verify=function(xmlText){return(xmlText.match(/<labelText(.)*>/)!=null);};this.processNode=function(node,nodeName,nodeValue){switch(nodeName){case"label":eval("service.labels."+node.getAttribute("id")+' = "'+nodeValue+'";');break;}};this.execute=function(){service.data.labelsLoaded=true;};}SB.base.DL_GetElementLeft=function(f){if(!f&&this){f=this;}var g=document.all?true:false;var d=f.offsetLeft;var k=f.offsetParent;while(k!=null){if(g){if((k.tagName!="TABLE")&&(k.tagName!="BODY")){d+=k.clientLeft;}}else{if(k.tagName=="TABLE"){var c=parseInt(k.border);if(isNaN(c)){var e=k.getAttribute("frame");if(e!=null){d+=1;}}else{if(c>0){d+=c;}}}}d+=k.offsetLeft;k=k.offsetParent;}return d;};SB.base.DL_GetElementTop=function(f){if(!f&&this){f=this;}var g=document.all?true:false;var d=f.offsetTop;var k=f.offsetParent;while(k!=null){if(g){if((k.tagName!="TABLE")&&(k.tagName!="BODY")){d+=k.clientTop;}}else{if(k.tagName=="TABLE"){var c=parseInt(k.border);if(isNaN(c)){var e=k.getAttribute("frame");if(e!=null){d+=1;}}else{if(c>0){d+=c;}}}}d+=k.offsetTop;k=k.offsetParent;}return d;};var toolTipId="";var PageObjects=new Array();SB.base.AddPageObject=function(e,c){var d=new Object();d.Name=e;d.TooltipText=c;PageObjects.push(d);};var ErrMsgObjects=new Array();SB.base.AddErrMsgObject=function(f,c){for(var d=0;d<ErrMsgObjects.length;d++){if(ErrMsgObjects[d].Name==f){ErrMsgObjects[d].ErrorMessage=c;return;}}var e=new Object();e.Name=f;e.ErrorMessage=c;ErrMsgObjects.push(e);};var Tooltip={Show:function(f){var c;for(c=0;c<PageObjects.length;c++){if(PageObjects[c].Name==f.id){break;}}if(c<PageObjects.length){var d=PageObjects[c].TooltipText;if(d!=null&&d!=""){var e=new Date();toolTipId=PageObjects[c].Name+e.getMilliseconds();this.Set(d,SB.base.DL_GetElementLeft(document.getElementById(PageObjects[c].Name+"_tt")),SB.base.DL_GetElementTop(f)+10);}}return true;},ShowInfo:function(f){var c;for(c=0;c<PageObjects.length;c++){if(PageObjects[c].Name+"_tt"==f.id){break;}}if(c<PageObjects.length){var d=PageObjects[c].TooltipText;if(d!=null&&d!=""){var e=new Date();toolTipId=PageObjects[c].Name+e.getMilliseconds();this.Set(d,SB.base.DL_GetElementLeft(f)+10,SB.base.DL_GetElementTop(f));}}return true;},ShowError:function(f){var c;for(c=0;c<ErrMsgObjects.length;c++){if(ErrMsgObjects[c].Name==f.id){break;}}if(c<ErrMsgObjects.length){var d=ErrMsgObjects[c].ErrorMessage;if(d!=null&&d!=""){var e=new Date();toolTipId=ErrMsgObjects[c].Name+e.getMilliseconds();this.Set(d,SB.base.DL_GetElementLeft(document.getElementById(ErrMsgObjects[c].Name))+10,SB.base.DL_GetElementTop(f)+10);}}return true;},Hide:function(d){for(var c=0;c<PageObjects.length;c++){if(PageObjects[c].Name==d.id){setTimeout("if (toolTipId == '"+toolTipId+"') {Tooltip.Set('', -800, -800); toolTipId = '';}",500);break;}}},HideInfo:function(d){for(var c=0;c<PageObjects.length;c++){if(PageObjects[c].Name+"_tt"==d.id){setTimeout("if (toolTipId == '"+toolTipId+"') {Tooltip.Set('', -800, -800); toolTipId = '';}",500);break;}}},HideError:function(d){for(var c=0;c<ErrMsgObjects.length;c++){if(ErrMsgObjects[c].Name==d.id){setTimeout("if (toolTipId == '"+toolTipId+"') {Tooltip.Set('', -800, -800); toolTipId = '';}",500);break;}}},Set:function(f,c,g){var e=document.getElementById("tooltipcontent");if(e==null){return;}e.innerHTML=f;e.style.padding="5px";var d=document.getElementById("tooltip");d.style.left=c+30+"px";d.style.top=g-10-50+"px";}};$(".icoError").live("mouseover",function(){ttSlim.Show(this);}).live("mouseout",function(){ttSlim.Hide(this);});$(".icoInfo").live("mouseover",function(){ttSlim.Show(this);}).live("mouseout",function(){ttSlim.Hide(this);});var ttSlimOn=new Array();var ttSlim={Show:function(){var d=(typeof arguments[0]=="string")?arguments[0]:arguments[0].id;var f=document.getElementById(d.replace(/ttt_?/i,"ico_"));var c=document.getElementById(d.replace(/ico_?/i,"ttt_"));if(!c||c.innerHTML.indexOf("tttContent")==-1){return false;}if(ttSlimOn[0]!=null){ttSlim.HideNow(ttSlimOn[1]);}ttSlimOn[0]=true;ttSlimOn[1]=d;var k=1;var e=4;var g=0;c.style.display="block";c.style.top=(ttSlim.FindPos(f,true)[0]-c.offsetHeight-k-document.documentElement.scrollTop<=0)?(ttSlim.FindPos(f)[0]+f.offsetHeight+e)+"px":ttSlim.FindPos(f)[0]-c.offsetHeight-k+"px";c.style.left=ttSlim.FindPos(f)[1]+f.offsetWidth+g+"px";if(document.getElementById("tt_ie_fix")){document.getElementById("tt_ie_fix").style.top=c.style.top;document.getElementById("tt_ie_fix").style.left=c.style.left;document.getElementById("tt_ie_fix").style.width=c.clientWidth+"px";document.getElementById("tt_ie_fix").style.height=c.clientHeight+"px";document.getElementById("tt_ie_fix").style.display="block";}},ShowNow:function(){var d=(typeof arguments[0]=="string")?arguments[0]:arguments[0].id;if(ttSlimOn[1]==d){var f=document.getElementById(d.replace(/ttt_?/i,"ico_"));var c=document.getElementById(d.replace(/ico_?/i,"ttt_"));if(!c||c.innerHTML.indexOf("tttContent")==-1){return false;}var k=1;var e=4;var g=0;c.style.top=(ttSlim.FindPos(f,true)[0]-c.offsetHeight-k-document.documentElement.scrollTop<=0)?(ttSlim.FindPos(f)[0]+f.offsetHeight+e)+"px":ttSlim.FindPos(f)[0]-c.offsetHeight-k+"px";c.style.left=ttSlim.FindPos(f)[1]+f.offsetWidth+g+"px";c.style.display="block";if(document.getElementById("tt_ie_fix")){document.getElementById("tt_ie_fix").style.top=c.style.top;document.getElementById("tt_ie_fix").style.left=c.style.left;document.getElementById("tt_ie_fix").style.width=c.clientWidth+"px";document.getElementById("tt_ie_fix").style.height=c.clientHeight+"px";document.getElementById("tt_ie_fix").style.display="block";}}else{return;}},Hide:function(){var argObjId=(typeof arguments[0]=="string")?arguments[0]:arguments[0].id;var objText=document.getElementById(argObjId.replace(/ico_?/i,"ttt_"));if(!objText||objText.innerHTML==""){return false;}eval("var timeoutID = setTimeout(\"ttSlim.HideNow('"+argObjId+"')\", 500);");ttSlimOn[0]=timeoutID;ttSlimOn[1]=argObjId;},HideFor:function(){var argObjId=(typeof arguments[0]=="string")?arguments[0]:arguments[0].id;var objText=document.getElementById(argObjId.replace(/ico_?/i,"ttt_"));if(!objText||objText.innerHTML==""){return false;}eval("var timeoutID = setTimeout(\"ttSlim.HideNow('"+argObjId+"')\", 1500);");ttSlimOn[0]=timeoutID;ttSlimOn[1]=argObjId;},HideNow:function(){var c=document.getElementById(arguments[0].replace(/ico_?/i,"ttt_"));if(!c){return false;}c.style.display="none";if(document.getElementById("tt_ie_fix")){document.getElementById("tt_ie_fix").style.display="none";}clearTimeout(ttSlimOn[0]);ttSlimOn[0]=ttSlimOn[1]=null;},FindPos:function(){var e,c;e=c=0;var d=arguments[0];if(d.offsetParent){do{if(!d.style.left||arguments[1]){e+=d.offsetLeft;}if(!d.style.top||arguments[1]){c+=d.offsetTop;}}while(d=d.offsetParent);}return[c,e];}};SB.base.ChangeRowVisibility=function(c,d){if(document.getElementById(d)!=null){if(navigator.product=="Gecko"&&navigator.productSub&&navigator.productSub>"20041010"&&(navigator.userAgent.indexOf("rv:1.8")!=-1||navigator.userAgent.indexOf("rv:1.9")!=-1)){if(c=="show"){document.getElementById(d).style.display="";}else{document.getElementById(d).style.display="none";}}else{if(c=="show"){if(document.all&&document.compatMode&&document.compatMode=="CSS1Compat"&&!window.opera){document.getElementById(d).style.display="block";}else{if(document.getElementById){if(document.getElementById(d).nodeName.toLowerCase()=="div"){document.getElementById(d).style.display="block";}else{document.getElementById(d).style.display="table-row";}}}}else{if(c=="hide"){document.getElementById(d).style.display="none";}}}}};SB.base.HideRow=function(c){SB.base.ChangeRowVisibility("hide",c);};SB.base.ShowRow=function(c){SB.base.ChangeRowVisibility("show",c);};SB.base.TrimString=function(c){return c.replace(/^\s\s*/,"").replace(/\s\s*$/,"");};SB.base.ToggleElement=function(d,c,e){if(document.getElementById(d)!=null){if(c=="visibility"){document.getElementById(d).style.visibility=e;}else{obj=document.getElementById(d);document.getElementById(d).style.display=e;}}};SB.base.AddOption=function(d,f,e){var c=new Option(f,e);d.options.add(c);};SB.base.RemoveAllOptions=function(c){var d;if(c.options.length>0){for(d=c.options.length-1;d>=0;d--){c.remove(d);}}};SB.base.GetUnhandledServerErrorMessage=function(){if($("#urlCode").val()=="com-ca"){return'    <div id="popBox2" class="popup alert">        <div class="popupHead">            <a href="javascript:void(0)" onclick="javascript:SB.base.divPopUp(1,\'hide\');"> [-] Close</a>            <h2>Server Not Available</h2>        </div>        <div class="popupBody">            <div class="container">                <div class="content"><p class="strong">The server is not available at this time. Please retry after some time. </p><p> Alternatively you can call us at 0800 028 0348 or mail us at <a href="mailto:Canada.Support@sportingbet.com">Canada.Support@sportingbet.com</a>.</p></div>            </div>        </div>        <div class="popupFoot">            <span></span>        </div>    </div>  ';}else{return'    <div id="popBox2" class="popup alert">        <div class="popupHead">            <a href="javascript:void(0)" onclick="javascript:SB.base.divPopUp(1,\'hide\');"> [-] Close</a>            <h2>Server Not Available</h2>        </div>        <div class="popupBody">            <div class="container">                <div class="content"><p class="strong">The server is not available at this time. Please retry after some time. </p><p> Alternatively you can call us at 0800 028 0348 or mail us at <a href="mailto:admin@sportingbet.com">admin@sportingbet.com</a>.</p></div>            </div>        </div>        <div class="popupFoot">            <span></span>        </div>    </div>  ';}};SB.base.ShowCouponErrorMessage=function(){var c=$("div#couponMessage");c.html(SB.base.GetCouponErrorMessage());};SB.base.GetCouponErrorMessage=function(){return'    <p class="errorSEO"><br/>We are sorry but this coupon is no longer available for betting.  Why not have a bet on one of the following events instead?<br/><br/></p>   ';};Hashtable.prototype.hash=null;Hashtable.prototype.keys=null;Hashtable.prototype.location=null;function Hashtable(){this.hash=new Array();this.keys=new Array();this.location=0;}Hashtable.prototype.get=function(c){return this.hash[c];};Hashtable.prototype.put=function(c,d){if(d==null){return null;}if(this.hash[c]==null){this.keys[this.keys.length]=c;}this.hash[c]=d;};function PopTrace(c){}SB.base.getElementsByClass=function(l,g,c){var f=new Array();if(g==null){g=document;}if(c==null){c="*";}var e=g.getElementsByTagName(c);var d=e.length;var k=new RegExp("\\b"+l+"\\b");for(i=0,j=0;i<d;i++){if(k.test(e[i].className)){f[j]=e[i];j++;}}return f;};var is_ie=(navigator.userAgent.indexOf("MSIE")>=0)?1:0;var is_ie5=(navigator.appVersion.indexOf("MSIE 5.5")!=-1)?1:0;var is_ie6=(navigator.appVersion.indexOf("MSIE 6.")!=-1)?1:0;var is_opera=((navigator.userAgent.indexOf("Opera6")!=-1)||(navigator.userAgent.indexOf("Opera/6")!=-1))?1:0;var is_netscape=(navigator.userAgent.indexOf("Netscape")>=0)?1:0;__customDoPostBack=function(u,v){var f=[];var q=/%20/g;var g=document.getElementById("aspnetForm").elements;for(var m=0;m<document.getElementById("aspnetForm").elements.length;m++){try{var d=g[m].name;var k=document.getElementById(g[m].id);var s=k.value;if(k.type=="checkbox"){if(k.checked){s=1;}else{s=0;}}if(d=="__EVENTTARGET"){s=u;}if(d=="__EVENTARGUMENT"){s=v;}var l=encodeURIComponent(d).replace(q,"+")+"="+encodeURIComponent(s).replace(q,"+");if(k.type=="radio"){if(k.checked){f.push(l);}}else{f.push(l);}}catch(o){}}var r="";try{r=service.data.sessionID;}catch(o){}var c=document.getElementById("urlid").value;if(r!=null&&r!=""){if(c.toString().indexOf("?")>0){HTTP.post(c+"&random="+new Date().getTime()+"&sessionID="+r,f.join("&"),CallBack,ErrorHandler,"popLayer1");}else{HTTP.post(c+"?random="+new Date().getTime()+"&sessionID="+r,f.join("&"),CallBack,ErrorHandler,"popLayer1");}}else{if(c.toString().indexOf("?")>0){HTTP.post(c+"&random="+new Date().getTime(),f.join("&"),CallBack,ErrorHandler,"popLayer1");}else{HTTP.post(c+"?random="+new Date().getTime(),f.join("&"),CallBack,ErrorHandler,"popLayer1");}}};CallBack=function(returnOutput,returnDiv,url){if(sessionTimer){sessionTimer.resetWarningTimer();}var output=returnOutput;returnOutput=SB.base.stripScripts(returnOutput);anum=(parseInt(returnDiv.replace(/popLayer/,"")));SB.base.divPopUp(anum,"hide");try{var pos=url.toString().indexOf("usermessage.aspx?");if(pos>0){var index=url.toString().indexOf("?");if(index>1){url=url.substring(1,index);}}document.getElementById(returnDiv).innerHTML=returnOutput+'<input type="hidden" name="urlid" id="urlid" value="'+url+'"/>';$("input.eventTrigger",returnOutput).each(function(){SB.EventHub.trigger($(this).attr("title"),$(this).val());});}catch(e){try{var pos=url.toString().indexOf("usermessage.aspx?");if(pos>0){var index=url.toString().indexOf("?");if(index>1){url=url.substring(1,index);}}top.document.getElementById(returnDiv).innerHTML=returnOutput+'<input type="hidden" name="urlid" id="urlid" value="'+url+'"/>';}catch(e){}}var scriptFilenames=SB.base.extractScriptsSource(output);for(var iP=0;iP<scriptFilenames.length;iP++){try{if(!(SB.base.searchHeadTagsforScript(scriptFilenames[iP]))){HTTP.loadScriptFile(scriptFilenames[iP]);}}catch(e){}}var scripts=SB.base.extractScripts(output);for(var iP=0;iP<scripts.length;iP++){try{eval(scripts[iP]);}catch(e){}}SB.base.divPopUp(anum,"show");if(typeof(sbWeb)!="undefined"&&typeof(sbWeb.ui)!="undefined"&&typeof(sbWeb.ui.overlayCallBack)=="function"){sbWeb.ui.overlayCallBack();}};ErrorHandler=function(f,e,d){if(d){var c=d.charAt(d.length-1);errorInnerHtml=SB.base.GetUnhandledServerErrorMessage();errorInnerHtml=errorInnerHtml.replace(/SB.base.divPopUp\(./g,"SB.base.divPopUp("+c);document.getElementById(d).innerHTML=errorInnerHtml;if(c==1){SB.base.divPopUp(2,"hide");}SB.base.divPopUp(parseInt(c),"show");}else{alert(f+": "+e);}};SB.base.DisplayErrorPageInPopup=function(k,g){var l='<body id="sports">';var f="</body>";var d="";var o=g.charAt(g.length-1);o=Number(o);var m;try{k=k.replace(/\n/g,"");var q=k.indexOf(l);var e=k.indexOf(f);d=k.substring(q+l.length,e);d=d.replace(/SB.base.divPopUp\(./g,"SB.base.divPopUp("+o);}catch(c){d=SB.base.GetUnhandledServerErrorMessage();d=d.replace(/SB.base.divPopUp\(./g,"SB.base.divPopUp("+o);}document.getElementById(g).innerHTML=d;SB.base.divPopUp(parseInt(o),"show");};SB.base.stripTags=function(c){return c.replace(/<\/?[^>]+>/gi,"");};SB.base.stripScripts=function(c){return c.replace(new RegExp("<script[^>]*>([\\S\\s]*?)<\/script>","img"),"");};SB.base.extractScripts=function(e){var g=new RegExp("<script[^>]*>([\\S\\s]*?)<\/script>","img");var d=new RegExp("<script[^>]*>([\\S\\s]*?)<\/script>","im");var f=e.match(g);if(f==null){return"";}for(var c=0;c<f.length;c++){f[c]=(f[c].match(d)||["",""])[1];}return f;};var HTTP;if(HTTP&&(typeof HTTP!="object"||HTTP.NAME)){throw new Error("Namespace 'HTTP' already exists");}HTTP={};HTTP.NAME="HTTP";HTTP.VERSION=1;HTTP._factories=[function(){return new XMLHttpRequest();},function(){return new ActiveXObject("Msxml2.XMLHTTP");},function(){return new ActiveXObject("Microsoft.XMLHTTP");}];HTTP._factory=null;HTTP.newRequest=function(){if(HTTP._factory!=null){return HTTP._factory();}for(var d=0;d<HTTP._factories.length;d++){try{var c=HTTP._factories[d];var f=c();if(f!=null){HTTP._factory=c;return f;}}catch(g){continue;}}if(is_opera){alert("Opera detected. The page may not behave as expected.");return;}else{HTTP._factory=function(){throw new Error("XMLHttpRequest not supported");};HTTP._factory();}};HTTP.syncTextCall=function(c){var d=HTTP.newRequest();d.open("GET",c,false);d.send(null);if(d.status==200){return d.responseText;}else{alert("Error "+d.status+": "+d.statusText);}};HTTP.getText=function(c,e){var d=HTTP.newRequest();d.onreadystatechange=function(){if(d.readyState==4&&d.status==200){e(d.responseText);}};d.open("GET",c);d.send(null);};HTTP.getXML=function(c,e){var d=HTTP.newRequest();d.onreadystatechange=function(){if(d.readyState==4&&d.status==200){e(d.responseXML);}};d.open("GET",c);d.send(null);};HTTP.getHeaders=function(d,f,c){var e=HTTP.newRequest();e.onreadystatechange=function(){if(e.readyState==4){if(e.status==200){f(HTTP.parseHeaders(e));}else{if(c){c(e.status,e.statusText);}else{f(null);}}}};e.open("HEAD",d);e.send(null);};HTTP.parseHeaders=function(e){var k=e.getAllResponseHeaders();var d={};var g=/^\s*/;var l=/\s*$/;var q=k.split("\n");for(var f=0;f<q.length;f++){var r=q[f];if(r.length==0){continue;}var m=r.indexOf(":");var c=r.substring(0,m).replace(g,"").replace(l,"");var o=r.substring(m+1).replace(g,"").replace(l,"");d[c]=o;}return d;};var Global_processingMessage="";var Global_processingTitle="";SB.base.holdingDiv=function(e){if(document.getElementById("registration_modCustRegFirstname")){message="<p>Processing your registration...</p>";}else{message="<p>The form is loading</p>";}title="Please wait a moment...";var f=document.getElementById("popLayer2").className;if(Global_processingTitle!="hidden"){if(f.indexOf("hide")!=-1){if(Global_processingMessage!=""){message=Global_processingMessage;}if(Global_processingTitle!=""){title=Global_processingTitle;}if(e==null){e="refresh";}var c='<div id="popBox2" class="popup alert">'+SB.base.processingAnimationContent(title,message)+"</div>";var d=document.getElementById("popLayer2");SB.base.divPopUp(2,"hide");d.innerHTML=c;SB.base.divPopUp(2,e);}if(e=="hide"){SB.base.divPopUp(2,e);}}};SB.base.processingAnimationContent=function(d,c){$("#popupTitle").html(d);$("#popupMessage").html(c);return $("div#animationDiv").html();};var responseState={success:0,waiting:1,error:2};var rState;HTTP.post=function(c,m,o,l,k){var q=120000;var g=HTTP.newRequest();var d=setTimeout("SB.base.holdingDiv('show')",1);var f;rState=responseState.waiting;g.onreadystatechange=function(){if(g.readyState==4){clearTimeout(f);clearTimeout(d);if(g.status==200){rState=responseState.success;SB.base.holdingDiv("hide");var r=HTTP._getResponse(g);o(r,k,c);}else{if(g.status==404||g.status==500){SB.base.holdingDiv("hide");SB.base.DisplayErrorPageInPopup(HTTP._getResponse(g),k);}else{if(l){rState=responseState.error;l(g.status,g.statusText,k);}else{o(null,null,null);rState=responseState.error;SB.base.holdingDiv("hide");}}}}};try{g.open("POST",c);g.setRequestHeader("Content-Type","application/x-www-form-urlencoded");g.send(m);f=setTimeout(function(){g.abort();clearTimeout(d);},q);}catch(e){alert(e.message);clearTimeout(d);rState=responseState.error;l(null,null,k);}};HTTP.requestTimeOut=function(c){c.abort();};HTTP.encodeFormData=function(g){var f=[];var e=/%20/g;for(var c in g){var d=g[c].toString();var k=encodeURIComponent(c).replace(e,"+")+"="+encodeURIComponent(d).replace(e,"+");f.push(k);}return f.join("&");};HTTP._getResponse=function(request){switch(request.getResponseHeader("Content-Type")){case"text/xml":return request.responseXML;case"text/json":case"application/json":case"text/javascript":case"application/javascript":case"application/x-javascript":return eval(request.responseText);default:return request.responseText;}};HTTP.get=function(d,l,c){var e=HTTP.newRequest();var k=0;var g;if(c.timeout){g=setTimeout(function(){e.abort();if(c.timeoutHandler){c.timeoutHandler(d);}},c.timeout);}e.onreadystatechange=function(){if(e.readyState==4){if(g){clearTimeout(g);}if(e.status==200){if(c.textonly){if(c.Content){l(e.responseText,c.Content);}else{l(e.responseText);}}else{if(c.Content){l(HTTP._getResponse(e),c.Content);}else{l(HTTP._getResponse(e));}}}else{if(c.errorHandler){try{c.errorHandler(e.status,e.statusText,c);}catch(m){c.errorHandler(e.status,"",c);}}else{l(null);}}}else{if(c.progressHandler){c.progressHandler(++k);}}};var f=d;if(c.parameters){f+="?"+HTTP.encodeFormData(c.parameters);}e.open("GET",f);e.send(null);};HTTP.getTextWithScript=function(e,f){var d=document.createElement("script");document.body.appendChild(d);var c="func"+HTTP.getTextWithScript.counter++;HTTP.getTextWithScript[c]=function(g){f(g);document.body.removeChild(d);delete HTTP.getTextWithScript[c];};d.src="jsquoter.php?url="+encodeURIComponent(e)+"&func="+encodeURIComponent("HTTP.getTextWithScript."+c);};HTTP.getTextWithScript.counter=0;var popUpDivURL="";var AJAXRequestContent="sportingbet";SB.base.inPlayResize=function(){if(window.top.document.getElementById("iTopLogin")){popH=0;if(window.innerHeight!=window.undefined){popH=window.top.innerHeight;}else{if(document.compatMode=="CSS1Compat"){popH=window.top.document.documentElement.clientHeight;}else{if(document.body){popH=window.top.document.body.clientHeight;}}}if(gPops[0]["view"]=="show"||gPops[1]["view"]=="show"){window.top.document.getElementById("iTopLogin").style.height=popH+"px";window.top.document.getElementById("iMainBody").style.height="0px";}else{window.top.document.getElementById("iTopLogin").style.height="";window.top.document.getElementById("iMainBody").style.height="4000px";}}};SB.base.reStyler=function(c,k,f,e){if(typeof(k)=="string"){k=k.replace(/ /gi,"");var l=new Array();l=k.split(",");for(i=0;i<l.length;i++){var d=document.getElementById(l[i]);SB.base.reStyler(c,d,f,e);}}else{switch(c){case"swap":k.className=!SB.base.reStyler("check",k,f)?k.className.replace(e,f):k.className.replace(f,e);break;case"add":if(!SB.base.reStyler("check",k,f)){k.className+=k.className?" "+f:f;}break;case"remove":var g=k.className.match(" "+f)?" "+f:f;k.className=k.className.replace(g,"");break;case"check":return new RegExp("\\b"+f+"\\b").test(k.className);break;case"set":SB.base.reStyler("remove",k,e);SB.base.reStyler("add",k,f);break;}}};var gPops=new Array();gPops[0]=new Array();gPops[1]=new Array();gPops[0]["view"]="hide";gPops[1]["view"]="hide";var gMaskSize=new Array();gMaskSize.height="0px";gMaskSize.width="0px";SB.base.addEvent=function(f,e,c){if(f.addEventListener){f.addEventListener(e,c,false);return true;}else{if(f.attachEvent){var d=f.attachEvent("on"+e,c);return d;}else{return false;}}};SB.base.removeEvent=function(g,f,d,c){if(g.removeEventListener){g.removeEventListener(f,d,c);return true;}else{if(g.detachEvent){var e=g.detachEvent("on"+f,d);return e;}else{alert("Handler could not be removed");}}};SB.base.addPopDivs=function(xNode){if(!xNode){xNode=document;}pDiv=SB.base.getElementsByClass("popDiv",xNode,"a");for(id=0;id<pDiv.length;id++){pRel=pDiv[id].rel.split(",");SB.base.addEvent(pDiv[id],"click",eval(pRel[0]));pDiv[id].url=pDiv[id].href;pDiv[id].pLayer=(!pDiv[id].target)?1:pDiv[id].target;pDiv[id].params=pRel;pDiv[id].href="javascript: void(0);";pDiv[id].target="";}};function init(){SB.base.addPopDivs();}var __oldDoPostBack=null;var __doPostBack;SB.base.overwriteDotNetDoPostBack=function(){if(__doPostBack){__oldDoPostBack=__doPostBack;}__doPostBack=__customDoPostBack;};SB.base.revertDotNetDoPostBack=function(){if(__oldDoPostBack){__doPostBack=__oldDoPostBack;__oldDoPostBack=null;}};SB.base.reallyClose=function(c,d){SB.base.divPopUp(c,d);location.href="/t/index.aspx?";};SB.base.dynamicPopupClose=function(e,g){var f=false;var d=$(e).parent();while(!f&&d.length==1){var k=d.attr("id");if(k!=null&&k.indexOf("popLayer")==0){f=true;}else{d=d.parent();}}if(f){var c=d.attr("id").replace("popLayer","")*1;if(g&&c==1){location.href=location.href.split("?")[0];}else{SB.base.divPopUp(c,"hide");}}};SB.base.divPopUp=function(c,d){if(typeof(c)!="number"){if(c.target){my=c.target;}else{if(c.srcElement){my=c.srcElement;}}if(my.nodeType==3){my=my.parentNode;}c=my.pLayer;d=my.params[1];}aID=c-1;p="popLayer"+c;veil="popVeil"+c;bad="popBadSelect"+c;popLayer=document.getElementById(p);switch(d){case"show":if(gPops[aID]["view"]=="show"){SB.base.revertDotNetDoPostBack();}gPops[aID]["view"]="show";popLayer.style.visibility="hidden";SB.base.reStyler("set",veil+","+bad+","+p,"show","hide");SB.base.centerPopWin();popLayer.style.visibility="visible";SB.base.overwriteDotNetDoPostBack();SB.base.addPopDivs(popLayer);SB.base.popPrint("open");break;case"remove":$(popLayer).html("");case"hide":gPops[aID]["view"]="hide";SB.base.inPlayResize();SB.base.reStyler("set",veil+","+bad+","+p,"hide","show");SB.base.revertDotNetDoPostBack();Global_processingMessage="";Global_processingTitle="";SB.base.popPrint("close");break;case"reload":SB.base.closeDivRefreshWindow();break;case"refresh":SB.base.reStyler("set",veil+","+bad+","+p,"show","hide");SB.base.centerPopWin();SB.base.addPopDivs();break;default:break;}};SB.base.popPrint=function(e){nonPops=new Array();nObjs=document.body.childNodes;var c=nObjs.length;for(ff=0;ff<c;ff++){if(nObjs[ff].nodeName=="FORM"||nObjs[ff].nodeName=="DIV"){nonPops.push(nObjs[ff]);}}if(e=="close"&&gPops[0]["view"]=="show"){e="open";}switch(e){case"close":for(var d=0;d<nonPops.length;d++){SB.base.reStyler("set",nonPops[d],"doPrint","noPrint");}SB.base.reStyler("remove","popLayer1","noPrint");document.getElementById("popupBox").className="noPrint";break;case"open":for(var d=0;d<nonPops.length;d++){SB.base.reStyler("set",nonPops[d],"noPrint","doPrint");}if(gPops[1]["view"]=="show"){SB.base.reStyler("set","popLayer1","noPrint","doPrint");}else{SB.base.reStyler("remove","popLayer1","noPrint");}document.getElementById("popupBox").className="doPrint";break;}};SB.base.popupFinder=function(c){pLayer="popLayer"+(c);hh=document.getElementById(pLayer);var d="popBox"+(c);for(i=0;i<hh.childNodes.length;i++){a=hh.childNodes[i];b=""+a.className;if(b.indexOf("popup")>=0){if(!a.getAttribute("id")){a.setAttribute("id","popBox"+c);}d=a.id;}}return d;};function scrollDelayer(c){setTimeout("SB.base.centerPopWin()",500);}SB.base.centerPopWin=function(d){if(typeof d=="number"){SB.base.doCenterPopWin(d);}else{for(var c=0;c<gPops.length;c++){if(gPops[c]["view"]=="show"){SB.base.doCenterPopWin(c+1);}}}};SB.base.addEvent(window,"resize",SB.base.centerPopWin);SB.base.doCenterPopWin=function(c){SB.base.inPlayResize();var g=document.getElementsByTagName("BODY")[0];var d=parseInt(SB.base.getScrollTop(),10);var f=parseInt(g.scrollLeft,10);SB.base.setMaskSize();box=SB.base.popupFinder(c);z=document.getElementById(box);width=0;height=0;if(z){width=z.offsetWidth;height=z.offsetHeight;}var e=SB.base.getViewportHeight();var k;if(document.getElementById("game")==null){k=980;}else{k=SB.base.getViewportWidth();}if((d+((e-height)/2))<=0){h=0;}else{h=(d+((e-height)/2));}if(z){z.style.top=h+"px";z.style.left=(f+((k-width)/2))+"px";}};SB.base.getViewportHeight=function(){if(window.innerHeight!=window.undefined){return window.innerHeight;}if(document.compatMode=="CSS1Compat"){return document.documentElement.clientHeight;}if(document.body){return document.body.clientHeight;}return window.undefined;};SB.base.getViewportWidth=function(){var d=17;var c=null;if(window.innerWidth!=window.undefined){return window.innerWidth;}if(document.compatMode=="CSS1Compat"){return window.document.documentElement.clientWidth;}if(document.body){return document.body.clientWidth;}};SB.base.getScrollTop=function(){if(self.pageYOffset){return self.pageYOffset;}else{if(document.documentElement&&document.documentElement.scrollTop){return document.documentElement.scrollTop;}else{if(document.body){return document.body.scrollTop;}}}};SB.base.getScrollLeft=function(){if(self.pageXOffset){return self.pageXOffset;}else{if(document.documentElement&&document.documentElement.scrollLeft){return document.documentElement.scrollLeft;}else{if(document.body){return document.body.scrollLeft;}}}};SB.base.setMaskSize=function(){var d=document.getElementsByTagName("BODY")[0];var c=SB.base.getViewportHeight();var e=SB.base.getViewportWidth();if(c>d.scrollHeight){popHeight=c;}else{popHeight=d.scrollHeight;}popWidth=document.body.offsetWidth;gBad1=document.getElementById("popBadSelect1");gVeil1=document.getElementById("popVeil1");gBad2=document.getElementById("popBadSelect2");gVeil2=document.getElementById("popVeil2");gBad1.style.height=popHeight+"px";gVeil1.style.height=popHeight+"px";gBad1.style.width=popWidth+"px";gBad2.style.height=popHeight+"px";gVeil2.style.height=popHeight+"px";gBad2.style.width=popWidth+"px";gVeil1.style.width=popWidth+"px";gVeil2.style.width=popWidth+"px";};SB.base.RecallOpenDiv=function(f,g,c,d){if(typeof(f)!="string"){if(f.target){my=f.target;}else{if(f.srcElement){my=f.srcElement;}}if(my.nodeType==3){my=my.parentNode;}f=my.url;g="popBadSelect"+my.pLayer;c="popVeil"+my.pLayer;d="popLayer"+my.pLayer;}var l="";try{l=service.data.sessionID;}catch(k){}if(l!=null&&l!=""){if(f.toString().indexOf("?")>0){HTTP.post(f+"&random="+new Date().getTime()+"&sessionID="+l,AJAXRequestContent,CallBack,ErrorHandler,d);}else{HTTP.post(f+"?random="+new Date().getTime()+"&sessionID="+l,AJAXRequestContent,CallBack,ErrorHandler,d);}}else{if(f.toString().indexOf("?")>0){HTTP.post(f+"&random="+new Date().getTime(),AJAXRequestContent,CallBack,ErrorHandler,d);}else{HTTP.post(f+"?random="+new Date().getTime(),AJAXRequestContent,CallBack,ErrorHandler,d);}}};SB.base.OpenDiv=function(e,f,c,d){if(typeof(e)!="string"){if(e.target){my=e.target;}else{if(e.srcElement){my=e.srcElement;}}if(my.nodeType==3){my=my.parentNode;}e=my.url;f="popBadSelect"+my.pLayer;c="popVeil"+my.pLayer;d="popLayer"+my.pLayer;}SB.base.OpenDivCheckLoginStatus(e,f,c,d,false);};SB.base.OpenDivLoginRequired=function(f,g,d,e,c){if(typeof(f)!="string"){if(f.target){my=f.target;}else{if(f.srcElement){my=f.srcElement;}}if(my.nodeType==3){my=my.parentNode;}f=my.url;g="popBadSelect"+my.pLayer;d="popVeil"+my.pLayer;e="popLayer"+my.pLayer;c=(my.params[1]!="true")?false:true;}if(typeof(document.getElementById(f))=="undefined"||typeof(document.getElementById(e))=="undefined"||typeof(document.getElementById(c))=="undefined"){setTimeout("SB.base.OpenDivLoginRequired(url,popBadSelectDiv,popVeilDiv,popLayerDiv,sessionExpired);",200);}if(c){popUpDivURL=f;SB.base.OpenDivLoginRequired("/t/customer/loginIframe.aspx?expired=true","popBadSelect1","popVeil1","popLayer1",false);}else{if(f.indexOf("&currentPageUrl")==-1){f=f+"&currentPageUrl="+window.location.href;}SB.base.OpenDiv(f,g,d,e);}};SB.base.OpenDivCheckLoginStatus=function(c,d,k,m,r,s,g){if(typeof(c)!="string"){if(c.target){my=c.target;}else{if(c.srcElement){my=c.srcElement;}}if(my.nodeType==3){my=my.parentNode;}c=my.url;d="popBadSelect"+my.pLayer;k="popVeil"+my.pLayer;m="popLayer"+my.pLayer;r=(my.params[1]!="true")?false:true;}if(typeof(document.getElementById(c))=="undefined"||typeof(document.getElementById(m))=="undefined"||typeof(document.getElementById(r))=="undefined"){setTimeout("SB.base.OpenDivCheckLoginStatus(url,popBadSelectDiv,popVeilDiv,popLayerDiv,loginCheckRequired);",200);}try{var f=(util.getCookie("ili")!=null&&util.getCookie("ili")!=""?util.getCookie("ili"):"no");}catch(o){alert(o);f="no";}if("no"==f&&r){popUpDivURL=c;if(s==undefined){s=SB.base.inferLoginSource(c);}var l="";if(s!=undefined){l="&loginSource="+s;}if(g==undefined){g=encodeURIComponent(window.top.location);}else{g=encodeURIComponent(g);}SB.base.OpenDivCheckLoginStatus("/loginbar.mvc/popup?currentPageUrl="+g+l+"&requestedPopupUrl="+encodeURIComponent(popUpDivURL),"popBadSelect1","popVeil1","popLayer1",false);}else{if(typeof(document.getElementById(m))=="undefined"||typeof(document.getElementById(c))=="undefined"||typeof(document.getElementById(r))=="undefined"){setTimeout("SB.base.OpenDivCheckLoginStatus(url,popBadSelectDiv,popVeilDiv,popLayerDiv,loginCheckRequired);",200);}else{document.getElementById(m).innerHTML="";if(typeof(document.getElementById(c))=="undefined"||typeof(document.getElementById(m))=="undefined"||typeof(document.getElementById(r))=="undefined"){setTimeout("SB.base.OpenDivCheckLoginStatus(url,popBadSelectDiv,popVeilDiv,popLayerDiv,loginCheckRequired);",200);}else{if(typeof(document.getElementById(c))=="undefined"||typeof(document.getElementById(m))=="undefined"||typeof(document.getElementById(r))=="undefined"){setTimeout("SB.base.OpenDivCheckLoginStatus(url,popBadSelectDiv,popVeilDiv,popLayerDiv,loginCheckRequired);",200);}else{var q="";try{q=service.data.sessionID;}catch(o){}if(q!=null&&q!=""){if(c.toString().indexOf("?")>0){HTTP.post(c+"&random="+new Date().getTime()+"&sessionID="+q,AJAXRequestContent,CallBack,ErrorHandler,m);}else{HTTP.post(c+"?random="+new Date().getTime()+"&sessionID="+q,AJAXRequestContent,CallBack,ErrorHandler,m);}}else{if(c.toString().indexOf("?")>0){HTTP.post(c+"&random="+new Date().getTime(),AJAXRequestContent,CallBack,ErrorHandler,m);}else{HTTP.post(c+"?random="+new Date().getTime(),AJAXRequestContent,CallBack,ErrorHandler,m);}}}}}}};SB.base.HideMeAfterAFewSeconds=function(c){layer=1;setTimeout("SB.base.divPopUp(1, 'hide')",c);};SB.base.DpAlertPage=function(c){layer=1;setTimeout("SB.base.OpenDiv('/t/customer/popupDomainPricing.aspx?layer=1', 'popBadSelect1','popVeil1','popLayer1');",1);setTimeout("SB.base.divPopUp(1, 'hide')",2000);if(c!=""){setTimeout("SB.base.OpenDiv('"+c+"?layer=1', 'popBadSelect1','popVeil1','popLayer1');",2001);}};SB.base.hideLayer1=function(){SB.base.divPopUp(1,"hide");};SB.base.hideLayer2=function(){SB.base.divPopUp(2,"hide");};SB.base.deferWindowCommand=function(c,d,k){if(typeof(c)!="string"){if(c.target){my=c.target;}else{if(c.srcElement){my=c.srcElement;}}if(my.nodeType==3){my=my.parentNode;}c=(my.url).replace("http://"+document.location.host,"");d=my.params[1];k=(my.params[2]!="true")?false:true;}try{var g=document.frmDeferWindowCommand;var f=SB.base.getPageURLWithoutUseraction(g.action);if(!isLocalhost){g.action=f.replace("http:/","https:/");}g.windowUrl.value=c;g.windowType.value=d;g.isLoginRequired.value=k;g.submit();}catch(e){}};SB.base.PageQuery=function(d){if(d.length>1){this.q=d.substring(1,d.length);}else{this.q=null;}this.keyValuePairs=new Array();if(d&&(d.length>1)){for(var c=0;c<this.q.split("&").length;c++){this.keyValuePairs[c]=this.q.split("&")[c];}}this.getKeyValuePairs=function(){return this.keyValuePairs;};this.getValue=function(f){for(var e=0;e<this.keyValuePairs.length;e++){if(this.keyValuePairs[e].split("=")[0]==f){return this.keyValuePairs[e].split("=")[1];}}return false;};this.getParameters=function(){var e=new Array(this.getLength());for(var f=0;f<this.keyValuePairs.length;f++){e[f]=this.keyValuePairs[f].split("=")[0];}return e;};this.getLength=function(){return this.keyValuePairs.length;};};SB.base.closeDivRefreshWindow=function(){gPops[0]["view"]="hide";gPops[1]["view"]="hide";SB.base.inPlayResize();location.href=SB.base.getPageURLWithoutUseraction();};SB.base.getPageURLWithoutUseraction=function(d){var g="";var e="";if(d==null){g=location.href;e=window.location.search;}else{g=d;var c=d.split("?");if(c[1]!=null){e="?"+c[1];}}var l=new SB.base.PageQuery(e);var m=unescape(l.getValue("useraction"));var r=g.split("#");var k=r[0];if(m!="false"){k=k.replace(e,"");var q=l.getKeyValuePairs();if(q.length>1){var o="";for(var f=0;f<q.length;f++){if(q[f].match("useraction=")==null&&q[f].match("action=")==null&&q[f].match("client=")==null){o+=q[f]+"&";}}if(o.length>1){k+="?"+o.substr(0,o.length-2);}}}else{r=g.split("#");k=r[0];}return k;};SB.base.loadPopup=function(e,c,d){try{if(d){SB.base.deferWindowCommand(e,"popup",c);}else{SB.base.OpenDivCheckLoginStatus(e,"popBadSelect1","popVeil1","popLayer1",c);}}catch(f){}};SB.base.loadUrlInPopUp=function(c,d,f,e){if((c!=null)&&(d=="popup")){$(document).ready(function(){SB.base.loadPopup(c,e,!f);});}};SB.base.extractScriptsSource=function(e){var g=new RegExp("<script src=[^>]*>([\\S\\s]*?)<\/script>","img");var d=new RegExp("<script src=[^>]*>([\\S\\s]*?)<\/script>","im");var f=e.match(g);if(f==null){return"";}for(var c=0;c<f.length;c++){f[c]=(f[c].match(d)||["",""])[1];}return f;};SB.base.searchHeadTagsforScript=function(e){try{var d=false;var g=document.getElementsByTagName("HEAD")[0];var c=g.getElementsByTagName("SCRIPT");for(var k=0;k<c.length;k++){if(c[k].getAttribute("src")!=null&&c[k].getAttribute("src")!=""){if(c[k].getAttribute("src").indexOf(e)>=0){d=true;break;}}}return(d);}catch(f){return(false);}};HTTP.loadScriptFile=function(c){var d=document.createElement("script");d.src=c;d.type="text/javascript";setTimeout("",100);document.getElementsByTagName("head")[0].appendChild(d);};SB.base.CloseDivs=function(){return"none";};SB.base.ShowMobileDiv=function(){if((document.getElementById("ctrlPreferences_modCustPreferencesCbxSmsAlerts"))&&(document.getElementById("ctrlPreferences_modCustPreferencesMobileDiv"))){if(document.getElementById("ctrlPreferences_modCustPreferencesCbxSmsAlerts").checked){document.getElementById("ctrlPreferences_modCustPreferencesMobileDiv").className="show";}else{document.getElementById("ctrlPreferences_modCustPreferencesMobileDiv").className="hide";}}};SB.base.initializeTooltip=function(e,d,c){e.className="icons icoError";d.className="toolTipText tttError";SB.base.removeExistingTooltipMessage(d);SB.base.createTooltipMessageTag(d,c);};SB.base.removeExistingTooltipMessage=function(c){c.innerHTML="";};SB.base.createTooltipMessageTag=function(d,c){var e=document.createElement("span");d.innerHTML='<span class="tttContent">'+c+"</span>";};SB.base.LoadGenericLabels=function(e,d){e.AreLabelsLoaded=false;e.Labels=new Hashtable();var c=new SB.base.GenericLabelsHandler(e);var f=new AjaxService(c);f.GetRequest(d);f=null;c=null;};SB.base.GenericLabelsHandler=function(c){this.inheritFrom=ResponseHandlerBase;this.inheritFrom();this.avoidCaching=false;this.traceLevel=4;this.verify=function(d){return(d.match(/<labelText(.)*>/)!=null);};this.processNode=function(e,f,d){switch(f){case"label":c.Labels.put(e.getAttribute("id"),d);break;}};this.execute=function(){c.AreLabelsLoaded=true;};};SB.base.inferLoginSource=function(c){var d=undefined;if(c.search(/depositpopuploader/i)>=0){d="deposit";}if(c.search(/withdrawalpopuploader/i)>=0){d="withdraw";}if(c.search(/multiclientdownloadpopup/i)>=0){d="poker";}return d;};SB.base.openDepositOrWithdrawalPopup=function(c){Global_processingTitle="hidden";SB.base.OpenDivCheckLoginStatus(c,"popBadSelect1","popVeil1","popLayer1",true);};SB.base.ReloadPage=function(){SB.base.holdingDiv("show");document.getElementById("refreshform").submit();};SB.base.isScrolledIntoView=function(e){var g=$(window).scrollTop();var f=g+$(window).height();var c=$(e).offset().top;var d=c+$(e).height();return((d>=g)&&(c<=f));};function expandFaq(c){document.getElementById("item"+c).style.display="block";document.getElementById("expander"+c).href="javascript:collapseFaq("+c+")";document.getElementById("expander"+c).title="Collapse";}function collapseFaq(c){document.getElementById("item"+c).style.display="none";document.getElementById("expander"+c).href="javascript:expandFaq("+c+")";document.getElementById("expander"+c).title="Expand";}function showAllFaqs(){var d=document.getElementById("faqCount").value;for(var c=1;c<=d;c++){expandFaq(c);}}function hideAllFaqs(){var d=document.getElementById("faqCount").value;for(var c=1;c<=d;c++){collapseFaq(c);}}function popUp(e,d,c){window.open(e,d,c);}$(document).ready(function(){try{if(!document.getElementsByTagName){return false;}var c=document.getElementsByTagName("a");for(i=0;i<c.length;i++){link=c[i];if(link.className&&(" "+link.className+" ").indexOf(" popup ")!=-1){link.onclick=function(){var g=780;var r=590;var f="popup";var e=1;var m=1;var k=1;var l=1;if(this.getAttribute("rel")){var o=this.getAttribute("rel");var q=o.split(" ");f=q[0]?q[0]:f;g=q[1]?q[1]:g;r=q[2]?q[2]:r;e=q[3]?q[3]:e;m=q[4]?q[4]:m;k=q[5]?q[5]:k;l=q[6]?q[6]:l;}if((g+5>screen.width)||(r+80>screen.height)){e=1;m=1;}attributes="width="+g+",height="+r+", resizable="+e+", scrollbars="+m+", status="+k+", location="+l+",toolbar="+l;popUp(this.getAttribute("href"),f,attributes);return false;};}}}catch(d){alert(d);}});if(typeof com=="undefined"){var com=new Object();}if(typeof com.deconcept=="undefined"){com.deconcept=new Object();}if(typeof com.deconcept.util=="undefined"){com.deconcept.util=new Object();}if(typeof com.deconcept.FlashObjectUtil=="undefined"){com.deconcept.FlashObjectUtil=new Object();}com.deconcept.FlashObject=function(k,f,v,m,r,u,s,y,d,g){this.DETECT_KEY=g?g:"detectflash";this.skipDetect=com.deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(k){this.setAttribute("swf",k);}if(f){this.setAttribute("id",f);}if(v){this.setAttribute("width",v);}if(m){this.setAttribute("height",m);}if(r){this.setAttribute("version",new com.deconcept.PlayerVersion(r.toString().split(".")));}if(u){this.addParam("bgcolor",u);}var e=y?y:"high";this.addParam("quality",e);this.setAttribute("redirectUrl","");if(d){this.setAttribute("redirectUrl",d);}if(s){var l=new com.deconcept.PlayerVersion([6,0,65]);var o=com.deconcept.FlashObjectUtil.getPlayerVersion();if(o.versionIsValid(l)&&!o.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);}}else{this.setAttribute("doExpressInstall",false);}};com.deconcept.FlashObject.prototype.setAttribute=function(c,d){this.attributes[c]=d;};com.deconcept.FlashObject.prototype.getAttribute=function(c){return this.attributes[c];};com.deconcept.FlashObject.prototype.getAttributes=function(){return this.attributes;};com.deconcept.FlashObject.prototype.addParam=function(c,d){this.params[c]=d;};com.deconcept.FlashObject.prototype.getParams=function(){return this.params;};com.deconcept.FlashObject.prototype.getParam=function(c){return this.params[c];};com.deconcept.FlashObject.prototype.addVariable=function(c,d){this.variables[c]=d;};com.deconcept.FlashObject.prototype.getVariable=function(c){return this.variables[c];};com.deconcept.FlashObject.prototype.getVariables=function(){return this.variables;};com.deconcept.FlashObject.prototype.getParamTags=function(){var d="";var c;var e=this.getParams();for(c in e){d+='<param name="'+c+'" value="'+e[c]+'" />';}return d;};com.deconcept.FlashObject.prototype.getVariablePairs=function(){var c=new Array();var d;var e=this.getVariables();for(d in e){c.push(d+"="+e[d]);}return c;};com.deconcept.FlashObject.prototype.getHTML=function(){var c="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");}c+='<embed type="application/x-shockwave-flash" src="'+this.getAttribute("swf")+'" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" id="'+this.getAttribute("id")+'" name="'+this.getAttribute("id")+'"';var g=this.getParams();for(var e in g){c+=" "+e+'="'+g[e]+'"';}f=this.getVariablePairs().join("&");if(f.length>0){c+=' flashvars="'+f+'"';}c+='wmode="transparent" ></embed>';}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");}c+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" id="'+this.getAttribute("id")+'">';c+='<param name="movie" value="'+this.getAttribute("swf")+'" />';var d=this.getParamTags();if(d.length>0){c+=d;}var f=this.getVariablePairs().join("&");if(f.length>0){c+='<param name="flashvars" value="'+f+'" />';}c+='<param name="wmode" value="opaque"/> </object>';}return c;};com.deconcept.FlashObject.prototype.write=function(c){if(this.skipDetect||this.getAttribute("doExpressInstall")||com.deconcept.FlashObjectUtil.getPlayerVersion().versionIsValid(this.getAttribute("version"))){if(document.getElementById){if(this.getAttribute("doExpressInstall")){this.addVariable("MMredirectURL",escape(window.location));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}document.getElementById(c).innerHTML=this.getHTML();}}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}};com.deconcept.FlashObjectUtil.getPlayerVersion=function(){var d=new com.deconcept.PlayerVersion(0,0,0);if(navigator.plugins&&navigator.mimeTypes.length){var c=navigator.plugins["Shockwave Flash"];if(c&&c.description){d=new com.deconcept.PlayerVersion(c.description.replace(/([a-z]|[A-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(window.ActiveXObject){try{var f=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");d=new com.deconcept.PlayerVersion(f.GetVariable("$version").split(" ")[1].split(","));}catch(g){}}}return d;};com.deconcept.PlayerVersion=function(c){this.major=parseInt(c[0])||0;this.minor=parseInt(c[1])||0;this.rev=parseInt(c[2])||0;};com.deconcept.PlayerVersion.prototype.versionIsValid=function(c){if(this.major<c.major){return false;}if(this.major>c.major){return true;}if(this.minor<c.minor){return false;}if(this.minor>c.minor){return true;}if(this.rev<c.rev){return false;}return true;};com.deconcept.util.getRequestParameter=function(f){var d=document.location.search||document.location.href.hash;if(d){var e=d.indexOf(f+"=");var c=(d.indexOf("&",e)>-1)?d.indexOf("&",e):d.length;if(d.length>1&&e>-1){return d.substring(d.indexOf("=",e)+1,c);}}return"";};if(Array.prototype.push==null){Array.prototype.push=function(c){this[this.length]=c;return this.length;};}var getQueryParamValue=com.deconcept.util.getRequestParameter;var FlashObject=com.deconcept.FlashObject;function ShowDiv(c){document.getElementById(c).style.display="";}function HideDiv(c){document.getElementById(c).style.display="none";}function ShowContactUsEmailForm(){ShowDiv("showEmailForm");HideDiv("EmailFormLink");ShowDiv("EmailFormHide");}function HideContactUsEmailForm(){HideDiv("showEmailForm");ShowDiv("EmailFormLink");HideDiv("EmailFormHide");}function InitialiseContactUsForm(){if(document.getElementById("ctrlContactUsEmail_errMsg")!=null){ShowContactUsEmailForm();}else{if(document.getElementById("ctrlContactUsEmail_lblInfo")!=null){ShowContactUsEmailForm();}}}function MM_findObj(k,g){var f,e,c;if(!g){g=document;}if((f=k.indexOf("?"))>0&&parent.frames.length){g=parent.frames[k.substring(f+1)].document;k=k.substring(0,f);}if(!(c=g[k])&&g.all){c=g.all[k];}for(e=0;!c&&e<g.forms.length;e++){c=g.forms[e][k];}for(e=0;!c&&g.layers&&e<g.layers.length;e++){c=MM_findObj(k,g.layers[e].document);}if(!c&&document.getElementById){c=document.getElementById(k);}return c;}function MM_showHideLayers(){var e,g,c,f,d=MM_showHideLayers.arguments;for(e=0;e<(d.length-2);e+=3){if((f=MM_findObj(d[e]))!=null){c=d[e+2];if(f.style){f=f.style;c=(c=="show")?"visible":(c="hide")?"hidden":c;}f.visibility=c;}}}function setCookie(d,g,k,f,c){var e=d+"="+escape(g)+((c==null)?"":"; expires="+c.toGMTString())+((k==null)?"":"; path="+k)+((f==null)?"":"; domain="+f);document.cookie=e;}function getCookie(e){var d=e+"=";var c=document.cookie;if(c.length>0){begin=c.indexOf(d);if(begin!=-1){begin+=d.length;end=c.indexOf(";",begin);if(end==-1){end=c.length;}return unescape(c.substring(begin,end));}}return null;}function delCookie(c,e,d){if(getCookie(c)){document.cookie=c+"="+((e==null)?"":"; path="+e)+((d==null)?"":"; domain="+d);}}(function(d){d.fn.preventInvalidCharacters=function(e){var f=false;d(this).unbind(".preventInvalidCharacters").bind("keypress.preventInvalidCharacters",function(g){if(f){return;}f=true;d.data(this,"origValue",d(this).val());}).bind("keyup.preventInvalidCharacters blur.preventInvalidCharacters",function(g){c(this,e);f=false;}).bind("paste.preventInvalidCharacters",function(k){var g=this;d.data(g,"origValue",d(g).val());setTimeout(function(){c(g,e);},0);});};function c(k,g){var f=d(k).val();var e=new RegExp(g);if(!e.test(f)){d(k).val(d.data(k,"origValue")||"");}}})(jQuery);if($.browser.msie&&!Number.prototype.slice){Number.prototype.slice=function(c,d){return this.toString().slice(c,d);};}function gotoDownload(){gaPokerDownload();var c=$.cookie("rStatus");if(c==null||c==1){var d="/t/customer/registrationpopup.aspx?submit=downloadForm";SB.base.deferWindowCommand(d,"popup",false);}else{document.downloadForm.submit();}}function savePIN(c){document.cookie="paradisePokerPin="+escape(c)+";path=/;expires=Thu, 31-Dec-2099 23:59:59 GMT";}function loadPIN(){var c=document.getElementById("statsIframe");var d=getCookie("paradisePokerPin");c.src=c.src+d;c.refresh;}function getQueryStringValue(e){var d=new Object();var l=location.search.substring(1);var k=l.split("&");for(var f=0;f<k.length;f++){var m=k[f].indexOf("=");if(m==-1){continue;}else{var c=k[f].substring(0,m);var g=k[f].substring(m+1);if(c==e){return g;}}}return"";}function expandHallofFame(c){document.getElementById("item"+c).style.display="block";document.getElementById("expander"+c).href="javascript:collapseFaq("+c+")";document.getElementById("expander"+c).title="Collapse";}function collapseHallofFame(c){document.getElementById("item"+c).style.display="none";document.getElementById("expander"+c).href="javascript:expandFaq("+c+")";document.getElementById("expander"+c).title="Expand";}var is_ie=(navigator.userAgent.indexOf("MSIE")>=0)?1:0;var is_ie5=(navigator.appVersion.indexOf("MSIE 5.5")!=-1)?1:0;var is_opera=((navigator.userAgent.indexOf("Opera6")!=-1)||(navigator.userAgent.indexOf("Opera/6")!=-1))?1:0;var is_netscape=(navigator.userAgent.indexOf("Netscape")>=0)?1:0;var sessionTimeOut=5;var bFlag=false;var popUpPreview=null;function loadGameLabels(){var c=new LabelsHandler();var d=new AjaxService(c);d.GetRequest("/config/translation/games/gameLabels.xml");d=null;c=null;}function keepSessionAlive(){var c={type:"POST",url:"/misc/games/webservices/sessionKeepAlive.ashx",data:"",success:function(d){if(d==1){GameSessionServiceHandler();}else{mainSessionLoggedOut();}},error:function(){mainSessionLoggedOut();}};jQuery.ajax(c);}function GameSessionServiceHandler(){this.inheritFrom=ResponseHandlerBase;this.inheritFrom();setTimeout("keepSessionAlive()",(60000*sessionTimeOut));}function initialiseKeepAlive(){setTimeout("keepSessionAlive()",(60000*sessionTimeOut));}function mainSessionLoggedOut(){alert(service.labels.mainSessionLoggedOut);window.close();}function generateGameHref(g,f,c){if(f=="popup"){if(c!=null){var e=c.split(" ");var d="width="+e[1]+",height="+e[2]+",resizable=yes,scrollbars=yes,status=no,location=no,toolbar=no";popUp(g,e[0],d);}}else{location.href=g;}}function launchGameDropdown(){var d=document.getElementById("gameDropdown");var c=d.options[d.selectedIndex];generateGameHref(c.value,c.className,c.getAttribute("rel"));}function addToMyGames(f,k){var d=getCookie("myGames");var e;var g=new Array();var l=0;if(d!=null){e=d.split("/");for(var c=0;c<e.length;c++){if(e[c]!=f){g[l]=e[c];l++;}else{return;}}}g[l]=f;d=g.join("/");saveGamesCookie(d);showPreview(false,"addGameToMyGames");alert(service.labels.myGamesAdded.replace("[PLACEHOLDER]",k));}function addToMyGames2(f,k){var d=getCookie("myGames");var e;var g=new Array();var l=0;if(d!=null){e=d.split("/");for(var c=0;c<e.length;c++){if(e[c]!=f){g[l]=e[c];l++;}else{return;}}}g[l]=f;d=g.join("/");saveGamesCookie(d);return true;}function removeFromMyGames(f,k){if(confirm(service.labels.removalConfirmation)){var d=getCookie("myGames");var e;var g=new Array();var l=0;if(d!=null){e=d.split("/");for(var c=0;c<e.length;c++){if(e[c]!=f){g[l]=e[c];l++;}}d=g.join("/");saveGamesCookie(d);document.getElementById("gameRemovedMessage").innerHTML=service.labels.myGamesRemoved.replace("[PLACEHOLDER]",k);document.getElementById("game_"+f).innerHTML="<img src='/s/images/games/remove.png' class='removed' alt='"+service.labels.removalAlt+"' />";}}}function showExitGame(g,e,d){showPreview(g,e,d);if(g){showPreview(false,"showExitButton");showPreview(true,"showPlayButton");}else{showPreview(true,"showExitButton");showPreview(false,"showPlayButton");}var c=getCookie("myGames");if(c!=null&&c.length>0){showPreview(true,"mygame");showPreview(false,"nomygame");}else{showPreview(true,"nomygame");showPreview(false,"mygame");}var f=document.getElementById("gameId").innerHTML;if(c!=null&&c.length>0){if(c.indexOf(f)==-1){showPreview(true,"notInMyGames");showPreview(false,"inMyGames");}else{showPreview(true,"inMyGames");showPreview(false,"notInMyGames");}}}function gameExists(f){var d=getCookie("myGames");var e;if(d!=null){e=d.split("/");for(var c=0;c<e.length;c++){if(e[c]==f){return true;}}}return false;}function setUpPage(){if(document.getElementById("showExitButton")){showPreview(true,"showExitButton");showPreview(false,"showPlayButton");}var c=document.getElementById("gameId").innerHTML;if(gameExists(c)){showPreview(false,"addGameToMyGames");}}function closePopUpPreview(c){showPreview(false,popUpPreview);}function showPreview(e,d,c){if(document.layers){if(e){document.layers[d].visibility="show";document.layers[d].display="";}else{unloadGamePlayer(c);document.layers[d].visibility="hide";document.layers[d].display="none";}}else{if(document.getElementById){if(e){document.getElementById(d).style.visibility="visible";document.getElementById(d).style.display="";}else{unloadGamePlayer(c);document.getElementById(d).style.visibility="hidden";document.getElementById(d).style.display="none";}}else{if(document.all(d).style.visibility=="visible"){document.all(d).style.visibility="visible";document.all(d).style.display="";}else{unloadGamePlayer(c);document.all(d).style.visibility="hidden";document.all(d).style.display="none";}}}}function unloadGamePlayer(c){var d=document.getElementById(c);if(d!=null){d.src="/t/games/gameHelp.aspx?gameCode="+c;}}function showGamePreview(d,c,o){var e=document.getElementById(c);var q=document.getElementById(o);var m=0,l=0;if(popUpPreview!=null){showPreview(false,popUpPreview);}if(d){q.focus();e.style.position="absolute";e.style.display="block";if(document.body&&typeof document.body.scrollTop!="undefined"){m+=document.body.scrollLeft;l+=document.body.scrollTop;if(document.body.parentNode.scrollTop&&typeof document.body.parentNode.scrollTop!="undefined"){m+=document.body.parentNode.scrollLeft;l+=document.body.parentNode.scrollTop;}}else{if(typeof window.pageXOffset!="undefined"){m+=window.pageXOffset;l+=window.pageYOffset;}}var g=getElementPosition(q);var k=g.left;var f=g.top;e.style.left=25+"%";e.style.top=(f+document.documentElement.scrollTop)+"px";e.style.visibility="visible";q.focus();popUpPreview=c;}else{e.style.visibility="hidden";e.style.display="none";e.style.top="";e.style.left="";popUpPreview=null;}}function getElementPosition(f){var c=document.getElementById(f);var e=0;var d=0;while(c){e+=c.offsetLeft;d+=c.offsetTop;c=c.offsetParemt;}return{left:e,top:d};}function saveGamesCookie(c){document.cookie="myGames="+escape(c)+";path=/;expires=Thu, 31-Dec-2099 23:59:59 GMT";}function displayPopupWindow(g,f,d){var e=location.href;var c=e.indexOf("/t/");e=e.substring(0,c);var g=e+g;var k=window.open(g,f,d);checkWindowResize(d,k);}function checkWindowResize(f,l){var d=f.split(",");var e=d[0].split("=");var k=d[1].split("=");var g=Number(e[1]);var c=Number(k[1])+85;l.resizeTo(g,c);}if(typeof(GRS)=="undefined"||GRS==null){var GRS=new Object();}if(!GRS.resizeGameIframe){GRS.resizeGameIframe=function(d,c){var e="#showGame iframe";$(e).width(d);$(e).height(c);};}if(!GRS.bingoResize){GRS.bingoResize=function(){if(screen.height<873){var c=screen.height-200;var d=1010;if(screen.width<d+10){d=screen.width-10;}window.moveTo(0,0);GRS.resizeGameIframe(d,c);}};}if(!GRS.loadNeoGame){GRS.loadNeoGame=function(e,s,g,u,o,k,l,f,r,q,c,m,d){LoadGame(e,s,g,u,o,k,l,f,r,q,c,m,d);window.onresize=null;};}if(!Array.prototype.remove){Array.prototype.remove=function(d){if(this instanceof Array){for(var c=0;c<this.length;c++){if(this[c]==d){this.splice(c,1);}}}};}if(!Array.prototype.forEach){Array.prototype.forEach=function(d){if(this instanceof Array){if(d instanceof Function){for(var c=0;c<this.length;c++){d(this[c]);}}}};}if(!Array.prototype.clone){Array.prototype.clone=function(){if(this instanceof Array){return this.slice(0);}return null;};}if(!Array.prototype.indexOf){Array.prototype.indexOf=function(d){for(var c=0;c<this.length;c++){if(this[c]==d){return c;}}return -1;};}if(!Array.prototype.first){Array.prototype.first=function(c){if(this instanceof Array&&c instanceof Function){for(var d=0;d<this.length;d++){if(c(this[d])){return this[d];}}}return null;};}if(!Array.fromHTMLCollection){Array.fromHTMLCollection=function(d){var c=new Array();for(var e=0;e<d.length;e++){c.push(d[e]);}return c;};}if(!String.prototype.encodeHTML){String.prototype.encodeHTML=function(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");};}if(!String.prototype.decodeHTML){String.prototype.decodeHTML=function(){return this.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">");};}(function(c){c.fn.centerTo=function(d){if(d==null){return;}d=c(d);var f=Math.round((d.width()-this.width())/2);var e=Math.round((d.height()-this.height())/2);this.css("left",f+"px");this.css("top",e+"px");};c.a=function(e,d){if(!c(e).hasClass("disabled")){d();}};c.moveWindowToCenter=function(f,e){if(typeof(f)=="undefined"||f==null){return false;}if(f.outerWidth){e.width=f.outerWidth;}if(f.outerHeight){e.height=f.outerHeight;}var d=(screen.availWidth-e.width)/2;var g=(screen.availHeight-e.height)/2;f.moveTo(d,g);return true;};c.fn.outerHTML=function(){return c("<div>").append(this.eq(0).clone()).html();};c.fn.where=function(e){var d=new Array();this.each(function(f,g){if(e(f,g)){d.push(g);}});return c(d);};c.fn.first=function(d){var f=null;for(var e=0;e<this.length;e++){if(d(e,this.get(e))){f=this.get(e);break;}}return c(f);};})(jQuery);if(typeof(GRS)=="undefined"||GRS==null){var GRS=new Object();}if(typeof(GRS.MultiGaming)=="undefined"||GRS.MultiGaming==null){GRS.MultiGaming=new Object();}if(!GRS.MultiGaming.isEmptyPopupWindow){GRS.MultiGaming.isEmptyPopupWindow=function(c){return GRS.safeExec(function(){return c.location.href.indexOf(SimplePopup.popupWindow.fileName)==-1&&c.location.href.indexOf(GamesPopup.popupWindow.fileName)==-1;},function(){return true;});};}if(!GRS.safeExec){GRS.safeExec=function(e,c){try{return e();}catch(d){if(c){return c();}}};}if(!GRS.MultiGaming.loadGameInfo){GRS.MultiGaming.loadGameInfo=function(d,c,e){$.ajax({type:"GET",url:"/multigaming.mvc/GetGameInfo",data:"gameCode="+d,contentType:"application/json; charset=utf-8",dataType:"json",success:function(f){if(c){c(f);}},error:function(f){if(e){e(f);}}});};}if(!GRS.MultiGaming.getPopupWindowInstance){GRS.MultiGaming.getPopupWindowInstance=function(c,d){return window.open("",c,d);};}SimplePopup=function(){var e=this;var c="#game #showGame";this.setDialogResult=null;this.showCloseWindowMessage=function(g){f(MessageTypes.CloseAllGames,null,function(k){if(g){g(k);}});};function d(g){e.setDialogResult=function(k){if(typeof(g)!="undefined"&&g!=null){g(k);}e.setDialogResult=null;};}this.closeMessage=function(g){GRS.hideDialog(g);$(c).css("visibility","visible");};function f(k,g,l){d(l);$(c).css("visibility","hidden");GRS.showDialog(k,g);$(window).focus();}this.getOperationMode=function(){return OperationModes.Single;};};SimplePopup.popupWindow={name:"gamesPopup",fileName:"/t/games/game.aspx",format:"width=600,height=400,statusbar=no,resizeable=no,scrollbars=no"};SimplePopup.getPopupWindowInstance=function(){return GRS.MultiGaming.getPopupWindowInstance(SimplePopup.popupWindow.name,SimplePopup.popupWindow.format);};GRS.dialog=null;GRS.showDialog=function(c,g,d){var l=$("#"+c);var q="clone"+l.attr("id");var e=$('<div id="'+q+'_background" class="popupBackground dialogBackground"></div>');e.hide();$("body").append(e);var f=l.outerHTML();for(prop in g){f=f.replace(new RegExp("\\["+prop+"\\]","g"),g[prop]);}var o=$(f);o.attr("id",q);var m=$('<div class="popupDiv dialog"><div id="popupBox" class="popup" style="position: absolute"></div></div>');var k=$("#popupBox",m);d=k.attr("style")+(d==null?"; max-width: 450px;":d);k.attr("style",d);k.append(o);$(window).resize(function(){k.centerTo(m);});m.hide();$("body").append(m);GRS.dialog=c;e.show();m.show();k.centerTo(m);};GRS.hideDialog=function(f){var c="clone"+f;var e=$("#"+c).parent().parent();e.hide();var d=$("#"+c+"_background");d.hide();GRS.dialog=null;$(e,"body").remove();$(d,"body").remove();};GRS.MultiGaming.Messages=new Object();Messages=GRS.MultiGaming.Messages;Messages.OpenGame="openGame";GRS.MultiGaming.GameController=new Object();GameController=GRS.MultiGaming.GameController;GameController.openGame=function(c){var e="gamingProxy";if($("#"+e).length==0){d(c);}else{f(c);}function f(){$.pm({target:window.frames[e],type:Messages.OpenGame,data:{gameCode:c}});}function d(){var g=$("<iframe></iframe>");g.attr("src","/t/games/multiGamingProxy.aspx?gameCode="+c);g.attr("frameborder","no");g.attr("id",e);g.attr("name",e);g.attr("style","display: none");$("body").append(g);}};GameController.open=function(e){GRS.MultiGaming.loadGameInfo(e,function(f){var g=$.browser;if(g.msie&&parseInt(g.version)<=7){c(f);}else{var k=GamesPopup.getPopupWindowInstance();if(!GRS.MultiGaming.isEmptyPopupWindow(k)){if(k.GRS.MultiGaming.Popup.getOperationMode()==OperationModes.Single){if(!f.isBetByBetSupported){c(f);}else{k.GRS.MultiGaming.Popup.showCloseWindowMessage(function(l){if(l){d(f);}});}}else{if(!f.isBetByBetSupported){k.GRS.MultiGaming.Popup.showCloseWindowMessage(function(l){if(l){k.GRS.MultiGaming.Popup.closeAllGames(false);c(f);}});}else{d(f);}}}else{if(f.isBetByBetSupported){d(f);}else{c(f);}}}},function(f){});function d(g){var f=null;var k=GamesPopup.getPopupWindowInstance();if(GRS.MultiGaming.isEmptyPopupWindow(k)||k.GRS.MultiGaming.Popup.getOperationMode()==OperationModes.Single){k.open(GamesPopup.popupWindow.fileName+"?gameId="+e,GamesPopup.popupWindow.name,GamesPopup.popupWindow.format);GamesPopup.clearCookie();GRS.safeExec(function(){k.moveTo(20,20);});}else{f=k.GRS.MultiGaming.Popup;}if(f!=null){f.openGame(e);}}function c(f){displayPopupWindow("/t/games/game.aspx?gameCode="+f.gameCode,SimplePopup.popupWindow.name,"width="+f.width+", height="+f.height+",statusbar=no,resizeable=no,scrollbars=no,left=20,top=20");var g=GamesPopup.getPopupWindowInstance();g.moveTo(20,20);g.focus();}};GRS.MultiGaming.OperationModes=new Object();OperationModes=GRS.MultiGaming.OperationModes;OperationModes.Single=0;OperationModes.Multi=1;GRS.MultiGaming.MessageTypes=new Object();MessageTypes=GRS.MultiGaming.MessageTypes;MessageTypes.MaxCountReached="maxCountReached";MessageTypes.GameNotFound="gameNotFound";MessageTypes.CloseAllGames="closeAllGames";MessageTypes.GameAddedToMyGames="gameAddedToMyGames";MessageTypes.GameLoadError="gameLoadError";MessageTypes.CloseWindow="closeGamingWindow";MessageTypes.LoggedOut="loggedOut";MessageTypes.DenyMultipleInstances="denyMultipleInstances";GameInfo=function(g,d,e,f,c){this.getGameName=function(){return g;};this.getGameCode=function(){return d;};this.getTabId=function(){return e;};this.getGameId=function(){return f;};this.denyMultipleInstances=function(){return c;};};GamesPopup=function(){var w=this;var P=new Array();var Q=null;var d="#tabheaders";var c=".gameSelectorContainer";var m="#tabs";var M=1511;var G=4;var J="#openEmbeddedGames";var D="#closeEmbeddedGames";var I="#embeddedGameContainer";var E=null;var g="#gameMainContainer";var o=c+" #gameDropDown";var y=GamesPopup.popupWindow;this.showCloseDialog=true;this.setDialogResult=null;var u=null;var V=null;f();function f(){u=$("#gameDropDown").dropDownMenu({},{onItemSelected:function(Y,X){w.gameSelectorChanged(X);},onOpen:function(){w.gameSelectorOpen();},onClosed:function(){w.gameSelectorClosed();}});}this.openGame=function(X){var Y=T(X);if(!Y){var Z=P.first(function(aa){return aa.getGameCode()==X;});if(Z!=null&&Z.denyMultipleInstances()){F(MessageTypes.DenyMultipleInstances,{gameName:Z.getGameName()});}else{GRS.MultiGaming.loadGameInfo(X,function(aa){W.call(GRS.MultiGaming.Popup,aa);},function(){F(MessageTypes.GameLoadError);});}}$(E).focus();};this.getOperationMode=function(){return Q;};function A(){var X="";P.forEach(function(Y){X+=Y.getGameCode()+", ";});X=X.substr(0,X.length-2);$.cookie(GamesPopup.openedGamesCookie,X);}this.getCookieGames=function(){var X=new Array();var Y=$.cookie(GamesPopup.openedGamesCookie);if(Y!=null&&Y.length>0){X=$.cookie(GamesPopup.openedGamesCookie).split(", ");}return X;};function T(X){if(E==null||E.closed){E=window.open("",y.name,y.format);if(GRS.MultiGaming.isEmptyPopupWindow(E)||E.GRS.MultiGaming.Popup.getOperationMode()==OperationModes.Single){Q=null;if(X!=null){E=window.open(y.fileName+"?gameId="+X,y.name,y.format);}return true;}}return false;}this.gameSelectorChanged=function(aa){var Z=$("> a",aa);var Y=Z.attr("name");var X=Z.hasClass("disabled");if(!X){this.openGame(Y);}};this.gameSelectorOpen=function(){$("> #tabPanels",m).addClass("gameSelectorOpen");};this.gameSelectorClosed=function(){$("> #tabPanels",m).removeClass("gameSelectorOpen");};this.getOpenedGames=function(){return P;};this.showEmbeddedGames=function(){$(J).hide();$(D).show();$(I).show();$(g).resizeWindowClientArea();window.moveTo(0,20);};this.hideEmbeddedGames=function(){$(D).hide();$(J).show();$(I).hide();$(g).resizeWindowClientArea();window.setTimeout(function(){$.moveWindowToCenter(window,{width:1005,height:854});},200);};this.showCloseWindowMessage=function(X){F(MessageTypes.CloseAllGames,null,function(Y){if(X){X(Y);}});};this.getOperationMode=function(){return Q;};this.addToFavoritGames=function(){var X=N();if(X==null){return;}addToMyGames2(X.getGameId(),X.getGameName());F(MessageTypes.GameAddedToMyGames,{gameName:X.getGameName()});};this.displayGameHelp=function(){var X=N();if(X==null){return;}displayPopupWindow("/t/games/gameHelp.aspx?gameCode="+X.getGameCode(),"gameHelp","width=800,height=600,statusbar=no,resizeable=no,scrollbars=yes");};this.closeMessage=function(X){GRS.hideDialog(X);if(typeof(V)!="undefined"&&V!=null){V.showGameTabs();}};this.closeAllGames=function(X){w.showCloseDialog=X;if(typeof(V)!="undefined"&&V!=null){V.closeAllTabs();}};this.userLoggedOut=function(){F(MessageTypes.LoggedOut,null,function(){window.close();});};function H(X){w.setDialogResult=function(Y){if(typeof(X)!="undefined"&&X!=null){X(Y);}w.setDialogResult=null;};}function R(Y,Z){if(Z){$("#"+Y).remove();$("#div-"+Y).remove();}var X=P.first(function(aa){return aa.getTabId()==Y;});q(X.getGameCode(),false);P.remove(X);A();if(P.length==0){Q=null;}e();}function l(X){R(X,false);if(!C()){if(w.showCloseDialog){F(MessageTypes.CloseWindow,null,function(Y){if(Y){window.close();}else{U(true);}});}}}function s(X){$("iframe",X).attr("src","about:blank");}function N(){if(P.length==0){return null;}var X=$(".stContainer ul li.sel").get(0).id;return P.first(function(Y){return X==Y.getTabId();});}function F(Y,X,Z){H(Z);k();GRS.showDialog(Y,X);$(window).focus();}function L(Y,X){$.ajax({type:"GET",url:"/multigaming.mvc/OpenGame",data:"gameCode="+X,contentType:"text/html; charset=utf-8",dataType:"text",success:function(Z){var ab=v();$("#div-"+Y).css("visibility",ab?"hidden":"visible");var aa=$("#div-"+Y+" .tabContent");aa.html(Z);O(aa);},error:function(){F(MessageTypes.GameLoadError);R.call(GRS.MultiGaming.Popup,Y,true);}});}function O(Y){var X=Y.offset().top;if($(window).height()-X<Y.height()){Y.height($(window).height()-X);Y.css("overflow-y","scroll");}}function v(){return typeof(V)!="undefined"&&V!=null&&!V.isGameTabsVisible();}function r(Y,Z){var X=$('<li id="'+Y+'"><a href="#div-'+Y+"\" class='tabHeader'>"+Z+"</a><img border='0' src='/s/images/games/tabClose.png' /></li>");return X;}function S(Y){var Z=v();var X=$('<div id="div-'+Y+'"><div class="tabContent"><div style="position:relative; width: 800px; top: 180px"><img  src="/s/images/ajax-loader.gif" /></div></div></div>');X.css("visibility",Z?"hidden":"visible");return X;}function k(){if(typeof(V)!="undefined"&&V!=null){V.hideGameTabs();}}function B(){k();SB.base.OpenDiv("/loginbar.mvc/popup?currentPageUrl="+location.href+"","popBadSelect1","popVeil1","popLayer1");}function W(X){if(!X.isUserLoggedIn){B();}else{if(X.isFound){if(Q==null){Q=X.isBetByBetSupported?OperationModes.Multi:OperationModes.Single;U(X.isBetByBetSupported);K.call(GRS.MultiGaming.Popup,X,P.length);}else{if(Q==OperationModes.Multi){if(X.isBetByBetSupported){if(G<=P.length){if(GRS.dialog!=MessageTypes.MaxCountReached){F(MessageTypes.MaxCountReached);}}else{K.call(GRS.MultiGaming.Popup,X,P.length);}}else{F(MessageTypes.CloseAllGames,null,function(Y){if(Y){w.closeAllGames();Q=OperationModes.Single;U(false);K.call(GRS.MultiGaming.Popup,X,0);}});}}else{if(Q==OperationModes.Single){if(X.isBetByBetSupported){F(MessageTypes.CloseAllGames,null,function(Y){if(Y){w.closeAllGames();Q=OperationModes.Multi;U(true);K.call(GRS.MultiGaming.Popup,X,0);}});}else{F(MessageTypes.CloseAllGames,null,function(Y){if(Y){w.closeAllGames();Q=OperationModes.Single;K.call(GRS.MultiGaming.Popup,X,0);}});}}}}}else{F(MessageTypes.GameNotFound);}}}function q(X,Z){var Y=$("li > a",o).where(function(aa,ab){return ab.name==X;});Y.each(function(aa,ab){var ac=$(ab);if(ac.length>0){if(Z){ac.addClass("disabled");}else{ac.removeClass("disabled");}}});}function K(aa,Y){var Z=aa.gameCode+M++;var X=r(Z,aa.gameName,aa.gameCode);var ab=S(Z);P.push(new GameInfo(aa.gameName,aa.gameCode,Z,aa.gameId,aa.denyMultipleInstances));A();if(aa.denyMultipleInstances){q(aa.gameCode,true);}$(d).append(X);$("> #tabPanels",m).append(ab);L(Z,aa.gameCode);V=$(m).smartTab({autoProgress:false,transitionEffect:"none",selected:Y,tabClosedCallback:l,beforeTabClosingCallback:s,isGameTabsHidden:v()})[0];e();}function C(){return P.length>0;}function U(X){if(!X){$(D).hide();$(J).hide();$(I).hide();$(g).resizeWindowClientArea();}else{$(D).hide();$(J).show();}}function e(){if(Q==OperationModes.Multi||Q==null){if(G<=P.length){u.forEach(function(X){X.collapse();});$(c).hide();}else{$(c).show();}}else{u.forEach(function(X){X.collapse();});$(c).hide();}}};GamesPopup.openedGamesCookie="openedGamesCookie";GamesPopup.clearCookie=function(){$.cookie(GamesPopup.openedGamesCookie,"");};GamesPopup.popupWindow={name:"gamesPopup",fileName:"/t/games/gamingpopup.aspx",format:"width=955,height=820,statusbar=no,resizeable=no,scrollbars=auto,top=20,left=20"};GamesPopup.getPopupWindowInstance=function(){return GRS.MultiGaming.getPopupWindowInstance(GamesPopup.popupWindow.name,GamesPopup.popupWindow.format);};(function(c){c.fn.resizeWindowClientArea=function(w){if(this.length>1){return false;}w=c.extend({},c.fn.resizeWindowClientArea.defaults,w);var e=this.width();var l=this.height();var u=c.browser.msie?w.msieResizeDelay:w.resizeDelay;var d=1;var k={deltaWidth:0,deltaHeight:0,width:0,height:0};var f=c("body");var g=c(window);var s={overflowX:f.get(0).style.overflowX,overflowY:f.get(0).style.overflowY,scroll:f.get(0).scroll};q();m(r);r();function v(){f.css("overflowY",s.overflowY);f.css("overflowX",s.overflowX);f.get(0).scroll=s.scroll;}function q(){f.css("overflowY","hidden");f.css("overflowX","hidden");f.get(0).scroll="";}function r(){window.setTimeout(function(){if(w.maxCycles<d){o(r);v();return;}d++;k.width=c(window).width();k.height=c(window).height();k.deltaWidth=(e-k.width);k.deltaHeight=(l-k.height);if(k.deltaWidth==0&&k.deltaHeight==0){o(r);v();return;}window.resizeBy(k.deltaWidth,k.deltaHeight);},u);}function m(y){if(!c.browser.msie){g.bind("resize",y);}else{g.get(0).attachEvent("onresizeend",y);}}function o(y){if(!c.browser.msie){g.unbind("resize",y);}else{g.get(0).detachEvent("onresizeend",y);}}return true;};c.fn.resizeWindowClientArea.defaults={maxCycles:3,msieResizeDelay:0,resizeDelay:0};})(jQuery);function embeddedGame_balanceRefresh(c){}function embeddedGameParent_balanceRefresh(){this.forceRefresh=true;SB.EventHub.trigger("balance-refresh",this);}function embeddedGameParent_contentLoaded(c){}function embeddedGameParent_topupFunds(){}function embeddedGameParent_keepAlive(){}function MM_jumpMenu(targ,selObj,restore){eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");if(restore){selObj.selectedIndex=0;}}function moveto(c){hideall();show(c);}function hideall(){for(var c=0;c<ids.length;c++){hide(ids[c]);}}function hide(c){if(document.getElementById){document.getElementById(c).style.display="none";}else{if(document.layers){document.id.display="none";}else{document.all.id.style.display="none";}}}function show(c){if(document.getElementById){document.getElementById(c).style.display="block";}else{if(document.layers){document.id.display="block";}else{document.all.id.style.display="block";}}}function swap(d,c){image=document.getElementById(d);source=image.getAttribute("src");newsource=image.setAttribute("src","/s/images/mobile/"+c);}var nPlayers;var nTables;SB.Poker=new Object();SB.base.LoadGenericLabels(SB.Poker,"/config/translation/paradise-poker/paradiseLabels.xml");function writeStats(){var c=10;if(!nPlayers){nPlayers=0;nTables=0;}if(nPlayers>=c){document.writeln("<b>  ");document.write(nPlayers+"</b> "+SB.Poker.Labels.get("PlayersAreAt")+" <b>"+nTables+"</b> "+SB.Poker.Labels.get("Tables"));document.writeln("");}else{document.writeln("&nbsp;");}}function pop(e,c,d){window.open(e,c,d);}function gotoDefaultCasinoDownload(){gaCasinoDownload();setCasinoDownloadedCookie();var c=$.cookie("rStatus");if(c==null||c==1){var d="/t/customer/registrationpopup.aspx?submit=downloadForm";SB.base.deferWindowCommand(d,"popup",false);}else{document.downloadForm.submit();}}function setCasinoCookie(d,e,c){var f=new Date();f.setDate(f.getDate()+c);document.cookie=d+"="+escape(e)+";path=/"+((c==null)?"":";expires="+f.toGMTString());}function getCookie(c){if(document.cookie.length>0){c_start=document.cookie.indexOf(c+"=");if(c_start!=-1){c_start=c_start+c.length+1;c_end=document.cookie.indexOf(";",c_start);if(c_end==-1){c_end=document.cookie.length;}return unescape(document.cookie.substring(c_start,c_end));}}return"";}function setCasinoDownloadedCookie(){setCasinoCookie("casino","y",3650);}function nag(){var d=getCookie("casino");if(d==""){var c="width=360,height=220,resizable=no,scrollbars=no,status=no,location=no,toolbar=no";popUp("/t/casino/pop-up/download-question.aspx","DownloadCasino",c);}}function confirmCasinoDownload(){dcsMultiTrack("DCS.dcsuri","/CasinoDownload/PlayNowButton/DownloadNow","WT.ti","Button:Casino Download - Download Now","WT.cg_n","Casino","WT.cg_s","Download Casino","WT.si_n","Casino","WT.si_p","Download","WT.ac","Casino Download - PlayNowButton");gaCasinoDownload();document.downloadForm.submit();setCasinoDownloadedCookie();}function delayCasinoDownload(){dcsMultiTrack("DCSext.gaming","No Download","DCSext.refusecasinodownload","1","DCSext.creative","Not Now Button");window.close();}function rejectCasinoDownload(){setCasinoDownloadedCookie();window.close();}function showPreview(d,c){if(document.layers){if(d){document.layers[c].visibility="show";document.layers[c].display="";}else{document.layers[c].visibility="hide";document.layers[c].display="none";}}else{if(document.getElementById){if(d){document.getElementById(c).style.visibility="visible";document.getElementById(c).style.display="";}else{document.getElementById(c).style.visibility="hidden";document.getElementById(c).style.display="none";}}else{if(document.all(c).style.visibility=="visible"){document.all(c).style.visibility="visible";document.all(c).style.display="";}else{document.all(c).style.visibility="hidden";document.all(c).style.display="none";}}}}var b_delay=3600;var b_timer=0;var b_active;var b_banner=0;function b_init(){var c;while(true){c=document.getElementById("banner_"+b_banner);if(!c){break;}b_banner++;}b_active=b_banner-1;b_show(b_active);hb_counter();}function hb_counter(){b_hide(b_active);b_active=(b_banner+(b_active+1))%b_banner;b_show(b_active);b_timer=window.setTimeout("hb_counter()",b_delay);}function b_show(d){var c=document.getElementById("banner_"+d);if(c!=null){c.style.display="";}}function b_hide(d){var c=document.getElementById("banner_"+d);if(c!=null){c.style.display="none";}}function b_stop(){clearTimeout(b_timer);b_timer=0;}function b_move(c){b_hide(b_active);b_active=c?(b_banner+b_active+1)%b_banner:(b_banner+b_active-1)%b_banner;b_show(b_active);if(!b_timer){b_timer=window.setTimeout("hb_counter()",b_delay);}}if(typeof(GRS)=="undefined"||GRS==null){var GRS=new Object();}if(typeof(GRS.PokerPlugin)=="undefined"||GRS.PokerPlugin==null){GRS.PokerPlugin=new Object();}if(!GRS.PokerPlugin.showLoginOrRegisterPopup){GRS.PokerPlugin.showLoginOrRegisterPopup=function(d,c,e){if(c){SB.base.deferWindowCommand(d,"popup",true);}else{SB.base.OpenDivCheckLoginStatus(d,"popBadSelect1","popVeil1","popLayer1",true,"poker",e);}};}if(!GRS.PokerPlugin.downloadBossClient){GRS.PokerPlugin.downloadBossClient=function(c,d){if(d!=null){var e=$(document.createElement("form"));e.attr("method","post").attr("action",c).attr("id","bossDownloadForm").attr("name","bossDownloadForm");$.each(d,function(f,g){e.append('<input type="hidden" name="'+f+'" value="'+g+'">');});e.append('<input type="submit" style="display:none" />');$("body").append(e);e.submit();}};}if(!GRS.PokerPlugin.updateCookie){GRS.PokerPlugin.updateCookie=function(c){if(c!=null&&c.length>0){var d=$.cookie("pClients");var e={};if(d!=null){$.each(d.split(","),function(g,k){e[k]=0;});}e[c]=0;var f="";$.each(e,function(g,k){f+=g+",";});f=f.substring(0,f.lastIndexOf(",",f.length));$.cookie("pClients",f);}};}MarketType=new Object();MarketType.Data=new Object();MarketType.Labels=new Hashtable();var IsHomePage=false;var evX=0;var evY=0;var HelpTipId="";var HelpObjects=new Array();function AddHelpObject(e,c){var d=new Object();d.Name=e;d.TooltipText=c;HelpObjects.push(d);}function findLeftPos(c){var d=0;if(c.offsetParent){d=c.offsetLeft;while(c=c.offsetParent){d+=c.offsetLeft;}}return d;}function findTopPos(d){var c=0;if(d.offsetParent){c=d.offsetTop;while(d=d.offsetParent){c+=d.offsetTop;}}return c;}function TrimEnd(c){if(c==null){return"";}if(c.charAt(c.length-1)==" "){c=c.substring(0,c.length-1);}return c;}function TrimHeadingTags(c){if(c==null){return"";}c=c.replace("<h3>","").replace("</h3>","").replace("<h2>","").replace("</h2>","").replace("<h1>","").replace("</h1>","");return c;}function TrimEndAndHeadingTags(c){c=TrimEnd(c);c=TrimHeadingTags(c);return c;}var HelpTip={GetTranslation:function(c){var d=MarketType.Labels.get(c);if(d==null||d==""){d=MarketType.Labels.get("default");}return d;},Show:function(e,c,d){c=TrimEndAndHeadingTags(c);evX=d.clientX;evY=d.clientY;if(!MarketType.Data.AreLabelsLoaded){MarketType.Data.Init(function(){showHelpTipAlert(true,HelpTip.GetTranslation(c));});}else{showHelpTipAlert(true,HelpTip.GetTranslation(c));}return true;},ShowLabel:function(e,d,c){d=TrimEndAndHeadingTags(d);var f=d;if(f==null||f==""){f=MarketType.Labels.get("default");}dateVar=new Date();HelpTipId=e.id+dateVar.getMilliseconds();evX=c.clientX;evY=c.clientY;showHelpTipAlert(true,f);return true;},Hide:function(c){if(c!=null){setTimeout("if (HelpTipId == '"+HelpTipId+"') {Tooltip.Set('', -1000, -1000); HelpTipId = '';}",0);}},Set:function(f,c,g){var e=document.getElementById("tooltipcontent");e.innerHTML=f;var d=document.getElementById("tooltip");d.style.left=c+"px";d.style.top=g-10+"px";},ShowOddsTip:function(d,c){if(MarketType.Data.AreLabelsLoaded!=true){MarketType.Data.Init();}var e=c;if(e!=null&&e!=""){dateVar=new Date();HelpTipId=d.id+dateVar.getMilliseconds();this.Set(e,findLeftPos(d)+65,findTopPos(d)+10);}return true;},HideOddsTip:function(){setTimeout("if (HelpTipId == '"+HelpTipId+"') {Tooltip.Set('', -1000, -1000); HelpTipId = '';}",500);}};MarketType.Data.Init=function(c){MarketType.Data.AreLabelsLoaded=false;MarketType.Data.LoadLabels(c);};MarketType.Data.LoadLabels=function(d){var c=new MakertTypeLabelsHandler(d);var e=new AjaxService(c);e.GetRequest("/config/translation/eventBrowsing/MarketTypeHelpLabels.xml");e=null;c=null;};function MakertTypeLabelsHandler(c){this.inheritFrom=ResponseHandlerBase;this.inheritFrom();this.avoidCaching=false;this.traceLevel=4;this.verify=function(d){return(d.match(/<labelText(.)*>/)!=null);};this.processNode=function(e,f,d){switch(f){case"label":MarketType.Labels.put(e.getAttribute("id"),d);break;}};this.execute=function(){MarketType.Data.AreLabelsLoaded=true;if(c!=null){c();}};}function showHelpTipAlert(c,f){var e=document.getElementById("tooltip");if(e!=null){if(c){var d=document.getElementById("tooltipcontent");d.innerHTML=f;e.style.visibility="visible";if((this.clientX==0)||(this.clientY==0)){e.style.left=(document.documentElement.clientWidth)+"px";e.style.top=document.documentElement.scrollTop+"px";}else{e.style.left=(evX+documentScrollLeft()+25)+"px";e.style.top=(evY+documentScrollTop()-10)+"px";}}else{if(e){e.style.visibility="hidden";e.style.top="0px";e.style.left="0px";}evX=0;evY=0;}}}function documentScrollLeft(){return(document.body.scrollLeft==0)?document.documentElement.scrollLeft:document.body.scrollLeft;}function documentScrollTop(){return(document.body.scrollTop==0)?document.documentElement.scrollTop:document.body.scrollTop;}var InformationTip={Show:function(d,e,c){showInformationTipAlert(true,TrimEndAndHeadingTags(e),d,c);return true;},Hide:function(c){showInformationTipAlert(false,"");}};function showInformationTipAlert(m,f,c,o){var e=document.getElementById("infotip");if(e){if(m){var g=document.getElementById("infotipcontent");g.innerHTML=f;e.style.visibility="visible";if((this.clientX==0)||(this.clientY==0)){e.style.left=(document.documentElement.clientWidth)+"px";e.style.top=document.documentElement.scrollTop+"px";}else{var l=findPos(c);var d=l[0];var k=l[1];e.style.left=(d-(e.offsetWidth/2)+(c.offsetWidth/2))+"px";e.style.top=(k-(e.offsetHeight))+"px";}}else{e.style.visibility="hidden";e.style.top="-1000px";e.style.left="-1000px";}}}function findPos(c){var e=c.offsetLeft;var d=c.offsetTop;while(c.offsetParent){e+=c.offsetParent.offsetLeft;d+=c.offsetParent.offsetTop;if(c==document.getElementsByTagName("body")[0]){break;}else{c=c.offsetParent;}}return[e,d];}function changeParameters(c,e,f){newParam=e+"="+f;var d;start=c.indexOf(e+"=");if(start==-1){d=c+"&"+newParam;}else{currentParam=c.substr(start);end=currentParam.indexOf("&");if(end!=-1){currentParam=c.substr(start,end);}d=c.replace(currentParam,newParam);}return d;}function validate_CheckBoxListSEO(f,l){var k="";var d="";var g="";var m="";for(var o=0;o<document.ecForm.elements.length;o++){if(document.ecForm.elements[o].type=="checkbox"){if(document.ecForm.elements[o].checked==true){g=document.ecForm.elements[o].name;k=g.replace("cbx","");var e="";if((document.ecForm.elements[o].previousElementSibling!=null)&&(document.ecForm.elements[o].previousElementSibling.id=="hid"+k)){e=document.ecForm.elements[o].previousElementSibling.value;}else{e=document.getElementById("hid"+k).value;}if(l=="AMACMARKET"){if(d!=""){d+="-"+k;}else{d=k;}}else{if(d!=""){d+="-"+e+"-"+k;}else{d=e+"-"+k;}}}}}if(d==""){m="";}else{if(l=="ECMARKET"){m=f.replace("[IDPLACEHOLDER]",d);}else{if(l=="AMACMARKET"){m=f.replace("[IDPLACEHOLDER]",d);}}}return m;}function validate_CheckBoxList(u,f,k,q){var l=0;var r="";var v="";var s="";var g="";var e="";var d="";for(var o=0;o<document.ecForm.elements.length;o++){if(document.ecForm.elements[o].type=="checkbox"){if(document.ecForm.elements[o].checked==true){s=document.ecForm.elements[o].name;r=s.replace("cbx","");var m=document.getElementById("hid"+r).value;if(v!=""){v+=","+r;g+=","+m;}else{v=r;g=m;}l=l+1;}}}if(g==""&&v==""){d="";}else{if(k=="ECMARKET"){d=u+"/"+f+"/ECMARKET/"+g+"/"+v+"/"+q;}else{if(k=="AMACMARKET"){d=u+"/"+f+"/AMACMARKET/"+v;}}}return d;}function selOddsFormatOnChange(c){var d=document.location.href;if(document.location.href.indexOf("?")==-1){d=d+"?";}d=changeParameters(d,"setOddsFormat",c.value);document.location.href=d;}function loadEventClassHighLighting(){$('input[name^="cbx"]').change(function(){var c='a[id*="'+this.name.substr(3)+'"]';if(this.checked){$(c).addClass("selected");}else{$(c).removeClass("selected");}});}function currentMarketSelectorChanged(){var d=$("select#currentMarketSelector");var c=$("option:selected",d).val();window.location.href=c;}var eventBrowsingLoaded=true;function gaChangeLanguage(){var c=window.location.pathname;gaTrackAction(c,"Change language");}function gaDepositStart(c){var d=c?"FirstDeposit":"Deposit";gaTrackForm(d,"Start");}function gaDepositFailed(c){var d=c?"FirstDeposit":"Deposit";gaTrackForm(d,"Fail");}function gaDepositSuccess(c){var d=c?"FirstDeposit":"Deposit";gaTrackForm(d,"Success");}function gaRegistrationAttempt(){gaTrackForm("Registration","Start");}function gaRegistrationFail(){gaTrackForm("Registration","Fail");}function gaRegistrationSuccess(){gaTrackForm("Registration","Success");}function gaWithdrawalStart(){gaTrackForm("Withdrawal","Start");}function gaWithdrawalFailed(){gaTrackForm("Withdrawal","Fail");}function gaWithdrawalSuccess(){gaTrackForm("Withdrawal","Success");}function countvalues(d){var c={},f=d.length,e;while(f--){e=c[d[f]];c[d[f]]=e?e+1:1;}return c;}function gaTrackBets(g,f){var c="sport-multi";g=g.slice(0,g.length-1);var d=g.split(" ");var e=countvalues(d)[d[0]];if(e==d.length){gaTrackAction(d[0],f);}else{gaTrackAction(c,f);}}function gaBetAttempt(){var c="Attempt Bet Placement";var d=jQuery("div.userItems").find("input:checkbox:checked").parent();var e=jQuery("div.sports",d).text();gaTrackBets(e,c);}function gaBetSuccess(){var d="All Bets Placed";var c=jQuery("ul.itemDescription",jQuery("div.basketReceipt"));var e=jQuery("div.sports",c).text();gaTrackBets(e,d);}function gaCasinoDownload(c){if(typeof(c)=="undefined"||c==""){c=window.location.pathname;}gaTrackAction(c,"Download Casino");}function gaInstantCasino(c){if(typeof(c)=="undefined"||c==""){c=window.location.pathname;}gaTrackAction(c,"Launch web casino");}function gaPokerDownload(){var c=window.location.pathname;gaTrackAction(c,"Download Poker");}function trackGaEvent(trackingData){try{var trackfunction=eval(trackingData.trackingFunction);}catch(err){}if(typeof(trackfunction)!="undefined"){trackfunction(trackingData.name,trackingData.action);}}if(typeof(SB)=="undefined"||SB==null){var SB=new Object();SB.customer=new Object();}else{if(typeof(SB.customer)=="undefined"||SB.customer==null){SB.customer=new Object();}}SB.customer.registration=new Object();var bubble_info_unavailable="Address not found, please try again.";var bubble_info_select="Please confirm your address by selecting an address and clicking on Use this address";var bubble_info_UsernameExists="Sorry. The username you have chosen is already taken, please pick another.";var bubble_info_UsernameRequired="Please enter your username. It is case sensitive, must be 6-12 characters long and include only letters and numbers or underscores.";var bubble_info_UsernameInfo="Your username is case-sensitive and must be 6-12 characters long. It can include letters, numbers and underscores.";var userNameInValid="invalid";var findAddressTitleMessage="Please wait while we lookup the address.";var findAddressTitle="Searching Address";SB.customer.registration.setKeyword=function(){if(document.getElementById("registration_modCustRegKeyword")!=null){var d=document.getElementById("registration_modCustRegKeyword").value;if(d!=null&&d!=""){var c=new SB.customer.registration.KeywordHandler(d);var e=new AjaxService(c);e.GetRequest("/misc/webServices/registration/TrackingService.aspx?action=keyword&item="+encodeURIComponent(d));e=null;c=null;}else{SB.customer.registration.ShowHowHear();}}};SB.customer.registration.KeywordHandler=function(c){this.avoidCaching=true;this.traceLevel=3;this.process=function(d){if(d.xmlHttp.responseXML!=null&&d.xmlHttp.responseXML.documentElement!=null){if(d.xmlHttp.responseXML.documentElement.childNodes.length>0){SB.base.HideRow(registration.trHowHearMain);SB.base.HideRow(registration.trHowHearSub);return;}else{SB.customer.registration.ShowHowHear();}}else{SB.customer.registration.ShowHowHear();}};};SB.customer.registration.ShowHowHear=function(){var c=document.getElementById(registration.trHowHearMain);if(c!=null){if(c.style.display=="none"&&document.getElementById("registration_modCustRegDdlTrackingMain")!=null){SB.base.ShowRow(registration.trHowHearMain);}}};SB.customer.registration.setTrackingSelectSub=function(){var f=document.getElementById("registration_modCustRegDdlTrackingMain").value;var d=document.getElementById("registration_modCustRegDdlTrackingSub");if(f==null||d==null){return;}var e=false;for(var k=0;k<registration.trackingMenuArray.length;k++){if(registration.trackingMenuArray[k]==f){SB.base.RemoveAllOptions(d);childArray=registration.trackingMenuSubArray[k];for(var c=0;c<childArray.length;c++){var g=childArray[c];if(g=="RADIO MARCA"){today=new Date();if(today.getDay()>15){g="R MARCA NACIONAL";}}SB.base.AddOption(d,g,childArray[c]);e=true;}}}if(e==true){if(document.getElementById("ddlTrackingLabel")!=null){document.getElementById("ddlTrackingLabel").innerHTML=f;}SB.base.ShowRow(registration.trHowHearSub);}else{SB.base.RemoveAllOptions(d);SB.base.HideRow(registration.trHowHearSub);}};SB.customer.registration.InitialiseTrackingSubMenu=function(){if(document.getElementById("registration_modCustRegDdlTrackingSub")!=null&&document.getElementById("registration_modCustRegDdlTrackingSub").options.length>0){SB.base.ShowRow(registration.trHowHearSub);}};SB.customer.registration.setCountry=function(c){if(SB.customer.registration.handleExcludedCountry(c)){return;}Global_processingMessage="The form is loading";var e=document.getElementById("registration_modCustRegDdlCountry").value;var d={type:"GET",dataType:"json",url:"/misc/webServices/registration/CountryService.ashx?item="+e,timeout:45000,success:function(f,g){new SB.customer.registration.CountryHandler(e,f);},error:function(g,k,f){}};jQuery.ajax(d);};SB.customer.registration.CountryHandler=function(key,response){var c=document.getElementById("registration_modCustRegBtnCountry");var t=document.getElementById("registration_txtLastCountry");var countryResponse=eval(response);if(countryResponse!=null){if(countryResponse.CountryFound||countryResponse.AddressLookup){t.value="true";c.click();}else{if(t.value=="true"){t.value="false";c.click();}else{if(document.getElementById("registration_modCustRegAddress")!=null){document.getElementById("registration_modCustRegAddress").focus();}}}SB.customer.registration.PersonalIndentityNumberDisplay();}};SB.customer.registration.handleExcludedCountry=function(d){var c=SB.customer.registration.getExclusionInformationFor(d[d.selectedIndex].value.toUpperCase());if(c){d.selectedIndex=0;SB.customer.registration.setCountry(d);SB.customer.registration.setGlobalProcessingMessage();SB.base.OpenDiv(c.warningPopupUrl,"popBadSelect2","popVeil2","popLayer2");return true;}return false;};SB.customer.registration.getExclusionInformationFor=function(c){return SB.customer.registration.excludedCountryCodes[c];};SB.customer.registration.displayAddressLookupFields=function(){if(document.getElementById("registration_modCustRegDdlCountry").value=="GB"&&document.getElementById("registration_modCustRegAddress").value==""){SB.customer.registration.showAddressLookup();document.getElementById("registration_txtLastCountry").value="true";}};SB.customer.registration.ValidateDoorNumber=function(c){if(/^[\w\s\-]*$/i.test(c)){return true;}else{return false;}};SB.customer.registration.ValidatePostcode=function(c){if(/^[a-z\s\d]*$/i.test(c)){return true;}else{return false;}};SB.customer.registration.getAddressLookupList=function(d){var f=document.getElementById("registration_modCustRegDoorNumber").value;var e=document.getElementById("registration_modCustRegPostcode").value;var k=document.getElementById("registration_ico_doorNumber");var g=document.getElementById("registration_ttt_doorNumber");Global_processingMessage="Please wait while we lookup the address.";Global_processingTitle="Searching Address";SB.base.holdingDiv("show");if(SB.customer.registration.ValidateDoorNumber(f)&&SB.customer.registration.ValidatePostcode(e)){var c=new SB.customer.registration.AddressLookupCallback(d);var l=new AjaxService(c);l.GetRequest("/misc/webServices/registration/AddressLookUpService.aspx?doorNumber="+f+"&postcode="+e);l=null;c=null;}else{SB.base.holdingDiv("hide");SB.base.initializeTooltip(k,g,bubble_info_unavailable);}};SB.customer.registration.AddressLookupCallback=function(d){this.avoidCaching=true;this.traceLevel=3;var f=false;var e=new Array();var c=0;this.process=function(q){var s=q.xmlHttp.responseXML;if(s!=null&&s.documentElement!=null){if(s.documentElement.childNodes.length>0){f=true;for(var o=0;o<s.documentElement.childNodes.length;o++){var g=s.documentElement.childNodes[o];if(g.hasChildNodes()&&g.firstChild.nodeType==3){e[c]=g.firstChild.nodeValue;c++;}}if(e.length==1){SB.customer.registration.setAddressInFields(e[0]);if(d){SB.customer.registration.dopostback();}}else{SB.customer.registration.showAddressLookUpResults();var u=new RegExp(", ,","g");for(var r=0;r<e.length;r++){var m=e[r].replace(u,",");SB.base.AddOption(document.getElementById("AddressLookUpListbox"),m,e[r]);}}}}if(f==false){var k=document.getElementById("registration_ico_doorNumber");var l=document.getElementById("registration_ttt_doorNumber");SB.base.holdingDiv("hide");SB.base.initializeTooltip(k,l,bubble_info_unavailable);SB.customer.registration.AddressLookupFailed();}SB.base.holdingDiv("hide");};};SB.customer.registration.AddressLookupFailed=function(){SB.base.ToggleElement("errorCouldNotFindAddress","display","block");SB.base.ShowRow("trEnterManuallyButton");};SB.customer.registration.setAddressInFields=function(d){var c=d.split(",");document.getElementById("registration_modCustRegAddress").value=SB.base.TrimString(c[0]);document.getElementById("registration_modCustRegAddressTwo").value=SB.base.TrimString(c[1]);document.getElementById("registration_ico_address").className="icons";document.getElementById("registration_modCustRegCity").value=SB.base.TrimString(c[2]);document.getElementById("registration_ico_city").className="icons";document.getElementById("registration_modCustRegCounty").value=SB.base.TrimString(c[3]);document.getElementById("registration_ico_county").className="icons";document.getElementById("registration_modCustRegPostcode").value=SB.base.TrimString(c[4]);document.getElementById("registration_ico_postCode").className="icons";SB.customer.registration.hideAddressLookUp();SB.customer.registration.showFullAddress();};SB.customer.registration.selectAddress=function(){var f=document.getElementById("registration_ico_AddressLookUpListbox");var c=document.getElementById("registration_ttt_AddressLookUpListbox");var e=document.getElementById("AddressLookUpListbox");if(e!=null){if(e.selectedIndex==-1){SB.base.initializeTooltip(f,c,bubble_info_select);}else{var d=e.options[e.selectedIndex].value;SB.customer.registration.setAddressInFields(d);}}};SB.customer.registration.showAddressLookup=function(){SB.base.HideRow("trAddressOne");SB.base.HideRow("HideAddress2");SB.base.HideRow("HideCity");SB.base.HideRow("trCounty");SB.base.ShowRow("trAddressLookup");SB.base.ToggleElement("AddressLookUpLink","display","block");};SB.customer.registration.hideAddressLookUp=function(){SB.base.HideRow("trEnterManuallyButton");SB.base.HideRow("trAddressLookup");SB.base.HideRow("trAddressLookupList");SB.base.HideRow("trAddressLookupButtons");SB.base.ToggleElement("AddressLookUpLink","display","none");};SB.customer.registration.showAddressLookUpResults=function(){SB.base.HideRow("trAddressLookup");SB.base.HideRow("trPostcode");SB.base.HideRow("AddressLookUpLink");SB.base.ShowRow("trAddressLookupList");SB.base.HideRow("AddressLookUpLink");SB.base.ShowRow("trAddressLookupButtons");SB.base.ShowRow("trEnterManuallyButton");};SB.customer.registration.showFullAddress=function(){SB.customer.registration.hideAddressLookUp();SB.customer.registration.populateFirstAddressLine();SB.base.ShowRow("trAddressOne");SB.base.ShowRow("HideAddress2");SB.base.ShowRow("HideCity");SB.base.ShowRow("trCounty");SB.base.ShowRow("trPostcode");SB.base.HideRow("trEnterManuallyButton");};SB.customer.registration.populateFirstAddressLine=function(){var d=document.getElementById("registration_modCustRegDoorNumber");var c=document.getElementById("registration_modCustRegAddress");if(d!=null&&c.value==""){document.getElementById("registration_modCustRegAddress").value=d.value;}};SB.customer.registration.doPostbackWrapper=function(c){if(c.attributes["class"]!=undefined&&c.attributes["class"].value=="disableClick"){return;}SB.customer.registration.dopostback();};SB.customer.registration.dopostback=function(){var d=document.getElementById("registration_modCustRegAddress").value;var g=document.getElementById("registration_modCustRegPostcode").value;var f=document.getElementById("registration_ico_AddressLookUpListbox");var c=document.getElementById("registration_ttt_AddressLookUpListbox");if(document.getElementById("trAddressLookupList").style.display!="none"){var e=document.getElementById("AddressLookUpListbox");if(e.selectedIndex>-1){SB.customer.registration.setAddressInFields(e.options[e.selectedIndex].value);}else{if(e.options.length>0&&document.getElementById("trAddressOne").style.display=="none"){if(f!=null&&c!=null){gaRegistrationFail();SB.base.initializeTooltip(f,c,bubble_info_select);}return;}}}else{if(g!=""&&(document.getElementById("AddressLookUpLink").style.display=="block")&&d==""){SB.customer.registration.getAddressLookupList(true);if(f!=null&&c!=null){gaRegistrationFail();SB.base.initializeTooltip(f,c,bubble_info_select);}return;}else{if(g!=""&&(document.getElementById("AddressLookUpLink").style.display=="none")&&d==""){SB.customer.registration.getAddressLookupList(false);SB.customer.registration.showAddressLookup();if(f!=null&&c!=null){gaRegistrationFail();SB.base.initializeTooltip(f,c,bubble_info_select);}return;}}}__doPostBack("registration$modCustRegisterButton","");};SB.customer.registration.getUsernameCheck=function(d){try{var m=d.value;var l=document.getElementById("registration_ico_username");var f=document.getElementById("registration_ttt_username");if(m!=null&&m!=""){var k=encodeURIComponent(m);var e={type:"GET",dataType:"json",url:"/misc/webServices/registration/UserNameCheckService.ashx?username="+escape(k),timeout:45000,success:function(o,q){new SB.customer.registration.UsernameCheckHandler(d,o);},error:function(){}};jQuery.ajax(e);}else{var c="Please enter your username. It is case sensitive, must be 6-12 characters long and include only letters and numbers or underscores.";l.className="icons icoError";f.className="toolTipText tttError";SB.base.removeExistingTooltipMessage(f);SB.base.createTooltipMessageTag(f,c);if(d.className.indexOf("usrNameTaken")==-1){d.className=(d.className+" usrNameTaken").replace(/^ /,"");}}}catch(g){}};SB.customer.registration.UsernameCheckHandler=function(userNameBox,response){this.avoidCaching=true;this.traceLevel=3;var usernameCheck=eval(response);var ico_username="";var ttt_username="";if(document.getElementById("registration_ico_username")!=null){ico_username=document.getElementById("registration_ico_username");}if(document.getElementById("registration_ttt_username")!=null){ttt_username=document.getElementById("registration_ttt_username");}if(usernameCheck!=null){if(usernameCheck.Available=="false"){var bubble_info_UsernameExists="Sorry. The username you have chosen is already taken, please pick another.";ico_username.className="icons icoError";ttt_username.className="toolTipText tttError";SB.base.removeExistingTooltipMessage(ttt_username);SB.base.createTooltipMessageTag(ttt_username,bubble_info_UsernameExists);if(userNameBox.className.indexOf("usrNameTaken")==-1){userNameBox.className=(userNameBox.className+" usrNameTaken").replace(/^ /,"");}}else{if(usernameCheck.Available==userNameInValid){ico_username.className="icons icoError";ttt_username.className="toolTipText tttError";SB.base.removeExistingTooltipMessage(ttt_username);SB.base.createTooltipMessageTag(ttt_username,usernameCheck.ValidationErrorMessage);if(userNameBox.className.indexOf("usrNameTaken")==-1){userNameBox.className=(userNameBox.className+" usrNameTaken").replace(/^ /,"");}}else{var bubble_info_UsernameInfo="Your username is case-sensitive and must be 6-12 characters long. It can include letters, numbers and underscores.";ico_username.className="icons icoInfo";ttt_username.className="toolTipText tttInfo";SB.base.removeExistingTooltipMessage(ttt_username);SB.base.createTooltipMessageTag(ttt_username,bubble_info_UsernameInfo);userNameBox.className=userNameBox.className.replace(/usrNameTaken/,"").replace(/ $/,"");}}}};SB.customer.registration.SetTextMessageOption=function(){var c=document.getElementById("registration_modCustRegCbxSmsContact");var e=document.getElementById("registration_modCustRegMobile");if(c!=null&&e!=null){var d=/\S/;if(d.test(e.value)){c.checked="true";}else{c.checked="";}}};SB.customer.registration.setGlobalProcessingMessage=function(){Global_processingMessage="The form is loading";};SB.customer.registration.PersonalIndentityNumberDisplay=function(){var c=document.getElementById("registration_modCustRegDdlCountry");if(document.getElementById("site_code")!=null&&document.getElementById("site_code").value=="miapuesta-cl"&&c.options[c.selectedIndex].value=="CL"){document.getElementById("registration_divPersonalIdentity").style.display="block";return;}if(document.getElementById("registration_divPersonalIdentity")!=null){document.getElementById("registration_divPersonalIdentity").style.display="none";}};SB.customer.registration.FormatRUTNumber=function(){ttSlim.Hide("registration_ico_personalIdentity");if(document.getElementById("site_code")!=null&&document.getElementById("site_code").value=="miapuesta-cl"){var e=document.getElementById("registration_modCustRegPersonalIdentity").value;if(e==""){return;}var f=e;f=f.split(",").join("");f=f.split(".").join("");f=f.split("-").join("");var c=f.length;if(c==8){f="0"+f;c=c+1;}if(c<8){alert("El RUT es inválido por falta de caracteres.");}var d=c-7;e=f.substring(0,d)+"."+f.substring(d,d+3)+"."+f.substring(d+3,d+6)+"-"+f.substring(c-1);document.getElementById("registration_modCustRegPersonalIdentity").value=e;}};SB.customer.registration.tracking=function(){this.trackingCategory=$("#tracking\\.trackingCategory");this.trackingCategorySource=$("#tracking\\.trackingCategorySource");this.subCategoryLabel=$("#AdvertisingSourcePerCategoryLabel");this.init();};SB.customer.registration.tracking.prototype={init:function(){var c=this;this.setTrackingCategorySource();this.trackingCategory.unbind().bind("change",function(){c.loadSubCategories();});},loadSubCategories:function(){var c=this;var e={category:c.trackingCategory.val()};var d={type:"POST",url:"/HowDidYouHear.mvc/GetUpdatedAdvertisingSource",data:e,timeout:45000,success:function(f,g){c.loadSubCategoriesSuccessHandler(f,g);},error:function(){}};jQuery.ajax(d);},loadSubCategoriesSuccessHandler:function(c,d){if(d=="success"){this.trackingCategorySource.html($("#tracking\\.trackingCategorySource",c).html());this.setTrackingCategorySource();}},setTrackingCategorySource:function(){if(this.trackingCategorySource.html()==""||this.trackingCategorySource.val()==""){this.trackingCategorySource.hide();this.subCategoryLabel.hide();}else{var c=this.trackingCategory.val();if(c!=null){this.subCategoryLabel.html(c).show();this.trackingCategorySource.show();}}}};if(typeof(SB)=="undefined"||SB==null){var SB=new Object();}SB.accounts=new Object();SB.accounts.onWithdrawClick=function(){SB.accounts.loadWithdrawlMethod();};SB.accounts.loadWithdrawlMethod=function(){Global_processingMessage="<p>The form is loading</p>";Global_processingTitle="Please wait a moment...";var d="";if(SB.accounts.getSelectedWithdrawPaymentMethod().indexOf("separator")==0){var c="/t/funding/WithdrawalPopUp.aspx";SB.base.RecallOpenDiv(c,"popBadSelect1","popVeil1","popLayer1");}else{if(SB.accounts.isUserWithdrawPaymentAccountSelected()){d="currentPPID="+SB.accounts.getCurrentWithdrawPPID()+"&userPaymentAccountID="+SB.accounts.getUserWithdrawPaymentAccountID();}else{d="currentPPID="+SB.accounts.getCurrentWithdrawPPID();}var c="/t/funding/WithdrawalPopUp.aspx?"+d;SB.base.RecallOpenDiv(c,"popBadSelect1","popVeil1","popLayer1");}};SB.accounts.loadManageCard=function(){var d="";if(SB.accounts.isUserWithdrawPaymentAccountSelected()){d="currentPPID="+SB.accounts.getCurrentWithdrawPPID()+"&userPaymentAccountID="+SB.accounts.getUserWithdrawPaymentAccountID();}else{d="currentPPID="+SB.accounts.getCurrentWithdrawPPID();}var c="/t/funding/ManageCardPopup.aspx?"+d;SB.base.RecallOpenDiv(c,"popBadSelect1","popVeil1","popLayer1");};SB.accounts.isUserWithdrawPaymentAccountSelected=function(){if(SB.accounts.getSelectedWithdrawPaymentMethod().indexOf("userPaymentAccounts")>=0){return true;}else{return false;}};SB.accounts.loadDepositCard=function(){var d="";if(SB.accounts.isUserWithdrawPaymentAccountSelected()){d="currentPPID="+SB.accounts.getCurrentWithdrawPPID()+"&userPaymentAccountID="+SB.accounts.getUserWithdrawPaymentAccountID();}else{d="currentPPID="+SB.accounts.getCurrentWithdrawPPID();}var c="/t/funding/depositPopup.aspx?"+d;SB.base.RecallOpenDiv(c,"popBadSelect1","popVeil1","popLayer1");};SB.accounts.closePage=function(c){if(c=="deposit"){SB.accounts.loadDepositCard();}else{SB.base.divPopUp(1,"hide");}};SB.accounts.getSelectedWithdrawPaymentMethod=function(){var d=document.getElementById("modFundingDepositddlPaymentMethod");var c=d.options[d.selectedIndex].value;return c;};SB.accounts.getCurrentWithdrawPPID=function(){var c=SB.accounts.getSelectedWithdrawPaymentMethod();var e=c.split(".");var d=e[1];return d;};SB.accounts.getUserWithdrawPaymentAccountID=function(){var c=SB.accounts.getSelectedWithdrawPaymentMethod();var d=c.split(".");var e=d[2];if(SB.accounts.isUserWithdrawPaymentAccountSelected()){e=d[2];}return e;};SB.accounts.onCreditCardWithdraw=function(){if(document.getElementById("cardAction").value=="withdraw"){__doPostBack("","");}else{alert(service.labels.selectValidCard);}};if(typeof(SB)=="undefined"||SB==null){var SB=new Object();SB.customer=new Object();}if(typeof(SB.customer)=="undefined"||SB.customer==null){SB.customer=new Object();}SB.customer.myAccounts=new Object();SB.customer.myAccounts.LoadContent=function(d,e){var c=new Object();c.timeout=25000;c.textonly=true;c.Content=e;c.errorHandler=SB.customer.myAccounts.ErrorHandler;HTTP.get(d,SB.customer.myAccounts.CallBackLoadContent,c);};SB.customer.myAccounts.CallBackLoadContent=function(returnOutput,Content){if(returnOutput!=null){document.getElementById(Content).innerHTML=returnOutput;var scripts=SB.base.extractScripts(returnOutput);for(var scriptCount=0;scriptCount<scripts.length;scriptCount++){try{eval(scripts[scriptCount]);}catch(e){}}}if(typeof(sbWeb)!="undefined"&&typeof(sbWeb.ui)!="undefined"&&typeof(sbWeb.ui.myAccountCallBack)=="function"){sbWeb.ui.myAccountCallBack();}};SB.customer.myAccounts.ErrorHandler=function(c,e,d){if(d.Content){errorInnerHtml=SB.base.GetUnhandledServerErrorMessage();document.getElementById(d.Content).innerHTML=errorInnerHtml;}else{alert(c+": "+e);}};SB.customer.myAccounts.Funding=function(c){popupOptions["switch"]="btnFunding";popupOptions.div="dvFunding";popupOptions.session="funding";popupOptions.sessionKey="sessionKeyFunding";popupOptions.src="../../t/customer/fundingoptions.aspx";popupOptions.divBar="dvFundingBar";popupOptions.divLink="modLayoutMyaccountTabsFundingLink";popupOptions.aClass="awake bar";popupOptions.iClass="asleep bar";SB.customer.myAccounts.UpdatePage();};SB.customer.myAccounts.PersonalDetails=function(c){popupOptions.divBar="dvPersonalDetailsBar";popupOptions.divLink="modLayoutMyaccountTabPersonalDetailsLink";popupOptions.aClass="awake bar";popupOptions.iClass="asleep bar";popupOptions["switch"]="btnPD";popupOptions.div="dvPersonalDetails";popupOptions.session="details";popupOptions.sessionKey="sessionKeyDetails";popupOptions.src="../../t/customer/detailsAndPreference.aspx?Readonly=true";SB.customer.myAccounts.UpdatePage();};SB.customer.myAccounts.BetLimitTabChangeContent=function(c){var d="/BetLimits.mvc/ChangeContent?subViewName="+c;new SB.sharedWallet.AhahDivReplacer(d,"#betLimitTabInnerContent").execute();return false;};SB.customer.myAccounts.PersonalLimits=function(c){popupOptions.divBar="dvLimitsBar";popupOptions.divLink="dvLimitsLink";popupOptions.aClass="awake bar";popupOptions.iClass="asleep bar";popupOptions["switch"]="btnLim";popupOptions.div="dvLimits";popupOptions.session="limits";popupOptions.sessionKey="sessionKeyLimits";popupOptions.src="../../t/customer/PersonalLimits.aspx?Readonly=true";SB.customer.myAccounts.UpdatePage();};SB.customer.myAccounts.AutoWithdrawal=function(c){popupOptions.divBar="dvAutoWithdrawalBar";popupOptions.divLink="dvAutoWithdrawalLink";popupOptions.aClass="awake bar";popupOptions.iClass="asleep bar";popupOptions["switch"]="btnAutoWithdrawal";popupOptions.div="dvAutoWithdrawal";popupOptions.session="autowithdrawal";popupOptions.sessionKey="sessionKeyAutowithdrawal";popupOptions.src="../../AutoWithdrawal.mvc/Display";SB.customer.myAccounts.UpdatePage();};SB.customer.myAccounts.CngPassword=function(c){popupOptions["switch"]="btnSec";popupOptions.div="dvSecurity";popupOptions.session="security";popupOptions.sessionKey="sessionKeySecurity";popupOptions.src="../../t/customer/mySecurity.aspx";popupOptions.divBar="dvSecurityBar";popupOptions.divLink="modLayoutMyaccountTabSecurityLink";popupOptions.aClass="awake bar";popupOptions.iClass="asleep bar";SB.customer.myAccounts.UpdatePage();};SB.customer.myAccounts.EuroPromotions=function(c){popupOptions["switch"]="btnEPromos";popupOptions.div="dvEPromotions";popupOptions.session="promotions";popupOptions.sessionKey="sessionKeyPromotions";popupOptions.src="../../t/customer/euroPromotions.aspx";popupOptions.divBar="dvEPromotionsBar";popupOptions.divLink="dvEPromotionsLink";popupOptions.aClass="awake bar";popupOptions.iClass="asleep bar";SB.customer.myAccounts.UpdatePage();};AgeVerification=function(){openIFrameInDivRefresh("dvAccHist","../../t/customer/verification.aspx","iFrmReg","Hide","Age Verification",oState,cState);};var isLoggedIn=true;SB.customer.myAccounts.visibilityServiceHandler=function(c){this.avoidCaching=true;this.traceLevel=3;this.process=function(d){if(d.xmlHttp.responseXML!=null&&d.xmlHttp.responseXML.documentElement!=null){if(d.xmlHttp.responseXML.documentElement.childNodes.length>0){if(d.xmlHttp.responseXML.documentElement.childNodes[0].nodeValue=="false"){isLoggedIn=false;SB.base.closeDivRefreshWindow();}}}};};SB.customer.myAccounts.UpdatePage=function(){var o=new SB.customer.myAccounts.visibilityServiceHandler();var m=new AjaxService(o);var c=popupOptions.div;var k=popupOptions.divBar;var f=popupOptions.divLink;var e=popupOptions["switch"];var l=popupOptions.src;var d=document.getElementById(e);var q=document.getElementById(f);var g=d.value=="0";m.GetRequest("/SetVisisbility.mvc/SetViewState/?name="+popupOptions.sessionKey+"&status="+g);if(d.value=="0"){if(isLoggedIn){SB.customer.myAccounts.LoadContent(l+"?"+new Date().getTime(),c);d.value="1";q.innerHTML=popupOptions.cState;document.getElementById(k).className=popupOptions.aClass;document.getElementById(c).style.display="block";$("#"+c).removeClass("hide");}}else{d.value="0";q.innerHTML=popupOptions.oState;document.getElementById(c).style.display="none";$("#"+c).addClass("hide");document.getElementById(k).className=popupOptions.iClass;if(document.getElementById("dvWaitContentLoading")!=null){document.getElementById(c).innerHTML=document.getElementById("dvWaitContentLoading").innerHTML;}}m=null;o=null;};SB.customer.myAccounts.FormatMobilePhoneNumber=function(d){var c=$(d).val();if(c.substring(0,1)=="0"){$(d).val(c.substring(1));}};$(document).ready(function(){var c=window.location.toString();if(c.indexOf("displayPersonalLimits")!=-1){SB.customer.myAccounts.Funding(popupOptions);SB.customer.myAccounts.PersonalLimits(popupOptions);}});fundingGlobals=new Object();fundingGlobals.card=new Object();fundingGlobals.list=new Object();if(typeof(SB)=="undefined"||SB==null){var SB=new Object();}if(typeof(SB.funding)=="undefined"||SB.funding==null){SB.funding=new Object();}GetVisibleDivStyle=function(){return"";};GetHiddenDivStyle=function(){return"none";};SB.funding.loadFundingLabels=function(){var c=new LabelsHandler();var d=new AjaxService(c);d.GetRequest("/config/translation/funding/FundingScriptLabels.xml");d=null;c=null;};SB.funding.onCardDelete=function(d){SB.funding.loadFundingLabels();document.getElementById("cardID").value=d;document.getElementById("cardAction").value="remove";if(document.getElementById("popBox2")){var e=service.labels.CardDeleteProcessing;var c="<p>"+service.labels.CardDeleteProcessingMessage+"</p>";document.getElementById("popBox2").innerHTML=SB.base.processingAnimationContent(e,c);}__doPostBack("","");};SB.funding.onCardUpdate=function(){SB.funding.loadFundingLabels();document.getElementById("cardAction").value="update";__doPostBack("","");};SB.funding.SetWalletRedirect=function(g,d){var e=document.getElementById("divMessage");if(e!=null){e.style.display="none";}var f=document.getElementById("redirectIFrame");var c=document.getElementById("divIframe");if(f!=null&&c!=null&&g!=""){SB.base.reStyler("add","ctrlDepositMethodList_divContent","hide");SB.base.reStyler("add",f,("pm"+d));SB.base.reStyler("add","VbVControl","hide");}c.style.display="block";f.src=g;f.style.display="";SB.base.divPopUp(1,"refresh");};SB.funding.SetWithdrawRedirect=function(g,d){var e=document.getElementById("divMessage");if(e!=null){e.style.display="none";}var f=document.getElementById("redirectIFrame");var c=document.getElementById("divIframe");if(f!=null&&c!=null&&g!=""){SB.base.reStyler("add","ctrlWithdrawMethodList_divContent","hide");SB.base.reStyler("add",f,("pm"+d));}c.style.display="block";f.src=g;f.style.display="";SB.base.divPopUp(1,"refresh");};SB.funding.SetEntropayRedirect=function(g){var d=document.getElementById("divMessage");if(d!=null){d.style.display="none";}var f=document.getElementById("redirectIFrame");var c=document.getElementById("divIframe");var e=document.getElementById("popBox2");if(f!=null&&c!=null&&g!=""){SB.base.reStyler("add","popupBodyEntropay","hide");SB.base.reStyler("add",f,"entropayIframe");SB.base.reStyler("add",e,"entropay");}c.style.display="block";f.src=g;f.style.display="";SB.base.divPopUp(1,"refresh");};SB.funding.SetSpeedCardRedirect=function(e,d){var c=document.getElementById("speedCardPollerIframe");if(c!=undefined){c.src=d;}SB.funding.SetWalletRedirect(e,"SCD");};SB.funding.SetVBVRedirect=function(e){var d=document.getElementById("redirectIFrame");var c=document.getElementById("divIframe");if(d!=null&&c!=null&&e!=""){SB.base.reStyler("add","ctrlDepositMethodList_divContent","hide");SB.base.reStyler("add",d,"pmVBV");}c.style.display="block";d.src=e;d.style.display="";};SB.funding.luhnCheckValue=function(g){if(!isNum(g)){return false;}var c=g.length;var d=c&1;var e=0;for(var f=0;f<c;f++){var k=parseInt(g.charAt(f));if(!((f&1)^d)){k*=2;if(k>9){k-=9;}}e+=k;}if(e%10==0){return true;}else{return false;}return true;};SB.funding.SetRedirectIFrameContentURLToPBP=function(c){alert("SetRedirectIFrameContentURLToPBP - change to use generic function! - See funding.js line 86");SetRedirectIFrameContent(c,"PBP");};SB.funding.SetRedirectIFrameContentURLToPaysafe=function(c){alert("SetRedirectIFrameContentURLToPaysafe - change to use generic function! - See funding.js line 94");SetRedirectIFrameContent(c,"PS");};SB.funding.ResetCardForm=function(){var f=document.getElementById("Entropay").value.toLowerCase()=="true";document.getElementById("ctrlDepositMethodList__ctl0_depositAmountWithFee").value=null;document.getElementById("ctrlDepositMethodList__ctl0_depositFee").value=null;var c=document.getElementById("popupBox");var g=c.getElementsByTagName("div");for(i=0;i<g.length;i++){if((g[i].id.indexOf("divValidationErrors")>-1)||(g[i].id.indexOf("errCardHolder")>-1)||(g[i].id.indexOf("errStartDate")>-1)||(g[i].id.indexOf("errIssueNo")>-1)||(g[i].id.indexOf("errExpiryDate")>-1)||(g[i].id.indexOf("errCardNo")>-1)||(g[i].id.indexOf("errCvv2")>-1)||(g[i].id.indexOf("errCardCurrency")>-1)||(g[i].id.indexOf("errAmount")>-1)){g[i].style.display=GetHiddenDivStyle();}}oAnchors=SB.base.getElementsByClass("error",c,"a");for(x=0;x<oAnchors.length;x++){SB.base.reStyler("remove",oAnchors[x],"error");}if(!f){var e=document.getElementsByTagName("select");for(i=0;i<e.length;i++){if((e[i].id.indexOf("ddlValidFromMonth")>-1)||(e[i].id.indexOf("ddlValidToMonth")>-1)||(e[i].id.indexOf("ddlValidFromYear")>-1)||(e[i].id.indexOf("ddlValidToYear")>-1)||(e[i].id.indexOf("ddlCurrency")>-1)){if(e[i].options.length>0){e[i].selectedIndex=0;}else{e[i].selectedIndex=-1;}}}}var d=document.getElementsByTagName("input");for(i=0;i<d.length;i++){if((d[i].id.indexOf("txtIssueno")>-1)||(d[i].id.indexOf("txtCvv2")>-1)||(d[i].id.indexOf("txtAmount")>-1)||(d[i].id.indexOf("txtDepositConvertedAmount")>-1)){d[i].value="";}}if(!f){var d=document.getElementsByTagName("input");for(i=0;i<d.length;i++){if((d[i].id.indexOf("txtCardno")>-1)){d[i].value="";}}}SB.funding.populateMissingAmount();};SB.funding.onCardWithdraw=function(){if(document.cardForm.cardAction.value=="withdraw"){document.cardForm.submit();}else{alert(service.labels.selectValidCard);}};onWithdrawCardSelect=function(c){};SB.funding.onDepositCardSelect=function(o,l,c,k){var d=document.getElementById("cardRow1");var g=document.getElementById("cardRow2A");var e=document.getElementById("cardRow2B");var u=document.getElementById("cardRow3A");var s=document.getElementById("cardRow3B");var w=document.getElementById("cardRow4");var v=document.getElementById("cardRow5");var r=document.getElementById("cardRow7");var q=document.getElementById("cvv2_"+o);var f=document.getElementById(fundingGlobals.card.ddlCardTypeID);var m=document.getElementById("cardId"+o);var f=document.getElementById(fundingGlobals.card.ddlCardListID);if(k=="true"){SB.funding.ResetCardForm();}if(SB.funding.isNewCard(o)){document.getElementById("cardAction").value="add";SB.funding.ShowNewCardRows(f,d,g,e,u,s,w,v,r,c);}else{document.getElementById("cardAction").value="deposit";SB.funding.InitialiseExistingCardRows(d,g,e,u,s,w,q,v,r);SB.funding.ShowExistingRetariusMessage(l,o);}SB.funding.onCardTypeChange(c,o,g,e,r);SB.funding.displayDepositAmounts(c,o,l);d=null;g=null;e=null;u=null;s=null;w=null;v=null;r=null;q=null;f=null;m=null;};SB.funding.onDepositNewCardSelect=function(m,l,c,k){var d=document.getElementById("cardRow1");var g=document.getElementById("cardRow2A");var e=document.getElementById("cardRow2B");var s=document.getElementById("cardRow3A");var r=document.getElementById("cardRow3B");var v=document.getElementById("cardRow4");var u=document.getElementById("cardRow5");var q=document.getElementById("cardRow7");var o=document.getElementById("cvv2_"+m);var f=document.getElementById(fundingGlobals.card.ddlCardListID);if(SB.funding.isNewCard(m)){SB.funding.ShowNewCardRows(f,d,g,e,s,r,v,u,q,c);}d=null;g=null;e=null;s=null;r=null;v=null;u=null;q=null;o=null;f=null;oCardRadio=null;};SB.funding.displayDepositAmounts=function(d,k,c){var f=document.getElementById(fundingGlobals.card.ddlDepositAmountID);var g=document.getElementById(fundingGlobals.card.txtAmountID);var e=document.getElementById(fundingGlobals.card.lblPPMsgID);if(f!=null){if(f.length>0){if(d=="WM"||c=="IV"){f.style.display="none";g.style.display="";}else{f.style.display="";g.style.display="none";}}else{f.style.display="none";g.style.display="";}}e.innerHTML="";for(i=0;i<fundingGlobals.card.ppLabels.length;i++){if(fundingGlobals.card.ppLabels[i].indexOf(d)>=0){e.innerHTML=fundingGlobals.card.ppLabels[i].substring(fundingGlobals.card.ppLabels[i].indexOf(d)+3);}}};SB.funding.DepositPopUpOnFocusInForm=function(c){var d=c.target?c.target:c.srcElement;if(d){SB_funding_lastTouchField=d.name;}};SB.funding.ShowExistingRetariusMessage=function(e,d){var c=fundingGlobals.card.customerCurrency;if(e=="WT"&&c!="GBP"&&c!="EUR"&&c!="USD"){document.getElementById("existingAccount").style.display=GetVisibleDivStyle();document.getElementById(fundingGlobals.card.currencyLabelID).style.display=GetHiddenDivStyle();}else{document.getElementById("existingAccount").style.display=GetHiddenDivStyle();document.getElementById(fundingGlobals.card.currencyLabelID).style.display=GetVisibleDivStyle();}};SB.funding.ShowNewCardRows=function(g,d,f,e,m,l,q,o,k,c){d.style.display=GetVisibleDivStyle();f.style.display=GetVisibleDivStyle();e.style.display=GetVisibleDivStyle();m.style.display=GetVisibleDivStyle();l.style.display=GetVisibleDivStyle();if(q!=null){q.style.display=GetVisibleDivStyle();}if((c=="unknown")&&(g!=null)){g.selectedIndex=0;}o.style.display=GetHiddenDivStyle();k.style.display=GetHiddenDivStyle();};SB.funding.InitialiseExistingCardRows=function(c,e,d,o,m,r,l,q,k){c.style.display=GetHiddenDivStyle();e.style.display=GetHiddenDivStyle();d.style.display=GetHiddenDivStyle();o.style.display=GetHiddenDivStyle();m.style.display=GetHiddenDivStyle();if(r!=null){r.style.display=GetVisibleDivStyle();var g=$("#ctrlDepositMethodList__ctl0_txtCvv2");var f=g.attr("data");if((l!=null)&&(l.value=="True")){g.attr("data",f.replace('"required":false','"required":true'));}else{g.attr("data",f.replace('"required":true','"required":false'));}}q.style.display=GetHiddenDivStyle();k.style.display=GetHiddenDivStyle();};SB.funding.ShowPaymentProviderLogos=function(c,e){var d=document.getElementById("providerDivs");if(d!=null){var f=d.getElementsByTagName("div");if(c==true){for(i=0;i<f.length;i++){if(f[i].id==e){f[i].style.display=GetVisibleDivStyle();}else{f[i].style.display=GetHiddenDivStyle();}}}else{for(i=0;i<f.length;i++){f[i].style.display=GetHiddenDivStyle();}}f=null;}d=null;};SB.funding.onNewCardTypeChange=function(c){var e=document.getElementById("cardRow2A");var d=document.getElementById("cardRow2B");var k=document.getElementById("cardRow7");var f="___";var g=c.value;if(g.toString().indexOf(f)>=0){g=c.value.split("___")[0];}SB.funding.onCardTypeChange(g,"new",e,d,k);e=null;d=null;k=null;SB.funding.displayDepositAmounts(c.value);};SB.funding.onCardTypeChange=function(c,f,e,d,g){SB.funding.DisplayValidFrom(f,c,e,d);SB.funding.DisplayCurrencyDropdown(c,f);SB.funding.SetDepositAmountCurrency(c,f);SB.funding.DisplayCurrencyConversionLabels(f,c,g);SB.funding.CalculateConversionAmount(f,c);SB.funding.DisplayMaestroLabel(c);SB.funding.AdjustCVV2Rules(c);SB.funding.DisplayWireCardLabel(f,c,g);SB.funding.ShowPaymentProviderLogos(true,SB.funding.GetCardTypePaymentProviderId(c));};SB.funding.isNewCard=function(c){if(c=="new"){return true;}else{return false;}};SB.funding.GetCardTypePaymentProviderId=function(c){var d=null;if(fundingGlobals.card.cardTypeData.length==1){d=fundingGlobals.card.cardTypeData[0][3];}else{for(i=0;i<fundingGlobals.card.cardTypeData.length;i++){if(c==fundingGlobals.card.cardTypeData[i][0]){d=fundingGlobals.card.cardTypeData[i][3];break;}}}return d;};SB.funding.CardTypeDoesCurrencyConversion=function(c){for(i=0;i<fundingGlobals.card.currencyConvertedCardTypes.length;i++){if(c==fundingGlobals.card.currencyConvertedCardTypes[i]){return true;}}return false;};SB.funding.DisplayValidFrom=function(f,c,e,d){if(SB.funding.isNewCard(f)&&(c=="MA"||c=="SW"||c=="unknown")){e.style.display=GetVisibleDivStyle();d.style.display=GetVisibleDivStyle();}else{e.style.display=GetHiddenDivStyle();d.style.display=GetHiddenDivStyle();}};SB.funding.DisplayCurrencyDropdown=function(c,e){if(SB.funding.CardTypeDoesCurrencyConversion(c)&&SB.funding.isNewCard(e)){document.getElementById("cardRow5").style.display=GetVisibleDivStyle();var d=document.getElementById(fundingGlobals.card.ddlCurrencyID);SB.base.RemoveAllOptions(d);for(i=0;i<fundingGlobals.card.currencyConvertedCardTypes.length;i++){if(fundingGlobals.card.currencyConvertedCardTypes[i]==c){for(j=0;j<fundingGlobals.card.cardTypeCurrencies[i].length;j++){SB.base.AddOption(d,fundingGlobals.card.cardTypeCurrencies[i][j],fundingGlobals.card.cardTypeCurrencies[i][j]);}}}d.selectedIndex=0;d=null;}else{document.getElementById("cardRow5").style.display=GetHiddenDivStyle();}};SB.funding.SetDepositAmountCurrency=function(c,d){document.getElementById(fundingGlobals.card.currencyLabelID).innerHTML=SB.funding.GetSelectedCurrency(c,d);};SB.funding.GetSelectedCurrency=function(c,e){if(SB.funding.CardTypeDoesCurrencyConversion(c)){if(SB.funding.isNewCard(e)){var d=document.getElementById(fundingGlobals.card.ddlCurrencyID);return d.options[d.selectedIndex].text;}else{return document.getElementById("currencyCode_"+e).value;}}else{return fundingGlobals.card.customerCurrency;}};SB.funding.GetCheckedCardId=function(){var c=document.getElementById("cardID").value;return c;};SB.funding.GetCardType=function(d){if(SB.funding.isNewCard(d)){var c=document.getElementById(fundingGlobals.card.ddlCardTypeID);return c.value;}else{return document.getElementById("cardType_"+d).value;}};SB.funding.GetCardTypeDescription=function(f){var c=SB.funding.GetCardType(f);var e=document.getElementById(fundingGlobals.card.ddlCardListID);if(e!=null){for(var d=0;d<e.length;d++){if(e[d].value==c){return e[d].text;}}}return"";};SB.funding.GetSelectedCurrencyConversionRate=function(c){for(i=0;i<fundingGlobals.card.allCardCurrencies.length;i++){if(fundingGlobals.card.allCardCurrencies[i]==c){return fundingGlobals.card.allCardCurrencyRates[i];}}};SB.funding.CalculateConversionAmount=function(d,c){SB.funding.SetConvertedAmount(c,d,"SB.funding.CalculateConversionAmount");};SB.funding.UpdateConvertedAmount=function(d){var e=SB.funding.GetCheckedCardId();if(e!=""){var c=SB.funding.GetCardType(e);SB.funding.SetConvertedAmount(c,e,d);c=null;}e=null;};SB.funding.SetConvertedAmount=function(d,l,e){if(SB.funding.CardTypeDoesCurrencyConversion(d,l)){if(e=="ddlCurrency"){SB.funding.SetDepositAmountCurrency(d,l);}var k=document.getElementById(fundingGlobals.card.txtAmountID);if(k!=null&&k.value!=""&&!isNaN(k.value)){var f=SB.funding.GetSelectedCurrency(d,l);var g=SB.funding.GetSelectedCurrencyConversionRate(f);var m=fundingGlobals.card.customerCurrencyConversionRate;var c=(parseFloat(m)/parseFloat(g))*parseFloat(k.value);document.getElementById(fundingGlobals.card.txtDepositConvertedAmountID).value=c.toFixed(2);f=null;g=null;m=null;c=null;}k=null;}};SB.funding.DisplayCurrencyConversionLabels=function(d,c,e){if(SB.funding.CardTypeDoesCurrencyConversion(c)){e.style.display=GetVisibleDivStyle();document.getElementById(fundingGlobals.card.lblMinDepositID).style.display=GetHiddenDivStyle();document.getElementById(fundingGlobals.card.lblMaxDepositID).style.display=GetHiddenDivStyle();document.getElementById("removedFromYourAccount").innerHTML=fundingGlobals.card.removedFromYourAccount.replace("[PLACEHOLDER]",SB.funding.GetCardTypeDescription(d));document.getElementById("removedFromYourAccount").style.display=GetVisibleDivStyle();document.getElementById("currencyOfYourCard").innerHTML=fundingGlobals.card.currencyOfYourCard.replace("[PLACEHOLDER]",SB.funding.GetCardTypeDescription(d));document.getElementById("currencyOfYourCard").style.display=GetVisibleDivStyle();}else{if(e!=null){e.style.display=GetHiddenDivStyle();}document.getElementById("removedFromYourAccount").style.display=GetHiddenDivStyle();document.getElementById("currencyOfYourCard").style.display=GetHiddenDivStyle();}};SB.funding.DisplayWireCardLabel=function(e,c){if(c=="WM"){if(SB.funding.isNewCard(e)){document.getElementById("cardRowHelpText").style.display=GetVisibleDivStyle();}else{document.getElementById("cardRowHelpText").style.display=GetHiddenDivStyle();}document.getElementById(fundingGlobals.card.lblMaxCustomerCxyDeposit).style.display=GetHiddenDivStyle();document.getElementById("wirecardDepositHelp").style.display=GetVisibleDivStyle();}else{document.getElementById("cardRowHelpText").style.display=GetHiddenDivStyle();document.getElementById(fundingGlobals.card.lblMaxCustomerCxyDeposit).style.display=GetVisibleDivStyle();var d=document.getElementById("wirecardDepositHelp");if(d!=null){d.style.display=GetHiddenDivStyle();}d=null;}};SB.funding.getSelectedPaymentMethod=function(){var c=document.getElementById("ctrlWithdrawMethodList_modFundingWithdrawddlPaymentMethod");if(c==null){c=document.getElementById("ctrlDepositMethodList_modFundingDepositddlPaymentMethod");}if(c==null){return null;}else{paymentMethod=c.options[c.selectedIndex].value;}return paymentMethod;};SB.funding.getCurrentPPID=function(){var c=SB.funding.getSelectedPaymentMethod();if(c!=null){var e=c.split("^");var d=e[1];return d;}else{return null;}};SB.funding.getUserPaymentAccountID=function(){if(SB.funding.getSelectedPaymentMethod()!=null){var c=SB.funding.getSelectedPaymentMethod();var d=c.split("^");var e=d[2];if(SB.funding.isUserPaymentAccountSelected()){e=d[2];}return e;}else{return null;}};SB.funding.getSubPaymentProvider=function(){var c=SB.funding.getSelectedPaymentMethod();if(SB.funding.paymentMethod!=null){if(SB.funding.isSubPaymentProviderSelected()){var d=c.split("^");return d[2];}else{return null;}}else{return null;}};SB.funding.getPopupPaymentProviderSelected=function(){var c=SB.funding.getSelectedPaymentMethod();if(c!=null){if(SB.funding.isPopupPaymentProviderSelected()){var d=c.split("^");return d[2];}else{return null;}}else{return null;}};SB.funding.isSubPaymentProviderSelected=function(){if(SB.funding.getSelectedPaymentMethod().indexOf("subMethods")>=0){return true;}else{return false;}};SB.funding.isPopupPaymentProviderSelected=function(){if(SB.funding.getSelectedPaymentMethod().indexOf("popupMethods")>=0){return true;}else{return false;}};SB.funding.isUserPaymentAccountSelected=function(){if(SB.funding.getSelectedPaymentMethod().indexOf("userPaymentAccounts")>=0){return true;}else{return false;}};SB.funding.loadPaymentMethod=function(e){var f=null;var d="";var c="";if($("#processOriginHidden").val()!=""){d="processOrigin="+$("#processOriginHidden").val();}if(e){f="/t/funding/depositPopUp.aspx?";}else{f="/t/funding/WithdrawalPopUp.aspx?";}Global_processingTitle="hidden";document.getElementById("divProcessingAnimation").className="show";document.getElementById("divShowContent").className="hide";if(SB.funding.getSelectedPaymentMethod().indexOf("separator")>=0){SB.base.RecallOpenDiv((f+d),"popBadSelect1","popVeil1","popLayer1");return false;}if(SB.funding.isPopupPaymentProviderSelected()){c="&currentPPID="+SB.funding.getCurrentPPID();}else{if(SB.funding.isUserPaymentAccountSelected()){c="&currentPPID="+SB.funding.getCurrentPPID()+"&userPaymentAccountID="+SB.funding.getUserPaymentAccountID();}else{if(SB.funding.isSubPaymentProviderSelected()){c="&currentPPID="+SB.funding.getCurrentPPID()+"&subPPID="+SB.funding.getUserPaymentAccountID();}else{c="&currentPPID="+SB.funding.getCurrentPPID();}}}SB.base.RecallOpenDiv((f+d+c),"popBadSelect1","popVeil1","popLayer1");if(SB.funding.isPopupPaymentProviderSelected()){SB.funding.openPopUpOnSuccess();}};SB.funding.openPopUpOnSuccess=function(){var c;if(rState==responseState.success){PopNewWindow(SB.funding.getPopupPaymentProviderSelected());}else{if(rState==responseState.waiting){c=setTimeout("SB.funding.openPopUpOnSuccess()",100);}else{clearTimeout(c);}}};SB.funding.getPaymentMethodInputControl=function(e,g){var c=e.id.split("_");var d=c[0]+"__ctl0_"+g;var f=document.getElementById(d);return f;};SB.funding.ValidateAndDeposit=function(c){document.getElementById("ctrlDepositMethodList_divContent").style.display=GetHiddenDivStyle();if(document.getElementById("_ctl0_divValidationErrors")){document.getElementById("_ctl0_divValidationErrors").style.display=GetHiddenDivStyle();}if(document.getElementById("divFailureResult")){document.getElementById("divFailureResult").style.display=GetHiddenDivStyle();}if(document.getElementById("divSuccessResult")){document.getElementById("divSuccessResult").style.display=GetHiddenDivStyle();}document.getElementById("divMessage").style.display=GetHiddenDivStyle();submitDeposit();};SB.funding.submitDeposit=function(){document.depositForm.submit();};SB.funding.showValidationErrorMessage=function(c){if(c){document.getElementById("divValidationErrors").style.display="block";if(document.getElementById("divError")!=null){document.getElementById("divError").style.display="none";}}else{document.getElementById("divValidationErrors").style.display="none";if(document.getElementById("divError")!=null){document.getElementById("divError").style.display="block";}}};SB.funding.HideCancelButton=function(){var c=SB.funding.getCurrentPPID();if(document.getElementById("divDisplayProgress")!=null){document.getElementById("divDisplayProgress").style.display=GetHiddenDivStyle();}if(c=="BW"){document.getElementById("ctrlDepositMethodList_modFundingDepositBtnCancel").style.display="none";}};SB.funding.onDepositRegisterOnly=function(c){var e=document.forms[0];if(e!=null){var d=e.elements.registerOnly;if(d!=null){d.value="true";}}SB.funding.onSubmitDepositOrWithdrawal(c);};SB.funding.onSubmitDepositOrWithdrawal=function(c){if($("#popLayer1 .popupHead #fundingInProgress").length==0){$("#popLayer1 .popupHead").append($('<input type="hidden" id="fundingInProgress" />'));Global_processingMessage="<p>The form is loading</p>";Global_processingTitle="Please wait a moment...";__doPostBack("","");}};SB.funding.showProcessingTransaction=function(){Global_processingMessage="<p>The form is loading</p>";Global_processingTitle="Please wait a moment...";SB.base.holdingDiv("show");};SB.funding.refreshBalance=function(d){var c=document.getElementById("modCustDisplayBalance");if(c!=null){c.innerHTML=d;}};SB.funding.iFrameRedirection=function(d){var c=document.getElementById("btnRedirect").value;SB.base.RecallOpenDiv(c,"popBadSelect1","popVeil1","popLayer1");};OpenPageInLayer2=function(c){SB.base.OpenDiv(c,"popBadSelect2","popVeil2","popLayer2");};AgeVerification=function(){location.href="/t/customer/myaccount.aspx";};SB.funding.getBankDetails=function(){var c;var e;var d="/t/funding/BTBankDetails.aspx?BankID=";c=document.getElementById("ctrlDepositMethodList__ctl0_lstCurrencyList").selectedIndex;e=document.getElementById("ctrlDepositMethodList__ctl0_lstCurrencyList").options[c].value;d=d+e;SB.funding.LoadHTML(d,"");};SB.funding.LoadHTML=function(d,e){var c=new Object();c.timeout=2000;c.textonly=true;c.Content=e;HTTP.getText(d,SB.funding.CallBackLoadHTML,c);};SB.funding.CallBackLoadHTML=function(c,d){if(c!=null){if(document.getElementById("ctrlDepositMethodList__ctl0_dvBankDetails")!=null){document.getElementById("ctrlDepositMethodList__ctl0_dvBankDetails").innerHTML=c;}else{if(document.getElementById("more_dvBankDetails")!=null){document.getElementById("more_dvBankDetails").innerHTML=c;}}}if(document.getElementById("ctrlDepositMethodList__ctl0_dvBankDetails")!=null){SB.base.divPopUp(1,"refresh");}};SB.funding.getPrintDetails=function(c){var e="<input id='btnCancel' type='button' value='Cancel' runat='server' onclick='SB.base.hideLayer1();' />";var d=document.getElementById("ctrlDepositMethodList__ctl0_dvBankDetails").innerHTML;document.getElementById("dvLoadPrintDetails").innerHTML=d+e;if(c=="False"){document.getElementById("email").value="";document.getElementById("dvLoadPrintDetails").style.display="none";document.getElementById("dvSendEmail").style.display="";}else{document.getElementById("dvLoadPrintDetails").style.display="";document.getElementById("dvSendEmail").style.display="none";window.print();SB.funding.hideLayer2();}};SB.funding.getBankDetailText=function(){var c="";if(document.getElementById("ctrlDepositMethodList__ctl0_dvBankDetails")!=null){c=document.getElementById("ctrlDepositMethodList__ctl0_dvBankDetails").innerHTML;}return c;};SB.funding.sendEmail=function(){var d=document.getElementById("txtEmailAddress").value;if(d!=""){var c="/t/modules/funding/deposit/PrintPopUp.aspx?emailaddress="+d+"&bankDetail="+SB.funding.getBankDetailText();SB.base.RecallOpenDiv(c,"popBadSelect2","popVeil2","popLayer2");}};SB.funding.hideLayer2=function(){SB.base.reStyler("swap","popLayer2, popVeil2, popBadSelect2","show","hide");};PopNewWindow=function(c){var d=window.open(c);d=null;return;};SB.funding.TrackLastDepositField=function trackLastDepositField(){try{countryTracker._trackEvent("Deposit","Form exit",SB_funding_lastTouchField);rollUpTracker._trackEvent("Deposit","Form exit",SB_funding_lastTouchField);dcsMultiTrack("DCSext.depexit",SB_funding_lastTouchField);}catch(c){}SB_funding_lastTouchField="no touch";};var SB_funding_lastTouchField="no touch";SB.funding.RemoveLastFieldTrackingEvents=function(){$(window).unbind("unload.TrackLastDepositField");};SB.funding.TrackLastDepositFieldAndRemoveEvents=function trackLastDepositFieldAndRemoveEvents(){SB.funding.TrackLastDepositField();SB.funding.RemoveLastFieldTrackingEvents();};SB.funding.LoadMethodforModule=function(c){switch(c){case"deposit":if(typeof(SB.funding.loadPaymentMethod)=="function"){SB.funding.loadPaymentMethod(true);}else{setTimeout("SB.funding.LoadMethodforModule('"+c+"')",10);}break;case"withdraw":if(typeof(SB.funding.loadPaymentMethod)=="function"){SB.funding.loadPaymentMethod(false);}else{setTimeout("SB.funding.LoadMethodforModule('"+c+"')",10);}break;case"carddeposit":if(typeof(SB.funding.cardDeposit.OnDropdownSelectionChange)=="function"){SB.funding.cardDeposit.OnDropdownSelectionChange();}else{setTimeout("SB.funding.LoadMethodforModule('"+c+"')",10);}break;case"cardwithdraw":if(typeof(OnWithdrawDropdownSelectionChange)=="function"){OnWithdrawDropdownSelectionChange();}else{setTimeout("SB.funding.LoadMethodforModule('"+c+"')",10);}break;default:break;}};SB.funding.DisplayMaestroLabel=function(c){if(c=="MA"||c=="SW"){document.getElementById("issueNumberTip").style.display=GetVisibleDivStyle();}else{document.getElementById("issueNumberTip").style.display=GetHiddenDivStyle();}};SB.funding.AdjustCVV2Rules=function(c){var e=$("#ctrlDepositMethodList__ctl0_txtCvv2");var d=e.attr("data");if(c=="LS"){e.attr("data",d.replace('"required":true','"required":false'));}else{e.attr("data",d.replace('"required":false','"required":true'));}e.data("metadata",null);};SB.funding.ResetTooltipError=function(){if(fundingGlobals.card.hasNoErrors=="false"){var c=document.getElementById("divFunding").getElementsByTagName("strong");for(i=0;i<c.length;i++){if(c[i].className=="icons icoError"){if(c[i].id.indexOf("cvv2No")!=-1){c[i].className="icons icoInfo";document.getElementById(c[i].id.replace(/ico_?/i,"ttt_")).className="toolTipText tttInfo";document.getElementById(c[i].id.replace(/ico_?/i,"ttt_")).innerHTML='<span class="tttContent">'+SB.funding.CVVInfoMessage+"</span>";continue;}c[i].className="icons";document.getElementById(c[i].id.replace(/ico_?/i,"ttt_")).innerHTML="";}}}};SB.funding.ProcessCardSelectionChange=function(c){switch(c){case"carddeposit":SB.funding.ResetTooltipError();SB.funding.resetErrorState();SB.funding.cardDeposit.resetCardFields();SB.funding.LoadMethodforModule(c);break;case"cardwithdraw":SB.funding.ResetTooltipError();SB.funding.ResetCardForm();SB.funding.resetErrorState();SB.funding.LoadMethodforModule(c);break;}};SB.funding.resetErrorState=function(){fundingGlobals.card.hasNoErrors="true";};SB.funding.calculateConversionForSpeedCard=function(f){var g=document.getElementById("convertedCurrency");if(g!=null){while(g.hasChildNodes()){g.removeChild(g.firstChild);}var d=NaN;if(f){d=parseFloat(document.getElementById("ctrlDepositMethodList__ctl0_modFundingDepositSCDAmount").value);}else{d=parseFloat(document.getElementById("ctrlWithdrawMethodList__ctl0_modFundingWithdrawSCDAmount").value);}var e=parseFloat(document.getElementById("conversionRate").value);if(isNaN(d)||isNaN(e)){g.appendChild(document.createTextNode("0"));}else{var c=(Math.round(d*e*100)/100);g.appendChild(document.createTextNode(c.toString()));}}};SB.funding.BankTranfer=function(c){this.div=c;this.setup();};SB.funding.BankTranfer.prototype={setup:function(){var c=this;$("select.bankName",this.div).change(function(){c.handleOtherOption(this);});},handleOtherOption:function(d){var c=$(":selected",d).val().toLowerCase();var e=$(":text.bankName",this.div);c=="other"?e.removeClass("hidden"):e.addClass("hidden");}};SB.funding.FragmentChanged=function(l){var q=$("input[id$='txtCardno']");var k=$("input[id$='CardNumber_Fragment1']");var g=$("input[id$='CardNumber_Fragment2']");var f=$("input[id$='CardNumber_Fragment3']");var d=$("input[id$='CardNumber_Fragment4']");var c=(window.event)?window.event:l;var m=c.target?c.target:c.srcElement;var o=c.keyCode;switch(o){case 16:case 20:case 17:case 9:return;break;}if(m.value.length>4){m.value=m.value.substring(0,4);}if(((m.value.length==4&&o!=39)||o==39)&&(SB.funding.GetCursorPosition(m)==m.value.length)){switch(m){case k.get(0):g.get(0).focus();break;case g.get(0):f.get(0).focus();break;case f.get(0):d.get(0).focus();break;}}else{if((o==8||o==37)&&SB.funding.GetCursorPosition(m)==0){switch(m){case d.get(0):f.get(0).focus();SB.funding.SetCursorPosition(f.get(0),f.get(0).value.length);break;case f.get(0):g.get(0).focus();SB.funding.SetCursorPosition(g.get(0),g.get(0).value.length);break;case g.get(0):k.get(0).focus();SB.funding.SetCursorPosition(k.get(0),k.get(0).value.length);break;}}}q.get(0).value=[k.val(),g.val(),f.val(),d.val()].join("");if(q.get(0).value.length==16){SB.funding.cardDeposit.luhnCheckCardNumber();}};SB.funding.SetCursorPosition=function(d,e){if(d.setSelectionRange){d.setSelectionRange(e,e);}else{if(d.createTextRange){var c=d.createTextRange();c.collapse(true);c.moveEnd("character",e);c.moveStart("character",e);c.select();}}};SB.funding.GetCursorPosition=function(f){if(f.selectionStart){var g=f.selectionStart;return g>0?g:0;}else{if(f.createTextRange){f.focus();var c=document.selection.createRange();if(c==null){return"0";}var d=f.createTextRange();var e=d.duplicate();d.moveToBookmark(c.getBookmark());e.setEndPoint("EndToStart",d);return e.text.length;}else{return 0;}}};SB.funding.removeEmptyOptionFromBTWithdraw=function(){var c=document.getElementById("ctrlWithdrawMethodList__ctl0_ddlBankName");if(c!=null&&c.options.length>0&&c.options[0].value==" "){c.remove(0);}};function roundNumber(c,d){return Math.round(c*Math.pow(10,d))/Math.pow(10,d);}SB.funding.calculateAmountWithFee=function(o,l,k,q,f){var m=$("input[id$='withFee']");if(m.length>0){var c=0;var d=m.get(0);try{var g=parseFloat($(o).get(0).value);if(!(isNaN(g)||g==0)){if(k){c=roundNumber(g*(1+l/100),2);}else{c=g+l;}}}catch(e){}d.value=c+q+f;}};SB.funding.UpdateMetadata=function(d,c){d.data("metadata",c);};SB.funding.removeAmountWithFeeValidation=function(d,c){if(c){if(c.messages){if(c.messages.minvalue){c.messages.minValueFee=c.messages.minvalue;}if(c.messages.maxvalue){c.messages.maxValueFee=c.messages.maxvalue;}}c.maxValueFee=false;c.minValueFee=false;SB.funding.UpdateMetadata(d,c);}};SB.funding.removeAmountValidation=function(d,c){if(c){c.maxvalue=false;c.minvalue=false;SB.funding.UpdateMetadata(d,c);}};SB.funding.calculateAmountWithDepositFee=function(u,d,D,s,v,r,k,A,q,f,w,o,e,y,g,B,C,m,l,c){SB.funding.calculateAmountWithDepositFeeWithIsMinMaxValidatorReq(u,d,D,s,v,r,k,A,q,f,w,o,e,y,g,B,C,m,l,c,true);};SB.funding.getDepositFee=function(k,q,l,e,o,f,d,m,c,g){var r=0;if((l==null||isNaN(l))||l>=g){r=r+c*((k!=null&&!isNaN(k))?k:0);r=r+c*((q!=null&&!isNaN(q))?q*g*0.01:0);}else{if((f==null||isNaN(f))||f>=g){r=r+c*((e!=null&&!isNaN(e))?e:0);r=r+c*((o!=null&&!isNaN(o))?o*g*0.01:0);}else{r=r+c*((d!=null&&!isNaN(d))?d:0);r=r+c*((m!=null&&!isNaN(m))?m*g*0.01:0);}}return Math.round(r*100)/100;};SB.funding.calculateAmountWithDepositFeeWithIsMinMaxValidatorReq=function(F,d,N,B,G,A,o,J,y,k,H,w,g,I,m,L,M,u,s,c,f){var E=parseFloat($(F).get(0).value);var K=$(d).get(0);var l=$(N).get(0);var C=0;var r=1;var D=E;var e=$(F);$.metadata.setType("attr","data");e.metadata();var v=e.data("metadata");SB.funding.removeAmountWithFeeValidation(e,v);try{if(!I){r=-1;}if(K&&!isNaN(E)&&E>0){SB.funding.removeAmountValidation(e,v);if((J==null||isNaN(J))||J>=E){C=C+r*((A!=null&&!isNaN(A))?A:0);C=C+r*((o!=null&&!isNaN(o))?o*E*0.01:0);}else{if((H==null||isNaN(H))||H>=E){C=C+r*((y!=null&&!isNaN(y))?y:0);C=C+r*((k!=null&&!isNaN(k))?k*E*0.01:0);}else{C=C+r*((w!=null&&!isNaN(w))?w:0);C=C+r*((g!=null&&!isNaN(g))?g*E*0.01:0);}}C=Math.round(C*100)/100;D=(E+C).toFixed(2);l.value=C;if(I){if(!isNaN(B)&&D<B){if(K){K.value=s;}if(f&&v){v.minValueFee=true;SB.funding.UpdateMetadata(e,v);}return;}if(!isNaN(G)&&D>G){if(K){K.value=c;}if(f&&v){v.maxValueFee=true;SB.funding.UpdateMetadata(e,v);}return;}}else{if(!isNaN(B)&&E<B){if(K){K.value=s;}if(f&&v){v.minValueFee=true;SB.funding.UpdateMetadata(e,v);}return;}if(!isNaN(G)&&E>G){if(K){K.value=c;}if(f&&v){v.maxValueFee=true;SB.funding.UpdateMetadata(e,v);}return;}}if(C>0){K.value=(Math.round(D*Math.pow(10,L))/Math.pow(10,L))+" "+m+" "+M;}else{K.value=(Math.round(D*Math.pow(10,L))/Math.pow(10,L))+" "+m+" "+u;}}else{if(K){K.value="";}l.value=Math.round(100*r*((A!=null&&!isNaN(A))?A:0))/100;}}catch(q){if(K){K.value="";}l.value=Math.round(100*r*((A!=null&&!isNaN(A))?A:0))/100;}};SB.funding.calculateAmountWithWithdrawFee=function(y,B,F,A,u,C,s,k,E,r,f,D,q,e,g,I,m,c){var G=$(F).get(0);var H=$(A).get(0);var v=0;var w=y;var d=$(B);$.metadata.setType("attr","data");d.metadata();var o=d.data("metadata");SB.funding.removeAmountWithFeeValidation(d,o);try{if(G&&!isNaN(y)&&y>0){SB.funding.removeAmountValidation(d,o);if((E==null||isNaN(E))||E>=y){v=v+((s!=null&&!isNaN(s))?s:0);v=v+((k!=null&&!isNaN(k))?k*y*0.01:0);}else{if((D==null||isNaN(D))||D>=y){v=v+((r!=null&&!isNaN(r))?r:0);v=v+((f!=null&&!isNaN(f))?f*y*0.01:0);}else{v=v+((q!=null&&!isNaN(q))?q:0);v=v+((e!=null&&!isNaN(e))?e*y*0.01:0);}}v=Math.round(v*100)/100;w=y-v;H.innerHTML=v+" "+g;if(u!=null&&!isNaN(u)&&w<u){G.innerHTML=m;if(o){o.minValueFee=true;SB.funding.UpdateMetadata(d,o);}return;}if(C!=null&&!isNaN(C)&&w>C){G.innerHTML=c;if(o){o.maxValueFee=true;SB.funding.UpdateMetadata(d,o);}return;}G.innerHTML=(Math.round(w*Math.pow(10,I))/Math.pow(10,I))+" "+g;}else{if(G){G.innerHTML="";}H.innerHTML=Math.round(((s!=null&&!isNaN(s))?s:0)*100)/100;}}catch(l){if(G){G.innerHTML="";}H.innerHTML=Math.round(((s!=null&&!isNaN(s))?s:0)*100)/100;}};SB.funding.getDepositAmount=function(v,e,A,u,d,y,s,c,f,w){w=Math.round(w*100)/100;var m=(w-(f*v))/(1+(f*e*0.01));var l=Math.round(m*100)/100;var r=SB.funding.getDepositFee(v,e,A,u,d,y,s,c,f,l);var D=Math.round((l+r)*100)/100;if(D!=w){var k=(w-(f*u))/(1+(f*d*0.01));l=Math.round(k*100)/100;var q=SB.funding.getDepositFee(v,e,A,u,d,y,s,c,f,l);var C=Math.round((l+q)*100)/100;if(C!=w){var g=(w-(f*s))/(1+(f*c*0.01));l=Math.round(g*100)/100;var o=SB.funding.getDepositFee(v,e,A,u,d,y,s,c,f,l);var B=Math.round((l+o)*100)/100;if(B!=w){return;}}}return l;};SB.funding.populateMissingAmount=function(){var d=$("#missingAmount");if(d.length>0){var e=d.val()-0;var g=$("#minimumDepositAmount").val()-0;var f=(g>e)?g:e;var c=$("input:text:visible[id$='Amount']");if(c.length!=0){c.val(f);}else{c=$("select[id$='Amount']");if(c.length!=0){c.get(0).selectedIndex=$("select[id$='Amount'] option").filter(function(k){return($(this).text()>=f);})[0].index;}}c.change();}};SB.funding.validation=function(d,c){this.container=d;this.submitbutton=c;this.validator=null;this.commaDelimitedErrors="";this.errorCounter=0;this.originalOnClick=null;};SB.funding.validation.prototype={metaDataAttribute:"data",ignoreAttribute:"ignore",errorIconAttribute:"erroricon",errorTooltipAttribute:"errortooltip",setup:function(){var self=this;$("#divFunding input:not([data]), #divFunding select:not([data])").attr("data","{alwaysvalid: true}");self.addMetadataToHelper("ctrlDepositMethodList__ctl0_validFromDate");self.addMetadataToHelper("ctrlDepositMethodList__ctl0_validToDate");$.metadata.setType("attr",self.metaDataAttribute);jQuery.validator.addMethod("notequalto",function(value,element,param){return this.optional(element)||value!=$(param).val();});jQuery.validator.addMethod("equalto",function(value,element,param){return this.optional(element)||value==$(param).val();});jQuery.validator.addMethod("maxLen",function(value,element,param){return this.optional(element)||!(this.getLength($.trim(value),element)>param);});jQuery.validator.addMethod("minLen",function(value,element,param){return this.optional(element)||!(this.getLength($.trim(value),element)<param);});jQuery.validator.addMethod("minvalue",function(value,element,param){return this.optional(element)||!value||parseFloat(value)>=parseFloat(param);});jQuery.validator.addMethod("maxvalue",function(value,element,param){return this.optional(element)||!value||parseFloat(value)<=parseFloat(param);});jQuery.validator.addMethod("minValueFee",function(value,element,param){return !value;});jQuery.validator.addMethod("maxValueFee",function(value,element,param){return !value;});jQuery.validator.addMethod("insufficientFunds",function(value,element,param){return this.optional(element)||value<=param;});jQuery.validator.addMethod("equaltoifnotempty",function(value,element,param){if($(param).val().length>0){if(!this.check($(param))){var errlist=this.errorList;this.showErrors();this.errorList=errlist;}}return true;});jQuery.validator.addMethod("luhnCheck",function(value,element,param){if(document.getElementById("ctrlDepositMethodList__ctl0_txtCardno")!=null){SB.funding.cardDeposit.InitialializeCardObjects();return SB.funding.cardDeposit.CheckNumberOnChange()!="failed";}return SB.funding.luhnCheckValue(value);});jQuery.validator.addMethod("compareTrue",function(value,element,param){return this.optional(element)||value==param;});jQuery.validator.addMethod("validdate",function(value,element,param){if(value=="invalid"){return false;}return true;});jQuery.validator.addMethod("alwaysvalid",function(value,element,param){return true;});jQuery.validator.addMethod("pattern",function(value,element,param){var newParam;if(typeof(param)=="string"){newParam=param;}else{newParam=param.source;}newParam=newParam.replace("\\w*","[\\p{Ll}\\p{Lu}\\p{Lt}\\p{Lo}\\p{Nd}\\p{Pc}]*").replace("\\w+","[\\p{Ll}\\p{Lu}\\p{Lt}\\p{Lo}\\p{Nd}\\p{Pc}]+").replace("\\w","\\p{Ll}\\p{Lu}\\p{Lt}\\p{Lo}\\p{Nd}\\p{Pc}");var regExp=new XRegExp(newParam);return this.optional(element)||regExp.test(value);});self.validator=self.container.validate({forcevalidate:true,ignore:"."+self.ignoreAttribute,errorPlacement:function(error,element,message){self.afterFailedValidation(error,element,message);},success:function(label,element){self.afterSuccessValidation(label,element);},invalidHandler:function(e,validator){var errors=validator.numberOfInvalids();if(errors){}},onfocusout:function(element){if((!this.checkable(element)&&(element.name in this.submitted||!this.optional(element)))||this.settings.forcevalidate){this.element(element);}},onclick:function(element){if(element.name in this.submitted){this.element(element);}else{if(element.parentNode.name in this.submitted){this.element(element.parentNode);}}}});$("input:checkbox",this.container).unbind(".validateCheckboxFields").bind("change.validateCheckboxFields blur.validateCheckboxFields",function(){self.validator.element(this);});$("input, select",this.container).unbind(".autoTooltip").bind("focus.autoTooltip",function(){ttSlim.Show($(this).attr(self.errorTooltipAttribute));}).bind("keypress.autoTooltip blur.autoTooltip",function(){ttSlim.HideNow($(this).attr(self.errorTooltipAttribute));});self.originalOnClick=self.submitbutton.attr("onclick");self.submitbutton.removeAttr("onclick").unbind().bind("click",function(event){var isValid=self.validate();if(isValid&&self.originalOnClick!=null){SB.funding.RemoveLastFieldTrackingEvents();if(typeof self.originalOnClick=="function"){self.originalOnClick(event);}else{eval(self.originalOnClick);}self.originalOnClick=null;self.validate();}return isValid;});$(".valid",self.container).each(function(index,element){self.validator.submitted[element.name]="";});$(".error",self.container).each(function(index,element){$(element).addClass("fieldError");self.validator.submitted[element.name]="";});$("#cardRow2A select").unbind(".dateValidation").bind("focus.dateValidation focusout.dateValidation",function(){$(self.container).unbind(".dateFieldsValidation").bind("focusin.dateFieldsValidation",function(event){if($(event.target).parents("#cardRow2A").length==0){self.checkDate("From");self.validateDateFields("From");$(self.container).unbind(".dateFieldsValidation");}});}).bind("change.dateValidation",function(){self.checkDate("From");if($("#ctrlDepositMethodList__ctl0_ico_validFromDate").hasClass("icoError")||$("#cardRow2A select").hasClass("fieldError")){self.validateDateFields("From");}}).click(function(){self.validateElement($("#ctrlDepositMethodList__ctl0_validFromDate"));});$("#cardRow3B select").unbind(".dateValidation").bind("focus.dateValidation focusout.dateValidation",function(){$(self.container).unbind(".dateFieldsValidation").bind("focusin.dateFieldsValidation",function(event){if($(event.target).parents("#cardRow3B").length==0){self.checkDate("To");self.validateDateFields("To");$(self.container).unbind(".dateFieldsValidation");}});}).bind("change.dateValidation",function(){self.checkDate("To");if($("#ctrlDepositMethodList__ctl0_ico_validToDate").hasClass("icoError")||$("#cardRow3B select").hasClass("fieldError")){self.validateDateFields("To");}});$("#modFundingDepositBtnCard").click(function(){self.validateDateFields("From");}).click(function(){self.validateDateFields("To");});},afterSuccessValidation:function(d,e){var c=this;var f=$("#"+e.attr(this.errorIconAttribute));var g=$("#"+e.attr(c.errorTooltipAttribute));g.empty();if(e.attr(c.metaDataAttribute)!==undefined){f.removeClass("icoInfo").removeClass("icoError").addClass("icoTrue");}e.siblings(".icons").removeClass("icoInfo").removeClass("icoError").addClass("icoTrue");e.removeClass("fieldError").addClass("valid");},afterFailedValidation:function(f,g,k){this.addErrorToLivePersonErrorTracking(k);var d=this;var e=g.attr(this.errorIconAttribute);var m=g.attr(d.errorTooltipAttribute);if(e){$("#"+e).removeClass("icoTrue").removeClass("icoInfo").addClass("icoError");}g.addClass("fieldError");if(m){var l=$("#"+m);l.addClass("tttError").empty().append($('<span class="tttContent"></span>').html(k));if(l.is(":visible")){ttSlim.HideNow(m);ttSlim.Show(m);}}g.siblings(".icons").removeClass("icoInfo").removeClass("icoTrue").addClass("icoError");g.siblings(".toolTipText").addClass("tttError");g.removeClass("valid").addClass("fieldError");var c=g.siblings(".toolTipText").children(".tttContent");if(c.attr("msg")==null){c.attr("msg",c.html());}c.html(k);},addErrorToLivePersonErrorTracking:function(c){if(c!=undefined){if(this.commaDelimitedErrors!=""){this.commaDelimitedErrors+=",";}this.commaDelimitedErrors+=c;this.errorCounter++;}},validate:function(){this.clearLivePersonTracking();var c=this.container.validate().form();this.sendErrorTrackingDataToLivePerson(c);return c;},clearLivePersonTracking:function(){this.commaDelimitedErrors="";this.errorCounter=0;},sendErrorTrackingDataToLivePerson:function(c){if(!c&&typeof lpSendData=="function"){lpSendData("page","ErrorName",this.commaDelimitedErrors);lpSendData("page","ErrorCounter",this.errorCounter);}},validateElement:function(c){return this.container.validate().element(c);},checkDate:function(c){var e=function(){var f=new Date($("#ctrlDepositMethodList__ctl0_ddlValid"+c+"Year").val(),$("#ctrlDepositMethodList__ctl0_ddlValid"+c+"Month").val()-(c=="From"?1:0),1,0,0,0,0);if((c=="To"&&f<=new Date())||(c=="From"&&f>new Date())){return false;}return true;};var d=$("#ctrlDepositMethodList__ctl0_ddlValid"+c+"Month").val()&&$("#ctrlDepositMethodList__ctl0_ddlValid"+c+"Year").val();$("#ctrlDepositMethodList__ctl0_valid"+c+"Date").val(d);if(d&&!e()){$("#ctrlDepositMethodList__ctl0_valid"+c+"Date").val("invalid");this.validator.element($("#ctrlDepositMethodList__ctl0_valid"+c+"Date"));}},validateDateFields:function(c){this.validator.element($("#ctrlDepositMethodList__ctl0_ddlValid"+c+"Month"));this.validator.element($("#ctrlDepositMethodList__ctl0_ddlValid"+c+"Year"));this.validator.element($("#ctrlDepositMethodList__ctl0_valid"+c+"Date"));!$("#ctrlDepositMethodList__ctl0_txtCardno").val()||this.validator.element($("#ctrlDepositMethodList__ctl0_txtCardno"));},addMetadataToHelper:function(id){if($("#"+id).length){var helperMetadata=eval("("+$("#"+id).attr(this.metaDataAttribute)+")");$("#"+id).data("metadata",helperMetadata);}}};SB.funding.OnePendingDeposit=function(m,l,e,f,g,d,k,c){this.amountFieldClientId=m;this.feeHiddenClientId=l;this.useOnePendingHiddenClientId=e;this.grossAmount=f;this.minimumRemainderWithdrwalAmount=g;this.fieldsToDisable=d;this.depositProviderName=k;this.currency=c;this.init();};SB.funding.OnePendingDeposit.currentObject=null;SB.funding.OnePendingDeposit.showOnePendingPopup=false;SB.funding.OnePendingDeposit.checkDepositForPendingWithdrawal=function(){if(SB.funding.OnePendingDeposit.showOnePendingPopup){SB.funding.OnePendingDeposit.openOnePendingDepositPopup();}else{if(SB.funding.OnePendingDeposit.currentObject!=null){$("#"+SB.funding.OnePendingDeposit.currentObject.useOnePendingHiddenClientId).val("false");}SB.funding.onSubmitDepositOrWithdrawal(true);}};SB.funding.OnePendingDeposit.openOnePendingDepositPopup=function(){var f=$("#"+SB.funding.OnePendingDeposit.currentObject.amountFieldClientId).val();var c=$("#"+SB.funding.OnePendingDeposit.currentObject.feeHiddenClientId).val();var g=SB.funding.OnePendingDeposit.currentObject.grossAmount;var k=SB.funding.OnePendingDeposit.currentObject.minimumRemainderWithdrwalAmount;var l=SB.funding.OnePendingDeposit.currentObject.depositProviderName;var d=SB.funding.OnePendingDeposit.currentObject.currency;var e="/modules/funding/PendingWithDrawalPopup.aspx";e+="?amount="+f;e+="&grossAmount="+g;e+="&minimumRemainderWithdrwalAmount="+k;e+="&depositProviderName="+l;e+="&currency="+d;if(c!=="0"){e+="&fee="+c;}else{e+="&fee=nofee";}SB.base.OpenDivCheckLoginStatus(e,"popBadSelect2","popVeil2","popLayer2",false);};SB.funding.OnePendingDeposit.prototype={init:function(){SB.funding.OnePendingDeposit.showOnePendingPopup=true;validators=new SB.funding.validation($("#aspnetForm"),$("#pendingWithdrawalLink"));validators.setup();},checkPWAvailableByAmount:function(){var c=$("#"+this.amountFieldClientId).val();if(c<=this.grossAmount-this.minimumRemainderWithdrwalAmount||c==this.grossAmount){SB.funding.OnePendingDeposit.showOnePendingPopup=true;}else{SB.funding.OnePendingDeposit.showOnePendingPopup=false;}},disablePWAffectedFields:function(){for(var e=0;e<this.fieldsToDisable.length;e++){var d=$("#"+this.fieldsToDisable[e]);d.attr("disabled","disabled");var c=$("#"+d.attr("errortooltip"));c.empty();c=$("#"+d.attr("erroricon"));c.removeClass("icoError");d.removeClass("fieldError");}},enablePWAffectedFields:function(){for(var c=0;c<this.fieldsToDisable.length;c++){$("#"+this.fieldsToDisable[c]).attr("disabled","");}}};var fundingJSLoaded=true;if(typeof(SB)=="undefined"||SB==null){var SB=new Object();}if(typeof(SB.funding)=="undefined"||SB.funding==null){SB.funding=new Object();}SB.funding.cardDeposit=new Object();SB.funding.cardDeposit.onNewCardTypeChange_Card=function(c){var d=document.getElementById("cardRow4");var e=document.getElementById("cardRow9");SB.funding.onCardTypeChange(c.value,"new",d,e);oCardRow2=null;oCardRow7=null;SB.funding.displayDepositAmounts(c.value,"new");};SB.funding.cardDeposit.validateCARD=function(d){var c=true;return c;};SB.funding.cardDeposit.disableDepositExpiredCard=function(l,c,g,e,k){var m="false";var f="false";if((e>c)||(e==c&&g>l)){m="true";}else{if((e==c&&g==l&&k>25)){f="true";}}if(m!="true"&&f!="true"){SB.funding.cardDeposit.clearExpiryDateIndicator();}else{var d=m=="true"?"Sorry your card has expired.":"We cannot accept a deposit using this card so close to its Expiry Date. If your bank has sent a replacement for this card, please update the Expiry Date or alternatively use another card.";document.getElementById("lnkActiveCard").style.display="none";document.getElementById("lnkExpiredCard").style.display="block";SB.funding.cardDeposit.setExpiryDateIndicator(d);}};SB.funding.cardDeposit.setExpiryDateIndicator=function(d){SB.base.holdingDiv("hide");var c=document.getElementById("ctrlDepositMethodList__ctl0_ico_expiryDate");var e=document.getElementById("ctrlDepositMethodList__ctl0_ttt_expiryDate");c.className="icons icoError";e.className="toolTipText tttError";SB.funding.cardDeposit.removeExistingTooltipMessage(e);bubble_info_message=d;SB.funding.cardDeposit.createTooltipMessageTag(e);SB.base.ToggleElement("cardExpired","display","block");};SB.funding.cardDeposit.clearExpiryDateIndicator=function(){var c=document.getElementById("ctrlDepositMethodList__ctl0_ico_expiryDate");var d=document.getElementById("ctrlDepositMethodList__ctl0_ttt_expiryDate");c.className="icons";d.className="toolTipText";SB.funding.cardDeposit.removeExistingTooltipMessage(d);SB.base.ToggleElement("cardExpired","display","none");};SB.funding.cardDeposit.loadManageCard=function(){var f="";var e="";var c=SB.funding.getCurrentPPID();var d=document.getElementById("cardID").value;Global_processingTitle="Please wait a moment...";Global_processingMessage="<p>The form is loading</p>";f="currentPPID="+c+"&userPaymentAccountID="+d+"&source=deposit";e="/t/funding/ManageCardPopup.aspx?"+f;SB.base.RecallOpenDiv(e,"popBadSelect1","popVeil1","popLayer1");};SB.funding.cardDeposit.OnDropdownSelectionChange=function(){document.getElementById("lnkActiveCard").style.display="block";document.getElementById("lnkExpiredCard").style.display="none";var m=document.getElementById("ctrlDepositMethodList__ctl0_dpdwnCardList");var u=m.options[m.selectedIndex].value;document.getElementById("dropdownSelection").value=u;var g=new Array();g=u.split("_");SB.funding.cardDeposit.createHiddenControls(g);if(g.length>16){var C=g[0];var l=g[1];var J=g[2];var H=g[3];var B=g[4];var d=g[5];var c=g[6];var E=g[7];var v=g[8];var F=g[9];var k=g[10];var K=g[11];var r=g[12];var o=g[13];document.getElementById("dvSavedCards").style.display="";document.getElementById("ctrlDepositMethodList__ctl0_ddlCardType").value=J;document.getElementById("cardID").value=C;document.getElementById("ctrlDepositMethodList__ctl0_InvoiceHelpDiv").style.display=(l=="IV")?"block":"none";SB.funding.onDepositCardSelect(C,l,J,fundingGlobals.card.hasNoErrors);var D=document.getElementById("ctrlDepositMethodList__ctl0_lblCardType");D.innerHTML=H;D.style.display="";document.getElementById("ctrlDepositMethodList__ctl0_spCardType").style.display="";var w=document.getElementById("ctrlDepositMethodList__ctl0_lblCardNumber");w.innerHTML=B;w.style.display="";document.getElementById("ctrlDepositMethodList__ctl0_spCardNumber").style.display="";var f=document.getElementById("ctrlDepositMethodList__ctl0_lblExpiryMonth");f.innerHTML=c;f.style.display="";document.getElementById("ctrlDepositMethodList__ctl0_spExpiryDate").style.display="";var q=document.getElementById("ctrlDepositMethodList__ctl0_lblExpiryYear");q.innerHTML=E;q.style.display="";SB.funding.cardDeposit.disableDepositExpiredCard(c,E,K,r,o);var d=g[5];if(d!=""&&d!=null){if(J=="MA"||J=="SW"||J=="unknown"){var I=d.substr(4,2);var G=d.substr(0,4);var A=document.getElementById("ctrlDepositMethodList__ctl0_lblStartMonth");A.innerHTML=I;A.style.display="";document.getElementById("ctrlDepositMethodList__ctl0_spStartDate").style.display="";var s=document.getElementById("ctrlDepositMethodList__ctl0_lblStartYear");s.innerHTML=G;s.style.display="";var e=document.getElementById("ctrlDepositMethodList__ctl0_lblIssueNumber");e.innerHTML=v;e.style.display="";document.getElementById("ctrlDepositMethodList__ctl0_spIssueNumber").style.display="";}else{SB.funding.cardDeposit.hideStartDateAndIssueNo();}}else{SB.funding.cardDeposit.hideStartDateAndIssueNo();}}else{document.getElementById("cardID").value="new";document.getElementById("cardID").value="new";SB.funding.onDepositCardSelect("new","unknown",false,fundingGlobals.card.hasNoErrors);SB.funding.cardDeposit.hideSavedCardAttributes();SB.funding.onNewCardTypeChange(m);var y=new Array();y=u.split("___");document.getElementById("ctrlDepositMethodList__ctl0_ddlCardType").value=y[0];document.getElementById("cardType").value=y[0];document.getElementById("ctrlDepositMethodList__ctl0_InvoiceHelpDiv").style.display="none";}};SB.funding.cardDeposit.hideStartDateAndIssueNo=function(){document.getElementById("ctrlDepositMethodList__ctl0_lblStartMonth").style.display="none";document.getElementById("ctrlDepositMethodList__ctl0_spStartDate").style.display="none";document.getElementById("ctrlDepositMethodList__ctl0_lblStartYear").style.display="none";document.getElementById("ctrlDepositMethodList__ctl0_lblIssueNumber").style.display="none";document.getElementById("ctrlDepositMethodList__ctl0_spIssueNumber").style.display="none";};SB.funding.cardDeposit.hideSavedCardAttributes=function(){document.getElementById("dvSavedCards").style.display="none";document.getElementById("ctrlDepositMethodList__ctl0_lblCardType").style.display="none";document.getElementById("ctrlDepositMethodList__ctl0_spCardType").style.display="none";document.getElementById("ctrlDepositMethodList__ctl0_lblCardNumber").style.display="none";document.getElementById("ctrlDepositMethodList__ctl0_spCardNumber").style.display="none";document.getElementById("ctrlDepositMethodList__ctl0_spExpiryDate").style.display="none";document.getElementById("ctrlDepositMethodList__ctl0_lblExpiryMonth").style.display="none";document.getElementById("ctrlDepositMethodList__ctl0_lblExpiryYear").style.display="none";document.getElementById("ctrlDepositMethodList__ctl0_spStartDate").style.display="none";document.getElementById("ctrlDepositMethodList__ctl0_lblStartMonth").style.display="none";document.getElementById("ctrlDepositMethodList__ctl0_lblStartYear").style.display="none";document.getElementById("ctrlDepositMethodList__ctl0_lblIssueNumber").style.display="none";document.getElementById("ctrlDepositMethodList__ctl0_spIssueNumber").style.display="none";};SB.funding.cardDeposit.createHiddenControls=function(c){var d=new Array();d=c;SB.funding.cardDeposit.createHiddenProviderId(d[0],d[1]);SB.funding.cardDeposit.createHiddenCardType(d[0],d[2]);SB.funding.cardDeposit.createHiddenCvv2(d[0],d[9]);SB.funding.cardDeposit.createHiddenCurrencyCode(d[0],d[10]);};SB.funding.cardDeposit.createHiddenProviderId=function(f,c){if(document.getElementById("cardProviderID_"+f)===null){var d=document.getElementById("placeholderHiddenControls");var e=document.createElement("input");e.setAttribute("type","hidden");e.setAttribute("id","cardProviderID_"+f);e.setAttribute("name","cardProviderID_"+f);e.setAttribute("value",c);d.appendChild(e);}};SB.funding.cardDeposit.createHiddenCardType=function(f,c){if(document.getElementById("cardType_"+f)===null){var d=document.getElementById("placeholderHiddenControls");var e=document.createElement("input");e.setAttribute("type","hidden");e.setAttribute("id","cardType_"+f);e.setAttribute("name","cardType_"+f);e.setAttribute("value",c);d.appendChild(e);}};SB.funding.cardDeposit.createHiddenCvv2=function(e,f){if(document.getElementById("cvv2_"+e)===null){var c=document.getElementById("placeholderHiddenControls");var d=document.createElement("input");d.setAttribute("type","hidden");d.setAttribute("id","cvv2_"+e);d.setAttribute("name","cvv2_"+e);d.setAttribute("value",f);c.appendChild(d);}};SB.funding.cardDeposit.onCardDeposit=function(c){var d=document.getElementById(fundingGlobals.card.ddlDepositAmountID);var e=document.getElementById(fundingGlobals.card.txtAmountID);if(d!=null){if(d.style.display!="none"){e.value=d.value;}}Global_processingMessage="<p>We're processing your transaction...</p>";Global_processingTitle="Please wait a moment...";__doPostBack("","");};SB.funding.cardDeposit.createHiddenCurrencyCode=function(f,c){if(document.getElementById("currencyCode_"+f)===null){var d=document.getElementById("placeholderHiddenControls");var e=document.createElement("input");e.setAttribute("type","hidden");e.setAttribute("id","currencyCode_"+f);e.setAttribute("name","currencyCode_"+f);e.setAttribute("value",c);d.appendChild(e);}};var Cards;var MC;var VI;var AmExCard;var DinersClubCard;var DiscoverCard;var enRouteCard;var JCBCard;var LuhnCheckSum;var MA;var SW;var VE;var MD;var VD;var bubble_info_message="Please check your card details as they appear to be incorrect.";SB.funding.cardDeposit.InitialializeCardObjects=function(){Cards=new Array(14);Cards[0]=new SB.funding.cardDeposit.CardType("MC","51,52,53,54,55","16");MC=Cards[0];Cards[1]=new SB.funding.cardDeposit.CardType("VI","4","13,16");VI=Cards[1];Cards[2]=new SB.funding.cardDeposit.CardType("AmExCard","34,37","15");AmExCard=Cards[2];Cards[3]=new SB.funding.cardDeposit.CardType("DinersClubCard","30,36,38","14");DinersClubCard=Cards[3];Cards[4]=new SB.funding.cardDeposit.CardType("DiscoverCard","6011","16");DiscoverCard=Cards[4];Cards[5]=new SB.funding.cardDeposit.CardType("enRouteCard","2014,2149","15");enRouteCard=Cards[5];Cards[6]=new SB.funding.cardDeposit.CardType("JCBCard","3088,3096,3112,3158,3337,3528","16");JCBCard=Cards[6];LuhnCheckSum=Cards[7]=new SB.funding.cardDeposit.CardType();Cards[8]=new SB.funding.cardDeposit.CardType("MA","50,56,57,58,6","16");MA=Cards[8];Cards[9]=new SB.funding.cardDeposit.CardType("SW","4903,4905,4911,4936,564182,633110,6333,6759","16,18,19");SW=Cards[9];Cards[10]=new SB.funding.cardDeposit.CardType("VE","4","13,16");VE=Cards[10];Cards[11]=new SB.funding.cardDeposit.CardType("MD","51,52,53,54,55","16");MD=Cards[11];Cards[12]=new SB.funding.cardDeposit.CardType("VD","4","13,16");VD=Cards[12];Cards[13]=new SB.funding.cardDeposit.CardType("LS","6304,6706,6771,6709","16,17,18,19");};var LuhnCheckUnchecked="unchecked";var LuhnCheckPassed="passed";var LuhnCheckFailed="failed";SB.funding.cardDeposit.luhnCheckCardNumber=function(){SB.funding.cardDeposit.InitialializeCardObjects();document.getElementById("imgCardNumberIncorrect").style.display="none";document.getElementById("imgCardNumberCorrect").style.display="none";var c=SB.funding.cardDeposit.CheckNumberOnChange();if(c==LuhnCheckPassed){SB.funding.cardDeposit.setCardNumberIndicator("icoTrue");}else{if(c==LuhnCheckFailed){SB.funding.cardDeposit.setCardNumberIndicator("icoFalse");}}};SB.funding.cardDeposit.setCardNumberIndicator=function(d){var c=document.getElementById("ctrlDepositMethodList__ctl0_ico_CardNumber");var e=document.getElementById("ctrlDepositMethodList__ctl0_ttt_CardNumber");SB.funding.cardDeposit.removeExistingTooltipMessage(e);if(d=="icoTrue"){c.className="icons icoTrue";e.className="toolTipText";}else{c.className="icons icoFalse";e.className="toolTipText tttError";SB.funding.cardDeposit.createTooltipMessageTag(e);}};SB.funding.cardDeposit.resetCardFields=function(){var c=document.getElementById("ctrlDepositMethodList__ctl0_ico_CardNumber");c.className="icons";var d=document.getElementById("ctrlDepositMethodList__ctl0_ttt_CardNumber");d.className="toolTipText";SB.funding.cardDeposit.removeExistingTooltipMessage(d);$("#divFunding input, select").removeClass("fieldError");$("#divFunding strong").removeClass("icoTrue").removeClass("icoError");$("#ctrlDepositMethodList__ctl0_validFromDate").val("invalid");$("#ctrlDepositMethodList__ctl0_validToDate").val("invalid");$("#ctrlDepositMethodList__ctl0_ico_cvv2No").addClass("icoInfo");$("#ctrlDepositMethodList__ctl0_ttt_cvv2No").removeClass("tttError").html('<span class="tttContent">'+$("#cardRow4 .hide .aside").html()+"</span>");};SB.funding.cardDeposit.removeExistingTooltipMessage=function(c){c.innerHTML="";};SB.funding.cardDeposit.createTooltipMessageTag=function(c){c.innerHTML='<span class="tttContent">'+bubble_info_message+"</span>";};SB.funding.cardDeposit.CardType=function(){var k;var c=SB.funding.cardDeposit.CardType.arguments;var f=SB.funding.cardDeposit.CardType.arguments.length;this.objname="object CardType";var e=(f>0)?c[0]:"CardObject";var g=(f>1)?c[1]:"0,1,2,3,4,5,6,7,8,9";var d=(f>2)?c[2]:"13,14,15,16,19";this.setCardNumber=setCardNumber;this.setCardType=setCardType;this.setLen=setLen;this.setRules=setRules;this.setExpiryDate=setExpiryDate;this.setCardType(e);this.setLen(d);this.setRules(g);if(f>4){this.setExpiryDate(c[3],c[4]);}this.checkCardNumber=checkCardNumber;this.getExpiryDate=SB.funding.cardDeposit.getExpiryDate;this.getCardType=SB.funding.cardDeposit.getCardType;this.isCardNumber=isCardNumber;this.isExpiryDate=isExpiryDate;this.isCloseToExpiryDate=isCloseToExpiryDate;this.luhnCheck=luhnCheck;return this;};SB.funding.cardDeposit.CheckNumberOnChange=function(){var c=document.getElementById("ctrlDepositMethodList__ctl0_txtCardno").value.split("-").join("");var f=document.getElementById("ctrlDepositMethodList__ctl0_ddlValidToYear").value;var d=document.getElementById("ctrlDepositMethodList__ctl0_ddlValidToMonth").value;var e=document.getElementById("ctrlDepositMethodList__ctl0_dpdwnCardList").value;if(c.length==0||f.length==0||d.length==0){return LuhnCheckUnchecked;}else{return SB.funding.cardDeposit.CheckCardNumber(c,f,d,e);}};SB.funding.cardDeposit.CheckCardNumber=function(m,k,r,q){var g;if(k.length==0){bubble_info_message="Please enter your card expiry date.";return LuhnCheckFailed;}g=k;tmpmonth=r;if(!(new SB.funding.cardDeposit.CardType()).isExpiryDate(g,tmpmonth)){bubble_info_message="Sorry your card has expired.";document.getElementById("lnkActiveCard").style.display="none";document.getElementById("lnkExpiredCard").style.display="block";return LuhnCheckFailed;}if((new SB.funding.cardDeposit.CardType()).isCloseToExpiryDate(g,tmpmonth)){bubble_info_message="You cannot insert a Credit Card so close to its expiry date.";document.getElementById("lnkActiveCard").style.display="none";document.getElementById("lnkExpiredCard").style.display="block";return LuhnCheckFailed;}document.getElementById("lnkActiveCard").style.display="block";document.getElementById("lnkExpiredCard").style.display="none";var f=q;var s;var l=new Array();l=q.split("_");var c=l[0];for(var e=0;e<Cards.length;e++){if(Cards[e].getCardType()==c){s=Cards[e];break;}}var d;if(s==null){d=false;}else{d=s.checkCardNumber(m,g,tmpmonth);}cardname="";if(d){return LuhnCheckPassed;}else{for(var e=0;e<Cards.length;e++){if(Cards[e].checkCardNumber(m,g,tmpmonth)){cardname=Cards[e].getCardType();break;}}if(cardname.length>0){var o="This looks like a card1 number, not a card2 number";o=o.replace("card1",cardname);o=o.replace("card2",f);bubble_info_message=o;return LuhnCheckFailed;}else{bubble_info_message="Please check your card number as it appears to be incorrect.";return LuhnCheckFailed;}}};checkCardNumber=function(){var c=checkCardNumber.arguments;var g=checkCardNumber.arguments.length;var e=(g>0)?c[0]:this.cardnumber;var d=(g>1)?c[1]:this.year;var f=(g>2)?c[2]:this.month;this.setCardNumber(e);this.setExpiryDate(d,f);if(!this.isCardNumber()){return false;}if(!this.isExpiryDate()){return false;}return true;};SB.funding.cardDeposit.getCardType=function(){return this.cardtype;};SB.funding.cardDeposit.getExpiryDate=function(){return this.month+"/"+this.year;};isCardNumber=function(){var d=isCardNumber.arguments;var f=isCardNumber.arguments.length;var e=(f>0)?d[0]:this.cardnumber;if(!this.luhnCheck()){return false;}for(var k=0;k<this.len.size;k++){if(e.toString().length==this.len[k]){for(var c=0;c<this.rules.size;c++){var g=e.substring(0,this.rules[c].toString().length);if(g==this.rules[c]){return true;}}return false;}}return false;};isExpiryDate=function(){var c=isExpiryDate.arguments;var d=isExpiryDate.arguments.length;year=d>0?c[0]:this.year;month=d>1?c[1]:this.month;if(!isNum(year+"")){return false;}if(!isNum(month+"")){return false;}today=new Date();expiry=new Date(year,month);if(today.getTime()>expiry.getTime()){return false;}else{return true;}};isCloseToExpiryDate=function(){var c=isCloseToExpiryDate.arguments;var d=isCloseToExpiryDate.arguments.length;year=d>0?c[0]:this.year;month=d>1?c[1]:this.month;if(!isNum(year+"")){return false;}if(!isNum(month+"")){return false;}today=new Date();expiry=new Date(year,month-1);if(today.getFullYear()==expiry.getFullYear()&&today.getMonth()==expiry.getMonth()&&today.getDate()>25){return true;}else{return false;}};isNum=function(c){c=c.toString();if(c.length==0){return false;}for(var d=0;d<c.length;d++){if(c.substring(d,d+1)<"0"||c.substring(d,d+1)>"9"){return false;}}return true;};luhnCheck=function(){var c=luhnCheck.arguments;var l=luhnCheck.arguments.length;var k=l>0?c[0]:this.cardnumber;if(!isNum(k)){return false;}var d=k.length;var e=d&1;var f=0;for(var g=0;g<d;g++){var m=parseInt(k.charAt(g));if(!((g&1)^e)){m*=2;if(m>9){m-=9;}}f+=m;}if(f%10==0){return true;}else{return false;}};makeArray=function makeArray(c){this.size=c;return this;};setCardNumber=function(c){this.cardnumber=c;return this;};setCardType=function(c){this.cardtype=c;return this;};setExpiryDate=function(c,d){this.year=c;this.month=d;return this;};setLen=function(c){if(c.length==0||c==null){c="13,14,15,16,19";}var e=c;n=1;while(e.indexOf(",")!=-1){e=e.substring(e.indexOf(",")+1,e.length);n++;}this.len=new makeArray(n);n=0;while(c.indexOf(",")!=-1){var d=c.substring(0,c.indexOf(","));this.len[n]=d;c=c.substring(c.indexOf(",")+1,c.length);n++;}this.len[n]=c;return this;};setRules=function(e){if(e.length==0||e==null){e="0,1,2,3,4,5,6,7,8,9";}var d=e;n=1;while(d.indexOf(",")!=-1){d=d.substring(d.indexOf(",")+1,d.length);n++;}this.rules=new makeArray(n);n=0;while(e.indexOf(",")!=-1){var c=e.substring(0,e.indexOf(","));this.rules[n]=c;e=e.substring(e.indexOf(",")+1,e.length);n++;}this.rules[n]=e;return this;};var cardJSLoaded=true;if(typeof(SB)=="undefined"||SB==null){var SB=new Object();}if(typeof(SB.funding)=="undefined"||SB.funding==null){SB.funding=new Object();}SB.funding.cardWithdraw=new Object();SB.funding.Withdrawal=new Object();SB.funding.cardWithdraw.validateWithdrawExpiry=function(){var o=true;var k=new Date();var g=k.getMonth();var e=k.getYear();var f=0;var m=0;var c=new Array();f=document.getElementById(fundingGlobals.card.wStartYear).innerText;m=document.getElementById(fundingGlobals.card.wExpiryYear).innerText;var l=document.getElementById(fundingGlobals.card.wStartMonth).innerText;var d=document.getElementById(fundingGlobals.card.wExpiryMonth).innerText;};SB.funding.cardWithdraw.cardValidityDates=function(c){var g=false;var d=new Date();var f=d.getMonth()+1;var e=d.getYear();if(c[0]==null||c[2]==null){g=false;return g;}else{if(c[0]<e){}else{if(c[0]==e){if(f>c[2]||f==c[2]){}else{g=false;return g;}}else{if(c[0]>e){g=false;return g;}}}}if(e<c[1]){}else{if(e==c[1]){if(f<c[3]||f==c[3]){}else{g=false;return g;}}else{if(e>c[1]){g=false;return g;}}}g=true;return g;};OnWithdrawDropdownSelectionChange=function(){if(document.getElementById("lnkActiveCard")){document.getElementById("lnkActiveCard").style.display="";}if(document.getElementById("lnkExpiredCard")){document.getElementById("lnkExpiredCard").style.display="none";}var s=document.getElementById("ctrlWithdrawMethodList__ctl0_dpdwnCardList");var O=s.options[s.selectedIndex].value;document.getElementById("dropdownSelection").value=O;var I=new Array();I=O.split("_");SB.funding.cardWithdraw.createHiddenControls(I);if(I.length>1){document.getElementById(fundingGlobals.card.wDdlCardType).value=I[2];document.getElementById("cardID").value=I[0];var c=document.getElementById(fundingGlobals.card.wLblCardType);c.innerHTML=I[3];c.style.display="";var d=document.getElementById(fundingGlobals.card.wLblCardNumber);d.innerHTML=I[4];d.style.display="";var u=document.getElementById(fundingGlobals.card.wExpiryMonth);u.innerHTML=I[6];u.style.display="";var R=document.getElementById(fundingGlobals.card.wExpiryYear);R.innerHTML=I[7];R.style.display="";var o=I[5];if(o!=""&&o!=null){if(I[2]=="MA"||I[2]=="SW"||I[2]=="unknown"){var S=o.substr(4,2);var A=o.substr(0,4);var D=document.getElementById(fundingGlobals.card.wStartMonth);D.innerHTML=S;D.style.display="";if(document.getElementById(fundingGlobals.card.wDivspStartDate)){document.getElementById(fundingGlobals.card.wDivspStartDate).style.display="";}var w=document.getElementById(fundingGlobals.card.wStartYear);w.innerHTML=A;w.style.display="";var q=document.getElementById(fundingGlobals.card.wLblIssueNumber);q.innerHTML=I[8];q.style.display="";if(document.getElementById(fundingGlobals.card.wDivspIssueNumber)){document.getElementById(fundingGlobals.card.wDivspIssueNumber).style.display="";}}else{SB.funding.cardWithdraw.hideStartDateAndIssueNo();}}else{SB.funding.cardWithdraw.hideStartDateAndIssueNo();}var f=document.getElementById(fundingGlobals.card.wInfo);f.innerHTML=I[11];var r=document.getElementById(fundingGlobals.card.wFees);r.innerHTML=I[12];var K=document.getElementById(fundingGlobals.card.wMinimum);K.innerHTML=I[13];var T=document.getElementById(fundingGlobals.card.wMaximum);T.innerHTML=I[14];var k=document.getElementById("ctrlWithdrawMethodList__ctl0_pwc_PWAdditionalAmount");$(k).removeClass("valid").removeClass("error").removeClass("fieldError");var F=document.getElementById("ctrlWithdrawMethodList__ctl0_pwc_domainPassword");$(F).removeClass("valid").removeClass("error").removeClass("fieldError");if(fundingGlobals.card.afterWithdrawalPageLoad!="true"){var J=document.getElementById("ctrlWithdrawMethodList__ctl0_pwc_ico_amount");J.setAttribute("class","icons");var M=document.getElementById("ctrlWithdrawMethodList__ctl0_pwc_ico_DomainPassword");M.setAttribute("class","icons");var E=document.getElementById("ctrlWithdrawMethodList__ctl0_pwc_ttt_amount");if(E.firstChild!=null){E.removeChild(E.firstChild);}var y=document.getElementById("ctrlWithdrawMethodList__ctl0_pwc_ttt_DomainPassword");if(y.firstChild!=null){y.removeChild(y.firstChild);}var v=document.getElementById("divError");if(v!=null&&v.parentNode!=null){v.parentNode.removeChild(v);}}fundingGlobals.card.afterWithdrawalPageLoad="false";jQuery.removeData(k,"metadata");var B=I[16];var G=I[17];if(B=="null"){var H=k.getAttribute("data");if(k.getAttribute("data").indexOf('"minvalue"')>=0&&k.getAttribute("data").indexOf('"minvalue"')<k.getAttribute("data").indexOf("messages")){H=k.getAttribute("data").replace(/"minvalue":\d*,/,"").replace('"minvalue":undefined',"");}k.setAttribute("data",H);}else{var H="";if(k.getAttribute("data").indexOf('"minvalue"')>=0&&k.getAttribute("data").indexOf('"minvalue"')<k.getAttribute("data").indexOf("messages")){H=k.getAttribute("data").replace(/"minvalue":\d*,/,'"minvalue":'+B+",").replace('"minvalue":undefined','"minvalue":'+B);}else{H=k.getAttribute("data").replace('"messages"','"minvalue":'+B+',"messages"');}k.setAttribute("data",H);}if(G=="null"){var H=k.getAttribute("data");if(k.getAttribute("data").indexOf('"maxvalue"')>=0&&k.getAttribute("data").indexOf('"maxvalue"')<k.getAttribute("data").indexOf("messages")){H=k.getAttribute("data").replace(/"maxvalue":\d*,/,"").replace('"maxvalue":undefined',"");}k.setAttribute("data",H);}else{var H="";if(k.getAttribute("data").indexOf('"maxvalue"')>=0&&k.getAttribute("data").indexOf('"maxvalue"')<k.getAttribute("data").indexOf("messages")){H=k.getAttribute("data").replace(/"maxvalue":\d*,/,'"maxvalue":'+G+",").replace('"maxvalue":undefined','"maxvalue":'+G);}else{H=k.getAttribute("data").replace('"messages"','"maxvalue":'+G+',"messages"');}k.setAttribute("data",H);}var P=document.getElementById(fundingGlobals.card.wWithdrawalFeeExplanationExtendedHelpText);var N=document.getElementById(fundingGlobals.card.wFeeExtendedHelpText);if(I[15].toLowerCase()!="true"&&I[32]&&P){P.style.display="";N.style.display="";P.innerHTML=I[32];}else{P.style.display="none";N.style.display="none";}var l=document.getElementById(fundingGlobals.card.freeRefundSection);var L=document.getElementById(fundingGlobals.card.freeRefundIsAvailableOuter);var g=document.getElementById(fundingGlobals.card.freeRefundIsAvailable);var m=document.getElementById(fundingGlobals.card.freeRefundIsUnavailableOuter);var Q=document.getElementById(fundingGlobals.card.freeRefundIsUnavailable);var C=document.getElementById(fundingGlobals.card.freeRefundUseOtherMethodsOuter);var e=document.getElementById(fundingGlobals.card.freeRefundUseOtherMethods);if(I[33].toLowerCase()=="true"){l.style.display="";if(I[34]!=""){L.style.display="";g.innerHTML=I[34];if(m){m.style.display="none";}}else{if(L){L.style.display="none";}m.style.display="";Q.innerHTML=I[35];}if(I[36]!=""){C.style.display="";e.innerHTML=SB.funding.cardWithdraw.ReplaceAll(I[36],"[underscore]","_");}else{if(C){C.style.display="none";}}}else{if(l){l.style.display="none";}}}else{document.getElementById("cardID").value="new";SB.funding.onDepositCardSelect("new","unknown",false,fundingGlobals.card.hasNoErrors);SB.funding.cardDeposit.hideSavedCardAttributes();SB.funding.onNewCardTypeChange(s);document.getElementById(fundingGlobals.card.wDdlCardType).value=O;document.getElementById("cardType").value=O;}SB.funding.cardWithdraw.stopWithdrawOnExpiredCard(document.getElementById(fundingGlobals.card.wExpiryMonth),document.getElementById(fundingGlobals.card.wExpiryYear));};SB.funding.cardWithdraw.ReplaceAll=function(g,e,f){var c=g;var d=c.indexOf(e);while(d!=-1){c=c.replace(e,f);d=c.indexOf(e);}return c;};SB.funding.cardWithdraw.hideStartDateAndIssueNo=function(){document.getElementById(fundingGlobals.card.wDivspStartDate).style.display="none";document.getElementById(fundingGlobals.card.wDivspIssueNumber).style.display="none";};SB.funding.cardWithdraw.createHiddenControls=function(c){var d=new Array();d=c;SB.funding.cardWithdraw.createHiddenProviderId(d[0],d[1]);SB.funding.cardWithdraw.createHiddenCardType(d[0],d[2]);SB.funding.cardWithdraw.createHiddenCvv2(d[0],d[9]);SB.funding.cardWithdraw.createHiddenCurrencyCode(d[0],d[10]);};SB.funding.cardWithdraw.createHiddenProviderId=function(f,c){var d=document.getElementById("placeholderHiddenControls");var e=document.createElement("input");e.setAttribute("type","hidden");e.setAttribute("id","cardProviderID_"+f);e.setAttribute("name","cardProviderID_"+f);e.setAttribute("value",c);d.appendChild(e);};SB.funding.cardWithdraw.createHiddenCardType=function(f,c){var d=document.getElementById("placeholderHiddenControls");var e=document.createElement("input");e.setAttribute("type","hidden");e.setAttribute("id","cardType_"+f);e.setAttribute("name","cardType_"+f);e.setAttribute("value",c);d.appendChild(e);};SB.funding.cardWithdraw.createHiddenCvv2=function(e,f){var c=document.getElementById("placeholderHiddenControls");var d=document.createElement("input");d.setAttribute("type","hidden");d.setAttribute("id","cvv2_"+e);d.setAttribute("name","cvv2_"+e);d.setAttribute("value",f);c.appendChild(d);};SB.funding.cardWithdraw.createHiddenCurrencyCode=function(f,c){var d=document.getElementById("placeholderHiddenControls");var e=document.createElement("input");e.setAttribute("type","hidden");e.setAttribute("id","currencyCode_"+f);e.setAttribute("name","currencyCode_"+f);e.setAttribute("value",c);d.appendChild(e);};SB.funding.cardWithdraw.stopWithdrawOnExpiredCard=function(c,q){var g=new Date();var d=false;var f=g.getMonth()+1;var e=g.getFullYear();var m=c.innerHTML;var k=q.innerHTML;if(k>e){}else{if(k==e){if(m<f){d=true;}}else{d=true;}}var o=document.getElementById(fundingGlobals.card.wActiveCardLink);var l=document.getElementById(fundingGlobals.card.wExpiredCardLink);if(d){o.style.display="none";l.style.display="block";}else{o.style.display="block";l.style.display="none";}};SB.funding.cardWithdraw.onSubmitWithdrawal=function(){SB.accounts.Login.OpenUserValidationPopup("withdrawal");};SB.funding.Withdrawal.submitChanges=function(){SB.funding.onSubmitDepositOrWithdrawal(true);};SB.Login=function(c){this.balanceUrl="/misc/webservices/funding/balanceservice.aspx";this.div=c;this.triggerLoginStatus();this.setupBalanceRefresh();this.setupUserStateRefresh();};SB.Login.prototype={triggerLoginStatus:function(){var c=this;$("input.loginStatus",c.div).each(function(){SB.EventHub.trigger("login-status",$(this).val());});},setupBalanceRefresh:function(){var c=this;SB.EventHub.bind("balance-refresh",function(d){if(c!=d){c.forceBalance(d.forceRefresh==true);}});},setupUserStateRefresh:function(){var c=this;if($(c.div).hasClass("inPlayLoginBox")){SB.EventHub.bind("user-state-refresh",function(d){if(c!=d){window.location.href=window.location.href;}});}},forceBalance:function(e){var c=this;var d={type:"GET",url:this.balanceUrl+"?forceRefresh="+e+"&cacheBuster="+new Date().getTime(),success:function(g,f){c.refreshBalance(g);},error:function(){alert("error");}};jQuery.ajax(d);},refreshBalance:function(d){var c=this;var e=$("string",d).text();$("span.balance",c.div).html(e);}};$(document).ready(function(){$("div.loginBox").each(function(){new SB.Login(this);});});SB.ui.WebTrends=function(c){if(typeof(c)!="undefined"){this.trackingFunction=c;}else{if(typeof(dcsMultiTrack)!="undefined"){this.trackingFunction=dcsMultiTrack;}else{this.trackingFunction=function(){};}}};SB.ui.WebTrends.prototype={trackUserEvent:function(d,e,f){try{this.trackingFunction("WT.ti",d,"WT.si_n",e,"WT.si_p",f);}catch(c){}},trackEvent:function(c){try{if(c.dcsvid!="undefined"){this.trackingFunction("DCS.dcsuri",c.pageUrl,"WT.ti",c.pageTitle,"WT.cg_n",c.contentGroup,"WT.cg_s",c.contentSubGroup,"WT.si_n",c.scenarioReport,"WT.si_p",c.scenarioReportStep,"DCSext.login",c.dcsextLogin,"WT.dcsvid",c.dcsvid);}else{this.trackingFunction("DCS.dcsuri",c.pageUrl,"WT.ti",c.pageTitle,"WT.cg_n",c.contentGroup,"WT.cg_s",c.contentSubGroup,"WT.si_n",c.scenarioReport,"WT.si_p",c.scenarioReportStep,"DCSext.login",c.dcsextLogin);}}catch(d){}}};SB.ui.Gomez=function(gomezPageId,gomezServerId){var gomez={gs:new Date().getTime(),acctId:"62CFD0",pgId:gomezPageId,grpId:gomezServerId};window.gomez=gomez;gomez=gomez?gomez:{};gomez.h3=function(d,s){for(var p in s){d[p]=s[p];}return d;};gomez.h3(gomez,{b3:function(r){if(r<=0){return false;}return Math.random()<=r&&r;},b0:function(n){var c=document.cookie;var v=c.match(new RegExp(";[ ]*"+n+"=([^;]*)"));if(!v){v=c.match(new RegExp(n+"=([^;]*)"));}if(v){return unescape(v[1]);}return"";},c2:function(n,v,e,p,d,s){try{var t=this,a=location.hostname;var c=n+"="+escape(v)+(e?";expires="+e.toGMTString():"")+(p?";path="+p:";path=/")+(d?";domain="+d:";domain="+a)+(s?";secure":"");document.cookie=c;}catch(e){}},z0:function(n){var t=this;if(n){var s=t.b0("__g_c");if(!s){return"";}var v=s.match(new RegExp(n+":([^|]*)"));if(v){return unescape(v[1]);}return"";}else{return"";}},z1:function(n,m){var t=this;if(n){var s=t.b0("__g_c");if(s){if(s.indexOf(n+":")!=-1){s=s.replace(new RegExp("("+n+":[^|]*)"),n+":"+m);}else{s=s==" "?n+":"+m:s+"|"+n+":"+m;}t.c2("__g_c",s);}else{t.c2("__g_c",n+":"+m);}}}});if(gomez.wrate){gomez.i0=gomez.z0("w");if(gomez.i0){gomez.runFlg=parseInt(gomez.i0)>0?true:false;}else{if(gomez.b3(parseFloat(gomez.wrate))){gomez.runFlg=true;gomez.z1("w",1);}else{gomez.runFlg=false;gomez.z1("w",0);}}}else{if(gomez.wrate==undefined){gomez.runFlg=true;gomez.z1("w",1);}else{gomez.runFlg=false;gomez.z1("w",0);}}if(gomez.runFlg){gomez.h1=function(v,d){return v?v:d;};gomez.gs=gomez.h1(gomez.gs,new Date().getTime());gomez.acctId=gomez.h1(gomez.acctId,"");gomez.pgId=gomez.h1(gomez.pgId,"");gomez.grpId=gomez.h1(gomez.grpId,"");gomez.E=function(c){this.s=c;};gomez.E.prototype={g1:function(e){var t=gomez,i=t.g6(e);if(i){i.e=t.b5();}}};gomez.L=function(m){this.a=m;};gomez.L.prototype={g2:function(m){var t=gomez,n=t.b5();var s=document.getElementsByTagName(m);var e=t.k;if(m=="script"){e=t.j;}if(m=="iframe"){e=t.l;}if(s){var l=s.length;for(var i=0;i<l;i++){var u=s[i].src||s[i].href;if(u&&!e[u]){var r=new gomez.E(e);t.grm[u]=r;e[u]=new t.c7(u,n);if(t.gIE&&m=="script"){t.e2(s[i],"readystatechange",t.d2,false);}else{t.e2(s[i],"load",r.g1,false);}}}}}};gomez.L.m=new Object;gomez.L.m.script=new gomez.L();gomez.L.m.link=new gomez.L();gomez.L.m.iframe=new gomez.L();gomez.S=function(){var t=this,h=gomez.acctId+".r.axf8.net";t.x=location.protocol+"//"+h+"/mr/b.gif?";t.y=location.protocol+"//"+h+"/mr/a.gif?";};gomez.h2=function(){var t=this;t.gIE=false;t.f=new Object;t._h=0;t.j=new Object;t.k=new Object;t.l=new Object;t.m=location.href;t.p=-1;t.q=-1;t.t=new Array;t.u=new Array;t._w=false;t.gSfr=/KHTML|WebKit/i.test(navigator.userAgent);t.gc={n:"c"};t.grm=new Object;t.b;t.a=0;t.d=false;t.x=false;t.s=new gomez.S;t._a=false;t.h6=false;t.n1=0;};gomez.h3(gomez,{h5:function(u){try{var s=document.createElement("script");s.src=u;s.type="text/javascript";if(document.body){document.body.appendChild(s);}else{if(document.documentElement.getElementsByTagName("head")[0]){document.documentElement.getElementsByTagName("head")[0].appendChild(s);}}}catch(e){}},a9:function(){var t=gomez,i=t.z0("a"),g=t.b0("__g_u"),h=t.z0("h");t.gc.h=t.z0("b");if(h){t.n1=parseInt(h);}if(!t.gc.h){t.gc.h=1;}t.z1("b",parseInt(t.gc.h)+1);if(i){t.a=parseInt(i);if(t.a==1){t._w=true;}else{if(t.a==3){t.x=true;t._w=true;}}t.d=true;t.gc.c=t.z0("c");t.gc.d=t.z0("d");t.gc.i=t.z0("e");t.gc.j=t.z0("f");if(t._w&&!t._a){t.h7();t._a=true;}}else{if(!t.gc.a){return;}var s="v=1";t.c2("__g_u","1",new Date(t.gt()+1000));if(t.b0("__g_u")&&g&&g!="1"&&g.indexOf("NaN")==-1&&g.indexOf("undefined")==-1){s="v=0";var r=g.split("_");t.b2(parseInt(r[0]),parseInt(r[1])+1);if(r[4]&&r[4]!="0"&&t.gt()<parseInt(r[5])&&r[2]&&r[2]!="0"){t.b1(parseFloat(r[2]),parseFloat(r[3]),parseFloat(r[4]),parseInt(r[5]));if(r[6]){t.n0(parseInt(r[6]));}return;}}t.h6=true;s=t.s.y+"a="+t.gc.a+"&"+s;if(t.gSfr){document.write("<script src='"+s+"'><\/script>");}else{t.h5(s);}}t.b=t.z0("g");},h7:function(){var t=gomez,u=t.tloc?t.tloc:location.protocol+"//"+t.acctId+".t.axf8.net/js/gtag4.js";if(t.gSfr){document.write("<script src='"+u+"'><\/script>");}else{t.h5(u);}},n0:function(h){var t=gomez,f=new Date(t.gt()+946080000000),g=t.b0("__g_u");t.n1=h;t.z1("h",h);if(g&&g!="1"&&g.indexOf("NaN")==-1&&g.indexOf("undefined")==-1){var r=g.split("_");g=""+r[0]+"_"+r[1]+"_"+r[2]+"_"+r[3]+"_"+r[4]+"_"+r[5]+"_"+h;t.c2("__g_u",g,f);}},b1:function(v,s,q,f){var t=this;if(t._a){return;}if(t.b3(v)){t._w=true;t.a=1;var p=parseFloat(s/v);if(t.b3(p)){t.x=true;t.a=3;}}t.d=true;t.z1("a",t.a);t.z1("e",v);t.z1("f",s);t.gc.i=v;t.gc.j=s;t.h4(v,s,q,f);if(t._w){t.h7();t._a=true;}},b2:function(v,s){var t=this,f=new Date(t.gt()+946080000000),g=""+v+"_"+s;if(t._a){return;}t.c2("__g_u",g,f);t.gc.c=v;t.gc.d=s;t.z1("c",v);t.z1("d",s);},h4:function(o,p,q,d){var t=this,f=new Date(t.gt()+946080000000),g=t.b0("__g_u");if(g&&g!="1"&&g.indexOf("NaN")==-1&&g.indexOf("undefined")==-1){var r=g.split("_"),s;if(d){s=d;}else{if(q&&q>=0){s=new Date(t.gt()+parseInt(q*86400000)).getTime();}else{q=5;s=new Date(t.gt()+432000000).getTime();}}g=""+r[0]+"_"+r[1]+"_"+o+"_"+p+"_"+q+"_"+s;t.c2("__g_u",g,f);}},gt:function(){return new Date().getTime();},b5:function(){return new Date().getTime()-gomez.gs;},b6:function(){var t=gomez;t.p=t.b5();},f8:function(){var t=this;if(t.pollId1){clearInterval(t.pollId1);}if(t.pollId2){clearInterval(t.pollId2);}if(t.pollId3){clearInterval(t.pollId3);}if(t.pollId4){clearInterval(t.pollId4);}},b7:function(){var t=gomez;t.f8();t.q=t.b5();},c7:function(u,s){var t=this;t.m=u;t.s=s;},c8:function(){var t=gomez,n=t.b5(),l=document.images.length;if(l>t._h){for(var i=t._h;i<l;++i){var u=document.images[i].src;if(u){var r=new gomez.E(t.f);t.grm[u]=r;t.f[u]=new t.c7(u,n);t.e2(document.images[i],"load",t.c4,false);t.e2(document.images[i],"error",t.c5,false);t.e2(document.images[i],"abort",t.c6,false);}}}t._h=l;},c4:function(e){var t=gomez,i=t.g6(e);if(i){i.e=t.b5();}},c5:function(e){var t=gomez,i=t.g6(e);if(i){i.e=t.b5();i.b=1;}},c6:function(e){var t=gomez,i=t.g6(e);if(i){i.a=t.b5();}},g6:function(e){var t=gomez,e=window.event?window.event:e,a=t.d8(e),i;if(t.grm[a.src||a.href]&&t.grm[a.src||a.href].s){i=t.grm[a.src||a.href].s[a.src||a.href];}return i;},d2:function(){var t=gomez;var e=window.event?window.event:e,s=t.d8(e);if(s.readyState=="loaded"||s.readyState=="complete"){var o=t.j[s.src];if(o){o.e=t.b5();}}},setPair:function(name,value){var t=this;t.t[t.t.length]={n:"p",a:name,b:value};},nameEvent:function(n){var t=this;t.f6(n,1);},startInterval:function(n){var t=this;t.f6(n,2,1);},endInterval:function(n){var t=this;t.f6(n,2,2);},f6:function(n,p,b){if(n&&n.length>20){n=n.substring(0,20);}var t=this,f=t.u;f[f.length]={n:"a",a:n,b:t.b5(),e:p,f:b};},d8:function(e){if(gomez.gIE){return e.srcElement||{};}else{return e.currentTarget||e.target||{};}},e2:function(e,p,f,c){var n="on"+p;if(e.addEventListener){e.addEventListener(p,f,c);}else{if(e.attachEvent){e.attachEvent(n,f);}else{var x=e[n];if(typeof e[n]!="function"){e[n]=f;}else{e[n]=function(a){x(a);f(a);};}}}},i1:function(){var d=window.document,done=false,i2=function(){if(!done){done=true;gomez.b6();gomez.a9();}};(function(){try{d.documentElement.doScroll("left");}catch(e){setTimeout(arguments.callee,50);return;}i2();})();d.onreadystatechange=function(){if(d.readyState=="complete"){d.onreadystatechange=null;i2();}};},g7:function(){try{var t=gomez;t.gc.a=t.acctId;
/*@cc_on t.gIE=true;@*/
if(t.gIE){t.i1();window.attachEvent("onload",t.b7);}else{if(t.gSfr){var m=setInterval(function(){if(/loaded|complete/.test(document.readyState)){clearInterval(m);delete m;t.b6();t.b7();}},10);}else{if(window.addEventListener){window.addEventListener("DOMContentLoaded",t.b6,false);window.addEventListener("load",t.b7,false);}else{return;}}}t.c8();t.pollId1=setInterval(t.c8,1);gomez.L.m.link.g2("link");t.pollId3=setInterval("gomez.L.m['link'].g2('link')",1);gomez.L.m.iframe.g2("iframe");t.pollId4=setInterval("gomez.L.m['iframe'].g2('iframe')",1);if(!t.gIE){t.a9();}}catch(e){return;}}});gomez.h2();gomez.g7();}};SB.ui.GomezAjax=function(c,d){this.gomezPageId=c;this.gomezServerId=d;if(window.gomez==undefined){new SB.ui.Gomez(c,d);}this.gomezAjax=gomez;};SB.ui.GomezAjax.prototype={ajaxStart:function(){if(this.gomezAjax!=undefined){this.gomezAjax.startInterval(this.gomezPageId);}},ajaxFinish:function(){if(this.gomezAjax!=undefined){this.gomezAjax.endInterval(this.gomezPageId);}}};SB.ui.GomezEvent=function(c,d){this.gomezPageId=c;this.gomezServerId=d;if(window.gomez==undefined){new SB.ui.Gomez(c,d);}this.gomezEvent=gomez;};SB.ui.GomezEvent.prototype={nameEvent:function(){if(this.gomezEvent!=undefined){this.gomezEvent.nameEvent(this.gomezPageId);}}};SB.ui.addGomezTag=function(d){if(window.gomez==undefined){return;}var f=$("div#siteInfo");var c=f.find("#serverIP").val();var e=" ["+f.find("#domainName").val()+"]";if(!$.browser.safari){new SB.ui.Gomez(d+e,c);}};SB.ui.addGomezEventTag=function(d){if(window.gomez==undefined){return;}var f=$("div#siteInfo");var c=f.find("#serverIP").val();var e=" ["+f.find("#domainName").val()+"]";if(!$.browser.safari){new SB.ui.GomezEvent(d+e,c).nameEvent();}};SB.ui.startGomezAjaxTracking=function(d){if(window.gomez==undefined){return;}var f=$("div#siteInfo");var c=f.find("#serverIP").val();var e=" ["+f.find("#domainName").val()+"]";if(!$.browser.safari){new SB.ui.GomezAjax(d+e,c).ajaxStart();}};SB.ui.endGomezAjaxTracking=function(d){if(window.gomez==undefined){return;}var f=$("div#siteInfo");var c=f.find("#serverIP").val();var e=" ["+f.find("#domainName").val()+"]";if(!$.browser.safari){new SB.ui.GomezAjax(d+e,c).ajaxFinish();}};$(document).ready(function(){var C=$("input#gomezTrackingActive");if(C!=undefined&&C.val()=="False"){return;}var D=$("div#siteInfo");var G=D.find(".serverIP").val();var f=" ["+D.find(".domainName").val()+"]";if(!$.browser.safari){$("div#homePage").each(function(){new SB.ui.Gomez("sportsbook homepage"+f,G);});$("a#modCustLoginRegister").click(function(){new SB.ui.startGomezAjaxTracking("registration form");});$("a#modCustLoginForgottenPw").click(function(){new SB.ui.startGomezAjaxTracking("forgotten password form");});$("a#modCustChangePwEdit").click(function(){new SB.ui.startGomezAjaxTracking("change password form");});$("div.mini").each(function(){new SB.ui.Gomez("affiliate bet basket"+f,G);});$("div#sportsLanding").each(function(){var J=$("input#sportName").val();new SB.ui.Gomez(J.toLowerCase()+" page"+f,G);});$("div#sportMultiplesLanding").each(function(){new SB.ui.Gomez("multiples page"+f,G);});$("div#inplayFlashApp").each(function(){new SB.ui.Gomez("inPlay flash page"+f,G);});$("a#todayurlLink").click(function(){var J=$("input#sportNo").val();if(J==102||J==103,102,14,313,314){new SB.ui.Gomez("todays football coupon"+f,G);}if(J==8){new SB.ui.Gomez("todays tennis coupon"+f,G);}});$("a#weekendurlLink").click(function(){var J=$("input#sportNo").val();if(J==102||J==103,102,14,313,314){new SB.ui.Gomez("weekend football coupon"+f,G);}});$("a#nextRacesUrlLink").click(function(){var J=$("input#sportNo").val();if(J==172,2){new SB.ui.Gomez("next horse races coupon"+f,G);}});$("div.myAccounts").each(function(){new SB.ui.Gomez("my account page"+f,G);});$("div#tEventbrowsingATRStreamingPopupPlayerDiv").each(function(){new SB.ui.Gomez("at the races"+f,G);});$("div#verifiedbyvisa").each(function(){new SB.ui.Gomez("payment protection form"+f,G);});var e=$("input#couponTemplateType1").val();var d=$("input#couponTemplateType2").val();var c=$("input#couponTemplateType3").val();var I=$("input#couponTemplateType4").val();var H=$("input#couponTemplateType5").val();var F=$("input#couponTemplateType6").val();var E=$("input#couponTemplateType7").val();if(e!=undefined){new SB.ui.Gomez(e+f,G);}if(d!=undefined){new SB.ui.Gomez(d+f,G);}if(c!=undefined){new SB.ui.Gomez(c+f,G);}if(I!=undefined){new SB.ui.Gomez(I+f,G);}if(H!=undefined){new SB.ui.Gomez(H+f,G);}if(F!=undefined){new SB.ui.Gomez(F+f,G);}if(E!=undefined){new SB.ui.Gomez(E+f,G);}var B=$("input#marketTemplateType1").val();var A=$("input#marketTemplateType2").val();var y=$("input#marketTemplateType3").val();var v=$("input#marketTemplateType4").val();var s=$("input#marketTemplateType5").val();var q=$("input#marketTemplateType6").val();var m=$("input#marketTemplateType7").val();var l=$("input#marketTemplateType8").val();var k=$("input#marketTemplateType9").val();var w=$("input#marketTemplateType10").val();var u=$("input#marketTemplateType11").val();var r=$("input#marketTemplateType12").val();var o=$("input#marketTemplateType13").val();if(B!=undefined){new SB.ui.Gomez(B+f,G);}if(A!=undefined){new SB.ui.Gomez(A+f,G);}if(y!=undefined){new SB.ui.Gomez(y+f,G);}if(v!=undefined){new SB.ui.Gomez(v+f,G);}if(s!=undefined){new SB.ui.Gomez(s+f,G);}if(q!=undefined){new SB.ui.Gomez(q+f,G);}if(m!=undefined){new SB.ui.Gomez(m+f,G);}if(l!=undefined){new SB.ui.Gomez(l+f,G);}if(k!=undefined){new SB.ui.Gomez(k+f,G);}if(w!=undefined){new SB.ui.Gomez(w+f,G);}if(u!=undefined){new SB.ui.Gomez(u+f,G);}if(r!=undefined){new SB.ui.Gomez(r+f,G);}if(o!=undefined){new SB.ui.Gomez(o+f,G);}var g=$("input#templateType").val();if(g!=undefined){new SB.ui.Gomez(g+f,G);}$("div#contactUs").each(function(){new SB.ui.Gomez("contact us page"+f,G);});$("div#404error").each(function(){new SB.ui.Gomez("404 error page"+f,G);});$("div.games-home").each(function(){new SB.ui.Gomez("games homepage"+f,G);});$("div.instant-casino").each(function(){new SB.ui.Gomez("casino homepage"+f,G);});$("div.live-casino").each(function(){new SB.ui.Gomez("live casino homepage"+f,G);});$("div#pokerPage").each(function(){new SB.ui.Gomez("poker homepage"+f,G);});$("div#OneVeeOne_divIframe").each(function(){new SB.ui.Gomez("1v1 homepage"+f,G);});$("div#backgammonPage").each(function(){new SB.ui.Gomez("backgammon homepage"+f,G);});$("div.financialsPage").each(function(){new SB.ui.Gomez("financials homepage"+f,G);});}});var ieDOM=false,nsDOM=false;var stdDOM=document.getElementById;initMethod=function(){if(!stdDOM){ieDOM=document.all;if(!ieDOM){nsDOM=((navigator.appName.indexOf("Netscape")!=-1)&&(parseInt(navigator.appVersion)==4));}}passwordChanged();};getObject=function(c){if(stdDOM){return document.getElementById(c);}if(ieDOM){return document.all[c];}if(nsDOM){return document.layers[c];}};getObjectStyle=function(c){if(nsDOM){return getObject(c);}var d=getObject(c);return d.style;};showDefault=function(c){showCell(c,"#E2E2E2","#E2E2E2");};showCell=function(c,e,d){getObjectStyle(c).color=e;getObjectStyle(c).backgroundColor=d;};changeCells=function(c,d){d=(d/5);d=d+1;for(i=1;i<d;i++){showCell("TD"+i,"Black",c);}for(i=d;i<21;i++){showDefault("TD"+i);}};showVeryPoor=function(d,c){changeCells("#EE0000",d);};showPoor=function(d,c){changeCells("#FF6103",d);};showAverage=function(d,c){changeCells("#FFE303",d);};showGood=function(d,c){changeCells("#98FB98",d);};showStrong=function(d,c){changeCells("#228B22",d);};showUndetermined=function(){showVeryPoor(0,"#EE0000");};passwordChanged=function(l,o,g,c,f,s){var r=0;var m=o;var k=new RegExp("(?=.*[A-Z])(?=.*[a-z]).*","g");var e=new RegExp("(?=.*[0-9]).*","g");var d=new RegExp("(?=.*[_]).*","g");var q=document.getElementById(l).value;r=q.length*5;if(k.test(q)){r=r+20;}if(e.test(q)){r=r+15;}if(d.test(q)){r=r+10;}if(r<31){showVeryPoor(r);}else{if(r<46){showPoor(r);m=g;}else{if(r<66){showAverage(r);m=c;}else{if(r<91){showGood(r);m=f;}else{if(r>90){m=s;if(r>100){r=100;}showStrong(r);}else{showVeryPoor(r);}}}}}document.getElementById("txtDisplay").innerHTML=m;};if(typeof SB=="undefined"){var SB={};}if(typeof SB.sharedWallet=="undefined"){SB.sharedWallet={};}SB.accounts.Login=function(){};SB.accounts.Login.BindPopup=function(){$("div.loginContent").each(function(){var c=new SB.sharedWallet.LoginPopup(this);c.setupEnterSubmit();c.bindLoginClick();c.setupValidation();c.focusUserNameInput();});};SB.accounts.Login.ProcessNextStep=function(){SB.base.divPopUp(1,"hide");$("input#nextPopup").each(function(){SB.base.OpenDiv(this.value,"popBadSelect1","popVeil1","popLayer1");});};SB.accounts.Login.UnBindPopup=function(){$("input").unbind("keydown");};SB.accounts.Login.ReRenderLoginPopup=function(){var g=$('input[name="LoginSource"]').val();var f=$('input[name="customTemplate"]').val();var e=$('input[name="StsLoginFormType"]').val();var d=encodeURIComponent(window.top.location);var k=encodeURIComponent(popUpDivURL);var c="/loginbar.mvc/popup?currentPageUrl="+d+"&customTemplate="+f+"&loginSource="+g+"&requestedPopupUrl="+k+"&stsLoginFormType="+e;new SB.sharedWallet.AhahDivReplacer(c,"#popLayer1").withProcessingImg().withPostSuccessHandler(function(){SB.base.centerPopWin();}).execute();return false;};SB.accounts.Login.OpenUserValidationPopup=function(c){SB.base.OpenDivCheckLoginStatus("/danishuservalidation.mvc/display?preRegistration=False&nemIdActionKey="+c,"popBadSelect2","popVeil2","popLayer2",false);return false;};SB.accounts.Login.ReRenderUserValidationPopup=function(){var d=$("#nemIdCallbackFunction").val();var c="/danishuservalidation.mvc/display?preRegistration=False&nemIdCallbackFunction="+d;new SB.sharedWallet.AhahDivReplacer(c,"#popLayer2").withProcessingImg().withPostSuccessHandler(function(){SB.base.centerPopWin();}).execute();return false;};SB.accounts.Login.CloseUserValidationPopupAndRunCallbackFunction=function(){var callback=$("#nemIdCallbackFunction").val();SB.base.divPopUp(2,"remove");if(callback){eval(callback);}};SB.accounts.Login.OpenUserPreRegistrationPopup=function(c){SB.base.OpenDiv("/danishuservalidation.mvc/display?preRegistration=True&preRegistrationParameters="+c,"popBadSelect1","popVeil1","popLayer1");return false;};SB.accounts.Login.ReRenderUserPreRegistrationPopup=function(){var d=$("#preRegistrationParameters").val();var c="/danishuservalidation.mvc/display?preRegistration=True&preRegistrationParameters="+d;new SB.sharedWallet.AhahDivReplacer(c,"#popLayer1").withProcessingImg().withPostSuccessHandler(function(){SB.base.centerPopWin();}).execute();return false;};SB.accounts.Login.ClosePreRegistrationPopupAndOpenRegistrationPopup=function(){var c=$("#preRegistrationParameters").val();SB.base.divPopUp(1,"remove");SB.base.OpenDiv("/registration.mvc/display?"+c,"popBadSelect1","popVeil1","popLayer1");};SB.sharedWallet.LoginPopup=function(c){this.div=c;};SB.sharedWallet.LoginPopup.prototype={focusUserNameInput:function(){$("#modCustLoginIFrameUsername").focus();},setupEnterSubmit:function(){var c=this;$("input").keydown(function(d){if(d.keyCode==13){c.handleLogin();return false;}});},bindLoginClick:function(){var c=this;$("#modCustLoginIFrameLogin").click(function(){c.handleLogin();});},handleLogin:function(){$("#requestedPopupUrl").val(popUpDivURL);new SB.sharedWallet.AhahFormSubmitter("#dvpage form[name='loginBox']").withHoldingDivEnabled(true).withSuccessTarget("#popLayer1").execute();return false;},setupValidation:function(){$("#modCustLoginIFrameUsername").unbind(".validation").bind("keydown.validation",function(){$("#ico_username").removeClass("icoFalse");});$("#modCustLoginIFramePassword").unbind(".validation").bind("keydown.validation",function(){$("#ico_password").removeClass("icoFalse");});}};OnOpenAccountClick=function(d){var c=location.href.split(":")[0];if(c=="http"){SB.base.deferWindowCommand(d+"","popup",false);}else{SB.base.OpenDivCheckLoginStatus(d+"","popBadSelect1","popVeil1","popLayer1",false);}return false;};$(document).ready(function(){$("#modCustLoginLogin").click(function(){$("form[name='loginBox']").submit();return false;});$("#modCustLoginLogout").click(function(){$("form[name='logout']").submit();return false;});$("#modCustStsLoginLogout").click(function(){$("form[name='logoutSts']").submit();return false;});$(".showLoginPopup").click(function(){var c=location.href.split(":")[0];var d=$(this).attr("popup");if(c=="http"){SB.base.deferWindowCommand(d,"popup",false);}else{SB.base.OpenDivCheckLoginStatus(d+"","popBadSelect1","popVeil1","popLayer1",false);}return false;});$("#modCustLoginForgottenPw.notOnHttps").click(function(){SB.base.deferWindowCommand(this.href+"","popup",false);return false;});$("#modCustLoginForgottenPw.onHttps").click(function(){SB.base.OpenDivCheckLoginStatus(this.href+"","popBadSelect1","popVeil1","popLayer1",false);return false;});$("#usernameLabel").focus(function(){$(this).hide();$("#modCustLoginUsername").show().focus();});$("#passwordLabel").focus(function(){$(this).hide();$("#modCustLoginPassword").show().focus();});$("#modCustLoginUsername").blur(function(){if(this.value==""){$(this).hide();$("#usernameLabel").show();}});$("#modCustLoginUsername").keydown(function(c){if(c.keyCode==13){$("form[name='loginBox']").submit();return false;}});$("#modCustLoginPassword").blur(function(){if(this.value==""){$(this).hide();$("#passwordLabel").show();}});$("#modCustLoginPassword").keydown(function(c){if(c.keyCode==13){$("form[name='loginBox']").submit();return false;}});$("#modCustLoginByNemId").click(function(){var e=$('input[name="currentPageUrl"]').val();var d="/loginbar.mvc/popup?customTemplate=LoginPopupOnlyLoginMode&currentPageUrl="+e;var c=window.location.protocol=="http:";SB.base.loadPopup(d,false,c);});$("#usernameLabel").show();$("#modCustLoginUsername").hide();$("#passwordLabel").show();$("#modCustLoginPassword").hide();$('input[name="showThePopup"]').each(function(){SB.base.OpenDiv(this.value,"popBadSelect1","popVeil1","popLayer1");});});if(typeof SB=="undefined"){var SB={};}if(typeof SB.sharedWallet=="undefined"){SB.sharedWallet={};}SB.sharedWallet.AhahRequest=function(){};SB.sharedWallet.AhahRequest.prototype={MakeGeneralAhahRequest:function(e,d){var c=this;$.ajax({url:e,type:"POST",success:d});},MakeInlineErrorHandledRequest:function(e,f,d){var c=this;$.ajax({url:e,type:"POST",success:d,error:function(k){var g=SB.base.GetUnhandledServerErrorMessage();$(f).html(g);}});},MakeInlineErrorHandledDivReplacementWithProcessingImg:function(e,f,d){var c=this;$(f).html("<img src='/modules/customer/myAccounts/loader/ajax-loader-round.gif' style='margin-left: 250px; margin-top: 50px;margin-bottom: 50px;' alt='Loading Content'/>");$.ajax({url:e,type:"POST",success:function(g,k){d(g,k);},error:function(k){var g=SB.base.GetUnhandledServerErrorMessage();$(f).html(g);}});},PostPopupFormWithDefaultErrorHandling:function(f,d){var c=this;var e=$(f);SB.base.holdingDiv("show");e.ajaxForm({success:function(g){SB.base.holdingDiv("hide");if(d){d(g);}else{$("#popupContent").html(g);}},error:function(g){SB.base.holdingDiv("hide");c.popupErrorHandler("#popLayer2",2);}});e.submit();},popupErrorHandler:function(e,d){var c=SB.base.GetUnhandledServerErrorMessage();$(e).html(c);$(".popupHead a",e).attr("id","closeServerError");$(".popupHead a",e).removeAttr("onclick");$("a#closeServerError",e).click(function(){SB.base.divPopUp(d,"hide");return false;});SB.base.divPopUp(d,"show");SB.base.centerPopWin(d);},defaultDivErrorHandler:function(d){var c=SB.base.GetUnhandledServerErrorMessage();$(d).html(c);},defaultDivSuccessHandler:function(d,c){$(d).html(c);}};SB.sharedWallet.AhahRequest=new SB.sharedWallet.AhahRequest();SB.sharedWallet.AhahDivReplacer=function(c,d){this.url=c;this.targetDiv=d;this.postSuccessHandler=function(){};this.postErrorHandler=function(){};this.successHandler=SB.sharedWallet.AhahRequest.defaultDivSuccessHandler;this.errorHandler=SB.sharedWallet.AhahRequest.defaultDivErrorHandler;this.hasProcessingImg=false;this.processingHandler=function(){};};SB.sharedWallet.AhahDivReplacer.prototype={withPostSuccessHandler:function(c){this.postSuccessHandler=c;return this;},withSuccessHandler:function(c){this.successHandler=c;return this;},withErrorHandler:function(c){this.errorHandler=c;return this;},withPostErrorHandler:function(c){this.postErrorHandler=c;return this;},withFrameErrorHandler:function(){this.errorHandler=function(c){SB.sharedWallet.AhahRequest.popupErrorHandler("#popLayer2",2);};return this;},withProcessingImg:function(){this.hasProcessingImg=true;return this;},withProcessingHandler:function(c){this.processingHandler=c;return this;},execute:function(){var c=this;if(this.hasProcessingImg){$(this.targetDiv).html("<img src='/modules/customer/myAccounts/loader/ajax-loader-round.gif' style='margin-left: 250px; margin-top: 50px;margin-bottom: 50px;' alt='Loading Content'/>");}else{this.processingHandler();}$.ajax({url:c.url,type:"GET",success:function(d){c.successHandler(c.targetDiv,d);c.postSuccessHandler(d);},error:function(d){c.errorHandler(c.targetDiv);c.postErrorHandler(d);}});}};SB.sharedWallet.AhahFormSubmitter=function(c){this.formSelector=c;this.successHandler=function(d){$("#popupContent").html(d);};};SB.sharedWallet.AhahFormSubmitter.prototype={withSuccessHandler:function(c){this.successHandler=c;this.holdingDivEnabled=true;return this;},withSuccessTarget:function(c){this.successHandler=function(d){$(c).html(d);};return this;},withHoldingDivEnabled:function(c){this.holdingDivEnabled=c;return this;},execute:function(){var c=this;var d=$(this.formSelector);this.holdingDivIfRequired("show");d.ajaxForm({success:function(e){c.holdingDivIfRequired("hide");c.successHandler(e);SB.base.centerPopWin();},error:function(e){c.holdingDivIfRequired("hide");SB.sharedWallet.AhahRequest.popupErrorHandler("#popLayer2",2);SB.base.centerPopWin();}});d.submit();},holdingDivIfRequired:function(c){if(this.holdingDivEnabled){SB.base.holdingDiv(c);}}};if(typeof SB.inPlay=="undefined"){SB.inPlay={};}SB.inPlay.HighlightCoupon=function(c){this.parentDiv=c;this.adjustColumnHeaderHeight();this.adjustEventRowHeight();this.boxVisible=true;this.setupOpenCloseButton();};SB.inPlay.HighlightCoupon.prototype={setupMediaCoverage:function(c){$("div.mediaCoverageButton",c).each(function(){var d=$(this);var e=$("div.mediaCoveragePopup",this);e.css("left",(e.position().left-e.width()/2));e.css("top",(e.position().top-e.height()));d.hover(function(){e.css("visibility","visible");},function(){e.css("visibility","hidden");});});},setupStatsButton:function(c){$("a.matchStatsButton",c).each(function(){var e=$(this);var d=$('input[type="hidden"]',e).val();if(d!=null){e.click(function(){window.open(d,"stats");});}});},setupBetButtons:function(e){var d=$("#betBasket").get(0).basket;try{$("a.addBetButton",e).each(function(){new SB.betBasket.AddButton(this,d);});}catch(c){}},setupPageLoadBindings:function(){var c=this;$("li.event",c.parentDiv).each(function(){c.setupEventRowBindings(this);});},setupEventRowBindings:function(c){this.setupMediaCoverage(c);this.setupStatsButton(c);},adjustEventRowHeight:function(){$(this.parentDiv).find(".columns").each(function(){var o=$(this).find(".eventInfo").height();var d=$(".score",$(this));var f=$(".scoreValue",d);d.height(o-2);f.css("top",(o-f.height())/2+"px");var l=$(this).find(".price");var c=$(this).find(".moreInfo");var e=$(this).find(".moreBetInfo");l.css("line-height",o+"px");var k=(o-c.height())/2;if(k<0){k=0;}c.css("margin-top",k+"px");var g=(o-e.height())/2;if(g<0){g=0;}e.css("margin-top",g+"px");var m=$(this).find(".priceChangeArrow");m.each(function(){var q=$(this).parent().position();$(this).css("top",q.top+(o-$(this).height())/2+"px");$(this).css("left",q.left+$(this).parent().width()-$(this).width()-5+"px");});});},adjustColumnHeaderHeight:function(){var d=0;$(".couponHeader > .columns",this.parentDiv).children().each(function(){if($(this).outerHeight()>d){d=$(this).outerHeight();}});var c=[];$(".couponHeader > .columns",this.parentDiv).children().each(function(){c.push(this);});$("ul.selectionHeader",this.parentDiv).children().each(function(){c.push(this);});$(c).each(function(){var e=(d-$(this).outerHeight())/2;$(this).css("height",d-e+"px");$(this).css("padding-top",e+"px");});},doEventCountUp:function(){var c=this;$("li.event div.ElapsedTime",c.parentDiv).each(function(){var k=$(this);var o=$("span",k).text();if(o!=""){var e=new Number(o.split(":")[0]);var m=new Number(o.split(":")[1]);var g=(e*60)+m+1;var l=Math.floor(g/60);var f=g-(l*60);var d=c.formatTime(l)+":"+c.formatTime(f);k.find("span").html(d);}});},formatTime:function(c){if(c<10){return"0"+String(c);}else{return String(c);}},onHeartbeat:function(){this.doEventCountUp();},setupOpenCloseButton:function(){var c=this;var d=$("a.OpenCloseLabel",c.parentDiv);d.unbind("click");d.bind("click",function(){var g=$(".couponEvents",c.parentDiv);var k=$(".couponHeader",c.parentDiv);var e=$(".couponBody",c.parentDiv);var f=$(".couponName",c.parentDiv);if(c.boxVisible){$(d[0]).text("[+] Open");g.hide();k.hide();e.hide();f.addClass("collapsedCoupon");c.boxVisible=false;}else{$(d[0]).text("[-] Close");g.show();k.show();e.show();f.removeClass("collapsedCoupon");c.boxVisible=true;}});}};SB.inPlay.OneClickMultiples=function(c){this.parentDiv=c;this.items=null;this.setupOpenCloseLink();this.clearOneClickMultiples();this.setupOneClickMultipleItems();this.adjustColumnHeaderHeight();this.setMultipleBoxVisibility();};SB.inPlay.OneClickMultiples.prototype={setupOneClickMultipleItems:function(){var c=this;c.items=[];var e=$("#betBasket").get(0).basket;var d=$(".tax1CM").val();var f=$(".taxDutyBase1CM").val();$("li.SubGroupRow",$(c.parentDiv).find("ul.SubGroups")).each(function(){c.items.push(new SB.inPlay.OneClickMultipleItem(this,e,d,f));});},setMultipleBoxVisibility:function(){if($.cookie("isMultipleBoxVisible")){this.showMultipleBox();}else{this.hideMultipleBox();}},clearOneClickMultiples:function(){$.fn.clearEditableSelectInstances();},adjustColumnHeaderHeight:function(){var c=$(".GroupHeader",this.parentDiv);var e=c.children(0).outerHeight();var d=[];d.push($(".SubGroupName",c).get(0));$(".SubGroupColumns",c).children().each(function(){d.push(this);});$(d).each(function(){var g=parseInt($(this).css("padding-top").replace("px",""));var f=g+(e-$(this).outerHeight())/2;$(this).height(e-f);$(this).css("padding-top",f+"px");});},setupOpenCloseLink:function(){var c=this;var d=$("a.OpenCloseLabel",c.parentDiv);d.unbind("click");d.bind("click",function(){if($.cookie("isMultipleBoxVisible")){c.hideMultipleBox();}else{c.showMultipleBox();}return false;});},hideMultipleBox:function(){var c=this;var f=$("a.OpenCloseLabel",c.parentDiv);var e=$(".MultipleGroupContent",this.parentDiv);var d=$(".MultipleGroupName",this.parentDiv);$(f[0]).text("[+] Open");e.hide();d.addClass("collapsedCoupon");$.cookie("isMultipleBoxVisible",null);},showMultipleBox:function(){var c=this;var g=$("a.OpenCloseLabel",c.parentDiv);var f=$(".MultipleGroupContent",this.parentDiv);var e=$(".MultipleGroupName",this.parentDiv);$(g[0]).text("[-] Close");f.show();e.removeClass("collapsedCoupon");$.cookie("isMultipleBoxVisible",true);for(var d=0;d!=c.items.length;d++){c.items[d].fixItemAfterUpdate();}}};SB.inPlay.InPlayController=function(c){this.parentDiv=c;this.coupons=this.bindCoupons();this.oneClickMultiples=null;this.setupMarketSelectors();this.setupPriceUpdate();this.bindMultiples();this.bindHeartbeat();};SB.inPlay.InPlayController.prototype={getPriceUpdates:function(g,k,f,l){var c=this;var e={deltaCouponKeys:k,timestamp:f,multipleCheckSum:l};var d={type:"POST",url:g,data:e,timeout:45000,traditional:true,success:function(m,o){c.priceUpdateSuccessHandler(m,o,f);},error:function(){}};jQuery.ajax(d);},reloadCouponAndMulitples:function(k,e,l){var c=this;var m={couponKeys:l};var f={couponKeys:l};var d={type:"POST",url:k,data:m,timeout:45000,traditional:true,success:function(o){c.couponUpdateSuccessHandler(o);},error:function(){c.hideProgress($("#inPlayCoupons"));}};var g={type:"POST",url:e,data:f,timeout:45000,traditional:true,success:function(o){c.multiplesUpdateSuccessHandler(o);},error:function(){c.hideProgress($("#OneClickMultiples"));}};c.showProgress($("#inPlayCoupons"));jQuery.ajax(d);c.showProgress($("#OneClickMultiples"));jQuery.ajax(g);},showProgress:function(c){$("div.processing",c).each(function(){var d=$(this);d.height(d.parent()[0].clientHeight);d.show();});},hideProgress:function(c){$(c).find("div.processing").hide();},couponUpdateSuccessHandler:function(d){var c=$("#inPlayCoupons",this.parentDiv);c.unbind();c.replaceWith(d);this.coupons=this.bindCoupons();this.setupMarketSelectors();},multiplesUpdateSuccessHandler:function(d){var c=$("#OneClickMultiples",this.parentDiv);c.unbind();this.updateMultiples(d);this.bindMultiples();},priceUpdateSuccessHandler:function(c,d){var f=this;var k=this.parentDiv;var e=$("#updatedAt",c).val();var g=new Array();$("#updatedAt",f.parentDiv).val(e);$("div.coupon",c).each(function(){var r=$(this).attr("id");var l=$("#"+r,k);var m=$("#checkSum",this).val();$("#checkSum",l).val(m);g.push(r);var q=$(this).find("ul.couponEvents");var o=l.find("ul.couponEvents");var s=new SB.inPlay.EventUpdater();s.updateEvents(o,q);});f.multiplesPriceUpdateSuccessHandler(c,d);},multiplesPriceUpdateSuccessHandler:function(c){var d=this;if(c!=null&&c!=""&&$("#OneClickMultiples",d.parentDiv).length>0){var e;if($(".GroupColumns",c).length>0){e=$("ul.SubGroups")[0];var f=$("ul.SubGroups",c)[0];$(e).unbind();$(e).replaceWith(f);d.bindMultiples();}else{if($("#areMultiplesUpdated",c).val()=="True"){e=$("ul.SubGroups")[0];$(e).unbind();d.updateMultiples("");}}}},updateMultiples:function(d){var c=$("#OneClickMultiples",this.parentDiv);if(d==null||d.length==0){c.html(d);}else{c.replaceWith(d);}},bindMultiples:function(){var c=this;var d=$("#OneClickMultiples div.Group",c.parentDiv);if(d.length>0){c.oneClickMultiples=new SB.inPlay.OneClickMultiples(d[0]);}},bindCoupons:function(){var c=this;var d=[];$("div.coupon",c.parentDiv).each(function(){var e=new SB.inPlay.HighlightCoupon(this);e.setupPageLoadBindings();d.push(e);});return d;},bindHeartbeat:function(){var c=this;$.doTimeout("inPlayHeartbeat");$.doTimeout("inPlayHeartbeat",1000,function(){$.each(c.coupons,function(){var d=this;d.onHeartbeat();});return true;});},setupMarketSelectors:function(){var c=this;var e=$("input.reloadCouponUrl",c.parentDiv).val();var d=$("input.reloadMultiplesUrl",c.parentDiv).val();$("select.marketSelector",c.parentDiv).change(function(){c.reloadCouponAndMulitples(e,d,c.getCouponKeys());});},setupPriceUpdate:function(){var c=this;var e=new Number($("#inPlayCoupons #refreshRate").val())*1000;var d=$("input.priceUpdateUrl",c.parentDiv).val();c.updatePrices(d);$.doTimeout("couponRefresh");$.doTimeout("couponRefresh",e,function(){c.updatePrices(d);return true;});},updatePrices:function(e){var d=this;var c=d.getDeltaCouponKeys();if(c.length>0){var f=$("#updatedAt",d.parentDiv).val();var k=$("#multipleCheckSum",$("#OneClickMultiples"));var g=k.length>0?k.val():"";d.getPriceUpdates(e,c,f,g);}},getCouponKeys:function(){var c=this;var d=[];$("select.marketSelector",c.parentDiv).each(function(){d.push(this.options[this.selectedIndex].value);});return d;},getDeltaCouponKeys:function(){var c=new Array();$("#inPlayCoupons").find("div.coupon").each(function(){var d=$("#checkSum",this).val();c.push($(this).attr("id")+":"+d);});return c;}};$(document).ready(function(){$("div#inPlayHighlights").each(function(){new SB.inPlay.InPlayController(this);});});SB.inPlay.OneClickMultipleItem=function(f,d,c,e){this.stake=0;this.div=f;this.stakeInput=null;this.stakeSelector=null;this.basket=d;this.tax=c;this.dutyBase=e;$(".editable-select",this.div).css("display","inline");this.fixHeight();this.setupToolTip();if(!this.isSuspended()){this.setupBetButton(this.basket);this.setupAddBetButton(this.basket);this.setupStakeSelector();this.setupStakeInput();this.updateCalculations();}};SB.inPlay.OneClickMultipleItem.prototype={setupBetButton:function(e){var c=this;var e=e;try{$("a.inplay_betButton",c.div).each(function(){new SB.inPlay.BetButton(this,e,c);});}catch(d){}},setupAddBetButton:function(e){var c=this;try{$("a.addBetButton",c.div).each(function(){$(this).unbind();new SB.betBasket.AddButton(this,e);$(this).bind("mouseover",function(f){c.showToolTip(this,"Add multiple to your betslip",f);$("li.selections",c.div).unbind("mouseover mouseout");});$(this).bind("mouseout",function(){$("li.selections",c.div).bind("mouseover",function(f){c.showToolTip(this,c.getToolTip(),f);}).bind("mouseout",function(){c.hideToolTip(this);});});});}catch(d){}},fixHeight:function(){var c=this;var d=$(".SubGroupColumns",this.div).children();d.each(function(){$(this).css("height","");$(this).css("padding-top","");});var e=$(this.div).outerHeight();d.each(function(){var k=(e-$(this).outerHeight())/2;if(c.dutyBase=="TOTALSTAKE"&&$(this).is(".tax")){k-=5;}$(this).css("height",e-k+"px");$(this).css("padding-top",k+"px");});if(c.stakeSelector){c.stakeSelector.positionElements();}var g=$(".cntBetButton",this.div);var f=($(".price",this.div).outerHeight()-g.outerHeight())/2;g.css("margin-top",f+"px");},setupToolTip:function(){var c=this;$("li.selections",c.div).unbind("mouseover mouseout").bind("mouseover",function(d){c.showToolTip(this,c.getToolTip(),d);}).bind("mouseout",function(){c.hideToolTip(this);});},setupStakeSelector:function(){this.stakeSelector=new SB.inPlay.StakeSelector(this.div,this);},setupStakeInput:function(){this.stakeInput=new SB.inPlay.StakeInput(this.div,this);},getStake:function(){var c;if(this.stakeSelector&&this.stakeSelector.active()){c=this.stakeSelector.getStake();}else{c=this.stakeInput.getStake();}return c;},isValidStake:function(c){return c>0;},validateStakeFormat:function(d){var c=this;var e;if(this.isValidStake(d)){e=$(".stakeValueFormatWarning",c.div);e.click(function(f){c.hideToolTip(this,"Please enter a numeric value here",f);});return true;}else{e=$(".stakeValueFormatWarning",c.div);e.click(function(f){c.showToolTip(this,"Please enter a numeric value here",f);});e.show();return false;}},persistStakeValue:function(g,f){var d=$(".stakePersistUrl").val();var e={stakeValue:g,multipleId:f};var c={type:"POST",url:d,data:e,timeout:45000,success:function(){},error:function(){}};jQuery.ajax(c);},updateCalculations:function(k){var c=this;if(k==null){k=c.getStake();}if(!c.isValidStake(k)){k=0;}c.stake=k;var e=c.potentialPayout(k);$("span.currency",c.div).removeClass("hidden");if(isNaN(e)){$("span.currency",c.div).addClass("hidden");}if(c.tax>0){var f;if(c.dutyBase=="STAKE"){f=k*Number(c.tax);}else{if(c.dutyBase=="TOTALSTAKE"){var d=Math.floor(100*(k/(1+Number(c.tax))))/100;var f=k-d;e=c.potentialPayout(d);$("span.realStake",c.div).text(c.basket.formatter.formatCurrencyWithoutCode(d));}else{if(c.dutyBase=="WINNING"){var f=(e-c.stake)*Number(c.tax);e-=f.toFixed(2);}else{if(c.dutyBase=="RETURN"){f=e*Number(c.tax);e-=f;}}}}var g=c.basket.formatter.formatCurrencyWithoutCode(f.toFixed(2));$("span.taxValue",c.div).text(g);}e=e.toFixed(2);var g=c.basket.formatter.formatCurrencyWithoutCode(e);$("span.amountValue",c.div).text(g);this.fixHeight();},potentialPayout:function(f){var d=this;var c=$("input.payoutFactor",d.div).val();if(f==""){return 0;}if(c!=undefined){var e=c*f;if(isNaN(e)){e=0;}return e;}return NaN;},showToolTip:function(e,d,c){d=TrimEnd(d);var f=unescape(d);if(f==null||f==""){f=MarketType.Labels.get("default");}dateVar=new Date();HelpTipId=e.id+dateVar.getMilliseconds();var g=navigator.userAgent.toLowerCase().indexOf("chrome")>-1;evX=c.clientX;if(g){evY=c.pageY;}else{evY=c.clientY;}showHelpTipAlert(true,f);return true;},hideToolTip:function(c){if(c!=null){setTimeout("if (HelpTipId == '"+HelpTipId+"') {Tooltip.Set('', -1000, -1000); HelpTipId = '';}",0);}},getToolTip:function(){return $(".tooltip",this.div).val();},getId:function(){return $(this.div).attr("id");},isSuspended:function(){return $(this.div).hasClass("suspended");},fixItemAfterUpdate:function(){this.fixHeight();if(this.stakeSelector!=null){this.stakeSelector.fixItemAfterUpdate();}}};SB.inPlay.EventUpdater=function(){};SB.inPlay.EventUpdater.prototype={updateEvents:function(e,f){var d=this;$("li.event",e).each(function(){$(this).addClass("update");});var c=null;$("li.event",f).each(function(){var g=this;var m=$(g).attr("id");var k=e.find("li#"+m);if(k.length==0){d.insertNewEvent(c,e,g);}else{k.unbind();d.replaceEvent(k,g);}var l=new SB.inPlay.HighlightCoupon(this);l.setupEventRowBindings(g);l.setupBetButtons(g);c=g;});$("li.event.update",e).each(function(){$(this).unbind().remove();});},insertNewEvent:function(d,e,c){$(c).hide();if(d==null){$(e).prepend(c);}else{$(c).insertAfter(d);}$(c).fadeIn("slow");},animatePrice:function(d,f){var c=3000;var g=$("a.price",f);var e=$(".priceChangeArrow",f);g.addClass(d);e.addClass(d);$.doTimeout(c,function(){g.removeClass(d);e.removeClass(d);e.addClass(d+"2");$.doTimeout(c,function(){e.removeClass(d+"2");});});},replaceEvent:function(e,d){var f=this;e.replaceWith(d);var k=$("li.selections.active",e).attr("id");var c=$("li.selections.active",d).attr("id");if(k==c){var g=$("li.selections.active li.active",d);g.each(function(){var o=this;var m=$(this).attr("id");var l=parseFloat($("li#"+m+" input.decValue",e).val());var q=parseFloat($("li#"+m+" input.decValue",d).val());if(l!=q){$("a.price",this).hide();if(l<q){f.animatePrice("priceUp",o);}else{f.animatePrice("priceDown",o);}$("a.price",this).fadeIn("slow");}});}}};SB.inPlay.BetButton=function(d,f,e){var c=this;$(d).click(function(g){c.click(g);});this.click=function(g){if((f.isInProgress()==false)&&(e.validateStakeFormat(e.getStake()))){SB.Mouse.savePosition();c.disableBetting();f.placeOneClickBet(c.getBetCode(),c.getStake(),c.enableBetting);}};this.getBetCode=function(){return $('input[type="hidden"]',d).val();};this.getStake=function(){return e.getStake();};this.disableBetting=function(){$(d).addClass("betButtonsDisabled");f.showProgress();};this.enableBetting=function(){$(d).removeClass("betButtonsDisabled");};};SB.inPlay.StakeSelector=function(d,c){this.editableSelectInstance=null;this.parentDiv=d;this.oneClickMultipleItem=c;this.setupStakeSelector(d,c);};SB.inPlay.StakeSelector.prototype={setupStakeSelector:function(f){var e=this;var d=$(".editable-select",f);if(d.length>0){$(function(){d.editableSelect({bg_iframe:false,case_sensitive:false,numeric:true,optionalClass:"om-stake-wrapper",optionalParent:$(".stake",f),useRelativeOffset:true,onSelect:function(){var g=this.text.val();if(e.oneClickMultipleItem.validateStakeFormat(g)){e.oneClickMultipleItem.persistStakeValue(g,e.oneClickMultipleItem.getId());e.setSelectedStake(g);}e.oneClickMultipleItem.updateCalculations(g);}});});e.editableSelectInstance=$(".editable-select",f).editableSelectInstances()[0];}else{$(".stakeBox",f).change(function(){var g=$(this).val();e.oneClickMultipleItem.validateStakeFormat(g);e.oneClickMultipleItem.updateCalculations(g);return false;});}var c=$("#stakeValue",f).val();if(c!=undefined){e.setSelectedStake(c);}},setSelectedStake:function(d){var c=this.editableSelectInstance;if(c!=null){c.current_value=d;c.text.val(d);}this.oneClickMultipleItem.updateCalculations(d);},getStake:function(){return this.editableSelectInstance.current_value;},positionElements:function(){if(this.editableSelectInstance){this.editableSelectInstance.positionElements();}},fixItemAfterUpdate:function(){if(this.editableSelectInstance!=null){this.editableSelectInstance.setWidths();this.editableSelectInstance.positionElements();}},active:function(){return this.editableSelectInstance!=null;}};SB.inPlay.StakeInput=function(d,c){this.parentDiv=d;this.stakeInput=null;this.oneClickMultipleItem=c;this.setupStakeInput();};SB.inPlay.StakeInput.prototype={setupStakeInput:function(){var c=this;$(".stake-input",c.parentDiv).each(function(){c.stakeInput=this;$(this).change(function(){var d=$(c.stakeInput).val();if(c.oneClickMultipleItem.validateStakeFormat(d)||d==""){c.oneClickMultipleItem.persistStakeValue(d,c.oneClickMultipleItem.getId());}c.oneClickMultipleItem.updateCalculations(d);});});},getStake:function(){return $(this.stakeInput).val();}};if(typeof SB.inPlayApp=="undefined"){SB.inPlayApp={};}SB.inPlayApp.LayoutController=function(c){this.layoutMode=2;this.root=c;this.inPlayPreferences=inPlayPreferences;this.layout=new SB.inPlayApp.Layouts(this.root);this.preferencesController=new SB.inPlayApp.PreferencesController(this);this.inPlayAppController=new SB.inPlayApp.InPlayAppController(this);this.priceUpdateController=new SB.inPlayApp.PriceUpdateController(this,this.inPlayAppController);this.marketContainer=new SB.inPlayApp.MarketContainer(this,this.priceUpdateController);this.favourites=new SB.inPlayApp.Favourites(this);this.liveNow=new SB.inPlayApp.LiveNow(this);this.upComing=new SB.inPlayApp.UpComing(this);this.polling=new SB.inPlayApp.Polling(this,this.inPlayAppController);this.setup();this.initialize();this.number=10;this.bindHeartbeat(this.layout);this.disableTextSelection();this.isVideoExtended="True";};SB.inPlayApp.LayoutController.prototype={initialize:function(){this.preferencesController.setup();this.updateLayout();this.favourites.initialize();this.inPlayAppController.loadInPlay();this.upComing.initialize();this.addShowAll("span.showall");this.initSpanner();},reset:function(){this.marketContainer.reset();this.favourites.reset();this.initialize();},initSpanner:function(){var c=this;$("#inplayhome div.spanner").appendTo("#loginBox div.position:first");$("#resetPreferences").unbind("click").click(function(){c.preferencesController.resetAllEvents();SB.base.OpenDiv("/InPlayApp.mvc/DisplaySpannerMessage","popBadSelect1","popVeil1","popLayer1");});},initLeftNavContainer:function(c){this.addShowHide("span.arrow",c,false);this.initializeEvents(c);this.updateLayout();},bindHeartbeat:function(){var c=this;$.doTimeout("inplayHeartbeat",false);$.doTimeout("inplayHeartbeat",1000,function(){var d=$(".event, #event-header-details",c.root);if(d.length>0){c.layout.doEventCountUp(d);}return true;});},reOpenSportGroup:function(c){var e=c.parents("li.inplay_sc:first");if(!e.hasClass("opened")){e.addClass("opened");var d=this.extractIdFromClass(e,"sport_");this.preferencesController.addOpenedLiveNowSport(d);}},addShowHide:function(d,c,f){var e=this;if(c==null){c=e.root;}if(f==null||f==true){f=true;}else{f=false;}c.find(d).unbind("click").click(function(){var g=$(this).parent();var k=function(){var l=g.parent();var r=l.hasClass("opened");var m=true;var v=null;if(this.id=="ulUpcoming"){var s=e.upComing.root.html();if(s==null||s.length==0){e.upComing.loadUpcoming();m=false;}e.preferencesController.saveUpcomingSportContainerOpenState(!r);}else{if(this.id=="ulLiveNow"){e.preferencesController.saveInplaySportContainerOpenState(r);}else{if(l.hasClass("inplay_sc")){var u=l.attr("id").split("_");if(u.length==2){if(!r){e.preferencesController.addOpenedLiveNowSport(u[1]);}else{e.preferencesController.removeOpenedLiveNowSport(u[1]);}}}else{if(l.hasClass("ev-parent")){var q=l.attr("id").split("_");if(q.length==2){if(!r){e.preferencesController.addOpenedEvent(q[1]);var o=e.extractIdFromClass(l,"sport_");e.preferencesController.addOpenedLiveNowSport(o);}else{e.preferencesController.removeOpenedEvent(q[1]);}}}else{if(l.hasClass("m_item")){v=e.extractIdFromClass(l.parents("li:first"),"mt_");}else{if(l.hasClass("marketGroup")){v=e.extractIdFromClass(l,"mt_");}}}}}}if(v!=null){if(!r){e.preferencesController.addOpenedMarket(v);}else{e.preferencesController.removeOpenedMarket(v);}}if(m){if(r){l.removeClass("opened");}else{l.addClass("opened");}$(this).css("display","");}};if(f){g.next().slideToggle(200,k);}else{g.next().slideToggle(0,k);}return true;});},extractIdFromClass:function(d,c){return this.extractNumberFromAttribute(d,"class",c);},extractNumberFromAttribute:function(l,g,f){var m=-1;if(l.length==0){return m;}var e=l.attr(g).split(" ");var c="";for(var d=e.length-1;d>=0;d--){if(e[d].indexOf(f)>-1){c=e[d];break;}}var k=c.split("_");if(k.length>1){m=k[1];}return m;},addHideAll:function(c){var d=this;d.root.find(c).unbind("click").click(function(){d.root.find("#navLeft").find(".headerSubSub, .headerSub").parent().removeClass("opened");d.root.find("#navLeft").find(".events").css("display","");$(this).removeClass("hideall").addClass("showall").attr("title","Show all");d.addShowAll(".showall");});},addShowAll:function(c){var d=this;d.root.find(c).unbind("click").click(function(){var e=d.root.find("#navLeft");e.find(".headerSub > .counter:not(:.empty)").parent().parent().addClass("opened");e.find(".headerSubSub.exp").parent().addClass("opened");$(this).removeClass("showall").addClass("hideall").attr("title","Hide all");d.addHideAll("span.hideall");});},addEvents:function(c,d){c.find("ul.events").append(d);this.initializeEvents(c);},initializeVideoStreaming:function(d){$("#VideoStreamingDataContainer").html(d);var e=$("#videoStreamingData");var c={baseURL:"%2fmisc%2fwebServices%2finPlay%2fNewXmlWebService.ashx%3faction%3d",userID:e.find("#userID").val(),eventID:e.find("#eventID").val(),eventStreamingId:e.find("#eventStreamingId").val(),streamingKey:e.find("#streamingKey").val(),eventName:e.find("#eventName").val(),startTime:e.find("#startTime").val(),sportID:e.find("#sportID").val(),isChargeable:e.find("#isChargeable").val(),isSubscribed:e.find("#isSubscribed").val(),langList:e.find("#langList").val(),scale:e.find("#scale").val()};swfobject.embedSWF("../../s/flash/inPlay/video_popup.swf","flashVideo","100%","374px","9.0.0","",c);this.updateLayout();},initializeEvents:function(e){var c=this;var d=e.find("li.ev-parent span.icon");d.click(function(g){var f=$(this).parent().parent();c.favourites.moveToFavourites(f);g.stopPropagation();});this.initializeEventLoad(e);},initializeEventLoad:function(d){var c=this;var e=d.find("span.event-name");e.click(function(){var f=$(this).parents("li.ev-parent:first");c.marketContainer.loadMarkets(f);c.preferencesController.saveLastVisitedEvent(f);c.updateLayout();});},initializeSportOrder:function(d,e){for(var c=d.length-1;c>=0;c--){var f=e.find("#sport_"+d[c]);e.prepend(f);}},initializeEventsDefaultOpenState:function(g){var k=this.inPlayPreferences.AppPreferences.CheckEventCountToExpand;var c=this.inPlayPreferences.AppPreferences.ExpandTopEvents;if(g==null){g=this.root;}var e=g.find("li.ev-parent");var m=Math.min(c,e.length,k);for(var d=0;d<m;d++){var f=$(e[d]);var l=this.extractNumberFromAttribute(f,"id","e_");this.preferencesController.addOpenedEvent(l);}},initializeEventsOpenState:function(f,c){if(c==null){c=this.root;}for(var d=0;d<f.length;d++){var e=c.find("#e_"+f[d]+":first");if(e.length>0){e.addClass("opened");}}},setupVideoPlayer:function(c){if(this.root.find("#IsStreaminEnabled").val()=="True"){$("#videoWrapper").removeClass("inactive");this.inPlayAppController.getStreamingInformation(c);}else{$("#videoWrapper").addClass("inactive");}},disableTextSelection:function(){$.extend($.fn.disableTextSelect=function(){return this.each(function(){if($.browser.msie){$(this).bind("selectstart",function(){return false;});}});});$("#inplayhome").disableTextSelect();},attachResizeWindow:function(){var c=this;$(window).resize(function(){c.updateLayout();});},setup:function(){var c=this;this.attachResizeWindow();$(document).ajaxComplete(function(){if(c.polling.favoriteSemaphore){c.polling.updateFavourites(c.polling.allEvents);}});$(window).bind("beforeunload",function(){c.marketContainer.dispose();c.polling.dispose();c.preferencesController.dispose();c.preferencesController.saveAllPreferences(false);});},updateEventCount:function(d,f){var c=d.find("span.e-count");var g=parseInt(c.text())+f;c.text(g);if(g==1){d.find("span.headerSub span.arrow").css("opacity","1.0");d.find("span.counter").removeClass("empty");}else{if(g==0){var e=d.find("span.headerSub span.arrow");e.trigger("click");e.css("opacity","0.0");d.find("span.counter").addClass("empty");}}},initializeRemovedFavouriteEventsFromSportGroup:function(d,f){for(var c=d.length-1;c>=0;c--){var e=f.find("#e_"+d[c]+":first");if(e.length>0){this.updateEventCount(e.parent().parent(),-1);e.remove();}}},updateLayout:function(){var e=this.layoutMode;var d=$(document).width();if(d>1300){$("#logincontainer, .container, .hcontainer").css("width","100%");$("#column1, #column2").addClass("half");if($("#column2 #videoWrapper").length==0){$("#column2").prepend($("#videoWrapper"));}this.layoutMode=3;}else{$("#logincontainer, .container, .hcontainer").css("width","994px");$("#column1, #column2").removeClass("half");if($("#rightNav #videoWrapper").length==0){$("#videoWrapper").insertAfter($("#rightNav form:first"));}this.layoutMode=2;}if(this.root.find("#IsStreaminEnabled").val()=="True"){if($.browser.mozilla){var c=setTimeout("updateVideoSize('"+this.isVideoExtended+"')",800);}else{updateVideoSize(this.isVideoExtended);}}if(e!=this.layoutMode){this.marketContainer.updateLayout(this.layoutMode);}}};SB.inPlayApp.LayoutController.dropDown=function(c){var f=$("#settled-markets");var e=$("#settled-markets-arrow");var d=$(c);d.width(f.width()+e.width()+4);d.scrollTop(0).toggle();return false;};function updateVideoSize(f){var d=$("#flashVideo");var k=20;var e=30;var g=3/4;var c;if(f=="False"){c=k;}else{c=e+k+d.width()*g;}d.height(c);}SB.inPlayApp.PreferencesController=function(c){this.layoutController=c;this.inPlayPreferences=c.inPlayPreferences.InplayPreferences;this.changeList=[];this.interval=5;this.completed=false;};SB.inPlayApp.PreferencesController.prototype={setup:function(){var c=this;$.doTimeout("autoSavePreferences",false);$.doTimeout("autoSavePreferences",c.interval*1000,function(){c.saveAllPreferences();return true;});},dispose:function(){$.doTimeout("autoSavePreferences");this.completed=false;},setFavoriteEvents:function(d){if(d==null||d==undefined){return;}var f=[];for(var c=0;c<d.length;c++){var e=d[c].substr(2);f.push(parseInt(e));}this.inPlayPreferences.FavoriteEvents=f;this.addPreferenceChange("FavoriteEvents");},addFavoriteEvent:function(d,f){if(d==null||d==undefined){return;}this.addPreferenceChange("FavoriteEvents");var e=parseInt(d.substr(2));var c=this.inPlayPreferences.FavoriteEvents.indexOf(e);if(c==-1){this.inPlayPreferences.FavoriteEvents.push(e);this.layoutController.updateEventCount(f,-1);}},removeFavoriteEvent:function(d,e){if(d==null||d==undefined){return;}this.addPreferenceChange("FavoriteEvents");var c=this.inPlayPreferences.FavoriteEvents.indexOf(parseInt(d.substr(2)));if(c!=-1){this.inPlayPreferences.FavoriteEvents.splice(c,1);if(e!=null){this.layoutController.updateEventCount(e,1);}}},storeSportOrder:function(g){this.addPreferenceChange("SportOrder");var e=[];for(var d=0;d<g.length;d++){var c=g[d].substr(6);e.push(parseInt(c));}var f=this.concatRemainingElements(e,this.inPlayPreferences.SportOrder);this.inPlayPreferences.SportOrder=f;},addOpenedLiveNowSport:function(d){this.addPreferenceChange("OpenedLiveNowSports");d=parseInt(d);var c=this.inPlayPreferences.OpenedLiveNowSports.indexOf(d);if(c==-1){this.inPlayPreferences.OpenedLiveNowSports.push(d);}var e=this.inPlayPreferences.OpenedLiveNowSports.indexOf(-1);if(d!=-1&&e!=-1){this.removeOpenedLiveNowSport("-1");}},removeOpenedLiveNowSport:function(d){this.addPreferenceChange("OpenedLiveNowSports");d=parseInt(d);var c=this.inPlayPreferences.OpenedLiveNowSports.indexOf(d);if(c!=-1){this.inPlayPreferences.OpenedLiveNowSports.splice(c,1);if(this.inPlayPreferences.OpenedLiveNowSports.length==0){this.addOpenedLiveNowSport("-1");}}},addOpenedUpcomingSport:function(d){this.addPreferenceChange("OpenedUpcomingSports");d=parseInt(d);var c=this.inPlayPreferences.OpenedUpcomingSports.indexOf(d);if(c==-1){this.inPlayPreferences.OpenedUpcomingSports.push(d);}},removeOpenedUpcomingSport:function(d){this.addPreferenceChange("OpenedUpcomingSports");d=parseInt(d);var c=this.inPlayPreferences.OpenedUpcomingSports.indexOf(d);if(c!=-1){this.inPlayPreferences.OpenedUpcomingSports.splice(c,1);}},saveInplaySportContainerOpenState:function(c){this.addPreferenceChange("IsInPlayContainerClosed");this.inPlayPreferences.IsInPlayContainerClosed=c;},saveUpcomingSportContainerOpenState:function(c){this.addPreferenceChange("IsUpcomingContainerOpened");this.inPlayPreferences.IsUpcomingContainerOpened=c;},addOpenedEvent:function(d){this.addPreferenceChange("OpenedEvents");d=parseInt(d);var c=this.inPlayPreferences.OpenedEvents.indexOf(d);if(c==-1){this.inPlayPreferences.OpenedEvents.push(d);}},removeOpenedEvent:function(d){this.addPreferenceChange("OpenedEvents");var c=this.inPlayPreferences.OpenedEvents.indexOf(parseInt(d));if(c!=-1){this.inPlayPreferences.OpenedEvents.splice(c,1);}},addOpenedMarket:function(d){this.addPreferenceChange("OpenedMarkets");d=parseInt(d);var c=this.inPlayPreferences.OpenedMarkets.indexOf(d);if(c==-1){this.inPlayPreferences.OpenedMarkets.push(d);}},removeOpenedMarket:function(d){this.addPreferenceChange("OpenedMarkets");var c=this.inPlayPreferences.OpenedMarkets.indexOf(parseInt(d));if(c!=-1){this.inPlayPreferences.OpenedMarkets.splice(c,1);}},storeMarketOrder:function(d,c){this.addPreferenceChange("MarketOrder");d=this.concatRemainingElements(d,this.getMarketSortOrderBySportId(c));this.setMarketSortOrderBySportId(c,d);},getMarketSortOrderBySportId:function(e){for(var d=0;d<this.inPlayPreferences.MarketOrders.length;d++){if(this.inPlayPreferences.MarketOrders[d].SportGroupId==e){return this.inPlayPreferences.MarketOrders[d].MarketOrders;}}var c=[];return c;},setMarketSortOrderBySportId:function(d,f){for(var c=0;c<this.inPlayPreferences.MarketOrders.length;c++){if(this.inPlayPreferences.MarketOrders[c].SportGroupId==d){this.inPlayPreferences.MarketOrders[c].MarketOrders=f;return;}}var e={SportGroupId:parseInt(d),MarketOrders:f};this.inPlayPreferences.MarketOrders[this.inPlayPreferences.MarketOrders.length]=e;},saveLastVisitedEvent:function(d){if(d==null){return;}var c=d.attr("id").substr(2);this.addPreferenceChange("LastVisitedEventId");this.inPlayPreferences.LastVisitedEventId=c;},resetAllEvents:function(){var c=this;c.changeList=[];var d={type:"POST",url:"/InPlayPreferences.mvc/ResetAllSettings",timeout:45000,traditional:true,datatype:"json",success:function(e){c.layoutController.inPlayPreferences.InplayPreferences=e.Preferences;c.layoutController.reset();},error:function(){}};$.ajax(d);},addPreferenceChange:function(c){if(this.changeList.indexOf(c)>-1){return false;}this.changeList.push(c);return true;},saveAllPreferences:function(f){if(this.changeList.length==0){return false;}if(f==null){f=true;}var d=this;var g=this.changeList.slice();d.changeList=[];var c=JSON.stringify(d.inPlayPreferences);var e={type:"POST",url:"/InPlayPreferences.mvc/SavePreferences",data:{preferences:c,changeList:g},timeout:45000,async:f,traditional:true,success:function(){this.completed=true;},error:function(){this.completed=true;}};$.ajax(e);return true;},concatRemainingElements:function(k,g){var c=[];for(var e=0;e<g.length;e++){var f=g[e];if(k.indexOf(f)==-1){c.push(f);}}var d=k.concat(c);return d;}};SB.inPlayApp.InPlayAppController=function(c){this.layoutController=c;this.ControllerMapping={InPlayApp:"/services/InPlayApp.mvc/",InPlayEventUpdate:"/services/InPlayEventUpdate.mvc/"};};SB.inPlayApp.InPlayAppController.prototype={getEventDeltaUpdates:function(f,g,k,c,e,m){var l=this.layoutController.inPlayPreferences.CurrentOddsFormat;var d={type:"GET",url:this.ControllerMapping.InPlayEventUpdate+"GetEventDeltaUpdates",data:{eventId:g,isSuspended:k,keys:c,settledMarketChecksum:e,oddsFormat:l},timeout:45000,traditional:true,cache:true,success:function(o){m(f,o,g);},error:function(){f.isExecuting=false;}};$.ajax(d);},getPriceDeltaUpdates:function(e,f,c,k){var g=this.layoutController.inPlayPreferences.CurrentOddsFormat;var d={type:"GET",url:this.ControllerMapping.InPlayEventUpdate+"GetPriceDeltaUpdates",data:{eventId:f,checkSum:c,oddsFormat:g},timeout:45000,traditional:true,cache:true,success:function(l){k(e,l);},error:function(){e.isExecuting=false;}};$.ajax(d);},getMarketGroups:function(f,e){var c=this;var g=c.layoutController.inPlayPreferences.CurrentOddsFormat;var d={type:"GET",url:this.ControllerMapping.InPlayApp+"GetMarketGroups",data:{eventId:f,oddsFormat:g},timeout:45000,traditional:true,cache:true,success:function(k){c.layoutController.marketContainer.display(k,f);},error:function(){c.layoutController.layout.hideProcessing(e);}};$.ajax(d);},getUpcomingEventsForSportGroup:function(e,f){var c=this;var d={type:"GET",url:this.ControllerMapping.InPlayApp+"GetUpcomingEventsForSportGroup",data:{sportGroupId:e},timeout:45000,traditional:true,success:function(g){c.layoutController.addEvents(f,$(g));},error:function(){}};$.ajax(d);},loadInPlay:function(){var c=this;var d={type:"GET",url:this.ControllerMapping.InPlayApp+"GetInPlaySports",dataType:"html",cache:true,timeout:45000,traditional:true,success:function(e){c.layoutController.liveNow.initialize(e);},error:function(){}};$.ajax(d);},getInPlayUpdates:function(d,e){var c={type:"GET",url:this.ControllerMapping.InPlayApp+"GetInPlaySports",dataType:"html",cache:true,timeout:45000,traditional:true,success:function(f){e(d,f);},error:function(){d.isExecuting=false;}};$.ajax(c);},loadUpcoming:function(){var c=this;var d={type:"GET",url:this.ControllerMapping.InPlayApp+"GetUpcomingSports",dataType:"html",cache:true,timeout:45000,traditional:true,success:function(e){c.layoutController.upComing.setup(e);},error:function(){}};$.ajax(d);},getUpcomingUpdates:function(d,e){var c={type:"GET",url:"/InPlayApp.mvc/GetUpcomingSports",dataType:"html",cache:true,timeout:45000,traditional:true,success:function(f){e(d,f);},error:function(){d.isExecuting=false;}};$.ajax(c);},getStreamingInformation:function(e){var c=this;var d={type:"GET",url:this.ControllerMapping.InPlayApp+"GetStreamingInformation",data:{eventId:e},timeout:45000,traditional:true,cache:true,success:function(f){c.layoutController.initializeVideoStreaming(f);},error:function(){}};$.ajax(d);}};SB.inPlayApp.DeltaUpdateController=function(d,c,e){this.marketContainer=e;this.root=d.root;this.layoutController=d;this.inPlayAppController=c;this.isExecuting=false;this.eventId=null;this.DeltaUpdateStatus={Unknown:0,Active:1,Added:2,Removed:3,Suspended:4,Closed:5,ReplaceAll:6,Replace:7,ReplaceEvent:8,AddSettledMarketResults:9,Unavailable:125};};SB.inPlayApp.DeltaUpdateController.prototype={attachEventDeltaUpdates:function(e){var c=this;var d=new Number(this.layoutController.inPlayPreferences.AppPreferences.EventUpdateRefreshRate)*1000;if(d<=0){return;}this.eventId=e;$.doTimeout("eventDeltaUpdates");$.doTimeout("eventDeltaUpdates",d,function(){if(c.isExecuting){return true;}var f=c.root.find("#column1 #checkSum").val();if(f==null||f==""){return false;}var k=c.root.find("#column1").hasClass("suspended");c.isExecuting=true;var g="";var l=$("#settled-markets-checksum");if(l.length>0){g=$("#settled-markets-checksum").val();}c.inPlayAppController.getEventDeltaUpdates(c,e,k,f,g,c.processEventDeltaUpdates);return true;});},dispose:function(){$.doTimeout("eventDeltaUpdates");this.eventId=null;},processEventDeltaUpdates:function(k,q,c){try{if(q==null||q.Id!=k.eventId){return;}if(q.Success){var e=k.root.find("#markets1");var m=k.root.find("#markets1, #markets2");if(q.Scores!=null){k.root.find("#column1 #event-score").html(q.Scores);}if(q.HasChanges){if(q.CheckSum!=null){k.root.find("#column1 #checkSum").val(q.CheckSum);}var f=true;var l=false;for(var g=0;g<q.DeltaUpdateItems.length;g++){var o=q.DeltaUpdateItems[g];var d=new SB.inPlayApp.DeltaUpdateContext(k,o,e,m);switch(o.Status){case k.DeltaUpdateStatus.ReplaceAll:k.replaceAll(d);l=true;break;case k.DeltaUpdateStatus.Added:k.addGroup(d);l=true;break;case k.DeltaUpdateStatus.Closed:case k.DeltaUpdateStatus.Removed:k.removeGroup(d);f=q.DeltaUpdateItems.length!=1;l=true;break;case k.DeltaUpdateStatus.Active:case k.DeltaUpdateStatus.Replace:case k.DeltaUpdateStatus.Suspended:k.replaceGroup(d);break;case k.DeltaUpdateStatus.ReplaceEvent:k.marketContainer.display(d.currentUpdate.Html,c);f=false;break;case k.DeltaUpdateStatus.AddSettledMarketResults:k.addSettledMarketResults(o);break;case k.DeltaUpdateStatus.Unavailable:k.root.find("#e_"+c).remove();k.layoutController.liveNow.loadFirstAvailableEvent();f=false;l=false;break;}}if(l){k.marketContainer.updateLayout(null);}if(f||l){k.marketContainer.initialize(c);}}}}finally{k.isExecuting=false;}},addSettledMarketResults:function(e){var c=$("#settled-markets-dropdown");$("#settled-markets-ul",c).prepend(e.Html);var d=$("#settled-markets-ul").children(":first").text();$("#settled-markets",c).text(d);$("#settled-markets-checksum",c).val(e.SettledMarketChecksum);},replaceAll:function(c){var f=$(c.currentUpdate.Html);var d=this.marketContainer.inPlayPreferences.InplayPreferences.MarketOrders;var e=this.marketContainer.initializeMarketGroupOrder(d,f);c.root.replaceWith(e);},addGroup:function(c){if(c.currentUpdate.Html!=null){var g=$(c.currentUpdate.Html);var e=this.marketContainer.getMarketSortOrderBySportId(this.marketContainer.sportGroupId);var f=this.layoutController.extractIdFromClass(g,"mt_");var k=-1;for(var d=0;d<e.length;d++){if(e[d]==f){k=d;break;}}if(k==-1){c.root.append(g);}else{if(k==0){c.root.prepend(g);}else{c.allMarkets.find("li.marketGroup.mt_"+e[k-1]).after(g);}}}},replaceGroup:function(c){c.replaceContent();},removeGroup:function(c){c.findGroup().remove();}};SB.inPlayApp.DeltaUpdateContext=function(d,f,c,e){this.controller=d;this.currentUpdate=f;this.root=c;this.allMarkets=e;};SB.inPlayApp.DeltaUpdateContext.prototype={findGroup:function(){return this.allMarkets.find("#"+this.currentUpdate.GroupId);},replaceContent:function(){this.findGroup().replaceWith(this.currentUpdate.Html);}};SB.inPlayApp.Polling=function(d,c){this.root=d.root;this.allEvents=null;this.layoutController=d;this.inPlayAppController=c;this.favourites=d.favourites;this.inPlayPreferences=d.inPlayPreferences;this.favoriteSemaphore=false;this.isExecuting=false;};SB.inPlayApp.Polling.prototype={setupInPlayUpdates:function(){var c=this;var d=new Number(this.layoutController.inPlayPreferences.AppPreferences.LeftNavRefreshRate)*1000;if(d<=0){return;}$.doTimeout("leftNavUpdates");$.doTimeout("leftNavUpdates",d,function(){if(c.isExecuting){return true;}c.allEvents=null;c.inPlayAppController.getInPlayUpdates(c,c.processInPlayUpdates);return true;});},dispose:function(){$.doTimeout("leftNavUpdates");this.favoriteSemaphore=false;},processInPlayUpdates:function(d,c){try{if(c==null){return;}var e=d.root.find("#ulLiveNow");var k=d.root.find("#inPlayContainer");var g=e.children();var f=$("#ulLiveNow",c);var l=f.children();d.preserveEvents(f);d.applySportState(d,c,k,g,f,l,e);d.layoutController.bindHeartbeat();d.layoutController.initLeftNavContainer(e.parent());if(d.layoutController.upComing.isLoaded){d.inPlayAppController.getUpcomingUpdates(d,d.processUpcomingUpdates);}else{d.favoriteSemaphore=true;}}finally{d.isExecuting=false;}},processUpcomingUpdates:function(e,c){if(c==null){return;}var d=e.root.find("#ulUpcoming");var k=e.root.find("#upcomingContainer");var g=k.find("#ulUpcoming").children();var f=$("#ulUpcoming",c);var l=f.children();e.preserveEvents(f);e.applySportState(e,c,k,g,f,l,d);e.layoutController.upComing.reInitUpcoming();e.favoriteSemaphore=true;},preserveEvents:function(c){if(this.allEvents==null){this.allEvents=$("li.ev-parent",c);}else{var d=$("li.ev-parent",c);$.merge(this.allEvents,d);}},applySportState:function(k,r,m,c,g,l,d){var q=this;c.each(function(){var v=$(this);var s=v.attr("id");var u=g.find("#"+s);if(u.length!=0){q.copyOpenCloseState(v,u);q.applyEventState(s,u,m);q.removeFavourites(u);m.find("#"+s).replaceWith(u);}else{m.find("#"+s).remove();}});var e=k.inPlayPreferences.InplayPreferences.SportOrder;var f=e[e.length-1];var o;l.each(function(){var w=$(this);var s=$(this).attr("id");var v=c.filter("#"+s);if(v.length==0){if(e.length==0){var u=d.find("#"+o);if(u.length>0){w.insertAfter(u);}else{d.prepend(w);}}else{w.insertAfter(d.find("#sport_"+f));}}o=$(this).attr("id");});},removeFavourites:function(g){var d=this;var f=g;var e=this.root.find("ul.menu").children();var c=e[0];$("li.ev-parent",c).each(function(){var k=$(this).attr("id");var l=f.find("#"+k);if(l.length!=0){d.layoutController.updateEventCount(l.parent().parent(),-1);l.remove();}});},applyEventState:function(c,e,d){d.find("#"+c+" li.ev-parent").each(function(){var g=$(this);var f=g.attr("id");var k=e.find("#"+f);if(g.hasClass("active")){k.addClass("active");}if(g.hasClass("opened")){if(k.children().filter("span.headerSubSub").hasClass("exp")){k.addClass("opened");}}else{if(k.hasClass("opened")){k.removeClass("opened");}}});},updateFavourites:function(g){var e=this;var d=g;var c=this.layoutController.favourites.root.parent();var k=c.find("li.ev-parent");k.each(function(){var o=$(this);var m=o.attr("id");var q=d.filter("#"+m+":first");if(q.length!=0){o.empty().append(q.children());if(o.hasClass("opened")){if(!o.children().filter("span.headerSubSub").hasClass("exp")){o.removeClass("opened");e.layoutController.preferencesController.removeOpenedEvent(m.substr(2));}}}else{var l=true;if(o.hasClass("upc")&&!e.layoutController.upComing.isLoaded){l=false;}if(l){o.unbind().remove();e.layoutController.preferencesController.removeFavoriteEvent(m,null);}}});this.favoriteSemaphore=false;if(k.length>0){this.favourites.reInitialize();}var f=this.root;if(f.find("li.ev-parent.active").length==0){this.layoutController.liveNow.loadFirstAvailableEvent();}},copyOpenCloseState:function(c,d){if(c.hasClass("opened")){d.addClass("opened");}else{d.removeClass("opened");}}};SB.inPlayApp.Layouts=function(c){this.parentDiv=c;};SB.inPlayApp.Layouts.prototype={doEventCountUp:function(d){var c=this;d.each(function(){var g=$(".time",this);var r=$('input[type="hidden"]',this).val();var e=$.trim(g.text());if(e!=""){var l=new Number(e.split(":")[0]);var f=new Number(e.split(":")[1]);var o;if(r=="False"){o=(l*60)+f-1;}else{o=(l*60)+f+1;}var q=Math.floor(o/60);var k=o-(q*60);var m=c.formatTime(q)+":"+c.formatTime(k);g.html(m);}});},formatTime:function(c){if(c<10){return"0"+String(c);}else{return String(c);}},setupBetButtons:function(e){var d=$("#betBasket").get(0).basket;try{$("a.addBetButton",e).unbind().each(function(){new SB.betBasket.AddButton(this,d);});}catch(c){}},setupEventLoadBindings:function(){var c=this;c.parentDiv.find("div.odds").each(function(){c.setupBetButtons(this);});},hideProcessing:function(c){c.find("div.processing").hide();},showProcessing:function(c){if(c==null||c.length==0){return;}var d=c.find("div.processing");d.width(c.width()).height(c.height());d.show();}};SB.inPlayApp.MarketContainer=function(c,d){this.defaultMarketLoaded=false;this.root=c.root;this.layoutController=c;this.layout=c.layout;this.priceUpdateController=d;this.inPlayPreferences=c.inPlayPreferences;this.inPlayAppController=c.inPlayAppController;this.preferencesController=c.preferencesController;this.deltaUpdateController=new SB.inPlayApp.DeltaUpdateController(c,this.inPlayAppController,this);this.eventId=null;this.sportGroupId=null;this.currentLayoutMode=2;this.marketsRoot=this.root.find("#page");this.dragDropHelper={index:0,source:null};};SB.inPlayApp.MarketContainer.prototype={initialize:function(c){this.setupSortableMarkets();this.initializeMarketGroupsOpenState(this.inPlayPreferences.InplayPreferences.OpenedMarkets);this.addShowHide("#column1 span.arrow");if(this.currentLayoutMode==3){this.addShowHide("#column2 span.arrow");}this.layout.setupEventLoadBindings();this.deltaUpdateController.attachEventDeltaUpdates(c);this.priceUpdateController.attachPriceDeltaUpdates(c);},reset:function(){this.defaultMarketLoaded=false;},dispose:function(){this.deltaUpdateController.dispose();},updateLayout:function(e){var c=e==null;if(e==null){e=this.currentLayoutMode;}else{this.currentLayoutMode=e;}var g=this.marketsRoot.find("#markets1");var f=this.marketsRoot.find("#markets2");if(e==3){var k;if(c){k=this.marketsRoot.find("#markets1, #markets2").children();}else{k=g.children();}var m=k.length;if(m>0){if(m>2){var o=Math.round((m+1.1)/2);var d=k.slice(o);if(c){f.empty();}f.append(d);}if(this.marketsRoot.find("#column1").hasClass("suspended")){this.marketsRoot.find("#column2").addClass("suspended");}else{this.marketsRoot.find("#column2").removeClass("suspended");}}}else{var l=f.children();if(l.length>0){g.append(l);}}},addShowHide:function(d,c,e){this.layoutController.addShowHide(d,c,e);},tryLoadDefaultEventMarket:function(){if(this.defaultMarketLoaded){return;}var d=this.inPlayPreferences.InplayPreferences.LastVisitedEventId;var c=null;if(d!=null&&d!=""){c=this.root.find("#e_"+d);}if(c==null){c=this.root.find("li.ev-parent:first");}if(c!=null&&c.length>0){this.defaultMarketLoaded=true;this.loadMarkets(c);this.layoutController.reOpenSportGroup(c);}},loadMarkets:function(d){if(d==null){return;}this.eventId=d.attr("id").substr(2);this.sportGroupId=this.layoutController.extractIdFromClass(d,"sport_");this.root.find(".active").removeClass("active");d.addClass("active");var c=this.root.find("#column1");this.marketsRoot.find("ul.menu, div.event-header-wrapper").hide();this.layoutController.layout.showProcessing(c);this.inPlayAppController.getMarketGroups(this.eventId,c);},display:function(c,e){var d=this.getMarketSortOrderBySportId(this.sportGroupId);var f=this.initializeMarketGroupOrder(d,$(c));if(this.currentLayoutMode==3){this.marketsRoot.find("#markets2").empty();}this.marketsRoot.find("#column1").replaceWith(f);this.layoutController.setupVideoPlayer(e);this.layoutController.updateLayout();this.marketsRoot.find("ul.menu, div.event-header-wrapper").show();this.initialize(e);this.updateLayout(this.currentLayoutMode);if(this.inPlayPreferences.AppPreferences.DiffusionEnabled){new SB.diffusion.PriceUpdater().resubscribeDiffusion();}},initializeMarketGroupOrder:function(f,k){var g=k.find("#markets1");var d=g.children();for(var e=f.length-1;e>=0;e--){var c="li.marketGroup.mt_"+f[e];var l=d.filter(c);if(l.length>0){g.prepend(l);}}return k;},initializeMarketGroupsOpenState:function(d){var e=this.root.find("#markets1, #markets2").children();for(var f=0;f<d.length;f++){var c="li.marketGroup.mt_"+d[f];var k=e.filter(c);if(k.length>0){k.addClass("opened");var g=k.find("li.m_item");if(g.length>0){g.addClass("opened");}}}},getMarketSortOrderBySportId:function(e){for(var d=0;d<this.inPlayPreferences.InplayPreferences.MarketOrders.length;d++){if(this.inPlayPreferences.InplayPreferences.MarketOrders[d].SportGroupId==e){return this.inPlayPreferences.InplayPreferences.MarketOrders[d].MarketOrders;}}var c=[];return c;},setupSortableMarkets:function(){var d=this;var c=this.root.find("#markets1");c.sortable("destroy");c.sortable({dropOnEmpty:true,helper:"clone",items:"> li",handle:"span",cursor:"move",connectWith:"#markets2",forcePlaceholderSize:true,placeholder:"placeholder",opacity:0.9,start:function(e,f){d.onMarketDragStart(e,f);},stop:function(e,f){d.onMarketDropped(e,f);}});c=this.root.find("#markets2");c.sortable("destroy");c.sortable({dropOnEmpty:true,helper:"clone",items:"> li",handle:"span",cursor:"move",connectWith:"#markets1",forcePlaceholderSize:true,placeholder:"placeholder",opacity:0.9,start:function(e,f){d.onMarketDragStart(e,f);},stop:function(e,f){d.onMarketDropped(e,f);}});},onMarketDragStart:function(d,e){var c=e.item;this.dragDropHelper.index=c.index();this.dragDropHelper.source=c.parent();$(".placeholder").css("width","98%").css("height",c.height());},onMarketDropped:function(c,r){var w=r.item;var m=w.index();var k=this.dragDropHelper.source;var u=k.attr("id");var v=w.parent().attr("id");var q=u=="markets1"&&v=="markets2";if(this.currentLayoutMode==2&&v=="markets2"){k.sortable("cancel");}if(this.dragDropHelper.index==m&&u==v){return;}var l;if((q)||(u=="markets2")){var g=this.marketsRoot.find("#markets1");var y=g.sortable("toArray");if(q){l=y.concat(this.marketsRoot.find("#markets2").sortable("toArray"));}else{l=y.concat(k.sortable("toArray"));}l.length=m+y.length+1;k=this.marketsRoot;}else{l=k.sortable("toArray");l.length=m+1;}var s=[];for(var f=0;f<l.length;f++){var o=l[f];var e=k.find("#"+o);var d=this.layoutController.extractIdFromClass(e,"mt_");if(d!=-1){s.push(parseInt(d));}}if(s.length>0){this.preferencesController.storeMarketOrder(s,this.sportGroupId);}}};SB.inPlayApp.Favourites=function(c){this.layoutController=c;this.root=c.root.find("#ulFavourites");this.inPlayPreferences=c.inPlayPreferences;this.preferencesController=c.preferencesController;this.addToFavouritesLabel="Remove from My Events";this.removeFromFavouritesLabel="Remove from My Events";};SB.inPlayApp.Favourites.prototype={initialize:function(){this.layoutController.addShowHide("span.arrow",this.root.parent());this.setupOnClick(this.root);this.layoutController.initializeEventsOpenState(this.inPlayPreferences.InplayPreferences.OpenedEvents,this.root);this.setupSortables();this.layoutController.marketContainer.tryLoadDefaultEventMarket();},reInitialize:function(){this.initialize();var c=this.root.find("li.ev-parent span.icon");c.addClass("ystar").attr("title",this.removeFromFavouritesLabel);},setupOnClick:function(c){var d=this;var e=c.find("li.ev-parent span.icon");e.unbind("click").click(function(g){var f=$(this).parent().parent();d.removeFromFavourites(f);g.stopPropagation();});this.layoutController.initializeEventLoad(c);},reset:function(){var c=this.root.find("li.ev-parent span.icon");c.each(function(){$(this).trigger("click");});},setupSortables:function(){var c=this;this.root.sortable("destroy");this.root.sortable({items:"> li",cursor:"move",forcePlaceholderSize:true,placeholder:"placeholder",helper:"clone",opacity:0.9,start:function(d,e){if($(e.item).hasClass("active")){$(e.helper).removeClass("active");}$(e.helper).addClass("shadow");$(".placeholder").css("width","220px");},stop:function(e,f){$(f.helper).removeClass("shadow");var d=c.root.sortable("toArray");c.preferencesController.setFavoriteEvents(d);}});},moveToFavourites:function(d){var c=this;var f=this.root;var k=d.parent().parent();var g=c.layoutController.extractIdFromClass(k,"sport_");var e="sport_"+g;if(!d.hasClass(e)){d.addClass(e);}d.slideToggle(300,function(){d=$(this).appendTo(f);var l=d.attr("id");d.slideToggle(600,function(){d=$(this);var m=d.find("span.icon");m.unbind("click").click(function(o){c.removeFromFavourites(d);o.stopPropagation();});m.addClass("ystar").attr("title",c.removeFromFavouritesLabel);});c.preferencesController.addFavoriteEvent(l,k);});},removeFromFavourites:function(f){var c=this;var e=f.attr("id");var k=this.layoutController.extractIdFromClass(f,"sport_");var d=f.hasClass("upc")?"#upcomingContainer":"#inPlayContainer";var g=$(d+" li.sport_"+k+" ul.events");f.slideToggle(300,function(){if(g.length>0){f=$(this).appendTo(g);f.slideToggle(600,function(){f=$(this);var l=f.find("span.icon");l.unbind("click").click(function(m){c.moveToFavourites(f);m.stopPropagation();});l.removeClass("ystar").attr("title",c.addToFavouritesLabel);});}c.preferencesController.removeFavoriteEvent(e,g.parent());});}};SB.inPlayApp.LiveNow=function(c){this.layoutController=c;this.root=null;this.inPlayPreferences=c.inPlayPreferences;this.preferencesController=c.preferencesController;this.marketContainer=c.marketContainer;};SB.inPlayApp.LiveNow.prototype={initialize:function(c){this.layoutController.root.find("#inPlayContainer").replaceWith(c);this.root=this.layoutController.root.find("#ulLiveNow");this.layoutController.initializeSportOrder(this.inPlayPreferences.InplayPreferences.SportOrder,this.root);this.initializeInPlayContainer();this.layoutController.initLeftNavContainer(this.root.parent());this.layoutController.initializeRemovedFavouriteEventsFromSportGroup(this.inPlayPreferences.InplayPreferences.FavoriteEvents,this.root);this.initializeSportGroupOpenState(this.inPlayPreferences.InplayPreferences.OpenedLiveNowSports);this.layoutController.initializeEventsOpenState(this.inPlayPreferences.InplayPreferences.OpenedEvents,this.root);this.setupSortables();this.layoutController.marketContainer.tryLoadDefaultEventMarket();this.layoutController.polling.setupInPlayUpdates();},initializeInPlayContainer:function(){if(!this.inPlayPreferences.InplayPreferences.IsInPlayContainerClosed){$("#inPlayContainer").addClass("opened");}},initializeSportGroupDefaultOpenState:function(){var c=this.layoutController.inPlayPreferences.AppPreferences.NoOfTopExpandedSport;var d=this.inPlayPreferences.InplayPreferences.OpenedLiveNowSports;if(d.length==0){var g=this.root.children();for(var f=0;f<c;f++){var e=$(g[f]);var k=this.layoutController.extractIdFromClass(e,"sport_");if($.inArray(k,d)){e.addClass("opened");this.preferencesController.addOpenedLiveNowSport(k);this.layoutController.initializeEventsDefaultOpenState(e);}}}var g=this.root.children();for(var f=0;f<g.length;f++){var e=$(g[f]);this.layoutController.initializeEventsDefaultOpenState(e);}},initializeSportGroupOpenState:function(l){var k=l.length;var f=this.root.children();f.filter("li").removeClass("opened");var d=k==0;if(d){this.initializeSportGroupDefaultOpenState();}var c=k==1&&l[0]==-1;if(!c){for(var e=0;e<k;e++){var g=f.filter("#sport_"+l[e]);if(g.length>0&&g.find("> ul.events").children().length>0){g.addClass("opened");}}}},reLoadEventWithMarkets:function(c){c.addClass("active");this.layoutController.reOpenSportGroup(c);this.marketContainer.loadMarkets(c);this.preferencesController.saveLastVisitedEvent(c);this.layoutController.updateLayout();},loadFirstAvailableEvent:function(){var c=this.layoutController.liveNow.root.find("li.ev-parent:first");if(c.length>0){this.reLoadEventWithMarkets(c);}},setupSortables:function(){var c=this;c.root.sortable("destroy");c.root.sortable({items:"> li",handle:"span.headerSub",helper:"clone",cursor:"move",forcePlaceholderSize:true,placeholder:"placeholder",opacity:0.9,start:function(f,g){var e=$(g.item);var d=$(g.helper);if(e.hasClass("active")){d.removeClass("active");}d.addClass("shadow");$(".placeholder").css("width","220px");},stop:function(f,g){var e=g.item.index();$(g.helper).removeClass("shadow");var d=c.root.sortable("toArray");d.length=e+1;c.preferencesController.storeSportOrder(d);c.layoutController.upComing.ReorderByLiveNow(c.inPlayPreferences.InplayPreferences.SportOrder);}});}};SB.inPlayApp.UpComing=function(c){this.layoutController=c;this.root=null;this.inPlayPreferences=c.inPlayPreferences;this.inPlayAppController=c.inPlayAppController;this.preferencesController=c.preferencesController;this.isLoaded=false;};SB.inPlayApp.UpComing.prototype={initialize:function(){if(this.inPlayPreferences.InplayPreferences.IsUpcomingContainerOpened){this.loadUpcoming();}else{this.initUpcoming();}},loadUpcoming:function(){this.layoutController.root.find("#upcomingProcessing").addClass("processing");this.inPlayAppController.loadUpcoming();},setup:function(c){var d=this.layoutController.root.find("#upcomingContainer");d.replaceWith(c);if(this.inPlayPreferences.InplayPreferences.IsUpcomingContainerOpened){d.addClass("opened");}this.initUpcoming();this.root.parent().addClass("opened");this.layoutController.initializeRemovedFavouriteEventsFromSportGroup(this.inPlayPreferences.InplayPreferences.FavoriteEvents,this.root);this.initializeSportGroupOpenState(this.inPlayPreferences.InplayPreferences.OpenedUpcomingSports);this.ReorderByLiveNow(this.inPlayPreferences.InplayPreferences.SportOrder);this.addSaveOpenClose();this.layoutController.initializeEvents(this.root);this.layoutController.initializeEventsOpenState(this.inPlayPreferences.InplayPreferences.OpenedEvents,this.root);this.layoutController.marketContainer.tryLoadDefaultEventMarket();this.isLoaded=true;},reInitUpcoming:function(){this.ReorderByLiveNow(this.inPlayPreferences.InplayPreferences.SportOrder);this.layoutController.initializeEvents(this.root);this.addSaveOpenClose();},initUpcoming:function(){this.root=this.layoutController.root.find("#ulUpcoming");this.layoutController.addShowHide("span.arrow",this.root.parent().find("span.header"),false);},initializeSportGroupOpenState:function(f){var c=this.root.children();for(var d=0;d<f.length;d++){var e=c.filter("#sport_"+f[d]);if(e.length>0){e.addClass("opened");}}},ReorderByLiveNow:function(e){var c=this.root.children();for(var d=e.length-1;d>=0;d--){var f=c.filter("#sport_"+e[d]);if(f.length>0){this.root.prepend(f);}}},addSaveOpenClose:function(){var c=this;this.root.find("span.arrow").unbind("click").click(function(){var f=$(this).parent();var e=f.parent();var d=c.layoutController.extractIdFromClass(e,"sport_");var g=e.hasClass("opened");if(g){e.removeClass("opened");c.preferencesController.removeOpenedUpcomingSport(d);}else{e.addClass("opened");c.preferencesController.addOpenedUpcomingSport(d);}});}};SB.inPlayApp.PriceUpdateController=function(d,c){this.root=d.root;this.layoutController=d;this.inPlayAppController=c;this.layout=d.layout;this.isExecuting=false;this.eventId=null;this.marketRoot=null;};SB.inPlayApp.PriceUpdateController.prototype={attachPriceDeltaUpdates:function(e){if(!this.layoutController.inPlayPreferences.AppPreferences.PriceUpdateEnabled){return;}var c=this;var d=new Number(this.layoutController.inPlayPreferences.AppPreferences.PriceUpdateRefreshRate)*1000;if(d<=0){return;}this.eventId=e;$.doTimeout("priceDeltaUpdates");$.doTimeout("priceDeltaUpdates",d,function(){if(c.isExecuting){return true;}var f=c.root.find("#column1 #priceCheckSum").val();if(f==null||f==""){return false;}c.isExecuting=true;c.inPlayAppController.getPriceDeltaUpdates(c,e,f,c.processPriceDeltaUpdates);return true;});},dispose:function(){$.doTimeout("priceDeltaUpdates");this.eventId=null;},processPriceDeltaUpdates:function(d,c){try{if(c==null||c.Id!=d.eventId){return;}if(c.Success&&c.HasChanges){d.marketRoot=d.root.find("#column1, #column2");if(c.CheckSum!=null){d.marketRoot.find("#priceCheckSum").val(c.CheckSum);}for(var e=0;e<c.DeltaUpdateItems.length;e++){var f=c.DeltaUpdateItems[e];switch(f.Status){case 7:d.changePrice(f);break;}}}}finally{d.isExecuting=false;}},changePrice:function(m){var e=m.GroupId;if(m.GroupId.substring(0,1)!="#"){e="#"+m.GroupId;}var g=this.marketRoot.find(e);if(g.length>0){var d=g.parent();var f=$(m.Html);var c=parseFloat(g.find("input.decValue").val());var k=parseFloat(f.find("input.decValue").val());g.replaceWith(f);this.layout.setupBetButtons(d);if(c!=k){var l=f.find("a.price");l.hide();if(c<k){this.animatePrice("priceUp",f);}else{this.animatePrice("priceDown",f);}l.fadeIn("slow");}}},animatePrice:function(d,f){var c=3000;var e=f.find(".priceChangeArrow");e.addClass(d);$.doTimeout(c,function(){e.removeClass(d);});}};function attatchToPricesLinks(){try{$("tr.normalRow").each(function(){new AddPriceButton(this);});}catch(c){}}$(document).ready(function(){attatchToPricesLinks();});SB.eventBrowsing.Indices=function(d){var c=-1;var g=-1;var k=-1;var f=-1;for(var e=0;e<d.length;e=e+1){if(d[e].id=="backButton"){c=e;}else{if(d[e].id=="forwardButton"){g=e;}else{if(c!=-1&&g==-1){if(k==-1&&d[e].style.display==""){k=e;}if(d[e].style.display==""){f=e;}}}}}this.backIndex=c;this.forwardIndex=g;this.firstVisible=k;this.lastVisible=f;};SB.eventBrowsing.scrollCells=function(g){var k=g;var c=k.parentNode.id;var q=k.parentNode.cells;var m=new SB.eventBrowsing.Indices(q);var l=m.backIndex;var o=m.forwardIndex;var f=m.firstVisible;var d=m.lastVisible;if(k.id=="forwardButton"&&d<o-1){d=d+1;q[d].style.display="";q[f].style.display="none";f=f+1;$.cookie("OUSP_"+c,f-l-1);}else{if(k.id=="backButton"&&f>l+1){q[d].style.display="none";d=d-1;f=f-1;q[f].style.display="";$.cookie("OUSP_"+c,f-l-1);}}SB.eventBrowsing.adjustBackButton(l,f,q);SB.eventBrowsing.adjustForwardButton(o,d,q);};SB.eventBrowsing.adjustBackButton=function(d,e,c){if(e-1==d){$("*",c[d]).css("display","none");}else{$("*",c[d]).css("display","");}};SB.eventBrowsing.adjustForwardButton=function(e,d,c){if(d+1==e){$("*",c[e]).css("display","none");}else{$("*",c[e]).css("display","");}};SB.eventBrowsing.deleteUnusedScrollPositionCookies=function(){if(document.cookie&&document.cookie!=""){var e=document.cookie.split(";");for(var d=0;d<e.length;d++){var f=e[d].split("=");var g=f[0].replace(/^ /,"");if(g.substr(0,5)=="OUSP_"){var c=g.substr(5);if($("#"+c).length==0){$.cookie(g,null);}}}}};SB.eventBrowsing.adjBackButton=function(f){var k=f;var d=k.parentNode.cells;var g=new SB.eventBrowsing.Indices(d);var c=g.backIndex;var l=g.firstVisible;SB.eventBrowsing.adjustBackButton(c,l,d);};SB.eventBrowsing.adjForwardButton=function(g){var l=g;var c=l.parentNode.cells;var k=new SB.eventBrowsing.Indices(c);var f=k.forwardIndex;var d=k.lastVisible;SB.eventBrowsing.adjustForwardButton(f,d,c);};SB.eventBrowsing.initializeOverUnderCoupon=function(){$("td#backButton",$("table#overUnderCoupon")).each(function(){SB.eventBrowsing.adjBackButton(this);});$("td#forwardButton",$("table#overUnderCoupon")).each(function(){SB.eventBrowsing.adjForwardButton(this);});};if(typeof SB=="undefined"){var SB=new Object();}if(typeof SB.betBasket=="undefined"){SB.betBasket=new Object();}if(typeof SB.betBasket.ui=="undefined"){SB.betBasket.ui=new Object();}if(typeof SB.ui=="undefined"){SB.ui=new Object();}SB.betBasket.Basket=function(d){this.div=d;this.setupVisibilityOfEmptyBasket();this.setupBasket();this.url="/misc/webServices/betBasket/BetBasketHtmlService.ashx";var c=this;SB.EventHub.bind("login-status",function(e){if(c!=e){c.load();}});SB.EventHub.bind("addItemToBetSlip",function(e){c.addFromFlash(e.bookId,e.selectionId,e.price);});};SB.betBasket.Basket.prototype={load:function(){this.callServer({action:"load"});},createTaxHelper:function(){var c=$("#taxDutyBase").val();if(c==undefined){this.taxHelper=new SB.betBasket.NoTaxHelper(this);}else{if(c=="WINNING"){this.taxHelper=new SB.betBasket.TaxOnWinHelper(this);}else{if(c=="STAKE"){this.taxHelper=new SB.betBasket.TaxOnStakeHelper(this);}else{if(c=="RETURN"){this.taxHelper=new SB.betBasket.TaxOnReturnHelper(this);}else{if(c=="TOTALSTAKE"){this.taxHelper=new SB.betBasket.TaxOnTotalStakeHelper(this);}}}}}return this.taxHelper;},switchTab:function(c){this.callServer({action:"switchTab",tab:c});},add:function(e){if(this.getCurrentTab()=="FixedTeaser"){this.addClean(e);}else{var d=this.targetAreas();var c=[d.notificationMessage,d.appendUserItems,d.selectionCount,d.redPopup,d.suggestedItems,d.totals,d.basketPopup,d.trackBetPlacement];this.callServer({action:"add",selection:e},c);}},addClean:function(c){this.callServer({action:"addClean",selection:c,tab:"Multiples"});},addFromFlash:function(e,c,d){this.callServer({action:"addFromFlash",bookId:e,selectionId:c,price:d,tab:"Multiples"});},replace:function(e,d,c){this.callServer({action:"replace",selection:d,old:e},c);},remove:function(c){this.callServer({action:"remove",selection:c});},removeAll:function(){this.callServer({action:"removeAll"});},selectAll:function(d,c){this.callServer({action:"selectAllItemsForCombination"});},toggle:function(e,d,c){this.callServer({action:"toggleItemForCombinations",selection:e,combinationToggle:d},c);},updateStake:function(e,c,d){this.callServer({action:"updateStake",selection:e,stake:c},d);},selectFreeBetVoucher:function(d,e,c){this.callServer({action:"selectFreeBetVoucher",selection:d,voucherId:e});},placeBets:function(c){this.disablePlaceButton();this.callServer({action:"placeBet",confirmed:c});},placeOneClickBet:function(e,c,d){this.callServer({action:"placeOneClickBet",selection:e,stake:c},undefined,d);},continueBetting:function(d){if(d){this.switchTab();}else{var c=$('div#basketReceipt input[name="basketItemCode"]',this.div).map(function(){return this.value;}).get().toString();this.remove(c);}},toNumber:function(d){var c=Number(d);if(!isNaN(c)){return c;}return 0;},updateTotals:function(){var c=this;c.taxHelper.updateTotals();},processing:0,maxConcurrent:1,queue:[],setInProgress:function(c){if(c){this.processing++;}else{$("a.addingBet").removeClass("addingBet");this.setupPlaceButton();this.clearBusy();this.processing--;}},isInProgress:function(){return this.processing>=this.maxConcurrent;},setBusy:function(c){this.clearBusy();$(c).addClass("basketBusy");$(this.div).addClass("basketBusy");},clearBusy:function(){$(".basketBusy").removeClass("basketBusy");},callServer:function(d,c,e){this.removeNotifications();if(!d.tab){d.tab=this.getCurrentTab();}if(this.isInProgress()){this.addToQueue(d,c,e);}else{this.setInProgress(true);this.startGomezAjaxTracking1();this.processRequest(d,c,e);this.endGomezAjaxTracking1();}},addToQueue:function(e,d,f){if(e.action=="removeAll"){this.queue=[];}if(this.queue.length>0){var c=this.queue[this.queue.length-1][0];if((c.action=="add"&&e.action=="add")||(c.action=="remove"&&e.action=="remove")){c.selection=c.selection+","+e.selection;}else{this.queue.push(arguments);}}else{this.queue.push(arguments);}},processRequest:function(f,c,g){var d=this;var e={type:"POST",url:this.url,data:f,timeout:45000,traditional:true,success:function(l,k){d.handlerSuccess(l,k,c);},error:function(){d.handlerFailure();},complete:function(){if(g){g();}}};jQuery.ajax(e);},handlerSuccess:function(e,d,c){this.updateHtml(e,d,c);this.setupSelectAllLink();this.processQueue();this.addGomezTag();},handlerFailure:function(){this.hideProgress();this.showClientFailureMessage();this.processQueue();},startGomezAjaxTracking1:function(){new SB.ui.startGomezAjaxTracking("bet basket html service");},endGomezAjaxTracking1:function(){new SB.ui.endGomezAjaxTracking("bet basket html service");},showClientFailureMessage:function(){$(this.div).prepend('<span id="lblErrorMessage" class="error notification">Sorry, the website is experiencing problems. Please contact Customer Services on 0800 028 0348.</span>');this.scrollErrorMessageIntoView();},processQueue:function(){if(this.queue.length>0){var c=this.queue.shift();this.processRequest.apply(this,c);}else{this.setInProgress(false);}},getCurrentTab:function(){return $("ul.tabs li.selected",this.div).attr("id");},updateHtml:function(e,d,c){var f=$("span#lblErrorMessage","<div>"+e+"</div>").length==0;if(f&&c){this.updateTargetedHtml(e,c);this.setupVisibilityOfEmptyBasket();}else{$(this.div).html(e);}this.setupBasket();this.trackBetPlacementResult();SB.promotions.FreeBetVoucher.initializeTooltip();this.scrollErrorMessageIntoView();},scrollErrorMessageIntoView:function(){if($("#lblErrorMessage").length&&!SB.base.isScrolledIntoView("#lblErrorMessage")){$("html, body").animate({scrollTop:$("#lblErrorMessage").offset().top-50},500);}},updateTargetedHtml:function(e,c){var d=this;jQuery.each(c,function(){this.action(d,e);});},replaceHtml:function(e,f,d){if(d==null){d=f;f=e;}var c=this;var g=$(e,d);$(f,c.div).html(g.html());},removeHtml:function(c){$(c,self.div).remove();},appendHtml:function(d,c,f){var e=this;$(d,f).each(function(){$(c,e.div).append($(this));});},updateValue:function(d,e,c){var f=$(d,c);$(e,this.div).each(function(){$(this).val(f.val());});},removeNotifications:function(){$(".notification",this.div).remove();jQuery.each(this.items,function(){this.removeNotifications();});$("div#basketReceipt",this.div).remove();},addGomezTag:function(){new SB.ui.addGomezTag("bet basket html service");},setupBasket:function(){var c=this;this.createTaxHelper();this.items=[];this.setupUserItems();this.setupSuggestedItems();this.setupRemoveAllButton();this.setupSelectAllButton();this.setupSelectAllLink();this.setupTabs();this.setupPlaceButton();this.setupContinueButton();this.setupPrintButton();this.setupHistoryButton();this.taxHelper.toggleVisibilityOfTaxFields();this.showNotificationAlert();this.showConfirmationBox();this.showConfirmationPopup();this.showTooltip();this.showPopup();this.triggerBalanceRefresh();this.triggerUserStateRefresh();this.setupTooltips();this.setupFormatter();this.div.basket=this;},setupFormatter:function(){var c=$("input.currencyCode",this.div).val();var d=$("input.currencyFormat",this.div).val();this.formatter=new SB.ui.FormattingUtil(d,c);},setupUserItems:function(){var c=this;$("ul.userItems li.basketItem",c.div).each(function(){c.items.push(new SB.betBasket.BasketItem(this,c));});},setupSuggestedItems:function(){var c=this;$("ul.suggestedItems li.basketItem",c.div).each(function(){c.items.push(new SB.betBasket.BasketItem(this,c));});},setupRemoveAllButton:function(){var c=this;$("a.removeAll",this.div).unbind("click").click(function(){c.removeAll();return false;});},setupSelectAllLink:function(){var c=this;if($("input.includeInSuggested",this.div).length==0){$("a.selectAll",this.div).attr("style","visibility:hidden;");}else{$("a.selectAll",this.div).attr("style","visibility:visible;");}},setupSelectAllButton:function(){var c=this;$("a.selectAll",this.div).unbind("click").click(function(){c.selectAll();return false;});},setupTabs:function(){var c=this;$("a.tab",this.div).unbind("click").click(function(){c.switchTab($(this).attr("rel"));});},setupPlaceButton:function(){var c=this;$("input.buy",this.div).removeClass("placingBet").unbind("click").click(function(){c.placeBets(false);});$("input.buy",this.div).removeClass("placingBet").unbind("confirmPlaceBet").bind("confirmPlaceBet",function(){c.showProgress();c.trackPlaceBets();c.placeBets(true);});},disablePlaceButton:function(){$("input.buy",this.div).unbind("click").addClass("placingBet");},setupContinueButton:function(){var c=this;$("input.continue").unbind("click").click(function(){c.continueBetting($("input.keepItems")[0].checked);});},setupHistoryButton:function(){var c=this;$("a.history").unbind("click").click(function(){if($("div#content.mini").length>0){window.open(this.href,"SportingbetWeb");return false;}c.showAccountHistoryWindow();return false;});},setupPrintButton:function(){var c=this;$("input.print").unbind("click").click(function(){c.showPrintWindow();});},setupTooltips:function(){$(".toolTipPopup",this.div).unbind("hover").hover(function(){var d=$(this).position().top-$(".displayMe",this).height()-5;var c=$(this).position().left;$(".displayMe",this).css("top",d).css("left",c).show();},function(){$(".displayMe",this).hide();});},showNotificationAlert:function(){$('input[name="NotificationMessage"]',this.div).each(function(){window.alert(this.value);});},showConfirmationBox:function(){var c=this;$('input[name="confirmationMessage"]').each(function(){if(window.confirm(this.value)){c.showProgress();c.trackPlaceBets();c.placeBets(true);}});},showConfirmationPopup:function(){var c=this;$("#confirmationPopup").each(function(){$("#popLayer1").html($("#confirmationPopup").html());$(this).remove();$("#btnConfirm").click(function(){SB.base.divPopUp(1,"hide");c.showProgress();c.trackPlaceBets();c.placeBets(true);});SB.base.divPopUp(1,"show");});},showTooltip:function(){var c=this;$("li.lastAdded:last-child ul.itemDescription",this.div).each(function(){var d=$(this).clone();if($("li span.eventIdentifier",d).length>2){$("li span.eventIdentifier",d).remove();$("li span.marketName",d).remove();}$(d).append("<li>Selection added to Betting Slip.</li>");SB.alert($(d).outerHTML());});},showPopup:function(){$('input[name="popUpMessage"]',this.div).each(function(){var c=$(this).val();if(c!=null){if($('input[name="onHttps"]',this.div).val()=="true"){SB.base.OpenDivCheckLoginStatus(c,"popBadSelect1","popVeil1","popLayer1",false);$(this).remove();}else{SB.base.deferWindowCommand(c,"popup",false);}}});},triggerBalanceRefresh:function(){var c=this;$('input[name="refreshBalance"]:first',c.div).each(function(){SB.EventHub.trigger("balance-refresh",c);});},triggerUserStateRefresh:function(){var c=this;$('input[name="refreshUserState"]:first',c.div).each(function(){SB.EventHub.trigger("user-state-refresh",c);});},clearMessages:function(){var c=this;$("span#lblErrorMessage",c.div).hide();},trackPlaceBets:function(){this.trackEvent("Attempt Bet Placement");},trackEvent:function(d){try{new SB.ui.WebTrends().trackUserEvent(d,"Bet Placement",d);}catch(c){}},trackBetPlacementResult:function(){var c=this;$('input[name="webTrendsInfo"]').each(function(){c.trackEvent(this.value);});},showProgress:function(){var e=this.div.scrollWidth;var c=this.div.scrollHeight;$("div#betPlacementProgress",this.div).width(e).height(c).bgiframe().show();$("div#betPlacementProgressEmpty",this.div).width(e).height(c).bgiframe().show();$("div#betPlacementProgressClean",this.div).width(e).height(c).bgiframe().show();var d=$("div#betPlacementProgressEmpty div.center",this.div).get(0).scrollHeight/-2;$("div#betPlacementProgressEmpty div.center",this.div).css("margin-top",d);var d=$("div#betPlacementProgressClean div.center",this.div).get(0).scrollHeight/-2;$("div#betPlacementProgressClean div.center",this.div).css("margin-top",d);this.showInRunning();},hideProgress:function(){$("div#betPlacementProgress").hide();$("div#betPlacementProgressEmpty").hide();$("div#betPlacementProgressClean").hide();},showInRunning:function(){$("span#bsktMsgInRunningCnt").each(function(){var c=$(this).html();if(c){c--;var d=setInterval(function(){if($("div#betPlacementProgress").is(":visible")||$("div#betPlacementProgressEmpty").is(":visible")||$("div#betPlacementProgressClean").is(":visible")){$("span#bsktMsgInRunningCnt").html(c.toString());if(c--==0){clearInterval(d);}}},1000);}});},showPrintWindow:function(){var c=window.open("/BetPrintReceipt.mvc/Display","PrintReceipt","width=350,height=500,status=yes,resizable=yes,top=0,left=0,scrollbars=yes");},showAccountHistoryWindow:function(){ShowPopup("/t/history/HistoryPopUp.aspx","/t/customer/myaccount.aspx?useraction=my_history");},setupVisibilityOfEmptyBasket:function(){if($("ul.userItems li.basketItem, div#basketReceipt",this.div).length>0){$("div#betSlipEmpty",this.div).addClass("notEmptyBasket");$("div#basketSlip",this.div).removeClass("notVisible");}else{$("div#betSlipEmpty",this.div).removeClass("notEmptyBasket");$("div#basketSlip",this.div).addClass("notVisible");}},indexOf:function(e){var c=this;var d=$("li.basketItem",c.div).get();return jQuery.inArray(e,d);},targetAreas:function(c){return{appendUserItems:{selector:"ul.userItems li.basketItem:not(.duplicate)",action:function(e,d){e.appendHtml(this.selector,"ul.userItems",d);}},suggestedItems:{selector:"div.suggestedItems",action:function(e,d){e.replaceHtml(this.selector,d);}},totals:{selector:"ul.totals",action:function(e,d){e.replaceHtml(this.selector,d);}},thisItem:{source:"li.basketItem",target:"li.basketItem:eq("+c+")",action:function(e,d){e.replaceHtml(this.source,this.target,d);}},potentialPayout:{source:"li.basketItem div.potentialPayout",target:"li.basketItem:eq("+c+") div.potentialPayout",action:function(e,d){e.replaceHtml(this.source,this.target,d);}},stakeField:{source:"li.basketItem input.amount",target:"li.basketItem:eq("+c+") input.amount",action:function(e,d){e.updateValue(this.source,this.target,d);}},redPopup:{selector:"div.popup",action:function(e,d){e.appendHtml(this.selector,"div#basketSlip",d);}},selectionCount:{selector:"span.hasSelections",action:function(e,d){e.replaceHtml(this.selector,d);}},notificationMessage:{selector:"input[name='NotificationMessage']",action:function(e,d){e.appendHtml(this.selector,"div#basketSlip",d);}},basketPopup:{selector:"input[name='popUpMessage']",action:function(e,d){e.removeHtml(this.selector);}},trackBetPlacement:{selector:"div.trackWTAddBet",action:function(e,d){if($("input[name='NotificationMessage']").val()==undefined){e.appendHtml(this.selector,"div#basketSlip",d);}}},confirmationPopup:{selector:"div.confirmationPopup",action:function(e,d){e.replaceHtml(this.selector,d);}}};}};SB.betBasket.NoTaxHelper=function(c){this.basket=c;};SB.betBasket.NoTaxHelper.prototype={totalCost:function(){var c=this.basket;var d=0;jQuery.each(c.items,function(){d+=this.cost();});return d;},totalPotentialPayout:function(){var d=this.basket;var c=0;jQuery.each(d.items,function(){c+=this.potentialPayout();});return c;},totalTaxDeduction:function(){return 0;},updateTotals:function(){var d=this.basket;var f=this.totalTaxDeduction();var c=this.totalPotentialPayout();$("ul.totals span.totalPotentialPayout span.currency",d.div).removeClass("hidden");if(isNaN(c)){$("ul.totals span.totalPotentialPayout span.currency",d.div).addClass("hidden");}else{c=c;}var e=d.formatter.formatCurrencyWithoutCode(this.totalCost());var g=d.formatter.formatCurrencyWithoutCode(c);$("ul.totals span.totalCost span.amountValue",d.div).text(e);$("ul.totals span.totalPotentialPayout span.amountValue",d.div).text(g);},toggleVisibilityOfTaxFields:function(){}};SB.betBasket.TaxOnWinHelper=function(c){this.basket=c;};SB.betBasket.TaxOnWinHelper.prototype={totalCost:function(){var c=this.basket;var d=0;jQuery.each(c.items,function(){d+=this.cost();});return d;},totalPotentialPayout:function(){var d=this.basket;var c=0;jQuery.each(d.items,function(){c+=this.potentialPayout();});return c;},totalTaxDeduction:function(){var c=this.basket;var d=0;jQuery.each(c.items,function(){d+=this.taxDeduction();});return d;},updateTotals:function(){var d=this.basket;var f=this.totalTaxDeduction();var c=this.totalPotentialPayout();$("ul.totals span.totalPotentialPayout span.currency",d.div).removeClass("hidden");if(isNaN(c)){$("ul.totals span.totalPotentialPayout span.currency",d.div).addClass("hidden");}else{f=Number(f.toFixed(2));c=c-f;}var e=d.formatter.formatCurrencyWithoutCode(this.totalCost());var k=d.formatter.formatCurrencyWithoutCode(f);var g=d.formatter.formatCurrencyWithoutCode(c);$("ul.totals span.totalCost span.amountValue",d.div).text(e);$("ul.totals span.totalPotentialPayout span.amountValue",d.div).text(g);$("ul.totals span.taxDeduction span.amountValue",d.div).text(k);this.toggleVisibilityOfTaxFields();},toggleVisibilityOfTaxFields:function(){var d=this;var e=$("ul.totals li.taxDeduction",this.div);var g=$("div.footer span.taxDeductionSP",this.div);if(e.length>0){g.hide();e.hide();var c=this.totalPotentialPayout();if(isNaN(c)){g.show();}else{var f=this.totalTaxDeduction();if(c>0&&f>0){e.show();}}}}};SB.betBasket.TaxOnReturnHelper=function(c){this.basket=c;};SB.betBasket.TaxOnReturnHelper.prototype={totalCost:function(){var c=this.basket;var d=0;jQuery.each(c.items,function(){d+=this.cost();});return d;},totalPotentialPayout:function(){var d=this.basket;var c=0;jQuery.each(d.items,function(){c+=this.potentialPayout();});return c;},totalTaxDeduction:function(){var c=this.basket;var d=0;jQuery.each(c.items,function(){d+=this.taxDeduction();});return d;},updateTotals:function(){var d=this.basket;var f=this.totalTaxDeduction();var c=this.totalPotentialPayout();$("ul.totals span.totalPotentialPayout span.currency",d.div).removeClass("hidden");if(isNaN(c)){$("ul.totals span.totalPotentialPayout span.currency",d.div).addClass("hidden");}else{f=Number(f.toFixed(2));c=c-f;}var e=d.formatter.formatCurrencyWithoutCode(this.totalCost());var k=d.formatter.formatCurrencyWithoutCode(f);var g=d.formatter.formatCurrencyWithoutCode(c);$("ul.totals span.totalCost span.amountValue",d.div).text(e);$("ul.totals span.totalPotentialPayout span.amountValue",d.div).text(g);$("ul.totals span.taxDeduction span.amountValue",d.div).text(k);this.toggleVisibilityOfTaxFields();},toggleVisibilityOfTaxFields:function(){var d=this;var e=$("ul.totals li.taxDeduction",this.div);var g=$("div.footer span.taxDeductionSP",this.div);if(e.length>0){g.hide();e.hide();var c=this.totalPotentialPayout();if(isNaN(c)){g.show();}else{var f=this.totalTaxDeduction();if(c>0&&f>0){e.show();}}}}};SB.betBasket.TaxOnStakeHelper=function(c){this.basket=c;};SB.betBasket.TaxOnStakeHelper.prototype={totalCost:function(){var c=this.basket;var d=0;jQuery.each(c.items,function(){d+=this.cost();});return d;},totalPotentialPayout:function(){var d=this.basket;var c=0;jQuery.each(d.items,function(){c+=this.potentialPayout();});return c;},totalTaxDeduction:function(){var c=this.basket;var d=0;jQuery.each(c.items,function(){d+=this.taxDeduction();});return d;},totalCostWithTax:function(){var c=this.basket;var d=0;jQuery.each(c.items,function(){d+=this.cost()+this.taxDeduction();});return d;},updateTotals:function(){var e=this.basket;var g=this.totalTaxDeduction();var c=this.totalPotentialPayout();$("ul.totals span.totalPotentialPayout span.currency",e.div).removeClass("hidden");if(isNaN(c)){$("ul.totals span.totalPotentialPayout span.currency",e.div).addClass("hidden");}var l=this.totalCost();var d=e.formatter.formatCurrencyWithoutCode(l+g);var f=e.formatter.formatCurrencyWithoutCode(l);var m=e.formatter.formatCurrencyWithoutCode(g);var k=e.formatter.formatCurrencyWithoutCode(c);$("ul.totals span.totalCost span.amountValue",e.div).text(d);$("ul.totals span.cost span.amountValue",e.div).text(f);$("ul.totals span.totalPotentialPayout span.amountValue",e.div).text(k);$("ul.totals span.taxDeduction span.amountValue",e.div).text(m);this.toggleVisibilityOfTaxFields();},toggleVisibilityOfTaxFields:function(){var c=this;var f=$("ul.totals li.cost");var d=$("ul.totals li.taxDeduction",this.div);var g=$("div.footer span.taxDeductionSP",this.div);if(d.length>0){g.hide();d.hide();f.hide();var e=this.totalTaxDeduction();if(isNaN(e)){g.show();}else{if(e>0){d.show();f.show();}}}}};SB.betBasket.TaxOnTotalStakeHelper=function(c){this.basket=c;};SB.betBasket.TaxOnTotalStakeHelper.prototype={totalCost:function(){var c=this.basket;var d=0;jQuery.each(c.items,function(){d+=this.cost();});return d;},totalPotentialPayout:function(){var d=this.basket;var c=0;jQuery.each(d.items,function(){c+=this.potentialPayout();});return c;},totalTaxDeduction:function(){var c=this.basket;var d=0;jQuery.each(c.items,function(){d+=this.taxDeduction();});return d;},totalRealStake:function(){var c=this.basket;var d=0;jQuery.each(c.items,function(){d+=c.toNumber(this.realStake()*(this.isEachWay()?2:1));});return d;},updateTotals:function(){var o=this.basket;var l=this.totalPotentialPayout();$("ul.totals span.totalPotentialPayout span.currency",o.div).removeClass("hidden");if(isNaN(l)){$("ul.totals span.totalPotentialPayout span.currency",o.div).addClass("hidden");}var c=this.totalCost();var g=this.totalRealStake();var e=c-g;var f=o.formatter.formatCurrencyWithoutCode(c);var k=o.formatter.formatCurrencyWithoutCode(e);var m=o.formatter.formatCurrencyWithoutCode(l);var d=o.formatter.formatCurrencyWithoutCode(g);$("ul.totals span.totalCost span.amountValue",o.div).text(f);$("ul.totals span.cost span.amountValue",o.div).text(f);$("ul.totals span.totalPotentialPayout span.amountValue",o.div).text(m);$("ul.totals span.taxDeduction span.amountValue",o.div).text(k);$("ul.totals span.totalRealStake span.amountValue",o.div).text(d);this.toggleVisibilityOfTaxFields();},toggleVisibilityOfTaxFields:function(){var c=this;var f=$("ul.totals li.cost");var d=$("ul.totals li.taxDeduction",this.div);var g=$("div.footer span.taxDeductionSP",this.div);if(d.length>0){g.hide();d.hide();f.hide();var e=this.totalTaxDeduction();if(isNaN(e)){g.show();}else{if(e>0){d.show();f.show();}}}}};SB.betBasket.BasketItem=function(d,c){this.div=d;this.basket=c;this.setupRemoveButton();this.setupSelectButton();this.setupStakeInput();this.setupEachWay();this.setupTeaser();this.fixHeight();this.repositionOptions();};SB.betBasket.BasketItem.prototype={getBetCode:function(){return $("input.basketItemCode",this.div).val();},getAmount:function(){var c=Number($("input.amount",this.div).val());return(isNaN(c)?0:c);},replace:function(c){var d=this.getBetCode();this.basket.replace(d,c);},remove:function(){var c=this.getBetCode();this.basket.remove(c);},toggle:function(e){var f=this.getBetCode();var d=this.basket.targetAreas(this.basket.indexOf(this.div));var c=[d.suggestedItems,d.totals];this.basket.toggle(f,e,c);},updateStake:function(){var c=this.getAmount();var d=this.getBetCode();this.basket.updateStake(d,c,[]);},formatStake:function(){var c=$("input.amount",this.div);var d=this.basket.formatter.formatNumeric(c.val());c.val((d==0?"":d));},updateTaxDeductionItem:function(){var c=this;var d=c.taxDeduction();$("div.taxDeductionItem span.currency",c.div).removeClass("hidden");if(isNaN(d)){$("div.taxDeductionItem span.currency",c.div).addClass("hidden");}var e=this.basket.formatter.formatCurrencyWithoutCode(d);$("div.taxDeductionItem span.amountValue",c.div).text(e);},updateRealStake:function(){var c=this;var d=c.realStake();var f=$("input.costFactor",c.div).val();d*=f;$("div.realStake span.currency",c.div).removeClass("hidden");if(isNaN(d)){$("div.realStake span.currency",c.div).addClass("hidden");}var e=this.basket.formatter.formatCurrencyWithoutCode(d);$("div.realStake span.amountValue",c.div).text(e);},updatePotentialPayout:function(){var c=this;var d=c.potentialPayout();$("div.potentialPayout span.currency",c.div).removeClass("hidden");if(isNaN(d)){$("div.potentialPayout span.currency",c.div).addClass("hidden");}var e=this.basket.formatter.formatCurrencyWithoutCode(d);$("div.potentialPayout span.amountValue",c.div).text(e);},potentialPayout:function(){var e=this;var d=$("input.potentialPayoutFactor",e.div).val();var c=$("input.amount",e.div).val();if(c==""){return 0;}if(d!=undefined){var f=d*e.realStake();if(isNaN(f)){f=0;}return f;}return NaN;},realStake:function(){var e=this;var c=$("input.amount",e.div).val();if(c==""){return 0;}var g=$("#taxDutyBase").val();if(g!="TOTALSTAKE"){return c;}var f=$("input.tax",e.div).val()/100;var d=$("input.levy",e.div).val()/100;c=Math.floor(c/(f+d+1)*100)/100;return c.toFixed(2);},isEachWay:function(){var c=this;isEachWay=$("input.basketItemEachWay",c.div).attr("checked");return isEachWay;},cost:function(){var c=this;var d=$("input.amount",c.div).val()*$("input.costFactor",c.div).val();if(isNaN(d)){d=0;}return d;},taxDeduction:function(){var d=this;var f=$("input.tax",d.div).val()/100;var c=$("input.levy",d.div).val()/100;var l=$("#taxDutyBase").val();var m=$("input.amount",d.div).val();var k=$("input.costFactor",d.div).val();var g=null;m*=k;if(l=="WINNING"){f=((this.potentialPayout()-m)*f);c=((this.potentialPayout()-m)*c);}else{if(l=="STAKE"){f=m*f;c=m*c;}else{if(l=="TOTALSTAKE"){var e=this.realStake();e*=k;g=m-e;}else{if(l=="RETURN"){f=this.potentialPayout()*f;c=this.potentialPayout()*c;}}}}if(g==null){g=Number(f.toFixed(2))+Number(c.toFixed(2));}if(isNaN(g)){g=0;}return g;},updatePotentialPayoutFactor:function(d,e){var c=this;$("input.potentialPayoutFactor",c.div).val(d);$("input.costFactor",c.div).val(e);c.updatePotentialPayout($("input.amount",c.div).val());},removeNotifications:function(){$(this.div).removeClass("lastAdded").removeClass("duplicate");},setupRemoveButton:function(){var c=this;$("input.remove",this.div).unbind("click").click(function(){c.basket.setBusy(this);c.remove();return false;});},setupEachWay:function(){var c=this;$("input.basketItemEachWay",this.div).unbind("click").click(function(){c.basket.setBusy(this);var d=c.swapAttributeValue("factor");var e=c.swapAttributeValue("costFactor");c.updatePotentialPayoutFactor(d,e);c.replace(this.value);c.swapAttributeValue("value");});},swapAttributeValue:function(e){var d=this;var k=$("input.basketItemCode",d.div);var c=$("input.basketItemEachWay",d.div);var g=k.attr(e);var f=c.attr(e);k.attr(e,f);c.attr(e,g);return f;},setupTeaser:function(){var c=this;$("select.teaserOptions",this.div).unbind("change").change(function(){c.updatePotentialPayoutFactor($(":selected",this).attr("factor"),$(":selected",this).attr("costFactor"));c.replace(this.value);});},setupSelectButton:function(){var c=this;$("input.includeInSuggested",this.div).unbind("click").click(function(){if($(c.div).is(".betState-SelectionNotAvailable")){this.checked=false;}else{c.basket.setBusy(this);c.toggle(this.checked);}});},setupStakeInput:function(){var c=this;$("input.amount",this.div).unbind("keyup").keyup(function(){c.updatePotentialPayout();c.updateRealStake();c.updateTaxDeductionItem();c.basket.updateTotals();c.stakeChanged();}).unbind("change").change(function(){c.formatStake();}).unbind("keypress").keypress(function(d){if(d.keyCode==13){this.blur();return false;}}).preventInvalidCharacters(/^(\d*\.?\d*)$/);},timeoutId:-1,delay:250,stakeChanged:function(){if(this.timeoutId!=-1){window.clearTimeout(this.timeoutId);}var c=this;this.timeoutId=window.setTimeout(function(){c.updateStake();},this.delay);},repositionOptions:function(){var c=this;var d=2;var e=$("li.selection :first",c.div).position();if(e){d=e.top;}$("label.basketItemCode",c.div).css("top",d);$("select.teaserOptions",c.div).css("top",d);},fixHeight:function(){$("div.amount",this.div).each(function(){var c=$(this).height();var d=$(this).parent().height();if(c>d){$(this).parent().height(c+5);}});}};SB.betBasket.AddButton=function(c,d){this.anchor=c;this.basket=d;this.setupAnchor();this.setupHover();};SB.betBasket.AddButton.prototype={setupAnchor:function(){var c=this;$(c.anchor).unbind("click").click(function(d){c.click(d);return false;});},setupHover:function(){var c=this;$(c.anchor).hover(function(){var d=$(".formattedPrice",$(this).parent()).html();HelpTip.ShowOddsTip(this,d);},function(){HelpTip.HideOddsTip();});},click:function(c){var d=this.getBetCode();this.displayBetAddingFeedback();SB.Mouse.savePosition();this.basket.add(d);},displayBetAddingFeedback:function(){$("a.addingBet").removeClass("addingBet");$(this.anchor).addClass("addingBet");},getBetCode:function(){return $('input[type="hidden"].betCode',this.anchor).val();}};function addBetSelection(d,e){SB.Mouse.savePosition();var c=$("div#betBasket").get(0).basket;if(e==null){c.add(d);}else{c.add(e);}}if(typeof SB.eventBrowsing=="undefined"){SB.eventBrowsing={};}SB.eventBrowsing.ForecastTable=function(e,d,c){this.div=e;this.basket=d;this.setupForecastTricastLink();this.isBound=false;this.rowPosition=c;if(c==0){this.setupBindings();$("#"+this.div.id).show();}};SB.eventBrowsing.ForecastTable.prototype={submit:function(){var c=this;$("form.forcastTricastForm",c.div).ajaxSubmit({target:"#betBasket",beforeSubmit:function(){return c.validateForm();},success:function(e,d){c.basket.updateHtml(e,d);c.reset();}});},reset:function(){var c=this;$("form.forcastTricastForm",c.div)[0].reset();$("form.forcastTricastForm input:checkbox:checked",c.div).not(":radio").uncheck();$(".NoOfBetTh",c.div).children("div").html("0");},validateForm:function(){var c=this;if($("table.ForecastTricast input:checked",c.div).length==0){return false;}if($("td.Fcc input:checked",c.div).length>0&&$("td.Fcc input:checked",c.div).length<2){var d=$("#errorMessageFC").val();if(!d){d="You need to select more than one runner to place a Forecast";}alert(d);return false;}if($("td.Tcc input:checked",c.div).length>0&&$("td.Tcc input:checked",c.div).length<3){var d=$("#errorMessageTC").val();if(!d){d="You need to select more than two runner to place a Tricast";}alert(d);return false;}return true;},setupResetButton:function(){var c=this;$("ul.FCResetButton a",c.div).unbind("click").click(function(){c.reset();});},setupAddBetButton:function(){var c=this;$("ul.FCBetButton a",c.div).unbind("click").click(function(){SB.Mouse.savePosition();c.submit();});},setupForecastGroup:function(){var c=this;this.forecastGroup=new SB.eventBrowsing.ForecastGroup(c.div,"td.Fcc",".forecastNumberOfBets",2);},setupTricastGroup:function(){var c=this;this.tricastGroup=new SB.eventBrowsing.ForecastGroup(c.div,"td.Tcc",".tricastNumberOfBets",3);},setupForecastTricastLink:function(){var d=this.div.id.replace("priceFC","linkFCTC");var c=this;$("#"+d).click(function(){c.setupBindings();var e=this.id.replace("linkFCTC","priceFC");$("#"+e).show();});if(this.rowPosition==0){$("#"+d).show();}},setupBindings:function(){if(!this.isBound){this.setupResetButton();this.setupAddBetButton();this.setupForecastGroup();this.setupTricastGroup();this.isBound=true;}},recalculateNoOfBets:function(){this.forecastGroup.recalculateNoOfBets();this.tricastGroup.recalculateNoOfBets();}};SB.eventBrowsing.ForecastGroup=function(e,c,f,d){this.parentDiv=e;this.tdClass=c;this.betCounter=f;this.numberOfSelectionsNeed=d;this.setupRows();};SB.eventBrowsing.ForecastGroup.prototype={setupRows:function(){var c=this;$(c.tdClass+" input[type='checkbox']",c.parentDiv).unbind("click").click(function(g){var d=$("table.ForecastTricast tbody tr",c.parentDiv).index($(this).parents("tr"));var f=$(g.target);if(f.hasClass("first-place")){c.toggle1stPlace(f,d);}if(f.hasClass("second-place")){c.toggle2ndPlace(f,d);}if(f.hasClass("third-place")){c.toggle3rdPlace(f,d);}if(f.hasClass("any-place")){c.toggleAnyPlace(f,d);}});},toggle1stPlace:function(d,c){this.toggleGroup(d,this.tdClass+" input.first-place");this.toggleGroup(d,this.tdClass+" input.any-place");this.toggleGroup(d,this.tdClass+" input.row-group"+c);this.updatePlacedNumberOfBets(this.tdClass+" input.placed");},toggle2ndPlace:function(d,c){this.toggleGroup(d,this.tdClass+" input.second-place");this.toggleGroup(d,this.tdClass+" input.any-place");this.toggleGroup(d,this.tdClass+" input.row-group"+c);this.updatePlacedNumberOfBets(this.tdClass+" input.placed");},toggle3rdPlace:function(d,c){this.toggleGroup(d,this.tdClass+" input.third-place");this.toggleGroup(d,this.tdClass+" input.any-place");this.toggleGroup(d,this.tdClass+" input.row-group"+c);this.updatePlacedNumberOfBets(this.tdClass+" input.placed");},toggleAnyPlace:function(d,c){this.toggleGroup(d,this.tdClass+" input.placed");this.toggleGroup(d,this.tdClass+" input.row-group"+c);this.updateAnyNumberOfBets(this.tdClass+" input.any-place");},toggleGroup:function(d,f){var c=this;var e=$(d).attr("checked");$(f,c.parentDiv).attr("checked",false);$(d).attr("checked",e);},updateAnyNumberOfBets:function(f){var c=this;var d=$(f,c.parentDiv).filter(function(){return $(this).attr("checked");}).length;var e=d<c.numberOfSelectionsNeed?0:c.calculateNumberOfBets(d);$(c.betCounter,c.parentDiv).empty().append(e+"");},calculateNumberOfBets:function(e){var c=this;var f=1;for(var d=0;d<c.numberOfSelectionsNeed;d++){f=f*(e-d);}return f;},updatePlacedNumberOfBets:function(f){var c=this;var d=$(f,c.parentDiv).filter(function(){return $(this).attr("checked");}).length;var e=d==c.numberOfSelectionsNeed?1:0;$(c.betCounter,c.parentDiv).empty().append(e+"");return e;},recalculateNoOfBets:function(){if(this.updatePlacedNumberOfBets(this.tdClass+" input.placed")==0){this.updateAnyNumberOfBets(this.tdClass+" input.any-place");}}};SB.eventBrowsing.ScoreCastController=function(c){this.parentDiv=c;this.setupEventFilters();};SB.eventBrowsing.ScoreCastController.prototype={setupEventFilters:function(){var c=$("select.goalScorers option:selected").attr("class");$("."+c).show();$("select.goalScorers").unbind().change(function(){var d=$("option:selected",this).attr("class");var e=$("select.correctScores:visible");if(e.length>0){e.find(".first")[0].selected=true;e.change();e.hide();}$("select."+d).show();$("td.betButtons a:visible").hide();$("td.betButtons a#first").show();});$("select.correctScores").unbind().change(function(){var d=$("option:selected",this).attr("class");$("td.betButtons a").hide();$("td.betButtons a#"+d).css("display","block");});new SB.diffusion.PriceUpdater().onScorecastCorrectScoreChange(true);}};var diffusionControlArray=new Array();SB.betBasket.bind=function(){$("div#betBasket").each(function(){var d=new SB.betBasket.Basket(this);SB.betBasket.SetupForecastTables(d);SB.betBasket.SetupRaceCastTables(d);try{$("a.addBetButton").each(function(){new SB.betBasket.AddButton(this,d);});}catch(c){}try{$("div.totePoolsOffers").each(function(){new SB.betBasket.RebindTote(d);});}catch(c){}try{$("div.totePoolsMultiRaceOffers").each(function(){new SB.betBasket.SetupMultiRaceOffers(d);});}catch(c){}});$(".Helpquestion").hover(function(c){var d=$(".helpText",$(this).parent()).html();HelpTip.Show(this,d,c);},function(){HelpTip.Hide(this);});$(".exclamation").hover(function(c){var d=$(".helpText",$(this).parent()).html();},function(){HelpTip.Hide(this);});};SB.betBasket.SetupForecastTables=function(e){try{var c=0;$("#content div.forecastTable").each(function(){new SB.eventBrowsing.ForecastTable(this,e,c++);});}catch(d){}};SB.betBasket.SetupRaceCastTables=function(d){try{$("#content form.raceCast").each(function(){new SB.eventBrowsing.RaceCastTable(this,d);});}catch(c){}};SB.betBasket.SetupMultiRaceOffers=function(c){this.basket=c;this.refreshInterval=30000;this.activeTabIndex=$("#activeTabIndex");this.tabsContainerSelector="div.panes > div";this.tabsSelector="ul.tabs";this.selection=[];this.dialog=null;this.selectionState=new SB.betBasket.SelectionStateRepository(this.tabsContainerSelector);this.configureTabs();};SB.betBasket.SetupMultiRaceOffers.prototype={configureTabs:function(){var c=this;var d={effect:"ajax",onBeforeClick:function(f,e){c.startGomezAjaxTracking(e);},onClick:function(f,e){c.tabClickHandler(e);},initialIndex:-1};$(this.tabsSelector).tabs(this.tabsContainerSelector,d);this.setActiveTabIndex();},setActiveTabIndex:function(){var c=parseInt(this.activeTabIndex.val())+1;$("#tab"+c).click();},tabClickHandler:function(c){this.bindDialog();this.bindForm();this.setupAutoRefresh();this.endGomezAjaxTracking(c);this.updateSingleRaceLink(c);},startGomezAjaxTracking:function(c){var d=this.getActiveTabName(c);new SB.ui.startGomezAjaxTracking("totepools multiples "+d);},endGomezAjaxTracking:function(c){var d=this.getActiveTabName(c);new SB.ui.endGomezAjaxTracking("totepools multiples "+d);},updateSingleRaceLink:function(c){var e=$("a.totePoolSingleRaceOfferLink");var d=$("#singleRaceOfferLink").val();e.attr("href",d);},getActiveTabName:function(c){return $("#tab"+(c+1)).text();},setupAutoRefresh:function(){var c=this;if(this.autoRefreshIsDisabled()){return;}var e=$(this.tabsContainerSelector);e.stopTime();var d=$(this.tabsSelector+" a.current").attr("href");e.everyTime(this.refreshInterval,function(){c.refreshTab(d);},0);},refreshTab:function(d){var c=this;$.ajax({url:d,success:function(e){c.reloadTabContent(e);}});},reloadTabContent:function(c){var d=$(this.tabsContainerSelector+" form");this.selectionState.save();d.replaceWith(c);this.selectionState.restore();this.dialog.rebind();this.bindForm();},bindDialog:function(){this.dialog=new SB.eventBrowsing.ToteMultipleDialog("table.multiRaceOffers");},autoRefreshIsDisabled:function(){var c=$.cookie("DisableTotesAutoRefresh");return c=="On";},bindForm:function(){var c=this;new SB.eventBrowsing.MultiRaceTable($("#content div.totePoolsMultiRaceOffers"),c.basket);}};SB.betBasket.RebindTote=function(c){this.timerInterval=30000;this.basket=c;this.selectionState=new SB.betBasket.SelectionStateRepository("#content");this.startRefresh();this.configureTabs();};SB.betBasket.RebindTote.prototype={configureTabs:function(){$("ul.tabs").tabs("div.panes > div");},autoRefreshIsDisabled:function(){var c=$.cookie("DisableTotesAutoRefresh");return c=="On";},startRefresh:function(){var c=this;if(this.autoRefreshIsDisabled()){return;}$("div.totePoolsOffers").everyTime(c.timerInterval,function(){c.refreshPage();},0);},rebindEvents:function(){var c=this;try{$("a.addBetButton").each(function(){new SB.betBasket.AddButton(this,c.basket);});}catch(d){}try{$("#content form.raceCast").each(function(){var e=new SB.eventBrowsing.RaceCastTable(this,c.basket);e.recalculateNoOfBets();});}catch(d){}},refreshPage:function(){var e=this;var c=$("#raceId").val();var d=$("h2.AllBetsEventName").text();if(c!="undefined"){$.ajax({url:"/TotePools.mvc/DisplayRace?race="+c+"&evName=;;"+escape(d),success:function(f){e.pageLoadHandler(f);}});}},pageLoadHandler:function(c){this.selectionState.save();$("div.totePoolsOffers").replaceWith(c);this.selectionState.restore();this.rebindEvents();}};SB.betBasket.SelectionStateRepository=function(c){this.formSelector=c;this.selections=[];this.selectedBetTypeOption;this.currentTabId;};SB.betBasket.SelectionStateRepository.prototype={save:function(){this.saveCurrentTabPanel();this.saveBetTypeOptions();this.saveCheckboxSelections();},restore:function(){this.restoreCurrentTabPanel();this.restoreBetTypeOptions();this.restoreCheckboxSelections();},saveCurrentTabPanel:function(){this.currentTabId=$("ul.tabs a.current").attr("id");},restoreCurrentTabPanel:function(){$("ul.tabs").tabs("div.panes > div");$("#"+this.currentTabId).click();},saveCheckboxSelections:function(){var c=this;c.selections=[];$("div.panes > div:visible :checkbox:checked").each(function(){c.selections.push(this.id);});},restoreCheckboxSelections:function(){var c=this;$(c.selections).each(function(){if($("#"+this,c.formSelector).attr("disabled")!=true){$("#"+this,"div.panes > div:visible").attr("checked",true);}});},saveBetTypeOptions:function(){this.selectedBetTypeOption=$("div.panes > div:visible :radio:checked",this.formSelector).val();},restoreBetTypeOptions:function(){$("div.panes > div:visible :radio[value="+this.selectedBetTypeOption+"]",this.formSelector).attr("checked","checked");}};var isConnected=false;var isReconnectionAttempt=false;var diffusionControlArray=new Array();var diffusionControlArrayCounter=0;var diffusionConnectionDetails;var topicsString;var reconnectionFrequency=10000;var heartbeatFrequency=10000;var heartbeatThreshold=20000;var heartbeatLastAction=new Date();var maxSubscriptionBatchSize=1500;if(typeof SB.diffusion=="undefined"){SB.diffusion={};}SB.diffusion.PriceUpdater=function(){};SB.diffusion.PriceUpdater.prototype={initDiffusion:function(){new SB.diffusion.PriceUpdater().buildConnectionDetails();$.doTimeout("diffusionHeartbeat",heartbeatFrequency,function(){if((new Date()-heartbeatLastAction)>heartbeatThreshold){DiffusionClient.ping();}return true;},true);},onDataEvent:function(c){heartbeatLastAction=new Date();for(var k=0;k<c.getNumberOfRecords();k++){var f=c.getFields(k)[0].split("|");var l=c.topic.split("/");var g=l[3];var d=new SB.diffusion.PriceUpdater().getBetControlFor(g);for(var e=0;e<d.length;e++){new SB.diffusion.PriceUpdater().diffusionUpdate(d[e],f);}}},onLostConnectionEvent:function(){try{var c=new SB.diffusion.PriceUpdater();isConnected=false;c.logErrorMessage("onLostConnectionEvent","Connection lost, trying to reconnect");c.attemptReconnection();}catch(d){}},onCallbackFunction:function(d){isConnected=d;var c=new SB.diffusion.PriceUpdater();if(d==true){$("#diffusionRefresh").hide();c.subscribeAll();}else{$("#diffusionRefresh").show();if(isReconnectionAttempt==false){c.attemptReconnection();c.logErrorMessage("onCallbackFunction","Connection failed");}}},diffusionUpdate:function(e,d){var c=d[0];if(c==""){c="NO";}switch(c){case"O":new SB.diffusion.PriceUpdater().priceUpdate(e,d);break;case"NO":new SB.diffusion.PriceUpdater().statusUpdate(e,c);break;case"SP":break;case"NR":break;case"WD":break;}},statusUpdate:function(e,k){var m=e.button;var f=$("div#isOffered",m).filter(function(){return $('input[type="hidden"].originalBetCode',$(this)).filter(function(){return this.value.substr(this.value.indexOf("@",this.value.indexOf("@")+1)+1,e.identifier.length)==e.identifier;}).length>0;});var c=$(f).prev("div#isNotOffered");$(c).removeClass("hide");$(f).addClass("hide");$("span.priceReadonly",m).empty().html(k);var g=$('input[type="hidden"].betCode',f);var o=$('input[type="hidden"].originalBetCode',f);var d=o.val().split("*")[1];var l=o.val().replace(d,"0~0");g.val(l);},priceUpdate:function(d,H){var y=this;var c=d.button;var v=(document.getElementsByTagName("body")[0].innerText!=undefined)?true:false;$("#isNotOffered",c).addClass("hide");$("#isOffered",c).removeClass("hide");var g=$.trim(H[1]);var J=$.trim(H[2]);var e=$.trim(H[3]);var A=g;switch($("select.oddsFormat option:selected").val()){case"UK":if(J==2){A="EVS";}else{A=g;}break;case"US":A=e;break;case"EU":A=J;break;}if(A!=""){var s;if(!d.oldScoreCastCoupon){s=$("div a span.priceText",c).filter(function(){return $('input[type="hidden"].originalBetCode',$(this).parent()).filter(function(){return this.value.substr(this.value.indexOf("@",this.value.indexOf("@")+1)+1,d.identifier.length)==d.identifier;}).length>0;}).get(0);}else{s=$("a span.priceText",c).contents().filter(function(){return this.nodeType==3&&$.trim(this.data)!="";}).get(0);}var w;if(v){w=s.innerText;s.innerText=A;}else{w=s.textContent;s.textContent=A;}var I=$('input[type="hidden"].betCode',c).filter(function(){return this.value.substr(this.value.indexOf("@",this.value.indexOf("@")+1)+1,d.identifier.length)==d.identifier;});var G=$('input[type="hidden"].originalBetCode',c).filter(function(){return this.value.substr(this.value.indexOf("@",this.value.indexOf("@")+1)+1,d.identifier.length)==d.identifier;});var D=g.replace("/","~");var q=I.val().split("*")[1];var u=G.val().split("*")[1];var r=G.val().replace(u,D);var F=I.val().split("*")[1]=="0~0";I.val(r);if((q!=D)){if(!F){var f=$(c).siblings(".previous");if(f.length>0){for(var E=0;E<f.length-1;E++){f[E].innerHTML=f[E+1].innerHTML;}f[f.length-1].innerHTML="<span>"+w+"</span>";}}var o=q.split("~")[0];var C=q.split("~")[1];var m=D.split("~")[0];var B=D.split("~")[1];var l=$("a.price",c).filter(function(){return $('input[type="hidden"].originalBetCode',$(this)).filter(function(){return this.value.substr(this.value.indexOf("@",this.value.indexOf("@")+1)+1,d.identifier.length)==d.identifier;}).length>0;});var k=l.css("display");l.hide();if(o==0&&C==0){y.animatePrice("priceUp",l);}else{if((o/C)<(m/B)){y.animatePrice("priceUp",l);}else{y.animatePrice("priceDown",l);}}l.css("display",k);l.fadeIn("slow");}}},animatePrice:function(e,d){var c=5000;var f=$(".priceChangeArrow",$(d));d.removeClass("priceUp");f.removeClass("priceUp");d.removeClass("priceDown");f.removeClass("priceDown");f.removeClass("priceUp2");f.removeClass("priceDown2");d.addClass(e);f.addClass(e);$.doTimeout(c,function(){d.removeClass(e);f.removeClass(e);f.addClass(e+"2");$.doTimeout(c,function(){f.removeClass(e+"2");});});},resubscribeDiffusion:function(){var c=new SB.diffusion.PriceUpdater();c.unsubscribeAll();topicsString=c.getDiffusionTopics();c.subscribeAll();},subscribeAll:function(){topicsString=new SB.diffusion.PriceUpdater().getDiffusionTopics();var c=topicsString;while(c.length>maxSubscriptionBatchSize){var d=c.substring(0,maxSubscriptionBatchSize).lastIndexOf(",");var e=c.substring(0,d);c=c.substring(d+1,c.length);DiffusionClient.subscribe(e);}DiffusionClient.subscribe(c);},unsubscribeAll:function(){if(!topicsString){return;}var c=topicsString;while(c&&c.length>maxSubscriptionBatchSize){var d=c.substring(0,maxSubscriptionBatchSize).lastIndexOf(",");var e=c.substring(0,d);c=c.substring(d+1,c.length);DiffusionClient.unsubscribe(e);}DiffusionClient.unsubscribe(c);},getDiffusionTopics:function(){var c="";var d=$("#domainpricinggroup").val();$("div#content div .odds, div#content div .usa, div#content td .odds, div#content td .usa").each(function(){try{var f=0;$('input[type="hidden"].originalBetCode',this).each(function(){var k=$(this).val();if(!k){return true;}var o=k.split("!");var e="";for(var l=0;l<o.length;l++){var m=o[l].split("@");if(m[0].indexOf("SCK")>=0){return true;}e=e+m[2]+"@";}e=e.substring(0,e.length-1);$($('input[type="hidden"].betCode',$(this).parent())[f]).val($($('input[type="hidden"].originalBetCode',$(this).parent())[f]).val());diffusionControlArray[diffusionControlArrayCounter++]={identifier:e,button:$(this).parent().parent().parent(),oldScoreCastCoupon:false};if(c.indexOf(diffusionControlArray[diffusionControlArrayCounter-1].identifier,0)<=0){c=c+"sportingbet/prices/"+d+"/"+diffusionControlArray[diffusionControlArrayCounter-1].identifier+",";}f++;return true;});}catch(g){return true;}return true;});if(c.length>0){c=c.substring(0,c.length-1);}return c;},attemptReconnection:function(){isReconnectionAttempt=true;if(!isConnected){var c=setInterval(function(){if(isConnected){clearInterval(c);}else{$("#diffusionRefresh").show();DiffusionClient.connect(diffusionConnectionDetails);}},reconnectionFrequency);}},buildConnectionDetails:function(){var d=this;var f;var e;if(window.location.protocol=="https:"){f=$('input[type="hidden"]#flashSecureUrl').val().split(":")[0];flashPort=$('input[type="hidden"]#flashSecureUrl').val().split(":")[1];e=$('input[type="hidden"]#wsSecureUrl').val();}else{f=$('input[type="hidden"]#flashUnsecureUrl').val().split(":")[0];flashPort=$('input[type="hidden"]#flashUnsecureUrl').val().split(":")[1];e=$('input[type="hidden"]#wsUnsecureUrl').val();}var c=$('input[type="hidden"]#libPathPrefix').val();diffusionConnectionDetails={debug:true,libPath:c+"/lib/DIFFUSION",flashHost:f,flashPort:flashPort,disableSilverlight:true,wsURL:e,onDataFunction:d.onDataEvent,onLostConnectionFunction:d.onLostConnectionEvent,onTopicStatusFunction:d.onTopicStatusEvent,onCallbackFunction:d.onCallbackFunction};},getBetControlFor:function(e){var d=new Array();var f=0;for(var c=0;c<diffusionControlArray.length;c++){if(diffusionControlArray[c].identifier==e){d[f++]=diffusionControlArray[c];}}return d;},logErrorMessage:function(d,c){$.ajax({url:"/logger.mvc/Error",type:"POST",data:{message:c,"function":d,file:"PriceUpdater.js"}});},onScorecastCorrectScoreChange:function(c){$("select.correctScores").change(function(e){var f=$("a.price:visible",$(".odds",$(e.target).parent().parent()));var d=new SB.diffusion.PriceUpdater();d.unsubscribeFromOtherScoreCast(f);d.subscribeScorecast(f,c);});},subscribeScorecast:function(c,d){var o=$('input[type="hidden"].originalBetCode',c).val();if(o){try{var q=$("#domainpricinggroup").val();var f=o.split("*")[0].split("@");var m=f[2]+"@"+f[3];var g=new SB.diffusion.PriceUpdater().getBetControlFor(m);if(g.length==0){var k=c.parent();if(!d){k=k.parent();}diffusionControlArray[diffusionControlArrayCounter++]={identifier:m,button:k,oldScoreCastCoupon:d};}DiffusionClient.subscribe("sportingbet/prices/"+q+"/"+m);}catch(l){}}},unsubscribeFromOtherScoreCast:function(d){var c=$('input[type="hidden"].originalBetCode',d).val();$("a.price:hidden",d.parent().parent().parent().parent().parent()).each(function(){var q=$('input[type="hidden"].originalBetCode',$(this)).val();if(q&&q!=c){try{var m=$("#domainpricinggroup").val();var l=q.split("*")[0].split("@");var f=l[2]+"@"+l[3];var k=new SB.diffusion.PriceUpdater().getBetControlFor(f);if(k.length>0){DiffusionClient.unsubscribe("sportingbet/prices/"+m+"/"+f);for(var g=0;g<k.length;g++){diffusionControlArray.splice(diffusionControlArray.indexOf(k[g]));diffusionControlArrayCounter--;}}}catch(o){}}});}};
