/*! jQuery v1.7.1 jquery.com | jquery.org/license */
(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(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 cb(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 ca(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bE.test(a)?d(a,e):ca(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)});else if(!c&&b!=null&&typeof b=="object")for(var e in b)ca(a+"["+e+"]",b[e],c,d);else d(a,b)}function b_(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function b$(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===bT,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=b$(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=b$(a,c,d,e,"*",g));return l}function bZ(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bP),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 bC(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bx:by,g=0,h=e.length;if(d>0){if(c!=="border")for(;g<h;g++)c||(d-=parseFloat(f.css(a,"padding"+e[g]))||0),c==="margin"?d+=parseFloat(f.css(a,c+e[g]))||0:d-=parseFloat(f.css(a,"border"+e[g]+"Width"))||0;return d+"px"}d=bz(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0;if(c)for(;g<h;g++)d+=parseFloat(f.css(a,"padding"+e[g]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+e[g]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+e[g]))||0);return d+"px"}function bp(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bo(a){var b=c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return b.firstChild}function bn(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bm)}function bm(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bl(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bk(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 bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c+(i[c][d].namespace?".":"")+i[c][d].namespace,i[c][d],i[c][d].data)}h.data&&(h.data=f.extend({},h.data))}}function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function T(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(O.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 S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}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=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var 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=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return 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.7.1",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.add(a);return this},eq:function(a){a=+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.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");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},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(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;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(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(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},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,"ms-").replace(v,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,c){var d;if(b){if(H)return H.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&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=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function 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={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m=function(b){var d,e,g,h,i;for(d=0,e=b.length;d<e;d++)g=b[d],h=f.type(g),h==="array"?m(g):h==="function"&&(!a.unique||!o.has(g))&&c.push(g)},n=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,l=j||0,j=0,k=c.length;for(;c&&l<k;l++)if(c[l].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}i=!1,c&&(a.once?e===!0?o.disable():c=[]:d&&d.length&&(e=d.shift(),o.fireWith(e[0],e[1])))},o={add:function(){if(c){var a=c.length;m(arguments),i?k=c.length:e&&e!==!0&&(j=a,n(e[0],e[1]))}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++)for(var f=0;f<c.length;f++)if(b[d]===c[f]){i&&f<=k&&(k--,f<=l&&l--),c.splice(f--,1);if(a.unique)break}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++)if(a===c[b])return!0}return!1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return!c},lock:function(){d=b,(!e||e===!0)&&o.disable();return this},locked:function(){return!d},fireWith:function(b,c){d&&(i?a.once||d.push([b,c]):(!a.once||!e)&&n(b,c));return this},fire:function(){o.fireWith(this,arguments);return this},fired:function(){return!!e}};return o};var i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks("once memory"),c=f.Callbacks("once memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);return this},always:function(){i.done.apply(i,arguments).fail.apply(i,arguments);return this},pipe:function(a,b,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({}),j;for(j in g)i[j]=g[j].fire,i[j+"With"]=g[j].fireWith;i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++)b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g;g||j.resolveWith(j,b)}else j!==a&&j.resolveWith(j,d?[a]:[]);return k}}),f.support=function(){var b,d,e,g,h,i,j,k,l,m,n,o,p,q=c.createElement("div"),r=c.documentElement;q.setAttribute("className","t"),q.innerHTML="   <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.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:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="<div "+n+"><div></div></div>"+"<table "+n+" cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="<div style='width:4px;'></div>",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e<g;e++)delete d[b[e]];if(!(c?m:f.isEmptyObject)(d))return}}if(!c){delete j[k].data;if(!m(j[k]))return}f.support.deleteExpando||!j.setInterval?delete j[k]:j[k]=null,i&&(f.support.deleteExpando?delete a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=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,e,g,h=null;if(typeof a=="undefined"){if(this.length){h=f.data(this[0]);if(this[0].nodeType===1&&!f._data(this[0],"parsedAttrs")){e=this[0].attributes;for(var i=0,j=e.length;i<j;i++)g=e[i].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),l(this[0],g,h[g]));f._data(this[0],"parsedAttrs",!0)}}return h}if(typeof a=="object")return this.each(function(){f.data(this,a)});d=a.split("."),d[1]=d[1]?"."+d[1]:"";if(c===b){h=this.triggerHandler("getData"+d[1]+"!",[d[0]]),h===b&&this.length&&(h=f.data(this[0],a),h=l(this[0],a,h));return h===b&&d[1]?this.data(d[0]):h}return this.each(function(){var b=f(this),e=[d[0],c];b.triggerHandler("setData"+d[1]+"!",e),f.data(this,a,c),b.triggerHandler("changeData"+d[1]+"!",e)})},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},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"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(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(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},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.Callbacks("once memory"),!0))h++,l.add(m);m();return d.promise()}});var o=/[\n\t\r]/g,p=/\s+/,q=/\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;f.fn.extend({attr:function(a,b){return 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(p);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+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(p);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(o," ");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(p);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+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(o," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.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}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),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,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c<d;c++){e=i[c];if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,"optgroup"))){b=f(e).val();if(j)return b;h.push(b)}}if(j&&!h.length&&i.length)return f(i[g]).val();return h},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},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h<g;h++)e=d[h],e&&(c=f.propFix[e]||e,f.attr(a,e,""),a.removeAttribute(v?e:c),u.test(e)&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(r.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}}},value:{get:function(a,b){if(w&&f.nodeName(a,"button"))return w.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(w&&f.nodeName(a,"button"))return w.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,g,h,i=a.nodeType;if(!!a&&i!==3&&i!==8&&i!==2){h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);return d!==b?g&&"set"in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get"in g&&(e=g.get(a,c))!==null?e:a[c]}},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){var d,e=f.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?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}},v||(y={name:!0,id:!0},w=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&(y[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.attrHooks.tabindex.set=w.set,f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})}),f.attrHooks.contenteditable={get:w.get,set:function(a,b,c){b===""&&(b="false"),w.set(a,b,c)}}),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var 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);return null}})),f.support.enctype||(f.propFix.enctype="encoding"),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 z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};
f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k<c.length;k++){l=A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,quick:G(g),namespace:n.join(".")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var g=f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||"")).split(" ");for(h=0;h<b.length;h++){i=A.exec(b[h])||[],j=k=i[1],l=i[2];if(!j){for(j in o)f.event.remove(a,j+b[h],c,d,!0);continue}p=f.event.special[j]||{},j=(d?p.delegateType:p.bindType)||j,r=o[j]||[],m=r.length,l=l?new RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(n=0;n<r.length;n++)s=r[n],(e||k===s.origType)&&(!c||c.guid===s.guid)&&(!l||l.test(s.namespace))&&(!d||d===s.selector||d==="**"&&s.selector)&&(r.splice(n--,1),s.selector&&r.delegateCount--,p.remove&&p.remove.call(a,s));r.length===0&&m!==r.length&&((!p.teardown||p.teardown.call(a,l)===!1)&&f.removeEvent(a,j,g.handle),delete o[j])}f.isEmptyObject(o)&&(q=g.handle,q&&(q.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;if(E.test(h+f.event.triggered))return;h.indexOf("!")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length&&!c.isPropagationStopped();l++)m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d)===!1&&c.preventDefault();c.type=h,!g&&!c.isDefaultPrevented()&&(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,i=[],j,k,l,m,n,o,p,q,r,s,t;g[0]=c,c.delegateTarget=this;if(e&&!c.target.disabled&&(!c.button||c.type!=="click")){m=f(this),m.context=this.ownerDocument||this;for(l=c.target;l!=this;l=l.parentNode||this){o={},q=[],m[0]=l;for(j=0;j<e;j++)r=d[j],s=r.selector,o[s]===b&&(o[s]=r.quick?H(l,r.quick):m.is(s)),o[s]&&q.push(r);q.length&&i.push({elem:l,matches:q})}}d.length>e&&i.push({elem:this,matches:d.slice(e)});for(j=0;j<i.length&&!c.isPropagationStopped();j++){p=i[j],c.currentTarget=p.elem;for(k=0;k<p.matches.length&&!c.isImmediatePropagationStopped();k++){r=p.matches[k];if(h||!c.namespace&&!r.namespace||c.namespace_re&&c.namespace_re.test(r.namespace))c.data=r.data,c.handleObj=r,n=((f.event.special[r.origType]||{}).handle||r.handler).apply(p.elem,g),n!==b&&(c.result=n,n===!1&&(c.preventDefault(),c.stopPropagation()))}}return c.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,d){var e,f,g,h=d.button,i=d.fromElement;a.pageX==null&&d.clientX!=null&&(e=a.target.ownerDocument||c,f=e.documentElement,g=e.body,a.pageX=d.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=d.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?d.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0);return a}},fix:function(a){if(a[f.expando])return a;var d,e,g=a,h=f.event.fixHooks[a.type]||{},i=h.props?this.props.concat(h.props):this.props;a=f.Event(g);for(d=i.length;d;)e=i[--d],a[e]=g[e];a.target||(a.target=g.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey);return h.filter?h.filter(a,g):a},special:{ready:{setup:f.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=f.extend(new f.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?f.event.trigger(e,null,b):f.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},f.event.handle=f.event.dispatch,f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!(this instanceof f.Event))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()?K:J):this.type=a,b&&f.extend(this,b),this.timeStamp=a&&a.timeStamp||f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=K;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=K;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=K,this.stopPropagation()},isDefaultPrevented:J,isPropagationStopped:J,isImmediatePropagationStopped:J},f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c=this,d=a.relatedTarget,e=a.handleObj,g=e.selector,h;if(!d||d!==c&&!f.contains(c,d))a.type=e.origType,h=e.handler.apply(this,arguments),a.type=b;return h}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form"))return!1;f.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=f.nodeName(c,"input")||f.nodeName(c,"button")?c.form:b;d&&!d._submit_attached&&(f.event.add(d,"submit._submit",function(a){this.parentNode&&!a.isTrigger&&f.event.simulate("submit",this.parentNode,a,!0)}),d._submit_attached=!0)})},teardown:function(){if(f.nodeName(this,"form"))return!1;f.event.remove(this,"._submit")}}),f.support.changeBubbles||(f.event.special.change={setup:function(){if(z.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")f.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,f.event.simulate("change",this,a,!0))});return!1}f.event.add(this,"beforeactivate._change",function(a){var b=a.target;z.test(b.nodeName)&&!b._change_attached&&(f.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&f.event.simulate("change",this.parentNode,a,!0)}),b._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){f.event.remove(this,"._change");return z.test(this.nodeName)}}),f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){var d=0,e=function(a){f.event.simulate(b,a.target,f.event.fix(a),!0)};f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.fn.extend({on:function(a,c,d,e,g){var h,i;if(typeof a=="object"){typeof c!="string"&&(d=c,c=b);for(i in a)this.on(i,c,d,a[i],g);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=J;else if(!e)return this;g===1&&(h=e,e=function(a){f().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=f.guid++));return this.each(function(){f.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on.call(this,a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=a.handleObj;f(a.delegateTarget).off(e.namespace?e.type+"."+e.namespace:e.type,e.selector,e.handler);return this}if(typeof a=="object"){for(var g in a)this.off(g,c,a[g]);return this}if(c===!1||typeof c=="function")d=c,c=b;d===!1&&(d=J);return this.each(function(){f.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){f(this.context).on(a,this.selector,b,c);return this},die:function(a,b){f(this.context).off(a,this.selector||"**",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a,c)},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)}}),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 contextmenu".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}if(j.nodeType===1){g||(j[d]=c,j.sizset=h);if(typeof b!="string"){if(j===b){k=!0;break}}else if(m.filter(b,[j]).length>0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}j.nodeType===1&&!g&&(j[d]=c,j.sizset=h);if(j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}e[h]=k}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},m.matches=function(a,b){return m(a,null,null,b)},m.matchesSelector=function(a,b){return m(b,null,null,[a]).length>0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e<f;e++){h=o.order[e];if(g=o.leftMatch[h].exec(a)){i=g[1],g.splice(1,1);if(i.substr(i.length-1)!=="\\"){g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c);if(d!=null){a=a.replace(o.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},m.filter=function(a,c,d,e){var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);while(a&&c.length){for(h in o.filter)if((f=o.leftMatch[h].exec(a))!=null&&f[2]){k=o.filter[h],l=f[1],g=!1,f.splice(1,1);if(l.substr(l.length-1)==="\\")continue;s===r&&(r=[]);if(o.preFilter[h]){f=o.preFilter[h](f,s,d,r,e,t);if(!f)g=i=!0;else if(f===!0)continue}if(f)for(n=0;(j=s[n])!=null;n++)j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));if(i!==b){d||(s=r),a=a.replace(o.match[h],"");if(!g)return[];break}}if(a===q)if(g==null)m.error(a);else break;q=a}return s},m.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)};var n=m.getText=function(a){var b,c,d=a.nodeType,e="";if(d){if(d===1||d===9){if(typeof a.textContent=="string")return a.textContent;if(typeof a.innerText=="string")return a.innerText.replace(k,"");for(a=a.firstChild;a;a=a.nextSibling)e+=n(a)}else if(d===3||d===4)return a.nodeValue}else for(b=0;c=a[b];b++)c.nodeType!==8&&(e+=n(c));return e},o=m.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!l.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&&m.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&m.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof 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(j,"")+" ";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(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var 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]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+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]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.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!!m(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=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([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}m.error(e)},CHILD:function(a,b){var c,e,f,g,h,i,j,k=b[1],l=a;switch(k){case"only":case"first":while(l=l.previousSibling)if(l.nodeType===1)return!1;if(k==="first")return!0;l=a;case"last":while(l=l.nextSibling)if(l.nodeType===1)return!1;return!0;case"nth":c=b[2],e=b[3];if(c===1&&e===0)return!0;f=b[0],g=a.parentNode;if(g&&(g[d]!==f||!a.nodeIndex)){i=0;for(l=g.firstChild;l;l=l.nextSibling)l.nodeType===1&&(l.nodeIndex=++i);g[d]=f}j=a.nodeIndex-e;return c===0?j===0:j%c===0&&j/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&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=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null: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=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=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(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var u,v;c.documentElement.compareDocumentPosition?u=function(a,b){if(a===b){h=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b){h=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i)return v(a,b);if(!g)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 v(e[k],f[k]);return k===c?v(a,f[k],-1):v(e[k],b,1)},v=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}),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)&&(o.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:[]}},o.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&&(o.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")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[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}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(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;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h<i;h++)m(a,g[h],e,c);return m.filter(f,e)};m.attr=f.attr,m.selectors.attrMap={},f.find=m,f.expr=m.selectors,f.expr[":"]=f.expr.filters,f.unique=m.uniqueSort,f.text=m.getText,f.isXMLDoc=m.isXML,f.contains=m.contains}();var L=/Until$/,M=/^(?:parents|prevUntil|prevAll)/,N=/,/,O=/^.[^:#\[\.,]*$/,P=Array.prototype.slice,Q=f.expr.match.POS,R={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(T(this,a,!1),"not",a)},filter:function(a){return this.pushStack(T(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?Q.test(a)?f(a,this.context).index(this[0])>=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d<a.length;d++)f(g).is(a[d])&&c.push({selector:a[d],elem:g,level:h});g=g.parentNode,h++}return c}var i=Q.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(i?i.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));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(S(c[0])||S(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);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).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 V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|style)/i,bb=/<(?:script|object|embed|option|style)/i,bc=new RegExp("<(?:"+V+")","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*<!(?:\[CDATA\[|\-\-)/,bg={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,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._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){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):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.clean(arguments);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.clean(arguments));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(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");try{for(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"&&bd.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?bi(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,bp)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!bb.test(j)&&(f.support.checkClone||!bd.test(j))&&(f.support.html5Clone||!bc.test(j))&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var 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,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},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(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1></$2>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),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&&X.test(k)&&o.insertBefore(b.createTextNode(X.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++)bn(k[i]);else bn(k);k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return!a.type||be.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.event.special,g=f.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()])continue;c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var j in b.events)e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle);b.handle&&(b.handle.elem=null)}g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c]}}}});var bq=/alpha\([^)]*\)/i,br=/opacity=([^)]*)/,bs=/([A-Z]|^ms)/g,bt=/^-?\d+(?:px)?$/i,bu=/^-?\d/,bv=/^([\-+])=([\-+.\de]+)/,bw={position:"absolute",visibility:"hidden",display:"block"},bx=["Left","Right"],by=["Top","Bottom"],bz,bA,bB;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=bz(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,h==="string"&&(g=bv.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in 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(bz)return bz(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 bC(a,b,d);f.swap(a,bw,function(){e=bC(a,b,d)});return e}},set:function(a,b){if(!bt.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.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,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,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=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,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&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.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(bN,"")).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||bO.test(this.nodeName)||bI.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(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return 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?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[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","*":bX},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},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),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>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof 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.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var 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=bH.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.add,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(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.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]!=="*"?", "+bX+"; 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=b$(bU,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){if(s<2)w(-1,z);else throw 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)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),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&&(ce.test(b.url)||e&&ce.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(ce,l),b.url===j&&(e&&(k=k.replace(ce,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 cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,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,cf&&delete ch[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=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("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",cv(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(cu("hide",3),a,b,c);var d,e,g=0,h=this.length;for(;g<h;g++)d=this[g],d.style&&(e=f.css(d,"display"),e!=="none"&&!f._data(d,"olddisplay")&&f._data(d,"olddisplay",e));for(g=0;g<h;g++)this[g].style&&(this[g].style.display="none");return 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(cu("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){function g(){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||cv(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)j=new f.fx(this,b,i),h=a[i],cn.test(h)?(o=f._data(this,"toggle"+i)||(h==="toggle"?d?"show":"hide":0),o?(f._data(this,"toggle"+i,o==="show"?"hide":"show"),j[o]()):j[h]()):(k=co.exec(h),l=j.cur(),k?(m=parseFloat(k[2]),n=k[3]||(f.cssNumber[i]?"":"px"),n!=="px"&&(f.style(this,i,(m||1)+n),l=(m||1)/j.cur()*l,f.style(this,i,l+n)),k[1]&&(m=(k[1]==="-="?-1:1)*m+l),j.custom(l,m,n)):j.custom(l,h,""));return!0}var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return e.queue===!1?this.each(g):this.queue(e.queue,g)},stop:function(a,c,d){typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]);return this.each(function(){function h(a,b,c){var e=b[c];f.removeData(a,c,!0),e.stop(d)}var b,c=!1,e=f.timers,g=f._data(this);d||f._unmark(!0,this);if(a==null)for(b in g)g[b]&&g[b].stop&&b.indexOf(".run")===b.length-4&&h(this,g,b);else g[b=a+".run"]&&g[b].stop&&h(this,g,b);for(b=e.length;b--;)e[b].elem===this&&(a==null||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1));(!d||!c)&&f.dequeue(this,a)})}}),f.each({slideDown:cu("show",1),slideUp:cu("hide",1),slideToggle:cu("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;if(d.queue==null||d.queue===!0)d.queue="fx";d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue?f.dequeue(this,d.queue):a!==!1&&f._unmark(this)};return 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+.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,c,d){function h(a){return e.step(a)}var e=this,g=f.fx;this.startTime=cr||cs(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(f.cssNumber[this.prop]?"":"px"),h.queue=this.options.queue,h.elem=this.elem,h.saveState=function(){e.options.hide&&f._data(e.elem,"fxshow"+e.prop)===b&&f._data(e.elem,"fxshow"+e.prop,e.start)},h()&&f.timers.push(h)&&!cp&&(cp=setInterval(g.tick,g.interval))},show:function(){var a=f._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||f.style(this.elem,this.prop),this.options.show=!0,a!==b?this.custom(this.cur(),a):this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f._data(this.elem,"fxshow"+this.prop)||f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b,c,d,e=cr||cs(),g=!0,h=this.elem,i=this.options;if(a||e>=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||f.fx.stop()},interval:13,stop:function(){clearInterval(cp),cp=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}}),f.each(["width","height"],function(a,b){f.fx.step[b]=function(a){f.style(a.elem,b,Math.max(0,a.now)+a.unit)}}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cw=/^t(?:able|d|h)$/i,cx=/^(?: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=cy(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);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.support.fixedPosition&&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.support.doesNotAddBorder&&(!f.support.doesAddBorderForTableAndCells||!cw.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.support.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.support.fixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},f.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var 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=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.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=cy(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=cy(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")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():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],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["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 i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window);
/*
 * jQuery clueTip plugin
 * Version 1.0.6  (January 13, 2010)
 * @requires jQuery v1.3+
 *
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 */
 
/*
 *
 * Full list of options/settings can be found at the bottom of this file and at http://plugins.learningjquery.com/cluetip/
 *
 * Examples can be found at http://plugins.learningjquery.com/cluetip/demo/
 *
*/
(function($){$.cluetip={version:'1.0.6'};var $cluetip,$cluetipInner,$cluetipOuter,$cluetipTitle,$cluetipArrows,$cluetipWait,$dropShadow,imgCount;$.fn.cluetip=function(js,options){if(typeof js=='object'){options=js;js=null;}
if(js=='destroy'){return this.removeData('thisInfo').unbind('.cluetip');}
return this.each(function(index){var link=this,$this=$(this);var opts=$.extend(true,{},$.fn.cluetip.defaults,options||{},$.metadata?$this.metadata():$.meta?$this.data():{});var cluetipContents=false;var cluezIndex=+opts.cluezIndex;$this.data('thisInfo',{title:link.title,zIndex:cluezIndex});var isActive=false,closeOnDelay=0;if(!$('#cluetip').length){$(['<div id="cluetip">','<div id="cluetip-outer">','<h3 id="cluetip-title"></h3>','<div id="cluetip-inner"></div>','</div>','<div id="cluetip-extra"></div>','<div id="cluetip-arrows" class="cluetip-arrows"></div>','</div>'].join(''))
[insertionType](insertionElement).hide();$cluetip=$('#cluetip').css({position:'absolute'});$cluetipOuter=$('#cluetip-outer').css({position:'relative',zIndex:cluezIndex});$cluetipInner=$('#cluetip-inner');$cluetipTitle=$('#cluetip-title');$cluetipArrows=$('#cluetip-arrows');$cluetipWait=$('<div id="cluetip-waitimage"></div>').css({position:'absolute'}).insertBefore($cluetip).hide();}
var dropShadowSteps=(opts.dropShadow)?+opts.dropShadowSteps:0;if(!$dropShadow){$dropShadow=$([]);for(var i=0;i<dropShadowSteps;i++){$dropShadow=$dropShadow.add($('<div></div>').css({zIndex:cluezIndex-1,opacity:.1,top:1+i,left:1+i}));}
$dropShadow.css({position:'absolute',backgroundColor:'#000'}).prependTo($cluetip);}
var tipAttribute=$this.attr(opts.attribute),ctClass=opts.cluetipClass;if(!tipAttribute&&!opts.splitTitle&&!js){return true;}
if(opts.local&&opts.localPrefix){tipAttribute=opts.localPrefix+tipAttribute;}
if(opts.local&&opts.hideLocal){$(tipAttribute+':first').hide();}
var tOffset=parseInt(opts.topOffset,10),lOffset=parseInt(opts.leftOffset,10);var tipHeight,wHeight,defHeight=isNaN(parseInt(opts.height,10))?'auto':(/\D/g).test(opts.height)?opts.height:opts.height+'px';var sTop,linkTop,posY,tipY,mouseY,baseline;var tipInnerWidth=parseInt(opts.width,10)||275,tipWidth=tipInnerWidth+(parseInt($cluetip.css('paddingLeft'),10)||0)+(parseInt($cluetip.css('paddingRight'),10)||0)+dropShadowSteps,linkWidth=this.offsetWidth,linkLeft,posX,tipX,mouseX,winWidth;var tipParts;var tipTitle=(opts.attribute!='title')?$this.attr(opts.titleAttribute):'';if(opts.splitTitle){if(tipTitle==undefined){tipTitle='';}
tipParts=tipTitle.split(opts.splitTitle);tipTitle=tipParts.shift();}
if(opts.escapeTitle){tipTitle=tipTitle.replace(/&/g,'&amp;').replace(/>/g,'&gt;').replace(/</g,'&lt;');}
var localContent;function returnFalse(){return false;}
var activate=function(event){if(!opts.onActivate($this)){return false;}
isActive=true;$cluetip.removeClass().css({width:tipInnerWidth});if(tipAttribute==$this.attr('href')){$this.css('cursor',opts.cursor);}
if(opts.hoverClass){$this.addClass(opts.hoverClass);}
linkTop=posY=$this.offset().top;linkLeft=$this.offset().left;mouseX=event.pageX;mouseY=event.pageY;if(link.tagName.toLowerCase()!='area'){sTop=$(document).scrollTop();winWidth=$(window).width();}
if(opts.positionBy=='fixed'){posX=linkWidth+linkLeft+lOffset;$cluetip.css({left:posX});}else{posX=(linkWidth>linkLeft&&linkLeft>tipWidth)||linkLeft+linkWidth+tipWidth+lOffset>winWidth?linkLeft-tipWidth-lOffset:linkWidth+linkLeft+lOffset;if(link.tagName.toLowerCase()=='area'||opts.positionBy=='mouse'||linkWidth+tipWidth>winWidth){if(mouseX+20+tipWidth>winWidth){$cluetip.addClass(' cluetip-'+ctClass);posX=(mouseX-tipWidth-lOffset)>=0?mouseX-tipWidth-lOffset-parseInt($cluetip.css('marginLeft'),10)+parseInt($cluetipInner.css('marginRight'),10):mouseX-(tipWidth/2);}else{posX=mouseX+lOffset;}}
var pY=posX<0?event.pageY+tOffset:event.pageY;$cluetip.css({left:(posX>0&&opts.positionBy!='bottomTop')?posX:(mouseX+(tipWidth/2)>winWidth)?winWidth/2-tipWidth/2:Math.max(mouseX-(tipWidth/2),0),zIndex:$this.data('thisInfo').zIndex});$cluetipArrows.css({zIndex:$this.data('thisInfo').zIndex+1});}
wHeight=$(window).height();if(js){if(typeof js=='function'){js=js.call(link);}
$cluetipInner.html(js);cluetipShow(pY);}
else if(tipParts){var tpl=tipParts.length;$cluetipInner.html(tpl?tipParts[0]:'');if(tpl>1){for(var i=1;i<tpl;i++){$cluetipInner.append('<div class="split-body">'+tipParts[i]+'</div>');}}
cluetipShow(pY);}
else if(!opts.local&&tipAttribute.indexOf('#')!==0){if(/\.(jpe?g|tiff?|gif|png)$/i.test(tipAttribute)){$cluetipInner.html('<img src="'+tipAttribute+'" alt="'+tipTitle+'" />');cluetipShow(pY);}else if(cluetipContents&&opts.ajaxCache){$cluetipInner.html(cluetipContents);cluetipShow(pY);}else{var optionBeforeSend=opts.ajaxSettings.beforeSend,optionError=opts.ajaxSettings.error,optionSuccess=opts.ajaxSettings.success,optionComplete=opts.ajaxSettings.complete;var ajaxSettings={cache:false,url:tipAttribute,beforeSend:function(xhr){if(optionBeforeSend){optionBeforeSend.call(link,xhr,$cluetip,$cluetipInner);}
$cluetipOuter.children().empty();if(opts.waitImage){$cluetipWait.css({top:mouseY+20,left:mouseX+20,zIndex:$this.data('thisInfo').zIndex-1}).show();}},error:function(xhr,textStatus){if(isActive){if(optionError){optionError.call(link,xhr,textStatus,$cluetip,$cluetipInner);}else{$cluetipInner.html('<i>sorry, the contents could not be loaded</i>');}}},success:function(data,textStatus){cluetipContents=opts.ajaxProcess.call(link,data);if(isActive){if(optionSuccess){optionSuccess.call(link,data,textStatus,$cluetip,$cluetipInner);}
$cluetipInner.html(cluetipContents);}},complete:function(xhr,textStatus){if(optionComplete){optionComplete.call(link,xhr,textStatus,$cluetip,$cluetipInner);}
imgCount=$('#cluetip-inner img').length;if(imgCount&&!$.browser.opera){$('#cluetip-inner img').bind('load error',function(){imgCount--;if(imgCount<1){$cluetipWait.hide();if(isActive){cluetipShow(pY);}}});}else{$cluetipWait.hide();if(isActive){cluetipShow(pY);}}}};var ajaxMergedSettings=$.extend(true,{},opts.ajaxSettings,ajaxSettings);$.ajax(ajaxMergedSettings);}}else if(opts.local){var $localContent=$(tipAttribute+(/#\S+$/.test(tipAttribute)?'':':eq('+index+')')).clone(true).show();$cluetipInner.html($localContent);cluetipShow(pY);}};var cluetipShow=function(bpY){$cluetip.addClass('cluetip-'+ctClass);if(opts.truncate){var $truncloaded=$cluetipInner.text().slice(0,opts.truncate)+'...';$cluetipInner.html($truncloaded);}
function doNothing(){};tipTitle?$cluetipTitle.show().html(tipTitle):(opts.showTitle)?$cluetipTitle.show().html('&nbsp;'):$cluetipTitle.hide();if(opts.sticky){var $closeLink=$('<div id="cluetip-close"><a href="#">'+opts.closeText+'</a></div>');(opts.closePosition=='bottom')?$closeLink.appendTo($cluetipInner):(opts.closePosition=='title')?$closeLink.prependTo($cluetipTitle):$closeLink.prependTo($cluetipInner);$closeLink.bind('click.cluetip',function(){cluetipClose();return false;});if(opts.mouseOutClose){$cluetip.bind('mouseleave.cluetip',function(){cluetipClose();});}else{$cluetip.unbind('mouseleave.cluetip');}}
var direction='';$cluetipOuter.css({zIndex:$this.data('thisInfo').zIndex,overflow:defHeight=='auto'?'visible':'auto',height:defHeight});tipHeight=defHeight=='auto'?Math.max($cluetip.outerHeight(),$cluetip.height()):parseInt(defHeight,10);tipY=posY;baseline=sTop+wHeight;if(opts.positionBy=='fixed'){tipY=posY-opts.dropShadowSteps+tOffset;}else if((posX<mouseX&&Math.max(posX,0)+tipWidth>mouseX)||opts.positionBy=='bottomTop'){if(posY+tipHeight+tOffset>baseline&&mouseY-sTop>tipHeight+tOffset){tipY=mouseY-tipHeight-tOffset;direction='top';}else{tipY=mouseY+tOffset;direction='bottom';}}else if(posY+tipHeight+tOffset>baseline){tipY=(tipHeight>=wHeight)?sTop:baseline-tipHeight-tOffset;}else if($this.css('display')=='block'||link.tagName.toLowerCase()=='area'||opts.positionBy=="mouse"){tipY=bpY-tOffset;}else{tipY=posY-opts.dropShadowSteps;}
if(direction==''){posX<linkLeft?direction='left':direction='right';}
$cluetip.css({top:tipY+'px'}).removeClass().addClass('clue-'+direction+'-'+ctClass).addClass(' cluetip-'+ctClass);if(opts.arrows){var bgY=(posY-tipY-opts.dropShadowSteps);$cluetipArrows.css({top:(/(left|right)/.test(direction)&&posX>=0&&bgY>0)?bgY+'px':/(left|right)/.test(direction)?0:''}).show();}else{$cluetipArrows.hide();}
$dropShadow.hide();$cluetip.hide()[opts.fx.open](opts.fx.openSpeed||0);if(opts.dropShadow){$dropShadow.css({height:tipHeight,width:tipInnerWidth,zIndex:$this.data('thisInfo').zIndex-1}).show();}
if($.fn.bgiframe){$cluetip.bgiframe();}
if(opts.delayedClose>0){closeOnDelay=setTimeout(cluetipClose,opts.delayedClose);}
opts.onShow.call(link,$cluetip,$cluetipInner);};var inactivate=function(event){isActive=false;$cluetipWait.hide();if(!opts.sticky||(/click|toggle/).test(opts.activation)){cluetipClose();clearTimeout(closeOnDelay);}
if(opts.hoverClass){$this.removeClass(opts.hoverClass);}};var cluetipClose=function(){$cluetipOuter.parent().hide().removeClass();opts.onHide.call(link,$cluetip,$cluetipInner);$this.removeClass('cluetip-clicked');if(tipTitle){$this.attr(opts.titleAttribute,tipTitle);}
$this.css('cursor','');if(opts.arrows){$cluetipArrows.css({top:''});}};$(document).bind('hideCluetip',function(e){cluetipClose();});if((/click|toggle/).test(opts.activation)){$this.bind('click.cluetip',function(event){if($cluetip.is(':hidden')||!$this.is('.cluetip-clicked')){activate(event);$('.cluetip-clicked').removeClass('cluetip-clicked');$this.addClass('cluetip-clicked');}else{inactivate(event);}
this.blur();return false;});}else if(opts.activation=='focus'){$this.bind('focus.cluetip',function(event){activate(event);});$this.bind('blur.cluetip',function(event){inactivate(event);});}else{$this[opts.clickThrough?'unbind':'bind']('click',returnFalse);var mouseTracks=function(evt){if(opts.tracking==true){var trackX=posX-evt.pageX;var trackY=tipY?tipY-evt.pageY:posY-evt.pageY;$this.bind('mousemove.cluetip',function(evt){$cluetip.css({left:evt.pageX+trackX,top:evt.pageY+trackY});});}};if($.fn.hoverIntent&&opts.hoverIntent){$this.hoverIntent({sensitivity:opts.hoverIntent.sensitivity,interval:opts.hoverIntent.interval,over:function(event){activate(event);mouseTracks(event);},timeout:opts.hoverIntent.timeout,out:function(event){inactivate(event);$this.unbind('mousemove.cluetip');}});}else{$this.bind('mouseenter.cluetip',function(event){activate(event);mouseTracks(event);}).bind('mouseleave.cluetip',function(event){inactivate(event);$this.unbind('mousemove.cluetip');});}
$this.bind('mouseover.cluetip',function(event){$this.attr('title','');}).bind('mouseleave.cluetip',function(event){$this.attr('title',$this.data('thisInfo').title);});}});};$.fn.cluetip.defaults={width:275,height:'auto',cluezIndex:97,positionBy:'auto',topOffset:15,leftOffset:15,local:false,localPrefix:null,hideLocal:true,attribute:'rel',titleAttribute:'title',splitTitle:'',escapeTitle:false,showTitle:true,cluetipClass:'default',hoverClass:'',waitImage:true,cursor:'pointer',arrows:false,dropShadow:true,dropShadowSteps:6,sticky:false,mouseOutClose:false,activation:'hover',clickThrough:false,tracking:false,delayedClose:0,closePosition:'top',closeText:'Close',truncate:0,fx:{open:'show',openSpeed:''},hoverIntent:{sensitivity:3,interval:50,timeout:0},onActivate:function(e){return true;},onShow:function(ct,ci){},onHide:function(ct,ci){},ajaxCache:true,ajaxProcess:function(data){data=data.replace(/<(script|style|title)[^<]+<\/(script|style|title)>/gm,'').replace(/<(link|meta)[^>]+>/g,'');return data;},ajaxSettings:{dataType:'html'},debug:false};var insertionType='appendTo',insertionElement='body';$.cluetip.setup=function(options){if(options&&options.insertionType&&(options.insertionType).match(/appendTo|prependTo|insertBefore|insertAfter/)){insertionType=options.insertionType;}
if(options&&options.insertionElement){insertionElement=options.insertionElement;}};})(jQuery);
/*!
 * jQuery UI 1.8.2
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI
 */
(function(c){c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.2",plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=0;e<b.length;e++)a.options[b[e][0]]&&b[e][1].apply(a.element,d)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")==
"hidden")return false;b=b&&b=="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,f,g){return c.ui.isOverAxis(a,d,f)&&c.ui.isOverAxis(b,e,g)},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}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect",
"none")},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",
1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==undefined)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");if(b=="absolute"||b=="relative"||b=="fixed"){b=parseInt(a.css("zIndex"));if(!isNaN(b)&&b!=0)return b}a=a.parent()}}return 0}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){var b=a.nodeName.toLowerCase(),d=c.attr(a,"tabindex");return(/input|select|textarea|button|object/.test(b)?
!a.disabled:"a"==b||"area"==b?a.href||!isNaN(d):!isNaN(d))&&!c(a)["area"==b?"parents":"closest"](":hidden").length},tabbable:function(a){var b=c.attr(a,"tabindex");return(isNaN(b)||b>=0)&&c(a).is(":focusable")}})}})(jQuery);
;/*!
 * jQuery UI Widget 1.8.2
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Widget
 */
(function(b){var j=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add(this).each(function(){b(this).triggerHandler("remove")});return j.call(b(this),a,c)})};b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=function(h){return!!b.data(h,a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend({},c.options);b[e][a].prototype=
b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):d;if(e&&d.substring(0,1)==="_")return h;e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==undefined){h=i;return false}}):this.each(function(){var g=
b.data(this,a);if(g){d&&g.option(d);g._init()}else b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){this.element=b(c).data(this.widgetName,this);this.options=b.extend(true,{},this.options,b.metadata&&b.metadata.get(c)[this.widgetName],a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();
this._init()},_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(a,c){var d=a,e=this;if(arguments.length===0)return b.extend({},e.options);if(typeof a==="string"){if(c===undefined)return this.options[a];d={};d[a]=c}b.each(d,function(f,
h){e._setOption(f,h)});return e},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",c);return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=
b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery);
;/*!
 * jQuery UI Mouse 1.8.2
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Mouse
 *
 * Depends:
 *	jquery.ui.widget.js
 */
(function(c){c.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(b){return a._mouseDown(b)}).bind("click."+this.widgetName,function(b){if(a._preventClickEvent){a._preventClickEvent=false;b.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(a){a.originalEvent=a.originalEvent||{};if(!a.originalEvent.mouseHandled){this._mouseStarted&&
this._mouseUp(a);this._mouseDownEvent=a;var b=this,e=a.which==1,f=typeof this.options.cancel=="string"?c(a.target).parents().add(a.target).filter(this.options.cancel).length:false;if(!e||f||!this._mouseCapture(a))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){b.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){this._mouseStarted=this._mouseStart(a)!==false;if(!this._mouseStarted){a.preventDefault();
return true}}this._mouseMoveDelegate=function(d){return b._mouseMove(d)};this._mouseUpDelegate=function(d){return b._mouseUp(d)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);c.browser.safari||a.preventDefault();return a.originalEvent.mouseHandled=true}},_mouseMove:function(a){if(c.browser.msie&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&&
this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=a.target==this._mouseDownEvent.target;this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-
a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery);
;/*
 * jQuery UI Position 1.8.2
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Position
 */
(function(c){c.ui=c.ui||{};var m=/left|center|right/,n=/top|center|bottom/,p=c.fn.position,q=c.fn.offset;c.fn.position=function(a){if(!a||!a.of)return p.apply(this,arguments);a=c.extend({},a);var b=c(a.of),d=(a.collision||"flip").split(" "),e=a.offset?a.offset.split(" "):[0,0],g,h,i;if(a.of.nodeType===9){g=b.width();h=b.height();i={top:0,left:0}}else if(a.of.scrollTo&&a.of.document){g=b.width();h=b.height();i={top:b.scrollTop(),left:b.scrollLeft()}}else if(a.of.preventDefault){a.at="left top";g=h=
0;i={top:a.of.pageY,left:a.of.pageX}}else{g=b.outerWidth();h=b.outerHeight();i=b.offset()}c.each(["my","at"],function(){var f=(a[this]||"").split(" ");if(f.length===1)f=m.test(f[0])?f.concat(["center"]):n.test(f[0])?["center"].concat(f):["center","center"];f[0]=m.test(f[0])?f[0]:"center";f[1]=n.test(f[1])?f[1]:"center";a[this]=f});if(d.length===1)d[1]=d[0];e[0]=parseInt(e[0],10)||0;if(e.length===1)e[1]=e[0];e[1]=parseInt(e[1],10)||0;if(a.at[0]==="right")i.left+=g;else if(a.at[0]==="center")i.left+=
g/2;if(a.at[1]==="bottom")i.top+=h;else if(a.at[1]==="center")i.top+=h/2;i.left+=e[0];i.top+=e[1];return this.each(function(){var f=c(this),k=f.outerWidth(),l=f.outerHeight(),j=c.extend({},i);if(a.my[0]==="right")j.left-=k;else if(a.my[0]==="center")j.left-=k/2;if(a.my[1]==="bottom")j.top-=l;else if(a.my[1]==="center")j.top-=l/2;j.left=parseInt(j.left);j.top=parseInt(j.top);c.each(["left","top"],function(o,r){c.ui.position[d[o]]&&c.ui.position[d[o]][r](j,{targetWidth:g,targetHeight:h,elemWidth:k,
elemHeight:l,offset:e,my:a.my,at:a.at})});c.fn.bgiframe&&f.bgiframe();f.offset(c.extend(j,{using:a.using}))})};c.ui.position={fit:{left:function(a,b){var d=c(window);b=a.left+b.elemWidth-d.width()-d.scrollLeft();a.left=b>0?a.left-b:Math.max(0,a.left)},top:function(a,b){var d=c(window);b=a.top+b.elemHeight-d.height()-d.scrollTop();a.top=b>0?a.top-b:Math.max(0,a.top)}},flip:{left:function(a,b){if(b.at[0]!=="center"){var d=c(window);d=a.left+b.elemWidth-d.width()-d.scrollLeft();var e=b.my[0]==="left"?
-b.elemWidth:b.my[0]==="right"?b.elemWidth:0,g=-2*b.offset[0];a.left+=a.left<0?e+b.targetWidth+g:d>0?e-b.targetWidth+g:0}},top:function(a,b){if(b.at[1]!=="center"){var d=c(window);d=a.top+b.elemHeight-d.height()-d.scrollTop();var e=b.my[1]==="top"?-b.elemHeight:b.my[1]==="bottom"?b.elemHeight:0,g=b.at[1]==="top"?b.targetHeight:-b.targetHeight,h=-2*b.offset[1];a.top+=a.top<0?e+b.targetHeight+h:d>0?e+g+h:0}}}};if(!c.offset.setOffset){c.offset.setOffset=function(a,b){if(/static/.test(c.curCSS(a,"position")))a.style.position=
"relative";var d=c(a),e=d.offset(),g=parseInt(c.curCSS(a,"top",true),10)||0,h=parseInt(c.curCSS(a,"left",true),10)||0;e={top:b.top-e.top+g,left:b.left-e.left+h};"using"in b?b.using.call(a,e):d.css(e)};c.fn.offset=function(a){var b=this[0];if(!b||!b.ownerDocument)return null;if(a)return this.each(function(){c.offset.setOffset(this,a)});return q.call(this)}}})(jQuery);
;/*
 * jQuery UI Slider 1.8.2
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Slider
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.mouse.js
 *	jquery.ui.widget.js
 */
(function(d){d.widget("ui.slider",d.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 a=this,b=this.options;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");b.disabled&&this.element.addClass("ui-slider-disabled ui-disabled");
this.range=d([]);if(b.range){if(b.range===true){this.range=d("<div></div>");if(!b.values)b.values=[this._valueMin(),this._valueMin()];if(b.values.length&&b.values.length!==2)b.values=[b.values[0],b.values[0]]}else this.range=d("<div></div>");this.range.appendTo(this.element).addClass("ui-slider-range");if(b.range==="min"||b.range==="max")this.range.addClass("ui-slider-range-"+b.range);this.range.addClass("ui-widget-header")}d(".ui-slider-handle",this.element).length===0&&d("<a href='#'></a>").appendTo(this.element).addClass("ui-slider-handle");
if(b.values&&b.values.length)for(;d(".ui-slider-handle",this.element).length<b.values.length;)d("<a href='#'></a>").appendTo(this.element).addClass("ui-slider-handle");this.handles=d(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(c){c.preventDefault()}).hover(function(){b.disabled||d(this).addClass("ui-state-hover")},function(){d(this).removeClass("ui-state-hover")}).focus(function(){if(b.disabled)d(this).blur();
else{d(".ui-slider .ui-state-focus").removeClass("ui-state-focus");d(this).addClass("ui-state-focus")}}).blur(function(){d(this).removeClass("ui-state-focus")});this.handles.each(function(c){d(this).data("index.ui-slider-handle",c)});this.handles.keydown(function(c){var e=true,f=d(this).data("index.ui-slider-handle"),g,h,i;if(!a.options.disabled){switch(c.keyCode){case d.ui.keyCode.HOME:case d.ui.keyCode.END:case d.ui.keyCode.PAGE_UP:case d.ui.keyCode.PAGE_DOWN:case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:e=
false;if(!a._keySliding){a._keySliding=true;d(this).addClass("ui-state-active");g=a._start(c,f);if(g===false)return}break}i=a.options.step;g=a.options.values&&a.options.values.length?(h=a.values(f)):(h=a.value());switch(c.keyCode){case d.ui.keyCode.HOME:h=a._valueMin();break;case d.ui.keyCode.END:h=a._valueMax();break;case d.ui.keyCode.PAGE_UP:h=a._trimAlignValue(g+(a._valueMax()-a._valueMin())/5);break;case d.ui.keyCode.PAGE_DOWN:h=a._trimAlignValue(g-(a._valueMax()-a._valueMin())/5);break;case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:if(g===
a._valueMax())return;h=a._trimAlignValue(g+i);break;case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(g===a._valueMin())return;h=a._trimAlignValue(g-i);break}a._slide(c,f,h);return e}}).keyup(function(c){var e=d(this).data("index.ui-slider-handle");if(a._keySliding){a._keySliding=false;a._stop(c,e);a._change(c,e);d(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(a){var b=this.options,c,e,f,g,h,i;if(b.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();c={x:a.pageX,y:a.pageY};e=this._normValueFromMouse(c);f=this._valueMax()-this._valueMin()+1;h=this;this.handles.each(function(j){var k=Math.abs(e-h.values(j));if(f>k){f=k;g=d(this);i=j}});if(b.range===true&&this.values(1)===b.min){i+=1;g=d(this.handles[i])}if(this._start(a,
i)===false)return false;this._mouseSliding=true;h._handleIndex=i;g.addClass("ui-state-active").focus();b=g.offset();this._clickOffset=!d(a.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:a.pageX-b.left-g.width()/2,top:a.pageY-b.top-g.height()/2-(parseInt(g.css("borderTopWidth"),10)||0)-(parseInt(g.css("borderBottomWidth"),10)||0)+(parseInt(g.css("marginTop"),10)||0)};e=this._normValueFromMouse(c);this._slide(a,i,e);return this._animateOff=true},_mouseStart:function(){return true},
_mouseDrag:function(a){var b=this._normValueFromMouse({x:a.pageX,y:a.pageY});this._slide(a,this._handleIndex,b);return false},_mouseStop:function(a){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(a,this._handleIndex);this._change(a,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b;
if(this.orientation==="horizontal"){b=this.elementSize.width;a=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{b=this.elementSize.height;a=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}b=a/b;if(b>1)b=1;if(b<0)b=0;if(this.orientation==="vertical")b=1-b;a=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+b*a)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=
this.values(b);c.values=this.values()}return this._trigger("start",a,c)},_slide:function(a,b,c){var e;if(this.options.values&&this.options.values.length){e=this.values(b?0:1);if(this.options.values.length===2&&this.options.range===true&&(b===0&&c>e||b===1&&c<e))c=e;if(c!==this.values(b)){e=this.values();e[b]=c;a=this._trigger("slide",a,{handle:this.handles[b],value:c,values:e});this.values(b?0:1);a!==false&&this.values(b,c,true)}}else if(c!==this.value()){a=this._trigger("slide",a,{handle:this.handles[b],
value:c});a!==false&&this.value(c)}},_stop:function(a,b){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b);c.values=this.values()}this._trigger("stop",a,c)},_change:function(a,b){if(!this._keySliding&&!this._mouseSliding){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b);c.values=this.values()}this._trigger("change",a,c)}},value:function(a){if(arguments.length){this.options.value=
this._trimAlignValue(a);this._refreshValue();this._change(null,0)}return this._value()},values:function(a,b){var c,e,f;if(arguments.length>1){this.options.values[a]=this._trimAlignValue(b);this._refreshValue();this._change(null,a)}if(arguments.length)if(d.isArray(arguments[0])){c=this.options.values;e=arguments[0];for(f=0;f<c.length;f+=1){c[f]=this._trimAlignValue(e[f]);this._change(null,f)}this._refreshValue()}else return this.options.values&&this.options.values.length?this._values(a):this.value();
else return this._values()},_setOption:function(a,b){var c,e=0;if(d.isArray(this.options.values))e=this.options.values.length;d.Widget.prototype._setOption.apply(this,arguments);switch(a){case "disabled":if(b){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.attr("disabled","disabled");this.element.addClass("ui-disabled")}else{this.handles.removeAttr("disabled");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(c=0;c<e;c+=1)this._change(null,c);this._animateOff=false;break}},_value:function(){var a=this.options.value;return a=this._trimAlignValue(a)},_values:function(a){var b,c;if(arguments.length){b=this.options.values[a];
return b=this._trimAlignValue(b)}else{b=this.options.values.slice();for(c=0;c<b.length;c+=1)b[c]=this._trimAlignValue(b[c]);return b}},_trimAlignValue:function(a){if(a<this._valueMin())return this._valueMin();if(a>this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=a%b;a=a-c;if(Math.abs(c)*2>=b)a+=c>0?b:-b;return parseFloat(a.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var a=
this.options.range,b=this.options,c=this,e=!this._animateOff?b.animate:false,f,g={},h,i,j,k;if(this.options.values&&this.options.values.length)this.handles.each(function(l){f=(c.values(l)-c._valueMin())/(c._valueMax()-c._valueMin())*100;g[c.orientation==="horizontal"?"left":"bottom"]=f+"%";d(this).stop(1,1)[e?"animate":"css"](g,b.animate);if(c.options.range===true)if(c.orientation==="horizontal"){if(l===0)c.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},b.animate);if(l===1)c.range[e?"animate":"css"]({width:f-
h+"%"},{queue:false,duration:b.animate})}else{if(l===0)c.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},b.animate);if(l===1)c.range[e?"animate":"css"]({height:f-h+"%"},{queue:false,duration:b.animate})}h=f});else{i=this.value();j=this._valueMin();k=this._valueMax();f=k!==j?(i-j)/(k-j)*100:0;g[c.orientation==="horizontal"?"left":"bottom"]=f+"%";this.handle.stop(1,1)[e?"animate":"css"](g,b.animate);if(a==="min"&&this.orientation==="horizontal")this.range.stop(1,1)[e?"animate":"css"]({width:f+"%"},
b.animate);if(a==="max"&&this.orientation==="horizontal")this.range[e?"animate":"css"]({width:100-f+"%"},{queue:false,duration:b.animate});if(a==="min"&&this.orientation==="vertical")this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},b.animate);if(a==="max"&&this.orientation==="vertical")this.range[e?"animate":"css"]({height:100-f+"%"},{queue:false,duration:b.animate})}}});d.extend(d.ui.slider,{version:"1.8.2"})})(jQuery);
;
(function($){$.fn.jsonSuggest=function(searchData,settings){var defaults={minCharacters:1,maxResults:undefined,wildCard:"",caseSensitive:false,notCharacter:"!",maxHeight:350,highlightMatches:true,onSelect:undefined,ajaxResults:false};settings=$.extend(defaults,settings);return this.each(function(){function regexEscape(txt,omit){var specials=['/','.','*','+','?','|','(',')','[',']','{','}','\\'];if(omit){for(var i=0;i<specials.length;i++){if(specials[i]===omit){specials.splice(i,1);}}}
var escapePatt=new RegExp('(\\'+specials.join('|\\')+')','g');return txt.replace(escapePatt,'\\$1');}
var obj=$(this),wildCardPatt=new RegExp(regexEscape(settings.wildCard||''),'g'),results=$('<div />'),currentSelection,pageX,pageY;function selectResultItem(item){obj.val(item.text);$(results).html('').hide();if(typeof settings.onSelect==='function'){settings.onSelect(item);}}
function setHoverClass(el){$('div.resultItem',results).removeClass('hover');$(el).addClass('hover');currentSelection=el;}
function buildResults(resultObjects,sFilterTxt){sFilterTxt="("+sFilterTxt+")";var bOddRow=true,i,iFound=0,filterPatt=settings.caseSensitive?new RegExp(sFilterTxt,"g"):new RegExp(sFilterTxt,"ig");$(results).html('').hide();for(i=0;i<resultObjects.length;i+=1){var item=$('<div />'),text=resultObjects[i].text;if(settings.highlightMatches===true){text=text.replace(filterPatt,"<strong>$1</strong>");}
$(item).append('<p class="text">'+text+'</p>');if(typeof resultObjects[i].extra==='string'){$(item).append('<p class="extra">'+resultObjects[i].extra+'</p>');}
if(typeof resultObjects[i].image==='string'){$(item).prepend('<img src="'+resultObjects[i].image+'" />').append('<br style="clear:both;" />');}
$(item).addClass('resultItem').addClass((bOddRow)?'odd':'even').click(function(n){return function(){selectResultItem(resultObjects[n]);};}(i)).mouseover(function(el){return function(){setHoverClass(el);};}(item));$(results).append(item);bOddRow=!bOddRow;iFound+=1;if(typeof settings.maxResults==='number'&&iFound>=settings.maxResults){break;}}
if($('div',results).length>0){currentSelection=undefined;$(results).show().css('height','auto');if($(results).height()>settings.maxHeight){$(results).css({'overflow':'auto','height':settings.maxHeight+'px'});}}}
function runSuggest(e){if(this.value.length<settings.minCharacters){$(results).html('').hide();return false;}
var resultObjects=[],sFilterTxt=(!settings.wildCard)?regexEscape(this.value):regexEscape(this.value,settings.wildCard).replace(wildCardPatt,'.*'),bMatch=true,filterPatt,i;if(settings.notCharacter&&sFilterTxt.indexOf(settings.notCharacter)===0){sFilterTxt=sFilterTxt.substr(settings.notCharacter.length,sFilterTxt.length);if(sFilterTxt.length>0){bMatch=false;}}
sFilterTxt=sFilterTxt||'.*';sFilterTxt=settings.wildCard?'^'+sFilterTxt:sFilterTxt;filterPatt=settings.caseSensitive?new RegExp(sFilterTxt):new RegExp(sFilterTxt,"i");if(settings.ajaxResults===true){resultObjects=searchData(this.value,settings.wildCard,settings.caseSensitive,settings.notCharacter);if(typeof resultObjects==='string'){resultObjects=JSON.parse(resultObjects);}}
else{for(i=0;i<searchData.length;i+=1){if(filterPatt.test(searchData[i].text)===bMatch){resultObjects.push(searchData[i]);}}}
buildResults(resultObjects,sFilterTxt);}
function keyListener(e){switch(e.keyCode){case 13:$(currentSelection).trigger('click');return false;case 40:if(typeof currentSelection==='undefined'){currentSelection=$('div.resultItem:first',results).get(0);}
else{currentSelection=$(currentSelection).next().get(0);}
setHoverClass(currentSelection);if(currentSelection){$(results).scrollTop(currentSelection.offsetTop);}
return false;case 38:if(typeof currentSelection==='undefined'){currentSelection=$('div.resultItem:last',results).get(0);}
else{currentSelection=$(currentSelection).prev().get(0);}
setHoverClass(currentSelection);if(currentSelection){$(results).scrollTop(currentSelection.offsetTop);}
return false;default:runSuggest.apply(this,[e]);}}
$(results).addClass('jsonSuggestResults').css({'top':(obj.position().top+obj.height()+5)+'px','left':obj.position().left+'px','width':obj.width()+'px'}).hide();obj.after(results).keyup(keyListener).blur(function(e){var resPos=$(results).offset();resPos.bottom=resPos.top+$(results).height();resPos.right=resPos.left+$(results).width();if(pageY<resPos.top||pageY>resPos.bottom||pageX<resPos.left||pageX>resPos.right){$(results).hide();}}).focus(function(e){$(results).css({'top':(obj.position().top+obj.height()+5)+'px','left':obj.position().left+'px'});if($('div',results).length>0){$(results).show();}}).attr('autocomplete','off');$().mousemove(function(e){pageX=e.pageX;pageY=e.pageY;});if($.browser.opera){obj.keydown(function(e){if(e.keyCode===40){return keyListener(e);}});}
settings.notCharacter=regexEscape(settings.notCharacter||'');if(!settings.ajaxResults){if(typeof searchData==='function'){searchData=searchData();}
if(typeof searchData==='string'){searchData=JSON.parse(searchData);}}});};})(jQuery);
if(!this.JSON){JSON=function(){function f(n){return n<10?'0'+n:n;}
Date.prototype.toJSON=function(key){return this.getUTCFullYear()+'-'+
f(this.getUTCMonth()+1)+'-'+
f(this.getUTCDate())+'T'+
f(this.getUTCHours())+':'+
f(this.getUTCMinutes())+':'+
f(this.getUTCSeconds())+'Z';};var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapeable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){escapeable.lastIndex=0;return escapeable.test(string)?'"'+string.replace(escapeable,function(a){var c=meta[a];if(typeof c==='string'){return c;}
return'\\u'+('0000'+
(+(a.charCodeAt(0))).toString(16)).slice(-4);})+'"':'"'+string+'"';}
function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(key);}
if(typeof rep==='function'){value=rep.call(holder,key,value);}
switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';}
gap+=indent;partial=[];if(typeof value.length==='number'&&!(value.propertyIsEnumerable('length'))){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||'null';}
v=partial.length===0?'[]':gap?'[\n'+gap+
partial.join(',\n'+gap)+'\n'+
mind+']':'['+partial.join(',')+']';gap=mind;return v;}
if(rep&&typeof rep==='object'){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==='string'){v=str(k,value,rep);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value,rep);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}
v=partial.length===0?'{}':gap?'{\n'+gap+partial.join(',\n'+gap)+'\n'+
mind+'}':'{'+partial.join(',')+'}';gap=mind;return v;}}
return{stringify:function(value,replacer,space){var i;gap='';indent='';if(typeof space==='number'){for(i=0;i<space;i+=1){indent+=' ';}}else if(typeof space==='string'){indent=space;}
rep=replacer;if(replacer&&typeof replacer!=='function'&&(typeof replacer!=='object'||typeof replacer.length!=='number')){throw new Error('JSON.stringify');}
return str('',{'':value});},parse:function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==='object'){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v;}else{delete value[k];}}}}
return reviver.call(holder,key,value);}
cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return'\\u'+('0000'+
(+(a.charCodeAt(0))).toString(16)).slice(-4);});}
if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){j=eval('('+text+')');return typeof reviver==='function'?walk({'':j},''):j;}
throw new SyntaxError('JSON.parse');}};}();}
function stadiumCapacityCheck(capacity){if(capacity.length==0){document.getElementById("capacityStatus").innerHTML="<font style='color:#FF0000;'>Enter a valid number</font>";return;}
capacity=Number(capacity);if(capacity==""||capacity==null||isNaN(capacity)){document.getElementById("capacityStatus").innerHTML="<font style='color:#FF0000;'>Enter a valid number</font>";}else if(capacity<3500||capacity>20000){document.getElementById("capacityStatus").innerHTML="<font style='color:#FF0000;'>Stand capacity be between 3500 and 20000</font>";}else{document.getElementById("capacityStatus").innerHTML="<font style='color:#009900;'>"+capacity+" stand capacity valid</font>";}}
function changeTraining(playerNo,teamNo,pAuthCode,tAuthCode,trainType,trainIntensity,fromPage,pCount,isWaiting){if(fromPage=="p"){$("#playerTraining").html("Updating...");$.ajax({url:"/includes/ajax/changePlayerTraining.php"+"?teamNo="+teamNo+"&playerNo="+playerNo+"&authCode="+pAuthCode+"&trainType="+trainType+"&trainIntensity="+trainIntensity+"&isWaiting="+isWaiting+"&randNum="+Math.random(),success:function(data){$("#playerTraining").html("<font style='color:#009900;'>OK</font>");if(trainType=="NN"){$("#trainingIntensityEnabled").hide();$("#trainingIntensityDisabled").show();}else{$("#trainingIntensityEnabled").show();$("#trainingIntensityDisabled").hide();}}});}else if(fromPage=="s"){document.getElementById("trainingType_"+pCount).disabled=true;document.getElementById("trainingIntensity_"+pCount).disabled=true;$.ajax({url:"/includes/ajax/changePlayerTraining.php"+"?teamNo="+teamNo+"&playerNo="+playerNo+"&authCode="+pAuthCode+"&trainType="+trainType+"&trainIntensity="+trainIntensity+"&isWaiting="+isWaiting+"&randNum="+Math.random(),success:function(data){document.getElementById("trainingType_"+pCount).disabled=false;document.getElementById("trainingIntensity_"+pCount).disabled=false;$("#squadTable_"+pCount).html("<font style='color:#009900;'>OK</font>");getTrainingMultiplier(teamNo,tAuthCode);if(trainType=="NN"){$("#trainingIntensityEnabled_"+pCount).hide();$("#trainingIntensityDisabled_"+pCount).show();}else{$("#trainingIntensityEnabled_"+pCount).show();$("#trainingIntensityDisabled_"+pCount).hide();}}});}}
var xmlHttp4;function calculatePrizeMoney(str,entrants,countryValue){if(str.length==0){document.getElementById("calculatePrizeMoney").innerHTML="";return;}
xmlHttp4=GetXmlHttpObject();if(xmlHttp4==null){alert("Browser does not support HTTP Request");return;}
var url="/includes/ajax/prizeMoney.php";url=url+"?q="+str+"&entrants="+entrants+"&countryValue="+countryValue;url=url+"&sid="+Math.random();xmlHttp4.onreadystatechange=stateChanged;xmlHttp4.open("GET",url,true);xmlHttp4.send(null);}
function stateChanged(){if(xmlHttp4.readyState==4||xmlHttp4.readyState=="complete"){document.getElementById("calculatePrizeMoney").innerHTML=xmlHttp4.responseText;}}function editLineupSwap(hasMembership,authCode,teamNo,matchNo,matchServerNo,isDefaultLineup,matchEngineVersion){var checkCount=0;var player1pos=null;var player2pos=null;for(i=0;i<=10;i++){if(document.lineupForm[i].playerCheck.checked){if(player1pos==null){player1pos=i;}else{player2pos=i;}
checkCount++;}}
if(checkCount<2){document.getElementById("swapPlayers").innerHTML="<font color='#FFFFFF'>Select 2 players to perform a swap</font>";return;}else if(checkCount==2&&document.lineupForm[player1pos].newPosition.value==0&&document.lineupForm[player2pos].newPosition.value==0){document.getElementById("swapPlayers").innerHTML="<font color='#FFFFFF'>One position must be non-empty!</font>";}else if(checkCount==2){document.getElementById("swapPlayers").innerHTML="<input type='hidden' name='playerSwapPos1' value='"+player1pos+"'><input type='hidden' name='playerSwapPos2' value='"+player2pos+"'><input type='button' onclick=\"swapPlayers('"+authCode+"',"+teamNo+","+matchNo+","+player1pos+","+player2pos+","+matchServerNo+","+hasMembership+", "+isDefaultLineup+", "+matchEngineVersion+");\" class='button' value='Swap these players' style='width:150px;'>";return;}else{document.getElementById("swapPlayers").innerHTML="<font color='#FFFFFF'>More than 2 players selected</font>";return;}}
var lastShownLiveActionID=null;var xmlHttp3;function newLiveAction(leagueID,competitionID){xmlHttp3=GetXmlHttpObject();if(xmlHttp3==null){alert("Browser does not support HTTP Request");return;}
var url="/modules/includes/match/ajax/checkNewPostings.php";if(lastShownLiveActionID==null){url=url+"?lastShownLiveActionID=0&initialLoad=1&leagueID="+leagueID+"&competitionID="+competitionID+"&randNum="+Math.random();}else{url=url+"?lastShownLiveActionID="+lastShownLiveActionID+"&leagueID="+leagueID+"&competitionID="+competitionID+"&randNum="+Math.random();}
xmlHttp3.onreadystatechange=function(){if(xmlHttp3.readyState==4||xmlHttp3.readyState=="complete"){addLiveAction(leagueID,competitionID);}};xmlHttp3.open("GET",url,true);xmlHttp3.send(null);setTimeout("newLiveAction("+leagueID+","+competitionID+");",5000);}
function addLiveAction(leagueID,competitionID){var result;var resultArray;if(xmlHttp3.readyState==4||xmlHttp3.readyState=="complete"){result=xmlHttp3.responseText;if(result.length>0||lastShownLiveActionID==null){if(lastShownLiveActionID==null){if(result.length>0){resultArray=result.split("###");for(i=1;i<=(resultArray.length+1);i++){result=resultArray[i-1].split("##");result[3]=parseInt(result[3]);result[4]=parseInt(result[4]);if(i==1){lastShownLiveActionID=parseInt(result[0]);}
if(result[5]==4){document.getElementById("liveAction"+i+"Text").innerHTML="<i>"+90+"'</i> <a href=\"/modules/match.php?ID="+result[2]+"\" class='fontDefaultLink' style=\"text-decoration:none;\">FT</a> "+result[1];}else if(result[5]==3){document.getElementById("liveAction"+i+"Text").innerHTML="<i>"+1+"'</i> <a href=\"/modules/match.php?ID="+result[2]+"\" class='fontDefaultLink' style=\"text-decoration:none;\">KICK OFF</a> "+result[1];}else{document.getElementById("liveAction"+i+"Text").innerHTML="<i>"+result[3]+"'</i> <a href=\"/modules/match.php?ID="+result[2]+"\" class='fontDefaultLink' style=\"text-decoration:none;\">GOAL</a> "+result[1];}}}else{document.getElementById("liveAction1Text").innerHTML="No live action updates...";}}else{result=result.split("##");lastShownLiveActionID=parseInt(result[0]);var j;for(j=16;j>=2;j--){document.getElementById("liveAction"+j+"Text").innerHTML=document.getElementById("liveAction"+(j-1)+"Text").innerHTML;}
document.getElementById("liveAction1Text").innerHTML="<i>"+result[3]+"'</i> <a href=\"/modules/match.php?ID="+result[2]+"\" class=\"fontDefaultLink\" style=\"text-decoration:none;\">GOAL</a> "+result[1];}}}}var virtualTourNo=1;var virtualTourContent=[];virtualTourContent[1]=["<b>Don't spend 90 minutes refreshing the page!</b>","Realtime match content loads automatically to the match viewer, as well as live scores in the league/cup you are entered into, so there will be no more refreshing the page!"];virtualTourContent[2]=["<b>Become the ultimate football boss!</b>","Run all aspects of your football team including staff, players, finances, lineups and tactics. All must be mastered to beat the competition."];virtualTourContent[3]=["<b>Control your club's stadium</b>","Keep the fans happy by building a stadium they will be keen to attend. Be careful to size it correctly as stadiums must pay maintenance."];virtualTourContent[4]=["<b>Player Training</b>","Set an individual training method for each players in your squad, choose the training type and intensity. Also select your clubs training days."];virtualTourContent[5]=["<b>Hire and Fire Staff</b>","Hire staff to help the running of your club. Hire a physio to minimise injuries, hire specific coaches to aid training performance, even hire a youth team coach to recommened youth players."];function nextVirtualTour(virtualTourMax,autoRotate){if(autoRotate==false){manualRotate=true;}
if(virtualTourNo<virtualTourMax){virtualTourNo++;document.getElementById("virtualTourTitle").innerHTML=virtualTourContent[virtualTourNo][0];for(var i=1;i<=virtualTourMax;i++){document.getElementById("virtualTourImage"+i).style.display="none";}
document.getElementById("virtualTourImage"+virtualTourNo).style.display="block";document.getElementById("virtualTourDesc").innerHTML=virtualTourContent[virtualTourNo][1];if(virtualTourNo==virtualTourMax){document.getElementById("rightLink").innerHTML="";}else{document.getElementById("rightLink").innerHTML="<a href='javascript:nextVirtualTour("+virtualTourMax+", false)' class='fontDefaultLink'>>></a>";}
document.getElementById("leftLink").innerHTML="<a href='javascript:previousVirtualTour("+virtualTourMax+", false)' class='fontDefaultLink'><<</a>";}}
function previousVirtualTour(virtualTourMax,autoRotate){if(autoRotate==false){manualRotate=true;}
if(virtualTourNo>1){virtualTourNo--;document.getElementById("virtualTourTitle").innerHTML=virtualTourContent[virtualTourNo][0];for(var i=1;i<=virtualTourMax;i++){document.getElementById("virtualTourImage"+i).style.display="none";}
document.getElementById("virtualTourImage"+virtualTourNo).style.display="block";document.getElementById("virtualTourDesc").innerHTML=virtualTourContent[virtualTourNo][1];if(virtualTourNo==1){document.getElementById("leftLink").innerHTML="";}else{document.getElementById("leftLink").innerHTML="<a href='javascript:previousVirtualTour("+virtualTourMax+", false)' class='fontDefaultLink'><<</a>";}
document.getElementById("rightLink").innerHTML="<a href='javascript:nextVirtualTour("+virtualTourMax+", false)' class='fontDefaultLink'>>></a>";}}
var hiddenScoreTemp="";var hiddenScoreTempTop="";var xmlHttp5;function voteAndNews(contentType){if(contentType=='vote'){document.getElementById("voteAndNews").innerHTML="Vote";}else if(contentType=='news'){document.getElementById("voteAndNews").innerHTML="News";}}
function hideHomeScore(teamNo,userType,e){if(e!=null){if(!e)var e=window.event;e.cancelBubble=true;if(e.stopPropagation)e.stopPropagation();}
if(document.getElementById("homeLiveScore")){hiddenScoreTemp=document.getElementById("homeLiveScore").innerHTML;}
if(document.getElementById("homeLiveScore_top")){hiddenScoreTempTop=document.getElementById("homeLiveScore_top").innerHTML;document.getElementById("homeLiveScore_top").innerHTML="<font style='color:#FFFF00;'>Score Hidden</font> [<a href='javascript:void(0);' onclick=\"showHomeScore("+teamNo+",'"+userType+"',event)\" class='fontDefaultLink' style='text-decoration:none; color:#CCCCCC;'>Show score</a>]";}
if(document.getElementById("homeLiveScore")){document.getElementById("homeLiveScore").innerHTML="<font style='color:#666666;'>Score Hidden</font> [<a href='javascript:void(0);' onclick=\"showHomeScore("+teamNo+",'"+userType+"',event)\" class='fontDefaultLink' style='text-decoration:none;'>Show score</a>]";}
xmlHttp5=GetXmlHttpObject();if(xmlHttp5==null){alert("Browser does not support HTTP Request");return;}
var url="/includes/ajax/showHideScorePreference.php";url=url+"?teamNo="+teamNo+"&userType="+userType+"&newPref=0&randNum="+Math.random();xmlHttp5.open("GET",url,true);xmlHttp5.send(null);}
function showHomeScore(teamNo,userType,e){if(e!=null){if(!e)var e=window.event;e.cancelBubble=true;if(e.stopPropagation)e.stopPropagation();}
if(document.getElementById("homeLiveScore_top")){document.getElementById("homeLiveScore_top").innerHTML=hiddenScoreTempTop;}
if(document.getElementById("homeLiveScore").innerHTML){document.getElementById("homeLiveScore").innerHTML=hiddenScoreTemp;}
xmlHttp5=GetXmlHttpObject();if(xmlHttp5==null){alert("Browser does not support HTTP Request");return;}
var url="/includes/ajax/showHideScorePreference.php";url=url+"?teamNo="+teamNo+"&userType="+userType+"&newPref=1&randNum="+Math.random();xmlHttp5.open("GET",url,true);xmlHttp5.send(null);}
function nextGameCountdown(seconds,divSelector){var secondsLeft=seconds;var days=Math.floor(secondsLeft/86400);if(days>0){secondsLeft=secondsLeft%86400;var hours=Math.floor(secondsLeft/3600);secondsLeft=secondsLeft%3600;var minutes=Math.floor(secondsLeft/60);secondsLeft=(secondsLeft%60).toString();}else{var hours=Math.floor(secondsLeft/3600);secondsLeft=secondsLeft%3600;var minutes=Math.floor(secondsLeft/60);secondsLeft=(secondsLeft%60).toString();}
if(secondsLeft.length<2){secondsLeft="0"+secondsLeft;}
if(document.getElementById("nextMatchCountdown_"+divSelector)!=null){if(days>0){document.getElementById("nextMatchCountdown_"+divSelector).innerHTML="<font style='font-size:11px;'>(<i><b>"+days+"</b> days, <b>"+hours+"</b> hrs, <b>"+minutes+"</b> mins</i>)</font>";}else{document.getElementById("nextMatchCountdown_"+divSelector).innerHTML="<font style='font-size:11px;'>(<i><b>"+hours+"</b> hrs, <b>"+minutes+"</b> mins, <b>"+secondsLeft+"</b> secs</i>)</font>";}}
setTimeout("nextGameCountdown("+(seconds-1)+", '"+divSelector+"')",985);}
var xmlHttp1;function addslashes(str){str=str.replace(/\\/g,'\\\\');str=str.replace(/\'/g,'\\\'');str=str.replace(/\"/g,'\\"');str=str.replace(/\0/g,'\\0');return str;}
function clubOverview(contentType){if(contentType=='overview'){document.getElementById("clubOverview_overview").style.display="inline";document.getElementById("clubOverview_fixtures").style.display="none";}else if(contentType=='fixtures'){document.getElementById("clubOverview_overview").style.display="none";document.getElementById("clubOverview_fixtures").style.display="inline";}}
function showFixtures(contentType,username,isMember,numFriendsOnline,homeKit,awayKit,teamName,financeString,teamNo,numAlerts,userType,hasReadWelcomeMail,limitedCompletedTasks){var result;var resultArray;if(xmlHttp1.readyState==4||xmlHttp1.readyState=="complete"){result=xmlHttp1.responseText;var content="";if(result.length>0){resultArray=result.split("###");for(i=0;i<(resultArray.length);i++){result=resultArray[i].split("##");content+=result[0]+" "+result[3]+" - <a href='/modules/match.php?ID="+result[1]+"' class='fontDefaultLink' style='color:#FFFFFF;'>"+result[2]+"</a>"+"<br/>";}}else{content+="No matches scheduled.";}
document.getElementById("clubOverview").innerHTML="<font style='font-size:10px;'>"+content+"</font>";document.getElementById("clubOverviewOverview").innerHTML="<a href='#' onclick=\"clubOverview('overview', '"+username+"', "+isMember+", "+numFriendsOnline+", '"+homeKit+"', '"+awayKit+"', '"+addslashes(teamName)+"', '"+financeString+"', "+teamNo+", "+numAlerts+", '"+userType+"', "+hasReadWelcomeMail+", "+limitedCompletedTasks+")\" class='fontDefaultLink' style='color:#FFFFFF;'>Overview</a>";document.getElementById("clubOverviewFixtures").innerHTML="<font style='font-size:10px;'>Fixtures</font>";}}
var xmlHttp1;var compVarArray=[];function addslashes(str){str=str.replace(/\\/g,'\\\\');str=str.replace(/\'/g,'\\\'');str=str.replace(/\"/g,'\\"');str=str.replace(/\0/g,'\\0');return str;}
function clubCompetitions(contentType){if(contentType=='overview'){document.getElementById("clubCompetition_overview").style.display="inline";document.getElementById("clubCompetition_league").style.display="none";document.getElementById("clubCompetition_cup").style.display="none";document.getElementById("clubCompetition_ntcup").style.display="none";}else if(contentType=='league'){document.getElementById("clubCompetition_overview").style.display="none";document.getElementById("clubCompetition_league").style.display="inline";document.getElementById("clubCompetition_cup").style.display="none";document.getElementById("clubCompetition_ntcup").style.display="none";}else if(contentType=='cup'){document.getElementById("clubCompetition_overview").style.display="none";document.getElementById("clubCompetition_league").style.display="none";document.getElementById("clubCompetition_cup").style.display="inline";document.getElementById("clubCompetition_ntcup").style.display="none";}else if(contentType=='NTCup'){document.getElementById("clubCompetition_overview").style.display="none";document.getElementById("clubCompetition_league").style.display="none";document.getElementById("clubCompetition_cup").style.display="none";document.getElementById("clubCompetition_ntcup").style.display="inline";}}
var positionArray=["st","nd","rd","th","th","th","th","th","th","th","th","th"];var roundArray=["Final","Semi-Final","Quarter Final"];function initCompetitionVariables(leaguePosString,leagueDivisionString,cupID,cupName,searchText,createCupText,drawBeenMade,roundsLeft,totalRounds,roundNum,roundArrayText,numEntrants,totalSpaces,prizemoney,autodrawDate,numNewCupPosts,cupRoundsComplete,leagueWinLossDrawString,numLeagueRoundsComplete,numNewLeaguePosts,numNewLeaguePostsDate){compVarArray[0]=leaguePosString;compVarArray[1]=leagueDivisionString;compVarArray[2]=cupID;compVarArray[3]=cupName;compVarArray[4]=searchText;compVarArray[5]=createCupText;compVarArray[6]=drawBeenMade;compVarArray[7]=Number(roundsLeft);compVarArray[8]=totalRounds;compVarArray[9]=roundNum;compVarArray[10]=roundArrayText;compVarArray[11]=numEntrants;compVarArray[12]=totalSpaces;compVarArray[13]=prizemoney;compVarArray[14]=autodrawDate;compVarArray[15]=numNewCupPosts;compVarArray[16]=cupRoundsComplete;compVarArray[17]=leagueWinLossDrawString;compVarArray[18]=Number(numLeagueRoundsComplete);compVarArray[19]=numNewLeaguePosts;compVarArray[20]=numNewLeaguePostsDate;}
function clubCompetitionsOverview(){var contents="";contents+="<table cellpadding='0px' cellspacing='0px' style='font-size:11px;'><tr><td><font style='font-size:10px;'><font style='font-weight:bold; font-size:10px; color:#FFFFFF; text-decoration:none;'>Competitions</font>: (Overview / <a href='#bcs' onClick='clubCompetitionsLeague()' class='fontDefaultLink' style='color:#FFFFFF;'>League</a> / <a href='#bcs' onClick='clubCompetitionsCup()' class='fontDefaultLink' style='color:#FFFFFF;'>Cup</a>)</font></td></tr><tr><td style='padding-top:5px;'><div class='divBackground' style='height:16px; width:17px; background:url(/images/newLayout/combinedIcons.png); background-position: -0px -283px;'></div> <font style='font-weight:bold; font-size:13px;'>"+compVarArray[0]+"</font> in <a href='/modules/league.php' class='fontDefaultLink' style='text-decoration:none; color:#FFFFFF;'>"+compVarArray[1]+"</a></td></tr><tr><td><div class='divBackground' style='height:16px; width:17px; background:url(/images/newLayout/combinedIcons.png); background-position: -0px -299px;'></div> ";if(compVarArray[2]==""){contents+="<font style='font-size:14px; font-weight:bold; color:#FFFF00;'>--</font> <a href='/modules/cupSearch.php' class='fontDefaultLink' style='text-decoration:none; color:#FFFFFF;'>"+compVarArray[4]+"</a> / <a href='/modules/createCup.php' class='fontDefaultLink' style='text-decoration:none; color:#FFFFFF;'>"+compVarArray[5]+"</a>";}else{if(compVarArray[6]==false){contents+="<font style='font-size:13px; font-weight:bold; color:#FFFF00;'>- -</font>";}else if(compVarArray[7]<=3){contents+="<font style='font-size:13px; font-weight:bold; color:#FFFF00;'>"+compVarArray[10]+"</font> of ";}else{var numPrelimRounds=compVarArray[8]-3;var prelimRoundNum=(compVarArray[16]+1);contents+="<font style='font-size:11px; font-weight:bold; color:#FFFF00;'>"+prelimRoundNum+positionArray[(prelimRoundNum-1)]+" Round</font> of ";}
contents+=" <a href='/modules/cupViewer.php?ID="+compVarArray[2]+"' class='fontDefaultLink' style='text-decoration:none; color:#FFFFFF;'>"+compVarArray[3]+"</a>";}
contents+="</td></tr></table>";document.getElementById("clubCompetition").innerHTML=contents;}
function clubCompetitionsLeague(){var contents="";contents+="<table cellpadding='0px' cellspacing='0px' style='font-size:11px;'><tr><td><font style='font-size:10px;'><font style='font-weight:bold; font-size:10px; color:#FFFFFF; text-decoration:none;'>Competitions</font>: (<a href='#bcs' onClick='clubCompetitionsOverview()' class='fontDefaultLink' style='color:#FFFFFF;'>Overview</a> / League / <a href='#bcs' onClick='clubCompetitionsCup()' class='fontDefaultLink' style='color:#FFFFFF;'>Cup</a>)</font></td></tr><tr><td style='padding-top:2px;'><div class='divBackground' style='height:16px; width:17px; background:url(/images/newLayout/combinedIcons.png); background-position: -0px -283px;'></div> <font style='font-weight:bold; font-size:13px;'>"+compVarArray[0]+"</font> in <a href='/modules/league.php' class='fontDefaultLink' style='text-decoration:none; color:#FFFFFF'>"+compVarArray[1]+"</a></td></tr><tr><td style='padding-top:2px;'>"+compVarArray[17]+"</td></tr><tr><td style='padding-top:2px;'>";var roundNum;if(compVarArray[18]<=18){roundNum=compVarArray[18];}else{roundNum=compVarArray[18]%18;}
contents+="Next round: "+roundNum+"/18 ";if(compVarArray[19]==0){contents+="(<img src='/images/icons/mailInverted.jpg'> <a href='/modules/league.php' class='fontDefaultLink' style='text-decoration:none; color:#FFFFFF;'>0 new posts</a>)";}else{contents+="(<img src='/images/icons/mailInverted.jpg'> <a href='/modules/league.php' class='fontDefaultLink' style='text-decoration:none; color:#FFFFFF;'>"+compVarArray[19]+" new posts</a>)";}
contents+="</td></tr></table>";document.getElementById("clubCompetition").innerHTML=contents;}
function clubCompetitionsCup(){var contents="";contents="<table cellpadding='0px' cellspacing='0px' style='font-size:11px;'><tr><td><font style='font-size:10px;'><font style='font-weight:bold; font-size:10px; color:#FFFFFF; text-decoration:none;'>Competitions</font>: (<a href='#bcs' onClick='clubCompetitionsOverview()' class='fontDefaultLink' style='color:#FFFFFF;'>Overview</a> / <a href='#bcs' onClick='clubCompetitionsLeague()' class='fontDefaultLink' style='color:#FFFFFF;'>League</a> / Cup)</font></td></tr>";contents+="<tr><td style='padding-top:2px;'><div class='divBackground' style='height:16px; width:17px; background:url(/images/newLayout/combinedIcons.png); background-position: -0px -299px;'></div> ";if(compVarArray[2]==""){contents+="<font style='font-size:14px; font-weight:bold; color:#FFFF00;'>--</font> <a href='/modules/cupSearch.php' class='fontDefaultLink' style='text-decoration:none; color:#FFFFFF;'>"+compVarArray[4]+"</a> / <a href='/modules/createCup.php' class='fontDefaultLink' style='text-decoration:none; color:#FFFFFF;'>"+compVarArray[5]+"</a>";}else{if(compVarArray[6]==false){contents+="<font style='font-size:13px; font-weight:bold; color:#FFFF00;'>- -</font>";}else if(compVarArray[7]<=3){contents+="<font style='font-size:13px; font-weight:bold; color:#FFFF00;'>"+compVarArray[10]+"</font> of ";}else{var numPrelimRounds=compVarArray[8]-3;var prelimRoundNum=(compVarArray[16]+1);contents+="<font style='font-size:11px; font-weight:bold; color:#FFFF00;'>"+prelimRoundNum+positionArray[(prelimRoundNum-1)]+" Round</font> of ";}
contents+=" <a href='/modules/cupViewer.php?ID="+compVarArray[2]+"' class='fontDefaultLink' style='text-decoration:none; color:#FFFFFF;'>"+compVarArray[3]+"</a>";contents+="</td></tr><tr><td style='padding-top:2px;'><font style='font-size:10px;'>";if(compVarArray[6]==true){contents+=compVarArray[11]+"/"+compVarArray[12]+" entrants";}else{contents+=compVarArray[11]+"/"+compVarArray[12]+" entrants";}
if(compVarArray[15]==0){contents+="(<img src='/images/icons/cupMessage.jpg'> <a href='/modules/cupViewer.php?ID="+compVarArray[2]+"' class='fontDefaultLink' style='text-decoration:none; color:#FFFFFF;'>0 new posts</a>)";}else{contents+="(<img src='/images/icons/cupMessage.jpg'> <a href='/modules/cupViewer.php?ID="+compVarArray[2]+"' class='fontDefaultLink' style='text-decoration:none; color:#FFFFFF;'>"+compVarArray[15]+" new posts</a>)";}
contents+="</font></td></tr><tr><td style='padding-top:2px;'><font style='font-size:10px;'>";if(compVarArray[6]==false){if(compVarArray[13]==0){contents+="No Prize (Draw: "+compVarArray[14]+")";}else{contents+=compVarArray[13]+" Prizemoney (Draw: "+compVarArray[14]+")";}}else{if(compVarArray[13]==0){contents+="No Prize (<a href='/modules/cupViewer.php?ID="+compVarArray[2]+"&p=draw' class='fontDefaultLink' style='text-decoration:none; color:#FFFFFF;'>View Draw</a>)";}else{contents+=compVarArray[13]+" Prizemoney (<a href='/modules/cupViewer.php?ID="+compVarArray[2]+"&p=draw' class='fontDefaultLink' style='text-decoration:none; color:#FFFFFF;'>View Draw</a>)";}}}
contents+="</font></td></tr></table>";document.getElementById("clubCompetition").innerHTML=contents;}
var xmlHttp6=null;String.prototype.startsWith=function(str){return(this.match("^"+str)==str)}
function openSiteURL(siteURL){if(xmlHttp6==null||xmlHttp6.readyState==0||xmlHttp6.readyState==4||xmlHttp6.readyState=="complete"){xmlHttp6=GetXmlHttpObject();result=null;if(xmlHttp6==null){alert("Browser does not support HTTP Request");return;}
var url=siteURL;xmlHttp6.onreadystatechange=function(){if(xmlHttp6.readyState==4||xmlHttp6.readyState=="complete"){result=xmlHttp6.responseText.split("###");if(result[0]!=null){document.getElementById("titleCell").innerHTML=result[0];}
if(result[1]!=null){document.getElementById("contentCell").innerHTML=result[1];}
if(result[2]!=null){document.getElementById("financeString").innerHTML="<font style='font-size:11px;'><b>Finance:</b> "+result[2]+"</font>";}
if(result[3]!=null){document.getElementById("alertString").innerHTML=result[3];}
if(url=="/modules/home.php"){eval("nextGameCountdown("+(document.getElementById("nextMatchCountdown").innerHTML)+");");}
pageTracker._trackPageview(url);window.location.hash=url;}};xmlHttp6.open("GET",url,true);xmlHttp6.send(null);}}var memberAdvertContent=[];memberAdvertContent[1]=["Make all types of live tactical changes."];memberAdvertContent[2]=["Design your clubs own kit."];memberAdvertContent[3]=["Bookmark any team, player or match."];memberAdvertContent[4]=["Track other clubs using the rival news feed."];memberAdvertContent[5]=["Use auto-bid to bid for you on players."];memberAdvertContent[6]=["Write press releases visible to other teams."];memberAdvertContent[7]=["Add any match to live action updates."];memberAdvertContent[8]=["Get estimations of any players skills."];memberAdvertContent[9]=["Have players replaced when injured."];memberAdvertContent[10]=["Have your flag collection last forever."];var memberAdvertShown=Math.floor(Math.random()*(memberAdvertContent.length-1)+1)
function loadMemberAdvert(){if(memberAdvertShown<(memberAdvertContent.length-1)){memberAdvertShown++;}else{memberAdvertShown=1;}
document.getElementById("memberAdvert1").innerHTML="<a href='/modules/upgradeAccount.php' style='font-size:10px; color:#FFFFFF; text-decoration:none;'>PinkBall membership benefit "+memberAdvertShown+"/"+(memberAdvertContent.length-1)+":</a>";document.getElementById("memberAdvert2").innerHTML="<a href='/modules/upgradeAccount.php' style='font-weight:bold; font-size:10px; color:#FFFFFF; text-decoration:none;'><div class='divBackground' style='height: 12px; width: 12px; background: url(/images/newLayout/combinedIcons.png) repeat scroll 0px -271px transparent;'></div> "+memberAdvertContent[memberAdvertShown]+"</a>";document.getElementById("memberAdvert3").innerHTML="<a href='/modules/upgradeAccount.php' style='font-weight:bold; font-size:10px; color:#FFFF00; text-decoration:none;'>All of this for less than £1 per month.</a>";setTimeout("loadMemberAdvert();",5000);}
var xmlHttp13;function estimatePlayerTraining(playerNo,trainingType,trainingIntensity,timeNum,timePeriod,t0,t1,t2,t3,t4,t5,t6){xmlHttp13=GetXmlHttpObject();if(xmlHttp13==null){alert("Browser does not support HTTP Request");return;}
document.getElementById("estimationStatus").innerHTML="Calculating... ";var url="/includes/estimatePlayerTraining.php";url=url+"?pNo="+playerNo+"&tType="+trainingType+"&tIntensity="+trainingIntensity+"&timeNum="+timeNum+"&timePeriod="+timePeriod+"&t0="+t0+"&t1="+t1+"&t2="+t2+"&t3="+t3+"&t4="+t4+"&t5="+t5+"&t6="+t6+"&randNum="+Math.random();xmlHttp13.onreadystatechange=function(){if((xmlHttp13.readyState==4||xmlHttp13.readyState=="complete")&&xmlHttp13.responseText!="ERROR"){displayEstimation(playerNo,trainingType,trainingIntensity,timeNum,timePeriod);}else if(xmlHttp13.responseText=="ERROR"){document.getElementById("estimationStatus").innerHTML="Time period specified too long";}};xmlHttp13.open("GET",url,true);xmlHttp13.send(null);}
function displayEstimation(playerNo,trainingType,trainingIntensity,timeNum,timePeriod){var result;var resultArray;var responseTable;result=xmlHttp13.responseText;resultArray=result.split("##");responseTable="<b>New Age:</b> "+resultArray[16]+"<table width='100%' cellpadding='0' cellspacing='0' style='font-size:10px; padding-top:7px;' border='0px'>";responseTable+="<tr><td style='padding-left:5px;' valign='top' width='27%'>";responseTable+="<font style='font-weight:bold; color:#006600; font-size:10px;'>Goalkeeping</font> "+resultArray[0]+"<table width='100%' style='font-size:10px;padding-top:2px;' cellpadding='1' cellspacing='4'><tr><td width='25%' style='padding-left:10px;'>Handling ("+resultArray[1]+")</td></tr><tr><td width='25%' style='padding-left:10px;'>Positioning ("+resultArray[2]+")</td></tr><tr><td width='25%' style='padding-left:10px;'>Agility ("+resultArray[3]+")</td></tr></table>";responseTable+="</td><td style='padding-left:5px;' valign='top' width='25%'>";responseTable+="<font style='font-weight:bold; color:#006600; font-size:10px;'>Defending</font> "+resultArray[4]+"<table width='100%' style='font-size:10px;padding-top:2px;' cellpadding='1' cellspacing='4'><tr><td width='25%' style='padding-left:10px;'>Tackling ("+resultArray[5]+")</td></tr><tr><td width='25%' style='padding-left:10px;'>Awareness ("+resultArray[6]+")</td></tr><tr><td width='25%' style='padding-left:10px;'>Marking ("+resultArray[7]+")</td></tr></table>";responseTable+="</td><td style='padding-left:5px;' valign='top' width='25%'>";responseTable+="<font style='font-weight:bold; color:#006600; font-size:10px;'>Midfield</font> "+resultArray[8]+"<table width='100%' style='font-size:10px;padding-top:2px;' cellpadding='1' cellspacing='4'><tr><td width='25%' style='padding-left:10px;'>Passing ("+resultArray[9]+")</td></tr><tr><td width='25%' style='padding-left:10px;'>Creativity ("+resultArray[10]+")</td></tr><tr><td width='25%' style='padding-left:10px;'>Crossing ("+resultArray[11]+")</td></tr></table>";responseTable+="</td><td style='padding-left:5px;' valign='top' width='25%'>";responseTable+="<font style='font-weight:bold; color:#006600; font-size:10px;'>Striking</font> "+resultArray[12]+"<table width='100%' style='font-size:10px;padding-top:2px;' cellpadding='1' cellspacing='4'><tr><td width='25%' style='padding-left:10px;'>Shooting ("+resultArray[13]+")</td></tr><tr><td width='25%' style='padding-left:10px;'>Heading ("+resultArray[14]+")</td></tr><tr><td width='25%' style='padding-left:10px;'>Pace ("+resultArray[15]+")</td></tr></table>";responseTable+="</td></tr></table>";responseTable+="<br/><table width='97%' cellpadding='0' cellspacing='0' style='font-size:10px;' border='0'><tr><td style='border:solid; border-color:#CCCCCC; border-width:1px; border-right:none; border-left:none; border-bottom:none;'>&nbsp;</td></tr></table>";document.getElementById("estimatedResult").innerHTML=responseTable;document.getElementById("estimationStatus").innerHTML="Done.";}
var xmlHttp14;function getTrainingMultiplier(teamNo,authCode){xmlHttp14=GetXmlHttpObject();if(xmlHttp14==null){alert("Browser does not support HTTP Request");return;}
var url="/includes/ajax/getTrainingMultiplier.php";url=url+"?teamNo="+teamNo+"&authCode="+authCode+"&randNum="+Math.random();xmlHttp14.onreadystatechange=function(){if((xmlHttp14.readyState==4||xmlHttp14.readyState=="complete")&&xmlHttp14.responseText!="ERROR"){displayTrainingMultiplier(teamNo,authCode);}};xmlHttp14.open("GET",url,true);xmlHttp14.send(null);}
function displayTrainingMultiplier(teamNo,authCode){var result;var resultArray;result=xmlHttp14.responseText;resultArray=result.split("###");document.getElementById("squadTrainingMultiplier_0").innerHTML=resultArray[0];document.getElementById("squadTrainingMultiplier_1").innerHTML=resultArray[1];document.getElementById("squadTrainingMultiplier_2").innerHTML=resultArray[2];document.getElementById("squadTrainingMultiplier_3").innerHTML=resultArray[3];document.getElementById("squadTrainingMultiplier_4").innerHTML=resultArray[4];document.getElementById("squadTrainingMultiplier_5").innerHTML=resultArray[5];document.getElementById("squadTrainingMultiplier_6").innerHTML=resultArray[6];document.getElementById("squadTrainingMultiplier_7").innerHTML=resultArray[7];}
function showTranslationPreview(lang,categorySelected,selectedPhraseCode,isUpdate){function ReplaceAll(Source,stringToFind,stringToReplace){var temp=Source;var index=temp.indexOf(stringToFind);while(index!=-1){temp=temp.replace(stringToFind,stringToReplace);index=temp.indexOf(stringToFind);}
return temp;}
function addslashespreview(str){str=ReplaceAll(str,'\"',"DOUBLE_QUOTE");return str;}
var testString=addslashespreview(document.getElementById('translationPreviewText').value);document.getElementById("translationPreview").innerHTML=document.getElementById("translationPreviewText").value;document.getElementById("translationSubmit").innerHTML="<form style='display:inline;' action='/modules/translate2.php?action=submit&categorySelected="+categorySelected+"&selectedPhraseCode="+selectedPhraseCode+"&langSelected="+lang+"&isUpdate="+isUpdate+"' method='post'><input type='hidden' name='textSubmit' value=\""+testString+"\"><input type='submit' class='button' value='Submit as Translation' style='width:150px;'></form>";}
function loadComments(commentType,uniqueID,startPos,teamNo,username,numComments,miniDisplay,fromPage){$("#teamComments").html("Loading...");$.ajax({url:"/includes/ajax/loadComments.php"+"?commentType="+commentType+"&uniqueID="+uniqueID+"&startPos="+startPos+"&teamNo="+teamNo+"&username="+username+"&numComments="+numComments+"&miniDisplay="+miniDisplay+"&fromPage="+fromPage+"&randNum="+Math.random(),success:function(data){resultArray=data.split("##");$("#teamComments").html(resultArray[0]);$("#numComments").html(resultArray[1]);if(document.getElementById("matchCommentsNum")){$("#matchCommentsNum").html("("+resultArray[4]+")");}
$("#previousCommentsDiv").html(resultArray[2]);$("#nextCommentsDiv").html(resultArray[3]);}});}
var xmlHttp17;function alphanumeric(alphane)
{var numaric=alphane;for(var j=0;j<numaric.length;j++){var alphaa=numaric.charAt(j);var hh=alphaa.charCodeAt(0);if((hh>47&&hh<58)||(hh>64&&hh<91)||(hh>96&&hh<123)||alphaa==" "){}else{return false;}}
return true;}
function trainingSetupSaveMenu(teamNo,authCode){document.getElementById("loadSaveTrainingSetup").innerHTML="[<a onClick=\"trainingSetupLoadMenu("+teamNo+",'"+authCode+"')\" class='fontDefaultLink'>Load</a>/Save Current]";document.getElementById("loadSaveMainWindow_load").style.display="none";document.getElementById("loadSaveMainWindow_save").style.display="inline";}
function trainingSetupLoadMenu(teamNo,authCode){document.getElementById("loadSaveTrainingSetup").innerHTML="[Load/<a onClick=\"trainingSetupSaveMenu("+teamNo+",'"+authCode+"')\" class='fontDefaultLink'>Save Current</a>]";document.getElementById("loadSaveMainWindow_load").style.display="inline";document.getElementById("loadSaveMainWindow_save").style.display="none";}
function showSavedTrainingSetup(teamNo,authCode){xmlHttp17=GetXmlHttpObject();if(xmlHttp17==null){alert("Browser does not support HTTP Request");return;}
var indexNumSelect=document.getElementById("savedTrainingSelect").selectedIndex;var url="/includes/ajax/saveLoadTrainingSetup.php";url=url+"?teamNo="+teamNo+"&authCode="+authCode+"&action=loadSavedDetails&savedNum="+indexNumSelect+"&randNum="+Math.random();xmlHttp17.onreadystatechange=function(){if((xmlHttp17.readyState==4||xmlHttp17.readyState=="complete")&&xmlHttp17.responseText!="ERROR"){var content="";var result=xmlHttp17.responseText;result=result.split("#");content+="<br/><table cellspacing='0px' cellpadding='0px'><tr><td style='padding-top:5px;'>\"<b>"+result[0]+"</b>\"</td></tr><tr><td style='padding-top:5px;'>"+result[1]+"</td></tr><tr><td style='padding-top:5px;'><form action='/modules/process/trainingSetupActions.php' method='get' style='display:inline;'><input type='hidden' name='savedNum' value='"+indexNumSelect+"'><input name='action' type='submit' value='Load' class='button' style='width:70px;'> <input name='action' type='submit' value='Save' class='button' style='width:70px;'> <input name='action' type='submit' value='Delete' class='button' style='width:70px;'></form></td></tr></table>";document.getElementById("loadSaveMainWindow_load_preview").innerHTML=content;}}
xmlHttp17.open("GET",url,true);xmlHttp17.send(null);}
function saveTrainingSetup(saveName,saveDesc,teamNo,authCode){xmlHttp17=GetXmlHttpObject();if(xmlHttp17==null){alert("Browser does not support HTTP Request");return;}
if(alphanumeric(saveName)==false||saveName.length==0){alert("Please only use letters and numbers in your training setup save name.");}else if(alphanumeric(saveDesc)==false||saveDesc.length==0){alert("Please only use letters and numbers in your training setup save description.");}else if(saveName.length>30){alert("Name must be 30 characters or less.");}else if(saveDesc.length>100){alert("Description must be 100 characters or less.");}else{document.getElementById("savedTrainingSetupButton").innerHTML="<img src='/images/icons/ajaxLoad.gif' border='0px'> Saving...";var url="/includes/ajax/saveLoadTrainingSetup.php";url=url+"?saveName="+saveName+"&saveDesc="+saveDesc+"&teamNo="+teamNo+"&authCode="+authCode+"&randNum="+Math.random();document.getElementById("savedTrainingSetupButton").innerHTML="<img src='/images/icons/ajaxLoad.gif' border='0px'>";xmlHttp17.onreadystatechange=function(){if((xmlHttp17.readyState==4||xmlHttp17.readyState=="complete")&&xmlHttp17.responseText!="ERROR"){var myselect=document.savedTrainingSelectForm.savedTrainingSelect;var myselectLength=myselect.length;try{myselect.add(new Option(saveName,0),myselect.options[myselectLength]);}catch(e){myselect.add(new Option(saveName,0),myselectLength);}
document.getElementById("savedTrainingSetupButton").innerHTML="<input type='button' value='Save' class='button' onClick=\"saveTrainingSetup(document.saveTrainingSetupForm.name.value, document.saveTrainingSetupForm.desc.value, "+teamNo+", '"+authCode+"')\"> Saved.";}else if(xmlHttp17.responseText=="ERROR"){document.getElementById("savedTrainingSetupButton").innerHTML="<input type='button' value='Save' class='button' onClick=\"saveTrainingSetup(document.saveTrainingSetupForm.name.value, document.saveTrainingSetupForm.desc.value, "+teamNo+", '"+authCode+"')\"> Error Saving.";}};xmlHttp17.open("GET",url,true);xmlHttp17.send(null);}}
var xmlHttp18;function lineupSetupSaveMenu(teamNo,authCode,matchNo){document.getElementById("loadSaveLineupSetup").innerHTML="[<a onClick=\"lineupSetupLoadMenu("+teamNo+",'"+authCode+"')\" class='fontDefaultLink'>Load</a>/Save Current]";document.getElementById("savedLineupSetup_load").style.display="none";document.getElementById("savedLineupSetup_save").style.display="inline";}
function lineupSetupLoadMenu(teamNo,authCode,matchNo){document.getElementById("loadSaveLineupSetup").innerHTML="[Load/<a onClick=\"lineupSetupSaveMenu("+teamNo+",'"+authCode+"', '"+matchNo+"')\" class='fontDefaultLink'>Save Current</a>]";document.getElementById("savedLineupSetup_load").style.display="inline";document.getElementById("savedLineupSetup_save").style.display="none";}
function showSavedLineupSetup(teamNo,authCode,matchNo,isYouth){xmlHttp18=GetXmlHttpObject();if(xmlHttp18==null){alert("Browser does not support HTTP Request");return;}
var indexNumSelect=document.getElementById("savedLineupSelect").selectedIndex;var url="/includes/ajax/saveLoadLineupSetup.php";url=url+"?teamNo="+teamNo+"&authCode="+authCode+"&action=loadSavedDetails&isYouth="+isYouth+"&savedNum="+indexNumSelect+"&randNum="+Math.random();xmlHttp18.onreadystatechange=function(){if((xmlHttp18.readyState==4||xmlHttp18.readyState=="complete")&&xmlHttp18.responseText!="ERROR"){var content="";var result=xmlHttp18.responseText;result=result.split("#");content+="<br/><table cellspacing='0px' cellpadding='0px'><tr><td style='padding-top:5px;'>\"<b>"+result[0]+"</b>\"</td></tr><tr><td style='padding-top:5px;'>"+result[1]+"</td></tr><tr><td style='padding-top:5px;'><form action='/modules/process/lineupSetupActions.php' method='get' style='display:inline;'><input type='hidden' name='matchNo' value='"+matchNo+"'><input type='hidden' name='savedNum' value='"+indexNumSelect+"'><input name='action' type='submit' value='Load' class='button' style='width:70px;'> <input name='action' type='submit' value='Save' class='button' style='width:70px;'> <input name='action' type='submit' value='Delete' class='button' style='width:70px;'></form></td></tr></table>";document.getElementById("savedLineupSetup_load_preview").innerHTML=content;}}
xmlHttp18.open("GET",url,true);xmlHttp18.send(null);}
function saveLineupSetup(saveName,saveDesc,teamNo,authCode,matchNo){xmlHttp18=GetXmlHttpObject();if(xmlHttp18==null){alert("Browser does not support HTTP Request");return;}
if(alphanumeric(saveName)==false||saveName.length==0){alert("Please only use letters and numbers in your lineup setup save name.");}else if(alphanumeric(saveDesc)==false||saveDesc.length==0){alert("Please only use letters and numbers in your lineup setup save description.");}else if(saveName.length>30){alert("Name must be 30 characters or less.");}else if(saveDesc.length>100){alert("Description must be 100 characters or less.");}else{document.getElementById("savedLineupSetupButton").innerHTML="<img src='/images/icons/ajaxLoad.gif' border='0px'> Saving...";var url="/includes/ajax/saveLoadLineupSetup.php";url=url+"?saveName="+saveName+"&saveDesc="+saveDesc+"&teamNo="+teamNo+"&matchNo="+matchNo+"&authCode="+authCode+"&randNum="+Math.random();document.getElementById("savedLineupSetupButton").innerHTML="<img src='/images/icons/ajaxLoad.gif' border='0px'>";xmlHttp18.onreadystatechange=function(){if((xmlHttp18.readyState==4||xmlHttp18.readyState=="complete")){var contents=xmlHttp18.responseText.split("#");if(contents[0]!="ERROR"){var myselect=document.savedLineupSelectForm.savedLineupSelect;var myselectLength=myselect.length;try{myselect.add(new Option(saveName,0),myselect.options[myselectLength]);}catch(e){myselect.add(new Option(saveName,0),myselectLength);}
document.getElementById("savedLineupSetupButton").innerHTML="<input type='button' value='Save' class='button' onClick=\"saveLineupSetup(document.saveLineupSetupForm.name.value, document.saveLineupSetupForm.desc.value, "+teamNo+", '"+authCode+"', "+matchNo+")\"> Saved.";}else{document.getElementById("savedLineupSetupButton").innerHTML="<input type='button' value='Save' class='button' onClick=\"saveLineupSetup(document.saveLineupSetupForm.name.value, document.saveLineupSetupForm.desc.value, "+teamNo+", '"+authCode+"', "+matchNo+")\"> Error Saving.";}}};xmlHttp18.open("GET",url,true);xmlHttp18.send(null);}}
var xmlHttp19=[];function updateKitPreview(divSelector,type){xmlHttp19[type]=GetXmlHttpObject();if(xmlHttp19[type]==null){alert("Browser does not support HTTP Request");return;}
var kDesign=document.getElementById(divSelector+"kDesign").value;var kCol1=document.getElementById(divSelector+"ColorPicker1").value;var kCol2=document.getElementById(divSelector+"ColorPicker2").value;if(divSelector=="homeTop"||divSelector=="homeShorts"){var textColour=document.getElementById("homeTopSquadTextColor").value;}else{var textColour=document.getElementById("awayTopSquadTextColor").value;}
document.getElementById(divSelector).innerHTML="<img src='/images/icons/ajaxLoad.gif' border='0px'>";document.getElementById(divSelector+"Back").innerHTML="<img src='/images/icons/ajaxLoad.gif' border='0px'>";var url="/includes/kitGenerator2.phpimg";url=url+"?type="+type+"&kCol1="+kCol1+"&kCol2="+kCol2+"&kDesign="+kDesign+"&kLetterCol="+textColour+"&ajaxLoad=1&randNum="+Math.random();xmlHttp19[type].onreadystatechange=function(){if((xmlHttp19[type].readyState==4||xmlHttp19[type].readyState=="complete")&&xmlHttp19[type].responseText!="ERROR"){var result=xmlHttp19[type].responseText;result=result.split("#");document.getElementById(divSelector).innerHTML="<img src='"+result[0]+"'>";document.getElementById(divSelector+"Back").innerHTML="<img src='"+result[1]+"'>";}};xmlHttp19[type].open("GET",url,true);xmlHttp19[type].send(null);}
var xmlHttp20;function rateManagerBlog(managerBlogNo,teamNo){xmlHttp20=GetXmlHttpObject();if(xmlHttp20==null){alert("Browser does not support HTTP Request");return;}
var ourRating=document.getElementById("blogRatingSelect").value;var url="/includes/ajax/team/rateManagerBlog.php";url=url+"?managerBlogNo="+managerBlogNo+"&ourRating="+ourRating+"&teamNo="+teamNo+"&randNum="+Math.random();xmlHttp20.onreadystatechange=function(){if(xmlHttp20.readyState==4||xmlHttp20.readyState=="complete"){document.getElementById("managerBlogRating").innerHTML=xmlHttp20.responseText;}};xmlHttp20.open("GET",url,true);xmlHttp20.send(null);}
var xmlHttp24;function loadManagerGoals(){xmlHttp24=GetXmlHttpObject();if(xmlHttp24==null){alert("Browser does not support HTTP Request");return;}
document.managerGoalForm.showCat.value="";document.getElementById("managerGoalsDiv").innerHTML="<img src='/images/icons/ajaxLoad.gif' border='0px'>";var numGoals=document.managerGoalForm.showGoals;var showGoals="undefined";for(var i=numGoals.length-1;i>-1;--i){if(numGoals[i].checked){showGoals=numGoals[i].value;}}
var showByCategorySelect=document.managerGoalForm.goalCategory;var showByCategoryIndex=document.managerGoalForm.goalCategory.selectedIndex;var showByCategory=showByCategorySelect[showByCategoryIndex].value;var showOnly=document.managerGoalForm.showOnly.value;var showCat=document.managerGoalForm.showCat.value;if(showCat.length>0){showByCategory=showCat;}
var username=document.managerGoalForm.managerGoalsUsername.value;var url="/modules/includes/team/ajax/managerGoals.php";url=url+"?showByCategory="+showByCategory+"&showGoals="+showGoals+"&showOnly="+showOnly+"&username="+username+"&randNum="+Math.random();xmlHttp24.onreadystatechange=function(){if((xmlHttp24.readyState==4||xmlHttp24.readyState=="complete")&&xmlHttp24.responseText!="error"){document.getElementById("managerGoalsDiv").innerHTML=xmlHttp24.responseText;}};xmlHttp24.open("GET",url,true);xmlHttp24.send(null);}
var xmlHttp26;function loadTransferHistory(page){xmlHttp26=GetXmlHttpObject();if(xmlHttp26==null){alert("Browser does not support HTTP Request");return;}
document.getElementById("transferHistoryDiv").innerHTML="<img src='/images/icons/ajaxLoad.gif' border='0px'>";var numTransferTypes=document.transferHistoryForm.transferTypes;var transferTypes="undefined";for(var i=numTransferTypes.length-1;i>-1;--i){if(numTransferTypes[i].checked){transferTypes=numTransferTypes[i].value;}}
var teamNo=document.transferHistoryForm.transferHistoryTeamNo.value;var url="/modules/includes/team/ajax/transferHistory.php";url=url+"?transferTypes="+transferTypes+"&teamNo="+teamNo+"&page="+page+"&randNum="+Math.random();xmlHttp26.onreadystatechange=function(){if((xmlHttp26.readyState==4||xmlHttp26.readyState=="complete")&&xmlHttp26.responseText!="error"){document.getElementById("transferHistoryDiv").innerHTML=xmlHttp26.responseText;}};xmlHttp26.open("GET",url,true);xmlHttp26.send(null);}
var xmlHttp23;function gradient(id,level)
{var box=document.getElementById(id);box.style.opacity=level;box.style.MozOpacity=level;box.style.KhtmlOpacity=level;box.style.filter="alpha(opacity="+level*100+")";box.style.display="block";return;}
function fadein(id)
{var level=0;while(level<=1)
{setTimeout("gradient('"+id+"',"+level+")",(level*1000)+10);level+=0.01;}}
var lightboxNumEmailCount=5;function loadEmailInputForm(managerNo)
{var contents="";contents+="<span id='boxtitle'></span>";contents+="Enter email addresses of your friends and we will invite them!";contents+="<br/><br>";contents+="<div style=\"display:inline;\" id=\"emailInputDiv\">";contents+="<table><tr><td><input type='text' id=\"emailInputDiv_1\"></td></tr></table>";contents+="<table><tr><td><input type='text' id=\"emailInputDiv_2\"></td></tr></table>";contents+="<table><tr><td><input type='text' id=\"emailInputDiv_3\"></td></tr></table>";contents+="<table><tr><td><input type='text' id=\"emailInputDiv_4\"></td></tr></table>";contents+="<table><tr><td><input type='text' id=\"emailInputDiv_5\"></td></tr></table>";contents+="</div>";contents+="<br/>";contents+="<a href='javascript: addEmailInput();' class='fontDefaultLink' style=\"text-decoration:none;\"> [+ Add another email address]</a>";contents+="<br/><br/>";contents+="<input type='button' value='Submit' class='button' onClick='javascript: submitEmailInput("+managerNo+");' style=\"width:80px;\">";contents+="<br/><br/>";contents+="<a href='javascript: closebox("+managerNo+");' class='fontDefaultLink' style=\"text-decoration:none;\">[Close]</a>";document.getElementById('box').innerHTML=contents;}
function submitEmailInput(managerNo)
{var emailCount=1;var emailSent=0;var contents="";var emailString="";contents+="<span id='boxtitle'>Thankyou!</span>";while(document.getElementById('emailInputDiv_'+emailCount)){var emailInput=document.getElementById('emailInputDiv_'+emailCount).value;if(emailInput.length>0){emailString+=emailInput+"<br/>";xmlHttp23=GetXmlHttpObject();if(xmlHttp23==null){alert("Browser does not support HTTP Request");return;}
var url="/includes/ajax/sendInviteEmail.php";url=url+"?managerNo="+managerNo+"&email="+emailInput+"&randNum="+Math.random();xmlHttp23.onreadystatechange=function(){if(xmlHttp23.readyState==4||xmlHttp23.readyState=="complete"){}};xmlHttp23.open("GET",url,true);xmlHttp23.send(null);emailSent+=1;}
emailCount+=1;}
contents+="Sent to "+emailSent+" email addresses:<br/><br/>";contents+=emailString;contents+="<br/><br/>";contents+="<a href='javascript: closebox("+managerNo+");' class='fontDefaultLink' style='text-decoration:none;'>[Close]</a>";document.getElementById('box').innerHTML=contents;}
function addEmailInput()
{var box=document.getElementById('emailInputDiv').innerHTML;lightboxNumEmailCount+=1;box+="<table><tr><td><input type='text' id='emailInputDiv_"+lightboxNumEmailCount+"'></td></tr></table>";document.getElementById('emailInputDiv').innerHTML=box;var textareaelem=document.getElementById('box');textareaelem.scrollTop=textareaelem.scrollHeight;}
function openbox(formtitle,fadin,boxid)
{if(boxid==null){boxid="";}
var box=document.getElementById('box'+boxid);document.getElementById('filter'+boxid).style.display='block';var btitle=document.getElementById('boxtitle'+boxid);btitle.innerHTML=formtitle;if(fadin)
{gradient("box"+boxid,0);fadein("box"+boxid);}
else
{box.style.display='block';}}
function closebox(managerNo)
{document.getElementById('box').style.display='none';document.getElementById('filter').style.display='none';loadEmailInputForm(managerNo);}
function promptLink(linkURL,promptText,promptForInput){if(promptForInput==null){promptForInput=false;}
if(promptForInput){var answer=prompt(promptText,"");}else{var answer=confirm(promptText);}
if(answer){if(promptForInput){linkURL=linkURL+"&answerText="+escape(answer);}
window.location=linkURL;}}
function promptSubmit(promptText,openURL){var answer=confirm(promptText);if(answer){if(openURL!=null){window.open(openURL,"","width=800,height=600,status=1,toolbar=1,scrollbars=yes");}else{return true;}}else{return false;}}
function isFieldEmpty(fieldId){var field=document.getElementById(fieldId).value;field=trim(field);if(field.length==0){alert('Comment cannot be empty!');return false;}else{return true;}}
var xmlHttp21=[];function showSquadPlayerTraining(pCount){var i;for(i=1;i<=pCount;i++){document.getElementById("squadPlayerDetails_training_"+i).style.display="inline";document.getElementById("squadPlayerDetails_status_"+i).style.display="none";document.getElementById("squadPlayerDetails_squadnumber_"+i).style.display="none";document.getElementById("squadPlayerDetails_wages_"+i).style.display="none";}
$(".switchSquadContentMenu").html("<a onclick='showSquadPlayerStatus("+pCount+")' class='underline'>"+squadPlayerLang[0]+"</a> / "+squadPlayerLang[1]+" / <a onclick='showSquadPlayerNumbers("+pCount+")' class='underline'>"+squadPlayerLang[2]+"</a> / <a onclick='showSquadWages("+pCount+")' class='underline'>"+squadPlayerLang[3]+"</a>");}
function showSquadPlayerStatus(pCount,nationalTeam){var i;for(i=1;i<=pCount;i++){if(nationalTeam!=true){document.getElementById("squadPlayerDetails_training_"+i).style.display="none";document.getElementById("squadPlayerDetails_wages_"+i).style.display="none";}
document.getElementById("squadPlayerDetails_status_"+i).style.display="inline";document.getElementById("squadPlayerDetails_squadnumber_"+i).style.display="none";}
if(nationalTeam!=true){$(".switchSquadContentMenu").html(""+squadPlayerLang[0]+" / <a onclick='showSquadPlayerTraining("+pCount+")' class='underline'>"+squadPlayerLang[1]+"</a> / <a onclick='showSquadPlayerNumbers("+pCount+")' class='underline'>"+squadPlayerLang[2]+"</a> / <a onclick='showSquadWages("+pCount+")' class='underline'>"+squadPlayerLang[3]+"</a>");}else{$(".switchSquadContentMenu").html(""+squadPlayerLang[0]+" / <a onclick='showSquadPlayerNumbers("+pCount+", true)' class='underline'>"+squadPlayerLang[2]+"</a>");}}
function showSquadPlayerNumbers(pCount,nationalTeam){var i;for(i=1;i<=pCount;i++){if(nationalTeam!=true){document.getElementById("squadPlayerDetails_training_"+i).style.display="none";document.getElementById("squadPlayerDetails_wages_"+i).style.display="none";}
document.getElementById("squadPlayerDetails_status_"+i).style.display="none";document.getElementById("squadPlayerDetails_squadnumber_"+i).style.display="inline";}
if(nationalTeam!=true){$(".switchSquadContentMenu").html("<a onclick='showSquadPlayerStatus("+pCount+")' class='underline'>"+squadPlayerLang[0]+"</a> / <a onclick='showSquadPlayerTraining("+pCount+")' class='underline'>"+squadPlayerLang[1]+"</a> / "+squadPlayerLang[2]+" / <a onclick='showSquadWages("+pCount+")' class='underline'>"+squadPlayerLang[3]+"</a>");}else{$(".switchSquadContentMenu").html("<a onclick='showSquadPlayerStatus("+pCount+", true)' class='underline'>"+squadPlayerLang[0]+"</a> / "+squadPlayerLang[2]);}}
function updateSquadNumber(pSelect,pTotal,playerNo,teamNo,authCode,type,kCol1,kCol2,kDesign,textColour,bgcolor,nationalTeam,playPage){var i;if(playPage==null){playPage=false;}
if(playPage==true){var kitSize="Team";}else{var kitSize="SquadPage";}
if(playPage==false){for(i=1;i<=pTotal;i++){document.getElementById("squadPlayerDetails_squadnumber_"+i+"_status").innerHTML="";}}
document.getElementById("squadPlayerDetails_squadnumber_"+pSelect+"_status").innerHTML="Updating...";xmlHttp21[0]=GetXmlHttpObject();xmlHttp21[1]=GetXmlHttpObject();if(xmlHttp21==null){alert("Browser does not support HTTP Request");return;}
var squadNumberInput=document.getElementById("squadNumberInput_"+pSelect).value;var url="/modules/includes/squad/ajax/updateSquadNumber.php";url=url+"?teamNo="+teamNo+"&authCode="+authCode+"&pNo="+playerNo+"&squadNumber="+squadNumberInput+"&nationalTeam="+nationalTeam+"&randNum="+Math.random();xmlHttp21[0].onreadystatechange=function(){if((xmlHttp21[0].readyState==4||xmlHttp21[0].readyState=="complete")&&xmlHttp21[0].responseText!="error"){var result=xmlHttp21[0].responseText.split("##");document.getElementById("squadPlayerDetails_squadnumber_"+pSelect+"_status").innerHTML=result[1];if(result[0]=="1"){document.getElementById("squadShirtDisplay_"+pSelect).innerHTML="<img src='/images/icons/ajaxLoad.gif' border='0px'>";var url="/includes/kitGenerator2.phpimg";url=url+"?view=back&size="+kitSize+"&sups=1&type="+type+"&kCol1="+kCol1+"&kCol2="+kCol2+"&kDesign="+kDesign+"&kLetterCol="+textColour+"&squadNumber="+squadNumberInput+"&ajaxLoad=1&setbg="+bgcolor+"&randNum="+Math.random();xmlHttp21[1].onreadystatechange=function(){if((xmlHttp21[1].readyState==4||xmlHttp21[1].readyState=="complete")&&xmlHttp21[1].responseText!="error"){var result2=xmlHttp21[1].responseText;result2=result2.split("#");document.getElementById("squadShirtDisplay_"+pSelect).innerHTML="<img src='"+result2[1]+"'>";}};xmlHttp21[1].open("GET",url,true);xmlHttp21[1].send(null);}}};xmlHttp21[0].open("GET",url,true);xmlHttp21[0].send(null);}
function showSquadWages(pCount){var i;for(i=1;i<=pCount;i++){document.getElementById("squadPlayerDetails_training_"+i).style.display="none";document.getElementById("squadPlayerDetails_status_"+i).style.display="none";document.getElementById("squadPlayerDetails_squadnumber_"+i).style.display="none";document.getElementById("squadPlayerDetails_wages_"+i).style.display="inline";}
$(".switchSquadContentMenu").html("<a onclick='showSquadPlayerStatus("+pCount+")' class='underline'>"+squadPlayerLang[0]+"</a> / <a onclick='showSquadPlayerTraining("+pCount+")' class='underline'>"+squadPlayerLang[1]+"</a> / <a onclick='showSquadPlayerNumbers("+pCount+")' class='underline'>"+squadPlayerLang[2]+"</a> / "+squadPlayerLang[3]+"");}
var xmlHttp22;function IsNumeric(sText){var ValidChars="0123456789.";var IsNumber=true;var Char;for(i=0;i<sText.length&&IsNumber==true;i++){Char=sText.charAt(i);if(ValidChars.indexOf(Char)==-1){IsNumber=false;}}
return IsNumber;}
function updatePlayerWages(playerNo,pCount,authCode,teamNo,divSuffix,wageDesired,page){xmlHttp22=GetXmlHttpObject();clearMultipleDiv("squadPlayerDetails_wages_status_",1,pCount,"");var currentWages=parseInt(document.getElementById("currentWages_"+playerNo).value);var wageInput=parseInt(document.getElementById("squadWageInput_"+divSuffix).value);var r;var r2;var wageDifference=currentWages-wageInput;if(IsNumeric(wageInput)==false){alert("Wage input must be a number!");}else{if(currentWages==wageInput){alert("No changes to be made");}else{var minWage=parseInt((wageDesired*0.3));if(wageInput<minWage){document.getElementById("squadPlayerDetails_wages_status_"+divSuffix).innerHTML="<font color='#FF0000'>Must be at least £"+minWage+"</font>";}else{r2=confirm("Setting player wages to £"+wageInput+", it this correct?");if(r2==true){if(currentWages>wageInput){r=confirm("As you are lowering the players wages, you will have to immediately pay the player the difference: £"+wageDifference+". Is this OK?");}else{r=true;}
if(r==true){if(page=='squad'){document.getElementById("squadPlayerDetails_wages_status_"+divSuffix).innerHTML="Saving...";}else if(page=='player'){document.getElementById("squadPlayerDetails_wages_mood_"+divSuffix).innerHTML="Saving...";}
if(xmlHttp22==null){alert("Browser does not support HTTP Request");return;}
var url="/modules/includes/squad/ajax/updatePlayerWages.php";url=url+"?ID="+playerNo+"&playerWages="+wageInput+"&authCode="+authCode+"&teamNo="+teamNo+"&fp="+page+"&randNum="+Math.random();xmlHttp22.onreadystatechange=function(){if((xmlHttp22.readyState==4||xmlHttp22.readyState=="complete")&&xmlHttp22.responseText!="error"){var result=xmlHttp22.responseText;result=result.split("##");if(result[0]=="ERROR"){document.getElementById("squadPlayerDetails_wages_status_"+divSuffix).innerHTML=result[1];}else{if(page=='squad'){document.getElementById("squadPlayerDetails_wages_status_"+divSuffix).innerHTML=result[0];document.getElementById("squadPlayerDetails_wages_mood_"+divSuffix).innerHTML=result[1];document.getElementById("currentWages_"+playerNo).value=wageInput;if(result[5]=="1"){document.getElementById("squadWageInput_"+divSuffix).style.borderColor="#999999";document.getElementById("squadWageInput_"+divSuffix).style.borderWidth="1px";}}else if(page=='player'){document.getElementById("squadPlayerDetails_wages_mood_"+divSuffix).innerHTML=result[1];document.getElementById("currentWages_"+playerNo).value=wageInput;document.getElementById("squadPlayerDetails_wages_percent_"+divSuffix).innerHTML=result[2];document.getElementById("squadPlayerDetails_wages_currentwages_"+divSuffix).innerHTML=result[3];document.getElementById("squadPlayerDetails_wages_status_"+divSuffix).innerHTML=result[4];}}}};xmlHttp22.open("GET",url,true);xmlHttp22.send(null);}}}}}}
var xmlHttp9;var myselect;function calculatePredictedRating(teamNo,matchNo,authCode,matchServerNo,isWaiting,matchEngineVersion){$.ajax({url:"includes/match/ajax/calculatePredictedRating.php"+"?matchNo="+matchNo+"&authCode="+authCode+"&teamNo="+teamNo+"&msn="+matchServerNo+"&mev="+matchEngineVersion+"&isWaiting="+isWaiting+"&update=1&randNum="+Math.random(),success:function(data){setCalculatedPredictedRating(data);}});}
function setCalculatedPredictedRating(data){var responseText=data.split("###");if(document.getElementById("predictedDefence")){var predictedDefenceChange=responseText[0]-document.getElementById("predictedDefence").innerHTML.replace(/(<([^>]+)>)/ig,"");var predictedMidfieldChange=responseText[1]-document.getElementById("predictedMidfield").innerHTML.replace(/(<([^>]+)>)/ig,"");var predictedAttackChange=responseText[2]-document.getElementById("predictedAttack").innerHTML.replace(/(<([^>]+)>)/ig,"");var predictedOverallChange=responseText[3]-document.getElementById("predictedOverall").innerHTML.replace(/(<([^>]+)>)/ig,"");$("#predictedDefence").html(responseText[0]);$("#predictedMidfield").html(responseText[1]);$("#predictedAttack").html(responseText[2]);$("#predictedOverall").html(responseText[3]);showPredictedChange("predictedDefenceChange",predictedDefenceChange);showPredictedChange("predictedMidfieldChange",predictedMidfieldChange);showPredictedChange("predictedAttackChange",predictedAttackChange);showPredictedChange("predictedOverallChange",predictedOverallChange);if(responseText[5]!=null&&responseText[6]!=null&&responseText[7]!=null&&responseText[8]!=null&&responseText[9]!=null){$("#lineupFitnessValue").html(responseText[5]);$("#lineupEnergyValue").html(responseText[7]);$("#lineupFormValue").html((responseText[6]*20).toFixed(1));$("#lineupMoodValue").html((responseText[8]*20).toFixed(1));$("#lineupExperienceValue").html(responseText[9]);document.getElementById("lineupFitness").innerHTML="<table cellpadding='0px' cellspacing='0px' class='nopadding' style='border-collapse:collapse;' width='75px'><tr><td height='9px' width='"+parseInt(responseText[5])+"%' style='border:solid; border-width:1px; border-color:#000000; border-right:none; background-color:#00FF00;'></td><td width='"+(100-parseInt(responseText[5]))+"%' style='border:solid; border-width:1px; border-color:#000000; border-left:none; background-color:#FFFFFF;'></td></tr></table>";document.getElementById("lineupEnergy").innerHTML="<table cellpadding='0px' cellspacing='0px' class='nopadding' style='border-collapse:collapse;' width='75px'><tr><td height='9px' width='"+parseInt(responseText[7])+"%' style='border:solid; border-width:1px; border-color:#000000; border-right:none; background-color:#FFD700;'></td><td width='"+(100-parseInt(responseText[7]))+"%' style='border:solid; border-width:1px; border-color:#000000; border-left:none; background-color:#FFFFFF;'></td></tr></table>";document.getElementById("lineupForm").innerHTML="<table cellpadding='0px' cellspacing='0px' class='nopadding' style='border-collapse:collapse;' width='75px'><tr><td height='9px' width='"+parseInt(responseText[6]*20)+"%' style='border:solid; border-width:1px; border-color:#000000; border-right:none; background-color:#FF6600;'></td><td width='"+(100-parseInt(responseText[6]*20))+"%' style='border:solid; border-width:1px; border-color:#000000; border-left:none; background-color:#FFFFFF;'></td></tr></table>";document.getElementById("lineupMood").innerHTML="<table cellpadding='0px' cellspacing='0px' class='nopadding' style='border-collapse:collapse;' width='75px'><tr><td height='9px' width='"+parseInt(responseText[8]*20)+"%' style='border:solid; border-width:1px; border-color:#000000; border-right:none; background-color:#0066CC;'></td><td width='"+(100-parseInt(responseText[8]*20))+"%' style='border:solid; border-width:1px; border-color:#000000; border-left:none; background-color:#FFFFFF;'></td></tr></table>";document.getElementById("lineupExperience").innerHTML="<table cellpadding='0px' cellspacing='0px' class='nopadding' style='border-collapse:collapse;' width='75px'><tr><td height='9px' width='"+parseInt(responseText[9])+"%' style='border:solid; border-width:1px; border-color:#000000; border-right:none; background-color:#CC0000;'></td><td width='"+(100-parseInt(responseText[9]))+"%' style='border:solid; border-width:1px; border-color:#000000; border-left:none; background-color:#FFFFFF;'></td></tr></table>";}else{$("#lineupFitnessValue").html("0.0");$("#lineupEnergyValue").html("0.0");$("#lineupFormValue").html("0.0");$("#lineupMoodValue").html("0.0");$("#lineupExperienceValue").html("0.0");document.getElementById("lineupFitness").innerHTML="<table cellpadding='0px' cellspacing='0px' style='border-collapse:collapse;' width='75px'><tr><td width='100%' height='9px' style='border:solid; border-width:1px; border-color:#000000; background-color:#FFFFFF;'></td></tr></table>";document.getElementById("lineupEnergy").innerHTML="<table cellpadding='0px' cellspacing='0px' style='border-collapse:collapse;' width='75px'><tr><td width='100%' height='9px' style='border:solid; border-width:1px; border-color:#000000; background-color:#FFFFFF;'></td></tr></table>";document.getElementById("lineupForm").innerHTML="<table cellpadding='0px' cellspacing='0px' style='border-collapse:collapse;' width='75px'><tr><td width='100%' height='9px' style='border:solid; border-width:1px; border-color:#000000; background-color:#FFFFFF;'></td></tr></table>";document.getElementById("lineupMood").innerHTML="<table cellpadding='0px' cellspacing='0px' style='border-collapse:collapse;' width='75px'><tr><td width='100%' height='9px' style='border:solid; border-width:1px; border-color:#000000; background-color:#FFFFFF;'></td></tr></table>";document.getElementById("lineupMood").innerHTML="<table cellpadding='0px' cellspacing='0px' style='border-collapse:collapse;' width='75px'><tr><td width='100%' height='9px' style='border:solid; border-width:1px; border-color:#000000; background-color:#FFFFFF;'></td></tr></table>";}}}
function showPredictedChange(divId,changeValue){if(changeValue>0){$("#"+divId).html("(<font style='color:#009900;'>+"+changeValue.toFixed(2)+"</font>)");}else if(changeValue<0){$("#"+divId).html("(<font style='color:#FF0000;'>"+changeValue.toFixed(2)+"</font>)");}else{$("#"+divId).html("");}}
function saveDefaultLineup(teamNo,matchNo,authCode,matchServerNo,isWaiting,matchEngineVersion){if(matchNo.length==0){$("#lineupLoadSaveDefaultStatus").html("");return;}else{$("#lineupLoadSaveDefaultStatus").html("<font color='#FFFFFF'>Saving...</font>");}
var url="includes/match/ajax/saveDefaultLineup.php";url=url+"?matchNo="+matchNo+"&authCode="+authCode+"&teamNo="+teamNo+"&matchServerNo="+matchServerNo+"&mev="+matchEngineVersion+"&isWaiting="+isWaiting+"&randNum="+Math.random();$.ajax({url:url,success:function(data){$("#lineupLoadSaveDefaultStatus").html(data);}});}
function updateFormation(hasMembership,authCode,teamNo,matchNo,matchServerNo,isDefaultLineup,matchEngineVersion){document.getElementById("lineupLoadSaveStatus").innerHTML="<font color='#009900'>Please wait...</font>";if(matchNo.length==0){document.getElementById("lineupLoadSaveStatus").innerHTML="";return;}else{document.getElementById("lineupLoadSaveStatus").innerHTML="<font color='#009900'>Please wait...</font>";}
var formation=document.formationForm.formation.value;$.ajax({url:"includes/match/ajax/updateFormation.php"+"?hm="+hasMembership+"&matchNo="+matchNo+"&ac="+authCode+"&teamNo="+teamNo+"&msn="+matchServerNo+"&mev="+matchEngineVersion+"&formation="+formation+"&isWaiting="+isDefaultLineup+"&randNum="+Math.random(),success:function(data){document.getElementById("lineupLoadSaveStatus").innerHTML=data;$.ajax({url:"includes/match/ajax/generateLineupTable.php"+"?hm="+hasMembership+"&matchNo="+matchNo+"&ac="+authCode+"&teamNo="+teamNo+"&msn="+matchServerNo+"&mev="+matchEngineVersion+"&formation="+formation+"&isWaiting="+isDefaultLineup+"&randNum="+Math.random(),success:function(data){var responseText=data.split("###");document.getElementById("lineupTable").innerHTML=responseText[0];calculatePredictedRating(teamNo,matchNo,authCode,matchServerNo,isDefaultLineup,matchEngineVersion);}});}});}
function updateOverallEffort(hasMembership,authCode,teamNo,matchNo,matchServerNo,isDefaultLineup,matchEngineVersion){$("#effortNotice").show();$("#lineupLoadSaveStatus").html("<font color='#009900'>Please wait...</font>");if(matchNo.length==0){$("#lineupLoadSaveStatus").html("");return;}else{$("#lineupLoadSaveStatus").html("<font color='#009900'>Please wait...</font>");}
var overallEffort=document.overallEffortForm.overallEffort.value;$.ajax({url:"includes/match/ajax/updateOverallEffort.php"+"?hm="+hasMembership+"&matchNo="+matchNo+"&ac="+authCode+"&teamNo="+teamNo+"&msn="+matchServerNo+"&mev="+matchEngineVersion+"&overallEffort="+overallEffort+"&isWaiting="+isDefaultLineup+"&randNum="+Math.random(),success:function(data){$("#lineupLoadSaveStatus").html(data);calculatePredictedRating(teamNo,matchNo,authCode,matchServerNo,isDefaultLineup,matchEngineVersion);}});}
function swapPlayers(authCode,teamNo,matchNo,player1pos,player2pos,matchServerNo,hasMembership,isDefaultLineup,matchEngineVersion){$("#swapPlayers").html("<font color='#FFFFFF'>Please wait...</font>");$.ajax({url:"includes/match/ajax/swapPlayers.php"+"?hm="+hasMembership+"&t="+teamNo+"&m="+matchNo+"&ac="+authCode+"&msn="+matchServerNo+"&mev="+matchEngineVersion+"&ppone="+player1pos+"&pptwo="+player2pos+"&isWaiting="+isDefaultLineup+"&randNum="+Math.random(),success:function(data){if(data=="MEMBER_ERROR"){document.getElementById("swapPlayers").innerHTML="<font color='#FFFFFF'>Only <div class='divBackground' style='height: 12px; width: 12px; background: url(/images/newLayout/combinedIcons.png) repeat scroll 0px -271px transparent;'></div> <a href='/modules/upgradeAccount.php?demo=tacticalChanges' class='fontDefaultLink' style='color:#FFFFFF;'>members</a> can make live changes</font>";}else if(data!="error"){document.getElementById("swapPlayers").innerHTML="<font color='#FFFFFF'>Swapping</font>";result=data.split("#");for(i=0;i<=10;i++){document.lineupForm[i].playerCheck.checked=false;}
var player1posName=document.lineupForm[player1pos].newPosition.value;var player2posName=document.lineupForm[player2pos].newPosition.value;if(player1posName!=0||player2posName!=0){var player1Foot=document.getElementById("playerFoot"+(player1pos+1)).innerHTML;var player2Foot=document.getElementById("playerFoot"+(player2pos+1)).innerHTML;var player1Kit=document.getElementById("playerKit"+(player1pos+1)).innerHTML;var player2Kit=document.getElementById("playerKit"+(player2pos+1)).innerHTML;var player1SentOff=document.lineupForm[player1pos].newPosition.disabled;var player2SentOff=document.lineupForm[player2pos].newPosition.disabled;document.lineupForm[player1pos].newPosition.remove(0);document.lineupForm[player2pos].newPosition.remove(0);if(result[1]!=0){if(player1posName==0){$(document.lineupForm[player1pos].newPosition).prepend($("<option></option>").attr("value",0).text("---"));$(document.lineupForm[player1pos].newPosition).prepend($("<option></option>").attr("value",99999999999).text(result[1]));}else{$(document.lineupForm[player1pos].newPosition).prepend($("<option></option>").attr("value",99999999999).text(result[1]));}}
if(result[0]!=0){myselect=document.lineupForm[player2pos].newPosition;if(player2posName==0){$(document.lineupForm[player2pos].newPosition).prepend($("<option></option>").attr("value",0).text("---"));$(document.lineupForm[player2pos].newPosition).prepend($("<option></option>").attr("value",99999999999).text(result[0]));}else{$(document.lineupForm[player2pos].newPosition).prepend($("<option></option>").attr("value",99999999999).text(result[0]));}}
document.lineupForm[player1pos].newPosition.selectedIndex=0;document.lineupForm[player2pos].newPosition.selectedIndex=0;$("#playerFoot"+(player1pos+1)).html(player2Foot);$("#playerFoot"+(player2pos+1)).html(player1Foot);$("#playerKit"+(player1pos+1)).html(player2Kit);$("#playerKit"+(player2pos+1)).html(player1Kit);document.lineupForm[player1pos].newPosition.disabled=player2SentOff;document.lineupForm[player2pos].newPosition.disabled=player1SentOff;calculatePredictedRating(teamNo,matchNo,authCode,matchServerNo,isDefaultLineup,matchEngineVersion);$("#swapPlayers").html("<font color='#FFFFFF'>Swap Complete</font>");}}}});}
function changePlayer(hasMembership,playerpos,authCode,teamNo,matchNo,matchServerNo,isDefaultLineup,matchEngineVersion){document.getElementById("lineupValidity").innerHTML="<img src='/images/icons/arrowSpin.gif' border='0px' /> <font color='#009900'>Updating..</font>";xmlHttp9=GetXmlHttpObject();if(xmlHttp9==null){alert("Browser does not support HTTP Request");return;}
var playerToAdd=document.lineupForm[playerpos].newPosition.value;var url="includes/match/ajax/changePlayer.php";url=url+"?hm="+hasMembership+"&teamNo="+teamNo+"&matchNo="+matchNo+"&ac="+authCode+"&msn="+matchServerNo+"&mev="+matchEngineVersion+"&playerpos="+playerpos+"&playerToAdd="+playerToAdd+"&isWaiting="+isDefaultLineup+"&randNum="+Math.random();xmlHttp9.onreadystatechange=function(){if((xmlHttp9.readyState==4||xmlHttp9.readyState=="complete")&&xmlHttp9.responseText!="error"&&xmlHttp9.responseText!="MEMBER_ERROR"){stateChanged3(authCode,teamNo,matchNo,playerpos,matchServerNo,playerToAdd,isDefaultLineup,matchEngineVersion);}else if((xmlHttp9.readyState==4||xmlHttp9.readyState=="complete")&&xmlHttp9.responseText=="MEMBER_ERROR"){window.location="http://www.zmanager.org/modules/upgradeAccount.php"}};xmlHttp9.open("GET",url,true);xmlHttp9.send(null);}
function stateChanged3(authCode,teamNo,matchNo,playerpos,matchServerNo,playerToAdd,isDefaultLineup,matchEngineVersion){var resultText=xmlHttp9.responseText;var result=resultText.split("##");var removeIndex=document.lineupForm[playerpos].newPosition.selectedIndex;var myselect4=document.lineupForm[playerpos].newPosition;if(myselect4.options[0].value!=0){removeIndex=removeIndex-1;}
if(result[1]!=0){for(i=document.SETPIECEFORM[0].SETPIECE.options.length-1;i>=0;i--){if(document.SETPIECEFORM[0].SETPIECE.options[i].value==result[1]){document.SETPIECEFORM[0].SETPIECE.remove(i);}}
for(i=document.SETPIECEFORM[1].SETPIECE.options.length-1;i>=0;i--){if(document.SETPIECEFORM[1].SETPIECE.options[i].value==result[1]){document.SETPIECEFORM[1].SETPIECE.remove(i);}}
var myselect21=document.CAPTAINFORM.CAPTAIN;var captainOptions=myselect21.options.length;for(i=document.CAPTAINFORM.CAPTAIN.options.length-1;i>=0;i--){if(document.CAPTAINFORM.CAPTAIN.options[i].value==result[1]){document.CAPTAINFORM.CAPTAIN.remove(i);}}
if(document.penaltyForm){for(i=0;i<=10;i++){for(j=document.penaltyForm[i].newPosition.options.length-1;j>=0;j--){if(document.penaltyForm[i].newPosition.options[j].value==result[1]){document.penaltyForm[i].newPosition.remove(j);document.penaltyForm[i].newPosition.style.color="black";}}}}}
if(playerToAdd!=0){$(document.CAPTAINFORM.CAPTAIN).prepend($("<option></option>").attr("value",playerToAdd).text(result[12]));$(document.SETPIECEFORM[0].SETPIECE).prepend($("<option></option>").attr("value",playerToAdd).text(result[17]));$(document.SETPIECEFORM[1].SETPIECE).prepend($("<option></option>").attr("value",playerToAdd).text(result[17]));if(document.penaltyForm){for(i=0;i<=10;i++){$(document.penaltyForm[i].newPosition).append($("<option></option>").attr("value",playerToAdd).text(result[18]));}}
var j;var debug="";for(i=0;i<=4;i++){debug+=i+": ";for(j=document.SUBFORM[i].SUB.options.length-1;j>=0;j--){debug+=j+"()";if(document.SUBFORM[i].SUB.options[j].value==playerToAdd){document.SUBFORM[i].SUB.remove(j);document.SUBFORM[i].SUB.style.color="black";debug+="DELETE!";}
debug+=" ";}
debug+="<br/>";}}
if(result[11]!=0){var captainOptions=document.CAPTAINFORM.CAPTAIN.options.length;for(i=document.CAPTAINFORM.CAPTAIN.options.length-1;i>=0;i--){if(document.CAPTAINFORM.CAPTAIN.options[i].value==result[11]){document.CAPTAINFORM.CAPTAIN.selectedIndex=i;}}}
if(result[15]!=0){for(i=document.SETPIECEFORM[0].SETPIECE.options.length-1;i>=0;i--){if(document.SETPIECEFORM[0].SETPIECE.options[i].value==result[15]){document.SETPIECEFORM[0].SETPIECE.selectedIndex=i;}}}
if(result[16]!=0){for(i=document.SETPIECEFORM[1].SETPIECE.options.length-1;i>=0;i--){if(document.SETPIECEFORM[1].SETPIECE.options[i].value==result[16]){document.SETPIECEFORM[1].SETPIECE.selectedIndex=i;}}}
if(result[0]!=0){for(i=0;i<=10;i++){var myselect2=document.lineupForm[i].newPosition;if(myselect2.options[1].value==0||myselect2.options[1].value==99999999999){document.lineupForm[i].newPosition.remove(removeIndex+1);}else{document.lineupForm[i].newPosition.remove(removeIndex);}}}
document.lineupForm[playerpos].newPosition.remove(0);var newOption;var playerAddedInjured=false;if(result[0]!=0){myselect=document.lineupForm[playerpos].newPosition;try{if(result[0].substr(0,7)=="INJURED"){myselect.add(new Option(result[0].substr(7)+" (injured)",playerToAdd),myselect.options[0]);playerAddedInjured=true;}else{myselect.add(new Option(result[0],playerToAdd),myselect.options[0]);}}catch(e){if(result[0].substr(0,7)=="INJURED"){myselect.add(new Option(result[0].substr(7)+" (injured)",playerToAdd),0);playerAddedInjured=true;}else{myselect.add(new Option(result[0],result[0]),0);}}
if(result[1]==0){try{myselect.add(new Option("---",0),myselect.options[1]);myselect.options[1].style.color="black";}catch(e){myselect.add(new Option("---",0),1);myselect.options[1].style.color="black";}}}
if(result[1]!=0){var i;for(i=0;i<=4;i++){var positionSkill=null;if(i==0){positionSkill=result[6];}else if(i==1){positionSkill=result[7];}else if(i==2||i==3){positionSkill=result[8];}else{positionSkill=result[9];}
myselect=document.SUBFORM[i].SUB;if(result[0]==0){if(result[2].substr(0,7)=="INJURED"){try{myselect.add(new Option(result[2].substr(7)+" "+positionSkill+" (injured)",result[1]),myselect.options[1]);}catch(e){myselect.add(new Option(result[2].substr(7)+" "+positionSkill+" (injured)",result[1]),1);}
myselect.options[1].style.color="red";}else{try{myselect.add(new Option(result[2]+" "+positionSkill,result[1]),myselect.options[1]);}catch(e){myselect.add(new Option(result[2]+" "+positionSkill,result[1]),1);}
myselect.options[1].style.color="black";}}else{if(result[2].substr(0,7)=="INJURED"){if(myselect.options[0].value==0){try{myselect.add(new Option(result[2].substr(7)+" "+positionSkill+" (injured)",result[1]),myselect.options[1]);}catch(e){myselect.add(new Option(result[2].substr(7)+" "+positionSkill+" (injured)",result[1]),1);}
myselect.options[2].style.color="red";}else{try{myselect.add(new Option(result[2].substr(7)+" "+positionSkill+" (injured)",result[1]),myselect.options[2]);}catch(e){myselect.add(new Option(result[2].substr(7)+" "+positionSkill+" (injured)",result[1]),2);}
myselect.options[2].style.color="red";}}else{if(myselect.options[0].value==0){try{myselect.add(new Option(result[2]+" "+positionSkill,result[1]),myselect.options[1]);}catch(e){myselect.add(new Option(result[2]+" "+positionSkill,result[1]),1);}
myselect.options[2].style.color="black";}else{try{myselect.add(new Option(result[2]+" "+positionSkill,result[1]),myselect.options[2]);}catch(e){myselect.add(new Option(result[2]+" "+positionSkill,result[1]),2);}
myselect.options[2].style.color="black";}}}}}
if(result[1]!=0){var i;var positionSkill;for(i=0;i<=10;i++){positionSkill=null;if(i==0){positionSkill=result[6];}else if(i<=parseInt(result[3])){positionSkill=result[7];}else if(i<=(parseInt(result[3])+parseInt(result[4]))){positionSkill=result[8];}else{positionSkill=result[9];}
myselect=document.lineupForm[i].newPosition;if(i==playerpos&&result[0]==0){try{if(result[2].substr(0,7)=="INJURED"){newOption=new Option(result[2].substr(7)+" "+positionSkill+" (injured)",result[1]);myselect.add(newOption,myselect.options[1]);myselect.options[1].style.color="red";}else{myselect.add(new Option(result[2]+" "+positionSkill,result[1]),myselect.options[1]);myselect.options[1].style.color="black";}}catch(e){if(result[2].substr(0,7)=="INJURED"){newOption=new Option(result[2].substr(7)+" "+positionSkill+" (injured)",result[1]);myselect.add(newOption,1);myselect.options[1].style.color="red";}else{myselect.add(new Option(result[2]+" "+positionSkill,result[1]),1);myselect.options[1].style.color="black";}}}else{if(myselect.options[0].value==0){try{if(result[2].substr(0,7)=="INJURED"){newOption=new Option(result[2].substr(7)+" "+positionSkill+" (injured)",result[1]);myselect.add(newOption,myselect.options[1]);myselect.options[1].style.color="red";}else{myselect.add(new Option(result[2]+" "+positionSkill,result[1]),myselect.options[1]);myselect.options[1].style.color="black";}}catch(e){if(result[2].substr(0,7)=="INJURED"){newOption=new Option(result[2].substr(7)+" "+positionSkill+" (injured)",result[1]);myselect.add(newOption,1);myselect.options[1].style.color="red";}else{myselect.add(new Option(result[2]+" "+positionSkill,result[1]),1);myselect.options[1].style.color="black";}}}else{try{if(result[2].substr(0,7)=="INJURED"){newOption=new Option(result[2].substr(7)+" "+positionSkill+" (injured)",result[1]);myselect.add(newOption,myselect.options[2]);myselect.options[2].style.color="red";}else{myselect.add(new Option(result[2]+" "+positionSkill,result[1]),myselect.options[2]);myselect.options[2].style.color="black";}}catch(e){if(result[2].substr(0,7)=="INJURED"){newOption=new Option(result[2].substr(7)+" "+positionSkill+" (injured)",result[1]);myselect.add(newOption,2);myselect.options[2].style.color="red";}else{myselect.add(new Option(result[2]+" "+positionSkill,result[1]),2);myselect.options[2].style.color="black";}}}}}}
if(result[10]=="L"){document.getElementById("playerFoot"+(playerpos+1)).innerHTML="<font color='#FFFFFF'>Left Footed</font>";}else if(result[10]=="R"){document.getElementById("playerFoot"+(playerpos+1)).innerHTML="<font color='#FFFFFF'>Right Footed</font>";}else if(result[10]=="B"){document.getElementById("playerFoot"+(playerpos+1)).innerHTML="<font color='#FFFFFF'>Left/Right Footed</font>";}else{document.getElementById("playerFoot"+(playerpos+1)).innerHTML="<font color='#FFFFFF'>N/A</font>";}
document.getElementById("playerKit"+(playerpos+1)).innerHTML=result[19];document.lineupForm[playerpos].newPosition.selectedIndex=0;if(playerAddedInjured){document.lineupForm[playerpos].newPosition.style.color="red";}else{document.lineupForm[playerpos].newPosition.style.color="black";}
document.lineupForm[playerpos].newPosition.blur();if(document.getElementById("toplineupstatus_"+matchNo)){document.getElementById("toplineupstatus_"+matchNo).innerHTML=result[14];}
document.getElementById("lineupValidity").innerHTML=result[13];calculatePredictedRating(teamNo,matchNo,authCode,matchServerNo,isDefaultLineup,matchEngineVersion);}
function changeCaptain(hasMembership,authCode,teamNo,matchNo,matchServerNo,isDefaultLineup,matchEngineVersion){$("#captainUpdate").html("<font color='#FFFFFF'>Updating...</font>");if(matchNo.length==0){$("#captainUpdate").html("");return;}else{$("#captainUpdate").html("<font color='#FFFFFF'>Updating...</font>");}
var playerNoSelect=document.CAPTAINFORM.CAPTAIN.value;$.ajax({url:"includes/match/ajax/updateCaptain.php"+"?hm="+hasMembership+"&matchNo="+matchNo+"&ac="+authCode+"&teamNo="+teamNo+"&msn="+matchServerNo+"&mev="+matchEngineVersion+"&playerNoSelect="+playerNoSelect+"&isWaiting="+isDefaultLineup+"&randNum="+Math.random(),success:function(data){calculatePredictedRating(teamNo,matchNo,authCode,matchServerNo,isDefaultLineup,matchEngineVersion);$("#captainUpdate").html("<font color='#FFFFFF'>Updated</font>");}});}
function updatePenaltyTaker(hasMembership,penaltyPos,authCode,teamNo,matchNo,matchServerNo,isDefaultLineup,matchEngineVersion){document.getElementById("penaltyTaker"+penaltyPos).innerHTML="<img src='/images/icons/arrowSpin.gif' border='0px' /> <font color='#009900'>Updating...</font>";xmlHttp9=GetXmlHttpObject();if(xmlHttp9==null){alert("Browser does not support HTTP Request");return;}
var playerToAdd=document.penaltyForm[penaltyPos-1].newPosition.value;var url="includes/match/ajax/updatePenaltyTaker.php";url=url+"?hm="+hasMembership+"&teamNo="+teamNo+"&matchNo="+matchNo+"&ac="+authCode+"&msn="+matchServerNo+"&mev="+matchEngineVersion+"&penaltyPos="+penaltyPos+"&playerToAdd="+playerToAdd+"&isWaiting="+isDefaultLineup+"&randNum="+Math.random();xmlHttp9.onreadystatechange=function(){if((xmlHttp9.readyState==4||xmlHttp9.readyState=="complete")&&xmlHttp9.responseText!="error"){stateChangedPenaltyTaker(authCode,teamNo,matchNo,penaltyPos,matchServerNo,playerToAdd,matchEngineVersion);}};xmlHttp9.open("GET",url,true);xmlHttp9.send(null);}
function stateChangedPenaltyTaker(authCode,teamNo,matchNo,penaltyPos,matchServerNo,playerToAdd,matchEngineVersion){var resultText=xmlHttp9.responseText;var result=resultText.split("#");var removeIndex=document.penaltyForm[penaltyPos-1].newPosition.selectedIndex;var myselect4=document.penaltyForm[penaltyPos-1].newPosition;if(myselect4.options[0].value!=0){removeIndex=removeIndex-1;}
if(result[0]!=0){for(i=0;i<=10;i++){var myselect2=document.penaltyForm[i].newPosition;if(myselect2.options[1].value==0||myselect2.options[1].value==99999999999){document.penaltyForm[i].newPosition.remove(removeIndex+1);}else{document.penaltyForm[i].newPosition.remove(removeIndex);}}}
document.penaltyForm[penaltyPos-1].newPosition.remove(0);if(result[0]!=0){myselect=document.penaltyForm[penaltyPos-1].newPosition;try{myselect.add(new Option(result[0],result[4]),myselect.options[0]);}catch(e){myselect.add(new Option(result[0],result[4]),0);}
if(result[1]==0){try{myselect.add(new Option("---",0),myselect.options[1]);}catch(e){myselect.add(new Option("---",0),1);}}}
if(result[1]!=0){var i;var positionSkill;for(i=0;i<=10;i++){positionSkill=null;positionSkill=result[3];myselect=document.penaltyForm[i].newPosition;if(i==(penaltyPos-1)&&result[0]==0){try{myselect.add(new Option(result[2]+" "+positionSkill,result[1]),myselect.options[1]);}catch(e){myselect.add(new Option(result[2]+" "+positionSkill,result[1]),1);}}else{if(myselect.options[0].value==0){try{myselect.add(new Option(result[2]+" "+positionSkill,result[1]),myselect.options[1]);}catch(e){myselect.add(new Option(result[2]+" "+positionSkill,result[1]),1);}}else{try{myselect.add(new Option(result[2]+" "+positionSkill,result[1]),myselect.options[2]);}catch(e){myselect.add(new Option(result[2]+" "+positionSkill,result[1]),2);}}}}}
document.penaltyForm[penaltyPos-1].newPosition.selectedIndex=0;document.getElementById("penaltyTaker"+penaltyPos).innerHTML="<font color='#009900'>Done</font>";}
function updateStyle(hasMembership,authCode,teamNo,matchNo,matchServerNo,isDefaultLineup,matchEngineVersion){$("#lineupLoadSaveStatus").html("<font color='#009900'>Please wait...</font>");if(matchNo.length==0){$("#lineupLoadSaveStatus").html("");return;}else{$("#lineupLoadSaveStatus").html("<font color='#009900'>Please wait...</font>");}
var style=document.styleForm.style.value;$.ajax({url:"includes/match/ajax/updateStyle.php"+"?hm="+hasMembership+"&matchNo="+matchNo+"&ac="+authCode+"&teamNo="+teamNo+"&msn="+matchServerNo+"&mev="+matchEngineVersion+"&style="+style+"&isWaiting="+isDefaultLineup+"&randNum="+Math.random(),success:function(data){$("#lineupLoadSaveStatus").html(data);calculatePredictedRating(teamNo,matchNo,authCode,matchServerNo,isDefaultLineup,matchEngineVersion);}});}
function updateMentality(hasMembership,authCode,teamNo,matchNo,matchServerNo,isDefaultLineup,matchEngineVersion){$("#lineupLoadSaveStatus").html("<font color='#009900'>Please wait...</font>");if(matchNo.length==0){$("#lineupLoadSaveStatus").html("");return;}else{$("#lineupLoadSaveStatus").html("<font color='#009900'>Please wait...</font>")}
var mentality=document.mentalityForm.mentality.value;$.ajax({url:"includes/match/ajax/updateMentality.php"+"?hm="+hasMembership+"&matchNo="+matchNo+"&ac="+authCode+"&teamNo="+teamNo+"&msn="+matchServerNo+"&mev="+matchEngineVersion+"&mentality="+mentality+"&isWaiting="+isDefaultLineup+"&randNum="+Math.random(),success:function(data){$("#lineupLoadSaveStatus").innerHTML=data;calculatePredictedRating(teamNo,matchNo,authCode,matchServerNo,isDefaultLineup,matchEngineVersion);}});}
function updateSubstitute(hasMembership,authCode,teamNo,matchNo,matchServerNo,subPos,isDefaultLineup,matchEngineVersion){document.getElementById("SUB"+subPos+"MESSAGE").innerHTML="<font color='#009900'>Please wait...</font>";if(matchNo.length==0){document.getElementById("SUB"+subPos+"MESSAGE").innerHTML="";return;}else{document.getElementById("SUB"+subPos+"MESSAGE").innerHTML="<font color='#009900'>Please wait...</font>";}
xmlHttp9=GetXmlHttpObject();if(xmlHttp9==null){alert("Browser does not support HTTP Request");return;}
var playerAddNo=document.SUBFORM[subPos].SUB.value;var url="includes/match/ajax/updateSubstitute.php";url=url+"?hm="+hasMembership+"&matchNo="+matchNo+"&ac="+authCode+"&teamNo="+teamNo+"&msn="+matchServerNo+"&mev="+matchEngineVersion+"&subPos="+subPos+"&playerToAdd="+playerAddNo+"&isWaiting="+isDefaultLineup+"&randNum="+Math.random();xmlHttp9.onreadystatechange=function(){if(xmlHttp9.readyState==4||xmlHttp9.readyState=="complete"){if(xmlHttp9.responseText!="error"){stateChanged8(hasMembership,authCode,teamNo,matchNo,matchServerNo,subPos,matchEngineVersion,playerAddNo);}}};xmlHttp9.open("GET",url,true);xmlHttp9.send(null);}
function stateChanged8(hasMembership,authCode,teamNo,matchNo,matchServerNo,subPos,matchEngineVersion,playerAddNo){var result=xmlHttp9.responseText;result=result.split("#");var removeIndex=document.SUBFORM[subPos].SUB.selectedIndex;var myselect4=document.SUBFORM[subPos].SUB;if(myselect4.options[0].value!=0){removeIndex=removeIndex-1;}
if(result[0]!=0){for(i=0;i<=4;i++){var myselect2=document.SUBFORM[i].SUB;if(myselect2.options[1].value==0||myselect2.options[1].value==99999999999){document.SUBFORM[i].SUB.remove(removeIndex+1);}else{document.SUBFORM[i].SUB.remove(removeIndex);}}}
document.SUBFORM[subPos].SUB.remove(0);var playerAddedInjured=false;if(result[0]!=0){myselect=document.SUBFORM[subPos].SUB;if(result[0].substr(0,7)=="INJURED"){playerAddedInjured=true;$(document.SUBFORM[subPos].SUB).prepend($("<option></option>").attr("value",playerAddNo).text(result[0].substr(7)+" (injured)"));}else{$(document.SUBFORM[subPos].SUB).prepend($("<option></option>").attr("value",playerAddNo).text(result[0]));}
if(result[1]==0){try{myselect.add(new Option("---",0),myselect.options[1]);}catch(e){myselect.add(new Option("---",0),1);}}}
if(result[1]!=0){var i;for(i=0;i<=4;i++){var positionSkill=null;if(i==0){positionSkill=result[6];}else if(i==1){positionSkill=result[7];}else if(i==2||i==3){positionSkill=result[8];}else{positionSkill=result[9];}
myselect=document.SUBFORM[i].SUB;if(i==subPos&&result[0]==0){if(result[2].substr(0,7)=="INJURED"){try{myselect.add(new Option(result[2].substr(7)+" "+positionSkill+" (injured)",result[1]),myselect.options[1]);}catch(e){myselect.add(new Option(result[2].substr(7)+" "+positionSkill+" (injured)",result[1]),1);}
myselect.options[1].style.color="red";}else{try{myselect.add(new Option(result[2]+" "+positionSkill,result[1]),myselect.options[1]);}catch(e){myselect.add(new Option(result[2]+" "+positionSkill,result[1]),1);}
myselect.options[1].style.color="black";}}else{if(result[2].substr(0,7)=="INJURED"){if(myselect.options[0].value==0){try{myselect.add(new Option(result[2].substr(7)+" "+positionSkill+" (injured)",result[1]),myselect.options[1]);}catch(e){myselect.add(new Option(result[2].substr(7)+" "+positionSkill+" (injured)",result[1]),1);}
myselect.options[2].style.color="red";}else{try{myselect.add(new Option(result[2].substr(7)+" "+positionSkill+" (injured)",result[1]),myselect.options[2]);}catch(e){myselect.add(new Option(result[2].substr(7)+" "+positionSkill+" (injured)",result[1]),2);}
myselect.options[2].style.color="red";}}else{if(myselect.options[0].value==0){try{myselect.add(new Option(result[2]+" "+positionSkill,result[1]),myselect.options[1]);}catch(e){myselect.add(new Option(result[2]+" "+positionSkill,result[1]),1);}
myselect.options[2].style.color="black";}else{try{myselect.add(new Option(result[2]+" "+positionSkill,result[1]),myselect.options[2]);}catch(e){myselect.add(new Option(result[2]+" "+positionSkill,result[1]),2);}
myselect.options[2].style.color="black";}}}}}
if(playerAddedInjured){document.SUBFORM[subPos].SUB.style.color="red";}else{document.SUBFORM[subPos].SUB.style.color="black";}
document.SUBFORM[subPos].SUB.selectedIndex=0;document.getElementById("SUB"+subPos+"MESSAGE").innerHTML="<font color='#008000' style='font-size:11px;'>Sub Updated</font>";}
function updateSetPieces(hasMembership,authCode,teamNo,matchNo,matchServerNo,setPiecePos,isDefaultLineup,matchEngineVersion){$("#setPieceMessage"+setPiecePos).html("<font color='#009900'>Please wait...</font>");if(matchNo.length==0){$("#setPieceMessage"+setPiecePos).html("");return;}else{$("#setPieceMessage"+setPiecePos).html("<font color='#009900'>Please wait...</font>");}
var playerNoSelect=document.SETPIECEFORM[setPiecePos].SETPIECE.value;$.ajax({url:"includes/match/ajax/updateSetPieces.php"+"?hm="+hasMembership+"&matchNo="+matchNo+"&ac="+authCode+"&teamNo="+teamNo+"&msn="+matchServerNo+"&mev="+matchEngineVersion+"&setPiecePos="+setPiecePos+"&playerNoSelect="+playerNoSelect+"&isWaiting="+isDefaultLineup+"&randNum="+Math.random(),success:function(data){document.getElementById("setPieceMessage"+setPiecePos).innerHTML="<font color='#009900' style='font-size:11px;'>Set Piece Taker Updated</font>";}});}
function clearDiv(div){document.getElementById(div).innerHTML="";}
function clearMultipleDiv(div,firstNum,lastNum,divAndNumGap){for(var i=firstNum;i<=lastNum;i++){document.getElementById(div+divAndNumGap+i).innerHTML="";}}
function doThis(){document.getElementById("lineupDiv").innerHTML="";}
var numShownCommLines=1;var xmlHttp7;var homeGoalCount=0;var awayGoalCount=0;function setMostRecentId(matchNo,matchServerNo,homeTeamNo,awayTeamNo,homeTeamName,awayTeamName,homeHex,awayHex,matchEngineVersion,watchAsLive){if(watchAsLive==null){watchAsLive=0;}
if(watchAsLive==1){watchAsLiveStartDate=parseInt(document.getElementById("watchAsLiveStartDate").innerHTML);}
xmlHttp7=GetXmlHttpObject();if(xmlHttp7==null){alert("Browser does not support HTTP Request");return;}
var url="/modules/includes/match/ajax/getCommentaryShownLines.php";url=url+"?matchNo="+matchNo+"&matchServerNo="+matchServerNo+"&mev="+matchEngineVersion+"&watchAsLiveStartDate="+watchAsLiveStartDate+"&randNum="+Math.random();xmlHttp7.onreadystatechange=function(){if((xmlHttp7.readyState==4||xmlHttp7.readyState=="complete")&&xmlHttp7.responseText!="error"){numShownCommLines=parseInt(xmlHttp7.responseText);getNewCommentary(matchNo,matchServerNo,homeTeamNo,awayTeamNo,homeTeamName,awayTeamName,homeHex,awayHex,matchEngineVersion,watchAsLive);}};xmlHttp7.open("GET",url,true);xmlHttp7.send(null);}
function getNewCommentary(matchNo,matchServerNo,homeTeamNo,awayTeamNo,homeTeamName,awayTeamName,homeHex,awayHex,matchEngineVersion,watchAsLive){var result;var resultArray;result=null;xmlHttp7=GetXmlHttpObject();watchAsLiveStartDate=null;if(watchAsLive==1){watchAsLiveStartDate=parseInt(document.getElementById("watchAsLiveStartDate").innerHTML);}
if(xmlHttp7==null){alert("Browser does not support HTTP Request");return;}
var url="/modules/includes/match/ajax/getCommentary.php";if(numShownCommLines==null){url=url+"?numShownCommLines="+numShownCommLines+"&matchNo="+matchNo+"&matchServerNo="+matchServerNo+"&mev="+matchEngineVersion+"&watchAsLiveStartDate="+watchAsLiveStartDate+"&initialLoad=1"+"&randNum="+Math.random();}else{url=url+"?numShownCommLines="+numShownCommLines+"&matchNo="+matchNo+"&matchServerNo="+matchServerNo+"&mev="+matchEngineVersion+"&watchAsLiveStartDate="+watchAsLiveStartDate+"&randNum="+Math.random();}
xmlHttp7.onreadystatechange=function(){if((xmlHttp7.readyState==4||xmlHttp7.readyState=="complete")&&xmlHttp7.responseText!="error"){stateChangedLiveText(matchNo,matchServerNo,homeTeamNo,awayTeamNo,homeTeamName,awayTeamName,homeHex,awayHex,matchEngineVersion);}};xmlHttp7.open("GET",url,true);xmlHttp7.send(null);setTimeout("getNewCommentary("+matchNo+","+matchServerNo+","+homeTeamNo+","+awayTeamNo+",\""+homeTeamName+"\",\""+awayTeamName+"\",'"+homeHex+"','"+awayHex+"',"+matchEngineVersion+",'"+watchAsLive+"');",5000);}
function stateChangedLiveText(matchNo,matchServerNo,homeTeamNo,awayTeamNo,homeTeamName,awayTeamName,homeHex,awayHex,matchEngineVersion){var result;var resultArray;result=xmlHttp7.responseText;if(result.length>0){resultArray=result.split("###");var i;for(i=(resultArray.length-1);i>=0;i--){result=resultArray[i].split("##");var newContent;if(result[2]=="SP"){newContent="<tr><td colspan='3' style='padding-top:7px;'>"+result[3]+"</td></tr>";document.getElementById("matchCommentary").innerHTML="<table width='100%' cellspacing='0px' cellpadding='0px'>"+newContent+"</table>"+document.getElementById("matchCommentary").innerHTML;}else{result[0]=parseInt(result[0]);result[1]=parseInt(result[1]);if(result[0]>=137&&result[1]>=0){result[0]-=17;}else if((result[0]==121&&result[1]>0)||result[0]>121){result[0]-=17;}else if(result[0]==121&&result[1]==0){result[0]-=16;}else if(result[0]>=106){result[0]-=16;}else if(result[0]>=60){result[0]-=15;}
if(result[0]<10&&result>=0){result[0]="0"+result[0];}
if(result[1]<10){result[1]="0"+result[1];}
switch(result[2]){case"N":if(result[6]==homeTeamNo){newContent="<tr><td width='3%' valign='top' style='padding-top:4px;'><img src='/includes/matchTeamBlob.php?hex="+homeHex+"' style='border:solid; border-width:1px; border-color:#000000;'></td><td width='10%' style='padding-left:6px; padding-top:4px;' valign='top'><b>"+result[0]+":"+result[1]+"</b></td><td width='87%' style='padding-left:4px;  padding-bottom:4px; padding-top:4px;'>"+result[3]+"</td></tr>";}else{newContent="<tr><td width='3%' valign='top' style='padding-top:4px;'><img src='/includes/matchTeamBlob.php?hex="+awayHex+"' style='border:solid; border-width:1px; border-color:#000000;'></td><td width='10%' style='padding-left:6px; padding-top:4px;' valign='top'><b>"+result[0]+":"+result[1]+"</b></td><td width='87%' style='padding-left:4px;  padding-bottom:4px; padding-top:4px;'>"+result[3]+"</td></tr>";}
break;case"G":var teamName;if(result[3]==homeTeamNo){teamName=homeTeamName;liveHomeGoals[matchNo]=parseInt(liveHomeGoals[matchNo]);liveHomeGoals[matchNo]=liveHomeGoals[matchNo]+1;document.getElementById("homeScoreline_ingame").innerHTML=liveHomeGoals[matchNo];}else if(result[3]==awayTeamNo){teamName=awayTeamName;liveAwayGoals[matchNo]=parseInt(liveAwayGoals[matchNo]);liveAwayGoals[matchNo]=liveAwayGoals[matchNo]+1;document.getElementById("awayScoreline_ingame").innerHTML=liveAwayGoals[matchNo];}
newContent="<tr><td width='3%'><img src='/includes/matchTeamBlob.php?hex="+homeHex+"' style='border:solid; border-width:1px; border-color:#000000;'></td><td width='10%' style='background-color:#000000; color:gold; padding-left:6px; padding-top:4px;' valign='top'><b>"+result[0]+":"+result[1]+"</b></td><td width='87%' style='background-color:#000000; color:gold; padding-left:4px; padding-top:4px; padding-bottom:4px;'>GOAL - "+result[5]+" ("+teamName+")<br/>"+result[4]+"</td></tr>";break;case"Y":newContent="<tr><td width='3%'><img src='/includes/matchTeamBlob.php?hex="+homeHex+"' style='border:solid; border-width:1px; border-color:#000000;'></td><td width='10%' style='background-color:yellow; padding-left:6px; padding-top:4px;' valign='top'><b>"+result[0]+":"+result[1]+"</b></td><td width='87%' style='background-color:yellow; padding-left:4px;padding-top:4px; padding-bottom:4px;'><img src='/images/misc/yellowCardMini.png'> "+result[3]+"</td></tr>";break;case"R":newContent="<tr><td width='3%'><img src='/includes/matchTeamBlob.php?hex="+homeHex+"' style='border:solid; border-width:1px; border-color:#000000;'></td><td width='10%' style='background-color:red; color:#FFFFFF; padding-left:6px; padding-top:4px;' valign='top'><b>"+result[0]+":"+result[1]+"</b></td><td width='87%' style='background-color:red; color:#FFFFFF; padding-left:4px;padding-top:4px; padding-bottom:4px;'>SENT OFF<br/>"+result[3]+"</td></tr>";break;case"X":case"HT":case"HTR":case"HTET":case"ETS":case"PNS":case"HTETR":newContent="<tr><td width='3%'><img src='/includes/matchTeamBlob.php?hex="+homeHex+"' style='border:solid; border-width:1px; border-color:#000000;'></td><td width='10%' style='background-color:#CCCCCC; padding-left:6px; padding-top:4px;' valign='top'><b>"+result[0]+":"+result[1]+"</b></td><td width='87%' style='background-color:#CCCCCC;padding-left:4px;padding-top:4px; padding-bottom:4px;'>"+result[3]+"</td></tr>";break;default:newContent="<tr><td width='3%'><img src='/includes/matchTeamBlob.php?hex="+homeHex+"' style='border:solid; border-width:1px; border-color:#000000;'></td><td width='10%' style='padding-left:6px; padding-top:4px;' valign='top'><b>"+result[0]+":"+result[1]+"</b></td><td width='87%' style='padding-left:4px; padding-top:5px; padding-bottom:5px;'>"+result[3]+"</td></tr>";}
document.getElementById("matchCommentary").innerHTML="<table width='100%' cellspacing='0px' cellpadding='0px'>"+newContent+"</table>"+document.getElementById("matchCommentary").innerHTML;}
numShownCommLines=numShownCommLines+1;if(result[2]=="HT"||result[2]=="HTET"){newContent="<tr><td colspan='3'>-------------------------------------------------------------------------------</td></tr>";document.getElementById("matchCommentary").innerHTML="<table width='100%' cellspacing='0px' cellpadding='0px'>"+newContent+"</table>"+document.getElementById("matchCommentary").innerHTML;}}}}
var xmlHttp8=[];var minutes=[];var seconds=[];var liveHomeGoals=[];var liveAwayGoals=[];function getMatchTimer(matchNo,matchServerNo,matchEngineVersion,divSelector,watchAsLive){var result;var resultArray;var xmlHttp8temp;result=null;if(watchAsLive==null){watchAsLive=false;}
xmlHttp8temp=GetXmlHttpObject();if(xmlHttp8[matchNo]==null){xmlHttp8[matchNo]=[];}
xmlHttp8[matchNo][divSelector]=xmlHttp8temp;if(xmlHttp8temp==null){alert("Browser does not support HTTP Request");return;}
if(watchAsLive==false){var url="/modules/includes/match/ajax/resyncMatchTimer.php";url=url+"?matchNo="+matchNo+"&matchServerNo="+matchServerNo+"&randNum="+Math.random();xmlHttp8temp.onreadystatechange=function(){if((xmlHttp8temp.readyState==4||xmlHttp8temp.readyState=="complete")&&xmlHttp8temp.responseText!="error"){stateChangedMatchTimer(matchNo,matchServerNo,matchEngineVersion,divSelector);}};xmlHttp8temp.open("GET",url,true);xmlHttp8temp.send(null);setTimeout("getMatchTimer("+matchNo+","+matchServerNo+","+matchEngineVersion+",'"+divSelector+"');",60000);}}
function stateChangedMatchTimer(matchNo,matchServerNo,matchEngineVersion,divSelector){var result;var resultArray;var xmlHttp8temp=xmlHttp8[matchNo][divSelector];result=xmlHttp8temp.responseText;if(result.length>0){result=result.split("#");minutes[matchNo][divSelector]=result[1];seconds[matchNo][divSelector]=result[2];}}
function getLiveMatchScore(zminutes,zseconds,matchNo,matchServerNo,matchEngineVersion,divSelector,updateScore){var xmlHttp8temp=xmlHttp8[matchNo][divSelector];var url="/modules/includes/match/ajax/getMatchScore.php";url=url+"?matchNo="+matchNo+"&matchServerNo="+matchServerNo+"&mev="+matchEngineVersion+"&minutes="+zminutes+"&seconds="+zseconds+"&randNum="+Math.random();xmlHttp8temp.onreadystatechange=function(){if((xmlHttp8temp.readyState==4||xmlHttp8temp.readyState=="complete")&&xmlHttp8temp.responseText!="error"){var result;result=xmlHttp8temp.responseText;result=result.split("#");liveHomeGoals[matchNo]=parseInt(result[0]);liveAwayGoals[matchNo]=parseInt(result[1]);if(updateScore==true&&isNaN(liveHomeGoals[matchNo])==false&&isNaN(liveAwayGoals[matchNo])==false){if(document.getElementById("homeScoreline_"+divSelector)){document.getElementById("homeScoreline_"+divSelector).innerHTML=liveHomeGoals[matchNo];document.getElementById("awayScoreline_"+divSelector).innerHTML=liveAwayGoals[matchNo];}}}};xmlHttp8temp.open("GET",url,true);xmlHttp8temp.send(null);}
function displayStatus(init,initMins,initSecs,matchType,matchNo,matchServerNo,matchEngineVersion,divSelector,updateScore){var tempMinutes;var tempSeconds;if(init==true){if(minutes[matchNo]==null){minutes[matchNo]=[];seconds[matchNo]=[];}
minutes[matchNo][divSelector]=initMins;seconds[matchNo][divSelector]=initSecs;getLiveMatchScore(minutes[matchNo][divSelector],seconds[matchNo][divSelector],matchNo,matchServerNo,matchEngineVersion,divSelector,updateScore);}else if(seconds[matchNo][divSelector]==0){getLiveMatchScore(minutes[matchNo][divSelector],seconds[matchNo][divSelector],matchNo,matchServerNo,matchEngineVersion,divSelector,updateScore);}
if(minutes[matchNo][divSelector]<0||(minutes[matchNo][divSelector]==0&&seconds[matchNo][divSelector]<0)){tempMinutes=Math.abs(minutes[matchNo][divSelector]);tempSeconds=Math.abs(seconds[matchNo][divSelector]);if(tempMinutes<10){tempMinutes="0"+tempMinutes;}
if(tempSeconds<10){tempSeconds="0"+tempSeconds;}
document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'>Kick off in "+tempMinutes+":"+tempSeconds+"</font>";}else if(minutes[matchNo][divSelector]<45){tempMinutes=Math.abs(minutes[matchNo][divSelector]);tempSeconds=Math.abs(seconds[matchNo][divSelector]);if(tempMinutes<10){tempMinutes="0"+tempMinutes;}
if(tempSeconds<10){tempSeconds="0"+tempSeconds;}
document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'>Current Time: <b>"+tempMinutes+"</b>:<b>"+tempSeconds+"</b></font>";}else if(minutes[matchNo][divSelector]<60){if(seconds[matchNo][divSelector]>49){tempSeconds="0"+(59-seconds[matchNo][divSelector]);}else{tempSeconds=(59-seconds[matchNo][divSelector]);}
document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'>Current Time: <b>Half Time</b> (Game restarts in "+((60-minutes[matchNo][divSelector])-1)+":"+tempSeconds+")</font>";}else if(minutes[matchNo][divSelector]<105){tempMinutes=Math.abs(minutes[matchNo][divSelector]-15);tempSeconds=Math.abs(seconds[matchNo][divSelector]);if(tempSeconds<10){tempSeconds="0"+tempSeconds;}
document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'>Current Time: <b>"+tempMinutes+"</b>:<b>"+tempSeconds+"</b></font>";}else if(minutes[matchNo][divSelector]<106&&(matchType=="C"||matchType=="P")&&liveHomeGoals[matchNo]==liveAwayGoals[matchNo]){if(seconds[matchNo][divSelector]>49){tempSeconds="0"+(59-seconds[matchNo][divSelector]);}else{tempSeconds=(59-seconds[matchNo][divSelector]);}
document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'>Current Time: <b>Full Time</b> (Extra time starts in 0:"+tempSeconds+")</font>";}else if(minutes[matchNo][divSelector]<106){if(seconds[matchNo][divSelector]>49){tempSeconds="0"+(59-seconds[matchNo][divSelector]);}else{tempSeconds=(59-seconds[matchNo][divSelector]);}
document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'>Current Time: Ending Match</font>";}else if(minutes[matchNo][divSelector]<121){tempMinutes=minutes[matchNo][divSelector]-16;tempSeconds=seconds[matchNo][divSelector];if(tempMinutes<10){tempMinutes="0"+tempMinutes;}
if(tempSeconds<10){tempSeconds="0"+tempSeconds;}
document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'>Current Time: <b>"+tempMinutes+"</b>:<b>"+tempSeconds+"</b> (Extra time)</font>";}else if(minutes[matchNo][divSelector]<122){if(seconds[matchNo][divSelector]>49){tempSeconds="0"+(59-seconds[matchNo][divSelector]);}else{tempSeconds=(59-seconds[matchNo][divSelector]);}
document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'>Current Time: <b>Half Time</b> (Extra time restarts in 0:"+tempSeconds+")</font>";}else if(minutes[matchNo][divSelector]<137){tempMinutes=minutes[matchNo][divSelector]-17;tempSeconds=seconds[matchNo][divSelector];if(tempMinutes<10){tempMinutes="0"+tempMinutes;}
if(tempSeconds<10){tempSeconds="0"+tempSeconds;}
document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'>Current Time: <b>"+tempMinutes+"</b>:<b>"+tempSeconds+"</b> (Extra time)</font>";}else if(minutes[matchNo][divSelector]==137&&liveHomeGoals[matchNo]!=liveAwayGoals[matchNo]){document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'>Current Time: Ending Match</font>";}else if(minutes[matchNo][divSelector]==137){document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'>Current Time: <b>Full Time</b> (Penalty Shootout starts in 0:"+tempSeconds+")</font>";}else if(minutes[matchNo][divSelector]<152){document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'>Current Time: Penalty Shootout in progress...</font>";}
seconds[matchNo][divSelector]++;if(seconds[matchNo][divSelector]==60){seconds[matchNo][divSelector]=0;minutes[matchNo][divSelector]++;}else if(seconds[matchNo][divSelector]==0){seconds[matchNo][divSelector]=-59;minutes[matchNo][divSelector]++;if(minutes[matchNo][divSelector]==1){seconds[matchNo][divSelector]=0;minutes[matchNo][divSelector]=0;}}
setTimeout("displayStatus("+false+", "+minutes[matchNo][divSelector]+","+seconds[matchNo][divSelector]+",'"+matchType+"',"+matchNo+","+matchServerNo+","+matchEngineVersion+",'"+divSelector+"', "+updateScore+");",985);}
function displayStatusMini(init,initMins,initSecs,matchType,matchNo,matchServerNo,matchEngineVersion,divSelector,updateScore){var tempMinutes;var tempSeconds;if(init==true){if(minutes[matchNo]==null){minutes[matchNo]=[];seconds[matchNo]=[];}
minutes[matchNo][divSelector]=initMins;seconds[matchNo][divSelector]=initSecs;getLiveMatchScore(minutes[matchNo][divSelector],seconds[matchNo][divSelector],matchNo,matchServerNo,matchEngineVersion,divSelector,updateScore);}else if(seconds[matchNo][divSelector]%10==0){getLiveMatchScore(minutes[matchNo][divSelector],seconds[matchNo][divSelector],matchNo,matchServerNo,matchEngineVersion,divSelector,updateScore);}
if(minutes[matchNo][divSelector]<0||(minutes[matchNo][divSelector]==0&&seconds[matchNo][divSelector]<0)){tempMinutes=Math.abs(minutes[matchNo][divSelector]);tempSeconds=Math.abs(seconds[matchNo][divSelector]);if(tempMinutes<10){tempMinutes="0"+tempMinutes;}
if(tempSeconds<10){tempSeconds="0"+tempSeconds;}
document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'>KO in:"+tempMinutes+":"+tempSeconds+"</font>";}else if(minutes[matchNo][divSelector]<45){tempMinutes=Math.abs(minutes[matchNo][divSelector]);tempSeconds=Math.abs(seconds[matchNo][divSelector]);if(tempMinutes<10){tempMinutes="0"+tempMinutes;}
if(tempSeconds<10){tempSeconds="0"+tempSeconds;}
document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'><b>"+tempMinutes+"</b>:<b>"+tempSeconds+"</b></font>";}else if(minutes[matchNo][divSelector]<60){if(seconds[matchNo][divSelector]>49){tempSeconds="0"+(59-seconds[matchNo][divSelector]);}else{tempSeconds=(59-seconds[matchNo][divSelector]);}
document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'><b>HT</b> (45:00)";}else if(minutes[matchNo][divSelector]<105){tempMinutes=minutes[matchNo][divSelector]-15;tempSeconds=seconds[matchNo][divSelector];if(tempSeconds<10){tempSeconds="0"+tempSeconds;}
document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'><b>"+tempMinutes+"</b>:<b>"+tempSeconds+"</b></font>";}else if(minutes[matchNo][divSelector]<106&&(matchType=="C"||matchType=="P")&&liveHomeGoals[matchNo]==liveAwayGoals[matchNo]){if(seconds[matchNo][divSelector]>49){tempSeconds="0"+(59-seconds[matchNo][divSelector]);}else{tempSeconds=(59-seconds[matchNo][divSelector]);}
document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'><b>90:00</b> (ET)</font>";}else if(minutes[matchNo][divSelector]<106){if(seconds[matchNo][divSelector]>49){tempSeconds="0"+(59-seconds[matchNo][divSelector]);}else{tempSeconds=(59-seconds[matchNo][divSelector]);}
document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'>FT</font>";}else if(minutes[matchNo][divSelector]<121){tempMinutes=minutes[matchNo][divSelector]-16;tempSeconds=seconds[matchNo][divSelector];if(tempMinutes<10){tempMinutes="0"+tempMinutes;}
if(tempSeconds<10){tempSeconds="0"+tempSeconds;}
document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'><b>"+tempMinutes+":"+tempSeconds+"</b> (ET)</font>";}else if(minutes[matchNo][divSelector]<122){if(seconds[matchNo][divSelector]>49){tempSeconds="0"+(59-seconds[matchNo][divSelector]);}else{tempSeconds=(59-seconds[matchNo][divSelector]);}
document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'><b>105:00</b> (ET)</font>";}else if(minutes[matchNo][divSelector]<137){tempMinutes=minutes[matchNo][divSelector]-17;tempSeconds=seconds[matchNo][divSelector];if(tempMinutes<10){tempMinutes="0"+tempMinutes;}
if(tempSeconds<10){tempSeconds="0"+tempSeconds;}
document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'><b>"+tempMinutes+"</b>:<b>"+tempSeconds+"</b> (ET)</font>";}else if(minutes[matchNo][divSelector]==137&&liveHomeGoals[matchNo]!=liveAwayGoals[matchNo]){document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'>FT</font>";}else if(minutes[matchNo][divSelector]==137){document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'><b>FT</b> (Penalties)</font>";}else if(minutes[matchNo][divSelector]<152){document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'><b>FT</b> (Penalties)</font>";}
seconds[matchNo][divSelector]++;if(seconds[matchNo][divSelector]==60){seconds[matchNo][divSelector]=0;minutes[matchNo][divSelector]++;}else if(seconds[matchNo][divSelector]==0){seconds[matchNo][divSelector]=-59;minutes[matchNo][divSelector]++;if(minutes[matchNo][divSelector]==1){seconds[matchNo][divSelector]=0;minutes[matchNo][divSelector]=0;}}
setTimeout("displayStatusMini("+false+", "+minutes[matchNo][divSelector]+","+seconds[matchNo][divSelector]+",'"+matchType+"',"+matchNo+","+matchServerNo+","+matchEngineVersion+",'"+divSelector+"', "+updateScore+");",985);}
var xmlHttp8=[];var xmlHttp27=[];var minutes=[];var seconds=[];var resyncSeconds=[];var skipResync=[];var liveHomeGoals=[];var liveAwayGoals=[];var liveGoalsResync=[];var liveMatchTimeResync=[];var liveTextArray=[];var lastShownAction=[];var nextShownAction=[];function print_r(array,return_val){var output="",pad_char=" ",pad_val=4,d=this.window.document;var getFuncName=function(fn){var name=(/\W*function\s+([\w\$]+)\s*\(/).exec(fn);if(!name){return'(Anonymous)';}return name[1];};var repeat_char=function(len,pad_char){var str="";for(var i=0;i<len;i++){str+=pad_char;}
return str;};var formatArray=function(obj,cur_depth,pad_val,pad_char){if(cur_depth>0){cur_depth++;}
var base_pad=repeat_char(pad_val*cur_depth,pad_char);var thick_pad=repeat_char(pad_val*(cur_depth+1),pad_char);var str="";if(typeof obj==='object'&&obj!==null&&obj.constructor&&getFuncName(obj.constructor)!=='PHPJS_Resource'){str+="Array\n"+base_pad+"(\n";for(var key in obj){if(obj[key]instanceof Array){str+=thick_pad+"["+key+"] => "+formatArray(obj[key],cur_depth+1,pad_val,pad_char);}else{str+=thick_pad+"["+key+"] => "+obj[key]+"\n";}}
str+=base_pad+")\n";}else if(obj===null||obj===undefined){str='';}else{str=obj.toString();}
return str;};output=formatArray(array,0,pad_val,pad_char);if(return_val!==true){if(d.body){this.echo(output);}else{try{d=XULDocument;this.echo('<pre xmlns="http://www.w3.org/1999/xhtml" style="white-space:pre;">'+output+'</pre>');}catch(e){this.echo(output);}}
return true;}else{return output;}}
function jumpToTime(startMin,startSec,jumpToMin,jumpToSec,homeTeamNo,awayTeamNo,homeHex,awayHex,homeTeamName,awayTeamName,matchNo){startSec=""+startSec;jumpToSec=""+jumpToSec;if(startSec.length<2){startSec="0"+startSec;}
if(jumpToSec.length<2){jumpToSec="0"+jumpToSec;}
var startMinSec=parseFloat(startMin+"."+startSec);var jumpMinSec=parseFloat(jumpToMin+"."+jumpToSec);var thisMinFloat=null;for(var i=0;i<liveTextArray[matchNo].length;i++){thisMinFloat=parseFloat(liveTextArray[matchNo][i][0]);if(thisMinFloat>startMinSec&&thisMinFloat<jumpMinSec){printCommentary(liveTextArray[matchNo][i],homeTeamNo,awayTeamNo,homeHex,awayHex,homeTeamName,awayTeamName,matchNo);}}}
function getMatchTimer2(matchNo,matchServerNo,matchEngineVersion,divSelector,watchAsLive){var result;var resultArray;var xmlHttp8temp;result=null;if(watchAsLive==null){watchAsLive=false;}
xmlHttp8temp=GetXmlHttpObject();if(xmlHttp8[matchNo]==null){xmlHttp8[matchNo]=[];}
xmlHttp8[matchNo][divSelector]=xmlHttp8temp;if(xmlHttp8temp==null){alert("Browser does not support HTTP Request");return;}
if(watchAsLive==false){var timestamp=Math.round(new Date().getTime()/1000);if(liveMatchTimeResync[matchNo]==null||liveMatchTimeResync[matchNo]<(timestamp-30)){liveMatchTimeResync[matchNo]=timestamp;var url="/modules/includes/match/ajax/resyncMatchTimerAndScore.php";url=url+"?matchNo="+matchNo+"&matchServerNo="+matchServerNo+"&randNum="+Math.random();xmlHttp8temp.onreadystatechange=function(){if((xmlHttp8temp.readyState==4||xmlHttp8temp.readyState=="complete")&&xmlHttp8temp.responseText!="error"){stateChangedMatchTimerAndScore(matchNo,matchServerNo,matchEngineVersion,divSelector);}};xmlHttp8temp.open("GET",url,true);xmlHttp8temp.send(null);setTimeout("getMatchTimer2("+matchNo+","+matchServerNo+","+matchEngineVersion+",'"+divSelector+"');",60000);}}}
function stateChangedMatchTimerAndScore(matchNo,matchServerNo,matchEngineVersion,divSelector){var result;var resultArray;var xmlHttp8temp=xmlHttp8[matchNo][divSelector];result=xmlHttp8temp.responseText;if(result.length>0){result=result.split("--BREAK--");timeData=result[0].split("#");for(i in minutes[matchNo]){minutes[matchNo][i]=timeData[1];seconds[matchNo][i]=timeData[2];}
scoreData=result[1].split("#");liveHomeGoals[matchNo]=parseInt(scoreData[0],10);liveAwayGoals[matchNo]=parseInt(scoreData[1],10);if(isNaN(liveHomeGoals[matchNo])==false&&isNaN(liveAwayGoals[matchNo])==false){for(i in minutes[matchNo]){if(document.getElementById("homeScoreline_"+i)){document.getElementById("homeScoreline_"+i).innerHTML=liveHomeGoals[matchNo];document.getElementById("awayScoreline_"+i).innerHTML=liveAwayGoals[matchNo];}}}}}
function getLiveMatchScore(zminutes,zseconds,matchNo,matchServerNo,matchEngineVersion,divSelector,updateScore){var xmlHttp27temp;xmlHttp27temp=GetXmlHttpObject();if(xmlHttp27[matchNo]==null){xmlHttp27[matchNo]=[];}
xmlHttp27[matchNo][divSelector]=xmlHttp27temp;if(xmlHttp27temp==null){alert("Browser does not support HTTP Request");return;}
if(liveGoalsResync[matchNo]==null||liveGoalsResync[matchNo]<(((parseInt(zminutes)*60)+parseInt(zseconds))-30)){liveGoalsResync[matchNo]=(parseInt(zminutes)*60)+parseInt(zseconds);var url="/modules/includes/match/ajax/getMatchScore.php";url=url+"?matchNo="+matchNo+"&matchServerNo="+matchServerNo+"&mev="+matchEngineVersion+"&minutes="+zminutes+"&seconds="+zseconds+"&randNum="+Math.random();xmlHttp27temp.onreadystatechange=function(){if((xmlHttp27temp.readyState==4||xmlHttp27temp.readyState=="complete")&&xmlHttp27temp.responseText!="error"){var result;result=xmlHttp27temp.responseText;result=result.split("#");liveHomeGoals[matchNo]=parseInt(result[0],10);liveAwayGoals[matchNo]=parseInt(result[1],10);if(updateScore==true&&isNaN(liveHomeGoals[matchNo])==false&&isNaN(liveAwayGoals[matchNo])==false){if(document.getElementById("homeScoreline_"+divSelector)){document.getElementById("homeScoreline_"+divSelector).innerHTML=liveHomeGoals[matchNo];document.getElementById("awayScoreline_"+divSelector).innerHTML=liveAwayGoals[matchNo];}}}};xmlHttp27temp.open("GET",url,true);xmlHttp27temp.send(null);}else{if(document.getElementById("homeScoreline_"+divSelector)){document.getElementById("homeScoreline_"+divSelector).innerHTML=liveHomeGoals[matchNo];document.getElementById("awayScoreline_"+divSelector).innerHTML=liveAwayGoals[matchNo];}}}
function printCommentary(result,homeTeamNo,awayTeamNo,homeHex,awayHex,homeTeamName,awayTeamName,matchNo){var newContent;var timeArray=result[0].split(".");timeArray[0]=parseInt(timeArray[0],10);timeArray[1]=parseInt(timeArray[1],10);if(result[1]=="SP"){newContent="<tr><td colspan='3' style='padding-top:7px;'>"+result[2]+"</td></tr>";document.getElementById("matchCommentary").innerHTML="<table width='100%' cellspacing='0px' cellpadding='0px'>"+newContent+"</table>"+document.getElementById("matchCommentary").innerHTML;}else{if(timeArray[0]>=137&&timeArray[1]>=0){timeArray[0]-=17;}else if((timeArray[0]==121&&timeArray[1]>0)||timeArray[0]>121){timeArray[0]-=17;}else if(timeArray[0]==121&&timeArray[1]==0){timeArray[0]-=16;}else if(timeArray[0]>=106){timeArray[0]-=16;}else if(timeArray[0]>=60){timeArray[0]-=15;}
if(timeArray[0]<10&&timeArray[1]>=0){timeArray[0]="0"+timeArray[0];}
if(timeArray[1]<10){timeArray[1]="0"+timeArray[1];}
switch(result[1]){case"N":if(result[5]==homeTeamNo){newContent="<tr><td width='3%' valign='middle' align='center'><img src='/includes/matchTeamBlob.php?hex="+homeHex+"' style='border:solid; border-width:1px; border-color:#000000;'></td><td class='matchNormal' style='padding-left:8px;' width='10%'><b>"+timeArray[0]+":"+timeArray[1]+"</b></td><td width='87%' class='matchNormal' style='padding-right:4px;padding-left:2px;'>"+result[2]+"</td></tr>";}else{newContent="<tr><td width='3%' valign='middle' align='center'><img src='/includes/matchTeamBlob.php?hex="+awayHex+"' style='border:solid; border-width:1px; border-color:#000000;'></td><td class='matchNormal' style='padding-left:8px;' width='10%'><b>"+timeArray[0]+":"+timeArray[1]+"</b></td><td width='87%' class='matchNormal' style='padding-right:4px;padding-left:2px;'>"+result[2]+"</td></tr>";}
break;case"G":var teamName;if(result[2]==homeTeamNo){teamName=homeTeamName;if(isNaN(liveHomeGoals[matchNo])){liveHomeGoals[matchNo]=0;}
liveHomeGoals[matchNo]=parseInt(liveHomeGoals[matchNo],10);liveHomeGoals[matchNo]=liveHomeGoals[matchNo]+1;document.getElementById("homeScoreline_ingame").innerHTML=liveHomeGoals[matchNo];}else if(result[2]==awayTeamNo){teamName=awayTeamName;if(isNaN(liveAwayGoals[matchNo])){liveAwayGoals[matchNo]=0;}
liveAwayGoals[matchNo]=parseInt(liveAwayGoals[matchNo],10);liveAwayGoals[matchNo]=liveAwayGoals[matchNo]+1;document.getElementById("awayScoreline_ingame").innerHTML=liveAwayGoals[matchNo];}
newContent="<tr><td width='3%' valign='middle' align='center'><img src='/includes/matchTeamBlob.php?hex="+homeHex+"' style='border:solid; border-width:1px; border-color:#000000;'></td><td width='10%' style='background-color:#000000; color:gold; padding-left:6px; padding-top:4px;' valign='top'><b>"+timeArray[0]+":"+timeArray[1]+"</b></td><td width='87%' style='background-color:#000000; color:gold; padding-left:4px; padding-top:4px; padding-bottom:4px;'>GOAL - "+result[4]+" ("+teamName+")<br/>"+result[3]+"</td></tr>";break;case"Y":newContent="<tr><td width='3%' valign='middle' align='center'><img src='/includes/matchTeamBlob.php?hex="+homeHex+"' style='border:solid; border-width:1px; border-color:#000000;'></td><td width='10%' style='background-color:yellow; padding-left:6px; padding-top:4px;' valign='top'><b>"+timeArray[0]+":"+timeArray[1]+"</b></td><td width='87%' style='background-color:yellow; padding-left:4px;padding-top:4px; padding-bottom:4px;'><img src='/images/misc/yellowCardMini.png'> "+result[2]+"</td></tr>";break;case"R":newContent="<tr><td width='3%' valign='middle' align='center'><img src='/includes/matchTeamBlob.php?hex="+homeHex+"' style='border:solid; border-width:1px; border-color:#000000;'></td><td width='10%' style='background-color:red; color:#FFFFFF; padding-left:6px; padding-top:4px;' valign='top'><b>"+timeArray[0]+":"+timeArray[1]+"</b></td><td width='87%' style='background-color:red; color:#FFFFFF; padding-left:4px;padding-top:4px; padding-bottom:4px;'>SENT OFF<br/>"+result[2]+"</td></tr>";break;case"X":case"HT":case"HTR":case"HTET":case"ETS":case"PNS":case"HTETR":newContent="<tr><td width='3%' valign='middle' align='center'>&nbsp;</td><td width='10%' style='background-color:#CCCCCC; padding-left:6px; padding-top:4px;' valign='top'><b>"+timeArray[0]+":"+timeArray[1]+"</b></td><td width='87%' style='background-color:#CCCCCC;padding-left:4px;padding-top:4px; padding-bottom:4px;'>"+result[2]+"</td></tr>";break;default:newContent="<tr><td width='3%' valign='middle' align='center'><img src='/includes/matchTeamBlob.php?hex="+homeHex+"' style='border:solid; border-width:1px; border-color:#000000;'></td><td width='10%' style='padding-left:6px; padding-top:4px;' valign='top'><b>"+timeArray[0]+":"+timeArray[1]+"</b></td><td width='87%' style='padding-left:4px; padding-top:5px; padding-bottom:5px;'>"+result[2]+"</td></tr>";}
document.getElementById("matchCommentary").innerHTML="<table width='100%' cellspacing='0px' cellpadding='0px'>"+newContent+"</table>"+document.getElementById("matchCommentary").innerHTML;}
if(result[1]=="HT"||result[1]=="HTET"){newContent="<tr><td colspan='3'>-------------------------------------------------------------------------------</td></tr>";document.getElementById("matchCommentary").innerHTML="<table width='100%' cellspacing='0px' cellpadding='0px'>"+newContent+"</table>"+document.getElementById("matchCommentary").innerHTML;}}
function loadLiveText(matchNo,matchServerNo,matchEngineVersion,init){if(init==false){var teamIndex=new Array();teamIndex[0]="H";teamIndex[1]="A";var overallIndex=new Array();overallIndex[0]="OV";overallIndex[1]="DF";overallIndex[2]="MF";overallIndex[3]="AT";for(x in teamIndex){for(var y=1;y<=11;y++){performanceID="performance_"+teamIndex[x]+"_"+y;if(document.getElementById(performanceID)){document.getElementById(performanceID).innerHTML="<img src='/images/icons/ajaxLoad2.gif' border='0px' /> <span style='color:#009900;'>Updating</span>";}}
for(y in overallIndex){performanceID="performance_"+teamIndex[x]+"_"+overallIndex[y];if(document.getElementById(performanceID)){document.getElementById(performanceID).innerHTML="<img src='/images/icons/ajaxLoad4.gif' border='0px' />";}}}}
var url="/modules/includes/match/ajax/loadLiveText.php?matchNo="+matchNo+"&matchServerNo="+matchServerNo+"&mev="+matchEngineVersion+"&randNum="+Math.random();loadedLiveText=ajaxLoadURL(url,null,false);loadedLiveText=loadedLiveText.split("--BREAK--");liveTextArray[matchNo]=loadedLiveText[0];liveTextArray[matchNo]=liveTextArray[matchNo].split("###");for(var i=0;i<liveTextArray[matchNo].length;i++){liveTextArray[matchNo][i]=liveTextArray[matchNo][i].split("##");}
if(init==false){livePerformanceArray=loadedLiveText[1];livePerformanceArray=livePerformanceArray.split("+");for(i=0;i<livePerformanceArray.length;i++){performanceValueArray=livePerformanceArray[i].split("=>");performanceID="performance_"+performanceValueArray[0];if(document.getElementById(performanceID)){document.getElementById(performanceID).innerHTML=performanceValueArray[1];}}}}
function loadLivePerformance(matchNo,matchServerNo,matchEngineVersion){}
function displayStatus(init,initMins,initSecs,matchType,matchNo,matchServerNo,matchEngineVersion,divSelector,updateScore,homeTeamNo,awayTeamNo,homeHex,awayHex,homeTeamName,awayTeamName,watchAsLive){var tempMinutes;var tempSeconds;if(init==true){if(initSecs<=49){resyncSeconds[matchNo]=50+Math.floor(Math.random()*9);skipResync[matchNo]=false;}else{resyncSeconds[matchNo]=50+Math.floor(Math.random()*9);skipResync[matchNo]=initMins;}
if(minutes[matchNo]==null){minutes[matchNo]=[];seconds[matchNo]=[];}
minutes[matchNo][divSelector]=initMins;seconds[matchNo][divSelector]=initSecs;liveTextArray[matchNo]=[];loadLiveText(matchNo,matchServerNo,matchEngineVersion,true);}else if(seconds[matchNo][divSelector]==0){}
if(minutes[matchNo][divSelector]<0||(minutes[matchNo][divSelector]==0&&seconds[matchNo][divSelector]<0)){tempMinutes=Math.abs(minutes[matchNo][divSelector]);tempSeconds=Math.abs(seconds[matchNo][divSelector]);if(tempMinutes<10){tempMinutes="0"+tempMinutes;}
if(tempSeconds<10){tempSeconds="0"+tempSeconds;}
document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'>Kick off in "+tempMinutes+":"+tempSeconds+"</font>";}else if(minutes[matchNo][divSelector]<45){tempMinutes=Math.abs(minutes[matchNo][divSelector]);tempSeconds=Math.abs(seconds[matchNo][divSelector]);if(tempMinutes<10){tempMinutes="0"+tempMinutes;}
if(tempSeconds<10){tempSeconds="0"+tempSeconds;}
document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'>Current Time: <b>"+tempMinutes+"</b>:<b>"+tempSeconds+"</b></font>";}else if(minutes[matchNo][divSelector]<60){if(seconds[matchNo][divSelector]>49){tempSeconds="0"+(59-seconds[matchNo][divSelector]);}else{tempSeconds=(59-seconds[matchNo][divSelector]);}
document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'>Current Time: <b>Half Time</b> (Game restarts in "+((60-minutes[matchNo][divSelector])-1)+":"+tempSeconds+")</font>";}else if(minutes[matchNo][divSelector]<105){tempMinutes=Math.abs(minutes[matchNo][divSelector]-15);tempSeconds=Math.abs(seconds[matchNo][divSelector]);if(tempSeconds<10){tempSeconds="0"+tempSeconds;}
document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'>Current Time: <b>"+tempMinutes+"</b>:<b>"+tempSeconds+"</b></font>";}else if(minutes[matchNo][divSelector]<106&&(matchType=="C"||matchType=="P")&&liveHomeGoals[matchNo]==liveAwayGoals[matchNo]){if(seconds[matchNo][divSelector]>49){tempSeconds="0"+(59-seconds[matchNo][divSelector]);}else{tempSeconds=(59-seconds[matchNo][divSelector]);}
document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'>Current Time: <b>Full Time</b> (Extra time starts in 0:"+tempSeconds+")</font>";}else if(minutes[matchNo][divSelector]<106){if(seconds[matchNo][divSelector]>49){tempSeconds="0"+(59-seconds[matchNo][divSelector]);}else{tempSeconds=(59-seconds[matchNo][divSelector]);}
document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'>Current Time: Ending Match</font>";}else if(minutes[matchNo][divSelector]<121){tempMinutes=minutes[matchNo][divSelector]-16;tempSeconds=seconds[matchNo][divSelector];if(tempMinutes<10){tempMinutes="0"+tempMinutes;}
if(tempSeconds<10){tempSeconds="0"+tempSeconds;}
document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'>Current Time: <b>"+tempMinutes+"</b>:<b>"+tempSeconds+"</b> (Extra time)</font>";}else if(minutes[matchNo][divSelector]<122){if(seconds[matchNo][divSelector]>49){tempSeconds="0"+(59-seconds[matchNo][divSelector]);}else{tempSeconds=(59-seconds[matchNo][divSelector]);}
document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'>Current Time: <b>Half Time</b> (Extra time restarts in 0:"+tempSeconds+")</font>";}else if(minutes[matchNo][divSelector]<137){tempMinutes=minutes[matchNo][divSelector]-17;tempSeconds=seconds[matchNo][divSelector];if(tempMinutes<10){tempMinutes="0"+tempMinutes;}
if(tempSeconds<10){tempSeconds="0"+tempSeconds;}
document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'>Current Time: <b>"+tempMinutes+"</b>:<b>"+tempSeconds+"</b> (Extra time)</font>";}else if(minutes[matchNo][divSelector]==137&&liveHomeGoals[matchNo]!=liveAwayGoals[matchNo]){document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'>Current Time: Ending Match</font>";}else if(minutes[matchNo][divSelector]==137){document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'>Current Time: <b>Full Time</b> (Penalty Shootout starts in 0:"+tempSeconds+")</font>";}else if(minutes[matchNo][divSelector]<152){document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'>Current Time: Penalty Shootout in progress...</font>";}
if(init==false&&divSelector=="ingame"){var tempSecs=""+seconds[matchNo][divSelector];if(tempSecs.length<2){tempSecs="0"+tempSecs;}
var commentaryMinSec=minutes[matchNo][divSelector]+"."+tempSecs;for(var i=0;i<liveTextArray[matchNo].length;i++){if(liveTextArray[matchNo][i][0]==commentaryMinSec){printCommentary(liveTextArray[matchNo][i],homeTeamNo,awayTeamNo,homeHex,awayHex,homeTeamName,awayTeamName,matchNo);}}}
if(seconds[matchNo][divSelector]==resyncSeconds[matchNo]){if(skipResync[matchNo]!=initMins){resyncSeconds[matchNo]=50+Math.floor(Math.random()*9);skipResync[matchNo]=initMins;loadLiveText(matchNo,matchServerNo,matchEngineVersion,false);}}
seconds[matchNo][divSelector]++;if(seconds[matchNo][divSelector]==60){seconds[matchNo][divSelector]=0;minutes[matchNo][divSelector]++;}else if(seconds[matchNo][divSelector]==0){seconds[matchNo][divSelector]=-59;minutes[matchNo][divSelector]++;if(minutes[matchNo][divSelector]==1){seconds[matchNo][divSelector]=0;minutes[matchNo][divSelector]=0;}}
setTimeout("displayStatus("+false+", "+minutes[matchNo][divSelector]+","+seconds[matchNo][divSelector]+",'"+matchType+"',"+matchNo+","+matchServerNo+","+matchEngineVersion+",'"+divSelector+"', "+updateScore+", '"+homeTeamNo+"', '"+awayTeamNo+"', '"+homeHex+"', '"+awayHex+"', \""+homeTeamName+"\", \""+awayTeamName+"\");",985);}
function displayStatusMini(init,initMins,initSecs,matchType,matchNo,matchServerNo,matchEngineVersion,divSelector,updateScore){var tempMinutes;var tempSeconds;if(init==true){if(minutes[matchNo]==null){minutes[matchNo]=[];seconds[matchNo]=[];}
minutes[matchNo][divSelector]=initMins;seconds[matchNo][divSelector]=initSecs;}else if(seconds[matchNo][divSelector]==0){}
if(minutes[matchNo][divSelector]<0||(minutes[matchNo][divSelector]==0&&seconds[matchNo][divSelector]<0)){tempMinutes=Math.abs(minutes[matchNo][divSelector]);tempSeconds=Math.abs(seconds[matchNo][divSelector]);if(tempMinutes<10){tempMinutes="0"+tempMinutes;}
if(tempSeconds<10){tempSeconds="0"+tempSeconds;}
document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'>KO in:"+tempMinutes+":"+tempSeconds+"</font>";}else if(minutes[matchNo][divSelector]<45){tempMinutes=Math.abs(minutes[matchNo][divSelector]);tempSeconds=Math.abs(seconds[matchNo][divSelector]);if(tempMinutes<10){tempMinutes="0"+tempMinutes;}
if(tempSeconds<10){tempSeconds="0"+tempSeconds;}
document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'><b>"+tempMinutes+"</b>:<b>"+tempSeconds+"</b></font>";}else if(minutes[matchNo][divSelector]<60){if(seconds[matchNo][divSelector]>49){tempSeconds="0"+(59-seconds[matchNo][divSelector]);}else{tempSeconds=(59-seconds[matchNo][divSelector]);}
document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'><b>HT</b> (45:00)";}else if(minutes[matchNo][divSelector]<105){tempMinutes=minutes[matchNo][divSelector]-15;tempSeconds=seconds[matchNo][divSelector];if(tempSeconds<10){tempSeconds="0"+tempSeconds;}
document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'><b>"+tempMinutes+"</b>:<b>"+tempSeconds+"</b></font>";}else if(minutes[matchNo][divSelector]<106&&(matchType=="C"||matchType=="P")&&liveHomeGoals[matchNo]==liveAwayGoals[matchNo]){if(seconds[matchNo][divSelector]>49){tempSeconds="0"+(59-seconds[matchNo][divSelector]);}else{tempSeconds=(59-seconds[matchNo][divSelector]);}
document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'><b>90:00</b> (ET)</font>";}else if(minutes[matchNo][divSelector]<106){if(seconds[matchNo][divSelector]>49){tempSeconds="0"+(59-seconds[matchNo][divSelector]);}else{tempSeconds=(59-seconds[matchNo][divSelector]);}
document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'>FT</font>";}else if(minutes[matchNo][divSelector]<121){tempMinutes=minutes[matchNo][divSelector]-16;tempSeconds=seconds[matchNo][divSelector];if(tempMinutes<10){tempMinutes="0"+tempMinutes;}
if(tempSeconds<10){tempSeconds="0"+tempSeconds;}
document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'><b>"+tempMinutes+":"+tempSeconds+"</b> (ET)</font>";}else if(minutes[matchNo][divSelector]<122){if(seconds[matchNo][divSelector]>49){tempSeconds="0"+(59-seconds[matchNo][divSelector]);}else{tempSeconds=(59-seconds[matchNo][divSelector]);}
document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'><b>105:00</b> (ET)</font>";}else if(minutes[matchNo][divSelector]<137){tempMinutes=minutes[matchNo][divSelector]-17;tempSeconds=seconds[matchNo][divSelector];if(tempMinutes<10){tempMinutes="0"+tempMinutes;}
if(tempSeconds<10){tempSeconds="0"+tempSeconds;}
document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'><b>"+tempMinutes+"</b>:<b>"+tempSeconds+"</b> (ET)</font>";}else if(minutes[matchNo][divSelector]==137&&liveHomeGoals[matchNo]!=liveAwayGoals[matchNo]){document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'>FT</font>";}else if(minutes[matchNo][divSelector]==137){document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'><b>FT</b> (Penalties)</font>";}else if(minutes[matchNo][divSelector]<152){document.getElementById("matchTime_"+divSelector).innerHTML="<font style='font-size:11px;'><b>FT</b> (Penalties)</font>";}
seconds[matchNo][divSelector]++;if(seconds[matchNo][divSelector]==60){seconds[matchNo][divSelector]=0;minutes[matchNo][divSelector]++;}else if(seconds[matchNo][divSelector]==0){seconds[matchNo][divSelector]=-59;minutes[matchNo][divSelector]++;if(minutes[matchNo][divSelector]==1){seconds[matchNo][divSelector]=0;minutes[matchNo][divSelector]=0;}}
setTimeout("displayStatusMini("+false+", "+minutes[matchNo][divSelector]+","+seconds[matchNo][divSelector]+",'"+matchType+"',"+matchNo+","+matchServerNo+","+matchEngineVersion+",'"+divSelector+"', "+updateScore+");",985);}
var xmlHttp10;function getLiveCompetitionScores(matchNo,leagueID,competitionNo,startDate){result=null;xmlHttp10=GetXmlHttpObject();if(xmlHttp10==null){alert("Browser does not support HTTP Request");return;}
var url="/modules/includes/match/ajax/liveCompetitionScores.php";if(leagueID!=null){url=url+"?matchNo="+matchNo+"&leagueID="+leagueID+"&startDate="+startDate+"&randNum="+Math.random();}else{url=url+"?&matchNo="+matchNo+"&competitionNo="+competitionNo+"&startDate="+startDate+"&randNum="+Math.random();}
xmlHttp10.onreadystatechange=function(){if((xmlHttp10.readyState==4||xmlHttp10.readyState=="complete")&&xmlHttp10.responseText!="error"){setLiveCompetitionScores(matchNo,leagueID,competitionNo,startDate);}};xmlHttp10.open("GET",url,true);xmlHttp10.send(null);setTimeout("getLiveCompetitionScores("+matchNo+","+leagueID+","+competitionNo+",'"+startDate+"');",30000);}
function setLiveCompetitionScores(matchNo,leagueID,competitionNo,startDate){var result;var resultArray;result=xmlHttp10.responseText;if(result.length>0){resultArray=result.split("###");var newContent="<table style='padding-top:5px;' width='100%' cellpadding='0px' cellspacing='0px'>";var i;for(i=0;i<(resultArray.length);i++){result=resultArray[i].split("##");newContent+="<tr onmouseover='ChangeColor(this, true);' onmouseout='ChangeColor(this, false);' onclick=\"DoNav('/modules/match.php?ID="+result[4]+"');\"><td width='41%'><div style='overflow:hidden; height:1.2em;'>"+result[7]+" <a href='/modules/team.php?ID="+result[5]+"' class='fontDefaultLink'>"+result[0]+"</a></div></td><td align='center' height='16px' width='8%' style='border:solid; border-width:1px; border-color:#333333; font-weight:bold;'>"+result[1]+"</td><td width='2%'></td><td align='center' height='16px' width='8%' style='border:solid; border-width:1px; border-color:#333333; font-weight:bold;'>"+result[2]+"</td><td width='41%' align='right' style='padding-right:6px;'><div style='overflow:hidden; height:1.2em;'><a href='/modules/team.php?ID="+result[6]+"' class='fontDefaultLink'>"+result[3]+"</a> "+result[8]+"</div></td></tr>";newContent+="<tr><td colspan='5' height='3px'></td></tr>";document.getElementById("liveCompetitionScores").innerHTML=newContent;}
newContent+="</table>";document.getElementById("liveCompetitionScores").innerHTML=newContent;}}
var xmlHttp11;function myClubStatsRank(teamNo,rankByGroup,countryCode,div){xmlHttp11=GetXmlHttpObject();if(xmlHttp11==null){alert("Browser does not support HTTP Request");return;}
var url="/modules/includes/team/ajax/myClubStatsRank.php";url=url+"?teamNo="+teamNo+"&rankByGroup="+rankByGroup+"&div="+div+"&cc="+countryCode+"&randNum="+Math.random();xmlHttp11.onreadystatechange=function(){if((xmlHttp11.readyState==4||xmlHttp11.readyState=="complete")&&xmlHttp11.responseText!="error"){myClubStatsRank2(teamNo,rankByGroup,countryCode,div);}};xmlHttp11.open("GET",url,true);xmlHttp11.send(null);}
function myClubStatsRank2(teamNo,rankByGroup,countryCode,div){var result;var resultArray;result=xmlHttp11.responseText;if(result.length>0){resultArray=result.split("###");document.getElementById("rank_results").innerHTML="<a href='/modules/clubStatsRankings.php?rankByGroup="+rankByGroup+"&cc="+countryCode+"&div="+div+"&rankBy=RESULTS&pos="+resultArray[0]+"' class='fontDefaultLink'>Ranked #"+resultArray[0]+"</a>";document.getElementById("rank_cleansheets").innerHTML="<a href='/modules/clubStatsRankings.php?rankByGroup="+rankByGroup+"&cc="+countryCode+"&div="+div+"&rankBy=CLEANSHEETS&pos="+resultArray[1]+"' class='fontDefaultLink'>Ranked #"+resultArray[1]+"</a>";document.getElementById("rank_goals_scored").innerHTML="<a href='/modules/clubStatsRankings.php?rankByGroup="+rankByGroup+"&cc="+countryCode+"&div="+div+"&rankBy=GOALS_SCORED&pos="+resultArray[2]+"' class='fontDefaultLink'>Ranked #"+resultArray[2]+"</a>";document.getElementById("rank_goals_conceded").innerHTML="<a href='/modules/clubStatsRankings.php?rankByGroup="+rankByGroup+"&cc="+countryCode+"&div="+div+"&rankBy=GOALS_CONCEDED&pos="+resultArray[3]+"' class='fontDefaultLink'>Ranked #"+resultArray[3]+"</a>";document.getElementById("rank_win_streak").innerHTML="<a href='/modules/clubStatsRankings.php?rankByGroup="+rankByGroup+"&cc="+countryCode+"&div="+div+"&rankBy=WIN_STREAK&pos="+resultArray[4]+"' class='fontDefaultLink'>Ranked #"+resultArray[4]+"</a>";document.getElementById("rank_undefeated_streak").innerHTML="<a href='/modules/clubStatsRankings.php?rankByGroup="+rankByGroup+"&cc="+countryCode+"&div="+div+"&rankBy=UNDEFEATED_STREAK&pos="+resultArray[5]+"' class='fontDefaultLink'>Ranked #"+resultArray[5]+"</a>";document.getElementById("rank_flag_countries_visited").innerHTML="<a href='/modules/clubStatsRankings.php?rankByGroup="+rankByGroup+"&cc="+countryCode+"&div="+div+"&rankBy=FLAG_COUNTRIES_VISITED&pos="+resultArray[5]+"' class='fontDefaultLink'>Ranked #"+resultArray[5]+"</a>";document.getElementById("rank_flag_countries_hosted").innerHTML="<a href='/modules/clubStatsRankings.php?rankByGroup="+rankByGroup+"&cc="+countryCode+"&div="+div+"&rankBy=FLAG_COUNTRIES_HOSTED&pos="+resultArray[5]+"' class='fontDefaultLink'>Ranked #"+resultArray[5]+"</a>";document.getElementById("rank_flag_player_nationalities").innerHTML="<a href='/modules/clubStatsRankings.php?rankByGroup="+rankByGroup+"&cc="+countryCode+"&div="+div+"&rankBy=FLAG_PLAYER_NATIONALITIES&pos="+resultArray[5]+"' class='fontDefaultLink'>Ranked #"+resultArray[5]+"</a>";}}
function getClubStatsRank(rankBy,rankByGroup,division,pos,higherOrLower,countryCode){xmlHttp11=GetXmlHttpObject();if(xmlHttp11==null){alert("Browser does not support HTTP Request");return;}
var url="/modules/includes/team/ajax/getClubStatsRank.php";if(pos>=11&&higherOrLower=="higher"){pos-=10;}else if(higherOrLower=="lower"){pos+=10;}
url=url+"?rankBy="+rankBy+"&rankByGroup="+rankByGroup+"&pos="+pos+"&cc="+countryCode+"&div="+division+"&randNum="+Math.random();xmlHttp11.onreadystatechange=function(){if((xmlHttp11.readyState==4||xmlHttp11.readyState=="complete")&&xmlHttp11.responseText!="error"){getClubStatsRank2(rankBy,rankByGroup,division,pos,higherOrLower,countryCode);}};xmlHttp11.open("GET",url,true);xmlHttp11.send(null);}
function getClubStatsRank2(rankBy,rankByGroup,division,pos,higherOrLower,countryCode){result=xmlHttp11.responseText;var content="";var pageSkipDivide=Math.floor((pos-1)/10)*10;var dataSplit="";if(result.length>0){var rankByName;var columnHeader;switch(rankBy){case"RESULTS":rankByName="Best Results";columnHeader="Results (W/D/L)";break;case"CLEANSHEETS":rankByName="Most Clean Sheets";columnHeader="Clean Sheets";break;case"GOALS_SCORED":rankByName="Most Goals Scored";columnHeader="Goals Scored";break;case"GOALS_CONCEDED":rankByName="Least Goals Conceded";columnHeader="Goals Conceded";break;case"WIN_STREAK":rankByName="Longest Winning Streak";columnHeader="Win Streak";break;case"UNDEFEATED_STREAK":rankByName="Longest Undefeated Streak";columnHeader="Games Undefeated";break;case"FLAG_COUNTRIES_VISITED":rankByName="Most Countries Visited";columnHeader="Countries Visited";break;case"FLAG_COUNTRIES_HOSTED":rankByName="Most Countries Hosted";columnHeader="Countries Hosted";break;case"FLAG_PLAYER_NATIONALITIES":rankByName="Most Player Nationalities Owned";columnHeader="Player Nationalities Owned";break;default:break;}
document.getElementById("clubStatsRankSubtitle").innerHTML="Showing results "+(pageSkipDivide+1)+"-"+(pageSkipDivide+10)+" of "+rankByName;dataSplit=result.split("####");dataSplit[0]=parseInt(dataSplit[0]);content+="<table cellspacing='2px' cellpadding='2px' width='450px' style='padding-top:5px;'>";content+="<tr><td><a href='#' onClick=\"getClubStatsRank('"+rankBy+"', '"+rankByGroup+"', "+division+", 1, null, '"+countryCode+"')\" class='fontDefaultLink')'>First Page</a></td><td align='right'><a href='#' onClick=\"getClubStatsRank('"+rankBy+"', '"+rankByGroup+"', "+division+", "+dataSplit[0]+", null, '"+countryCode+"')\" class='fontDefaultLink')'>Last Page</a></td></tr>";content+="</table>";content+="<table cellspacing='2px' cellpadding='2px'>";resultArray=dataSplit[1].split("###");for(i=(resultArray.length-1);i>=0;i--){result=resultArray[i].split("##");var resultRank="";var header=false;if(result[0]=="0"){header=true;}
if(header){content+="<tr><td width='15px'></td><td align='center' width='35px'>Rank</td><td width='130px'>Team</td><td width='130px'>Manager</td><td align='center' width='130px'>"+columnHeader+"</td></tr>";}else{content+="<tr><td width='15px'></td><td align='center' width='35px'><b>"+result[0]+".</b></td><td width='150px'><a href='/modules/team.php?ID="+result[1]+"' class='fontDefaultLink'>"+result[2]+"</a></td><td width='150px'>"+result[3]+"</td><td align='center'>"+result[4]+"</td></tr>";}}
content+="<tr><td colspan='3' style='padding-top:8px;'>";if(pos>=10||higherOrLower=="lower"){content+="<a href='#' onclick=\"getClubStatsRank('"+rankBy+"', '"+rankByGroup+"', "+division+", "+pos+", 'higher', '"+countryCode+"')\" class='fontDefaultLink' style='text-decoration:none;'><< Show Higher results</a>";}
content+="</td><td><td colspan='2' style='padding-top:8px;'>";if(dataSplit[0]>=(pos+10)){content+="<a href='#' onclick=\"getClubStatsRank('"+rankBy+"', '"+rankByGroup+"', "+division+", "+pos+", 'lower', '"+countryCode+"')\" class='fontDefaultLink' style='text-decoration:none;'>Show Lower results >></a>";}
content+="</td></tr><tr><td colspan='5' style='padding-top:8px;'>[<a href='/modules/clubStats.php' class='fontDefaultLink'>Back to my Club stats</a>]</tr>";content+="</table>";document.getElementById("clubStatsTable").innerHTML=content;}}
function GetXmlHttpObject(){var xmlHttplocal;try{xmlHttplocal=new XMLHttpRequest();}catch(e){var XmlHttpVersions=new Array("MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.5.0","MSXML2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP");for(var i=0;i<XmlHttpVersions.length&&!xmlHttplocal;i++){try{xmlHttplocal=new ActiveXObject(XmlHttpVersions[i]);}catch(e){}}}
if(!xmlHttplocal)
alert("Error creating the XMLHttpRequest object.");else
return xmlHttplocal;}var xmlHttp25;function ajaxLoadURL(url,returnDiv,synchronous){if(synchronous==null){synchronous=true;}
xmlHttp25=GetXmlHttpObject();if(xmlHttp25==null){alert("Browser does not support HTTP Request");return;}
if(returnDiv!=null){document.getElementById(returnDiv).innerHTML="<img src='/images/icons/ajaxLoad.gif'>"}
xmlHttp25.onreadystatechange=function(){if((xmlHttp25.readyState==4||xmlHttp25.readyState=="complete")&&xmlHttp25.responseText!="error"){if(returnDiv!=null){document.getElementById(returnDiv).innerHTML=xmlHttp25.responseText;}}};xmlHttp25.open("GET",url,synchronous);xmlHttp25.send(null);if(synchronous==false){return xmlHttp25.responseText;}}
function limitText(limitField,limitCount,limitNum){if(limitField.value.length>limitNum){limitField.value=limitField.value.substring(0,limitNum);}else{limitCount.value=limitNum-limitField.value.length;}}
function ChangeColor(tableRow,highLight){if(highLight){tableRow.style.backgroundColor='#99ff99';tableRow.style.cursor="pointer";}else{tableRow.style.backgroundColor='white';}}
function DoNav(theUrl){document.location.href=theUrl;}
function js_clock(){var currentTime=new Date();var currentYear=currentTime.getFullYear();var currentMonth=currentTime.getMonth()+1;var currentDate=currentTime.getDate();var currentHours=currentTime.getHours();var currentMinutes=currentTime.getMinutes();var currentSeconds=currentTime.getSeconds();currentDate=(currentDate<10?"0":"")+currentDate;currentMonth=(currentMonth<10?"0":"")+currentMonth;currentHours=(currentHours<10?"0":"")+currentHours;currentMinutes=(currentMinutes<10?"0":"")+currentMinutes;currentSeconds=(currentSeconds<10?"0":"")+currentSeconds;var clock_div=document.getElementById('js_clock');clock_div.innerHTML=currentYear+"/"+currentMonth+"/"+currentDate+"  "+currentHours+":"+currentMinutes+":"+currentSeconds;setTimeout("js_clock()",990);}
$(document).ready(function(){js_clock();});$(document).ready(function(){var timeout=100;var closetimer=0;var ddmenuitem=0;function jsddm_open(){jsddm_canceltimer();jsddm_close();ddmenuitem=$(this).find('ul').css('visibility','visible');}
function jsddm_close()
{if(ddmenuitem)ddmenuitem.css('visibility','hidden');}
function jsddm_timer()
{closetimer=window.setTimeout(jsddm_close,timeout);}
function jsddm_canceltimer()
{if(closetimer)
{window.clearTimeout(closetimer);closetimer=null;}}
$(document).ready(function()
{var config={over:jsddm_open,timeout:40,interval:75,sensitivity:9,out:jsddm_timer};$("#jsddm > li").hoverIntent(config);});document.onclick=jsddm_close;});$(document).ready(function(){var config={over:function(){var overlay=$(this).find('.zmanager-top-tab-overlay');if(overlay[0]){overlay.show();}},timeout:40,interval:50,sensitivity:1,out:function(){$(this).find('.zmanager-top-tab-overlay').hide();}};$("div[id*='zmanagertab']").hoverIntent(config);});(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev])}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev])};var handleHover=function(e){var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t)}if(e.type=="mouseenter"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob)},cfg.timeout)}}};return this.bind('mouseenter',handleHover).bind('mouseleave',handleHover)}})(jQuery);function initSearchOnClick(){document.getElementById("zSearchSuggest").style.color="#000000";document.getElementById("zSearchSuggest").value="";}
function searchOnBlur(){document.getElementById("zSearchSuggest").style.color="#999999";document.getElementById("zSearchSuggest").value="Search zManager...";}
function searchReturn(e){var contents=document.getElementById("zSearchSuggest").value;if(contents.length==0){}else{var code=(e.keyCode?e.keyCode:e.which);if(code==13){window.location="/modules/searchResults.php?query="+escape(contents);}}}
