/*!
 * jQuery JavaScript Library v1.4.2
 * http://jquery.com/
 *
 * Copyright 2010, John Resig
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 * Copyright 2010, The Dojo Foundation
 * Released under the MIT, BSD, and GPL Licenses.
 *
 * Date: Sat Feb 13 22:33:48 2010 -0500
 */
/*
 * jQuery Form Plugin
 * version: 2.03 (01/20/2008)
 * @requires jQuery v1.1 or later
 *
 * Examples at: http://malsup.com/jquery/form/
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 *
 * Revision: $Id$
 */
/* Copyright (c) 2007 Paul Bakaus (paul.bakaus@googlemail.com) and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * $LastChangedDate: 2007-12-20 08:46:55 -0600 (Thu, 20 Dec 2007) $
 * $Rev: 4259 $
 *
 * Version: 1.2
 *
 * Requires: jQuery 1.2+
 */
/*
 * positionBy 1.0.7 (2008-01-29)
 *
 * Copyright (c) 2006,2007 Jonathan Sharp (http://jdsharp.us)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://jdsharp.us/
 *
 * Built upon jQuery 1.2.2 (http://jquery.com)
 * This also requires the jQuery dimensions plugin
 */
/* Copyright (c) 2006 Brandon Aaron (http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * $LastChangedDate: 2007-07-11 23:14:51 -0500 (Wed, 11 Jul 2007) $
 * $Rev: 2323 $
 *
 * Version 2.1
 */
/*
 * jdMenu 1.4.1 (2008-03-31)
 *
 * Copyright (c) 2006,2007 Jonathan Sharp (http://jdsharp.us)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://jdsharp.us/
 *
 * Built upon jQuery 1.2.1 (http://jquery.com)
 * This also requires the jQuery dimensions >= 1.2 plugin
 */
/*
 *
 * Copyright (c) 2006-2009 Sam Collett (http://www.texotela.co.uk)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * Version 2.2.4
 * Demo: http://www.texotela.co.uk/code/jquery/select/
 *
 * $LastChangedDate: 2009-02-08 00:28:12 +0000 (Sun, 08 Feb 2009) $
 * $Rev: 6185 $
 *
 */
/*
 * The purpose of this plugin is to override the default .ajax call and
 * check for an X-QuakeLive-Redirect header in order to push the user
 * to the login page.
 *
 */
/**
 * Ajax Queue Plugin
 * 
 * Homepage: http://jquery.com/plugins/project/ajaxqueue
 * Documentation: http://docs.jquery.com/AjaxQueue
 */
/**!
 * jQuery Ajax Retry
 *
 * project-site: http://plugins.jquery.com/project/jquery-ajax-retry
 * repository: http://github.com/execjosh/jquery-ajax-retry
 *
 * @author execjosh
 *
 * Copyright (c) 2010 execjosh, http://execjosh.blogspot.com
 * Licenced under the terms of the MIT License
 * (http://github.com/execjosh/jquery-ajax-retry/blob/master/LICENSE)
 */
/*
 * jQuery.ScrollTo
 * Copyright (c) 2007-2008 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under MIT and GPL.
 * Date: 2/19/2008
 */
/*
 * jqModal - Minimalist Modaling with jQuery
 *
 * Copyright (c) 2007 Brice Burgess <bhb@iceburg.net>, http://www.iceburg.net
 * Licensed under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 * 
 * $Version: 2007.??.?? +r12 beta
 * Requires: jQuery 1.1.3+
 */
/**
 * jQuery Lightbox
 * Version 0.5 - 11/29/2007
 * @author Warren Krewenki
 *
 * This package is distributed under the BSD license.
 * For full license information, see LICENSE.TXT
 *
 * Based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/)
 * Originally written to make use of the Prototype framework, and Script.acalo.us, now altered to use jQuery.
 *
 *
 **/
/*
 * Superfish v1.4.8 - jQuery menu widget
 * Copyright (c) 2008 Joel Birch
 *
 * Dual licensed under the MIT and GPL licenses:
 * 	http://www.opensource.org/licenses/mit-license.php
 * 	http://www.gnu.org/licenses/gpl.html
 *
 * CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt
 */
/*
 * 
 * TableSorter 2.0 - Client-side table sorting with ease!
 * Version 2.0.3
 * @requires jQuery v1.2.3
 * 
 * Copyright (c) 2007 Christian Bach
 * Examples and docs at: http://tablesorter.com
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 * 
 */
/*
 * hoverIntent is similar to jQuery's built-in "hover" function except that
 * instead of firing the onMouseOver event immediately, hoverIntent checks
 * to see if the user's mouse has slowed down (beneath the sensitivity
 * threshold) before firing the onMouseOver event.
 * 
 * hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+
 * <http://cherne.net/brian/resources/jquery.hoverIntent.html>
 *
 * hoverIntent is currently available for use in all personal or commercial 
 * projects under both MIT and GPL licenses. This means that you can choose 
 * the license that best suits your project, and use it accordingly.
 */
/**
 * jCarouselLite - jQuery plugin to navigate images/any content in a carousel style widget.
 * @requires jQuery v1.2 or above
 *
 * http://gmarwaha.com/jquery/jcarousellite/
 *
 * Copyright (c) 2007 Ganeshji Marwaha (gmarwaha.com)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 * Version: 1.0.1
 * Note: Requires jquery 1.2 or above from version 1.0.1
 */
/*
 * jQuery Context Menu Plugin
 *
 * Version 1.01
 *
 * Cory S.N. LaViska
 * A Beautiful Site (http://abeautifulsite.net/)
 *
 * More info: http://abeautifulsite.net/2008/09/jquery-context-menu-plugin/
 *
 * Terms of Use
 *
 * This plugin is dual-licensed under the GNU General Public License
 *   and the MIT License and is copyright A Beautiful Site, LLC.
 */
/**
 * writeCapture.js v1.0.5
 * http://github.com/iamnoah/writeCapture
 * @author noah <noah.sloan@gmail.com>
 * 
 */
/**
 * jquery.writeCapture.js 
 * 
 * Note that this file only provides the jQuery plugin functionality, you still
 * need writeCapture.js. The compressed version will contain both as as single
 * file.
 *
 * @author noah <noah.sloan@gmail.com>
 * 
 */
/**
 * Flash (http://jquery.lukelutman.com/plugins/flash)
 * A jQuery plugin for embedding Flash movies.
 * 
 * Version 1.0
 * November 9th, 2006
 *
 * Copyright (c) 2006 Luke Lutman (http://www.lukelutman.com)
 * Dual licensed under the MIT and GPL licenses.
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.opensource.org/licenses/gpl-license.php
 */
/*
 * jQuery UI Effects 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/Effects/
 */
/**
*
*  Base64 encode / decode
*  http://www.webtoolkit.info/
*
**/
/*
 * OpenX 2.6.4 "Single Page Call" Flash Library - http://www.openx.org
 */
/*
 * Copyright (c) 2007-2009 Id Software LLC.  All rights reserved.
 */
(function(a,d){function b(){if(!g.isReady){try{v.documentElement.doScroll("left")}catch(n){setTimeout(b,1);return}g.ready()}}function k(n,A){A.src?g.ajax({url:A.src,async:false,dataType:"script"}):g.globalEval(A.text||A.textContent||A.innerHTML||"");A.parentNode&&A.parentNode.removeChild(A)}function c(n,A,B,D,E,K){var L=n.length;if(typeof A==="object"){for(var Y in A)c(n,Y,A[Y],D,E,B);return n}if(B!==d){D=!K&&D&&g.isFunction(B);for(Y=0;Y<L;Y++)E(n[Y],A,D?B.call(n[Y],Y,E(n[Y],A)):B,K);return n}return L?
E(n[0],A):d}function e(){return(new Date).getTime()}function p(){return false}function x(){return true}function t(n,A,B){B[0].type=n;return g.event.handle.apply(A,B)}function z(n){var A,B=[],D=[],E=arguments,K,L,Y,T,Z,ia;L=g.data(this,"events");if(!(n.liveFired===this||!L||!L.live||n.button&&n.type==="click")){n.liveFired=this;var wa=L.live.slice(0);for(T=0;T<wa.length;T++){L=wa[T];L.origType.replace(pa,"")===n.type?D.push(L.selector):wa.splice(T--,1)}K=g(n.target).closest(D,n.currentTarget);Z=0;
for(ia=K.length;Z<ia;Z++)for(T=0;T<wa.length;T++){L=wa[T];if(K[Z].selector===L.selector){Y=K[Z].elem;D=null;if(L.preType==="mouseenter"||L.preType==="mouseleave")D=g(n.relatedTarget).closest(L.selector)[0];if(!D||D!==Y)B.push({elem:Y,handleObj:L})}}Z=0;for(ia=B.length;Z<ia;Z++){K=B[Z];n.currentTarget=K.elem;n.data=K.handleObj.data;n.handleObj=K.handleObj;if(K.handleObj.origHandler.apply(K.elem,E)===false){A=false;break}}return A}}function r(n,A){return"live."+(n&&n!=="*"?n+".":"")+A.replace(/\./g,
"`").replace(/ /g,"&")}function m(n,A){var B=0;A.each(function(){if(this.nodeName===(n[B]&&n[B].nodeName)){var D=g.data(n[B++]),E=g.data(this,D);if(D=D&&D.events){delete E.handle;E.events={};for(var K in D)for(var L in D[K])g.event.add(this,K,D[K][L],D[K][L].data)}}})}function l(n,A,B){var D,E,K;A=A&&A[0]?A[0].ownerDocument||A[0]:v;if(n.length===1&&typeof n[0]==="string"&&n[0].length<512&&A===v&&!ib.test(n[0])&&(g.support.checkClone||!jb.test(n[0]))){E=true;if(K=g.fragments[n[0]])if(K!==1)D=K}if(!D){D=
A.createDocumentFragment();g.clean(n,A,D,B)}if(E)g.fragments[n[0]]=K?D:1;return{fragment:D,cacheable:E}}function q(n,A){var B={};g.each(kb.concat.apply([],kb.slice(0,A)),function(){B[this]=n});return B}function u(n){return"scrollTo"in n&&n.document?n:n.nodeType===9?n.defaultView||n.parentWindow:false}var g=function(n,A){return new g.fn.init(n,A)},o=a.jQuery,y=a.$,v=a.document,C,G=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,H=/^.[^:#\[\.,]*$/,F=/\S/,J=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Q=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,
aa=navigator.userAgent,ca=false,qa=[],ja,ga=Object.prototype.toString,ma=Object.prototype.hasOwnProperty,ka=Array.prototype.push,S=Array.prototype.slice,fa=Array.prototype.indexOf;g.fn=g.prototype={init:function(n,A){var B,D,E;if(!n)return this;if(n.nodeType){this.context=this[0]=n;this.length=1;return this}if(n==="body"&&!A){this.context=v;this[0]=v.body;this.selector="body";this.length=1;return this}if(typeof n==="string")if((B=G.exec(n))&&(B[1]||!A))if(B[1]){E=A?A.ownerDocument||A:v;if(D=Q.exec(n))if(g.isPlainObject(A)){n=
[v.createElement(D[1])];g.fn.attr.call(n,A,true)}else n=[E.createElement(D[1])];else{D=l([B[1]],[E]);n=(D.cacheable?D.fragment.cloneNode(true):D.fragment).childNodes}return g.merge(this,n)}else{if(D=v.getElementById(B[2])){if(D.id!==B[2])return C.find(n);this.length=1;this[0]=D}this.context=v;this.selector=n;return this}else if(!A&&/^\w+$/.test(n)){this.selector=n;this.context=v;n=v.getElementsByTagName(n);return g.merge(this,n)}else return!A||A.jquery?(A||C).find(n):g(A).find(n);else if(g.isFunction(n))return C.ready(n);
if(n.selector!==d){this.selector=n.selector;this.context=n.context}return g.makeArray(n,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return S.call(this,0)},get:function(n){return n==null?this.toArray():n<0?this.slice(n)[0]:this[n]},pushStack:function(n,A,B){var D=g();g.isArray(n)?ka.apply(D,n):g.merge(D,n);D.prevObject=this;D.context=this.context;if(A==="find")D.selector=this.selector+(this.selector?" ":"")+B;else if(A)D.selector=this.selector+
"."+A+"("+B+")";return D},each:function(n,A){return g.each(this,n,A)},ready:function(n){g.bindReady();if(g.isReady)n.call(v,g);else qa&&qa.push(n);return this},eq:function(n){return n===-1?this.slice(n):this.slice(n,+n+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(S.apply(this,arguments),"slice",S.call(arguments).join(","))},map:function(n){return this.pushStack(g.map(this,function(A,B){return n.call(A,B,A)}))},end:function(){return this.prevObject||
g(null)},push:ka,sort:[].sort,splice:[].splice};g.fn.init.prototype=g.fn;g.extend=g.fn.extend=function(){var n=arguments[0]||{},A=1,B=arguments.length,D=false,E,K,L,Y;if(typeof n==="boolean"){D=n;n=arguments[1]||{};A=2}if(typeof n!=="object"&&!g.isFunction(n))n={};if(B===A){n=this;--A}for(;A<B;A++)if((E=arguments[A])!=null)for(K in E){L=n[K];Y=E[K];if(n!==Y)if(D&&Y&&(g.isPlainObject(Y)||g.isArray(Y))){L=L&&(g.isPlainObject(L)||g.isArray(L))?L:g.isArray(Y)?[]:{};n[K]=g.extend(D,L,Y)}else if(Y!==d)n[K]=
Y}return n};g.extend({noConflict:function(n){a.$=y;if(n)a.jQuery=o;return g},isReady:false,ready:function(){if(!g.isReady){if(!v.body)return setTimeout(g.ready,13);g.isReady=true;if(qa){for(var n,A=0;n=qa[A++];)n.call(v,g);qa=null}g.fn.triggerHandler&&g(v).triggerHandler("ready")}},bindReady:function(){if(!ca){ca=true;if(v.readyState==="complete")return g.ready();if(v.addEventListener){v.addEventListener("DOMContentLoaded",ja,false);a.addEventListener("load",g.ready,false)}else if(v.attachEvent){v.attachEvent("onreadystatechange",
ja);a.attachEvent("onload",g.ready);var n=false;try{n=a.frameElement==null}catch(A){}v.documentElement.doScroll&&n&&b()}}},isFunction:function(n){return ga.call(n)==="[object Function]"},isArray:function(n){return ga.call(n)==="[object Array]"},isPlainObject:function(n){if(!n||ga.call(n)!=="[object Object]"||n.nodeType||n.setInterval)return false;if(n.constructor&&!ma.call(n,"constructor")&&!ma.call(n.constructor.prototype,"isPrototypeOf"))return false;var A;for(A in n);return A===d||ma.call(n,A)},
isEmptyObject:function(n){for(var A in n)return false;return true},error:function(n){throw n;},parseJSON:function(n){if(typeof n!=="string"||!n)return null;n=g.trim(n);if(/^[\],:{}\s]*$/.test(n.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return a.JSON&&a.JSON.parse?a.JSON.parse(n):(new Function("return "+n))();else g.error("Invalid JSON: "+n)},noop:function(){},globalEval:function(n){if(n&&
F.test(n)){var A=v.getElementsByTagName("head")[0]||v.documentElement,B=v.createElement("script");B.type="text/javascript";if(g.support.scriptEval)B.appendChild(v.createTextNode(n));else B.text=n;A.insertBefore(B,A.firstChild);A.removeChild(B)}},nodeName:function(n,A){return n.nodeName&&n.nodeName.toUpperCase()===A.toUpperCase()},each:function(n,A,B){var D,E=0,K=n.length,L=K===d||g.isFunction(n);if(B)if(L)for(D in n){if(A.apply(n[D],B)===false)break}else for(;E<K;){if(A.apply(n[E++],B)===false)break}else if(L)for(D in n){if(A.call(n[D],
D,n[D])===false)break}else for(B=n[0];E<K&&A.call(B,E,B)!==false;B=n[++E]);return n},trim:function(n){return(n||"").replace(J,"")},makeArray:function(n,A){var B=A||[];if(n!=null)n.length==null||typeof n==="string"||g.isFunction(n)||typeof n!=="function"&&n.setInterval?ka.call(B,n):g.merge(B,n);return B},inArray:function(n,A){if(A.indexOf)return A.indexOf(n);for(var B=0,D=A.length;B<D;B++)if(A[B]===n)return B;return-1},merge:function(n,A){var B=n.length,D=0;if(typeof A.length==="number")for(var E=
A.length;D<E;D++)n[B++]=A[D];else for(;A[D]!==d;)n[B++]=A[D++];n.length=B;return n},grep:function(n,A,B){for(var D=[],E=0,K=n.length;E<K;E++)!B!==!A(n[E],E)&&D.push(n[E]);return D},map:function(n,A,B){for(var D=[],E,K=0,L=n.length;K<L;K++){E=A(n[K],K,B);if(E!=null)D[D.length]=E}return D.concat.apply([],D)},guid:1,proxy:function(n,A,B){if(arguments.length===2)if(typeof A==="string"){B=n;n=B[A];A=d}else if(A&&!g.isFunction(A)){B=A;A=d}if(!A&&n)A=function(){return n.apply(B||this,arguments)};if(n)A.guid=
n.guid=n.guid||A.guid||g.guid++;return A},uaMatch:function(n){n=n.toLowerCase();n=/(webkit)[ \/]([\w.]+)/.exec(n)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(n)||/(msie) ([\w.]+)/.exec(n)||!/compatible/.test(n)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(n)||[];return{browser:n[1]||"",version:n[2]||"0"}},browser:{}});aa=g.uaMatch(aa);if(aa.browser){g.browser[aa.browser]=true;g.browser.version=aa.version}if(g.browser.webkit)g.browser.safari=true;if(fa)g.inArray=function(n,A){return fa.call(A,n)};C=g(v);if(v.addEventListener)ja=
function(){v.removeEventListener("DOMContentLoaded",ja,false);g.ready()};else if(v.attachEvent)ja=function(){if(v.readyState==="complete"){v.detachEvent("onreadystatechange",ja);g.ready()}};(function(){g.support={};var n=v.documentElement,A=v.createElement("script"),B=v.createElement("div"),D="script"+e();B.style.display="none";B.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var E=B.getElementsByTagName("*"),K=B.getElementsByTagName("a")[0];
if(!(!E||!E.length||!K)){g.support={leadingWhitespace:B.firstChild.nodeType===3,tbody:!B.getElementsByTagName("tbody").length,htmlSerialize:!!B.getElementsByTagName("link").length,style:/red/.test(K.getAttribute("style")),hrefNormalized:K.getAttribute("href")==="/a",opacity:/^0.55$/.test(K.style.opacity),cssFloat:!!K.style.cssFloat,checkOn:B.getElementsByTagName("input")[0].value==="on",optSelected:v.createElement("select").appendChild(v.createElement("option")).selected,parentNode:B.removeChild(B.appendChild(v.createElement("div"))).parentNode===
null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};A.type="text/javascript";try{A.appendChild(v.createTextNode("window."+D+"=1;"))}catch(L){}n.insertBefore(A,n.firstChild);if(a[D]){g.support.scriptEval=true;delete a[D]}try{delete A.test}catch(Y){g.support.deleteExpando=false}n.removeChild(A);if(B.attachEvent&&B.fireEvent){B.attachEvent("onclick",function T(){g.support.noCloneEvent=false;B.detachEvent("onclick",T)});B.cloneNode(true).fireEvent("onclick")}B=v.createElement("div");
B.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";n=v.createDocumentFragment();n.appendChild(B.firstChild);g.support.checkClone=n.cloneNode(true).cloneNode(true).lastChild.checked;g(function(){var T=v.createElement("div");T.style.width=T.style.paddingLeft="1px";v.body.appendChild(T);g.boxModel=g.support.boxModel=T.offsetWidth===2;v.body.removeChild(T).style.display="none"});n=function(T){var Z=v.createElement("div");T="on"+T;var ia=T in Z;if(!ia){Z.setAttribute(T,"return;");ia=
typeof Z[T]==="function"}return ia};g.support.submitBubbles=n("submit");g.support.changeBubbles=n("change");n=A=B=E=K=null}})();g.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var ha="jQuery"+e(),O=0,P={};g.extend({cache:{},expando:ha,noData:{embed:true,object:true,applet:true},data:function(n,A,B){if(!(n.nodeName&&g.noData[n.nodeName.toLowerCase()])){n=
n==a?P:n;var D=n[ha],E=g.cache;if(!D&&typeof A==="string"&&B===d)return null;D||(D=++O);if(typeof A==="object"){n[ha]=D;E[D]=g.extend(true,{},A)}else if(!E[D]){n[ha]=D;E[D]={}}n=E[D];if(B!==d)n[A]=B;return typeof A==="string"?n[A]:n}},removeData:function(n,A){if(!(n.nodeName&&g.noData[n.nodeName.toLowerCase()])){n=n==a?P:n;var B=n[ha],D=g.cache,E=D[B];if(A){if(E){delete E[A];g.isEmptyObject(E)&&g.removeData(n)}}else{if(g.support.deleteExpando)delete n[g.expando];else n.removeAttribute&&n.removeAttribute(g.expando);
delete D[B]}}}});g.fn.extend({data:function(n,A){if(typeof n==="undefined"&&this.length)return g.data(this[0]);else if(typeof n==="object")return this.each(function(){g.data(this,n)});var B=n.split(".");B[1]=B[1]?"."+B[1]:"";if(A===d){var D=this.triggerHandler("getData"+B[1]+"!",[B[0]]);if(D===d&&this.length)D=g.data(this[0],n);return D===d&&B[1]?this.data(B[0]):D}else return this.trigger("setData"+B[1]+"!",[B[0],A]).each(function(){g.data(this,n,A)})},removeData:function(n){return this.each(function(){g.removeData(this,
n)})}});g.extend({queue:function(n,A,B){if(n){A=(A||"fx")+"queue";var D=g.data(n,A);if(!B)return D||[];if(!D||g.isArray(B))D=g.data(n,A,g.makeArray(B));else D.push(B);return D}},dequeue:function(n,A){A=A||"fx";var B=g.queue(n,A),D=B.shift();if(D==="inprogress")D=B.shift();if(D){A==="fx"&&B.unshift("inprogress");D.call(n,function(){g.dequeue(n,A)})}}});g.fn.extend({queue:function(n,A){if(typeof n!=="string"){A=n;n="fx"}if(A===d)return g.queue(this[0],n);return this.each(function(){var B=g.queue(this,
n,A);n==="fx"&&B[0]!=="inprogress"&&g.dequeue(this,n)})},dequeue:function(n){return this.each(function(){g.dequeue(this,n)})},delay:function(n,A){n=g.fx?g.fx.speeds[n]||n:n;A=A||"fx";return this.queue(A,function(){var B=this;setTimeout(function(){g.dequeue(B,A)},n)})},clearQueue:function(n){return this.queue(n||"fx",[])}});var R=/[\n\t]/g,X=/\s+/,M=/\r/g,W=/href|src|style/,ea=/(button|input)/i,na=/(button|input|object|select|textarea)/i,sa=/^(a|area)$/i,la=/radio|checkbox/;g.fn.extend({attr:function(n,
A){return c(this,n,A,true,g.attr)},removeAttr:function(n){return this.each(function(){g.attr(this,n,"");this.nodeType===1&&this.removeAttribute(n)})},addClass:function(n){if(g.isFunction(n))return this.each(function(Z){var ia=g(this);ia.addClass(n.call(this,Z,ia.attr("class")))});if(n&&typeof n==="string")for(var A=(n||"").split(X),B=0,D=this.length;B<D;B++){var E=this[B];if(E.nodeType===1)if(E.className){for(var K=" "+E.className+" ",L=E.className,Y=0,T=A.length;Y<T;Y++)if(K.indexOf(" "+A[Y]+" ")<
0)L+=" "+A[Y];E.className=g.trim(L)}else E.className=n}return this},removeClass:function(n){if(g.isFunction(n))return this.each(function(T){var Z=g(this);Z.removeClass(n.call(this,T,Z.attr("class")))});if(n&&typeof n==="string"||n===d)for(var A=(n||"").split(X),B=0,D=this.length;B<D;B++){var E=this[B];if(E.nodeType===1&&E.className)if(n){for(var K=(" "+E.className+" ").replace(R," "),L=0,Y=A.length;L<Y;L++)K=K.replace(" "+A[L]+" "," ");E.className=g.trim(K)}else E.className=""}return this},toggleClass:function(n,
A){var B=typeof n,D=typeof A==="boolean";if(g.isFunction(n))return this.each(function(E){var K=g(this);K.toggleClass(n.call(this,E,K.attr("class"),A),A)});return this.each(function(){if(B==="string")for(var E,K=0,L=g(this),Y=A,T=n.split(X);E=T[K++];){Y=D?Y:!L.hasClass(E);L[Y?"addClass":"removeClass"](E)}else if(B==="undefined"||B==="boolean"){this.className&&g.data(this,"__className__",this.className);this.className=this.className||n===false?"":g.data(this,"__className__")||""}})},hasClass:function(n){n=
" "+n+" ";for(var A=0,B=this.length;A<B;A++)if((" "+this[A].className+" ").replace(R," ").indexOf(n)>-1)return true;return false},val:function(n){if(n===d){var A=this[0];if(A){if(g.nodeName(A,"option"))return(A.attributes.value||{}).specified?A.value:A.text;if(g.nodeName(A,"select")){var B=A.selectedIndex,D=[],E=A.options;A=A.type==="select-one";if(B<0)return null;var K=A?B:0;for(B=A?B+1:E.length;K<B;K++){var L=E[K];if(L.selected){n=g(L).val();if(A)return n;D.push(n)}}return D}if(la.test(A.type)&&
!g.support.checkOn)return A.getAttribute("value")===null?"on":A.value;return(A.value||"").replace(M,"")}return d}var Y=g.isFunction(n);return this.each(function(T){var Z=g(this),ia=n;if(this.nodeType===1){if(Y)ia=n.call(this,T,Z.val());if(typeof ia==="number")ia+="";if(g.isArray(ia)&&la.test(this.type))this.checked=g.inArray(Z.val(),ia)>=0;else if(g.nodeName(this,"select")){var wa=g.makeArray(ia);g("option",this).each(function(){this.selected=g.inArray(g(this).val(),wa)>=0});if(!wa.length)this.selectedIndex=
-1}else this.value=ia}})}});g.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(n,A,B,D){if(!n||n.nodeType===3||n.nodeType===8)return d;if(D&&A in g.attrFn)return g(n)[A](B);D=n.nodeType!==1||!g.isXMLDoc(n);var E=B!==d;A=D&&g.props[A]||A;if(n.nodeType===1){var K=W.test(A);if(A in n&&D&&!K){if(E){A==="type"&&ea.test(n.nodeName)&&n.parentNode&&g.error("type property can't be changed");n[A]=B}if(g.nodeName(n,"form")&&n.getAttributeNode(A))return n.getAttributeNode(A).nodeValue;
if(A==="tabIndex")return(A=n.getAttributeNode("tabIndex"))&&A.specified?A.value:na.test(n.nodeName)||sa.test(n.nodeName)&&n.href?0:d;return n[A]}if(!g.support.style&&D&&A==="style"){if(E)n.style.cssText=""+B;return n.style.cssText}E&&n.setAttribute(A,""+B);n=!g.support.hrefNormalized&&D&&K?n.getAttribute(A,2):n.getAttribute(A);return n===null?d:n}return g.style(n,A,B)}});var pa=/\.(.*)$/,ua=function(n){return n.replace(/[^\w\s\.\|`]/g,function(A){return"\\"+A})};g.event={add:function(n,A,B,D){if(!(n.nodeType===
3||n.nodeType===8)){if(n.setInterval&&n!==a&&!n.frameElement)n=a;var E,K;if(B.handler){E=B;B=E.handler}if(!B.guid)B.guid=g.guid++;if(K=g.data(n)){var L=K.events=K.events||{},Y=K.handle;if(!Y)K.handle=Y=function(){return typeof g!=="undefined"&&!g.event.triggered?g.event.handle.apply(Y.elem,arguments):d};Y.elem=n;A=A.split(" ");for(var T,Z=0,ia;T=A[Z++];){K=E?g.extend({},E):{handler:B,data:D};if(T.indexOf(".")>-1){ia=T.split(".");T=ia.shift();K.namespace=ia.slice(0).sort().join(".")}else{ia=[];K.namespace=
""}K.type=T;K.guid=B.guid;var wa=L[T],ya=g.event.special[T]||{};if(!wa){wa=L[T]=[];if(!ya.setup||ya.setup.call(n,D,ia,Y)===false)if(n.addEventListener)n.addEventListener(T,Y,false);else n.attachEvent&&n.attachEvent("on"+T,Y)}if(ya.add){ya.add.call(n,K);if(!K.handler.guid)K.handler.guid=B.guid}wa.push(K);g.event.global[T]=true}n=null}}},global:{},remove:function(n,A,B,D){if(!(n.nodeType===3||n.nodeType===8)){var E,K=0,L,Y,T,Z,ia,wa,ya=g.data(n),Ba=ya&&ya.events;if(ya&&Ba){if(A&&A.type){B=A.handler;
A=A.type}if(!A||typeof A==="string"&&A.charAt(0)==="."){A=A||"";for(E in Ba)g.event.remove(n,E+A)}else{for(A=A.split(" ");E=A[K++];){Z=E;L=E.indexOf(".")<0;Y=[];if(!L){Y=E.split(".");E=Y.shift();T=RegExp("(^|\\.)"+g.map(Y.slice(0).sort(),ua).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(ia=Ba[E])if(B){Z=g.event.special[E]||{};for(Aa=D||0;Aa<ia.length;Aa++){wa=ia[Aa];if(B.guid===wa.guid){if(L||T.test(wa.namespace)){D==null&&ia.splice(Aa--,1);Z.remove&&Z.remove.call(n,wa)}if(D!=null)break}}if(ia.length===0||
D!=null&&ia.length===1){if(!Z.teardown||Z.teardown.call(n,Y)===false)ta(n,E,ya.handle);delete Ba[E]}}else for(var Aa=0;Aa<ia.length;Aa++){wa=ia[Aa];if(L||T.test(wa.namespace)){g.event.remove(n,Z,wa.handler,Aa);ia.splice(Aa--,1)}}}if(g.isEmptyObject(Ba)){if(A=ya.handle)A.elem=null;delete ya.events;delete ya.handle;g.isEmptyObject(ya)&&g.removeData(n)}}}}},trigger:function(n,A,B,D){var E=n.type||n;if(!D){n=typeof n==="object"?n[ha]?n:g.extend(g.Event(E),n):g.Event(E);if(E.indexOf("!")>=0){n.type=E=
E.slice(0,-1);n.exclusive=true}if(!B){n.stopPropagation();g.event.global[E]&&g.each(g.cache,function(){this.events&&this.events[E]&&g.event.trigger(n,A,this.handle.elem)})}if(!B||B.nodeType===3||B.nodeType===8)return d;n.result=d;n.target=B;A=g.makeArray(A);A.unshift(n)}n.currentTarget=B;(D=g.data(B,"handle"))&&D.apply(B,A);D=B.parentNode||B.ownerDocument;try{if(!(B&&B.nodeName&&g.noData[B.nodeName.toLowerCase()]))if(B["on"+E]&&B["on"+E].apply(B,A)===false)n.result=false}catch(K){}if(!n.isPropagationStopped()&&
D)g.event.trigger(n,A,D,true);else if(!n.isDefaultPrevented()){D=n.target;var L,Y=g.nodeName(D,"a")&&E==="click",T=g.event.special[E]||{};if((!T._default||T._default.call(B,n)===false)&&!Y&&!(D&&D.nodeName&&g.noData[D.nodeName.toLowerCase()])){try{if(D[E]){if(L=D["on"+E])D["on"+E]=null;g.event.triggered=true;D[E]()}}catch(Z){}if(L)D["on"+E]=L;g.event.triggered=false}}},handle:function(n){var A,B,D,E;n=arguments[0]=g.event.fix(n||a.event);n.currentTarget=this;A=n.type.indexOf(".")<0&&!n.exclusive;
if(!A){B=n.type.split(".");n.type=B.shift();D=RegExp("(^|\\.)"+B.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}E=g.data(this,"events");B=E[n.type];if(E&&B){B=B.slice(0);E=0;for(var K=B.length;E<K;E++){var L=B[E];if(A||D.test(L.namespace)){n.handler=L.handler;n.data=L.data;n.handleObj=L;L=L.handler.apply(this,arguments);if(L!==d){n.result=L;if(L===false){n.preventDefault();n.stopPropagation()}}if(n.isImmediatePropagationStopped())break}}}return n.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
fix:function(n){if(n[ha])return n;var A=n;n=g.Event(A);for(var B=this.props.length,D;B;){D=this.props[--B];n[D]=A[D]}if(!n.target)n.target=n.srcElement||v;if(n.target.nodeType===3)n.target=n.target.parentNode;if(!n.relatedTarget&&n.fromElement)n.relatedTarget=n.fromElement===n.target?n.toElement:n.fromElement;if(n.pageX==null&&n.clientX!=null){A=v.documentElement;B=v.body;n.pageX=n.clientX+(A&&A.scrollLeft||B&&B.scrollLeft||0)-(A&&A.clientLeft||B&&B.clientLeft||0);n.pageY=n.clientY+(A&&A.scrollTop||
B&&B.scrollTop||0)-(A&&A.clientTop||B&&B.clientTop||0)}if(!n.which&&(n.charCode||n.charCode===0?n.charCode:n.keyCode))n.which=n.charCode||n.keyCode;if(!n.metaKey&&n.ctrlKey)n.metaKey=n.ctrlKey;if(!n.which&&n.button!==d)n.which=n.button&1?1:n.button&2?3:n.button&4?2:0;return n},guid:1E8,proxy:g.proxy,special:{ready:{setup:g.bindReady,teardown:g.noop},live:{add:function(n){g.event.add(this,n.origType,g.extend({},n,{handler:z}))},remove:function(n){var A=true,B=n.origType.replace(pa,"");g.each(g.data(this,
"events").live||[],function(){if(B===this.origType.replace(pa,""))return A=false});A&&g.event.remove(this,n.origType,z)}},beforeunload:{setup:function(n,A,B){if(this.setInterval)this.onbeforeunload=B;return false},teardown:function(n,A){if(this.onbeforeunload===A)this.onbeforeunload=null}}}};var ta=v.removeEventListener?function(n,A,B){n.removeEventListener(A,B,false)}:function(n,A,B){n.detachEvent("on"+A,B)};g.Event=function(n){if(!this.preventDefault)return new g.Event(n);if(n&&n.type){this.originalEvent=
n;this.type=n.type}else this.type=n;this.timeStamp=e();this[ha]=true};g.Event.prototype={preventDefault:function(){this.isDefaultPrevented=x;var n=this.originalEvent;if(n){n.preventDefault&&n.preventDefault();n.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=x;var n=this.originalEvent;if(n){n.stopPropagation&&n.stopPropagation();n.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=x;this.stopPropagation()},isDefaultPrevented:p,isPropagationStopped:p,
isImmediatePropagationStopped:p};var za=function(n){var A=n.relatedTarget;try{for(;A&&A!==this;)A=A.parentNode;if(A!==this){n.type=n.data;g.event.handle.apply(this,arguments)}}catch(B){}},Ca=function(n){n.type=n.data;g.event.handle.apply(this,arguments)};g.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(n,A){g.event.special[n]={setup:function(B){g.event.add(this,A,B&&B.selector?Ca:za,n)},teardown:function(B){g.event.remove(this,A,B&&B.selector?Ca:za)}}});if(!g.support.submitBubbles)g.event.special.submit=
{setup:function(){if(this.nodeName.toLowerCase()!=="form"){g.event.add(this,"click.specialSubmit",function(n){var A=n.target,B=A.type;if((B==="submit"||B==="image")&&g(A).closest("form").length)return t("submit",this,arguments)});g.event.add(this,"keypress.specialSubmit",function(n){var A=n.target,B=A.type;if((B==="text"||B==="password")&&g(A).closest("form").length&&n.keyCode===13)return t("submit",this,arguments)})}else return false},teardown:function(){g.event.remove(this,".specialSubmit")}};if(!g.support.changeBubbles){var Ja=
/textarea|input|select/i,Qa,Ua=function(n){var A=n.type,B=n.value;if(A==="radio"||A==="checkbox")B=n.checked;else if(A==="select-multiple")B=n.selectedIndex>-1?g.map(n.options,function(D){return D.selected}).join("-"):"";else if(n.nodeName.toLowerCase()==="select")B=n.selectedIndex;return B},Va=function(n,A){var B=n.target,D,E;if(!(!Ja.test(B.nodeName)||B.readOnly)){D=g.data(B,"_change_data");E=Ua(B);if(n.type!=="focusout"||B.type!=="radio")g.data(B,"_change_data",E);if(!(D===d||E===D))if(D!=null||
E){n.type="change";return g.event.trigger(n,A,B)}}};g.event.special.change={filters:{focusout:Va,click:function(n){var A=n.target,B=A.type;if(B==="radio"||B==="checkbox"||A.nodeName.toLowerCase()==="select")return Va.call(this,n)},keydown:function(n){var A=n.target,B=A.type;if(n.keyCode===13&&A.nodeName.toLowerCase()!=="textarea"||n.keyCode===32&&(B==="checkbox"||B==="radio")||B==="select-multiple")return Va.call(this,n)},beforeactivate:function(n){n=n.target;g.data(n,"_change_data",Ua(n))}},setup:function(){if(this.type===
"file")return false;for(var n in Qa)g.event.add(this,n+".specialChange",Qa[n]);return Ja.test(this.nodeName)},teardown:function(){g.event.remove(this,".specialChange");return Ja.test(this.nodeName)}};Qa=g.event.special.change.filters}v.addEventListener&&g.each({focus:"focusin",blur:"focusout"},function(n,A){function B(D){D=g.event.fix(D);D.type=A;return g.event.handle.call(this,D)}g.event.special[A]={setup:function(){this.addEventListener(n,B,true)},teardown:function(){this.removeEventListener(n,
B,true)}}});g.each(["bind","one"],function(n,A){g.fn[A]=function(B,D,E){if(typeof B==="object"){for(var K in B)this[A](K,D,B[K],E);return this}if(g.isFunction(D)){E=D;D=d}var L=A==="one"?g.proxy(E,function(T){g(this).unbind(T,L);return E.apply(this,arguments)}):E;if(B==="unload"&&A!=="one")this.one(B,D,E);else{K=0;for(var Y=this.length;K<Y;K++)g.event.add(this[K],B,L,D)}return this}});g.fn.extend({unbind:function(n,A){if(typeof n==="object"&&!n.preventDefault)for(var B in n)this.unbind(B,n[B]);else{B=
0;for(var D=this.length;B<D;B++)g.event.remove(this[B],n,A)}return this},delegate:function(n,A,B,D){return this.live(A,B,D,n)},undelegate:function(n,A,B){return arguments.length===0?this.unbind("live"):this.die(A,null,B,n)},trigger:function(n,A){return this.each(function(){g.event.trigger(n,A,this)})},triggerHandler:function(n,A){if(this[0]){var B=g.Event(n);B.preventDefault();B.stopPropagation();g.event.trigger(B,A,this[0]);return B.result}},toggle:function(n){for(var A=arguments,B=1;B<A.length;)g.proxy(n,
A[B++]);return this.click(g.proxy(n,function(D){var E=(g.data(this,"lastToggle"+n.guid)||0)%B;g.data(this,"lastToggle"+n.guid,E+1);D.preventDefault();return A[E].apply(this,arguments)||false}))},hover:function(n,A){return this.mouseenter(n).mouseleave(A||n)}});var Ya={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};g.each(["live","die"],function(n,A){g.fn[A]=function(B,D,E,K){var L,Y=0,T,Z,ia=K||this.selector,wa=K?this:g(this.context);if(g.isFunction(D)){E=D;D=d}for(B=
(B||"").split(" ");(L=B[Y++])!=null;){K=pa.exec(L);T="";if(K){T=K[0];L=L.replace(pa,"")}if(L==="hover")B.push("mouseenter"+T,"mouseleave"+T);else{Z=L;if(L==="focus"||L==="blur"){B.push(Ya[L]+T);L+=T}else L=(Ya[L]||L)+T;A==="live"?wa.each(function(){g.event.add(this,r(L,ia),{data:D,selector:ia,handler:E,origType:L,origHandler:E,preType:Z})}):wa.unbind(r(L,ia),E)}}return this}});g.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),
function(n,A){g.fn[A]=function(B){return B?this.bind(A,B):this.trigger(A)};if(g.attrFn)g.attrFn[A]=true});a.attachEvent&&!a.addEventListener&&a.attachEvent("onunload",function(){for(var n in g.cache)if(g.cache[n].handle)try{g.event.remove(g.cache[n].handle.elem)}catch(A){}});(function(){function n(I){for(var N="",U,V=0;I[V];V++){U=I[V];if(U.nodeType===3||U.nodeType===4)N+=U.nodeValue;else if(U.nodeType!==8)N+=n(U.childNodes)}return N}function A(I,N,U,V,da,ba){da=0;for(var ra=V.length;da<ra;da++){var oa=
V[da];if(oa){oa=oa[I];for(var xa=false;oa;){if(oa.sizcache===U){xa=V[oa.sizset];break}if(oa.nodeType===1&&!ba){oa.sizcache=U;oa.sizset=da}if(oa.nodeName.toLowerCase()===N){xa=oa;break}oa=oa[I]}V[da]=xa}}}function B(I,N,U,V,da,ba){da=0;for(var ra=V.length;da<ra;da++){var oa=V[da];if(oa){oa=oa[I];for(var xa=false;oa;){if(oa.sizcache===U){xa=V[oa.sizset];break}if(oa.nodeType===1){if(!ba){oa.sizcache=U;oa.sizset=da}if(typeof N!=="string"){if(oa===N){xa=true;break}}else if(T.filter(N,[oa]).length>0){xa=
oa;break}}oa=oa[I]}V[da]=xa}}}var D=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,E=0,K=Object.prototype.toString,L=false,Y=true;[0,0].sort(function(){Y=false;return 0});var T=function(I,N,U,V){U=U||[];var da=N=N||v;if(N.nodeType!==1&&N.nodeType!==9)return[];if(!I||typeof I!=="string")return U;for(var ba=[],ra,oa,xa,Wa,Ma=true,Ra=va(N),Na=I;(D.exec(""),ra=D.exec(Na))!==null;){Na=ra[3];ba.push(ra[1]);if(ra[2]){Wa=
ra[3];break}}if(ba.length>1&&ia.exec(I))if(ba.length===2&&Z.relative[ba[0]])oa=bb(ba[0]+ba[1],N);else for(oa=Z.relative[ba[0]]?[N]:T(ba.shift(),N);ba.length;){I=ba.shift();if(Z.relative[I])I+=ba.shift();oa=bb(I,oa)}else{if(!V&&ba.length>1&&N.nodeType===9&&!Ra&&Z.match.ID.test(ba[0])&&!Z.match.ID.test(ba[ba.length-1])){ra=T.find(ba.shift(),N,Ra);N=ra.expr?T.filter(ra.expr,ra.set)[0]:ra.set[0]}if(N){ra=V?{expr:ba.pop(),set:ya(V)}:T.find(ba.pop(),ba.length===1&&(ba[0]==="~"||ba[0]==="+")&&N.parentNode?
N.parentNode:N,Ra);oa=ra.expr?T.filter(ra.expr,ra.set):ra.set;if(ba.length>0)xa=ya(oa);else Ma=false;for(;ba.length;){var Ga=ba.pop();ra=Ga;if(Z.relative[Ga])ra=ba.pop();else Ga="";if(ra==null)ra=N;Z.relative[Ga](xa,ra,Ra)}}else xa=[]}xa||(xa=oa);xa||T.error(Ga||I);if(K.call(xa)==="[object Array]")if(Ma)if(N&&N.nodeType===1)for(I=0;xa[I]!=null;I++){if(xa[I]&&(xa[I]===true||xa[I].nodeType===1&&Ea(N,xa[I])))U.push(oa[I])}else for(I=0;xa[I]!=null;I++)xa[I]&&xa[I].nodeType===1&&U.push(oa[I]);else U.push.apply(U,
xa);else ya(xa,U);if(Wa){T(Wa,da,U,V);T.uniqueSort(U)}return U};T.uniqueSort=function(I){if(Aa){L=Y;I.sort(Aa);if(L)for(var N=1;N<I.length;N++)I[N]===I[N-1]&&I.splice(N--,1)}return I};T.matches=function(I,N){return T(I,null,null,N)};T.find=function(I,N,U){var V,da;if(!I)return[];for(var ba=0,ra=Z.order.length;ba<ra;ba++){var oa=Z.order[ba];if(da=Z.leftMatch[oa].exec(I)){var xa=da[1];da.splice(1,1);if(xa.substr(xa.length-1)!=="\\"){da[1]=(da[1]||"").replace(/\\/g,"");V=Z.find[oa](da,N,U);if(V!=null){I=
I.replace(Z.match[oa],"");break}}}}V||(V=N.getElementsByTagName("*"));return{set:V,expr:I}};T.filter=function(I,N,U,V){for(var da=I,ba=[],ra=N,oa,xa,Wa=N&&N[0]&&va(N[0]);I&&N.length;){for(var Ma in Z.filter)if((oa=Z.leftMatch[Ma].exec(I))!=null&&oa[2]){var Ra=Z.filter[Ma],Na,Ga;Ga=oa[1];xa=false;oa.splice(1,1);if(Ga.substr(Ga.length-1)!=="\\"){if(ra===ba)ba=[];if(Z.preFilter[Ma])if(oa=Z.preFilter[Ma](oa,ra,U,ba,V,Wa)){if(oa===true)continue}else xa=Na=true;if(oa)for(var Za=0;(Ga=ra[Za])!=null;Za++)if(Ga){Na=
Ra(Ga,oa,Za,ra);var lb=V^!!Na;if(U&&Na!=null)if(lb)xa=true;else ra[Za]=false;else if(lb){ba.push(Ga);xa=true}}if(Na!==d){U||(ra=ba);I=I.replace(Z.match[Ma],"");if(!xa)return[];break}}}if(I===da)if(xa==null)T.error(I);else break;da=I}return ra};T.error=function(I){throw"Syntax error, unrecognized expression: "+I;};var Z=T.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|)\s*\]/,
TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(I){return I.getAttribute("href")}},relative:{"+":function(I,N){var U=typeof N==="string",V=U&&!/\W/.test(N);U=U&&!V;if(V)N=N.toLowerCase();V=0;for(var da=I.length,
ba;V<da;V++)if(ba=I[V]){for(;(ba=ba.previousSibling)&&ba.nodeType!==1;);I[V]=U||ba&&ba.nodeName.toLowerCase()===N?ba||false:ba===N}U&&T.filter(N,I,true)},">":function(I,N){var U=typeof N==="string";if(U&&!/\W/.test(N)){N=N.toLowerCase();for(var V=0,da=I.length;V<da;V++){var ba=I[V];if(ba){U=ba.parentNode;I[V]=U.nodeName.toLowerCase()===N?U:false}}}else{V=0;for(da=I.length;V<da;V++)if(ba=I[V])I[V]=U?ba.parentNode:ba.parentNode===N;U&&T.filter(N,I,true)}},"":function(I,N,U){var V=E++,da=B;if(typeof N===
"string"&&!/\W/.test(N)){var ba=N=N.toLowerCase();da=A}da("parentNode",N,V,I,ba,U)},"~":function(I,N,U){var V=E++,da=B;if(typeof N==="string"&&!/\W/.test(N)){var ba=N=N.toLowerCase();da=A}da("previousSibling",N,V,I,ba,U)}},find:{ID:function(I,N,U){if(typeof N.getElementById!=="undefined"&&!U)return(I=N.getElementById(I[1]))?[I]:[]},NAME:function(I,N){if(typeof N.getElementsByName!=="undefined"){for(var U=[],V=N.getElementsByName(I[1]),da=0,ba=V.length;da<ba;da++)V[da].getAttribute("name")===I[1]&&
U.push(V[da]);return U.length===0?null:U}},TAG:function(I,N){return N.getElementsByTagName(I[1])}},preFilter:{CLASS:function(I,N,U,V,da,ba){I=" "+I[1].replace(/\\/g,"")+" ";if(ba)return I;ba=0;for(var ra;(ra=N[ba])!=null;ba++)if(ra)if(da^(ra.className&&(" "+ra.className+" ").replace(/[\t\n]/g," ").indexOf(I)>=0))U||V.push(ra);else if(U)N[ba]=false;return false},ID:function(I){return I[1].replace(/\\/g,"")},TAG:function(I){return I[1].toLowerCase()},CHILD:function(I){if(I[1]==="nth"){var N=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(I[2]===
"even"&&"2n"||I[2]==="odd"&&"2n+1"||!/\D/.test(I[2])&&"0n+"+I[2]||I[2]);I[2]=N[1]+(N[2]||1)-0;I[3]=N[3]-0}I[0]=E++;return I},ATTR:function(I,N,U,V,da,ba){N=I[1].replace(/\\/g,"");if(!ba&&Z.attrMap[N])I[1]=Z.attrMap[N];if(I[2]==="~=")I[4]=" "+I[4]+" ";return I},PSEUDO:function(I,N,U,V,da){if(I[1]==="not")if((D.exec(I[3])||"").length>1||/^\w/.test(I[3]))I[3]=T(I[3],null,null,N);else{I=T.filter(I[3],N,U,true^da);U||V.push.apply(V,I);return false}else if(Z.match.POS.test(I[0])||Z.match.CHILD.test(I[0]))return true;
return I},POS:function(I){I.unshift(true);return I}},filters:{enabled:function(I){return I.disabled===false&&I.type!=="hidden"},disabled:function(I){return I.disabled===true},checked:function(I){return I.checked===true},selected:function(I){return I.selected===true},parent:function(I){return!!I.firstChild},empty:function(I){return!I.firstChild},has:function(I,N,U){return!!T(U[3],I).length},header:function(I){return/h\d/i.test(I.nodeName)},text:function(I){return"text"===I.type},radio:function(I){return"radio"===
I.type},checkbox:function(I){return"checkbox"===I.type},file:function(I){return"file"===I.type},password:function(I){return"password"===I.type},submit:function(I){return"submit"===I.type},image:function(I){return"image"===I.type},reset:function(I){return"reset"===I.type},button:function(I){return"button"===I.type||I.nodeName.toLowerCase()==="button"},input:function(I){return/input|select|textarea|button/i.test(I.nodeName)}},setFilters:{first:function(I,N){return N===0},last:function(I,N,U,V){return N===
V.length-1},even:function(I,N){return N%2===0},odd:function(I,N){return N%2===1},lt:function(I,N,U){return N<U[3]-0},gt:function(I,N,U){return N>U[3]-0},nth:function(I,N,U){return U[3]-0===N},eq:function(I,N,U){return U[3]-0===N}},filter:{PSEUDO:function(I,N,U,V){var da=N[1],ba=Z.filters[da];if(ba)return ba(I,U,N,V);else if(da==="contains")return(I.textContent||I.innerText||n([I])||"").indexOf(N[3])>=0;else if(da==="not"){N=N[3];U=0;for(V=N.length;U<V;U++)if(N[U]===I)return false;return true}else T.error("Syntax error, unrecognized expression: "+
da)},CHILD:function(I,N){var U=N[1],V=I;switch(U){case "only":case "first":for(;V=V.previousSibling;)if(V.nodeType===1)return false;if(U==="first")return true;V=I;case "last":for(;V=V.nextSibling;)if(V.nodeType===1)return false;return true;case "nth":U=N[2];var da=N[3];if(U===1&&da===0)return true;var ba=N[0],ra=I.parentNode;if(ra&&(ra.sizcache!==ba||!I.nodeIndex)){var oa=0;for(V=ra.firstChild;V;V=V.nextSibling)if(V.nodeType===1)V.nodeIndex=++oa;ra.sizcache=ba}V=I.nodeIndex-da;return U===0?V===0:
V%U===0&&V/U>=0}},ID:function(I,N){return I.nodeType===1&&I.getAttribute("id")===N},TAG:function(I,N){return N==="*"&&I.nodeType===1||I.nodeName.toLowerCase()===N},CLASS:function(I,N){return(" "+(I.className||I.getAttribute("class"))+" ").indexOf(N)>-1},ATTR:function(I,N){var U=N[1];U=Z.attrHandle[U]?Z.attrHandle[U](I):I[U]!=null?I[U]:I.getAttribute(U);var V=U+"",da=N[2],ba=N[4];return U==null?da==="!=":da==="="?V===ba:da==="*="?V.indexOf(ba)>=0:da==="~="?(" "+V+" ").indexOf(ba)>=0:!ba?V&&U!==false:
da==="!="?V!==ba:da==="^="?V.indexOf(ba)===0:da==="$="?V.substr(V.length-ba.length)===ba:da==="|="?V===ba||V.substr(0,ba.length+1)===ba+"-":false},POS:function(I,N,U,V){var da=Z.setFilters[N[2]];if(da)return da(I,U,N,V)}}},ia=Z.match.POS;for(var wa in Z.match){Z.match[wa]=RegExp(Z.match[wa].source+/(?![^\[]*\])(?![^\(]*\))/.source);Z.leftMatch[wa]=RegExp(/(^(?:.|\r|\n)*?)/.source+Z.match[wa].source.replace(/\\(\d+)/g,function(I,N){return"\\"+(N-0+1)}))}var ya=function(I,N){I=Array.prototype.slice.call(I,
0);if(N){N.push.apply(N,I);return N}return I};try{Array.prototype.slice.call(v.documentElement.childNodes,0)}catch(Ba){ya=function(I,N){var U=N||[];if(K.call(I)==="[object Array]")Array.prototype.push.apply(U,I);else if(typeof I.length==="number")for(var V=0,da=I.length;V<da;V++)U.push(I[V]);else for(V=0;I[V];V++)U.push(I[V]);return U}}var Aa;if(v.documentElement.compareDocumentPosition)Aa=function(I,N){if(!I.compareDocumentPosition||!N.compareDocumentPosition){if(I==N)L=true;return I.compareDocumentPosition?
-1:1}var U=I.compareDocumentPosition(N)&4?-1:I===N?0:1;if(U===0)L=true;return U};else if("sourceIndex"in v.documentElement)Aa=function(I,N){if(!I.sourceIndex||!N.sourceIndex){if(I==N)L=true;return I.sourceIndex?-1:1}var U=I.sourceIndex-N.sourceIndex;if(U===0)L=true;return U};else if(v.createRange)Aa=function(I,N){if(!I.ownerDocument||!N.ownerDocument){if(I==N)L=true;return I.ownerDocument?-1:1}var U=I.ownerDocument.createRange(),V=N.ownerDocument.createRange();U.setStart(I,0);U.setEnd(I,0);V.setStart(N,
0);V.setEnd(N,0);U=U.compareBoundaryPoints(Range.START_TO_END,V);if(U===0)L=true;return U};(function(){var I=v.createElement("div"),N="script"+(new Date).getTime();I.innerHTML="<a name='"+N+"'/>";var U=v.documentElement;U.insertBefore(I,U.firstChild);if(v.getElementById(N)){Z.find.ID=function(V,da,ba){if(typeof da.getElementById!=="undefined"&&!ba)return(da=da.getElementById(V[1]))?da.id===V[1]||typeof da.getAttributeNode!=="undefined"&&da.getAttributeNode("id").nodeValue===V[1]?[da]:d:[]};Z.filter.ID=
function(V,da){var ba=typeof V.getAttributeNode!=="undefined"&&V.getAttributeNode("id");return V.nodeType===1&&ba&&ba.nodeValue===da}}U.removeChild(I);U=I=null})();(function(){var I=v.createElement("div");I.appendChild(v.createComment(""));if(I.getElementsByTagName("*").length>0)Z.find.TAG=function(N,U){var V=U.getElementsByTagName(N[1]);if(N[1]==="*"){for(var da=[],ba=0;V[ba];ba++)V[ba].nodeType===1&&da.push(V[ba]);V=da}return V};I.innerHTML="<a href='#'></a>";if(I.firstChild&&typeof I.firstChild.getAttribute!==
"undefined"&&I.firstChild.getAttribute("href")!=="#")Z.attrHandle.href=function(N){return N.getAttribute("href",2)};I=null})();v.querySelectorAll&&function(){var I=T,N=v.createElement("div");N.innerHTML="<p class='TEST'></p>";if(!(N.querySelectorAll&&N.querySelectorAll(".TEST").length===0)){T=function(V,da,ba,ra){da=da||v;if(!ra&&da.nodeType===9&&!va(da))try{return ya(da.querySelectorAll(V),ba)}catch(oa){}return I(V,da,ba,ra)};for(var U in I)T[U]=I[U];N=null}}();(function(){var I=v.createElement("div");
I.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!I.getElementsByClassName||I.getElementsByClassName("e").length===0)){I.lastChild.className="e";if(I.getElementsByClassName("e").length!==1){Z.order.splice(1,0,"CLASS");Z.find.CLASS=function(N,U,V){if(typeof U.getElementsByClassName!=="undefined"&&!V)return U.getElementsByClassName(N[1])};I=null}}})();var Ea=v.compareDocumentPosition?function(I,N){return!!(I.compareDocumentPosition(N)&16)}:function(I,N){return I!==N&&(I.contains?
I.contains(N):true)},va=function(I){return(I=(I?I.ownerDocument||I:0).documentElement)?I.nodeName!=="HTML":false},bb=function(I,N){for(var U=[],V="",da,ba=N.nodeType?[N]:N;da=Z.match.PSEUDO.exec(I);){V+=da[0];I=I.replace(Z.match.PSEUDO,"")}I=Z.relative[I]?I+"*":I;da=0;for(var ra=ba.length;da<ra;da++)T(I,ba[da],U);return T.filter(V,U)};g.find=T;g.expr=T.selectors;g.expr[":"]=g.expr.filters;g.unique=T.uniqueSort;g.text=n;g.isXMLDoc=va;g.contains=Ea})();var Sa=/Until$/,$a=/^(?:parents|prevUntil|prevAll)/,
Fa=/,/;S=Array.prototype.slice;var Ka=function(n,A,B){if(g.isFunction(A))return g.grep(n,function(E,K){return!!A.call(E,K,E)===B});else if(A.nodeType)return g.grep(n,function(E){return E===A===B});else if(typeof A==="string"){var D=g.grep(n,function(E){return E.nodeType===1});if(H.test(A))return g.filter(A,D,!B);else A=g.filter(A,D)}return g.grep(n,function(E){return g.inArray(E,A)>=0===B})};g.fn.extend({find:function(n){for(var A=this.pushStack("","find",n),B=0,D=0,E=this.length;D<E;D++){B=A.length;
g.find(n,this[D],A);if(D>0)for(var K=B;K<A.length;K++)for(var L=0;L<B;L++)if(A[L]===A[K]){A.splice(K--,1);break}}return A},has:function(n){var A=g(n);return this.filter(function(){for(var B=0,D=A.length;B<D;B++)if(g.contains(this,A[B]))return true})},not:function(n){return this.pushStack(Ka(this,n,false),"not",n)},filter:function(n){return this.pushStack(Ka(this,n,true),"filter",n)},is:function(n){return!!n&&g.filter(n,this).length>0},closest:function(n,A){if(g.isArray(n)){var B=[],D=this[0],E,K=
{},L;if(D&&n.length){E=0;for(var Y=n.length;E<Y;E++){L=n[E];K[L]||(K[L]=g.expr.match.POS.test(L)?g(L,A||this.context):L)}for(;D&&D.ownerDocument&&D!==A;){for(L in K){E=K[L];if(E.jquery?E.index(D)>-1:g(D).is(E)){B.push({selector:L,elem:D});delete K[L]}}D=D.parentNode}}return B}var T=g.expr.match.POS.test(n)?g(n,A||this.context):null;return this.map(function(Z,ia){for(;ia&&ia.ownerDocument&&ia!==A;){if(T?T.index(ia)>-1:g(ia).is(n))return ia;ia=ia.parentNode}return null})},index:function(n){if(!n||typeof n===
"string")return g.inArray(this[0],n?g(n):this.parent().children());return g.inArray(n.jquery?n[0]:n,this)},add:function(n,A){var B=typeof n==="string"?g(n,A||this.context):g.makeArray(n),D=g.merge(this.get(),B);return this.pushStack(!B[0]||!B[0].parentNode||B[0].parentNode.nodeType===11||!D[0]||!D[0].parentNode||D[0].parentNode.nodeType===11?D:g.unique(D))},andSelf:function(){return this.add(this.prevObject)}});g.each({parent:function(n){return(n=n.parentNode)&&n.nodeType!==11?n:null},parents:function(n){return g.dir(n,
"parentNode")},parentsUntil:function(n,A,B){return g.dir(n,"parentNode",B)},next:function(n){return g.nth(n,2,"nextSibling")},prev:function(n){return g.nth(n,2,"previousSibling")},nextAll:function(n){return g.dir(n,"nextSibling")},prevAll:function(n){return g.dir(n,"previousSibling")},nextUntil:function(n,A,B){return g.dir(n,"nextSibling",B)},prevUntil:function(n,A,B){return g.dir(n,"previousSibling",B)},siblings:function(n){return g.sibling(n.parentNode.firstChild,n)},children:function(n){return g.sibling(n.firstChild)},
contents:function(n){return g.nodeName(n,"iframe")?n.contentDocument||n.contentWindow.document:g.makeArray(n.childNodes)}},function(n,A){g.fn[n]=function(B,D){var E=g.map(this,A,B);Sa.test(n)||(D=B);if(D&&typeof D==="string")E=g.filter(D,E);E=this.length>1?g.unique(E):E;if((this.length>1||Fa.test(D))&&$a.test(n))E=E.reverse();return this.pushStack(E,n,S.call(arguments).join(","))}});g.extend({filter:function(n,A,B){if(B)n=":not("+n+")";return g.find.matches(n,A)},dir:function(n,A,B){var D=[];for(n=
n[A];n&&n.nodeType!==9&&(B===d||n.nodeType!==1||!g(n).is(B));){n.nodeType===1&&D.push(n);n=n[A]}return D},nth:function(n,A,B){A=A||1;for(var D=0;n;n=n[B])if(n.nodeType===1&&++D===A)break;return n},sibling:function(n,A){for(var B=[];n;n=n.nextSibling)n.nodeType===1&&n!==A&&B.push(n);return B}});var Xa=/ jQuery\d+="(?:\d+|null)"/g,Oa=/^\s+/,Pa=/(<([\w:]+)[^>]*?)\/>/g,Da=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,Ha=/<([\w:]+)/,La=/<tbody/i,cb=/<|&#?\w+;/,ib=/<script|<object|<embed|<option|<style/i,
jb=/checked\s*(?:[^=]|=\s*.checked.)/i,mb=function(n,A,B){return Da.test(B)?n:A+"></"+B+">"},Ia={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,"",""]};Ia.optgroup=Ia.option;Ia.tbody=Ia.tfoot=Ia.colgroup=Ia.caption=Ia.thead;Ia.th=
Ia.td;if(!g.support.htmlSerialize)Ia._default=[1,"div<div>","</div>"];g.fn.extend({text:function(n){if(g.isFunction(n))return this.each(function(A){var B=g(this);B.text(n.call(this,A,B.text()))});if(typeof n!=="object"&&n!==d)return this.empty().append((this[0]&&this[0].ownerDocument||v).createTextNode(n));return g.text(this)},wrapAll:function(n){if(g.isFunction(n))return this.each(function(B){g(this).wrapAll(n.call(this,B))});if(this[0]){var A=g(n,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&
A.insertBefore(this[0]);A.map(function(){for(var B=this;B.firstChild&&B.firstChild.nodeType===1;)B=B.firstChild;return B}).append(this)}return this},wrapInner:function(n){if(g.isFunction(n))return this.each(function(A){g(this).wrapInner(n.call(this,A))});return this.each(function(){var A=g(this),B=A.contents();B.length?B.wrapAll(n):A.append(n)})},wrap:function(n){return this.each(function(){g(this).wrapAll(n)})},unwrap:function(){return this.parent().each(function(){g.nodeName(this,"body")||g(this).replaceWith(this.childNodes)}).end()},
append:function(){return this.domManip(arguments,true,function(n){this.nodeType===1&&this.appendChild(n)})},prepend:function(){return this.domManip(arguments,true,function(n){this.nodeType===1&&this.insertBefore(n,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(A){this.parentNode.insertBefore(A,this)});else if(arguments.length){var n=g(arguments[0]);n.push.apply(n,this.toArray());return this.pushStack(n,"before",arguments)}},after:function(){if(this[0]&&
this[0].parentNode)return this.domManip(arguments,false,function(A){this.parentNode.insertBefore(A,this.nextSibling)});else if(arguments.length){var n=this.pushStack(this,"after",arguments);n.push.apply(n,g(arguments[0]).toArray());return n}},remove:function(n,A){for(var B=0,D;(D=this[B])!=null;B++)if(!n||g.filter(n,[D]).length){if(!A&&D.nodeType===1){g.cleanData(D.getElementsByTagName("*"));g.cleanData([D])}D.parentNode&&D.parentNode.removeChild(D)}return this},empty:function(){for(var n=0,A;(A=
this[n])!=null;n++)for(A.nodeType===1&&g.cleanData(A.getElementsByTagName("*"));A.firstChild;)A.removeChild(A.firstChild);return this},clone:function(n){var A=this.map(function(){if(!g.support.noCloneEvent&&!g.isXMLDoc(this)){var B=this.outerHTML,D=this.ownerDocument;if(!B){B=D.createElement("div");B.appendChild(this.cloneNode(true));B=B.innerHTML}return g.clean([B.replace(Xa,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(Oa,"")],D)[0]}else return this.cloneNode(true)});if(n===true){m(this,A);
m(this.find("*"),A.find("*"))}return A},html:function(n){if(n===d)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Xa,""):null;else if(typeof n==="string"&&!ib.test(n)&&(g.support.leadingWhitespace||!Oa.test(n))&&!Ia[(Ha.exec(n)||["",""])[1].toLowerCase()]){n=n.replace(Pa,mb);try{for(var A=0,B=this.length;A<B;A++)if(this[A].nodeType===1){g.cleanData(this[A].getElementsByTagName("*"));this[A].innerHTML=n}}catch(D){this.empty().append(n)}}else g.isFunction(n)?this.each(function(E){var K=
g(this),L=K.html();K.empty().append(function(){return n.call(this,E,L)})}):this.empty().append(n);return this},replaceWith:function(n){if(this[0]&&this[0].parentNode){if(g.isFunction(n))return this.each(function(A){var B=g(this),D=B.html();B.replaceWith(n.call(this,A,D))});if(typeof n!=="string")n=g(n).detach();return this.each(function(){var A=this.nextSibling,B=this.parentNode;g(this).remove();A?g(A).before(n):g(B).append(n)})}else return this.pushStack(g(g.isFunction(n)?n():n),"replaceWith",n)},
detach:function(n){return this.remove(n,true)},domManip:function(n,A,B){var D,E,K=n[0],L=[],Y;if(!g.support.checkClone&&arguments.length===3&&typeof K==="string"&&jb.test(K))return this.each(function(){g(this).domManip(n,A,B,true)});if(g.isFunction(K))return this.each(function(Z){var ia=g(this);n[0]=K.call(this,Z,A?ia.html():d);ia.domManip(n,A,B)});if(this[0]){D=K&&K.parentNode;D=g.support.parentNode&&D&&D.nodeType===11&&D.childNodes.length===this.length?{fragment:D}:l(n,this,L);Y=D.fragment;if(E=
Y.childNodes.length===1?Y=Y.firstChild:Y.firstChild){A=A&&g.nodeName(E,"tr");E=0;for(var T=this.length;E<T;E++)B.call(A?g.nodeName(this[E],"table")?this[E].getElementsByTagName("tbody")[0]||this[E].appendChild(this[E].ownerDocument.createElement("tbody")):this[E]:this[E],E>0||D.cacheable||this.length>1?Y.cloneNode(true):Y)}L.length&&g.each(L,k)}return this}});g.fragments={};g.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(n,
A){g.fn[n]=function(B){var D=[];B=g(B);var E=this.length===1&&this[0].parentNode;if(E&&E.nodeType===11&&E.childNodes.length===1&&B.length===1){B[A](this[0]);return this}else{E=0;for(var K=B.length;E<K;E++){var L=(E>0?this.clone(true):this).get();g.fn[A].apply(g(B[E]),L);D=D.concat(L)}return this.pushStack(D,n,B.selector)}}});g.extend({clean:function(n,A,B,D){A=A||v;if(typeof A.createElement==="undefined")A=A.ownerDocument||A[0]&&A[0].ownerDocument||v;for(var E=[],K=0,L;(L=n[K])!=null;K++){if(typeof L===
"number")L+="";if(L){if(typeof L==="string"&&!cb.test(L))L=A.createTextNode(L);else if(typeof L==="string"){L=L.replace(Pa,mb);var Y=(Ha.exec(L)||["",""])[1].toLowerCase(),T=Ia[Y]||Ia._default,Z=T[0],ia=A.createElement("div");for(ia.innerHTML=T[1]+L+T[2];Z--;)ia=ia.lastChild;if(!g.support.tbody){Z=La.test(L);Y=Y==="table"&&!Z?ia.firstChild&&ia.firstChild.childNodes:T[1]==="<table>"&&!Z?ia.childNodes:[];for(T=Y.length-1;T>=0;--T)g.nodeName(Y[T],"tbody")&&!Y[T].childNodes.length&&Y[T].parentNode.removeChild(Y[T])}!g.support.leadingWhitespace&&
Oa.test(L)&&ia.insertBefore(A.createTextNode(Oa.exec(L)[0]),ia.firstChild);L=ia.childNodes}if(L.nodeType)E.push(L);else E=g.merge(E,L)}}if(B)for(K=0;E[K];K++)if(D&&g.nodeName(E[K],"script")&&(!E[K].type||E[K].type.toLowerCase()==="text/javascript"))D.push(E[K].parentNode?E[K].parentNode.removeChild(E[K]):E[K]);else{E[K].nodeType===1&&E.splice.apply(E,[K+1,0].concat(g.makeArray(E[K].getElementsByTagName("script"))));B.appendChild(E[K])}return E},cleanData:function(n){for(var A,B,D=g.cache,E=g.event.special,
K=g.support.deleteExpando,L=0,Y;(Y=n[L])!=null;L++)if(B=Y[g.expando]){if((A=D[B])&&A.events)for(var T in A.events)E[T]?g.event.remove(Y,T):ta(Y,T,A.handle);if(K)delete Y[g.expando];else Y.removeAttribute&&Y.removeAttribute(g.expando);delete D[B]}}});var qb=/z-?index|font-?weight|opacity|zoom|line-?height/i,nb=/alpha\([^)]*\)/,ob=/opacity=([^)]*)/,db=/float/i,eb=/-([a-z])/ig,rb=/([A-Z])/g,sb=/^-?\d+(?:px)?$/i,tb=/^-?\d/,ub={position:"absolute",visibility:"hidden",display:"block"},vb=["Left","Right"],
wb=["Top","Bottom"],xb=v.defaultView&&v.defaultView.getComputedStyle,pb=g.support.cssFloat?"cssFloat":"styleFloat",fb=function(n,A){return A.toUpperCase()};g.fn.css=function(n,A){return c(this,n,A,true,function(B,D,E){if(E===d)return g.curCSS(B,D);if(typeof E==="number"&&!qb.test(D))E+="px";g.style(B,D,E)})};g.extend({style:function(n,A,B){if(!n||n.nodeType===3||n.nodeType===8)return d;if((A==="width"||A==="height")&&parseFloat(B)<0)B=d;var D=n.style||n,E=B!==d;if(!g.support.opacity&&A==="opacity"){if(E){D.zoom=
1;A=parseInt(B,10)+""==="NaN"?"":"alpha(opacity="+B*100+")";n=D.filter||g.curCSS(n,"filter")||"";D.filter=nb.test(n)?n.replace(nb,A):A}return D.filter&&D.filter.indexOf("opacity=")>=0?parseFloat(ob.exec(D.filter)[1])/100+"":""}if(db.test(A))A=pb;A=A.replace(eb,fb);if(E)D[A]=B;return D[A]},css:function(n,A,B,D){if(A==="width"||A==="height"){var E,K=A==="width"?vb:wb;B=function(){E=A==="width"?n.offsetWidth:n.offsetHeight;D!=="border"&&g.each(K,function(){D||(E-=parseFloat(g.curCSS(n,"padding"+this,
true))||0);if(D==="margin")E+=parseFloat(g.curCSS(n,"margin"+this,true))||0;else E-=parseFloat(g.curCSS(n,"border"+this+"Width",true))||0})};n.offsetWidth!==0?B():g.swap(n,ub,B);return Math.max(0,Math.round(E))}return g.curCSS(n,A,B)},curCSS:function(n,A,B){var D,E=n.style;if(!g.support.opacity&&A==="opacity"&&n.currentStyle){D=ob.test(n.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return D===""?"1":D}if(db.test(A))A=pb;if(!B&&E&&E[A])D=E[A];else if(xb){if(db.test(A))A="float";A=A.replace(rb,
"-$1").toLowerCase();E=n.ownerDocument.defaultView;if(!E)return null;if(n=E.getComputedStyle(n,null))D=n.getPropertyValue(A);if(A==="opacity"&&D==="")D="1"}else if(n.currentStyle){B=A.replace(eb,fb);D=n.currentStyle[A]||n.currentStyle[B];if(!sb.test(D)&&tb.test(D)){A=E.left;var K=n.runtimeStyle.left;n.runtimeStyle.left=n.currentStyle.left;E.left=B==="fontSize"?"1em":D||0;D=E.pixelLeft+"px";E.left=A;n.runtimeStyle.left=K}}return D},swap:function(n,A,B){var D={};for(var E in A){D[E]=n.style[E];n.style[E]=
A[E]}B.call(n);for(E in A)n.style[E]=D[E]}});if(g.expr&&g.expr.filters){g.expr.filters.hidden=function(n){var A=n.offsetWidth,B=n.offsetHeight,D=n.nodeName.toLowerCase()==="tr";return A===0&&B===0&&!D?true:A>0&&B>0&&!D?false:g.curCSS(n,"display")==="none"};g.expr.filters.visible=function(n){return!g.expr.filters.hidden(n)}}var yb=e(),zb=/<script(.|\s)*?\/script>/gi,Ab=/select|textarea/i,Bb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,Ta=/=\?(&|$)/,
gb=/\?/,Cb=/(\?|&)_=.*?(&|$)/,Db=/^(\w+:)?\/\/([^\/?#]+)/,Eb=/%20/g,Fb=g.fn.load;g.fn.extend({load:function(n,A,B){if(typeof n!=="string")return Fb.call(this,n);else if(!this.length)return this;var D=n.indexOf(" ");if(D>=0){var E=n.slice(D,n.length);n=n.slice(0,D)}D="GET";if(A)if(g.isFunction(A)){B=A;A=null}else if(typeof A==="object"){A=g.param(A,g.ajaxSettings.traditional);D="POST"}var K=this;g.ajax({url:n,type:D,dataType:"html",data:A,complete:function(L,Y){if(Y==="success"||Y==="notmodified")K.html(E?
g("<div />").append(L.responseText.replace(zb,"")).find(E):L.responseText);B&&K.each(B,[L.responseText,Y,L])}});return this},serialize:function(){return g.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?g.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||Ab.test(this.nodeName)||Bb.test(this.type))}).map(function(n,A){var B=g(this).val();return B==null?null:g.isArray(B)?g.map(B,function(D){return{name:A.name,
value:D}}):{name:A.name,value:B}}).get()}});g.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(n,A){g.fn[A]=function(B){return this.bind(A,B)}});g.extend({get:function(n,A,B,D){if(g.isFunction(A)){D=D||B;B=A;A=null}return g.ajax({type:"GET",url:n,data:A,success:B,dataType:D})},getScript:function(n,A){return g.get(n,null,A,"script")},getJSON:function(n,A,B){return g.get(n,A,B,"json")},post:function(n,A,B,D){if(g.isFunction(A)){D=D||B;B=A;A={}}return g.ajax({type:"POST",
url:n,data:A,success:B,dataType:D})},ajaxSetup:function(n){g.extend(g.ajaxSettings,n)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:a.XMLHttpRequest&&(a.location.protocol!=="file:"||!a.ActiveXObject)?function(){return new a.XMLHttpRequest}:function(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(n){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",
json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(n){function A(){E.success&&E.success.call(T,Y,L,va);E.global&&D("ajaxSuccess",[va,E])}function B(){E.complete&&E.complete.call(T,va,L);E.global&&D("ajaxComplete",[va,E]);E.global&&!--g.active&&g.event.trigger("ajaxStop")}function D(da,ba){(E.context?g(E.context):g.event).trigger(da,ba)}var E=g.extend(true,{},g.ajaxSettings,n),K,L,Y,T=n&&n.context||E,Z=E.type.toUpperCase();if(E.data&&E.processData&&
typeof E.data!=="string")E.data=g.param(E.data,E.traditional);if(E.dataType==="jsonp"){if(Z==="GET")Ta.test(E.url)||(E.url+=(gb.test(E.url)?"&":"?")+(E.jsonp||"callback")+"=?");else if(!E.data||!Ta.test(E.data))E.data=(E.data?E.data+"&":"")+(E.jsonp||"callback")+"=?";E.dataType="json"}if(E.dataType==="json"&&(E.data&&Ta.test(E.data)||Ta.test(E.url))){K=E.jsonpCallback||"jsonp"+yb++;if(E.data)E.data=(E.data+"").replace(Ta,"="+K+"$1");E.url=E.url.replace(Ta,"="+K+"$1");E.dataType="script";a[K]=a[K]||
function(da){Y=da;A();B();a[K]=d;try{delete a[K]}catch(ba){}ya&&ya.removeChild(Ba)}}if(E.dataType==="script"&&E.cache===null)E.cache=false;if(E.cache===false&&Z==="GET"){var ia=e(),wa=E.url.replace(Cb,"$1_="+ia+"$2");E.url=wa+(wa===E.url?(gb.test(E.url)?"&":"?")+"_="+ia:"")}if(E.data&&Z==="GET")E.url+=(gb.test(E.url)?"&":"?")+E.data;E.global&&!g.active++&&g.event.trigger("ajaxStart");ia=(ia=Db.exec(E.url))&&(ia[1]&&ia[1]!==location.protocol||ia[2]!==location.host);if(E.dataType==="script"&&Z==="GET"&&
ia){var ya=v.getElementsByTagName("head")[0]||v.documentElement,Ba=v.createElement("script");Ba.src=E.url;if(E.scriptCharset)Ba.charset=E.scriptCharset;if(!K){var Aa=false;Ba.onload=Ba.onreadystatechange=function(){if(!Aa&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){Aa=true;A();B();Ba.onload=Ba.onreadystatechange=null;ya&&Ba.parentNode&&ya.removeChild(Ba)}}}ya.insertBefore(Ba,ya.firstChild);return d}var Ea=false,va=E.xhr();if(va){E.username?va.open(Z,E.url,E.async,
E.username,E.password):va.open(Z,E.url,E.async);try{if(E.data||n&&n.contentType)va.setRequestHeader("Content-Type",E.contentType);if(E.ifModified){g.lastModified[E.url]&&va.setRequestHeader("If-Modified-Since",g.lastModified[E.url]);g.etag[E.url]&&va.setRequestHeader("If-None-Match",g.etag[E.url])}ia||va.setRequestHeader("X-Requested-With","XMLHttpRequest");va.setRequestHeader("Accept",E.dataType&&E.accepts[E.dataType]?E.accepts[E.dataType]+", */*":E.accepts._default)}catch(bb){}if(E.beforeSend&&
E.beforeSend.call(T,va,E)===false){E.global&&!--g.active&&g.event.trigger("ajaxStop");va.abort();return false}E.global&&D("ajaxSend",[va,E]);var I=va.onreadystatechange=function(da){if(!va||va.readyState===0||da==="abort"){Ea||B();Ea=true;if(va)va.onreadystatechange=g.noop}else if(!Ea&&va&&(va.readyState===4||da==="timeout")){Ea=true;va.onreadystatechange=g.noop;L=da==="timeout"?"timeout":!g.httpSuccess(va)?"error":E.ifModified&&g.httpNotModified(va,E.url)?"notmodified":"success";var ba;if(L==="success")try{Y=
g.httpData(va,E.dataType,E)}catch(ra){L="parsererror";ba=ra}if(L==="success"||L==="notmodified")K||A();else g.handleError(E,va,L,ba);B();da==="timeout"&&va.abort();if(E.async)va=null}};try{var N=va.abort;va.abort=function(){va&&N.call(va);I("abort")}}catch(U){}E.async&&E.timeout>0&&setTimeout(function(){va&&!Ea&&I("timeout")},E.timeout);try{va.send(Z==="POST"||Z==="PUT"||Z==="DELETE"?E.data:null)}catch(V){g.handleError(E,va,null,V);B()}E.async||I();return va}},handleError:function(n,A,B,D){if(n.error)n.error.call(n.context||
n,A,B,D);if(n.global)(n.context?g(n.context):g.event).trigger("ajaxError",[A,n,D])},active:0,httpSuccess:function(n){try{return!n.status&&location.protocol==="file:"||n.status>=200&&n.status<300||n.status===304||n.status===1223||n.status===0}catch(A){}return false},httpNotModified:function(n,A){var B=n.getResponseHeader("Last-Modified"),D=n.getResponseHeader("Etag");if(B)g.lastModified[A]=B;if(D)g.etag[A]=D;return n.status===304||n.status===0},httpData:function(n,A,B){var D=n.getResponseHeader("content-type")||
"",E=A==="xml"||!A&&D.indexOf("xml")>=0;n=E?n.responseXML:n.responseText;E&&n.documentElement.nodeName==="parsererror"&&g.error("parsererror");if(B&&B.dataFilter)n=B.dataFilter(n,A);if(typeof n==="string")if(A==="json"||!A&&D.indexOf("json")>=0)n=g.parseJSON(n);else if(A==="script"||!A&&D.indexOf("javascript")>=0)g.globalEval(n);return n},param:function(n,A){function B(L,Y){if(g.isArray(Y))g.each(Y,function(T,Z){A||/\[\]$/.test(L)?D(L,Z):B(L+"["+(typeof Z==="object"||g.isArray(Z)?T:"")+"]",Z)});else!A&&
Y!=null&&typeof Y==="object"?g.each(Y,function(T,Z){B(L+"["+T+"]",Z)}):D(L,Y)}function D(L,Y){Y=g.isFunction(Y)?Y():Y;E[E.length]=encodeURIComponent(L)+"="+encodeURIComponent(Y)}var E=[];if(A===d)A=g.ajaxSettings.traditional;if(g.isArray(n)||n.jquery)g.each(n,function(){D(this.name,this.value)});else for(var K in n)B(K,n[K]);return E.join("&").replace(Eb,"+")}});var hb={},Gb=/toggle|show|hide/,Hb=/^([+-]=)?([\d+-.]+)(.*)$/,ab,kb=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],
["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];g.fn.extend({show:function(n,A){if(n||n===0)return this.animate(q("show",3),n,A);else{for(var B=0,D=this.length;B<D;B++){var E=g.data(this[B],"olddisplay");this[B].style.display=E||"";if(g.css(this[B],"display")==="none"){E=this[B].nodeName;var K;if(hb[E])K=hb[E];else{var L=g("<"+E+" />").appendTo("body");K=L.css("display");if(K==="none")K="block";L.remove();hb[E]=K}g.data(this[B],"olddisplay",K)}}B=0;for(D=this.length;B<
D;B++)this[B].style.display=g.data(this[B],"olddisplay")||"";return this}},hide:function(n,A){if(n||n===0)return this.animate(q("hide",3),n,A);else{for(var B=0,D=this.length;B<D;B++){var E=g.data(this[B],"olddisplay");!E&&E!=="none"&&g.data(this[B],"olddisplay",g.css(this[B],"display"))}B=0;for(D=this.length;B<D;B++)this[B].style.display="none";return this}},_toggle:g.fn.toggle,toggle:function(n,A){var B=typeof n==="boolean";if(g.isFunction(n)&&g.isFunction(A))this._toggle.apply(this,arguments);else n==
null||B?this.each(function(){var D=B?n:g(this).is(":hidden");g(this)[D?"show":"hide"]()}):this.animate(q("toggle",3),n,A);return this},fadeTo:function(n,A,B){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:A},n,B)},animate:function(n,A,B,D){var E=g.speed(A,B,D);if(g.isEmptyObject(n))return this.each(E.complete);return this[E.queue===false?"each":"queue"](function(){var K=g.extend({},E),L,Y=this.nodeType===1&&g(this).is(":hidden"),T=this;for(L in n){var Z=L.replace(eb,
fb);if(L!==Z){n[Z]=n[L];delete n[L];L=Z}if(n[L]==="hide"&&Y||n[L]==="show"&&!Y)return K.complete.call(this);if((L==="height"||L==="width")&&this.style){K.display=g.css(this,"display");K.overflow=this.style.overflow}if(g.isArray(n[L])){(K.specialEasing=K.specialEasing||{})[L]=n[L][1];n[L]=n[L][0]}}if(K.overflow!=null)this.style.overflow="hidden";K.curAnim=g.extend({},n);g.each(n,function(ia,wa){var ya=new g.fx(T,K,ia);if(Gb.test(wa))ya[wa==="toggle"?Y?"show":"hide":wa](n);else{var Ba=Hb.exec(wa),Aa=
ya.cur(true)||0;if(Ba){var Ea=parseFloat(Ba[2]),va=Ba[3]||"px";if(va!=="px"){T.style[ia]=(Ea||1)+va;Aa=(Ea||1)/ya.cur(true)*Aa;T.style[ia]=Aa+va}if(Ba[1])Ea=(Ba[1]==="-="?-1:1)*Ea+Aa;ya.custom(Aa,Ea,va)}else ya.custom(Aa,wa,"")}});return true})},stop:function(n,A){var B=g.timers;n&&this.queue([]);this.each(function(){for(var D=B.length-1;D>=0;D--)if(B[D].elem===this){A&&B[D](true);B.splice(D,1)}});A||this.dequeue();return this}});g.each({slideDown:q("show",1),slideUp:q("hide",1),slideToggle:q("toggle",
1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(n,A){g.fn[n]=function(B,D){return this.animate(A,B,D)}});g.extend({speed:function(n,A,B){var D=n&&typeof n==="object"?n:{complete:B||!B&&A||g.isFunction(n)&&n,duration:n,easing:B&&A||A&&!g.isFunction(A)&&A};D.duration=g.fx.off?0:typeof D.duration==="number"?D.duration:g.fx.speeds[D.duration]||g.fx.speeds._default;D.old=D.complete;D.complete=function(){D.queue!==false&&g(this).dequeue();g.isFunction(D.old)&&D.old.call(this)};return D},easing:{linear:function(n,
A,B,D){return B+D*n},swing:function(n,A,B,D){return(-Math.cos(n*Math.PI)/2+0.5)*D+B}},timers:[],fx:function(n,A,B){this.options=A;this.elem=n;this.prop=B;if(!A.orig)A.orig={}}});g.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(g.fx.step[this.prop]||g.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(n){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==
null))return this.elem[this.prop];return(n=parseFloat(g.css(this.elem,this.prop,n)))&&n>-10000?n:parseFloat(g.curCSS(this.elem,this.prop))||0},custom:function(n,A,B){function D(K){return E.step(K)}this.startTime=e();this.start=n;this.end=A;this.unit=B||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;D.elem=this.elem;if(D()&&g.timers.push(D)&&!ab)ab=setInterval(g.fx.tick,13)},show:function(){this.options.orig[this.prop]=g.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop===
"width"||this.prop==="height"?1:0,this.cur());g(this.elem).show()},hide:function(){this.options.orig[this.prop]=g.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(n){var A=e(),B=true;if(n||A>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var D in this.options.curAnim)if(this.options.curAnim[D]!==true)B=false;if(B){if(this.options.display!=null){this.elem.style.overflow=
this.options.overflow;n=g.data(this.elem,"olddisplay");this.elem.style.display=n?n:this.options.display;if(g.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&g(this.elem).hide();if(this.options.hide||this.options.show)for(var E in this.options.curAnim)g.style(this.elem,E,this.options.orig[E]);this.options.complete.call(this.elem)}return false}else{E=A-this.startTime;this.state=E/this.options.duration;n=this.options.easing||(g.easing.swing?"swing":"linear");this.pos=
g.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||n](this.state,E,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};g.extend(g.fx,{tick:function(){for(var n=g.timers,A=0;A<n.length;A++)n[A]()||n.splice(A--,1);n.length||g.fx.stop()},stop:function(){clearInterval(ab);ab=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(n){g.style(n.elem,"opacity",n.now)},_default:function(n){if(n.elem.style&&n.elem.style[n.prop]!=
null)n.elem.style[n.prop]=(n.prop==="width"||n.prop==="height"?Math.max(0,n.now):n.now)+n.unit;else n.elem[n.prop]=n.now}}});if(g.expr&&g.expr.filters)g.expr.filters.animated=function(n){return g.grep(g.timers,function(A){return n===A.elem}).length};g.fn.offset="getBoundingClientRect"in v.documentElement?function(n){var A=this[0];if(n)return this.each(function(E){g.offset.setOffset(this,n,E)});if(!A||!A.ownerDocument)return null;if(A===A.ownerDocument.body)return g.offset.bodyOffset(A);var B=A.getBoundingClientRect(),
D=A.ownerDocument;A=D.body;D=D.documentElement;return{top:B.top+(self.pageYOffset||g.support.boxModel&&D.scrollTop||A.scrollTop)-(D.clientTop||A.clientTop||0),left:B.left+(self.pageXOffset||g.support.boxModel&&D.scrollLeft||A.scrollLeft)-(D.clientLeft||A.clientLeft||0)}}:function(n){var A=this[0];if(n)return this.each(function(ia){g.offset.setOffset(this,n,ia)});if(!A||!A.ownerDocument)return null;if(A===A.ownerDocument.body)return g.offset.bodyOffset(A);g.offset.initialize();var B=A.offsetParent,
D=A,E=A.ownerDocument,K,L=E.documentElement,Y=E.body;D=(E=E.defaultView)?E.getComputedStyle(A,null):A.currentStyle;for(var T=A.offsetTop,Z=A.offsetLeft;(A=A.parentNode)&&A!==Y&&A!==L;){if(g.offset.supportsFixedPosition&&D.position==="fixed")break;K=E?E.getComputedStyle(A,null):A.currentStyle;T-=A.scrollTop;Z-=A.scrollLeft;if(A===B){T+=A.offsetTop;Z+=A.offsetLeft;if(g.offset.doesNotAddBorder&&!(g.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(A.nodeName))){T+=parseFloat(K.borderTopWidth)||
0;Z+=parseFloat(K.borderLeftWidth)||0}D=B;B=A.offsetParent}if(g.offset.subtractsBorderForOverflowNotVisible&&K.overflow!=="visible"){T+=parseFloat(K.borderTopWidth)||0;Z+=parseFloat(K.borderLeftWidth)||0}D=K}if(D.position==="relative"||D.position==="static"){T+=Y.offsetTop;Z+=Y.offsetLeft}if(g.offset.supportsFixedPosition&&D.position==="fixed"){T+=Math.max(L.scrollTop,Y.scrollTop);Z+=Math.max(L.scrollLeft,Y.scrollLeft)}return{top:T,left:Z}};g.offset={initialize:function(){var n=v.body,A=v.createElement("div"),
B,D,E,K=parseFloat(g.curCSS(n,"marginTop",true))||0;g.extend(A.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});A.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";n.insertBefore(A,n.firstChild);
B=A.firstChild;D=B.firstChild;E=B.nextSibling.firstChild.firstChild;this.doesNotAddBorder=D.offsetTop!==5;this.doesAddBorderForTableAndCells=E.offsetTop===5;D.style.position="fixed";D.style.top="20px";this.supportsFixedPosition=D.offsetTop===20||D.offsetTop===15;D.style.position=D.style.top="";B.style.overflow="hidden";B.style.position="relative";this.subtractsBorderForOverflowNotVisible=D.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=n.offsetTop!==K;n.removeChild(A);g.offset.initialize=g.noop},
bodyOffset:function(n){var A=n.offsetTop,B=n.offsetLeft;g.offset.initialize();if(g.offset.doesNotIncludeMarginInBodyOffset){A+=parseFloat(g.curCSS(n,"marginTop",true))||0;B+=parseFloat(g.curCSS(n,"marginLeft",true))||0}return{top:A,left:B}},setOffset:function(n,A,B){if(/static/.test(g.curCSS(n,"position")))n.style.position="relative";var D=g(n),E=D.offset(),K=parseInt(g.curCSS(n,"top",true),10)||0,L=parseInt(g.curCSS(n,"left",true),10)||0;if(g.isFunction(A))A=A.call(n,B,E);B={top:A.top-E.top+K,left:A.left-
E.left+L};"using"in A?A.using.call(n,B):D.css(B)}};g.fn.extend({position:function(){if(!this[0])return null;var n=this[0],A=this.offsetParent(),B=this.offset(),D=/^body|html$/i.test(A[0].nodeName)?{top:0,left:0}:A.offset();B.top-=parseFloat(g.curCSS(n,"marginTop",true))||0;B.left-=parseFloat(g.curCSS(n,"marginLeft",true))||0;D.top+=parseFloat(g.curCSS(A[0],"borderTopWidth",true))||0;D.left+=parseFloat(g.curCSS(A[0],"borderLeftWidth",true))||0;return{top:B.top-D.top,left:B.left-D.left}},offsetParent:function(){return this.map(function(){for(var n=
this.offsetParent||v.body;n&&!/^body|html$/i.test(n.nodeName)&&g.css(n,"position")==="static";)n=n.offsetParent;return n})}});g.each(["Left","Top"],function(n,A){var B="scroll"+A;g.fn[B]=function(D){var E=this[0],K;if(!E)return null;if(D!==d)return this.each(function(){if(K=u(this))K.scrollTo(!n?D:g(K).scrollLeft(),n?D:g(K).scrollTop());else this[B]=D});else return(K=u(E))?"pageXOffset"in K?K[n?"pageYOffset":"pageXOffset"]:g.support.boxModel&&K.document.documentElement[B]||K.document.body[B]:E[B]}});
g.each(["Height","Width"],function(n,A){var B=A.toLowerCase();g.fn["inner"+A]=function(){return this[0]?g.css(this[0],B,false,"padding"):null};g.fn["outer"+A]=function(D){return this[0]?g.css(this[0],B,false,D?"margin":"border"):null};g.fn[B]=function(D){var E=this[0];if(!E)return D==null?null:this;if(g.isFunction(D))return this.each(function(K){var L=g(this);L[B](D.call(this,K,L[B]()))});return"scrollTo"in E&&E.document?E.document.compatMode==="CSS1Compat"&&E.document.documentElement["client"+A]||
E.document.body["client"+A]:E.nodeType===9?Math.max(E.documentElement["client"+A],E.body["scroll"+A],E.documentElement["scroll"+A],E.body["offset"+A],E.documentElement["offset"+A]):D===d?g.css(E,B):this.css(B,typeof D==="string"?D:D+"px")}});a.jQuery=a.$=g})(window);
(function(a){function d(k){var c=this.form;c.clk=this;if(this.type=="image")if(k.offsetX!=undefined){c.clk_x=k.offsetX;c.clk_y=k.offsetY}else if(typeof a.fn.offset=="function"){var e=a(this).offset();c.clk_x=k.pageX-e.left;c.clk_y=k.pageY-e.top}else{c.clk_x=k.pageX-this.offsetLeft;c.clk_y=k.pageY-this.offsetTop}setTimeout(function(){c.clk=c.clk_x=c.clk_y=null},10)}function b(){var k=a.fn.ajaxForm.optionHash[this.formPluginId];a(this).ajaxSubmit(k);return false}a.fn.ajaxSubmit=function(k){function c(){function m(){if(!H++){y.detachEvent?
y.detachEvent("onload",m):y.removeEventListener("load",m,false);var J=true;try{if(F)throw"timeout";var Q,aa;aa=y.contentWindow?y.contentWindow.document:y.contentDocument?y.contentDocument:y.document;C.responseText=aa.body?aa.body.innerHTML:null;C.responseXML=aa.XMLDocument?aa.XMLDocument:aa;if(u.dataType=="json"||u.dataType=="script"){var ca=aa.getElementsByTagName("textarea")[0];Q=ca?ca.value:C.responseText;u.dataType=="json"?eval("data = "+Q):a.globalEval(Q)}else if(u.dataType=="xml"){Q=C.responseXML;
if(!Q&&C.responseText!=null)Q=l(C.responseText)}else Q=C.responseText}catch(qa){J=false;a.handleError(u,C,"error",qa)}if(J){u.success(Q,"success");G&&a.event.trigger("ajaxSuccess",[C,u])}G&&a.event.trigger("ajaxComplete",[C,u]);G&&!--a.active&&a.event.trigger("ajaxStop");if(u.complete)u.complete(C,J?"success":"error");setTimeout(function(){o.remove();C.responseXML=null},100)}}function l(J,Q){if(window.ActiveXObject){Q=new ActiveXObject("Microsoft.XMLDOM");Q.async="false";Q.loadXML(J)}else Q=(new DOMParser).parseFromString(J,
"text/xml");return Q&&Q.documentElement&&Q.documentElement.tagName!="parsererror"?Q:null}var q=t[0],u=a.extend({},a.ajaxSettings,k),g="jqFormIO"+a.fn.ajaxSubmit.counter++,o=a('<iframe id="'+g+'" name="'+g+'" />'),y=o[0],v=a.browser.opera&&window.opera.version()<9;if(a.browser.msie||v)y.src='javascript:false;document.write("");';o.css({position:"absolute",top:"-1000px",left:"-1000px"});var C={responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},
setRequestHeader:function(){}},G=u.global;G&&!a.active++&&a.event.trigger("ajaxStart");G&&a.event.trigger("ajaxSend",[C,u]);var H=0,F=0;setTimeout(function(){var J=q.encoding?"encoding":"enctype",Q=t.attr("target"),aa=t.attr("action");t.attr({target:g,method:"POST",action:u.url});q[J]="multipart/form-data";u.timeout&&setTimeout(function(){F=true;m()},u.timeout);o.appendTo("body");y.attachEvent?y.attachEvent("onload",m):y.addEventListener("load",m,false);q.submit();t.attr({action:aa,target:Q})},10)}
if(typeof k=="function")k={success:k};k=a.extend({url:this.attr("action")||window.location.toString(),type:this.attr("method")||"GET"},k||{});var e={};a.event.trigger("form.pre.serialize",[this,k,e]);if(e.veto)return this;var p=this.formToArray(k.semantic);if(k.data)for(var x in k.data)p.push({name:x,value:k.data[x]});if(k.beforeSubmit&&k.beforeSubmit(p,this,k)===false)return this;a.event.trigger("form.submit.validate",[p,this,k,e]);if(e.veto)return this;e=a.param(p);if(k.type.toUpperCase()=="GET"){k.url+=
(k.url.indexOf("?")>=0?"&":"?")+e;k.data=null}else k.data=e;var t=this,z=[];k.resetForm&&z.push(function(){t.resetForm()});k.clearForm&&z.push(function(){t.clearForm()});if(!k.dataType&&k.target){var r=k.success||function(){};z.push(function(m){this.evalScripts?a(k.target).attr("innerHTML",m).evalScripts().each(r,arguments):a(k.target).html(m).each(r,arguments)})}else k.success&&z.push(k.success);k.success=function(m,l){for(var q=0,u=z.length;q<u;q++)z[q](m,l,t)};e=a("input:file",this).fieldValue();
p=false;for(x=0;x<e.length;x++)if(e[x])p=true;if(k.iframe||p)a.browser.safari&&k.closeKeepAlive?a.get(k.closeKeepAlive,c):c();else a.ajax(k);a.event.trigger("form.submit.notify",[this,k]);return this};a.fn.ajaxSubmit.counter=0;a.fn.ajaxForm=function(k){return this.ajaxFormUnbind().submit(b).each(function(){this.formPluginId=a.fn.ajaxForm.counter++;a.fn.ajaxForm.optionHash[this.formPluginId]=k;a(":submit,input:image",this).click(d)})};a.fn.ajaxForm.counter=1;a.fn.ajaxForm.optionHash={};a.fn.ajaxFormUnbind=
function(){this.unbind("submit",b);return this.each(function(){a(":submit,input:image",this).unbind("click",d)})};a.fn.formToArray=function(k){var c=[];if(this.length==0)return c;var e=this[0],p=k?e.getElementsByTagName("*"):e.elements;if(!p)return c;for(var x=0,t=p.length;x<t;x++){var z=p[x],r=z.name;if(r)if(k&&e.clk&&z.type=="image")!z.disabled&&e.clk==z&&c.push({name:r+".x",value:e.clk_x},{name:r+".y",value:e.clk_y});else if((z=a.fieldValue(z,true))&&z.constructor==Array)for(var m=0,l=z.length;m<
l;m++)c.push({name:r,value:z[m]});else z!==null&&typeof z!="undefined"&&c.push({name:r,value:z})}if(!k&&e.clk){k=e.getElementsByTagName("input");x=0;for(t=k.length;x<t;x++){p=k[x];(r=p.name)&&!p.disabled&&p.type=="image"&&e.clk==p&&c.push({name:r+".x",value:e.clk_x},{name:r+".y",value:e.clk_y})}}return c};a.fn.formSerialize=function(k){return a.param(this.formToArray(k))};a.fn.fieldSerialize=function(k){var c=[];this.each(function(){var e=this.name;if(e){var p=a.fieldValue(this,k);if(p&&p.constructor==
Array)for(var x=0,t=p.length;x<t;x++)c.push({name:e,value:p[x]});else p!==null&&typeof p!="undefined"&&c.push({name:this.name,value:p})}});return a.param(c)};a.fn.fieldValue=function(k){for(var c=[],e=0,p=this.length;e<p;e++){var x=a.fieldValue(this[e],k);x===null||typeof x=="undefined"||x.constructor==Array&&!x.length||(x.constructor==Array?a.merge(c,x):c.push(x))}return c};a.fieldValue=function(k,c){var e=k.name,p=k.type,x=k.tagName.toLowerCase();if(typeof c=="undefined")c=true;if(c&&(!e||k.disabled||
p=="reset"||p=="button"||(p=="checkbox"||p=="radio")&&!k.checked||(p=="submit"||p=="image")&&k.form&&k.form.clk!=k||x=="select"&&k.selectedIndex==-1))return null;if(x=="select"){var t=k.selectedIndex;if(t<0)return null;e=[];x=k.options;var z=(p=p=="select-one")?t+1:x.length;for(t=p?t:0;t<z;t++){var r=x[t];if(r.selected){r=a.browser.msie&&!r.attributes.value.specified?r.text:r.value;if(p)return r;e.push(r)}}return e}return k.value};a.fn.clearForm=function(){return this.each(function(){a("input,select,textarea",
this).clearFields()})};a.fn.clearFields=a.fn.clearInputs=function(){return this.each(function(){var k=this.type,c=this.tagName.toLowerCase();if(k=="text"||k=="password"||c=="textarea")this.value="";else if(k=="checkbox"||k=="radio")this.checked=false;else if(c=="select")this.selectedIndex=-1})};a.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||typeof this.reset=="object"&&!this.reset.nodeType)this.reset()})};a.fn.enable=function(k){if(k==undefined)k=true;return this.each(function(){this.disabled=
!k})};a.fn.select=function(k){if(k==undefined)k=true;return this.each(function(){var c=this.type;if(c=="checkbox"||c=="radio")this.checked=k;else if(this.tagName.toLowerCase()=="option"){c=a(this).parent("select");k&&c[0]&&c[0].type=="select-one"&&c.find("option").select(false);this.selected=k}})}})(jQuery);
(function(a){function d(b,k){return parseInt(a.curCSS(b.jquery?b[0]:b,k,true))||0}a.dimensions={version:"1.2"};a.each(["Height","Width"],function(b,k){a.fn["inner"+k]=function(){if(this[0]){var c=k=="Height"?"Top":"Left",e=k=="Height"?"Bottom":"Right";return this.is(":visible")?this[0]["client"+k]:d(this,k.toLowerCase())+d(this,"padding"+c)+d(this,"padding"+e)}};a.fn["outer"+k]=function(c){if(this[0]){var e=k=="Height"?"Top":"Left",p=k=="Height"?"Bottom":"Right";c=a.extend({margin:false},c||{});return(this.is(":visible")?
this[0]["offset"+k]:d(this,k.toLowerCase())+d(this,"border"+e+"Width")+d(this,"border"+p+"Width")+d(this,"padding"+e)+d(this,"padding"+p))+(c.margin?d(this,"margin"+e)+d(this,"margin"+p):0)}}});a.each(["Left","Top"],function(b,k){a.fn["scroll"+k]=function(c){if(this[0])return c!=undefined?this.each(function(){this==window||this==document?window.scrollTo(k=="Left"?c:a(window).scrollLeft(),k=="Top"?c:a(window).scrollTop()):this["scroll"+k]=c}):this[0]==window||this[0]==document?self[k=="Left"?"pageXOffset":
"pageYOffset"]||a.boxModel&&document.documentElement["scroll"+k]||document.body["scroll"+k]:this[0]["scroll"+k]}});a.fn.extend({position:function(){var b=this[0],k,c,e;if(b){e=this.offsetParent();k=this.offset();c=e.offset();k.top-=d(b,"marginTop");k.left-=d(b,"marginLeft");c.top+=d(e,"borderTopWidth");c.left+=d(e,"borderLeftWidth");k={top:k.top-c.top,left:k.left-c.left}}return k},offsetParent:function(){for(var b=this[0].offsetParent;b&&!/^body|html$/i.test(b.tagName)&&a.css(b,"position")=="static";)b=
b.offsetParent;return a(b)}})})(jQuery);
(function(a){var d=function(b,k,c,e){this.x1=b;this.x2=c;this.y1=k;this.y2=e};d.prototype.contains=function(b){return this.x1<=b.x1&&b.x2<=this.x2&&this.y1<=b.y1&&b.y2<=this.y2};d.prototype.transform=function(b,k){return new d(this.x1+b,this.y1+k,this.x2+b,this.y2+k)};a.fn.positionBy=function(b){if(this.length==0)return this;b=a.extend({target:null,targetPos:null,elementPos:null,x:null,y:null,positions:null,addClass:false,force:false,container:window,hideAfterPosition:false},b);if(b.x!=null)var k=
b.x,c=b.y,e=0,p=0;else{var x=a(a(b.target)[0]);e=x.outerWidth();p=x.outerHeight();x=x.offset();k=x.left;c=x.top}var t=k+e,z=c+p;return this.each(function(){var r=a(this);r.is(":visible")||r.css({left:-3000,top:-3000}).show();var m=r.outerWidth(),l=r.outerHeight(),q=[],u=[];q[0]=new d(t,c,t+m,c+l);u[0]=[1,7,4];q[1]=new d(t,z-l,t+m,z);u[1]=[0,6,4];q[2]=new d(t,z,t+m,z+l);u[2]=[1,3,10];q[3]=new d(t-m,z,t,z+l);u[3]=[1,6,10];q[4]=new d(k,z,k+m,z+l);u[4]=[1,6,9];q[5]=new d(k-m,z,k,z+l);u[5]=[6,4,9];q[6]=
new d(k-m,z-l,k,z);u[6]=[7,1,4];q[7]=new d(k-m,c,k,c+l);u[7]=[6,0,4];q[8]=new d(k-m,c-l,k,c);u[8]=[7,9,4];q[9]=new d(k,c-l,k+m,c);u[9]=[0,7,4];q[10]=new d(t-m,c-l,t,c);u[10]=[0,7,3];q[11]=new d(t,c-l,t+m,c);u[11]=[0,10,3];q[12]=new d(t-m,c,t,c+l);u[12]=[13,7,10];q[13]=new d(t-m,z-l,t,z);u[13]=[12,6,3];q[14]=new d(k,z-l,k+m,z);u[14]=[15,1,4];q[15]=new d(k,c,k+m,c+l);u[15]=[14,0,9];if(b.positions!==null)var g=b.positions[0];else if(b.targetPos!=null&&b.elementPos!=null){g=[];g[0]=[];g[0][0]=15;g[0][1]=
7;g[0][2]=8;g[0][3]=9;g[1]=[];g[1][0]=0;g[1][1]=12;g[1][2]=10;g[1][3]=11;g[2]=[];g[2][0]=2;g[2][1]=3;g[2][2]=13;g[2][3]=1;g[3]=[];g[3][0]=4;g[3][1]=5;g[3][2]=6;g[3][3]=14;g=g[b.targetPos][b.elementPos]}var o=q[g];if(!b.force){$window=a(window);m=$window.scrollLeft();l=$window.scrollTop();m=new d(m,l,m+$window.width(),l+$window.height());g=b.positions?b.positions:[g];for(l=[];g.length>0;){var y=g.shift();if(!l[y]){l[y]=true;if(m.contains(q[y])){o=q[y];break}else if(b.positions===null)g=jQuery.merge(g,
u[y])}}}r.parents().each(function(){var v=a(this);if(v.css("position")!="static"){v=v.offset();o=o.transform(-v.left,-v.top);return false}});q={left:o.x1,top:o.y1};if(b.hideAfterPosition)q.display="none";r.css(q);b.addClass&&r.removeClass("positionBy0 positionBy1 positionBy2 positionBy3 positionBy4 positionBy5 positionBy6 positionBy7 positionBy8 positionBy9 positionBy10 positionBy11 positionBy12 positionBy13 positionBy14 positionBy15").addClass("positionBy"+y)})}})(jQuery);
(function(a){a.fn.bgIframe=a.fn.bgiframe=function(d){if(a.browser.msie&&/6.0/.test(navigator.userAgent)){d=a.extend({top:"auto",left:"auto",width:"auto",height:"auto",opacity:true,src:"javascript:false;"},d||{});var b=function(c){return c&&c.constructor==Number?c+"px":c},k='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+d.src+'"style="display:block;position:absolute;z-index:-1;'+(d.opacity!==false?"filter:Alpha(Opacity='0');":"")+"top:"+(d.top=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+'px')":
b(d.top))+";left:"+(d.left=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+'px')":b(d.left))+";width:"+(d.width=="auto"?"expression(this.parentNode.offsetWidth+'px')":b(d.width))+";height:"+(d.height=="auto"?"expression(this.parentNode.offsetHeight+'px')":b(d.height))+';"/>';return this.each(function(){a("> iframe.bgiframe",this).length==0&&this.insertBefore(document.createElement(k),this.firstChild)})}return this}})(jQuery);$(function(){$("ul.jd_menu").jdMenu()});
(function(a){function d(c){var e=a.data(a(c).parents().andSelf().filter("ul.jd_menu")[0],"jdMenuSettings");a("> li",c).bind("mouseenter.jdmenu mouseleave.jdmenu",function(p){a(this).toggleClass("jdm_hover");var x=a("> ul",this);if(x.length==1){clearTimeout(this.$jdTimer);var t=(p=p.type=="mouseenter")?b:k;this.$jdTimer=setTimeout(function(){t(x[0],e.onAnimate,e.isVertical)},p?e.showDelay:e.hideDelay)}}).bind("click.jdmenu",function(p){var x=a("> ul",this);if(x.length==1&&(e.disableLinks==true||a(this).hasClass("accessible"))){b(x,
e.onAnimate,e.isVertical);return false}if(p.target==this){x=a("> a",p.target).not(".accessible");if(x.length>0){x=x[0];x.onclick?a(x).trigger("click"):window.open(x.href,x.target||"_self")}}if(e.disableLinks||!e.disableLinks&&!a(this).parent().hasClass("jd_menu")){a(this).parent().jdMenuHide();p.stopPropagation()}}).find("> a").bind("focus.jdmenu blur.jdmenu",function(p){var x=a(this).parents("li:eq(0)");p.type=="focus"?x.addClass("jdm_hover"):x.removeClass("jdm_hover")}).filter(".accessible").bind("click.jdmenu",
function(p){p.preventDefault()})}function b(c,e,p){c=a(c);if(!c.is(":visible")){c.bgiframe();var x=c.parent();c.trigger("jdMenuShow").positionBy({target:x[0],targetPos:p===true||!x.parent().hasClass("jd_menu")?1:3,elementPos:0,hideAfterPosition:true});if(!c.hasClass("jdm_events")){c.addClass("jdm_events");d(c)}x.addClass("jdm_active").siblings("li").find("> ul:eq(0):visible").each(function(){k(this)});e===undefined?c.show():e.apply(c[0],[true])}}function k(c,e){c=a(c);a(".bgiframe",c).remove();c.filter(":not(.jd_menu)").find("> li > ul:eq(0):visible").each(function(){k(this)}).end();
e===undefined?c.hide():e.apply(c[0],[false]);c.trigger("jdMenuHide").parents("li:eq(0)").removeClass("jdm_active jdm_hover").end().find("> li").removeClass("jdm_active jdm_hover")}a.fn.jdMenu=function(c){c=a.extend({showDelay:200,hideDelay:500,disableLinks:true},c);if(!a.isFunction(c.onAnimate))c.onAnimate=undefined;return this.filter("ul.jd_menu").each(function(){a.data(this,"jdMenuSettings",a.extend({isVertical:a(this).hasClass("jd_menu_vertical")},c));d(this)})};a.fn.jdMenuUnbind=function(){a("ul.jdm_events",
this).unbind(".jdmenu").find("> a").unbind(".jdmenu")};a.fn.jdMenuHide=function(){return this.filter("ul").each(function(){k(this)})};a(window).bind("click.jdmenu",function(){a("ul.jd_menu ul:visible").jdMenuHide()})})(jQuery);
(function(a){a.fn.addOption=function(){var d=function(t,z,r,m){var l=document.createElement("option");l.value=z;l.text=r;r=t.options;var q=r.length;if(!t.cache){t.cache={};for(var u=0;u<q;u++)t.cache[r[u].value]=u}if(typeof t.cache[z]=="undefined")t.cache[z]=q;t.options[t.cache[z]]=l;if(m)l.selected=true},b=arguments;if(b.length==0)return this;var k=true,c=false,e,p,x;if(typeof b[0]=="object"){c=true;e=b[0]}if(b.length>=2){if(typeof b[1]=="boolean")k=b[1];else if(typeof b[2]=="boolean")k=b[2];if(!c){p=
b[0];x=b[1]}}this.each(function(){if(this.nodeName.toLowerCase()=="select")if(c)for(var t in e)d(this,t,e[t],k);else d(this,p,x,k)});return this};a.fn.ajaxAddOption=function(d,b,k,c,e){if(typeof d!="string")return this;if(typeof b!="object")b={};if(typeof k!="boolean")k=true;this.each(function(){var p=this;a.getJSON(d,b,function(x){a(p).addOption(x,k);if(typeof c=="function")typeof e=="object"?c.apply(p,e):c.call(p)})});return this};a.fn.removeOption=function(){var d=arguments;if(d.length==0)return this;
var b=typeof d[0],k,c;if(b=="string"||b=="object"||b=="function"){k=d[0];if(k.constructor==Array){b=k.length;for(var e=0;e<b;e++)this.removeOption(k[e],d[1]);return this}}else if(b=="number")c=d[0];else return this;this.each(function(){if(this.nodeName.toLowerCase()=="select"){if(this.cache)this.cache=null;var p=false,x=this.options;if(k)for(var t=x.length-1;t>=0;t--){if(k.constructor==RegExp){if(x[t].value.match(k))p=true}else if(x[t].value==k)p=true;if(p&&d[1]===true)p=x[t].selected;if(p)x[t]=null;
p=false}else(p=d[1]===true?x[c].selected:true)&&this.remove(c)}});return this};a.fn.sortOptions=function(d){var b=a(this).selectedValues(),k=typeof d=="undefined"?true:!!d;this.each(function(){if(this.nodeName.toLowerCase()=="select"){for(var c=this.options,e=c.length,p=[],x=0;x<e;x++)p[x]={v:c[x].value,t:c[x].text};p.sort(function(t,z){o1t=t.t.toLowerCase();o2t=z.t.toLowerCase();if(o1t==o2t)return 0;return k?o1t<o2t?-1:1:o1t>o2t?-1:1});for(x=0;x<e;x++){c[x].text=p[x].t;c[x].value=p[x].v}}}).selectOptions(b,
true);return this};a.fn.selectOptions=function(d,b){var k=typeof d;if(k=="object"&&d.constructor==Array){var c=this;a.each(d,function(){c.selectOptions(this,b)})}var e=b||false;if(k!="string"&&k!="function"&&k!="object")return this;this.each(function(){if(this.nodeName.toLowerCase()!="select")return this;for(var p=this.options,x=p.length,t=0;t<x;t++)if(d.constructor==RegExp)if(p[t].value.match(d))p[t].selected=true;else{if(e)p[t].selected=false}else if(p[t].value==d)p[t].selected=true;else if(e)p[t].selected=
false});return this};a.fn.copyOptions=function(d,b){var k=b||"selected";if(a(d).size()==0)return this;this.each(function(){if(this.nodeName.toLowerCase()!="select")return this;for(var c=this.options,e=c.length,p=0;p<e;p++)if(k=="all"||k=="selected"&&c[p].selected)a(d).addOption(c[p].value,c[p].text)});return this};a.fn.containsOption=function(d,b){var k=false,c=typeof d,e=typeof b;if(c!="string"&&c!="function"&&c!="object")return e=="function"?this:k;this.each(function(){if(this.nodeName.toLowerCase()!=
"select")return this;if(k&&e!="function")return false;for(var p=this.options,x=p.length,t=0;t<x;t++)if(d.constructor==RegExp){if(p[t].value.match(d)){k=true;e=="function"&&b.call(p[t],t)}}else if(p[t].value==d){k=true;e=="function"&&b.call(p[t],t)}});return e=="function"?this:k};a.fn.selectedValues=function(){var d=[];this.selectedOptions().each(function(){d[d.length]=this.value});return d};a.fn.selectedTexts=function(){var d=[];this.selectedOptions().each(function(){d[d.length]=this.text});return d};
a.fn.selectedOptions=function(){return this.find("option:selected")}})(jQuery);
(function(a){var d=a.ajax;a.ajax=function(b){b=jQuery.extend(b,jQuery.extend({},jQuery.ajaxDefaults,b));var k=b.complete;b.complete=function(c,e){if(e=="success")try{var p=c.getResponseHeader("X-QuakeLive-Goto");if(p)if(p.indexOf("http://")==0||p.indexOf("https://")==0){window.location=p;return}else quakelive.Goto(p);var x=c.getResponseHeader("X-QL-IDENT");if(x!==null&&(""+x).length>0){var t=x.split(" ");if(t[0]!=quakelive.userid||t[1]!=quakelive.siteConfig.premiumStatus){qlHidePrompt(a("div.modal"));
qlPrompt({title:"Mismatched User State Detected",body:"A state mismatch was detected while loading this page. This can occur if your subscription has recently expired, or if you have multiple tabs of QUAKE LIVE open.<br /><br />Please reload this page in order to continue.",fatal:true})}}}catch(z){}k&&k(c,e)};return d.apply(this,arguments)}})(jQuery);
(function(a){var d=a.ajax,b={},k={},c=[],e=[];a.ajaxAbort=function(p){if(b[p]){b[p].abort();k[p].global&&!--jQuery.active&&jQuery.event.trigger("ajaxStop");if(jQuery.active<0)jQuery.active=0}};a.ajax=function(p){p=jQuery.extend(p,jQuery.extend({},jQuery.ajaxSettings,p));var x=p.port;k[x]=p;switch(p.mode){case "abort":if(b[x]){b[x].abort();p.global&&!--jQuery.active&&jQuery.event.trigger("ajaxStop");if(jQuery.active<0)jQuery.active=0}return b[x]=d.apply(this,arguments);case "queue":var t=p.complete;
p.complete=function(){t&&t.apply(this,arguments);jQuery([d]).dequeue("ajax"+x)};jQuery([d]).queue("ajax"+x,function(){d(p)});return;case "sync":var z=c.length;c[z]={error:p.error,success:p.success,complete:p.complete,done:false};e[z]={error:[],success:[],complete:[]};p.error=function(){e[z].error=arguments};p.success=function(){e[z].success=arguments};p.complete=function(){e[z].complete=arguments;c[z].done=true;if(z==0||!c[z-1])for(var r=z;r<c.length&&c[r].done;r++){c[r].error&&c[r].error.apply(jQuery,
e[r].error);c[r].success&&c[r].success.apply(jQuery,e[r].success);c[r].complete&&c[r].complete.apply(jQuery,e[r].complete);c[r]=null;e[r]=null}}}return d.apply(this,arguments)}})(jQuery);
(function(a){var d=function(){},b=function(e){return Math.floor(Math.random()*((2<<e)-1))},k={attempts:16,cutoff:5,delay_func:b,error_codes:[502,503,504],slot_time:1E3,tick:d},c=a.ajax;a.ajaxRetrySettings=k;a.ajaxRetrySetup=function(e){k=a.extend(true,k,e);return a.ajaxRetrySettings=k};a.ajax=function(e){function p(m){if(0>m)c(e);else{window.setTimeout(function(){t.tick({attempts:t.attempts,cutoff:t.cutoff,failures:x,slot_time:t.slot_time,ticks:m})},0);window.setTimeout(function(){p(m-1)},t.slot_time)}}
e=a.extend(true,{},a.ajaxSettings,e);if(!e.retry)return c(e);var x=0,t=a.extend(true,{},a.ajaxRetrySettings,e.retry),z=e.error||d;t.attempts=Math.max(1,Math.min(t.attempts,1024));t.cutoff=Math.max(1,Math.min(t.cutoff,1024));t.slot_time=Math.max(10,Math.min(t.slot_time,1E4));t.tick=t.tick||d;t.delay_func=t.delay_func||b;e.error=function(m,l,q){var u=0<=a.inArray(m.status,t.error_codes);x++;if(!u||x>=t.attempts)window.setTimeout(function(){z(m,l,q)},0);else{var g=(x>=t.cutoff?t.cutoff:x)-1;window.setTimeout(function(){p(t.delay_func(g))},
0)}};var r=c(e);e.xhr=function(){return r};return r}})(jQuery);
(function(a){function d(k){return typeof k=="object"?k:{top:k,left:k}}var b=a.scrollTo=function(k,c,e){b.window().scrollTo(k,c,e)};b.defaults={axis:"y",duration:1};b.window=function(){return a(a.browser.safari?"body":"html")};a.fn.scrollTo=function(k,c,e){if(typeof c=="object"){e=c;c=0}e=a.extend({},b.defaults,e);c=c||e.speed||e.duration;e.queue=e.queue&&e.axis.length>1;if(e.queue)c/=2;e.offset=d(e.offset);e.over=d(e.over);return this.each(function(){function p(u){z.animate(l,c,e.easing,u&&function(){u.call(this,
k)})}function x(u){var g=q?a.browser.opera?document.body:document.documentElement:t;return g["scroll"+u]-g["client"+u]}var t=this,z=a(t),r=k,m,l={},q=z.is("html,body");switch(typeof r){case "number":case "string":if(/^([+-]=)?\d+(px)?$/.test(r)){r=d(r);break}r=a(r,this);case "object":if(r.is||r.style)m=(r=a(r)).offset()}a.each(e.axis.split(""),function(u,g){var o=g=="x"?"Left":"Top",y=o.toLowerCase(),v="scroll"+o,C=t[v],G=g=="x"?"Width":"Height",H=G.toLowerCase();if(m){l[v]=m[y]+(q?0:C-z.offset()[y]);
if(e.margin){l[v]-=parseInt(r.css("margin"+o))||0;l[v]-=parseInt(r.css("border"+o+"Width"))||0}l[v]+=e.offset[y]||0;if(e.over[y])l[v]+=r[H]()*e.over[y]}else l[v]=r[y];if(/^\d+$/.test(l[v]))l[v]=l[v]<=0?0:Math.min(l[v],x(G));if(!u&&e.queue){C!=l[v]&&p(e.onAfterFirst);delete l[v]}});p(e.onAfter)})}})(jQuery);
(function(a){a.fn.jqm=function(m){var l={zIndex:9999999,overlay:50,overlayClass:"jqmOverlay",closeClass:"jqmClose",trigger:".jqModal",ajax:false,target:false,modal:false,toTop:false,onShow:false,onHide:false,onLoad:false};return this.each(function(){if(!this._jqm){d++;this._jqm=d;b[d]={c:a.extend(l,m),a:false,w:a(this).addClass("jqmID"+d),s:d};l.trigger&&a(this).jqmAddTrigger(l.trigger)}})};a.fn.jqmAddClose=function(m){return r(this,m,"jqmHide")};a.fn.jqmAddTrigger=function(m){return r(this,m,"jqmShow")};
a.fn.jqmShow=function(m){return this.each(function(){!b[this._jqm].a&&a.jqm.open(this._jqm,m)})};a.fn.jqmHide=function(m){return this.each(function(){b[this._jqm].a&&a.jqm.close(this._jqm,m)})};a.jqm={hash:{},open:function(m,l){var q=b[m],u=q.c,g="."+u.closeClass,o=/^\d+$/.test(q.w.css("z-index"))&&q.w.css("z-index")||u.zIndex,y=a("<div></div>").css({height:"100%",width:"100%",position:"fixed",left:0,top:0,"z-index":o-1,opacity:u.overlay/100});q.t=l;q.a=true;q.w.css("z-index",o);if(u.modal){!k[0]&&
t("bind");k.push(m);y.css("cursor","wait")}else if(u.overlay>0)q.w.jqmAddClose(y);else y=false;q.o=y?y.addClass(u.overlayClass).prependTo("body"):false;if(c&&a("html,body").css({height:"100%",width:"100%"})&&y){y=y.css({position:"absolute"})[0];for(var v in{Top:1,Left:1})y.style.setExpression(v.toLowerCase(),"(_=(document.documentElement.scroll"+v+" || document.body.scroll"+v+"))+'px'")}if(u.ajax){o=u.target||q.w;y=u.ajax;o=typeof o=="string"?a(o,q.w):a(o);y=y.substr(0,1)=="@"?a(l).attr(y.substring(1)):
y;o.load(y,function(){u.onLoad&&u.onLoad.call(this,q);g&&q.w.jqmAddClose(a(g,q.w));p(q)})}else g&&q.w.jqmAddClose(a(g,q.w));u.toTop&&q.o&&q.w.before('<span id="jqmP'+q.w[0]._jqm+'"></span>').insertAfter(q.o);u.onShow?u.onShow(q):q.w.show();p(q);return false},close:function(m){m=b[m];m.a=false;if(m.c.modal){k.pop();!k[0]&&t("unbind")}m.c.toTop&&m.o&&a("#jqmP"+m.w[0]._jqm).after(m.w).remove();if(m.c.onHide)m.c.onHide(m);else m.w.hide()&&m.o&&m.o.remove();return false}};var d=0,b=a.jqm.hash,k=[],c=a.browser.msie&&
a.browser.version=="6.0",e=a('<iframe src="javascript:false;document.write(\'\');" class="jqm"></iframe>').css({opacity:0}),p=function(m){if(c)m.o&&m.o.html('<p style="width:100%;height:100%"/>').prepend(e)||!a("iframe.jqm",m.w)[0]&&m.w.prepend(e);x(m)},x=function(m){try{a(":input:visible",m.w)[0].focus()}catch(l){}},t=function(m){a()[m]("keypress",z)[m]("keydown",z)[m]("mousedown",z)},z=function(m){var l=b[k[k.length-1]];(m=!a(m.target).parents(".jqmID"+l.s)[0])&&x(l);return!m},r=function(m,l,q){var u=
[];m.each(function(){u.push(this._jqm)});a(l).each(function(){if(this[q])a.extend(this[q],u);else{this[q]=u;a(this).click(function(){for(var g in{jqmShow:1,jqmHide:1})for(var o in this[g])b[this[g][o]]&&b[this[g][o]].w[g](this);return false})}});return m}})(jQuery);
(function(a){a.fn.lightbox=function(d){function b(){a("#lb_overlay").remove();a("#lightbox").remove();u.inprogress=false;if(u.jsonData&&u.jsonData.length>0){var g=u.jsonDataParser?u.jsonDataParser:a.fn.lightbox.parseJsonData;u.imageArray=[];u.imageArray=g(u.jsonData)}g='<div id="outerImageContainer"><div id="imageContainer"><iframe id="lightboxIframe" /><img id="lightboxImage"><div id="hoverNav"><a href="javascript://" title="'+u.strings.prevLinkTitle+'" id="prevLink"></a><a href="javascript://" id="nextLink" title="'+
u.strings.nextLinkTitle+'"></a></div><div id="loading"><a href="javascript://" id="loadingLink"><img src="'+u.fileLoadingImage+'"></a></div></div></div>';var o='<div id="imageDataContainer" class="clearfix"><div id="imageData"><div id="imageDetails"><span id="caption"></span><span id="numberDisplay"></span></div><div id="bottomNav">';if(u.displayHelp)o+='<span id="helpDisplay">'+u.strings.help+"</span>";o+='<a href="javascript://" id="bottomNavClose" title="'+u.strings.closeTitle+'"><img src="'+u.fileBottomNavCloseImage+
'"></a></div></div></div>';if(u.navbarOnTop){g='<div id="lb_overlay"></div><div id="lightbox">'+o+g+"</div>";a("body").append(g);a("#imageDataContainer").addClass("ontop")}else{g='<div id="lb_overlay"></div><div id="lightbox">'+g+o+"</div>";a("body").append(g)}a("#lb_overlay").click(function(){z()}).hide();a("#lightbox").click(function(){z()}).hide();a("#loadingLink").click(function(){z();return false});a("#bottomNavClose").click(function(){z();return false});a("#outerImageContainer").width(u.widthCurrent).height(u.heightCurrent);
a("#imageDataContainer").width(u.widthCurrent);if(!u.imageClickClose){a("#lightboxImage").click(function(){return false});a("#hoverNav").click(function(){return false})}}function k(){return Array(a(document).width(),a(document).height(),a(window).width(),a(window).height())}function c(){var g,o;if(self.pageYOffset){o=self.pageYOffset;g=self.pageXOffset}else if(document.documentElement&&document.documentElement.scrollTop){o=document.documentElement.scrollTop;g=document.documentElement.scrollLeft}else if(document.body){o=
document.body.scrollTop;g=document.body.scrollLeft}return Array(g,o)}function e(g){var o=new Date,y=null;do y=new Date;while(y-o<g)}function p(g){a("select, embed").hide();var o=k();a("#lb_overlay").hide().css({width:"100%",height:o[1]+"px",opacity:u.overlayOpacity}).fadeIn();imageNum=0;if(!u.jsonData){u.imageArray=[];!g.rel||g.rel==""?u.imageArray.push(Array(g.href,u.displayTitle?g.title:"")):a("a").each(function(){if(this.href&&this.rel==g.rel)u.imageArray.push(Array(this.href,u.displayTitle?this.title:
""))})}if(u.imageArray.length>1){for(i=0;i<u.imageArray.length;i++)for(j=u.imageArray.length-1;j>i;j--)u.imageArray[i][0]==u.imageArray[j][0]&&u.imageArray.splice(j,1);for(;u.imageArray[imageNum][0]!=g.href;)imageNum++}var y=c();o=y[1]+o[3]/10;y=y[0];a("#lightbox").css({top:o+"px",left:y+"px"}).show();u.slideNavBar||a("#imageData").hide();x(imageNum)}function x(g){if(u.inprogress==false){u.inprogress=true;u.activeImage=g;a("#loading").show();a("#lightboxImage").hide();a("#hoverNav").hide();a("#prevLink").hide();
a("#nextLink").hide();if(u.slideNavBar){a("#imageDataContainer").hide();a("#imageData").hide()}t()}}function t(){imgPreloader=new Image;imgPreloader.onload=function(){var g=imgPreloader.width,o=imgPreloader.height;if(u.fitToScreen){var y=k(),v=y[2]-2*u.borderSize;y=y[3]-200;if(imgPreloader.height>y){g=parseInt(y/imgPreloader.height*imgPreloader.width);o=y}else if(imgPreloader.width>v){o=parseInt(v/imgPreloader.width*imgPreloader.height);g=v}}a("#lightboxImage").attr("src",u.imageArray[u.activeImage][0]).width(g).height(o);
r(g,o)};imgPreloader.src=u.imageArray[u.activeImage][0]}function z(){q();a("#lightbox").hide();a("#lb_overlay").fadeOut();a("select, object, embed").show()}function r(g,o){u.widthCurrent=a("#outerImageContainer").outerWidth();u.heightCurrent=a("#outerImageContainer").outerHeight();var y=Math.max(350,g+u.borderSize*2),v=o+u.borderSize*2;u.xScale=y/u.widthCurrent*100;u.yScale=v/u.heightCurrent*100;wDiff=u.widthCurrent-y;hDiff=u.heightCurrent-v;a("#imageDataContainer").animate({width:y},u.resizeSpeed,
"linear");a("#outerImageContainer").animate({width:y},u.resizeSpeed,"linear",function(){a("#outerImageContainer").animate({height:v},u.resizeSpeed,"linear",function(){a("#loading").hide();a("#lightboxImage").fadeIn("fast");a("#numberDisplay").html("");u.imageArray[u.activeImage][1]&&a("#caption").html(u.imageArray[u.activeImage][1]).show();if(u.imageArray.length>1){var C;C=u.strings.image+(u.activeImage+1)+u.strings.of+u.imageArray.length;if(!u.disableNavbarLinks){if(u.activeImage>0||u.loopImages)C=
'<a title="'+u.strings.prevLinkTitle+'" href="#" id="prevLinkText">'+u.strings.prevLinkText+"</a>"+C;if(u.activeImage+1<u.imageArray.length||u.loopImages)C+='<a title="'+u.strings.nextLinkTitle+'" href="#" id="nextLinkText">'+u.strings.nextLinkText+"</a>"}a("#numberDisplay").html(C).show()}u.slideNavBar?a("#imageData").slideDown(u.navBarSlideSpeed):a("#imageData").show();C=k();a("#lb_overlay").height(C[1]);m();if(u.loopImages&&u.imageArray.length>1){preloadNextImage=new Image;preloadNextImage.src=
u.imageArray[u.activeImage==u.imageArray.length-1?0:u.activeImage+1][0];preloadPrevImage=new Image;preloadPrevImage.src=u.imageArray[u.activeImage==0?u.imageArray.length-1:u.activeImage-1][0]}else{if(u.imageArray.length-1>u.activeImage){preloadNextImage=new Image;preloadNextImage.src=u.imageArray[u.activeImage+1][0]}if(u.activeImage>0){preloadPrevImage=new Image;preloadPrevImage.src=u.imageArray[u.activeImage-1][0]}}u.inprogress=false})});if(hDiff==0&&wDiff==0)jQuery.browser.msie?e(250):e(100);a("#prevLink").height(o);
a("#nextLink").height(o)}function m(){if(u.imageArray.length>1){a("#hoverNav").show();if(u.loopImages){a("#prevLink,#prevLinkText").show().click(function(){x(u.activeImage==0?u.imageArray.length-1:u.activeImage-1);return false});a("#nextLink,#nextLinkText").show().click(function(){x(u.activeImage==u.imageArray.length-1?0:u.activeImage+1);return false})}else{u.activeImage!=0&&a("#prevLink,#prevLinkText").show().click(function(){x(u.activeImage-1);return false});u.activeImage!=u.imageArray.length-1&&
a("#nextLink,#nextLinkText").show().click(function(){x(u.activeImage+1);return false})}a(document).bind("keydown",{opts:u},l)}}function l(g){var o=g.data.opts;g=g.keyCode;var y=String.fromCharCode(g).toLowerCase();if(y=="x"||y=="o"||y=="c"||g==27)z();else if(y=="p"||g==37)if(o.loopImages){q();x(o.activeImage==0?o.imageArray.length-1:o.activeImage-1)}else{if(o.activeImage!=0){q();x(o.activeImage-1)}}else if(y=="n"||g==39)if(u.loopImages){q();x(o.activeImage==o.imageArray.length-1?0:o.activeImage+1)}else if(o.activeImage!=
o.imageArray.length-1){q();x(o.activeImage+1)}}function q(){a(document).unbind("keydown")}var u=a.extend({},a.fn.lightbox.defaults,d);return this.each(function(){a(this).click(function(){b();p(this);return false})})};a.fn.lightbox.parseJsonData=function(d){var b=[];a.each(d,function(){b.push(Array(this.url,this.title))});return b};a.fn.lightbox.defaults={fileLoadingImage:"images/loader.gif",fileBottomNavCloseImage:"images/lightbox/closelabel.gif",overlayOpacity:0.8,borderSize:10,imageArray:[],activeImage:null,
inprogress:false,resizeSpeed:350,widthCurrent:250,heightCurrent:250,xScale:1,yScale:1,displayTitle:true,navbarOnTop:false,slideNavBar:false,navBarSlideSpeed:350,displayHelp:false,strings:{help:" \u2190 / P - previous image\u00a0\u00a0\u00a0\u00a0\u2192 / N - next image\u00a0\u00a0\u00a0\u00a0ESC / X - close image gallery",prevLinkTitle:"previous image",nextLinkTitle:"next image",prevLinkText:"&laquo; Previous",nextLinkText:"Next &raquo;",closeTitle:"close image gallery",image:"Image ",of:" of "},
fitToScreen:true,disableNavbarLinks:false,loopImages:false,imageClickClose:true,jsonData:null,jsonDataParser:null}})(jQuery);
(function(a){a.fn.superfish=function(b){var k=a.fn.superfish,c=k.c,e=a(['<span class="',c.arrowClass,'"></span>'].join("")),p=function(){var z=a(this),r=t(z);clearTimeout(r.sfTimer);z.showSuperfishUl().siblings().hideSuperfishUl()},x=function(){var z=a(this),r=t(z),m=k.op;clearTimeout(r.sfTimer);r.sfTimer=setTimeout(function(){m.retainPath=a.inArray(z[0],m.$path)>-1;z.hideSuperfishUl();m.$path.length&&z.parents(["li.",m.hoverClass].join("")).length<1&&p.call(m.$path)},m.delay)},t=function(z){z=z.parents(["ul.",
c.menuClass,":first"].join(""))[0];k.op=k.o[z.serial];return z};return this.each(function(){var z=this.serial=k.o.length,r=a.extend({},k.defaults,b);r.$path=a("li."+r.pathClass,this).slice(0,r.pathLevels).each(function(){a(this).addClass([r.hoverClass,c.bcClass].join(" ")).filter("li:has(ul)").removeClass(r.pathClass)});k.o[z]=k.op=r;a("li:not(:has(ul))",this).hover(p,x);a("li:has(ul)",this)[a.fn.hoverIntent&&!r.disableHI?"hoverIntent":"hover"](p,x).each(function(){r.autoArrows&&a(">a:first-child",
this).addClass(c.anchorClass).append(e.clone())}).not("."+c.bcClass).hideSuperfishUl();var m=a("a",this);m.each(function(l){var q=m.eq(l).parents("li");m.eq(l).focus(function(){p.call(q)}).blur(function(){x.call(q)})});r.onInit.call(this)}).each(function(){var z=[c.menuClass];k.op.dropShadows&&!(a.browser.msie&&a.browser.version<7)&&z.push(c.shadowClass);a(this).addClass(z.join(" "))})};var d=a.fn.superfish;d.o=[];d.op={};d.IE7fix=function(){var b=d.op;a.browser.msie&&a.browser.version>6&&b.dropShadows&&
b.animation.opacity!=undefined&&this.toggleClass(d.c.shadowClass+"-off")};d.c={bcClass:"sf-breadcrumb",menuClass:"sf-js-enabled",anchorClass:"sf-with-ul",arrowClass:"sf-sub-indicator",shadowClass:"sf-shadow"};d.defaults={hoverClass:"sfHover",pathClass:"overideThisToUse",pathLevels:1,delay:800,animation:{opacity:"show"},speed:"normal",autoArrows:true,dropShadows:true,disableHI:false,onInit:function(){},onBeforeShow:function(){},onShow:function(){},onHide:function(){}};a.fn.extend({hideSuperfishUl:function(){var b=
d.op,k=b.retainPath===true?b.$path:"";b.retainPath=false;k=a(["li.",b.hoverClass].join(""),this).add(this).not(k).removeClass(b.hoverClass).find(">ul").hide().css("visibility","hidden");b.onHide.call(k);return this},showSuperfishUl:function(){var b=d.op,k=this.addClass(b.hoverClass).find(">ul:hidden").css("visibility","visible");d.IE7fix.call(k);b.onBeforeShow.call(k);k.animate(b.animation,b.speed,function(){d.IE7fix.call(k);b.onShow.call(k)});return this}})})(jQuery);
(function(a){a.extend({tablesorter:new (function(){function b(F,J){k(F+","+((new Date).getTime()-J.getTime())+"ms")}function k(F){typeof console!="undefined"&&typeof console.debug!="undefined"||alert(F)}function c(F,J){if(F.config.debug)var Q="";var aa=F.tBodies[0].rows;if(F.tBodies[0].rows[0]){var ca=[];aa=aa[0].cells;for(var qa=aa.length,ja=0;ja<qa;ja++){var ga=false;if(a.metadata&&a(J[ja]).metadata()&&a(J[ja]).metadata().sorter)ga=e(a(J[ja]).metadata().sorter);else if(F.config.headers[ja]&&F.config.headers[ja].sorter)ga=
e(F.config.headers[ja].sorter);if(!ga)a:{ga=F;for(var ma=aa[ja],ka=G.length,S=1;S<ka;S++)if(G[S].is(a.trim(x(ga.config,ma)),ga,ma)){ga=G[S];break a}ga=G[0]}if(F.config.debug)Q+="column:"+ja+" parser:"+ga.id+"\n";ca.push(ga)}}F.config.debug&&k(Q);return ca}function e(F){for(var J=G.length,Q=0;Q<J;Q++)if(G[Q].id.toLowerCase()==F.toLowerCase())return G[Q];return false}function p(F){if(F.config.debug)var J=new Date;for(var Q=F.tBodies[0]&&F.tBodies[0].rows.length||0,aa=F.tBodies[0].rows[0]&&F.tBodies[0].rows[0].cells.length||
0,ca=F.config.parsers,qa={row:[],normalized:[]},ja=0;ja<Q;++ja){var ga=F.tBodies[0].rows[ja],ma=[];qa.row.push(a(ga));for(var ka=0;ka<aa;++ka)ma.push(ca[ka].format(x(F.config,ga.cells[ka]),F,ga.cells[ka]));ma.push(ja);qa.normalized.push(ma)}F.config.debug&&b("Building cache for "+Q+" rows:",J);return qa}function x(F,J){if(!J)return"";var Q="";return Q=F.textExtraction=="simple"?J.childNodes[0]&&J.childNodes[0].hasChildNodes()?J.childNodes[0].innerHTML:J.innerHTML:typeof F.textExtraction=="function"?
F.textExtraction(J):a(J).text()}function t(F,J){if(F.config.debug)var Q=new Date;for(var aa=J.row,ca=J.normalized,qa=ca.length,ja=ca[0].length-1,ga=a(F.tBodies[0]),ma=[],ka=0;ka<qa;ka++){ma.push(aa[ca[ka][ja]]);if(!F.config.appender)for(var S=aa[ca[ka][ja]],fa=S.length,ha=0;ha<fa;ha++)ga[0].appendChild(S[ha])}F.config.appender&&F.config.appender(F,ma);ma=null;F.config.debug&&b("Rebuilt table:",Q);r(F);setTimeout(function(){a(F).trigger("sortEnd")},0)}function z(F){if(F.config.debug)var J=new Date;
for(var Q=[],aa=0;aa<F.tHead.rows.length;aa++)Q[aa]=0;$tableHeaders=a("thead th",F);$tableHeaders.each(function(ca){this.count=0;this.column=ca;var qa=F.config.sortInitialOrder;this.order=i=typeof qa!="Number"?qa.toLowerCase()=="desc"?1:0:qa==1?qa:0;if(!(qa=a.metadata&&a(this).metadata().sorter===false?true:false))qa=F.config.headers[ca]&&F.config.headers[ca].sorter===false?true:false;if(qa)this.sortDisabled=true;this.sortDisabled||a(this).addClass(F.config.cssHeader);F.config.headerList[ca]=this});
if(F.config.debug){b("Built headers:",J);k($tableHeaders)}return $tableHeaders}function r(F){for(var J=F.config.widgets,Q=J.length,aa=0;aa<Q;aa++)m(J[aa]).format(F)}function m(F){for(var J=H.length,Q=0;Q<J;Q++)if(H[Q].id.toLowerCase()==F.toLowerCase())return H[Q]}function l(F,J){for(var Q=J.length,aa=0;aa<Q;aa++)if(J[aa][0]==F)return true;return false}function q(F,J,Q,aa){J.removeClass(aa[0]).removeClass(aa[1]);var ca=[];J.each(function(){this.sortDisabled||(ca[this.column]=a(this))});F=Q.length;
for(J=0;J<F;J++)ca[Q[J][0]].addClass(aa[Q[J][1]])}function u(F){if(F.config.widthFixed){var J=a("<colgroup>");a("tr:first td",F.tBodies[0]).each(function(){J.append(a("<col>").css("width",a(this).width()))});a(F).prepend(J)}}function g(F,J){return F<J?-1:F>J?1:0}function o(F,J){return J<F?-1:J>F?1:0}function y(F,J){return F-J}function v(F,J){return J-F}function C(F,J,Q){if(F.config.debug)var aa=new Date;for(var ca="var sortWrapper = function(a,b) {",qa=J.length,ja=0;ja<qa;ja++){var ga=J[ja][0],ma=
J[ja][1],ka="e"+ja;ca+="var "+ka+" = "+(F.config.parsers[ga].type=="text"?ma==0?g:o:ma==0?y:v)+"(a["+ga+"],b["+ga+"]); ";ca+="if("+ka+") { return "+ka+"; } ";ca+="else { "}ja=Q.normalized[0].length-1;ca+="return a["+ja+"]-b["+ja+"];";for(ja=0;ja<qa;ja++)ca+="}; ";ca+="return 0; ";ca+="}; ";eval(ca);Q.normalized.sort(sortWrapper);F.config.debug&&b("Sorting on "+J.toString()+" and dir "+ma+" time:",aa);return Q}var G=[],H=[];this.defaults={cssHeader:"header",cssAsc:"headerSortUp",cssDesc:"headerSortDown",
sortInitialOrder:"asc",sortMultiSortKey:"shiftKey",sortForce:null,sortAppend:null,textExtraction:"simple",parsers:{},widgets:[],widgetZebra:{css:["even","odd"]},headers:{},widthFixed:false,cancelSelection:true,sortList:[],headerList:[],dateFormat:"us",decimal:".",debug:false};this.benchmark=b;this.construct=function(F){return this.each(function(){if(this.tHead&&this.tBodies){var J,Q,aa,ca;this.config={};ca=a.extend(this.config,a.tablesorter.defaults,F);J=a(this);Q=z(this);this.config.parsers=c(this,
Q);aa=p(this);var qa=[ca.cssDesc,ca.cssAsc];u(this);Q.click(function(ja){J.trigger("sortStart");var ga=J[0].tBodies[0]&&J[0].tBodies[0].rows.length||0;if(!this.sortDisabled&&ga>0){a(this);ga=this.column;this.order=this.count++%2;if(ja[ca.sortMultiSortKey])if(l(ga,ca.sortList))for(ja=0;ja<ca.sortList.length;ja++){var ma=ca.sortList[ja],ka=ca.headerList[ma[0]];if(ma[0]==ga){ka.count=ma[1];ka.count++;ma[1]=ka.count%2}}else ca.sortList.push([ga,this.order]);else{ca.sortList=[];if(ca.sortForce!=null){ma=
ca.sortForce;for(ja=0;ja<ma.length;ja++)ma[ja][0]!=ga&&ca.sortList.push(ma[ja])}ca.sortList.push([ga,this.order])}setTimeout(function(){q(J[0],Q,ca.sortList,qa);t(J[0],C(J[0],ca.sortList,aa))},1);return false}}).mousedown(function(){if(ca.cancelSelection){this.onselectstart=function(){return false};return false}});J.bind("update",function(){this.config.parsers=c(this,Q);aa=p(this)}).bind("sorton",function(ja,ga){a(this).trigger("sortStart");ca.sortList=ga;for(var ma=ca.sortList,ka=this.config,S=ma.length,
fa=0;fa<S;fa++){var ha=ma[fa],O=ka.headerList[ha[0]];O.count=ha[1];O.count++}q(this,Q,ma,qa);t(this,C(this,ma,aa))}).bind("appendCache",function(){t(this,aa)}).bind("applyWidgetId",function(ja,ga){m(ga).format(this)}).bind("applyWidgets",function(){r(this)});if(a.metadata&&a(this).metadata()&&a(this).metadata().sortlist)ca.sortList=a(this).metadata().sortlist;ca.sortList.length>0&&J.trigger("sorton",[ca.sortList]);r(this)}})};this.addParser=function(F){for(var J=G.length,Q=true,aa=0;aa<J;aa++)if(G[aa].id.toLowerCase()==
F.id.toLowerCase())Q=false;Q&&G.push(F)};this.addWidget=function(F){H.push(F)};this.formatFloat=function(F){F=parseFloat(F);return isNaN(F)?0:F};this.formatInt=function(F){F=parseInt(F);return isNaN(F)?0:F};this.isDigit=function(F,J){var Q="\\"+J.decimal;return RegExp("/(^[+]?0("+Q+"0+)?$)|(^([-+]?[1-9][0-9]*)$)|(^([-+]?((0?|[1-9][0-9]*)"+Q+"(0*[1-9][0-9]*)))$)|(^[-+]?[1-9]+[0-9]*"+Q+"0+$)/").test(a.trim(F))};this.clearTableBody=function(F){if(a.browser.msie)(function(){for(;this.firstChild;)this.removeChild(this.firstChild)}).apply(F.tBodies[0]);
else F.tBodies[0].innerHTML=""}})});a.fn.extend({tablesorter:a.tablesorter.construct});var d=a.tablesorter;d.addParser({id:"text",is:function(){return true},format:function(b){return a.trim(b.toLowerCase())},type:"text"});d.addParser({id:"digit",is:function(b,k){return a.tablesorter.isDigit(b,k.config)},format:function(b){return a.tablesorter.formatFloat(b)},type:"numeric"});d.addParser({id:"currency",is:function(b){return/^[\u00a3$\u20ac?.]/.test(b)},format:function(b){return a.tablesorter.formatFloat(b.replace(RegExp(/[^0-9.]/g),
""))},type:"numeric"});d.addParser({id:"ipAddress",is:function(b){return/^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/.test(b)},format:function(b){b=b.split(".");for(var k="",c=b.length,e=0;e<c;e++){var p=b[e];k+=p.length==2?"0"+p:p}return a.tablesorter.formatFloat(k)},type:"numeric"});d.addParser({id:"url",is:function(b){return/^(https?|ftp|file):\/\/$/.test(b)},format:function(b){return jQuery.trim(b.replace(RegExp(/(https?|ftp|file):\/\//),""))},type:"text"});d.addParser({id:"isoDate",is:function(b){return/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(b)},
format:function(b){return a.tablesorter.formatFloat(b!=""?(new Date(b.replace(RegExp(/-/g),"/"))).getTime():"0")},type:"numeric"});d.addParser({id:"percent",is:function(b){return/\%$/.test(a.trim(b))},format:function(b){return a.tablesorter.formatFloat(b.replace(RegExp(/%/g),""))},type:"numeric"});d.addParser({id:"usLongDate",is:function(b){return b.match(RegExp(/^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/))},format:function(b){return a.tablesorter.formatFloat((new Date(b)).getTime())},
type:"numeric"});d.addParser({id:"shortDate",is:function(b){return/\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}/.test(b)},format:function(b,k){var c=k.config;b=b.replace(/\-/g,"/");if(c.dateFormat=="us")b=b.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$1/$2");else if(c.dateFormat=="uk")b=b.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$2/$1");else if(c.dateFormat=="dd/mm/yy"||c.dateFormat=="dd-mm-yy")b=b.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/,"$1/$2/$3");return a.tablesorter.formatFloat((new Date(b)).getTime())},
type:"numeric"});d.addParser({id:"time",is:function(b){return/^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/.test(b)},format:function(b){return a.tablesorter.formatFloat((new Date("2000/01/01 "+b)).getTime())},type:"numeric"});d.addParser({id:"metadata",is:function(){return false},format:function(b,k,c){b=k.config;b=!b.parserMetadataName?"sortValue":b.parserMetadataName;return a(c).metadata()[b]},type:"numeric"});d.addWidget({id:"zebra",format:function(b){if(b.config.debug)var k=
new Date;a("tr:visible",b.tBodies[0]).filter(":even").removeClass(b.config.widgetZebra.css[1]).addClass(b.config.widgetZebra.css[0]).end().filter(":odd").removeClass(b.config.widgetZebra.css[0]).addClass(b.config.widgetZebra.css[1]);b.config.debug&&a.tablesorter.benchmark("Applying Zebra widget",k)}})})(jQuery);
(function(a){a.fn.hoverIntent=function(d,b){var k={sensitivity:7,interval:100,timeout:0};k=a.extend(k,b?{over:d,out:b}:d);var c,e,p,x,t=function(m){c=m.pageX;e=m.pageY},z=function(m,l){l.hoverIntent_t=clearTimeout(l.hoverIntent_t);if(Math.abs(p-c)+Math.abs(x-e)<k.sensitivity){a(l).unbind("mousemove",t);l.hoverIntent_s=1;return k.over.apply(l,[m])}else{p=c;x=e;l.hoverIntent_t=setTimeout(function(){z(m,l)},k.interval)}},r=function(m){for(var l=(m.type=="mouseover"?m.fromElement:m.toElement)||m.relatedTarget;l&&
l!=this;)try{l=l.parentNode}catch(q){l=this}if(l==this)return false;var u=jQuery.extend({},m),g=this;if(g.hoverIntent_t)g.hoverIntent_t=clearTimeout(g.hoverIntent_t);if(m.type=="mouseover"){p=u.pageX;x=u.pageY;a(g).bind("mousemove",t);if(g.hoverIntent_s!=1)g.hoverIntent_t=setTimeout(function(){z(u,g)},k.interval)}else{a(g).unbind("mousemove",t);if(g.hoverIntent_s==1)g.hoverIntent_t=setTimeout(function(){g.hoverIntent_t=clearTimeout(g.hoverIntent_t);g.hoverIntent_s=0;k.out.apply(g,[u])},k.timeout)}};
return this.mouseover(r).mouseout(r)}})(jQuery);
(function(a){function d(b,k){return parseInt(a.css(b[0],k))||0}a.fn.jCarouselLite=function(b){b=a.extend({btnPrev:null,btnNext:null,btnGo:null,mouseWheel:false,auto:null,speed:200,easing:null,vertical:false,circular:true,visible:3,start:0,scroll:1,beforeStart:null,afterEnd:null},b||{});return this.each(function(){function k(){y&&clearTimeout(y);y=setTimeout(function(){c(g+b.scroll)},b.auto+b.speed)}function c(v){if(!e){b.auto&&k();b.beforeStart&&b.beforeStart.call(this,q.slice(g).slice(0,l),g);if(b.circular)if(v<=
b.start-l-1){z.css(p,-((u-l*2)*o)+"px");g=v==b.start-l-1?u-l*2-1:u-l*2-b.scroll}else if(v>=u-l+1){z.css(p,-(l*o)+"px");g=v==u-l+1?l+1:l+b.scroll}else g=v;else if(v<0||v>u-l)return;else g=v;e=true;z.animate(p=="left"?{left:-(g*o)}:{top:-(g*o)},b.speed,b.easing,function(){b.afterEnd&&b.afterEnd.call(this,q.slice(g).slice(0,l),g);e=false});if(!b.circular){a(b.btnPrev+","+b.btnNext).removeClass("disabled");a(g-b.scroll<0&&b.btnPrev||g+b.scroll>u-l&&b.btnNext||[]).addClass("disabled")}}return false}var e=
false,p=b.vertical?"top":"left",x=b.vertical?"height":"width",t=a(this),z=a("ul",t),r=a("li",z),m=r.size(),l=b.visible;if(b.circular){z.prepend(r.slice(m-l-1+1).clone()).append(r.slice(0,l).clone());b.start+=l}var q=a("li",z),u=q.size(),g=b.start;t.css("visibility","visible");q.css({overflow:"hidden","float":b.vertical?"none":"left"});z.css({margin:"0",padding:"0",position:"relative","list-style-type":"none","z-index":"1"});t.css({overflow:"hidden",position:"relative","z-index":"2",left:"0px"});var o=
b.vertical?q[0].offsetHeight+d(q,"marginTop")+d(q,"marginBottom"):q[0].offsetWidth+d(q,"marginLeft")+d(q,"marginRight");r=o*u;m=o*l;var y=null;q.css({width:q.width(),height:q.height()});z.css(x,r+"px").css(p,-(g*o));t.css(x,m+"px");b.btnPrev&&a(b.btnPrev).click(function(){return c(g-b.scroll)});b.btnNext&&a(b.btnNext).click(function(){return c(g+b.scroll)});b.btnGo&&a.each(b.btnGo,function(v,C){a(C).click(function(){return c(b.circular?b.visible+v:v)})});b.mouseWheel&&t.mousewheel&&t.mousewheel(function(v,
C){return C>0?c(g-b.scroll):c(g+b.scroll)});b.auto&&k()})}})(jQuery);
jQuery&&function(){$.extend($.fn,{contextMenu:function(a,d){if(a.menu==undefined)return false;if(a.inSpeed==undefined)a.inSpeed=150;if(a.outSpeed==undefined)a.outSpeed=75;if(a.inSpeed==0)a.inSpeed=-1;if(a.outSpeed==0)a.outSpeed=-1;$(this).each(function(){var b=$(this),k=$(b).offset();$("#"+a.menu).addClass("contextMenu");$(this).mousedown(function(c){c.stopPropagation();$(this).mouseup(function(e){e.stopPropagation();var p=$(this);$(this).unbind("mouseup");if(c.button==2){$(".contextMenu").hide();
var x=$("#"+a.menu);if($(b).hasClass("disabled"))return false;var t={},z,r;if(self.innerHeight){t.pageYOffset=self.pageYOffset;t.pageXOffset=self.pageXOffset;t.innerHeight=self.innerHeight;t.innerWidth=self.innerWidth}else if(document.documentElement&&document.documentElement.clientHeight){t.pageYOffset=document.documentElement.scrollTop;t.pageXOffset=document.documentElement.scrollLeft;t.innerHeight=document.documentElement.clientHeight;t.innerWidth=document.documentElement.clientWidth}else if(document.body){t.pageYOffset=
document.body.scrollTop;t.pageXOffset=document.body.scrollLeft;t.innerHeight=document.body.clientHeight;t.innerWidth=document.body.clientWidth}e.pageX?z=e.pageX:z=e.clientX+t.scrollLeft;e.pageY?r=e.pageY:z=e.clientY+t.scrollTop;a.onBeforeShow&&a.onBeforeShow($(x));$(document).unbind("click");$(x).css({top:r,left:z}).fadeIn(a.inSpeed);$(x).find("A").mouseover(function(){$(x).find("LI.hover").removeClass("hover");$(this).parent().addClass("hover")}).mouseout(function(){$(x).find("LI.hover").removeClass("hover")});
$(document).keypress(function(m){switch(m.keyCode){case 38:if($(x).find("LI.hover").size()==0)$(x).find("LI:last").addClass("hover");else{$(x).find("LI.hover").removeClass("hover").prevAll("LI:not(.disabled)").eq(0).addClass("hover");$(x).find("LI.hover").size()==0&&$(x).find("LI:last").addClass("hover")}break;case 40:if($(x).find("LI.hover").size()==0)$(x).find("LI:first").addClass("hover");else{$(x).find("LI.hover").removeClass("hover").nextAll("LI:not(.disabled)").eq(0).addClass("hover");$(x).find("LI.hover").size()==
0&&$(x).find("LI:first").addClass("hover")}break;case 13:$(x).find("LI.hover A").trigger("click");break;case 27:$(document).trigger("click");break}});$("#"+a.menu).find("A").unbind("click");$("#"+a.menu).find("LI:not(.disabled) A").click(function(){$(document).unbind("click").unbind("keypress");$(".contextMenu").hide();d&&d($(this).attr("href").substr(1),$(p),{x:z-k.left,y:r-k.top,docX:z,docY:r});return false});setTimeout(function(){$(document).click(function(){$(document).unbind("click").unbind("keypress");
$(x).fadeOut(a.outSpeed);return false})},0)}})});if($.browser.mozilla)$("#"+a.menu).each(function(){$(this).css({MozUserSelect:"none"})});else $.browser.msie?$("#"+a.menu).each(function(){$(this).bind("selectstart.disableTextSelect",function(){return false})}):$("#"+a.menu).each(function(){$(this).bind("mousedown.disableTextSelect",function(){return false})});$(b).add($("UL.contextMenu")).bind("contextmenu",function(){return false})});return $(this)},disableContextMenuItems:function(a){if(a==undefined){$(this).find("LI").addClass("disabled");
return $(this)}$(this).each(function(){if(a!=undefined)for(var d=a.split(","),b=0;b<d.length;b++)$(this).find('A[href="'+d[b]+'"]').parent().addClass("disabled")});return $(this)},enableContextMenuItems:function(a){if(a==undefined){$(this).find("LI.disabled").removeClass("disabled");return $(this)}$(this).each(function(){if(a!=undefined)for(var d=a.split(","),b=0;b<d.length;b++)$(this).find('A[href="'+d[b]+'"]').parent().removeClass("disabled")});return $(this)},disableContextMenu:function(){$(this).each(function(){$(this).addClass("disabled")});
return $(this)},enableContextMenu:function(){$(this).each(function(){$(this).removeClass("disabled")});return $(this)},destroyContextMenu:function(){$(this).each(function(){$(this).unbind("mousedown").unbind("mouseup")});return $(this)}})}(jQuery);
(function(a,d){function b(M,W){for(var ea=0,na=M.length;ea<na;ea++)if(W(M[ea])===false)return}function k(M){return Object.prototype.toString.call(M)==="[object Function]"}function c(M,W){var ea=false;b(M,function(na){return!(ea=W(na))});return ea}function e(M){this._queue=[];this._children=[];(this._parent=M)&&M._addChild(this)}function p(M){if(M)return new e(M);e.call(this);this.paused=0}function x(){}function t(M){b(M,function(W){var ea=F.getElementById(W.id);if(ea){b(W.el.childNodes,function(na){ea.appendChild(na)});
ea.contentWindow&&d.setTimeout(function(){W.el.contentWindow.document.copyTo(ea.contentWindow.document)},1);a.copyAttrs(W.el,ea)}else Q("<proxyGetElementById - finish>","no element in writen markup with id "+W.id)})}function z(M,W){if(W&&W[M]===false)return false;return W&&W[M]||X[M]}function r(M,W){function ea(za){var Ca=F.createElement("div");la.push({id:za,el:Ca});Ca.contentWindow={document:new x};return Ca}function na(za){var Ca=a.$(M.target),Ja=F.createElement("div");Ca.parentNode.insertBefore(Ja,
Ca);a.replaceWith(Ja,ta.out);ta.out="";return J?ta.getEl.call(F,za):ta.getEl(za)}function sa(za){return(J?ta.getEl.call(F,za):ta.getEl(za))||findEl(za)}var la=[],pa=z("proxyGetElementById",W),ua=z("writeOnGetElementById",W),ta={write:F.write,writeln:F.writeln,finish:function(){},out:""};M.state=ta;F.write=function(za){ta.out+=za};F.writeln=function(za){ta.out+=za+"\n"};if(pa||ua){ta.getEl=F.getElementById;F.getElementById=sa;if(ua)findEl=na;else{findEl=ea;ta.finish=function(){t(la)}}}return ta}function m(M){F.write=
M.write;F.writeln=M.writeln;if(M.getEl)F.getElementById=M.getEl;return M.out}function l(){}function q(){}function u(M,W,ea){W=r(W,ea);try{var na=M&&M.replace(/^\s*<!(\[CDATA\[|--)/,"").replace(/(\]\]|--)>\s*$/,""),sa=F.createElement("div");F.body.insertBefore(sa,null);a.replaceWith(sa,'<script type="text/javascript">'+na+"<\/script>")}catch(la){Q(M,la)}finally{m(W)}return W}function g(M){return(M=/^(\w+:)?\/\/([^\/?#]+)/.exec(M))&&(M[1]&&M[1]!=location.protocol||M[2]!=location.host)}function o(M){return RegExp(M+
"=(?:([\"'])([\\s\\S]*?)\\1|([^\\s>]+))","i")}function y(M){var W=o(M);return function(ea){ea=W.exec(ea)||[];return ea[2]||ea[3]}}function v(M,W){var ea;if(k(M)){ea=M;M=null}M=M||{};ea=ea||M&&M.done;M.done=W?function(){W(ea)}:ea;return M}function C(M){var W=(++ha).toString();S[W]=function(){M();delete S[W]};return W}function G(M){return fa.replace(/%d/,C(M))}function H(M,W,ea,na){var sa=ea&&new p(ea)||O;W=v(W);var la=z("done",W);ea="";var pa=z("fixUrls",W);k(pa)||(pa=function(ua){return ua});if(k(la))ea=
G(function(){sa.push(la)});return M.replace(aa,function(ua,ta,za){function Ca(){Sa(za)}function Ja(){a.ajax({url:Fa,type:"GET",dataType:"text",async:false,success:function(Da){Sa(Da)}})}function Qa(Da,Ha,La){Q("<XHR for "+Fa+">",La);sa.resume()}function Ua(){return G(function(){sa.resume()})}function Va(){var Da,Ha;a.ajax({url:Fa,type:"GET",dataType:"text",async:true,success:function(La){if(Da)try{Sa(La,Ua())}catch(cb){Q(La,cb)}else Ha=La},error:Qa});return function(){Da=true;Ha?Sa(Ha):sa.pause()}}
function Ya(){var Da=r(Pa,W);sa.pause();R("pause",Fa);a.ajax({url:Fa,type:"GET",dataType:"script",success:function(){R("out",Fa,Da.out);$a(m(Da),G(Da.finish)+Ua());R("resume",Fa)},error:Qa})}function Sa(Da,Ha){var La=u(Da,Pa,W);Ha=G(La.finish)+(Ha||"");$a(La.out,Ha)}function $a(Da,Ha){a.replaceWith(Pa.target,H(Da,null,sa,Pa)+(Ha||""))}var Fa=qa(ta),Ka=ja(ta)||"",Xa=ga(ta)||"";Ka=!Ka&&!Xa||Ka.toLowerCase().indexOf("javascript")!==-1||Xa.toLowerCase().indexOf("javascript")!==-1;R("replace",Fa,ua);if(!Ka)return ua;
ua=C(function(){sa.push(Oa)});Ka=ma+ua;var Oa,Pa={target:"#"+Ka,parent:na};if(Fa){Fa=pa(Fa);ta=ta.replace(ca,"");Oa=g(Fa)?Ya:z("asyncAll",W)?Va():Ja}else Oa=Ca;return'<div style="display: none" id="'+Ka+'"></div>'+ta+ka.replace(/%d/,ua)+"<\/script>"})+ea}var F=d.document;a=a||function(M){return{ajax:M.ajax,$:function(W){return M(W)[0]},replaceWith:function(W,ea){var na=M(W)[0],sa=na.nextSibling,la=na.parentNode;M(na).remove();sa?M(sa).before(ea):M(la).append(ea)},onLoad:function(W){M(W)},copyAttrs:function(W,
ea){for(var na=M(ea),sa=W.attributes,la=0,pa=sa.length;la<pa;la++)if(sa[la]&&sa[la].value)try{na.attr(sa[la].name,sa[la].value)}catch(ua){}}}}(d.jQuery);a.copyAttrs=a.copyAttrs||function(){};a.onLoad=a.onLoad||function(){throw"error: autoAsync cannot be used without jQuery or defining writeCaptureSupport.onLoad";};e.prototype={_addChild:function(M){this._children.push(M)},push:function(M){this._queue.push(M);this._bubble("_doRun")},pause:function(){this._bubble("_doPause")},resume:function(){this._bubble("_doResume")},
_bubble:function(M){for(var W=this;!W[M];)W=W._parent;return W[M]()},_next:function(){if(c(this._children,function(W){return W._next()}))return true;var M=this._queue.shift();M&&M();return!!M}};p.prototype=function(){function M(){}M.prototype=e.prototype;return new M}();p.prototype._doRun=function(){if(!this.running){this.running=true;try{for(;this.paused<1&&this._next(););}finally{this.running=false}}};p.prototype._doPause=function(){this.paused++};p.prototype._doResume=function(){this.paused--;
this._doRun()};x.prototype={_html:"",open:function(){this._opened=true;this._delegate&&this._delegate.open()},write:function(M){if(!this._closed){this._written=true;if(this._delegate)this._delegate.write(M);else this._html+=M}},writeln:function(M){this.write(M+"\n")},close:function(){this._closed=true;this._delegate&&this._delegate.close()},copyTo:function(M){this._delegate=M;M.foobar=true;this._opened&&M.open();this._written&&M.write(this._html);this._closed&&M.close()}};var J=function(){var M={f:F.getElementById};
try{M.f.call(F,"abc");return true}catch(W){return false}}(),Q=k(d.console&&console.error)?q:l,aa=/(<script[\s\S]*?>)([\s\S]*?)<\/script>/ig,ca=o("src"),qa=y("src"),ja=y("type"),ga=y("language"),ma="__document_write_ajax_div-",ka="window['__document_write_ajax_callbacks__']['%d']();",S=d.__document_write_ajax_callbacks__={},fa='<script type="text/javascript">'+ka+"<\/script>",ha=0,O=new p,P=[],R=window._debugWriteCapture?function(){}:function(M,W,ea){P.push({type:M,src:W,data:ea})},X=d.writeCapture=
{_original:d.writeCapture,fixUrls:function(M){return M.replace(/&amp;/g,"&")},noConflict:function(){d.writeCapture=this._original;return this},debug:P,proxyGetElementById:false,_forTest:{Q:p,GLOBAL_Q:O,$:a,matchAttr:y,slice:function(M,W,ea){return Array.prototype.slice.call(M,W||0,ea||M&&M.length)},capture:r,uncapture:m,captureWrite:u},replaceWith:function(M,W,ea){a.replaceWith(M,H(W,ea))},html:function(M,W,ea){M=a.$(M);M.innerHTML="<span/>";a.replaceWith(M.firstChild,H(W,ea))},load:function(M,W,
ea){a.ajax({url:W,dataType:"text",type:"GET",success:function(na){X.html(M,na,ea)}})},autoAsync:function(M){var W=F.write,ea=F.writeln,na,sa=[];F.writeln=function(pa){F.write(pa+"\n")};var la;F.write=function(pa){var ua;for(var ta=ua=F.body;ta&&ta.nodeType===1;){ua=ta;for(ta=ta.lastChild;ta&&ta.nodeType!==1;)ta=ta.previousSibling}ua=ua;if(ua!==na){na=ua;sa.push(la={el:ua,out:[]})}la.out.push(pa)};a.onLoad(function(){var pa,ua,ta;M=v(M);ta=M.done;M.done=function(){F.write=W;F.writeln=ea;ta&&ta()};
for(var za=0,Ca=sa.length;za<Ca;za++){pa=sa[za].el;ua=F.createElement("div");pa.parentNode.insertBefore(ua,pa.nextSibling);pa=sa[za].out.join("");pa=Ca-za===1?H(pa,M):H(pa);a.replaceWith(ua,pa)}})},sanitize:H,sanitizeSerial:function(M,W){var ea=O;b(M,function(na){ea.push(function(){na.action(H(na.html,na.options,ea),na)})});W&&ea.push(W)}}})(this.writeCaptureSupport,this);
(function(a,d){function b(l,q,u,g){if(arguments.length==0)return k.call(this);var o=z[l];if(l=="load"){o=q;var y=u,v,C=o.indexOf(" ");if(C>=0){v=o.slice(C,o.length);o=o.slice(0,C)}if(a.isFunction(g)){y=y||{};y.done=g}return a.ajax({url:o,type:y&&y.type||"GET",dataType:"html",data:y&&y.params,complete:x(this,y,v)})}if(!o)throw"invalid method parameter "+l;return c.call(this,q,u,o)}function k(){function l(){var u=this,g=false;this[r]=true;a.each(z,function(o){var y=q[o];if(y)u[o]=function(v,C,G){if(!g&&
Object.prototype.toString.call(v)=="[object String]")try{g=true;return b.call(u,o,v,C,G)}finally{g=false}return y.apply(u,arguments)}});this.pushStack=function(){return k.call(q.pushStack.apply(u,arguments))};this.endCapture=function(){return q}}if(this[r])return this;var q=this;l.prototype=q;return new l}function c(l,q,u){var g,o=this;if(q&&q.done){g=q.done;delete q.done}else if(a.isFunction(q)){g=q;q=null}d.sanitizeSerial(a.map(this,function(y){return{html:l,options:q,action:function(v){u.call(y,
v)}}}),g&&function(){g.call(o)}||g);return this}function e(l){a(this).html(l)}function p(l){return function(q){a(this)[l](q)}}function x(l,q,u){return function(g,o){if(o=="success"||o=="notmodified"){var y=t(g.responseText,u);c.call(l,y,q,e)}}}function t(l,q){if(!q||!l)return l;var u=0,g={};return a("<div/>").append(l.replace(/<script(.|\s)*?\/script>/g,function(o){g[u]=o;return"jquery-writeCapture-script-placeholder-"+u++ +"-wc"})).find(q).html().replace(m,function(o,y){return g[y]})}var z={html:e};
a.each(["append","prepend","after","before","wrap","wrapAll","replaceWith","wrapInner"],function(){z[this]=p(this)});a.fn.writeCapture=b;var r="__writeCaptureJsProxied-fghebd__",m=/jquery-writeCapture-script-placeholder-(\d+)-wc/g;a.writeCapture=d})(jQuery,writeCapture.noConflict());
(function(){function a(){var k="";for(var c in this)if(typeof this[c]!="function")k+=c+'="'+this[c]+'" ';return k}function d(){var k="";for(var c in this)if(typeof this[c]!="function")k+=c+"="+encodeURIComponent(this[c])+"&";return k.replace(/&$/,"")}var b;b=jQuery.fn.flash=function(k,c,e,p){var x=e||b.replace;c=b.copy(b.pluginOptions,c);if(!b.hasFlash(c.version))if(c.expressInstall&&b.hasFlash(6,0,65))var t={flashvars:{MMredirectURL:location,MMplayerType:"PlugIn",MMdoctitle:jQuery("title").text()}};
else if(c.update)x=p||b.update;else return this;k=b.copy(b.htmlOptions,t,k);return this.each(function(){x.call(this,b.copy(k))})};b.copy=function(){for(var k={},c={},e=0;e<arguments.length;e++){var p=arguments[e];if(p!=undefined){jQuery.extend(k,p);p.flashvars!=undefined&&jQuery.extend(c,p.flashvars)}}k.flashvars=c;return k};b.hasFlash=function(k,c,e){if(/hasFlash\=true/.test(location))return true;if(/hasFlash\=false/.test(location))return false;var p=b.hasFlash.playerVersion().match(/\d+/g);k=String([k,
c,e]).match(/\d+/g)||String(b.pluginOptions.version).match(/\d+/g);for(c=0;c<3;c++){p[c]=parseInt(p[c]||0);k[c]=parseInt(k[c]||0);if(p[c]<k[c])return false;if(p[c]>k[c])return true}return true};b.hasFlash.playerVersion=function(){try{try{var k=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");try{k.AllowScriptAccess="always"}catch(c){return"6,0,0"}}catch(e){}return(new ActiveXObject("ShockwaveFlash.ShockwaveFlash")).GetVariable("$version").replace(/\D+/g,",").match(/^,?(.+),?$/)[1]}catch(p){try{if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin)return(navigator.plugins["Shockwave Flash 2.0"]||
navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g,",").match(/^,?(.+),?$/)[1]}catch(x){}}return"0,0,0"};b.htmlOptions={height:240,flashvars:{},pluginspage:"http://www.adobe.com/go/getflashplayer",src:"#",type:"application/x-shockwave-flash",width:320};b.pluginOptions={expressInstall:false,update:true,version:"6.0.65"};b.replace=function(k){this.innerHTML='<div class="alt">'+this.innerHTML+"</div>";jQuery(this).addClass("flash-replaced").prepend(b.transform(k))};b.update=function(){var k=
String(location).split("?");k.splice(1,0,"?hasFlash=true&");k=k.join("");k='<p>This content requires the Flash Player. <a href="http://www.adobe.com/go/getflashplayer">Download Flash Player</a>. Already have Flash Player? <a href="'+k+'">Click here.</a></p>';this.innerHTML='<span class="alt">'+this.innerHTML+"</span>";jQuery(this).addClass("flash-update").prepend(k)};b.transform=function(k){k.toString=a;if(k.flashvars)k.flashvars.toString=d;return"<embed "+String(k)+"/>"};window.attachEvent&&window.attachEvent("onbeforeunload",
function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){}})})();
jQuery.effects||function(a){function d(z){var r;if(z&&z.constructor==Array&&z.length==3)return z;if(r=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(z))return[parseInt(r[1],10),parseInt(r[2],10),parseInt(r[3],10)];if(r=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(z))return[parseFloat(r[1])*2.55,parseFloat(r[2])*2.55,parseFloat(r[3])*2.55];if(r=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(z))return[parseInt(r[1],
16),parseInt(r[2],16),parseInt(r[3],16)];if(r=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(z))return[parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16)];if(/rgba\(0, 0, 0, 0\)/.exec(z))return p.transparent;return p[a.trim(z).toLowerCase()]}function b(){var z=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,r={},m,l;if(z&&z.length&&z[0]&&z[z[0]])for(var q=z.length;q--;){m=z[q];if(typeof z[m]=="string"){l=m.replace(/\-(\w)/g,function(u,g){return g.toUpperCase()});
r[l]=z[m]}}else for(m in z)if(typeof z[m]==="string")r[m]=z[m];return r}function k(z){var r,m;for(r in z){m=z[r];if(m==null||a.isFunction(m)||r in t||/scrollbar/.test(r)||!/color/i.test(r)&&isNaN(parseFloat(m)))delete z[r]}return z}function c(z,r){var m={_:0},l;for(l in r)if(z[l]!=r[l])m[l]=r[l];return m}function e(z,r,m,l){if(typeof z=="object"){l=r;m=null;r=z;z=r.effect}if(a.isFunction(r)){l=r;m=null;r={}}if(a.isFunction(m)){l=m;m=null}if(typeof r=="number"||a.fx.speeds[r]){l=m;m=r;r={}}r=r||{};
m=m||r.duration;m=a.fx.off?0:typeof m=="number"?m:a.fx.speeds[m]||a.fx.speeds._default;l=l||r.complete;return[z,r,m,l]}a.effects={};a.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(z,r){a.fx.step[r]=function(m){if(!m.colorInit){var l;l=m.elem;var q=r,u;do{u=a.curCSS(l,q);if(u!=""&&u!="transparent"||a.nodeName(l,"body"))break;q="backgroundColor"}while(l=l.parentNode);l=d(u);m.start=l;m.end=d(m.end);m.colorInit=true}m.elem.style[r]=
"rgb("+Math.max(Math.min(parseInt(m.pos*(m.end[0]-m.start[0])+m.start[0],10),255),0)+","+Math.max(Math.min(parseInt(m.pos*(m.end[1]-m.start[1])+m.start[1],10),255),0)+","+Math.max(Math.min(parseInt(m.pos*(m.end[2]-m.start[2])+m.start[2],10),255),0)+")"}});var p={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,
0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,
203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},x=["add","remove","toggle"],t={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};a.effects.animateClass=function(z,r,m,l){if(a.isFunction(m)){l=m;m=null}return this.each(function(){var q=a(this),u=q.attr("style")||" ",g=k(b.call(this)),o,y=q.attr("className");a.each(x,function(v,C){z[C]&&q[C+"Class"](z[C])});
o=k(b.call(this));q.attr("className",y);q.animate(c(g,o),r,m,function(){a.each(x,function(v,C){z[C]&&q[C+"Class"](z[C])});if(typeof q.attr("style")=="object"){q.attr("style").cssText="";q.attr("style").cssText=u}else q.attr("style",u);l&&l.apply(this,arguments)})})};a.fn.extend({_addClass:a.fn.addClass,addClass:function(z,r,m,l){return r?a.effects.animateClass.apply(this,[{add:z},r,m,l]):this._addClass(z)},_removeClass:a.fn.removeClass,removeClass:function(z,r,m,l){return r?a.effects.animateClass.apply(this,
[{remove:z},r,m,l]):this._removeClass(z)},_toggleClass:a.fn.toggleClass,toggleClass:function(z,r,m,l,q){return typeof r=="boolean"||r===undefined?m?a.effects.animateClass.apply(this,[r?{add:z}:{remove:z},m,l,q]):this._toggleClass(z,r):a.effects.animateClass.apply(this,[{toggle:z},r,m,l])},switchClass:function(z,r,m,l,q){return a.effects.animateClass.apply(this,[{add:r,remove:z},m,l,q])}});a.extend(a.effects,{version:"1.8.2",save:function(z,r){for(var m=0;m<r.length;m++)r[m]!==null&&z.data("ec.storage."+
r[m],z[0].style[r[m]])},restore:function(z,r){for(var m=0;m<r.length;m++)r[m]!==null&&z.css(r[m],z.data("ec.storage."+r[m]))},setMode:function(z,r){if(r=="toggle")r=z.is(":hidden")?"show":"hide";return r},getBaseline:function(z,r){var m,l;switch(z[0]){case "top":m=0;break;case "middle":m=0.5;break;case "bottom":m=1;break;default:m=z[0]/r.height}switch(z[1]){case "left":l=0;break;case "center":l=0.5;break;case "right":l=1;break;default:l=z[1]/r.width}return{x:l,y:m}},createWrapper:function(z){if(z.parent().is(".ui-effects-wrapper"))return z.parent();
var r={width:z.outerWidth(true),height:z.outerHeight(true),"float":z.css("float")},m=a("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0});z.wrap(m);m=z.parent();if(z.css("position")=="static"){m.css({position:"relative"});z.css({position:"relative"})}else{a.extend(r,{position:z.css("position"),zIndex:z.css("z-index")});a.each(["top","left","bottom","right"],function(l,q){r[q]=z.css(q);if(isNaN(parseInt(r[q],10)))r[q]="auto"});
z.css({position:"relative",top:0,left:0})}return m.css(r).show()},removeWrapper:function(z){if(z.parent().is(".ui-effects-wrapper"))return z.parent().replaceWith(z);return z},setTransition:function(z,r,m,l){l=l||{};a.each(r,function(q,u){unit=z.cssUnit(u);if(unit[0]>0)l[u]=unit[0]*m+unit[1]});return l}});a.fn.extend({effect:function(z){var r=e.apply(this,arguments);r={options:r[1],duration:r[2],callback:r[3]};var m=a.effects[z];return m&&!a.fx.off?m.call(this,r):this},_show:a.fn.show,show:function(z){if(!z||
typeof z=="number"||a.fx.speeds[z])return this._show.apply(this,arguments);else{var r=e.apply(this,arguments);r[1].mode="show";return this.effect.apply(this,r)}},_hide:a.fn.hide,hide:function(z){if(!z||typeof z=="number"||a.fx.speeds[z])return this._hide.apply(this,arguments);else{var r=e.apply(this,arguments);r[1].mode="hide";return this.effect.apply(this,r)}},__toggle:a.fn.toggle,toggle:function(z){if(!z||typeof z=="number"||a.fx.speeds[z]||typeof z=="boolean"||a.isFunction(z))return this.__toggle.apply(this,
arguments);else{var r=e.apply(this,arguments);r[1].mode="toggle";return this.effect.apply(this,r)}},cssUnit:function(z){var r=this.css(z),m=[];a.each(["em","px","%","pt"],function(l,q){if(r.indexOf(q)>0)m=[parseFloat(r),q]});return m}});a.easing.jswing=a.easing.swing;a.extend(a.easing,{def:"easeOutQuad",swing:function(z,r,m,l,q){return a.easing[a.easing.def](z,r,m,l,q)},easeInQuad:function(z,r,m,l,q){return l*(r/=q)*r+m},easeOutQuad:function(z,r,m,l,q){return-l*(r/=q)*(r-2)+m},easeInOutQuad:function(z,
r,m,l,q){if((r/=q/2)<1)return l/2*r*r+m;return-l/2*(--r*(r-2)-1)+m},easeInCubic:function(z,r,m,l,q){return l*(r/=q)*r*r+m},easeOutCubic:function(z,r,m,l,q){return l*((r=r/q-1)*r*r+1)+m},easeInOutCubic:function(z,r,m,l,q){if((r/=q/2)<1)return l/2*r*r*r+m;return l/2*((r-=2)*r*r+2)+m},easeInQuart:function(z,r,m,l,q){return l*(r/=q)*r*r*r+m},easeOutQuart:function(z,r,m,l,q){return-l*((r=r/q-1)*r*r*r-1)+m},easeInOutQuart:function(z,r,m,l,q){if((r/=q/2)<1)return l/2*r*r*r*r+m;return-l/2*((r-=2)*r*r*r-2)+
m},easeInQuint:function(z,r,m,l,q){return l*(r/=q)*r*r*r*r+m},easeOutQuint:function(z,r,m,l,q){return l*((r=r/q-1)*r*r*r*r+1)+m},easeInOutQuint:function(z,r,m,l,q){if((r/=q/2)<1)return l/2*r*r*r*r*r+m;return l/2*((r-=2)*r*r*r*r+2)+m},easeInSine:function(z,r,m,l,q){return-l*Math.cos(r/q*(Math.PI/2))+l+m},easeOutSine:function(z,r,m,l,q){return l*Math.sin(r/q*(Math.PI/2))+m},easeInOutSine:function(z,r,m,l,q){return-l/2*(Math.cos(Math.PI*r/q)-1)+m},easeInExpo:function(z,r,m,l,q){return r==0?m:l*Math.pow(2,
10*(r/q-1))+m},easeOutExpo:function(z,r,m,l,q){return r==q?m+l:l*(-Math.pow(2,-10*r/q)+1)+m},easeInOutExpo:function(z,r,m,l,q){if(r==0)return m;if(r==q)return m+l;if((r/=q/2)<1)return l/2*Math.pow(2,10*(r-1))+m;return l/2*(-Math.pow(2,-10*--r)+2)+m},easeInCirc:function(z,r,m,l,q){return-l*(Math.sqrt(1-(r/=q)*r)-1)+m},easeOutCirc:function(z,r,m,l,q){return l*Math.sqrt(1-(r=r/q-1)*r)+m},easeInOutCirc:function(z,r,m,l,q){if((r/=q/2)<1)return-l/2*(Math.sqrt(1-r*r)-1)+m;return l/2*(Math.sqrt(1-(r-=2)*
r)+1)+m},easeInElastic:function(z,r,m,l,q){z=1.70158;var u=0,g=l;if(r==0)return m;if((r/=q)==1)return m+l;u||(u=q*0.3);if(g<Math.abs(l)){g=l;z=u/4}else z=u/(2*Math.PI)*Math.asin(l/g);return-(g*Math.pow(2,10*(r-=1))*Math.sin((r*q-z)*2*Math.PI/u))+m},easeOutElastic:function(z,r,m,l,q){z=1.70158;var u=0,g=l;if(r==0)return m;if((r/=q)==1)return m+l;u||(u=q*0.3);if(g<Math.abs(l)){g=l;z=u/4}else z=u/(2*Math.PI)*Math.asin(l/g);return g*Math.pow(2,-10*r)*Math.sin((r*q-z)*2*Math.PI/u)+l+m},easeInOutElastic:function(z,
r,m,l,q){z=1.70158;var u=0,g=l;if(r==0)return m;if((r/=q/2)==2)return m+l;u||(u=q*0.3*1.5);if(g<Math.abs(l)){g=l;z=u/4}else z=u/(2*Math.PI)*Math.asin(l/g);if(r<1)return-0.5*g*Math.pow(2,10*(r-=1))*Math.sin((r*q-z)*2*Math.PI/u)+m;return g*Math.pow(2,-10*(r-=1))*Math.sin((r*q-z)*2*Math.PI/u)*0.5+l+m},easeInBack:function(z,r,m,l,q,u){if(u==undefined)u=1.70158;return l*(r/=q)*r*((u+1)*r-u)+m},easeOutBack:function(z,r,m,l,q,u){if(u==undefined)u=1.70158;return l*((r=r/q-1)*r*((u+1)*r+u)+1)+m},easeInOutBack:function(z,
r,m,l,q,u){if(u==undefined)u=1.70158;if((r/=q/2)<1)return l/2*r*r*(((u*=1.525)+1)*r-u)+m;return l/2*((r-=2)*r*(((u*=1.525)+1)*r+u)+2)+m},easeInBounce:function(z,r,m,l,q){return l-a.easing.easeOutBounce(z,q-r,0,l,q)+m},easeOutBounce:function(z,r,m,l,q){return(r/=q)<1/2.75?l*7.5625*r*r+m:r<2/2.75?l*(7.5625*(r-=1.5/2.75)*r+0.75)+m:r<2.5/2.75?l*(7.5625*(r-=2.25/2.75)*r+0.9375)+m:l*(7.5625*(r-=2.625/2.75)*r+0.984375)+m},easeInOutBounce:function(z,r,m,l,q){if(r<q/2)return a.easing.easeInBounce(z,r*2,0,
l,q)*0.5+m;return a.easing.easeOutBounce(z,r*2-q,0,l,q)*0.5+l*0.5+m}})}(jQuery);
(function(a){a.effects.highlight=function(d){return this.queue(function(){var b=a(this),k=["backgroundImage","backgroundColor","opacity"],c=a.effects.setMode(b,d.options.mode||"show"),e={backgroundColor:b.css("backgroundColor")};if(c=="hide")e.opacity=0;a.effects.save(b,k);b.show().css({backgroundImage:"none",backgroundColor:d.options.color||"#ffff99"}).animate(e,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){c=="hide"&&b.hide();a.effects.restore(b,k);c=="show"&&!a.support.opacity&&
this.style.removeAttribute("filter");d.callback&&d.callback.apply(this,arguments);b.dequeue()}})})}})(jQuery);
(function(a){a.effects.pulsate=function(d){return this.queue(function(){var b=a(this),k=a.effects.setMode(b,d.options.mode||"show");times=(d.options.times||5)*2-1;duration=d.duration?d.duration/2:a.fx.speeds._default/2;isVisible=b.is(":visible");animateTo=0;if(!isVisible){b.css("opacity",0).show();animateTo=1}if(k=="hide"&&isVisible||k=="show"&&!isVisible)times--;for(k=0;k<times;k++){b.animate({opacity:animateTo},duration,d.options.easing);animateTo=(animateTo+1)%2}b.animate({opacity:animateTo},duration,
d.options.easing,function(){animateTo==0&&b.hide();d.callback&&d.callback.apply(this,arguments)});b.queue("fx",function(){b.dequeue()}).dequeue()})}})(jQuery);
(function(a){a.effects.slide=function(d){return this.queue(function(){var b=a(this),k=["position","top","left"],c=a.effects.setMode(b,d.options.mode||"show"),e=d.options.direction||"left";a.effects.save(b,k);b.show();a.effects.createWrapper(b).css({overflow:"hidden"});var p=e=="up"||e=="down"?"top":"left";e=e=="up"||e=="left"?"pos":"neg";var x=d.options.distance||(p=="top"?b.outerHeight({margin:true}):b.outerWidth({margin:true}));if(c=="show")b.css(p,e=="pos"?-x:x);var t={};t[p]=(c=="show"?e=="pos"?
"+=":"-=":e=="pos"?"-=":"+=")+x;b.animate(t,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){c=="hide"&&b.hide();a.effects.restore(b,k);a.effects.removeWrapper(b);d.callback&&d.callback.apply(this,arguments);b.dequeue()}})})}})(jQuery);
(function(a){a.ui=a.ui||{};if(!a.ui.version){a.extend(a.ui,{version:"1.8.2",plugin:{add:function(d,b,k){d=a.ui[d].prototype;for(var c in k){d.plugins[c]=d.plugins[c]||[];d.plugins[c].push([b,k[c]])}},call:function(d,b,k){if((b=d.plugins[b])&&d.element[0].parentNode)for(var c=0;c<b.length;c++)d.options[b[c][0]]&&b[c][1].apply(d.element,k)}},contains:function(d,b){return document.compareDocumentPosition?d.compareDocumentPosition(b)&16:d!==b&&d.contains(b)},hasScroll:function(d,b){if(a(d).css("overflow")==
"hidden")return false;var k=b&&b=="left"?"scrollLeft":"scrollTop",c=false;if(d[k]>0)return true;d[k]=1;c=d[k]>0;d[k]=0;return c},isOverAxis:function(d,b,k){return d>b&&d<b+k},isOver:function(d,b,k,c,e,p){return a.ui.isOverAxis(d,k,e)&&a.ui.isOverAxis(b,c,p)},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}});a.fn.extend({_focus:a.fn.focus,focus:function(d,b){return typeof d==="number"?this.each(function(){var k=this;setTimeout(function(){a(k).focus();b&&b.call(k)},d)}):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 d;d=a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",
1))}).eq(0);return/fixed/.test(this.css("position"))||!d.length?a(document):d},zIndex:function(d){if(d!==undefined)return this.css("zIndex",d);if(this.length){d=a(this[0]);for(var b;d.length&&d[0]!==document;){b=d.css("position");if(b=="absolute"||b=="relative"||b=="fixed"){b=parseInt(d.css("zIndex"));if(!isNaN(b)&&b!=0)return b}d=d.parent()}}return 0}});a.extend(a.expr[":"],{data:function(d,b,k){return!!a.data(d,k[3])},focusable:function(d){var b=d.nodeName.toLowerCase(),k=a.attr(d,"tabindex");return(/input|select|textarea|button|object/.test(b)?
!d.disabled:"a"==b||"area"==b?d.href||!isNaN(k):!isNaN(k))&&!a(d)["area"==b?"parents":"closest"](":hidden").length},tabbable:function(d){var b=a.attr(d,"tabindex");return(isNaN(b)||b>=0)&&a(d).is(":focusable")}})}})(jQuery);
(function(a){var d=a.fn.remove;a.fn.remove=function(b,k){return this.each(function(){if(!k)if(!b||a.filter(b,[this]).length)a("*",this).add(this).each(function(){a(this).triggerHandler("remove")});return d.call(a(this),b,k)})};a.widget=function(b,k,c){var e=b.split(".")[0],p;b=b.split(".")[1];p=e+"-"+b;if(!c){c=k;k=a.Widget}a.expr[":"][p]=function(x){return!!a.data(x,b)};a[e]=a[e]||{};a[e][b]=function(x,t){arguments.length&&this._createWidget(x,t)};k=new k;k.options=a.extend({},k.options);a[e][b].prototype=
a.extend(true,k,{namespace:e,widgetName:b,widgetEventPrefix:a[e][b].prototype.widgetEventPrefix||b,widgetBaseClass:p},c);a.widget.bridge(b,a[e][b])};a.widget.bridge=function(b,k){a.fn[b]=function(c){var e=typeof c==="string",p=Array.prototype.slice.call(arguments,1),x=this;c=!e&&p.length?a.extend.apply(null,[true,c].concat(p)):c;if(e&&c.substring(0,1)==="_")return x;e?this.each(function(){var t=a.data(this,b),z=t&&a.isFunction(t[c])?t[c].apply(t,p):t;if(z!==t&&z!==undefined){x=z;return false}}):this.each(function(){var t=
a.data(this,b);if(t){c&&t.option(c);t._init()}else a.data(this,b,new k(c,this))});return x}};a.Widget=function(b,k){arguments.length&&this._createWidget(b,k)};a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(b,k){this.element=a(k).data(this.widgetName,this);this.options=a.extend(true,{},this.options,a.metadata&&a.metadata.get(k)[this.widgetName],b);var c=this;this.element.bind("remove."+this.widgetName,function(){c.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(b,k){var c=b,e=this;if(arguments.length===0)return a.extend({},e.options);if(typeof b==="string"){if(k===undefined)return this.options[b];c={};c[b]=k}a.each(c,function(p,
x){e._setOption(p,x)});return e},_setOption:function(b,k){this.options[b]=k;if(b==="disabled")this.widget()[k?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",k);return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(b,k,c){var e=this.options[b];k=a.Event(k);k.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase();c=c||{};if(k.originalEvent){b=
a.event.props.length;for(var p;b;){p=a.event.props[--b];k[p]=k.originalEvent[p]}}this.element.trigger(k,c);return!(a.isFunction(e)&&e.call(this.element[0],k,c)===false||k.isDefaultPrevented())}}})(jQuery);
(function(a){a.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var d=this;this.element.bind("mousedown."+this.widgetName,function(b){return d._mouseDown(b)}).bind("click."+this.widgetName,function(b){if(d._preventClickEvent){d._preventClickEvent=false;b.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(d){d.originalEvent=d.originalEvent||{};if(!d.originalEvent.mouseHandled){this._mouseStarted&&
this._mouseUp(d);this._mouseDownEvent=d;var b=this,k=d.which==1,c=typeof this.options.cancel=="string"?a(d.target).parents().add(d.target).filter(this.options.cancel).length:false;if(!k||c||!this._mouseCapture(d))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){b.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(d)&&this._mouseDelayMet(d)){this._mouseStarted=this._mouseStart(d)!==false;if(!this._mouseStarted){d.preventDefault();
return true}}this._mouseMoveDelegate=function(e){return b._mouseMove(e)};this._mouseUpDelegate=function(e){return b._mouseUp(e)};a(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);a.browser.safari||d.preventDefault();return d.originalEvent.mouseHandled=true}},_mouseMove:function(d){if(a.browser.msie&&!d.button)return this._mouseUp(d);if(this._mouseStarted){this._mouseDrag(d);return d.preventDefault()}if(this._mouseDistanceMet(d)&&
this._mouseDelayMet(d))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,d)!==false)?this._mouseDrag(d):this._mouseUp(d);return!this._mouseStarted},_mouseUp:function(d){a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=d.target==this._mouseDownEvent.target;this._mouseStop(d)}return false},_mouseDistanceMet:function(d){return Math.max(Math.abs(this._mouseDownEvent.pageX-
d.pageX),Math.abs(this._mouseDownEvent.pageY-d.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery);
(function(a){a.widget("ui.slider",a.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 d=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=a([]);if(b.range){if(b.range===true){this.range=a("<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=a("<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")}a(".ui-slider-handle",this.element).length===0&&a("<a href='#'></a>").appendTo(this.element).addClass("ui-slider-handle");
if(b.values&&b.values.length)for(;a(".ui-slider-handle",this.element).length<b.values.length;)a("<a href='#'></a>").appendTo(this.element).addClass("ui-slider-handle");this.handles=a(".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(k){k.preventDefault()}).hover(function(){b.disabled||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")}).focus(function(){if(b.disabled)a(this).blur();
else{a(".ui-slider .ui-state-focus").removeClass("ui-state-focus");a(this).addClass("ui-state-focus")}}).blur(function(){a(this).removeClass("ui-state-focus")});this.handles.each(function(k){a(this).data("index.ui-slider-handle",k)});this.handles.keydown(function(k){var c=true,e=a(this).data("index.ui-slider-handle"),p,x,t;if(!d.options.disabled){switch(k.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.PAGE_UP:case a.ui.keyCode.PAGE_DOWN:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:c=
false;if(!d._keySliding){d._keySliding=true;a(this).addClass("ui-state-active");p=d._start(k,e);if(p===false)return}break}t=d.options.step;p=d.options.values&&d.options.values.length?x=d.values(e):x=d.value();switch(k.keyCode){case a.ui.keyCode.HOME:x=d._valueMin();break;case a.ui.keyCode.END:x=d._valueMax();break;case a.ui.keyCode.PAGE_UP:x=d._trimAlignValue(p+(d._valueMax()-d._valueMin())/5);break;case a.ui.keyCode.PAGE_DOWN:x=d._trimAlignValue(p-(d._valueMax()-d._valueMin())/5);break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(p===
d._valueMax())return;x=d._trimAlignValue(p+t);break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(p===d._valueMin())return;x=d._trimAlignValue(p-t);break}d._slide(k,e,x);return c}}).keyup(function(k){var c=a(this).data("index.ui-slider-handle");if(d._keySliding){d._keySliding=false;d._stop(k,c);d._change(k,c);a(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(d){var b=this.options,k,c,e,p,x,t;if(b.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();k={x:d.pageX,y:d.pageY};c=this._normValueFromMouse(k);e=this._valueMax()-this._valueMin()+1;x=this;this.handles.each(function(z){var r=Math.abs(c-x.values(z));if(e>r){e=r;p=a(this);t=z}});if(b.range===true&&this.values(1)===b.min){t+=1;p=a(this.handles[t])}if(this._start(d,
t)===false)return false;this._mouseSliding=true;x._handleIndex=t;p.addClass("ui-state-active").focus();b=p.offset();this._clickOffset=!a(d.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:d.pageX-b.left-p.width()/2,top:d.pageY-b.top-p.height()/2-(parseInt(p.css("borderTopWidth"),10)||0)-(parseInt(p.css("borderBottomWidth"),10)||0)+(parseInt(p.css("marginTop"),10)||0)};c=this._normValueFromMouse(k);this._slide(d,t,c);return this._animateOff=true},_mouseStart:function(){return true},
_mouseDrag:function(d){var b=this._normValueFromMouse({x:d.pageX,y:d.pageY});this._slide(d,this._handleIndex,b);return false},_mouseStop:function(d){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(d,this._handleIndex);this._change(d,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(d){var b;
if(this.orientation==="horizontal"){b=this.elementSize.width;d=d.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{b=this.elementSize.height;d=d.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}b=d/b;if(b>1)b=1;if(b<0)b=0;if(this.orientation==="vertical")b=1-b;d=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+b*d)},_start:function(d,b){var k={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){k.value=
this.values(b);k.values=this.values()}return this._trigger("start",d,k)},_slide:function(d,b,k){var c;if(this.options.values&&this.options.values.length){c=this.values(b?0:1);if(this.options.values.length===2&&this.options.range===true&&(b===0&&k>c||b===1&&k<c))k=c;if(k!==this.values(b)){c=this.values();c[b]=k;d=this._trigger("slide",d,{handle:this.handles[b],value:k,values:c});this.values(b?0:1);d!==false&&this.values(b,k,true)}}else if(k!==this.value()){d=this._trigger("slide",d,{handle:this.handles[b],
value:k});d!==false&&this.value(k)}},_stop:function(d,b){var k={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){k.value=this.values(b);k.values=this.values()}this._trigger("stop",d,k)},_change:function(d,b){if(!this._keySliding&&!this._mouseSliding){var k={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){k.value=this.values(b);k.values=this.values()}this._trigger("change",d,k)}},value:function(d){if(arguments.length){this.options.value=
this._trimAlignValue(d);this._refreshValue();this._change(null,0)}return this._value()},values:function(d,b){var k,c,e;if(arguments.length>1){this.options.values[d]=this._trimAlignValue(b);this._refreshValue();this._change(null,d)}if(arguments.length)if(a.isArray(arguments[0])){k=this.options.values;c=arguments[0];for(e=0;e<k.length;e+=1){k[e]=this._trimAlignValue(c[e]);this._change(null,e)}this._refreshValue()}else return this.options.values&&this.options.values.length?this._values(d):this.value();
else return this._values()},_setOption:function(d,b){var k,c=0;if(a.isArray(this.options.values))c=this.options.values.length;a.Widget.prototype._setOption.apply(this,arguments);switch(d){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(k=0;k<c;k+=1)this._change(null,k);this._animateOff=false;break}},_value:function(){var d=this.options.value;return d=this._trimAlignValue(d)},_values:function(d){var b,k;if(arguments.length){b=this.options.values[d];
return b=this._trimAlignValue(b)}else{b=this.options.values.slice();for(k=0;k<b.length;k+=1)b[k]=this._trimAlignValue(b[k]);return b}},_trimAlignValue:function(d){if(d<this._valueMin())return this._valueMin();if(d>this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,k=d%b;d=d-k;if(Math.abs(k)*2>=b)d+=k>0?b:-b;return parseFloat(d.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var d=
this.options.range,b=this.options,k=this,c=!this._animateOff?b.animate:false,e,p={},x,t,z,r;if(this.options.values&&this.options.values.length)this.handles.each(function(m){e=(k.values(m)-k._valueMin())/(k._valueMax()-k._valueMin())*100;p[k.orientation==="horizontal"?"left":"bottom"]=e+"%";a(this).stop(1,1)[c?"animate":"css"](p,b.animate);if(k.options.range===true)if(k.orientation==="horizontal"){if(m===0)k.range.stop(1,1)[c?"animate":"css"]({left:e+"%"},b.animate);if(m===1)k.range[c?"animate":"css"]({width:e-
x+"%"},{queue:false,duration:b.animate})}else{if(m===0)k.range.stop(1,1)[c?"animate":"css"]({bottom:e+"%"},b.animate);if(m===1)k.range[c?"animate":"css"]({height:e-x+"%"},{queue:false,duration:b.animate})}x=e});else{t=this.value();z=this._valueMin();r=this._valueMax();e=r!==z?(t-z)/(r-z)*100:0;p[k.orientation==="horizontal"?"left":"bottom"]=e+"%";this.handle.stop(1,1)[c?"animate":"css"](p,b.animate);if(d==="min"&&this.orientation==="horizontal")this.range.stop(1,1)[c?"animate":"css"]({width:e+"%"},
b.animate);if(d==="max"&&this.orientation==="horizontal")this.range[c?"animate":"css"]({width:100-e+"%"},{queue:false,duration:b.animate});if(d==="min"&&this.orientation==="vertical")this.range.stop(1,1)[c?"animate":"css"]({height:e+"%"},b.animate);if(d==="max"&&this.orientation==="vertical")this.range[c?"animate":"css"]({height:100-e+"%"},{queue:false,duration:b.animate})}}});a.extend(a.ui.slider,{version:"1.8.2"})})(jQuery);
(function(a){function d(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._inDialog=this._datepickerShowing=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass=
"ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su",
"Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",
minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false,autoSize:false};a.extend(this._defaults,this.regional[""]);this.dpDiv=a('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible"></div>')}function b(c,e){a.extend(c,
e);for(var p in e)if(e[p]==null||e[p]==undefined)c[p]=e[p];return c}a.extend(a.ui,{datepicker:{version:"1.8.2"}});var k=(new Date).getTime();a.extend(d.prototype,{markerClassName:"hasDatepicker",log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(c){b(this._defaults,c||{});return this},_attachDatepicker:function(c,e){var p=null;for(var x in this._defaults){var t=c.getAttribute("date:"+x);if(t){p=p||{};try{p[x]=eval(t)}catch(z){p[x]=
t}}}x=c.nodeName.toLowerCase();t=x=="div"||x=="span";if(!c.id){this.uuid+=1;c.id="dp"+this.uuid}var r=this._newInst(a(c),t);r.settings=a.extend({},e||{},p||{});if(x=="input")this._connectDatepicker(c,r);else t&&this._inlineDatepicker(c,r)},_newInst:function(c,e){return{id:c[0].id.replace(/([^A-Za-z0-9_])/g,"\\\\$1"),input:c,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:e,dpDiv:!e?this.dpDiv:a('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')}},
_connectDatepicker:function(c,e){var p=a(c);e.append=a([]);e.trigger=a([]);if(!p.hasClass(this.markerClassName)){this._attachments(p,e);p.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(x,t,z){e.settings[t]=z}).bind("getData.datepicker",function(x,t){return this._get(e,t)});this._autoSize(e);a.data(c,"datepicker",e)}},_attachments:function(c,e){var p=this._get(e,"appendText"),x=this._get(e,"isRTL");e.append&&
e.append.remove();if(p){e.append=a('<span class="'+this._appendClass+'">'+p+"</span>");c[x?"before":"after"](e.append)}c.unbind("focus",this._showDatepicker);e.trigger&&e.trigger.remove();p=this._get(e,"showOn");if(p=="focus"||p=="both")c.focus(this._showDatepicker);if(p=="button"||p=="both"){p=this._get(e,"buttonText");var t=this._get(e,"buttonImage");e.trigger=a(this._get(e,"buttonImageOnly")?a("<img/>").addClass(this._triggerClass).attr({src:t,alt:p,title:p}):a('<button type="button"></button>').addClass(this._triggerClass).html(t==
""?p:a("<img/>").attr({src:t,alt:p,title:p})));c[x?"before":"after"](e.trigger);e.trigger.click(function(){a.datepicker._datepickerShowing&&a.datepicker._lastInput==c[0]?a.datepicker._hideDatepicker():a.datepicker._showDatepicker(c[0]);return false})}},_autoSize:function(c){if(this._get(c,"autoSize")&&!c.inline){var e=new Date(2009,11,20),p=this._get(c,"dateFormat");if(p.match(/[DM]/)){var x=function(t){for(var z=0,r=0,m=0;m<t.length;m++)if(t[m].length>z){z=t[m].length;r=m}return r};e.setMonth(x(this._get(c,
p.match(/MM/)?"monthNames":"monthNamesShort")));e.setDate(x(this._get(c,p.match(/DD/)?"dayNames":"dayNamesShort"))+20-e.getDay())}c.input.attr("size",this._formatDate(c,e).length)}},_inlineDatepicker:function(c,e){var p=a(c);if(!p.hasClass(this.markerClassName)){p.addClass(this.markerClassName).append(e.dpDiv).bind("setData.datepicker",function(x,t,z){e.settings[t]=z}).bind("getData.datepicker",function(x,t){return this._get(e,t)});a.data(c,"datepicker",e);this._setDate(e,this._getDefaultDate(e),
true);this._updateDatepicker(e);this._updateAlternate(e)}},_dialogDatepicker:function(c,e,p,x,t){c=this._dialogInst;if(!c){this.uuid+=1;this._dialogInput=a('<input type="text" id="'+("dp"+this.uuid)+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>');this._dialogInput.keydown(this._doKeyDown);a("body").append(this._dialogInput);c=this._dialogInst=this._newInst(this._dialogInput,false);c.settings={};a.data(this._dialogInput[0],"datepicker",c)}b(c.settings,x||{});e=e&&e.constructor==
Date?this._formatDate(c,e):e;this._dialogInput.val(e);this._pos=t?t.length?t:[t.pageX,t.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");c.settings.onSelect=p;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);
a.blockUI&&a.blockUI(this.dpDiv);a.data(this._dialogInput[0],"datepicker",c);return this},_destroyDatepicker:function(c){var e=a(c),p=a.data(c,"datepicker");if(e.hasClass(this.markerClassName)){var x=c.nodeName.toLowerCase();a.removeData(c,"datepicker");if(x=="input"){p.append.remove();p.trigger.remove();e.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)}else if(x=="div"||x=="span")e.removeClass(this.markerClassName).empty()}},
_enableDatepicker:function(c){var e=a(c),p=a.data(c,"datepicker");if(e.hasClass(this.markerClassName)){var x=c.nodeName.toLowerCase();if(x=="input"){c.disabled=false;p.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(x=="div"||x=="span")e.children("."+this._inlineClass).children().removeClass("ui-state-disabled");this._disabledInputs=a.map(this._disabledInputs,function(t){return t==c?null:t})}},_disableDatepicker:function(c){var e=
a(c),p=a.data(c,"datepicker");if(e.hasClass(this.markerClassName)){var x=c.nodeName.toLowerCase();if(x=="input"){c.disabled=true;p.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(x=="div"||x=="span")e.children("."+this._inlineClass).children().addClass("ui-state-disabled");this._disabledInputs=a.map(this._disabledInputs,function(t){return t==c?null:t});this._disabledInputs[this._disabledInputs.length]=c}},_isDisabledDatepicker:function(c){if(!c)return false;
for(var e=0;e<this._disabledInputs.length;e++)if(this._disabledInputs[e]==c)return true;return false},_getInst:function(c){try{return a.data(c,"datepicker")}catch(e){throw"Missing instance data for this datepicker";}},_optionDatepicker:function(c,e,p){var x=this._getInst(c);if(arguments.length==2&&typeof e=="string")return e=="defaults"?a.extend({},a.datepicker._defaults):x?e=="all"?a.extend({},x.settings):this._get(x,e):null;var t=e||{};if(typeof e=="string"){t={};t[e]=p}if(x){this._curInst==x&&
this._hideDatepicker();var z=this._getDateDatepicker(c,true);b(x.settings,t);this._attachments(a(c),x);this._autoSize(x);this._setDateDatepicker(c,z);this._updateDatepicker(x)}},_changeDatepicker:function(c,e,p){this._optionDatepicker(c,e,p)},_refreshDatepicker:function(c){(c=this._getInst(c))&&this._updateDatepicker(c)},_setDateDatepicker:function(c,e){var p=this._getInst(c);if(p){this._setDate(p,e);this._updateDatepicker(p);this._updateAlternate(p)}},_getDateDatepicker:function(c,e){var p=this._getInst(c);
p&&!p.inline&&this._setDateFromField(p,e);return p?this._getDate(p):null},_doKeyDown:function(c){var e=a.datepicker._getInst(c.target),p=true,x=e.dpDiv.is(".ui-datepicker-rtl");e._keyEvent=true;if(a.datepicker._datepickerShowing)switch(c.keyCode){case 9:a.datepicker._hideDatepicker();p=false;break;case 13:p=a("td."+a.datepicker._dayOverClass,e.dpDiv).add(a("td."+a.datepicker._currentClass,e.dpDiv));p[0]?a.datepicker._selectDay(c.target,e.selectedMonth,e.selectedYear,p[0]):a.datepicker._hideDatepicker();
return false;case 27:a.datepicker._hideDatepicker();break;case 33:a.datepicker._adjustDate(c.target,c.ctrlKey?-a.datepicker._get(e,"stepBigMonths"):-a.datepicker._get(e,"stepMonths"),"M");break;case 34:a.datepicker._adjustDate(c.target,c.ctrlKey?+a.datepicker._get(e,"stepBigMonths"):+a.datepicker._get(e,"stepMonths"),"M");break;case 35:if(c.ctrlKey||c.metaKey)a.datepicker._clearDate(c.target);p=c.ctrlKey||c.metaKey;break;case 36:if(c.ctrlKey||c.metaKey)a.datepicker._gotoToday(c.target);p=c.ctrlKey||
c.metaKey;break;case 37:if(c.ctrlKey||c.metaKey)a.datepicker._adjustDate(c.target,x?+1:-1,"D");p=c.ctrlKey||c.metaKey;if(c.originalEvent.altKey)a.datepicker._adjustDate(c.target,c.ctrlKey?-a.datepicker._get(e,"stepBigMonths"):-a.datepicker._get(e,"stepMonths"),"M");break;case 38:if(c.ctrlKey||c.metaKey)a.datepicker._adjustDate(c.target,-7,"D");p=c.ctrlKey||c.metaKey;break;case 39:if(c.ctrlKey||c.metaKey)a.datepicker._adjustDate(c.target,x?-1:+1,"D");p=c.ctrlKey||c.metaKey;if(c.originalEvent.altKey)a.datepicker._adjustDate(c.target,
c.ctrlKey?+a.datepicker._get(e,"stepBigMonths"):+a.datepicker._get(e,"stepMonths"),"M");break;case 40:if(c.ctrlKey||c.metaKey)a.datepicker._adjustDate(c.target,+7,"D");p=c.ctrlKey||c.metaKey;break;default:p=false}else if(c.keyCode==36&&c.ctrlKey)a.datepicker._showDatepicker(this);else p=false;if(p){c.preventDefault();c.stopPropagation()}},_doKeyPress:function(c){var e=a.datepicker._getInst(c.target);if(a.datepicker._get(e,"constrainInput")){e=a.datepicker._possibleChars(a.datepicker._get(e,"dateFormat"));
var p=String.fromCharCode(c.charCode==undefined?c.keyCode:c.charCode);return c.ctrlKey||p<" "||!e||e.indexOf(p)>-1}},_doKeyUp:function(c){c=a.datepicker._getInst(c.target);if(c.input.val()!=c.lastVal)try{if(a.datepicker.parseDate(a.datepicker._get(c,"dateFormat"),c.input?c.input.val():null,a.datepicker._getFormatConfig(c))){a.datepicker._setDateFromField(c);a.datepicker._updateAlternate(c);a.datepicker._updateDatepicker(c)}}catch(e){a.datepicker.log(e)}return true},_showDatepicker:function(c){c=c.target||
c;if(c.nodeName.toLowerCase()!="input")c=a("input",c.parentNode)[0];if(!(a.datepicker._isDisabledDatepicker(c)||a.datepicker._lastInput==c)){var e=a.datepicker._getInst(c);a.datepicker._curInst&&a.datepicker._curInst!=e&&a.datepicker._curInst.dpDiv.stop(true,true);var p=a.datepicker._get(e,"beforeShow");b(e.settings,p?p.apply(c,[c,e]):{});e.lastVal=null;a.datepicker._lastInput=c;a.datepicker._setDateFromField(e);if(a.datepicker._inDialog)c.value="";if(!a.datepicker._pos){a.datepicker._pos=a.datepicker._findPos(c);
a.datepicker._pos[1]+=c.offsetHeight}var x=false;a(c).parents().each(function(){x|=a(this).css("position")=="fixed";return!x});if(x&&a.browser.opera){a.datepicker._pos[0]-=document.documentElement.scrollLeft;a.datepicker._pos[1]-=document.documentElement.scrollTop}p={left:a.datepicker._pos[0],top:a.datepicker._pos[1]};a.datepicker._pos=null;e.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});a.datepicker._updateDatepicker(e);p=a.datepicker._checkOffset(e,p,x);e.dpDiv.css({position:a.datepicker._inDialog&&
a.blockUI?"static":x?"fixed":"absolute",display:"none",left:p.left+"px",top:p.top+"px"});if(!e.inline){p=a.datepicker._get(e,"showAnim");var t=a.datepicker._get(e,"duration"),z=function(){a.datepicker._datepickerShowing=true;var r=a.datepicker._getBorders(e.dpDiv);e.dpDiv.find("iframe.ui-datepicker-cover").css({left:-r[0],top:-r[1],width:e.dpDiv.outerWidth(),height:e.dpDiv.outerHeight()})};e.dpDiv.zIndex(a(c).zIndex()+1);a.effects&&a.effects[p]?e.dpDiv.show(p,a.datepicker._get(e,"showOptions"),t,
z):e.dpDiv[p||"show"](p?t:null,z);if(!p||!t)z();e.input.is(":visible")&&!e.input.is(":disabled")&&e.input.focus();a.datepicker._curInst=e}}},_updateDatepicker:function(c){var e=this,p=a.datepicker._getBorders(c.dpDiv);c.dpDiv.empty().append(this._generateHTML(c)).find("iframe.ui-datepicker-cover").css({left:-p[0],top:-p[1],width:c.dpDiv.outerWidth(),height:c.dpDiv.outerHeight()}).end().find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout",function(){a(this).removeClass("ui-state-hover");
this.className.indexOf("ui-datepicker-prev")!=-1&&a(this).removeClass("ui-datepicker-prev-hover");this.className.indexOf("ui-datepicker-next")!=-1&&a(this).removeClass("ui-datepicker-next-hover")}).bind("mouseover",function(){if(!e._isDisabledDatepicker(c.inline?c.dpDiv.parent()[0]:c.input[0])){a(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");a(this).addClass("ui-state-hover");this.className.indexOf("ui-datepicker-prev")!=-1&&a(this).addClass("ui-datepicker-prev-hover");
this.className.indexOf("ui-datepicker-next")!=-1&&a(this).addClass("ui-datepicker-next-hover")}}).end().find("."+this._dayOverClass+" a").trigger("mouseover").end();p=this._getNumberOfMonths(c);var x=p[1];x>1?c.dpDiv.addClass("ui-datepicker-multi-"+x).css("width",17*x+"em"):c.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");c.dpDiv[(p[0]!=1||p[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");c.dpDiv[(this._get(c,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");
c==a.datepicker._curInst&&a.datepicker._datepickerShowing&&c.input&&c.input.is(":visible")&&!c.input.is(":disabled")&&c.input.focus()},_getBorders:function(c){var e=function(p){return{thin:1,medium:2,thick:3}[p]||p};return[parseFloat(e(c.css("border-left-width"))),parseFloat(e(c.css("border-top-width")))]},_checkOffset:function(c,e,p){var x=c.dpDiv.outerWidth(),t=c.dpDiv.outerHeight(),z=c.input?c.input.outerWidth():0,r=c.input?c.input.outerHeight():0,m=document.documentElement.clientWidth+a(document).scrollLeft(),
l=document.documentElement.clientHeight+a(document).scrollTop();e.left-=this._get(c,"isRTL")?x-z:0;e.left-=p&&e.left==c.input.offset().left?a(document).scrollLeft():0;e.top-=p&&e.top==c.input.offset().top+r?a(document).scrollTop():0;e.left-=Math.min(e.left,e.left+x>m&&m>x?Math.abs(e.left+x-m):0);e.top-=Math.min(e.top,e.top+t>l&&l>t?Math.abs(t+r):0);return e},_findPos:function(c){for(var e=this._get(this._getInst(c),"isRTL");c&&(c.type=="hidden"||c.nodeType!=1);)c=c[e?"previousSibling":"nextSibling"];
c=a(c).offset();return[c.left,c.top]},_hideDatepicker:function(c){var e=this._curInst;if(!(!e||c&&e!=a.data(c,"datepicker")))if(this._datepickerShowing){c=this._get(e,"showAnim");var p=this._get(e,"duration"),x=function(){a.datepicker._tidyDialog(e);this._curInst=null};a.effects&&a.effects[c]?e.dpDiv.hide(c,a.datepicker._get(e,"showOptions"),p,x):e.dpDiv[c=="slideDown"?"slideUp":c=="fadeIn"?"fadeOut":"hide"](c?p:null,x);c||x();if(c=this._get(e,"onClose"))c.apply(e.input?e.input[0]:null,[e.input?e.input.val():
"",e]);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(a.blockUI){a.unblockUI();a("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(c){c.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(c){if(a.datepicker._curInst){c=a(c.target);c[0].id!=a.datepicker._mainDivId&&c.parents("#"+a.datepicker._mainDivId).length==0&&!c.hasClass(a.datepicker.markerClassName)&&
!c.hasClass(a.datepicker._triggerClass)&&a.datepicker._datepickerShowing&&!(a.datepicker._inDialog&&a.blockUI)&&a.datepicker._hideDatepicker()}},_adjustDate:function(c,e,p){c=a(c);var x=this._getInst(c[0]);if(!this._isDisabledDatepicker(c[0])){this._adjustInstDate(x,e+(p=="M"?this._get(x,"showCurrentAtPos"):0),p);this._updateDatepicker(x)}},_gotoToday:function(c){c=a(c);var e=this._getInst(c[0]);if(this._get(e,"gotoCurrent")&&e.currentDay){e.selectedDay=e.currentDay;e.drawMonth=e.selectedMonth=e.currentMonth;
e.drawYear=e.selectedYear=e.currentYear}else{var p=new Date;e.selectedDay=p.getDate();e.drawMonth=e.selectedMonth=p.getMonth();e.drawYear=e.selectedYear=p.getFullYear()}this._notifyChange(e);this._adjustDate(c)},_selectMonthYear:function(c,e,p){c=a(c);var x=this._getInst(c[0]);x._selectingMonthYear=false;x["selected"+(p=="M"?"Month":"Year")]=x["draw"+(p=="M"?"Month":"Year")]=parseInt(e.options[e.selectedIndex].value,10);this._notifyChange(x);this._adjustDate(c)},_clickMonthYear:function(c){c=this._getInst(a(c)[0]);
c.input&&c._selectingMonthYear&&!a.browser.msie&&c.input.focus();c._selectingMonthYear=!c._selectingMonthYear},_selectDay:function(c,e,p,x){var t=a(c);if(!(a(x).hasClass(this._unselectableClass)||this._isDisabledDatepicker(t[0]))){t=this._getInst(t[0]);t.selectedDay=t.currentDay=a("a",x).html();t.selectedMonth=t.currentMonth=e;t.selectedYear=t.currentYear=p;this._selectDate(c,this._formatDate(t,t.currentDay,t.currentMonth,t.currentYear))}},_clearDate:function(c){c=a(c);this._getInst(c[0]);this._selectDate(c,
"")},_selectDate:function(c,e){var p=this._getInst(a(c)[0]);e=e!=null?e:this._formatDate(p);p.input&&p.input.val(e);this._updateAlternate(p);var x=this._get(p,"onSelect");if(x)x.apply(p.input?p.input[0]:null,[e,p]);else p.input&&p.input.trigger("change");if(p.inline)this._updateDatepicker(p);else{this._hideDatepicker();this._lastInput=p.input[0];typeof p.input[0]!="object"&&p.input.focus();this._lastInput=null}},_updateAlternate:function(c){var e=this._get(c,"altField");if(e){var p=this._get(c,"altFormat")||
this._get(c,"dateFormat"),x=this._getDate(c),t=this.formatDate(p,x,this._getFormatConfig(c));a(e).each(function(){a(this).val(t)})}},noWeekends:function(c){c=c.getDay();return[c>0&&c<6,""]},iso8601Week:function(c){c=new Date(c.getTime());c.setDate(c.getDate()+4-(c.getDay()||7));var e=c.getTime();c.setMonth(0);c.setDate(1);return Math.floor(Math.round((e-c)/864E5)/7)+1},parseDate:function(c,e,p){if(c==null||e==null)throw"Invalid arguments";e=typeof e=="object"?e.toString():e+"";if(e=="")return null;
for(var x=(p?p.shortYearCutoff:null)||this._defaults.shortYearCutoff,t=(p?p.dayNamesShort:null)||this._defaults.dayNamesShort,z=(p?p.dayNames:null)||this._defaults.dayNames,r=(p?p.monthNamesShort:null)||this._defaults.monthNamesShort,m=(p?p.monthNames:null)||this._defaults.monthNames,l=p=-1,q=-1,u=-1,g=false,o=function(J){(J=H+1<c.length&&c.charAt(H+1)==J)&&H++;return J},y=function(J){o(J);J=RegExp("^\\d{1,"+(J=="@"?14:J=="!"?20:J=="y"?4:J=="o"?3:2)+"}");J=e.substring(G).match(J);if(!J)throw"Missing number at position "+
G;G+=J[0].length;return parseInt(J[0],10)},v=function(J,Q,aa){J=o(J)?aa:Q;for(Q=0;Q<J.length;Q++)if(e.substr(G,J[Q].length)==J[Q]){G+=J[Q].length;return Q+1}throw"Unknown name at position "+G;},C=function(){if(e.charAt(G)!=c.charAt(H))throw"Unexpected literal at position "+G;G++},G=0,H=0;H<c.length;H++)if(g)if(c.charAt(H)=="'"&&!o("'"))g=false;else C();else switch(c.charAt(H)){case "d":q=y("d");break;case "D":v("D",t,z);break;case "o":u=y("o");break;case "m":l=y("m");break;case "M":l=v("M",r,m);break;
case "y":p=y("y");break;case "@":var F=new Date(y("@"));p=F.getFullYear();l=F.getMonth()+1;q=F.getDate();break;case "!":F=new Date((y("!")-this._ticksTo1970)/1E4);p=F.getFullYear();l=F.getMonth()+1;q=F.getDate();break;case "'":if(o("'"))C();else g=true;break;default:C()}if(p==-1)p=(new Date).getFullYear();else if(p<100)p+=(new Date).getFullYear()-(new Date).getFullYear()%100+(p<=x?0:-100);if(u>-1){l=1;q=u;do{x=this._getDaysInMonth(p,l-1);if(q<=x)break;l++;q-=x}while(1)}F=this._daylightSavingAdjust(new Date(p,
l-1,q));if(F.getFullYear()!=p||F.getMonth()+1!=l||F.getDate()!=q)throw"Invalid date";return F},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1E7,formatDate:function(c,e,p){if(!e)return"";var x=(p?p.dayNamesShort:null)||this._defaults.dayNamesShort,t=(p?
p.dayNames:null)||this._defaults.dayNames,z=(p?p.monthNamesShort:null)||this._defaults.monthNamesShort;p=(p?p.monthNames:null)||this._defaults.monthNames;var r=function(o){(o=g+1<c.length&&c.charAt(g+1)==o)&&g++;return o},m=function(o,y,v){y=""+y;if(r(o))for(;y.length<v;)y="0"+y;return y},l=function(o,y,v,C){return r(o)?C[y]:v[y]},q="",u=false;if(e)for(var g=0;g<c.length;g++)if(u)if(c.charAt(g)=="'"&&!r("'"))u=false;else q+=c.charAt(g);else switch(c.charAt(g)){case "d":q+=m("d",e.getDate(),2);break;
case "D":q+=l("D",e.getDay(),x,t);break;case "o":q+=m("o",(e.getTime()-(new Date(e.getFullYear(),0,0)).getTime())/864E5,3);break;case "m":q+=m("m",e.getMonth()+1,2);break;case "M":q+=l("M",e.getMonth(),z,p);break;case "y":q+=r("y")?e.getFullYear():(e.getYear()%100<10?"0":"")+e.getYear()%100;break;case "@":q+=e.getTime();break;case "!":q+=e.getTime()*1E4+this._ticksTo1970;break;case "'":if(r("'"))q+="'";else u=true;break;default:q+=c.charAt(g)}return q},_possibleChars:function(c){for(var e="",p=false,
x=function(z){(z=t+1<c.length&&c.charAt(t+1)==z)&&t++;return z},t=0;t<c.length;t++)if(p)if(c.charAt(t)=="'"&&!x("'"))p=false;else e+=c.charAt(t);else switch(c.charAt(t)){case "d":case "m":case "y":case "@":e+="0123456789";break;case "D":case "M":return null;case "'":if(x("'"))e+="'";else p=true;break;default:e+=c.charAt(t)}return e},_get:function(c,e){return c.settings[e]!==undefined?c.settings[e]:this._defaults[e]},_setDateFromField:function(c,e){if(c.input.val()!=c.lastVal){var p=this._get(c,"dateFormat"),
x=c.lastVal=c.input?c.input.val():null,t,z;t=z=this._getDefaultDate(c);var r=this._getFormatConfig(c);try{t=this.parseDate(p,x,r)||z}catch(m){this.log(m);x=e?"":x}c.selectedDay=t.getDate();c.drawMonth=c.selectedMonth=t.getMonth();c.drawYear=c.selectedYear=t.getFullYear();c.currentDay=x?t.getDate():0;c.currentMonth=x?t.getMonth():0;c.currentYear=x?t.getFullYear():0;this._adjustInstDate(c)}},_getDefaultDate:function(c){return this._restrictMinMax(c,this._determineDate(c,this._get(c,"defaultDate"),new Date))},
_determineDate:function(c,e,p){var x=function(z){var r=new Date;r.setDate(r.getDate()+z);return r},t=function(z){try{return a.datepicker.parseDate(a.datepicker._get(c,"dateFormat"),z,a.datepicker._getFormatConfig(c))}catch(r){}var m=(z.toLowerCase().match(/^c/)?a.datepicker._getDate(c):null)||new Date,l=m.getFullYear(),q=m.getMonth();m=m.getDate();for(var u=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,g=u.exec(z);g;){switch(g[2]||"d"){case "d":case "D":m+=parseInt(g[1],10);break;case "w":case "W":m+=parseInt(g[1],
10)*7;break;case "m":case "M":q+=parseInt(g[1],10);m=Math.min(m,a.datepicker._getDaysInMonth(l,q));break;case "y":case "Y":l+=parseInt(g[1],10);m=Math.min(m,a.datepicker._getDaysInMonth(l,q));break}g=u.exec(z)}return new Date(l,q,m)};if(e=(e=e==null?p:typeof e=="string"?t(e):typeof e=="number"?isNaN(e)?p:x(e):e)&&e.toString()=="Invalid Date"?p:e){e.setHours(0);e.setMinutes(0);e.setSeconds(0);e.setMilliseconds(0)}return this._daylightSavingAdjust(e)},_daylightSavingAdjust:function(c){if(!c)return null;
c.setHours(c.getHours()>12?c.getHours()+2:0);return c},_setDate:function(c,e,p){var x=!e,t=c.selectedMonth,z=c.selectedYear;e=this._restrictMinMax(c,this._determineDate(c,e,new Date));c.selectedDay=c.currentDay=e.getDate();c.drawMonth=c.selectedMonth=c.currentMonth=e.getMonth();c.drawYear=c.selectedYear=c.currentYear=e.getFullYear();if((t!=c.selectedMonth||z!=c.selectedYear)&&!p)this._notifyChange(c);this._adjustInstDate(c);if(c.input)c.input.val(x?"":this._formatDate(c))},_getDate:function(c){return!c.currentYear||
c.input&&c.input.val()==""?null:this._daylightSavingAdjust(new Date(c.currentYear,c.currentMonth,c.currentDay))},_generateHTML:function(c){var e=new Date;e=this._daylightSavingAdjust(new Date(e.getFullYear(),e.getMonth(),e.getDate()));var p=this._get(c,"isRTL"),x=this._get(c,"showButtonPanel"),t=this._get(c,"hideIfNoPrevNext"),z=this._get(c,"navigationAsDateFormat"),r=this._getNumberOfMonths(c),m=this._get(c,"showCurrentAtPos"),l=this._get(c,"stepMonths"),q=r[0]!=1||r[1]!=1,u=this._daylightSavingAdjust(!c.currentDay?
new Date(9999,9,9):new Date(c.currentYear,c.currentMonth,c.currentDay)),g=this._getMinMaxDate(c,"min"),o=this._getMinMaxDate(c,"max");m=c.drawMonth-m;var y=c.drawYear;if(m<0){m+=12;y--}if(o){var v=this._daylightSavingAdjust(new Date(o.getFullYear(),o.getMonth()-r[0]*r[1]+1,o.getDate()));for(v=g&&v<g?g:v;this._daylightSavingAdjust(new Date(y,m,1))>v;){m--;if(m<0){m=11;y--}}}c.drawMonth=m;c.drawYear=y;v=this._get(c,"prevText");v=!z?v:this.formatDate(v,this._daylightSavingAdjust(new Date(y,m-l,1)),this._getFormatConfig(c));
v=this._canAdjustMonth(c,-1,y,m)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+k+".datepicker._adjustDate('#"+c.id+"', -"+l+", 'M');\" title=\""+v+'"><span class="ui-icon ui-icon-circle-triangle-'+(p?"e":"w")+'">'+v+"</span></a>":t?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+v+'"><span class="ui-icon ui-icon-circle-triangle-'+(p?"e":"w")+'">'+v+"</span></a>";var C=this._get(c,"nextText");C=!z?C:this.formatDate(C,this._daylightSavingAdjust(new Date(y,
m+l,1)),this._getFormatConfig(c));t=this._canAdjustMonth(c,+1,y,m)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+k+".datepicker._adjustDate('#"+c.id+"', +"+l+", 'M');\" title=\""+C+'"><span class="ui-icon ui-icon-circle-triangle-'+(p?"w":"e")+'">'+C+"</span></a>":t?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+C+'"><span class="ui-icon ui-icon-circle-triangle-'+(p?"w":"e")+'">'+C+"</span></a>";l=this._get(c,"currentText");C=this._get(c,"gotoCurrent")&&
c.currentDay?u:e;l=!z?l:this.formatDate(l,C,this._getFormatConfig(c));z=!c.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+k+'.datepicker._hideDatepicker();">'+this._get(c,"closeText")+"</button>":"";x=x?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(p?z:"")+(this._isInRange(c,C)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+
k+".datepicker._gotoToday('#"+c.id+"');\">"+l+"</button>":"")+(p?"":z)+"</div>":"";z=parseInt(this._get(c,"firstDay"),10);z=isNaN(z)?0:z;l=this._get(c,"showWeek");C=this._get(c,"dayNames");this._get(c,"dayNamesShort");var G=this._get(c,"dayNamesMin"),H=this._get(c,"monthNames"),F=this._get(c,"monthNamesShort"),J=this._get(c,"beforeShowDay"),Q=this._get(c,"showOtherMonths"),aa=this._get(c,"selectOtherMonths");this._get(c,"calculateWeek");for(var ca=this._getDefaultDate(c),qa="",ja=0;ja<r[0];ja++){for(var ga=
"",ma=0;ma<r[1];ma++){var ka=this._daylightSavingAdjust(new Date(y,m,c.selectedDay)),S=" ui-corner-all",fa="";if(q){fa+='<div class="ui-datepicker-group';if(r[1]>1)switch(ma){case 0:fa+=" ui-datepicker-group-first";S=" ui-corner-"+(p?"right":"left");break;case r[1]-1:fa+=" ui-datepicker-group-last";S=" ui-corner-"+(p?"left":"right");break;default:fa+=" ui-datepicker-group-middle";S="";break}fa+='">'}fa+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+S+'">'+(/all|left/.test(S)&&
ja==0?p?t:v:"")+(/all|right/.test(S)&&ja==0?p?v:t:"")+this._generateMonthYearHeader(c,m,y,g,o,ja>0||ma>0,H,F)+'</div><table class="ui-datepicker-calendar"><thead><tr>';var ha=l?'<th class="ui-datepicker-week-col">'+this._get(c,"weekHeader")+"</th>":"";for(S=0;S<7;S++){var O=(S+z)%7;ha+="<th"+((S+z+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+C[O]+'">'+G[O]+"</span></th>"}fa+=ha+"</tr></thead><tbody>";ha=this._getDaysInMonth(y,m);if(y==c.selectedYear&&m==c.selectedMonth)c.selectedDay=
Math.min(c.selectedDay,ha);S=(this._getFirstDayOfMonth(y,m)-z+7)%7;ha=q?6:Math.ceil((S+ha)/7);O=this._daylightSavingAdjust(new Date(y,m,1-S));for(var P=0;P<ha;P++){fa+="<tr>";var R=!l?"":'<td class="ui-datepicker-week-col">'+this._get(c,"calculateWeek")(O)+"</td>";for(S=0;S<7;S++){var X=J?J.apply(c.input?c.input[0]:null,[O]):[true,""],M=O.getMonth()!=m,W=M&&!aa||!X[0]||g&&O<g||o&&O>o;R+='<td class="'+((S+z+6)%7>=5?" ui-datepicker-week-end":"")+(M?" ui-datepicker-other-month":"")+(O.getTime()==ka.getTime()&&
m==c.selectedMonth&&c._keyEvent||ca.getTime()==O.getTime()&&ca.getTime()==ka.getTime()?" "+this._dayOverClass:"")+(W?" "+this._unselectableClass+" ui-state-disabled":"")+(M&&!Q?"":" "+X[1]+(O.getTime()==u.getTime()?" "+this._currentClass:"")+(O.getTime()==e.getTime()?" ui-datepicker-today":""))+'"'+((!M||Q)&&X[2]?' title="'+X[2]+'"':"")+(W?"":' onclick="DP_jQuery_'+k+".datepicker._selectDay('#"+c.id+"',"+O.getMonth()+","+O.getFullYear()+', this);return false;"')+">"+(M&&!Q?"&#xa0;":W?'<span class="ui-state-default">'+
O.getDate()+"</span>":'<a class="ui-state-default'+(O.getTime()==e.getTime()?" ui-state-highlight":"")+(O.getTime()==u.getTime()?" ui-state-active":"")+(M?" ui-priority-secondary":"")+'" href="#">'+O.getDate()+"</a>")+"</td>";O.setDate(O.getDate()+1);O=this._daylightSavingAdjust(O)}fa+=R+"</tr>"}m++;if(m>11){m=0;y++}fa+="</tbody></table>"+(q?"</div>"+(r[0]>0&&ma==r[1]-1?'<div class="ui-datepicker-row-break"></div>':""):"");ga+=fa}qa+=ga}qa+=x+(a.browser.msie&&parseInt(a.browser.version,10)<7&&!c.inline?
'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':"");c._keyEvent=false;return qa},_generateMonthYearHeader:function(c,e,p,x,t,z,r,m){var l=this._get(c,"changeMonth"),q=this._get(c,"changeYear"),u=this._get(c,"showMonthAfterYear"),g='<div class="ui-datepicker-title">',o="";if(z||!l)o+='<span class="ui-datepicker-month">'+r[e]+"</span>";else{r=x&&x.getFullYear()==p;var y=t&&t.getFullYear()==p;o+='<select class="ui-datepicker-month" onchange="DP_jQuery_'+k+".datepicker._selectMonthYear('#"+
c.id+"', this, 'M');\" onclick=\"DP_jQuery_"+k+".datepicker._clickMonthYear('#"+c.id+"');\">";for(var v=0;v<12;v++)if((!r||v>=x.getMonth())&&(!y||v<=t.getMonth()))o+='<option value="'+v+'"'+(v==e?' selected="selected"':"")+">"+m[v]+"</option>";o+="</select>"}u||(g+=o+(z||!(l&&q)?"&#xa0;":""));if(z||!q)g+='<span class="ui-datepicker-year">'+p+"</span>";else{m=this._get(c,"yearRange").split(":");var C=(new Date).getFullYear();r=function(G){G=G.match(/c[+-].*/)?p+parseInt(G.substring(1),10):G.match(/[+-].*/)?
C+parseInt(G,10):parseInt(G,10);return isNaN(G)?C:G};e=r(m[0]);m=Math.max(e,r(m[1]||""));e=x?Math.max(e,x.getFullYear()):e;m=t?Math.min(m,t.getFullYear()):m;for(g+='<select class="ui-datepicker-year" onchange="DP_jQuery_'+k+".datepicker._selectMonthYear('#"+c.id+"', this, 'Y');\" onclick=\"DP_jQuery_"+k+".datepicker._clickMonthYear('#"+c.id+"');\">";e<=m;e++)g+='<option value="'+e+'"'+(e==p?' selected="selected"':"")+">"+e+"</option>";g+="</select>"}g+=this._get(c,"yearSuffix");if(u)g+=(z||!(l&&q)?
"&#xa0;":"")+o;g+="</div>";return g},_adjustInstDate:function(c,e,p){var x=c.drawYear+(p=="Y"?e:0),t=c.drawMonth+(p=="M"?e:0);e=Math.min(c.selectedDay,this._getDaysInMonth(x,t))+(p=="D"?e:0);x=this._restrictMinMax(c,this._daylightSavingAdjust(new Date(x,t,e)));c.selectedDay=x.getDate();c.drawMonth=c.selectedMonth=x.getMonth();c.drawYear=c.selectedYear=x.getFullYear();if(p=="M"||p=="Y")this._notifyChange(c)},_restrictMinMax:function(c,e){var p=this._getMinMaxDate(c,"min"),x=this._getMinMaxDate(c,"max");
e=p&&e<p?p:e;return e=x&&e>x?x:e},_notifyChange:function(c){var e=this._get(c,"onChangeMonthYear");if(e)e.apply(c.input?c.input[0]:null,[c.selectedYear,c.selectedMonth+1,c])},_getNumberOfMonths:function(c){c=this._get(c,"numberOfMonths");return c==null?[1,1]:typeof c=="number"?[1,c]:c},_getMinMaxDate:function(c,e){return this._determineDate(c,this._get(c,e+"Date"),null)},_getDaysInMonth:function(c,e){return 32-(new Date(c,e,32)).getDate()},_getFirstDayOfMonth:function(c,e){return(new Date(c,e,1)).getDay()},
_canAdjustMonth:function(c,e,p,x){var t=this._getNumberOfMonths(c);p=this._daylightSavingAdjust(new Date(p,x+(e<0?e:t[0]*t[1]),1));e<0&&p.setDate(this._getDaysInMonth(p.getFullYear(),p.getMonth()));return this._isInRange(c,p)},_isInRange:function(c,e){var p=this._getMinMaxDate(c,"min"),x=this._getMinMaxDate(c,"max");return(!p||e.getTime()>=p.getTime())&&(!x||e.getTime()<=x.getTime())},_getFormatConfig:function(c){var e=this._get(c,"shortYearCutoff");e=typeof e!="string"?e:(new Date).getFullYear()%
100+parseInt(e,10);return{shortYearCutoff:e,dayNamesShort:this._get(c,"dayNamesShort"),dayNames:this._get(c,"dayNames"),monthNamesShort:this._get(c,"monthNamesShort"),monthNames:this._get(c,"monthNames")}},_formatDate:function(c,e,p,x){if(!e){c.currentDay=c.selectedDay;c.currentMonth=c.selectedMonth;c.currentYear=c.selectedYear}e=e?typeof e=="object"?e:this._daylightSavingAdjust(new Date(x,p,e)):this._daylightSavingAdjust(new Date(c.currentYear,c.currentMonth,c.currentDay));return this.formatDate(this._get(c,
"dateFormat"),e,this._getFormatConfig(c))}});a.fn.datepicker=function(c){if(!a.datepicker.initialized){a(document).mousedown(a.datepicker._checkExternalClick).find("body").append(a.datepicker.dpDiv);a.datepicker.initialized=true}var e=Array.prototype.slice.call(arguments,1);if(typeof c=="string"&&(c=="isDisabled"||c=="getDate"||c=="widget"))return a.datepicker["_"+c+"Datepicker"].apply(a.datepicker,[this[0]].concat(e));if(c=="option"&&arguments.length==2&&typeof arguments[1]=="string")return a.datepicker["_"+
c+"Datepicker"].apply(a.datepicker,[this[0]].concat(e));return this.each(function(){typeof c=="string"?a.datepicker["_"+c+"Datepicker"].apply(a.datepicker,[this].concat(e)):a.datepicker._attachDatepicker(this,c)})};a.datepicker=new d;a.datepicker.initialized=false;a.datepicker.uuid=(new Date).getTime();a.datepicker.version="1.8.2";window["DP_jQuery_"+k]=a})(jQuery);
(function(){window.Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(a){var d="",b,k,c,e,p,x,t=0;for(a=Base64._utf8_encode(a);t<a.length;){b=a.charCodeAt(t++);k=a.charCodeAt(t++);c=a.charCodeAt(t++);e=b>>2;b=(b&3)<<4|k>>4;p=(k&15)<<2|c>>6;x=c&63;if(isNaN(k))p=x=64;else if(isNaN(c))x=64;d=d+this._keyStr.charAt(e)+this._keyStr.charAt(b)+this._keyStr.charAt(p)+this._keyStr.charAt(x)}return d},decode:function(a){var d="",b,k,c,e,p,x=0;for(a=a.replace(/[^A-Za-z0-9\+\/\=]/g,
"");x<a.length;){b=this._keyStr.indexOf(a.charAt(x++));k=this._keyStr.indexOf(a.charAt(x++));e=this._keyStr.indexOf(a.charAt(x++));p=this._keyStr.indexOf(a.charAt(x++));b=b<<2|k>>4;k=(k&15)<<4|e>>2;c=(e&3)<<6|p;d+=String.fromCharCode(b);if(e!=64)d+=String.fromCharCode(k);if(p!=64)d+=String.fromCharCode(c)}return d=Base64._utf8_decode(d)},_utf8_encode:function(a){a=a.replace(/\r\n/g,"\n");for(var d="",b=0;b<a.length;b++){var k=a.charCodeAt(b);if(k<128)d+=String.fromCharCode(k);else{if(k>127&&k<2048)d+=
String.fromCharCode(k>>6|192);else{d+=String.fromCharCode(k>>12|224);d+=String.fromCharCode(k>>6&63|128)}d+=String.fromCharCode(k&63|128)}}return d},_utf8_decode:function(a){for(var d="",b=0,k=c1=c2=0;b<a.length;){k=a.charCodeAt(b);if(k<128){d+=String.fromCharCode(k);b++}else if(k>191&&k<224){c2=a.charCodeAt(b+1);d+=String.fromCharCode((k&31)<<6|c2&63);b+=2}else{c2=a.charCodeAt(b+1);c3=a.charCodeAt(b+2);d+=String.fromCharCode((k&15)<<12|(c2&63)<<6|c3&63);b+=3}}return d}}})();
if(typeof org=="undefined")var org={};if(typeof org.openx=="undefined")org.openx={};if(typeof org.openx.util=="undefined")org.openx.util={};if(typeof org.openx.SWFObjectUtil=="undefined")org.openx.SWFObjectUtil={};
org.openx.SWFObject=function(a,d,b,k,c,e,p,x,t,z){if(document.getElementById){this.DETECT_KEY=z?z:"detectflash";this.skipDetect=org.openx.util.getRequestParameter(this.DETECT_KEY);this.params={};this.variables={};this.attributes=[];a&&this.setAttribute("swf",a);d&&this.setAttribute("id",d);b&&this.setAttribute("width",b);k&&this.setAttribute("height",k);c&&this.setAttribute("version",new org.openx.PlayerVersion(c.toString().split(".")));this.installedVer=org.openx.SWFObjectUtil.getPlayerVersion();
if(!window.opera&&document.all&&this.installedVer.major>7)org.openx.SWFObject.doPrepUnload=true;e&&this.addParam("bgcolor",e);this.addParam("quality",p?p:"high");this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);this.setAttribute("xiRedirectUrl",x?x:window.location);this.setAttribute("redirectUrl","");t&&this.setAttribute("redirectUrl",t)}};
org.openx.SWFObject.prototype={useExpressInstall:function(a){this.xiSWFPath=!a?"expressinstall.swf":a;this.setAttribute("useExpressInstall",true)},setAttribute:function(a,d){this.attributes[a]=d},getAttribute:function(a){return this.attributes[a]},addParam:function(a,d){this.params[a]=d},getParams:function(){return this.params},addVariable:function(a,d){this.variables[a]=d},getVariable:function(a){return this.variables[a]},getVariables:function(){return this.variables},getVariablePairs:function(){var a=
[],d,b=this.getVariables();for(d in b)a[a.length]=d+"="+b[d];return a},getSWFHTML:function(){var a="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath)}a='<embed type="application/x-shockwave-flash" src="'+this.getAttribute("swf")+'" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'"';a+=
' id="'+this.getAttribute("id")+'" name="'+this.getAttribute("id")+'" ';var d=this.getParams();for(var b in d)a+=[b]+'="'+d[b]+'" ';b=this.getVariablePairs().join("&");if(b.length>0)a+='flashvars="'+b+'"';a+="/>"}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath)}a='<object id="'+this.getAttribute("id")+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+
'" style="'+this.getAttribute("style")+'">';a+='<param name="movie" value="'+this.getAttribute("swf")+'" />';d=this.getParams();for(b in d)a+='<param name="'+b+'" value="'+d[b]+'" />';b=this.getVariablePairs().join("&");if(b.length>0)a+='<param name="flashvars" value="'+b+'" />';a+="</object>"}return a},write:function(a){if(this.getAttribute("useExpressInstall"))if(this.installedVer.versionIsValid(new org.openx.PlayerVersion([6,0,65]))&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",
true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title)}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){(typeof a=="string"?document.getElementById(a):a).innerHTML=this.getSWFHTML();return true}else this.getAttribute("redirectUrl")!=""&&document.location.replace(this.getAttribute("redirectUrl"));
return false}};
org.openx.SWFObjectUtil.getPlayerVersion=function(){var a=new org.openx.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var d=navigator.plugins["Shockwave Flash"];if(d&&d.description)a=new org.openx.PlayerVersion(d.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."))}else if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){d=1;for(var b=3;d;)try{b++;d=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+b);a=new org.openx.PlayerVersion([b,
0,0])}catch(k){d=null}}else{try{d=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(c){try{d=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");a=new org.openx.PlayerVersion([6,0,21]);d.AllowScriptAccess="always"}catch(e){if(a.major==6)return a}try{d=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(p){}}if(d!=null)a=new org.openx.PlayerVersion(d.GetVariable("$version").split(" ")[1].split(","))}return a};
org.openx.PlayerVersion=function(a){this.major=a[0]!=null?parseInt(a[0]):0;this.minor=a[1]!=null?parseInt(a[1]):0;this.rev=a[2]!=null?parseInt(a[2]):0};org.openx.PlayerVersion.prototype.versionIsValid=function(a){if(this.major<a.major)return false;if(this.major>a.major)return true;if(this.minor<a.minor)return false;if(this.minor>a.minor)return true;if(this.rev<a.rev)return false;return true};
org.openx.util={getRequestParameter:function(a){var d=document.location.search||document.location.hash;if(a==null)return d;if(d){d=d.substring(1).split("&");for(var b=0;b<d.length;b++)if(d[b].substring(0,d[b].indexOf("="))==a)return d[b].substring(d[b].indexOf("=")+1)}return""}};org.openx.SWFObjectUtil.cleanupSWFs=function(){for(var a=document.getElementsByTagName("OBJECT"),d=a.length-1;d>=0;d--){a[d].style.display="none";for(var b in a[d])if(typeof a[d][b]=="function")a[d][b]=function(){}}};
if(org.openx.SWFObject.doPrepUnload)if(!org.openx.unloadSet){org.openx.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",org.openx.SWFObjectUtil.cleanupSWFs)};window.attachEvent("onbeforeunload",org.openx.SWFObjectUtil.prepUnload);org.openx.unloadSet=true}if(!document.getElementById&&document.all)document.getElementById=function(a){return document.all[a]};
var getQueryParamValue=org.openx.util.getRequestParameter,FlashObject=org.openx.SWFObject,SWFObject=org.openx.SWFObject;document.mmm_fo=1;
(function(a){function d(){a(document).bind("mousemove",b.Tick);b.Tick();e()}var b={};window.quakelive=b;b.modules={};b.hooks={};b.skipEndGame=false;b.pathParts=[];b.activeModule=null;b.exports={};b.session=null;b.username=null;b.password=null;b.groups=[];b.userid=0;b.userstatus="";b.userinfo={};b.startupInviteCount=0;b.xmppDispatcher=null;b.xmppClient=null;b.clans=[];b.clanid=0;b.activeClan=null;b.isQueued=0;b.headless=false;b.pathHistory=[];b.defaultSiteConfig={xmppDomain:"xmpp-dev.idsoftware.com",
realm:"qztest",cdnUrl:"http://%LOCATION%",baseUrl:"http://%LOCATION%",secureBaseUrl:"https://%LOCATION%",staticUrl:"http://%LOCATION%",trackPageViews:false,showPostGameAlways:false,deliveryUrl:"http://media.quakelive.com/delivery/spc.php",randomStatusIcon:false,premiumStatus:"standard",homeOverride:""};b.PlayerAvatarPath={SM:"/images/players/icon_sm/",MD:"/images/players/icon_md/",LG:"/images/players/icon_lg/",XL:"/images/players/icon_xl/",G_SM:"/images/players/icon_gray_sm/",G_MD:"/images/players/icon_gray_md/",
G_LG:"/images/players/icon_gray_lg/",G_XL:"/images/players/icon_gray_xl/"};b.SwapAvatarPath=function(o,y){for(var v in b.PlayerAvatarPath)o=o.replace(b.PlayerAvatarPath[v],y);return o};b.resource=function(o){if(typeof o!="string")return"";var y=o.lastIndexOf(".");if(y!=-1){var v=0;if(b.siteConfig.realm=="qztest")v=Math.floor(Math.random()*99999999);o=o.substring(0,y)+"_v"+b.siteConfig.resourceRevision+"."+v+o.substring(y)}return b.siteConfig.staticUrl+o};b.CleanupPath=function(o){for(o=b.UndecorateAnchor(o);o.charAt(0)==
"/";)o=o.substring(1);for(;o.charAt(o.length-1)=="/";)o=o.substring(0,o.length-1);return o};b.ExtractParams=function(o,y,v){v=v||{};for(y=y;y<o.length;++y){var C=o[y].split("=",2);v[C[0]]=C[1]}return v};b.MergeParams=function(o){var y="",v=0;for(var C in o){if(v++>0)y+=";";y+=C+"="+o[C]}return y};b.AddParam=function(o,y){b.params[o]=y};b.RemoveParam=function(o){b.params[o]&&delete b.params[o]};b.HasParam=function(o){return b.params[o]?true:false};b.GetParam=function(o){return b.params[o]};b.BuildSubPath=
function(o){for(var y="",v=0;v<o;++v)if(typeof quakelive.pathParts[v]!="undefined"){if(v>0)y+="/";y+=quakelive.pathParts[v]}return y};b.ParsePath=function(o){var y=quakelive.UndecorateAnchor(o||window.location.hash);if(y.length>0){y=y.split(";");b.path=b.CleanupPath(y[0]);b.params=y.length>1?b.ExtractParams(y,1):{}}else{b.path=b.CleanupPath(window.location.pathname);if(!b.path)b.path=b.userid?b.GetUserHome():b.home;b.params={};b.SetAnchor(b.path)}b.location=window.location;b.pathParts=b.path.split("/")||
[];b.prevActiveModule=b.activeModule;if(b.pathParts.length>0){b.activeModule=b["mod_"+b.pathParts[0]];if(b.activeModule)b.activeModule.ModuleActivate();else b.activeModule=null}else b.activeModule=null;!b.activeModule&&o!="sorry"&&b.ParsePath("sorry")};b.AddToPathHistory=function(o){o=b.UndecorateAnchor(o);if(!(b.pathHistory.length&&b.pathHistory[b.pathHistory.length-1]==o)){b.pathHistory.push(o);b.pathHistory.length>5&&b.pathHistory.splice(0,1)}};b.GetPathHistory=function(o){if(b.pathHistory.length<
1)return b.GetUserHome();o=o+1;if(o>b.pathHistory.length)o=b.pathHistory.length;return b.pathHistory[b.pathHistory.length-o]};b.Goto=function(o,y,v){if(typeof window.onbeforeunload=="function"){var C="Are you sure you want to navigate away from this page?\n\n"+window.onbeforeunload()+"\n\nPress OK to continue, or Cancel to stay on the current page.";if(!confirm(C))return;window.onbeforeunload=null}if(!quakelive.IsLoggedIn()&&ReadCookie(quakelive.siteConfig.aluCookie)!==null&&ReadCookie(quakelive.siteConfig.alpCookie)!==
null)quakelive.PageRedirect("/user/login_redirect");else{if(quakelive.isQueued)o="queue";if(quakelive.IsLoggedIn()&&o=="register")o=b.home;b.HideOverlay();b.ShutdownGame();C={};if(typeof y=="string")b.ExtractParams(y.split(";"),0,C);else C=typeof y=="object"?a.extend({},y):{};y=o;if(C=b.MergeParams(C))y+=";"+C;if(!v){b.SetMonitorPath(b.DecorateAnchor(y));b.SetAnchor(y)}b.AddToPathHistory(y);b.ParsePath(y);b.LoadLayout(b.activeModule.GetLayout());b.TrackPageView(o);b.ScrollToTop()}};b.BuildGotoURL=
function(o,y,v){v=v?b.siteConfig.secureBaseUrl:b.siteConfig.baseUrl;v+="/"+b.DecorateAnchor(o);o=typeof y=="string"?b.ExtractParams(y.split(";"),0):a.isPlainObject(y)?a.extend({},y):{};if(o=b.MergeParams(o))v+=";"+o;return v};b.GotoSecure=function(o,y){b.IsSecure()?b.Goto(o,y):b.PageRedirect(b.BuildGotoURL(o,y,true))};b.GotoInsecure=function(o,y){b.IsSecure()?b.PageRedirect(b.BuildGotoURL(o,y,false)):b.Goto(o,y)};b.ScrollToTop=function(){window.scrollBy(-99999,-99999)};b.GetLoadingBar=function(){return"<div id='loading-outer'><div id='loading-inner'>Loading&hellip;<div id='loading-image'></div></div></div>"};
b.ConfirmInstallClose=function(){confirm("This QUAKE LIVE update is mandatory. Are you sure you want to close?\n\nYou will be logged out of QUAKE LIVE if you proceed.")&&quakelive.PageRedirect("/user/logout")};b.Overlay=function(o,y,v){b.TrackPageView(o);a("#overlay-content").html(b.GetLoadingBar());a.get(o,null,function(C){a("#overlay-content").html(C);b.SendModuleMessage("OnOverlayLoaded",o.split("/"))});a("#overlay-bg").css("display","inline");y||(y="quakelive.CloseOverlay(); return false");a("#overlay-close").html('<a href="javascript:;" onclick="'+
y+'"><img src="'+quakelive.resource("/images/site/close.png")+'" class="pngfix" border="0" width="71" height="13" /></a>');a("#overlay").css("display","inline");if(!v){b.params.overlay=o;if(y=b.MergeParams(b.params))y=";"+y;b.SetAnchor(quakelive.path+y)}};b.OverlayRaw=function(o,y){b.TrackPageView(o);a("#overlay-raw").html(b.GetLoadingBar());a.get(o,null,function(v){a("#overlay-raw").html(v);y&&y()});a("#overlay-bg").css("display","inline");a("#overlay-raw").css("display","inline")};b.CloseOverlay=
function(){a("#overlay-bg").hide();a("#overlay").hide();if(b.path){b.SetAnchor(b.path);b.ParsePath()}};b.CURRENT_LAYOUT=null;b.LAYOUT_CACHE={};b.LoadLayout=function(o,y){if(b.CURRENT_LAYOUT==o){b.OnLayoutLoaded();y&&y()}else{b.FlushVertCache();b.CURRENT_LAYOUT=o;b.LAYOUT_CACHE[o]?b.LoadLayout_Success(b.LAYOUT_CACHE[o],o,y):a.ajax({type:"get",url:"/layout/"+o,dataType:"html",success:function(v){b.LAYOUT_CACHE[o]=v;b.LoadLayout_Success(v,o,y)},error:b.LoadLayout_Error})}};b.LoadLayout_Error=function(){};
b.LoadLayout_Success=function(o,y,v){a("#body-container").html(o);a("body").attr("class","lyt_"+y);b.OnLayoutLoaded();v&&v()};var k=0;b.Tick=function(){k=(new Date).getTime()};var c=({"https:":15,"http:":30}[window.location.protocol]||30)*60*1E3,e=function(){var o=(new Date).getTime();if(b.IsGameRunning())k=o;if(a.inArray("id",quakelive.groups)!==-1)k=o;o-k>c?a.ajax({url:"/forum/pinglastactivity.php",cache:false,timeout:15E3,dataType:"json",cache:false,error:quakelive.TriggerInactivityMonitor,success:function(y){if(y.ECODE===
0)if(o-y.lastActivity>c)quakelive.TriggerInactivityMonitor();else{k=o;setTimeout(e,6E4)}else quakelive.TriggerInactivityMonitor()}}):setTimeout(e,6E4)};b.TriggerInactivityMonitor=function(){quakelive.PageRedirect("/user/logout/session_expired");a(document).unbind("mousemove")};var p=30,x=false;b.OnPluginInstalled=function(){function o(){if(quakelive.isQueued)quakelive.Goto("queue");else{var G=["Good luck and have fun!","A frag a day keeps the doctor away&hellip;","You have arrived.","Lock and load&hellip;",
"OM NOM NOM&hellip;","Articulating Splines&hellip;","QUAKE LIVE - It's over 9000!","Gotta frag 'em all!","Mirroring reflections&hellip;"];qlHidePrompt();b.SetLoadingBlurb(G[parseInt(Math.random()*G.length)]);b.ParsePath();b.LoadLayout(b.activeModule.GetLayout(),function(){b.inviteMonitor.SetInvitationCount(quakelive.startupInviteCount);b.SendModuleMessage("OnAuthenticatedInit",b.userinfo);d();qz_instance.IsCrashDumpPresent()&&quakelive.Overlay("home/crashed","CloseCrashReport()",true)})}}function y(){if(xmppActive){clearInterval(v);
o()}else C++==p&&qlPrompt({title:"XMPP Connection Failure",body:"We're sorry, but it appears you are having problems connecting to the QUAKE LIVE network. If you are behind a firewall you must make sure that it permits the following connection:<br /><br />Protocol: TCP<br />Host: "+quakelive.siteConfig.xmppDomain+"<br />Port: 5222<br /><br />Contact your network administrator for further instructions, or <a href='javascript:;' onclick='quakelive.mod_support.GotoSupport(); return false'>Click Here</a> to look for help.</p>",
okLabel:"Keep Trying",ok:function(){C=0;qlHidePrompt()},cancelLabel:"Logout",cancel:function(){quakelive.Logout()}})}if(!x){x=true;b.SetLoadingBlurb("Connecting to QUAKE LIVE network&hellip;");var v=0,C=0;v=setInterval(y,1E3);y()}};b.OnLayoutLoaded=function(){b.LoadPathContent();b.params.overlay&&b.Overlay(b.params.overlay);b.SetPageTitle(b.GetPageTitle());b.SendModuleMessage("OnLayoutLoaded")};b.GetPageTitle=function(){var o="";if(b.activeModule.GetTitle)if((o=b.activeModule.GetTitle())!=="")o=" "+
o;return"QUAKE LIVE"+o};b.SetPageTitle=function(o){document.title=o};b.ShowContent=function(o){a("#qlv_contentBody").empty().append(o)};b.GetLoadPath=function(){return b.path};b.LoadPathContent=function(){a.ajax({type:"get",url:b.activeModule.GetLoadPath(),data:b.params,mode:"abort",port:"ql_goto",success:b.LoadPathContent_Success,error:b.LoadPathContent_Error})};b.LoadPathContent_Error=function(){};b.LoadPathContent_Success=function(o){var y=b.GetModule(b.pathParts[0]);y.ShowContent(o);b.SetPageTitle(b.GetPageTitle());
y.DISPLAY.friends&&!b.IsGameRunning()&&b.mod_friends.MoveTo("#qlv_chatControl");b.userid||(b.activeModule==b.mod_welcome?a("#qlv_chatfill").hide():a("#qlv_chatfill").show());b.HideTooltip();var v=b.pathParts[0];if(v==="practice")v=b.home;o=a("#newnav_top .selected");v=a("#newnav_top #tn_"+v);o.toggleClass("selected");v.toggleClass("selected");b.SendModuleMessage("OnContentLoaded",y)};b.currentServerId=0;b.IsGameRunning=function(){if(typeof qz_instance!="undefined")try{return qz_instance.IsGameRunning()}catch(o){return false}else return false};
b.ShutdownGame=function(){if(b.IsGameRunning()){qz_instance.SendGameCommand("quit;");b.currentServerId=0}};var t=function(){};b.RegisterModule=function(o,y){if(b.modules[o]==null){b["mod_"+o]=b.modules[o]=y;if(!y.DISPLAY)y.DISPLAY={friends:true};if(!y.LAYOUT)y.LAYOUT="prelogin";if(!y.ShowContent)y.ShowContent=quakelive.ShowContent;if(!y.GetLoadPath)y.GetLoadPath=quakelive.GetLoadPath;if(!y.GetLayout){var v=y;y.GetLayout=function(){return v.LAYOUT}}if(!y.GetTitle){v=y;y.GetTitle=function(){return v.TITLE||
""}}if(!y.OnModuleInit)y.OnModuleInit=t;if(!y.OnModuleActivated)y.OnModuleActivated=t;y.__initialized=false;y.ModuleActivate=function(){y.__initialized||y.OnModuleInit();y.__initialized=true;y.OnModuleActivated()}}};b.InitPlugin=function(){if(b.IsSecure()){d();b.ParsePath();b.LoadLayout(b.activeModule.GetLayout())}else{b.SetLoadingBlurb("Starting QUAKE LIVE plugin&hellip;");b.xmppDispatcher=new XMPPEventDispatcher;b.xmppDispatcher.RegisterHooks();b.xmppClient=b.xmppDispatcher.CreateClient(b.username);
run_plugin(quakelive.username,quakelive.xaid)}};b.SetLoadingBlurb=function(o){a("#loading-blurb").html(o)};b.IsMemberOf=function(o){o=o.toLowerCase();for(var y in b.groups)if(b.groups[y].toLowerCase()==o)return true;return false};b.IsMemberOfAny=function(o){for(var y in o)if(b.IsMemberOf(o[y]))return true;return false};b.CheckQueuePosition=function(){a.ajax({url:"/queue/status",method:"get",dataType:"json",timeout:2E4,success:function(o){var y=true;if(o.ECODE===0){quakelive.SendModuleMessage("OnQueueStatusUpdated",
o);if(o.pos<0)y=false}y&&setTimeout(b.CheckQueuePosition,3E4)},error:function(){setTimeout(b.CheckQueuePosition,3E4)}})};b.IsDecoratedAnchor=function(o){return o.substring(0,2)=="#!"};b.UndecorateAnchor=function(o){if(b.IsDecoratedAnchor(o))o=o.substring(2);else if(o.substring(0,1)=="#")o=o.substring(1);return o};b.DecorateAnchor=function(o){return"#!"+b.UndecorateAnchor(o)};b.SetAnchor=function(o){window.location.hash=b.DecorateAnchor(o)};b.FixAnchor=function(){var o=window.location.hash;if(!b.IsDecoratedAnchor(o)){b.StopPathMonitor();
b.SetAnchor(o);b.StartPathMonitor()}};b.Init=function(o){b.SetLoadingBlurb("Initializing QUAKE LIVE&hellip;");b.initTime=(new Date).getTime();if(o){if(o.LOGGED_IN){b.isQueued=parseInt(o.QUEUED);b.session=o.SESSION;b.username=o.USERNAME;b.xaid=o.XAID;b.userstatus=o.STATUS;b.userid=parseInt(o.USERID);b.userinfo=a.extend({},o.INFO);b.groups=o.GROUPS;b.cvars.Import(a.extend({},o.CVARS));b.binds.Import(a.extend({},o.BINDS));b.startupInviteCount=parseInt(o.INVITE_COUNT);b.startupClanInviteCount=parseInt(o.CLAN_INVITE_COUNT);
b.clanid=parseInt(o.CLAN_ID);b.clanlist=o.CLANS;b.clandb={};for(var y in b.clanlist)b.clandb[b.clanlist[y].clan_id]=b.clanlist[y];b.activeClan=null;b.headless=o.HEADLESS}locdb.LoadLocations(o.LOCATIONS);mapdb.Load(o.MAPDB);mapdb.LoadTags(o.MAPTAGS)}b.serverManager=new b.ServerManager;a.ajaxSetup({cache:false});a("#ajax_loading_indicator").ajaxStart(function(){a(this).fadeIn("fast")}).ajaxStop(function(){a(this).fadeOut("fast")});for(y in b.siteConfig);for(var v in b.modules){o=b.modules[v];o.Init&&
o.Init()}if(b.userinfo&&parseInt(b.userinfo.EULA_OUTDATED)){b.ParsePath("legals/eula_updated");b.LoadLayout(b.activeModule.GetLayout())}else if(quakelive.IsLoggedIn())b.InitPlugin();else{b.ParsePath();b.LoadLayout(b.activeModule.GetLayout())}b.StartPathMonitor();b.FixAnchor();b.isQueued&&b.AddOnceHook("OnLayoutLoaded",b.CheckQueuePosition)};b.InitPopup=function(o){b.initTime=(new Date).getTime();b.session=o.SESSION;b.username=o.USERNAME;b.xaid=o.XAID;b.userstatus=o.STATUS;b.userid=parseInt(o.USERID);
a.ajaxSetup({cache:false});a("#ajax_loading_indicator").ajaxStart(function(){a(this).fadeIn("fast")}).ajaxStop(function(){a(this).fadeOut("fast")});for(var y in b.siteConfig);y=null;for(q in b.popups){var v=b.popups[q];if(v.name=o.popup_name)y=v}for(var C in y.modules)C.Init&&C.Init();b.ParsePath();b.StartPathMonitor();b.InitTracker()};b.moduleMessageCount={};b.SendModuleMessage=function(o,y,v){var C=false;if(typeof b.moduleMessageCount[o]=="undefined")b.moduleMessageCount[o]=[0,0];b.moduleMessageCount[o][0]++;
b.moduleMessageCount[o][1]=(new Date).getTime()-b.initTime;for(var G in b.modules)if(!(v&&G!=v)){var H=b.modules[G];if(typeof H[o]=="function")if(H[o].apply(H,[y]))C=true}if(b.hooks[o])for(var F in b.hooks[o])b.hooks[o][F](y);return C};b.GetModule=function(o){return b.modules[o]||{}};b.HideTooltip=function(){b.matchtip.HideMatchTooltip(-1);b.statstip.HideStatsTooltip()};b.HideOverlay=function(){a("#overlay").hide();a("#overlay-bg").hide();a("#qlv_OverlayContent").empty();quakelive.mod_prefs.CloseOverlay();
a(".jqmWindow").jqmHide()};b.Eval=function(o){try{return JSON.parse(o)}catch(y){return null}};b.IsSecure=function(){return window.location.protocol=="https:"};b.IsLoggedIn=function(){return quakelive.userid!=0};b.IsMozilla=function(){var o=b.IdentifyBrowser(navigator.userAgent);return o&&o.name=="mozilla"||false};b.IsSafari=function(){var o=b.IdentifyBrowser(navigator.userAgent);return o&&o.name=="safari"||false};b.IsOpera=function(){var o=b.IdentifyBrowser(navigator.userAgent);return o&&o.name==
"opera"||false};b.IsChrome=function(){var o=b.IdentifyBrowser(navigator.userAgent);return o&&o.name=="chrome"||false};b.IsLinux=function(){var o=b.IdentifyOS(navigator.userAgent);return o&&o.name=="linux"||false};b.IsWindows=function(){var o=b.IdentifyOS(navigator.userAgent);return o&&o.name=="windows"||false};b.IsMacintosh=function(){var o=b.IdentifyOS(navigator.userAgent);return o&&o.name=="macintosh"||false};b.IsVista=function(){var o=b.IdentifyOS(navigator.userAgent);return o&&o.name=="windows"&&
parseInt(o.versionNumber)==6||false};b.IsIE6=function(){var o=b.IdentifyBrowser(navigator.userAgent);return o&&parseInt(o.versionNumber)==6||false};b.IsMSIE=function(){var o=b.IdentifyBrowser(navigator.userAgent);return o&&o.name=="msie"||false};var z={macintosh:{mozilla:3.5,safari:1},linux:{mozilla:3},windows:{msie:7,mozilla:1.5}};b.IdentifyVersion=function(o,y){var v=null;for(var C in o){var G=RegExp(o[C],"gi").exec(y),H={name:"",version:"0",versionNumber:0};if(G){for(v=1;v<G.length;++v){for(var F=
G[v];F.indexOf("_")!=-1;)F=F.replace("_",".");var J=parseFloat(F);if(J>H.version){H.version=F;H.versionNumber=J}}H.name=C;v=H;break}}return v};var r={windows:"Win(?:dows)?(?:\\s?(?:NT|XP)?)?\\s+([\\d\\.]+)",macintosh:"Intel\\s+Mac(?:intosh)?\\s+OS\\s+X(?:\\s+([\\d_\\.]+))",linux:"(Linux)"};b.IdentifyOS=function(o){return b.IdentifyVersion(r,o)};var m={mozilla:"(?:Firefox|Iceweasel|Icecat|Shiretoko|Namoroka|Minefield|GranParadiso)[\\/\\s]+([\\d\\.]+)",chrome:"Chrome\\/([\\d\\.]+)",safari:"Safari\\/([\\d\\.]+)",
opera:"Opera\\/([\\d\\.]+)",msie:"MSIE\\s+([\\d\\.]+)"};b.IdentifyBrowser=function(o){return b.IdentifyVersion(m,o)};b.IsCompatibleBrowser=function(o){if(b.IsLoggedIn())return true;if(b.siteConfig.realm=="qztest"||b.siteConfig.realm=="qztest-jah")return true;if(arguments.length==0)o=navigator.userAgent;var y=b.IdentifyOS(o);if(!y||!z[y.name])return false;var v=b.IdentifyBrowser(o);if(!v||!z[y.name][v.name])return false;minVersions=z[y.name];if(v.version<minVersions[v.name])return false;return true};
b.CheckBrowserCompat=function(){if(!b.IsCompatibleBrowser()){var o=["We're sorry, but it appears that you are using an incompatible system.To play QUAKE LIVE you must use one of the following Operating Systems and Web Browsers:<br /><br /><ul style='margin: 5px'><li>Windows XP / Windows Vista / Windows 7</li><li>Intel Mac OSX 10.4 or higher</li><li>Linux (LSB 3.0 or higher)</li></ul><ul style='margin: 5px'><li>Firefox 2.0 or higher (Mac OSX requires Firefox 3.5+)</li><li>Internet Explorer 7 or higher</li><li>Safari 3.0 or higher</li></ul><br /><center><img src='",
quakelive.resource("/images/site/logo_os_win.png"),"' width='40' height='40' style='margin: 0 10px' /><img src='",quakelive.resource("/images/site/logo_os_mac.png"),"' width='40' height='40' style='margin: 0 10px' /><img src='",quakelive.resource("/images/site/logo_os_linux.png"),"' width='40' height='40' style='margin: 0 10px' /><img src='",quakelive.resource("/images/site/logo_browser_ff.png"),"' width='40' height='40' style='margin: 0 10px' /><img src='",quakelive.resource("/images/site/logo_browser_ie.png"),
"' width='40' height='40' style='margin: 0 10px' /><img src='",quakelive.resource("/images/site/logo_browser_safari.png"),"' width='40' height='40' style='margin: 0 10px' /></center><br />Support for additional browsers is under development.<br /><br /><small style='text-align: center; display: block' onclick='this.innerHTML=navigator.userAgent'>Show your browser identification</small>"].join("");qlPrompt({title:"Incompatible Browser",body:o,fatal:false,alert:true});return false}return true};b.AddHook=
function(o,y){if(typeof y=="function"){b.hooks[o]||(b.hooks[o]=[]);b.hooks[o].push(y)}};b.AddOnceHook=function(o,y){var v=function(C){y(C);b.RemoveHook(o,v)};b.AddHook(o,v)};b.RemoveHook=function(o,y){for(var v=b.hooks[o],C=v.length-1;C>=0;--C)if(v[C]===y){v.splice(C,1);return}};b.PreloadImages=function(){for(var o=0;o<arguments.length;++o)a("<img>").attr("src",arguments[o])};b.PreloadClasses=function(){for(var o=0;o<arguments.length;++o)a("<div>").attr("class",arguments[o])};b.InitTracker=function(){if(typeof _gaq!=
"undefined"){var o="guest";if(b.IsLoggedIn())o=b.siteConfig.premiumStatus;_gaq.push(["_setCustomVar",1,"Member Status",o,2])}};b.TrackPageView=function(o){if(typeof _gaq!="undefined"){if(o[0]!="/")o="/"+o;_gaq.push(["_trackPageview",o])}};b.TrackEvent=function(){if(typeof _gaq!="undefined"){for(var o=["_trackEvent"],y=0;y<arguments.length;++y)o.push(arguments[y]);_gaq.push(o)}};b.querystring={};if(window.location.search)for(var l=window.location.search.substring(1).split("&"),q=0;q<l.length;++q){var u=
l[q].split("=",2);b.querystring[u[0]]=u[1]}b.Logout=function(){quakelive.PageRedirect(b.siteConfig.baseUrl+"/user/logout")};b.ShowLoadingPacifier=function(){a("#loading_pacifier").show()};b.HideLoadingPacifier=function(){a("#loading_pacifier").hide()};var g={};b.SetMonitorPath=function(o){g.lastPath=o};b.StartPathMonitor=function(){b.StopPathMonitor();g.lastPath=window.location.hash;g.thHandle=setInterval(b.CheckPathForUpdates,200)};b.StopPathMonitor=function(){if(g.thHandle){clearInterval(g.thHandle);
g.thHandle=0}};b.GotoCurrentPath=function(){quakelive.ParsePath();quakelive.LoadLayout(quakelive.activeModule.GetLayout())};b.CheckPathForUpdates=function(){if(g.lastPath!=window.location.hash){var o=false,y=b.UndecorateAnchor(window.location.hash),v=b.activeModule;if(v&&v.skipMatchingPathUpdates)if(v.skipMatchingPathUpdates.test(y))o=true;v=window.location.hash;o||quakelive.Goto(y);g.lastPath=v}};b.LoadSiteConfig=function(o){o=a.extend({},b.defaultSiteConfig,o);for(var y in o)if(typeof o[y]=="string"){var v=
o[y];v=v.replace(/%LOCATION%/g,window.location.hostname);var C=window.location.hostname.toLowerCase().split(".");v=v.replace(/%HOSTNAME%/g,C[0]);o[y]=v}v=o.realm;y=v.indexOf("-");o.baseRealm=y!=-1?v.substring(0,y):v;b.siteConfig=o;b.home=b.siteConfig.homeOverride||"home"};b.PageRedirect=function(o){window.location=o};b.IsRealm=function(o){var y=false;if(typeof o=="object")for(var v in o){if(o[v]==b.siteConfig.baseRealm)y=true}else y=o==b.siteConfig.baseRealm;return y};b.GetUserHome=function(o){if(quakelive.IsLoggedIn())return quakelive.userstatus==
"ACTIVE"?o||b.cvars.Get("web_home","").value||"welcome":"welcome";return"home"};b.SetUserHome=function(o){o=b.GetUserHome(o);SetCvar("web_home",o)};b.MakeHomeChooser=function(o){if(b.userstatus=="ACTIVE"){var y=b.GetUserHome();a("#home_chooser").remove();var v=a("<div id='home_chooser'></div>");y==o?v.attr("title","This page is your Home").append('<div class="home_icon"></div>').append('<div class="cl"></div>'):v.attr("title","Click to set this page as your Home").append('<a href="javascript:;" class="home_icon"></a>').append('<a href="javascript:;" class="home_text">Set as My Home</a>').append('<div class="cl"></div>').find("a").click(function(){quakelive.ChooseHome(o);
return false});a(".postlogin_nav").append(v)}};b.ChooseHome=function(o){b.SetUserHome(o);a("#home_chooser a").css({"text-decoration":"none",cursor:"default"}).removeAttr("title").unbind("click");a("#home_chooser .home_text").text("Updated My Home").fadeOut(2E3,function(){b.MakeHomeChooser(o)})};b.ViewActiveClan=function(){quakelive.activeClan&&quakelive.Goto("clans/profile/"+quakelive.activeClan.name)};b.EditActiveClan=function(){quakelive.activeClan&&quakelive.Goto("clans/control/"+quakelive.activeClan.name)};
b.SetActiveClan=function(o){quakelive.clanid=o;quakelive.activeClan=quakelive.clandb[o];quakelive.SendModuleMessage("OnClanChanged",quakelive.activeClan)};b.RemoveClan=function(o){quakelive.activeClan&&o==quakelive.activeClan.clan_id&&quakelive.SetActiveClan(0);typeof b.clandb[o]!="undefined"&&delete b.clandb[o]};b.AddClan=function(o){b.clandb[o.clan_id]=a.extend({},o)};b.GetVerisignSealHtml=function(o){return'<table width="135" border="0" cellpadding="2" cellspacing="0" title="Click to Verify - This site chose VeriSign SSL for secure e-commerce and confidential communications."><tr><td width="135" align="center" valign="top" id="verisign_inner_area"><script type="text/javascript" src="https://seal.verisign.com/getseal?host_name=secure.quakelive.com&amp;size=L&amp;use_flash='+
(o?"YES":"NO")+'&amp;use_transparent=NO&amp;lang=en"><\/script><br /><a href="http://www.verisign.com/ssl-certificate/" target="_blank"  style="color:#000000; text-decoration:none; font:bold 7px verdana,sans-serif; letter-spacing:.5px; text-align:center; margin:0px; padding:0px;">ABOUT SSL CERTIFICATES</a></td></tr></table>'};b.Popup=function(o){var y="";for(var v in o.options)y+=y.length==0?v+"="+o.options[v]:","+v+"="+o.options[v];v={SESSION:b.session,USERNAME:b.username,XAID:b.xaid,USERID:b.userid,
STATUS:b.userstatus,popup_name:o.name};var C="";C+=o.secure==true?"https://":"http://";C+=document.domain;C+=o.url+"?"+Base64.encode(JSON.stringify(v));window.open(C,o.title,y)};b.popups={SocialInvite:{name:"SocialInvite",url:"/friends/social/a",title:"Address Book Search",secure:true,options:{location:"no",menubar:"no",scrollbars:"yes",status:"yes",titlebar:"yes",resizable:"no",height:250,width:700,directories:"no",screenX:30,screenY:30},modules:["friends"]}};window.IsMacintosh=quakelive.IsMacintosh;
window.IsWindows=quakelive.IsWindows;window.IsLinux=quakelive.IsLinux;window.IsVista=quakelive.IsVista;window.IsMozilla=quakelive.IsMozilla;window.IsSafari=quakelive.IsSafari;window.IsMSIE=quakelive.IsMSIE;window.IsIE6=quakelive.IsIE6;window.IsChrome=quakelive.IsChrome;window.IsOpera=quakelive.IsOpera;b.config=function(o,y){if(typeof b.siteConfig[o]=="undefined")return y;return b.siteConfig[o]};b.CanEmbedViewport=function(){return!b.IsMacintosh()};b.LoadSiteConfig(window.SITECONFIG)})(jQuery);
(function(){var a={};window.onerror=function(d,b,k){var c={};c.m=d;c.u=b;c.l=k;if(typeof quakelive!="undefined"){if(typeof quakelive.siteConfig.allowRepeatErrors=="undefined"||!quakelive.siteConfig.allowRepeatErrors)if(a[d])return;a[d]=true;c.uid=quakelive.userid;c.sta=quakelive.userstatus;c.pre=quakelive.siteConfig?quakelive.siteConfig.premiumStatus:"NA";c.tsr=(new Date).getTime()-quakelive.initTime;b=quakelive.pathHistory?quakelive.pathHistory.length:0;for(d=b-1;d>=0;--d)c["hs_"+(b-d)]=quakelive.pathHistory[d];
if(quakelive.moduleMessageCount)for(var e in quakelive.moduleMessageCount)c["mm_"+e]=quakelive.moduleMessageCount[e][0]}e="/e?";for(var p in c)e+=p+"="+escape(c[p])+"&";d=new Image;d.src=e;return false}})();function EncodeURL(a){a=a.replace(/\+/g,"%2B");a=a.replace(/\ /g,"%20");a=a.replace(/\&/g,"%26");a=a.replace(/\?/g,"%3F");return a=a.replace(/\//g,"%2F")}
function CreateCookie(a,d,b){if(b){var k=new Date;k.setTime(k.getTime()+b*24*60*60*1E3);b="; expires="+k.toGMTString()}else b="";s=a+"="+d+b+"; path=/";document.cookie=s}function ReadCookie(a,d){for(var b=a+"=",k=document.cookie.split(";"),c=0;c<k.length;c++){for(var e=k[c];e.charAt(0)==" ";)e=e.substring(1,e.length);if(e.indexOf(b)==0)return e.substring(b.length,e.length)}return arguments.length>1?d:null}function EraseCookie(a){CreateCookie(a,"",-1)}
function FormatError(a){return"Name:"+a.name+" Num:"+a.number+" Desc:"+a.description+": "+a}function StartPacifier(a,d){$(a).html("<span class='pacifier-active'>"+d+"</span>").show()}function StopPacifier(a,d,b){$(a).html("<span class='pacifier-inactive'>"+d+"</span>");b&&setTimeout('ClearPacifier("'+a+'")',b)}function ClearPacifier(a){$(a).empty()}function StripColors(a){if(a==null||a.length==0)return"";return a.replace(/(\^[0-9])/g,"").replace(/\^/g,"")}
function StripClanName(a){return a=StripColors(a)}var ClanRank={leader:1,officer:2,veteran:3,member:4,initiate:5};function FormatClanRank(a){var d={};d[ClanRank.leader]="Clan Leader";d[ClanRank.officer]="Clan Officer";d[ClanRank.veteran]="Veteran";d[ClanRank.member]="Member";d[ClanRank.initiate]="Initiate";return d[a]}
function ParseModelSkin(a){var d={model:"",skin:""};a=a.split("/");if(a.length>=2){d.model=a[0].toLowerCase();d.skin=a[1].toLowerCase()}else{d.model=a[0].toLowerCase();d.skin="default"}if(d.model[0]=="*")d.model=d.model.substring(1);return d}
function PlayerIconSet(a,d){this.model=a.toLowerCase();this.skin=d.toLowerCase();this.modelskin=this.model+"_"+this.skin;this.small="<img src='"+quakelive.resource("/images/players/icon_sm/"+this.model+"_"+this.skin+".png")+"' width='18' height='18' />";this.medium="<img src='"+quakelive.resource("/images/players/icon_md/"+this.model+"_"+this.skin+".png")+"' width='30' height='30' />";this.large="<img src='"+quakelive.resource("/images/players/icon_lg/"+this.model+"_"+this.skin+".png")+"' width='43' height='43' />";
this.friend_large="<img src='"+quakelive.resource("/images/players/icon_xl/"+this.model+"_"+this.skin+".png")+"' width='62' height='62' />"}
function BuildPlayerIcon(a,d,b){b=$.extend({},{status:"standard",callback:"",gray:false,extraClass:""},b);var k={0:"standard",1:"premium",2:"pro"};if(typeof k[b.status]!="undefined")b.status=k[b.status];a=quakelive.resource("/images/players/icon_"+(b.gray?"gray_":"")+d+"/"+a+".png");d=$('<div class="usericon_'+b.status+"_"+d+" "+b.extraClass+'" style="background-image: url('+a+')"><div class="frame"></div><label></label></div>');if(typeof b.callback=="function"){d.click(b.callback).addClass("interactive");
d.find("label").addClass("interactive")}return d}function RemoveArrayIndex(a,d){var b=null;return b=d==0?a.slice(1):d==a.length-1?a.slice(0,a.length-1):a.slice(0,d).concat(a.slice(d+1))}function ECODE_SUCCESS(a){return typeof a=="number"?a==0:typeof a=="string"?a.length==1&&a.charAt(0)=="0":false}function FormatNumber(a){return""+1*a}function isEmailValid(a){return/^[a-z0-9.!\#$%&\'*+-\/=?^_`{|}~]+@([0-9.]+|([^\s\'"<>]+\.+[a-z]{2,6}))$/i.test(a)?true:false}
var SECS_IN_MINUTE=60,SECS_IN_HOUR=3600,SECS_IN_DAY=86400,SECS_IN_WEEK=604800,SECS_IN_YEAR=31536E3,SECS_IN_MONTH=2592E3;
function DecomposeTimeDelta(a){var d=parseInt(a/SECS_IN_YEAR);a-=d*SECS_IN_YEAR;var b=parseInt(a/SECS_IN_MONTH);a-=b*SECS_IN_MONTH;var k=parseInt(a/SECS_IN_WEEK);a-=k*SECS_IN_WEEK;var c=parseInt(a/SECS_IN_DAY);a-=c*SECS_IN_DAY;var e=parseInt(a/SECS_IN_HOUR);a-=e*SECS_IN_HOUR;var p=parseInt(a/SECS_IN_MINUTE);a-=p*SECS_IN_MINUTE;return{years:d,months:b,weeks:k,days:c,hours:e,mins:p,secs:a}}
function FormatDuration(a){var d=parseInt(a/60);a-=d*60;var b=undefined;if(d>59){b=parseInt(d/60);d%=60}var k="";if(b){k+=b;k+=":"}if(d<10)k+="0";k+=d;k+=":";if(a<10)k+="0";k+=a;return k}function FormatNumberNicely(a){var d=[0,"one","two","three","four","five","six"];return d[a]?d[a]:a}
function GetFriendlyTimeDelta(a){a=DecomposeTimeDelta(a);if(a.years>0)return a.years==1?"last year":FormatNumberNicely(a.years)+" years ago";if(a.months>0)return a.months==1?"last month":FormatNumberNicely(a.months)+" months ago";if(a.weeks>0)return a.weeks==1?"last week":FormatNumberNicely(a.weeks)+" weeks ago";if(a.days>0)return a.days==1?"yesterday":FormatNumberNicely(a.days)+" days ago";if(a.hours>0)return a.hours==1?"1 hour ago":FormatNumberNicely(a.days)+" hours ago";return a.mins>45?"about an hour ago":
a.mins>=25?"about half an hour ago":"just now"}var SkillDelta={TOOLOW:-2,TOOHIGH:-3,UNKNOWN:-1,LOWER:0,MATCHED:1,HARD:2,HARDER:3,EVENHARDER:4},SkillSettings={};SkillSettings[SkillDelta.LOWER]={desc:"Your Skill Higher",color:"#ffffff",delta:SkillDelta.LOWER};SkillSettings[SkillDelta.MATCHED]={desc:"Skill Matched",color:"#39c50a",delta:SkillDelta.MATCHED};SkillSettings[SkillDelta.HARD]={desc:"More Challenging",color:"#f5c276",delta:SkillDelta.HARD};
SkillSettings[SkillDelta.HARDER]={desc:"Very Difficult",color:"#ef422e",delta:SkillDelta.HARDER};SkillSettings[SkillDelta.EVENHARDER]={desc:"Very Difficult",color:"#ef422e",delta:SkillDelta.HARDER};SkillSettings[SkillDelta.TOOLOW]={desc:"Your Skill Too High",color:"#ffffff",delta:"x"};SkillSettings[SkillDelta.TOOHIGH]={desc:"Your Skill Too Low",color:"#ffffff",delta:"x"};SkillSettings[SkillDelta.UNKNOWN]={desc:"Unrestricted Match",color:"#ffffff",delta:"p"};
SkillSettings.unregistered={desc:"Your Skill Unknown",color:"#ffffff",delta:"r"};SkillSettings["default"]={desc:"Unknown",color:"#ffffff",delta:"p"};function GetSkillRankInfo(a){var d=a;if(quakelive.userid){if(quakelive.userstatus=="REGISTERED")d="unregistered"}else d=SkillDelta.MATCHED;return $.extend({delta:a,desc:"",color:""},SkillSettings[d]||SkillSettings["default"])}function FormatRank(a){var d=a%100,b=a%10;return a+(b==1&&d!=11?"st":b==2&&d!=12?"nd":b==3&&d!=13?"rd":"th")}
function FormatTimeDelta(a){if(a>=2592E3){num=Math.round(a/2592E3);return num!=1?num+" months":num+" month"}else if(a>=86400){num=Math.round(a/86400);return num!=1?num+" days":num+" day"}else if(a>=3600){num=Math.round(a/3600);return num!=1?num+" hours":num+" hour"}else if(a>=60){num=Math.round(a/60);return num!=1?num+" minutes":num+" minute"}else return"1 minute"}function Clamp(a,d,b){if(a<d)return d;else if(a>b)return b;return a}
function ChangeModelSkin(a,d){for(var b=a.split("_"),k="",c=0;c<b.length-1;++c)k+=b[c]+"_";k+=d;return k}function FirstDefined(){for(var a=0;a<arguments.length;++a)if(typeof arguments[a]!="undefined")return arguments[a]}function StripSlashes(){}function qlHideBroadcast(){qlBroadcast({close:true})}
function qlBroadcast(a){function d(){b.slideUp(a.slideSpeed,function(){$(this).hide()})}var b=$("#qlv_broadcast");a=$.extend({body:"",close:false,showClose:true,slideSpeed:500},a);b.html("<p>"+a.body+"</p>");a.close?d():b.slideDown(a.slideSpeed,function(){$(this).effect("pulsate",{times:1},500);if(a.showClose){b.prepend('<div class="qlv_broadcast_close interactive"></div>');$(".qlv_broadcast_close").click(d)}})}
function qlPrompt(a){quakelive.matchtip.HideMatchTooltip();a=$.extend({id:"prompt",title:"",body:"",input:false,password:false,inputLabel:"",inputReadOnly:false,ok:function(){$("#"+a.id).jqmHide()},okLabel:"OK",cancel:function(){$("#"+a.id).jqmHide()},cancelLabel:"Cancel",alert:false,fatal:false,top:false,showX:false,customWidth:false,customHeight:false,hideButtons:false},a);if(a.fatal)a=$.extend(a,{ok:function(){window.location.reload()},okLabel:"Reload",showX:false,alert:true});var d=$("#"+a.id);
if(d.length===0){d=$('<div id="'+a.id+'" class="modal"></div>');$("body").append(d)}a.id!="prompt"&&d.css("z-index",9999);d.html(quakelive.mod_home.TPL_PROMPT_HTML);d.find(".modal-title").html(a.title);a.body&&d.find("#modal-body").html(a.body);a.customWidth&&d.css({width:a.customWidth+"px",marginLeft:"-"+parseInt(a.customWidth/2)+"px"});a.customHeight&&d.css({height:a.customHeight+"px"});if(a.hideButtons){d.find("#modal-cancel,#modal-input,#modal-ok,.modal-close-box").css("display","none");$(".modal-title").attr("colspan",
"2")}else{if(a.input){d.find("#modal-input").css("display","block");a.password?d.find("#modal-input").html('<input type="password" />'):d.find("#modal-input").html('<input type="text" />');a.inputReadOnly&&d.find("#modal-input input").attr("readonly","readonly")}else d.find("#modal-input").css("display","none");a.alert?d.find("#modal-cancel").css("display","none"):d.find("#modal-cancel").css("display","");d.find("#modal-input input").val(a.inputLabel);d.find("#modal-ok").val(a.okLabel);d.find("#modal-cancel").val(a.cancelLabel);
$("#"+a.id+" form").submit(function(){a.ok();return false});d.find("#modal-ok").click(a.ok);d.find("#modal-cancel").click(a.cancel);if(a.showX){d.find("#modal-close").click(a.cancel);$(".modal-title").attr("colspan","1")}else{d.find(".modal-close-box").hide();$(".modal-title").attr("colspan","2")}}d.jqm({modal:true});d.jqmShow();var b=d.width();if(!a.customWidth&&b<357){b=357;d.css({width:b+"px"})}else if(!a.customWidth&&b>500){b=500;d.css({width:b+"px"})}var k=d.height(),c="-"+parseInt(b/2+20)+"px",
e=parseInt((1100-k)/35);if(e<5)e=5;d.css({height:k+"px",top:e+"%",marginLeft:c});d.find("#modal-shadow").width(b+"px");quakelive.ScrollToTop();d.find("input:first,textarea:first").focus();return d}function qlProcessing(a,d,b,k){a={hideButtons:true,body:"<center><h1>"+d+'</h1><img src="'+quakelive.resource("/images/loader.gif")+'" width="62" height="13" style="margin: 12px" /></center>',title:a};if(b){a.alert=true;a.hideButtons=false;a.okLabel=b;a.ok=k||qlHidePrompt}qlPrompt(a)}
function qlBeginSaving(a,d){d||(d="Saving...");$("#modal-ok",a).blur().val(d).removeClass("modal-submit-button").addClass("modal-saving-button").attr("disabled","true");$("#modal-error",a).hide()}function qlEndSaving(a,d){d||(d="Save");$("#modal-ok",a).val(d).removeClass("modal-saving-button").addClass("modal-submit-button").removeAttr("disabled")}function qlError(a,d){d?$("#modal-error",a).show().text(d).effect("pulsate",{times:1},500):$("#modal-error",a).hide()}
function qlAlert(a,d){qlPrompt({body:d,title:a,alert:true})}function qlConfirm(a,d,b,k){qlPrompt({title:a,body:d,ok:function(){b&&b();qlHidePrompt()},okLabel:"OK",cancel:function(){k&&k();qlHidePrompt()},cancelLabel:"Cancel"})}function qlHidePrompt(a){a||(a=$("#prompt"));a.jqmHide()}function ZeroPad(a){return a<10?"0"+a:""+a}function qlLock(a){this.locked=false;this.name=a}qlLock.prototype.Acquire=function(){this.locked=true};qlLock.prototype.Release=function(){this.locked=false};
qlLock.prototype.IsLocked=function(){return this.locked};function SafeParseInt(a){try{var d=parseInt(a);if(!isNaN(d))return d}catch(b){}return 0}function EscapeHTML(a){var d=document.createElement("div");a=document.createTextNode(a);d.appendChild(a);return d.innerHTML}var _tmplCache={};
function ParseTemplate(a,d){var b="";try{var k=_tmplCache[a];if(!k){var c="var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+a.replace(/[\r\t\n]/g," ").replace(/'(?=[^#]*#>)/g,"\t").split("'").join("\\'").split("\t").join("'").replace(/<#=(.+?)#>/g,"',$1,'").split("<#").join("');").split("#>").join("p.push('")+"');}return p.join('');";k=new Function("obj",c);_tmplCache[a]=k}return k(d)}catch(e){b=e.message}return"<!-- ERROR: "+EscapeHTML(b)+" --\>"}
function InArray(a,d){for(var b=d.length,k=0;k<b;k++)if(d[k]==a)return true;return false}
FormStyler=function(){var a={text:'<div class="ff_type_text"><div class="ff_status_icon"></div><label></label><small></small><div class="ff_field_wrapper"><div class="ff_input_wrapper"><input type="text" /></div><div class="ff_status_text">&nbsp;</div></div></div>',colorize:'<div class="ff_type_color"><div class="ff_colorize_wrapper"></div></div>',checkbox:'<div class="ff_type_checkbox"><div class="ff_checkbox_wrapper"> <input type="checkbox" /></div><div class="ff_field_wrapper"><div class="ff_label"><label></label></div></div></div><div class="cl"></div>',textarea:'<div class="ff_type_textarea"><div class="ff_field_wrapper"><div class="ff_input_wrapper"><textarea></textarea></div><div class="ff_status_text">&nbsp;</div></div></div>',
password:'<div class="ff_type_password"><div class="ff_status_icon"></div><label></label><div class="ff_field_wrapper"><div class="ff_input_wrapper"><input type="password" /></div><div class="ff_status_text">&nbsp;</div></div></div>',clan_tag:'<div class="ff_type_text"><div class="ff_status_icon"></div><label></label><small></small><div class="ff_field_wrapper fl"><div class="fl ff_input_wrapper"><input type="text" autocomplete="off" /></div><div class="ff_status_text">&nbsp;</div></div><div class="bare_clan fr"></div><div class="cl"></div></div>',
format_tag:'<div class="ff_type_text"><div class="ff_status_icon"></div><div class="bare_clan fr"></div><small></small><div class="ff_field_wrapper fl"><div class="fl ff_input_wrapper"><input type="text" autocomplete="off" /></div><div class="ff_status_text">&nbsp;</div></div><div class="cl"></div><div class="reset_tag"></div></div>',clan_avatar:'<div class="ff_type_clan_avatar"><div class="ff_status_icon"></div><label></label><small></small><div class="ff_field_wrapper"><div class="ff_avatar_wrapper"></div><div class="ff_status_text">&nbsp;</div></div></div>'};
this.SetupFormField=function(d,b){var k=$.extend({autocomplete:true},b);$(d).each(function(c,e){var p=$(e);if(k.type=="text"||k.type=="textarea"||k.type=="password"||k.type=="checkbox"||k.type=="clan_tag"||k.type=="format_tag"){var x=$(a[k.type]);k.description&&$("small",x).text(k.description).show();k.title?$("label",x).text(k.title):$("label",x).hide();inputType=k.type=="textarea"?"textarea":"input";var t={tabindex:k.tabindex||0,name:k.name,id:k.name};if(!k.autocomplete)t.autocomplete="off";$(inputType,
x).attr(t).focus(function(){if(!p.hasClass("ff_state_error")&&k.type!="checkbox"){$(".ff_status_text",x).html(k.help);x.addClass("ff_state_focus")}}).blur(function(){x.removeClass("ff_state_focus ff_state_error ff_state_ok");if(k.validate){var v=x;k.validate(function(){v.removeClass("ff_state_error").addClass("ff_state_ok")},function(C){v.removeClass("ff_state_ok").addClass("ff_state_error");$(".ff_status_text",v).html(C)})}});k.maxlength&&$(inputType,x).attr("maxlength",k.maxlength);if(!k.validate&&
k.maxlength){var z=x,r=k.maxlength,m=r;if(k.value)m-=k.value.length;$(inputType,z).attr("maxlength",k.maxlength).keyup(function(){if($(this).val())m=r-$(this).val().length;if(m<0){var v=m*-1;$(".ff_status_text",z).html(v+" over the limit of "+r);z.removeClass("ff_state_ok").addClass("ff_state_error")}else{$(".ff_status_text",z).html(m+" characters remaining.");z.removeClass("ff_state_error").addClass("ff_state_ok")}});$(".ff_status_text",z).html(m+" characters remaining.")}k.tabindex==1&&$(inputType,
x).focus();if(k.type=="checkbox"){k.help&&$(".ff_status_checkbox",x).html(k.help);$("label",x).attr("for",k.name)}if(k.type=="clan_tag"||k.type=="format_tag"){var l=5;if(k.clan){k.value=k.clan.pretty_tag;k.clan_tag=StripClanName(k.value)}if(k.type=="format_tag"&&k.value)l=k.clan_tag.length;$("input",x).attr("maxlength",15).keyup(function(){var v=StripClanName(this.value);if(k.value&&k.type=="format_tag")if(v.toLowerCase()!=k.clan_tag.toLowerCase()){$(".ff_status_text",x).html("Clan tag must remain the same");
x.removeClass("ff_state_ok").addClass("ff_state_error")}else{$(".ff_status_text",x).html(k.help);x.removeClass("ff_state_error")}else if(v.length==0)$(".bare_clan",x).empty();else v.length<=l?$(".bare_clan",x).html("ID: <b>"+v+"</b>"):$(".bare_clan",x).html('<b style="color: #f00">ID: '+v.substring(0,l)+"&hellip;</b>")});k.value&&$("input",x).val(k.value)}k.cols&&$(inputType,x).attr("cols",k.cols);if(k.width){x.find(inputType).css("width",k.width+"px");x.find(".ff_field_wrapper,label").css("width",
parseInt(k.width)+6+"px");x.css("width",parseInt(k.width)+6+"px")}k.align&&$(inputType,x).css("text-align",k.align);if(k.value)k.type=="checkbox"?$(inputType,x).attr("checked",true):$(inputType,x).val(k.value);k.rows&&$(inputType,x).attr("rows",k.rows);p.empty().append(x)}else if(k.type=="birthdate"){x=$(a[k.type]);$("label",x).text(k.title);var q,u=function(){if(k.validate){var v=x;k.validate(function(){v.removeClass("ff_state_error").addClass("ff_state_ok")},function(C){v.removeClass("ff_state_ok").addClass("ff_state_error");
$(".ff_status_text",v).html(C)})}};t=$(".ff_select_month",x).attr("tabindex",k.tabindex+0).attr("name",k.name+"_month").change(u);q='<option value="0">Month</option>';var g="January|February|March|April|May|June|July|August|September|October|November|December".split("|");for(c=0;c<g.length;++c)q+='<option value="'+(c+1)+'">'+g[c]+"</option>";t.empty().append(q);t=$(".ff_select_day",x).attr("tabindex",k.tabindex+1).attr("name",k.name+"_day").change(u);q='<option value="0">Day</option>';for(c=0;c<31;++c)q+=
'<option value="'+(c+1)+'">'+(c+1)+"</option>";t.empty().append(q);t=$(".ff_select_year",x).attr("tabindex",k.tabindex+2).attr("name",k.name+"_year").change(u);q='<option value="0">Year</option>';u=(new Date).getFullYear();for(c=0;c<100;++c)q+='<option value="'+(u-c)+'">'+(u-c)+"</option>";t.empty().append(q);p.empty().append(x)}else if(k.type=="captcha"){x=$(a[k.type]);$("label",x).text(k.title);$("input",x).focus(function(){if(!p.hasClass("ff_state_error")){$(".ff_status_text",x).html(k.help);x.addClass("ff_state_focus")}}).blur(function(){x.removeClass("ff_state_focus");
if(k.validate){var v=x;k.validate(function(){v.removeClass("ff_state_error").addClass("ff_state_ok")},function(C){v.removeClass("ff_state_ok").addClass("ff_state_error");$(".ff_status_text",v).html(C)})}}).attr("tabindex",k.tabindex||0).attr("name",k.name);p.empty().append(x);$(".btn_refresh",x).click(function(){RefreshCaptchaField(d);$("input",x).val("").focus()});RefreshCaptchaField(d)}else if(k.type=="colorpalette"){t="";p.empty();for(q=1;q<8;q++){u="";g=colorPalette[q].color;var o=g.substr(0,
1).toUpperCase()+g.substr(1);if(q==1)u+="palette_icon_selected";t+='<div class="color_block"><div class="interactive palette_icon '+u+'" style="background-image: url('+quakelive.resource("/images/modules/account/palette-"+g+".png")+')" id="Palette-'+g+'" title="'+o+'"></div></div>'}t+='<div class="color_block"><div class="palette_icon interactive" id="Palette-C" title="Toggle Capitalization"></div></div>';p.append('<div id="color_list">'+t+"</div>");for(q=1;q<8;q++)$("#Palette-"+colorPalette[q].color,
p).click(function(){module.PaletteSetColor(this.id)});$(".reset").click(function(){module.ResetColors()});$("#Palette-C").click(function(){module.CaseChange()})}else if(k.type=="colorize"){x=$(a[k.type]);$("label",x).html(k.title);t=quakelive.cvars.Get("name").value;u=quakelive.username;if(u.toLowerCase()!=StripColors(t).toLowerCase())t=u;u=0;g="";for(o=0;o<t.length;o++){var y=t.charAt(o);u++;if(y=="^"){o++;for(c=1;c<8;c++)if(colorPalette[c].code==t.charAt(o))q=colorPalette[c].color;currentPalette=
q?"color_palette_"+q:"color_palette_white";o++;y=t.charAt(o);g+='<td><div class="color_letter interactive '+currentPalette+'" id="tag-'+u+'" title="Click to style this letter">'+y+"</div></td>"}else g+='<td><div class="color_letter interactive color_palette_white" id="tag-'+u+'" title="Click to style this letter">'+y+"</div></td>"}$(".ff_colorize_wrapper",x).html('<table cellspacing="0" cellpadding="0" border="0" align="center"><tr>'+g+"</tr></table>");p.empty().append(x)}else if(k.type=="clan_avatar"){x=
$(a[k.type]);k.description&&$("small",x).text(k.description).show();k.title?$("label",x).text(k.title):$("label",x).hide();t=$(".ff_avatar_wrapper",x).empty();q=k.avatars;for(c=0;c<q.length;++c){u=q[c];t.append('<a href="javascript:;" onclick="quakelive.mod_clans.SelectAvatar(this,\''+u.id+'\'); return false"><img src="'+quakelive.resource("/images/clan_avatars/md/"+u.name+".png")+'" /></a>')}t.append("<div class='cl'></div>");t.append("<input type='hidden' id='clan_avatar_field' name='avatar' value='' />");
p.empty().append(x)}})};this.FocusField=function(){var d=$("#help_"+this.id);d.find(".error").size()==0&&d.addClass("grayBack").addClass("grayBorder").removeClass("transBorder").removeClass("transBack").find(".help").show()};this.BlurField=function(){var d=$("#help_"+this.id);d.find(".error").size()==0&&d.removeClass("grayBack").removeClass("grayBorder").addClass("transBack").addClass("transBorder").find(".help").hide()};this.StyleAsDefault=function(d){$("#help_"+d+" .error").remove();$("#wrap_"+
d).removeClass("orangeBorder");$("#label_"+d).removeClass("orangeTxt");$("#help_"+d).removeClass("orangeBack").removeClass("orangeBorder").removeClass("blackTxt").addClass("whiteTxt");$(".reg_error_block").html("&nbsp;")};this.StyleAsError=function(d){$("#wrap_"+d).addClass("orangeBorder");$("#label_"+d).addClass("orangeTxt");$("#help_"+d).addClass("orangeBack").addClass("orangeBorder").addClass("blackTxt").removeClass("whiteTxt")};this.SetFieldError=function(d,b){$(d).removeClass("ff_state_ok").addClass("ff_state_error").find(".ff_status_text").text(b)};
this.SetFieldOk=function(d){$(d).removeClass("ff_state_error").addClass("ff_state_ok")};this.ResetFieldStatus=function(d){$(d).removeClass("ff_state_error ff_state_ok")}};formStyler=new FormStyler;function JID(a){this.bare=a;var d=a.indexOf("@");if(d!=-1)this.username=a.substring(0,d);else{this.username=a;this.bare=a+"@"+quakelive.siteConfig.xmppDomain}}JID.prototype.Clone=function(){return new JID(this.bare)};function XMPPEventListener(){}XMPPEventListener.prototype.OnConnected=function(){};
XMPPEventListener.prototype.OnDisconnected=function(){};XMPPEventListener.prototype.OnRosterFilled=function(){};XMPPEventListener.prototype.OnMessage=function(){};XMPPEventListener.prototype.OnPresence=function(){};function XMPPEventDispatcher(){this.prototype=new XMPPEventListener;this.listeners=[];this.eventQueue=[];this.eventLog=[]}
var XMPP_EVENTS={IM_OnDisconnected:"OnDisconnected",IM_OnConnected:"OnConnected",IM_OnRosterFilled:"OnRosterFilled",IM_OnMessage:"OnMessage",IM_OnPresence:"OnPresence",IM_OnSubscribeRequest:"OnSubscribeRequest",IM_OnItemAdded:"OnItemAdded",IM_OnItemRemoved:"OnItemRemoved",IM_OnItemSubscribed:"OnItemSubscribed",IM_OnItemUnsubscribed:"OnItemUnsubscribed",IM_OnItemUpdated:"OnItemUpdated",IM_OnPrivacyNames:"OnPrivacyNames",IM_OnPrivacyList:"OnPrivacyList",IM_OnPrivacyChanged:"OnPrivacyChanged",IM_OnPrivacyResult:"OnPrivacyResult",
IM_OnSelfPresence:"OnSelfPresence",IM_OnConnectFail:"OnConnectFail",IM_OnKicked:"OnKicked"};XMPPEventDispatcher.prototype.PushEvent=function(a,d){var b=[a,d||null,(new Date).getTime()];this.eventQueue.push(b);this.eventLog.push(b)};XMPPEventDispatcher.prototype.GetNextEvent=function(){return this.eventQueue.length>0?this.eventQueue.shift():null};XMPPEventDispatcher.prototype.PumpEvents=function(){for(var a;(a=this.GetNextEvent())!=null;)this.HandleEvent(a)};
XMPPEventDispatcher.prototype.HandleEvent=function(a){var d=a[0];a=a[1];typeof this[d]=="function"&&this[d].apply(this,a)};XMPPEventDispatcher.prototype.BuildEventCallback=function(a){var d=this;return function(){d.PushEvent(XMPP_EVENTS[a],arguments)}};XMPPEventDispatcher.prototype.AddEventDispatcher=function(a){var d=this;this[a]=function(){d.DispatchEvents(a,arguments)}};
XMPPEventDispatcher.prototype.RegisterHooks=function(){var a=this;for(var d in XMPP_EVENTS){quakelive.AddHook(d,this.BuildEventCallback(d));this.AddEventDispatcher(XMPP_EVENTS[d])}setInterval(function(){a.PumpEvents()},100)};XMPPEventDispatcher.prototype.AddListener=function(a){this.listeners.push(a)};XMPPEventDispatcher.prototype.RemoveListener=function(a){var d=-1;for(d in this.listeners)if(this.listeners[d]===a)break;if(d!=-1)this.listeners=RemoveArrayIndex(this.listeners,d)};
XMPPEventDispatcher.prototype.CreateClient=function(a){return new XMPPClient(this,a)};XMPPEventDispatcher.prototype.DispatchEvents=function(a,d){for(var b in this.listeners){var k=this.listeners[b];typeof k[a]=="function"&&k[a].apply(k,d)}};function XMPPPrivacyList(){}XMPPPrivacyList.prototype.AddListener=function(){};XMPPPrivacyList.prototype.RemoveListener=function(){};
var PresType={Unknown:0,Available:1,Chat:2,Away:3,Dnd:4,Xa:5,Unavailable:6},S10nType={None:0,NoneOut:1,NoneIn:2,NoneOutIn:3,To:4,ToIn:5,From:6,FromOut:7,Both:8};function XMPPRosterItem(a){this.jid=a;this.subscription=S10nType.None;this.presence=PresType.Unknown;this.group="offline"}XMPPRosterItem.prototype.IsVisible=function(){return this.subscription==S10nType.Both&&this.presence==PresType.Available};function XMPPRosterGroup(){}
function XMPPRoster(){this.items={};this.presenceGroups=[];for(var a=PresType.Unknown;a<=PresType.Unavailable;a++)this.presenceGroups[a]={};this.subscriptionGroups=[];for(a=S10nType.None;a<=S10nType.Both;a++)this.subscriptionGroups[a]={}}
XMPPRoster.prototype.OnRosterFilled=function(){var a=qz_instance.IM_GetRoster();if(a=quakelive.Eval(a)){this.items={};for(var d in a){var b=a[d],k=new JID(d),c=new XMPPRosterItem(k);this.items[k.username]=c;this.ChangeItemSubscription(c,b.SUBSCRIPTION);this.ChangeItemPresence(c,b.ONLINE?PresType.Available:PresType.Unavailable)}}};
XMPPRoster.prototype.ChangeItemSubscription=function(a,d){if(a.subscription!=d){typeof this.subscriptionGroups[a.subscription][a.jid.username]!="undefined"&&delete this.subscriptionGroups[a.subscription][a.jid.username];a.subscription=d;this.subscriptionGroups[a.subscription][a.jid.username]=a}};
XMPPRoster.prototype.ChangeItemPresence=function(a,d){if(a.presence!=d){typeof this.presenceGroups[a.presence][a.jid.username]!="undefined"&&delete this.presenceGroups[a.presence][a.jid.username];a.presence=d;this.presenceGroups[a.presence][a.jid.username]=a}};
XMPPRoster.prototype.OnItemRemoved=function(a){if(a=quakelive.Eval(a)){a=new JID(a.jid);if(typeof this.items[a.username]!="undefined"){var d=this.items[a.username];delete this.presenceGroups[d.presence][a.username];delete this.subscriptionGroups[d.subscription][a.username];delete this.items[a.username]}}};XMPPRoster.prototype.OnItemAdded=function(a){if(a=quakelive.Eval(a)){a=new JID(a.jid);if(typeof this.items[a.username]=="undefined"){var d=new XMPPRosterItem(a);this.items[a.username]=d}}};
XMPPRoster.prototype.OnItemUpdated=function(a){if(a=quakelive.Eval(a)){var d=new JID(a.jid);typeof this.items[d.username]!="undefined"&&this.ChangeItemSubscription(this.items[d.username],a.subscription)}};XMPPRoster.prototype.OnPresence=function(a){if(a=quakelive.Eval(a)){var d=new JID(a.who);if(typeof this.items[d.username]!="undefined"){d=this.items[d.username];this.ChangeItemPresence(d,a.presence);d.status=a.status}}};
XMPPRoster.prototype.Iterate=function(a){var d=0;for(var b in this.items){a.apply(this,[this.items[b]]);d++}return d};XMPPRoster.prototype.IteratePresenceGroup=function(a,d){if(typeof this.presenceGroups[a]=="undefined")return 0;var b=0;for(var k in this.presenceGroups[a]){d.apply(this,[this.presenceGroups[a][k]]);b++}return b};XMPPRoster.prototype.EventItemSubscriptionChanged=function(){};var _detailsCache={};
XMPPRoster.prototype.GetItemDetails=function(a){_detailsCache[a]||this.AddItemDetails(a);return _detailsCache[a]};
XMPPRoster.prototype.AddItemDetails=function(a,d){var b=$.extend({},{BIO:"",COUNTRY_ABBREV:"US",COUNTRY_NAME:"United States",LAST_ONLINE:0,LAST_ONLINE_DATE:"",MODEL:"sarge",SKIN:"default",PLAYER_CLAN:"",PLAYER_ID:0,PLAYER_NICK:"",STATUS:0},d);b.LAST_ONLINE=parseInt(b.LAST_ONLINE);b.STATUS=parseInt(b.STATUS);b.PLAYER_ID=parseInt(b.PLAYER_ID);b.icons=new PlayerIconSet(b.MODEL,b.SKIN);b.clan=b.PLAYER_CLAN||"";b.name=b.PLAYER_NICK||a;_detailsCache[a]=b};function XMPPClientListener(){}
function XMPPClientPrivacyListener(){}function XMPPClient(a,d){this.jid=new JID(d.toLowerCase());this.privacy=new XMPPPrivacyList(a);this.roster=new XMPPRoster;this.clientListener=new XMPPClientListener(this);a.AddListener(this.clientListener);a.AddListener(this.roster);this.privacyListener=new XMPPClientPrivacyListener(this);this.privacy.AddListener(this.privacyListener)}
var version_windows=[0,1,0,491],version_linux=[0,1,0,491],version_mac=[0,1,0,491],version=[0,1,0,491],CLSID="70A1ADC3-9C2D-4F7C-B189-55C5CF397F1C",MIME_TYPE="application/x-id-quakelive";version=IsLinux()?version_linux:IsMacintosh()?version_mac:version_windows;var BUILD_NUMBER=version[3],check_version=version.join("."),check_version_comma=version.join(","),current_version="NA",ie_cookie_string="quakelive_upgrade",debug_install=false;
function OSGetName(){return IsLinux()?"os_linux":IsMacintosh()?"os_mac":"os_win"}function BrowserGetName(){return IsMSIE()?"msie":IsChrome()?"chrome":IsSafari()?"safari":IsMozilla()?"mozilla":"unknown"}window.qz_instance=undefined;function VersionListener(){this.VersionTooOld=function(){};this.VersionTooNew=function(){};this.VersionOk=function(){};this.HandshakeFailed=function(){};this.PluginNotInstalled=function(){}}
function StartupVersionListener(){this.prototype=new VersionListener;this.waitingForInstall=false;this.curVersion=0;this.GotoPluginInstall=function(b){if(!this.waitingForInstall){var k=this,c=function(){if(quakelive.activeModule==quakelive.mod_register){k.UpdateInstallState(k.curInstallStates,k.curVersion);k.WaitForInstall(b);quakelive.RemoveHook("OnContentLoaded",c)}};quakelive.AddHook("OnContentLoaded",c);var e=function(){k.eulaConfirmed=true;quakelive.ParsePath("register/install");quakelive.LoadLayout(quakelive.activeModule.GetLayout())};
if(this.doEulaConfirm){quakelive.ParsePath("legals/eula_updated");quakelive.LoadLayout(quakelive.activeModule.GetLayout());quakelive.onAfterEulaConfirm=e}else e()}};var a={Hidden:"hidden",Checking:"checking",Completed:"complete",Restart:"restart",TooNew:"toonew"};this.WaitForInstall=function(b){function k(){b.CheckVersion(5,c)}var c=this;this.waitingForInstall=true;this.watchInstallHandle&&clearInterval(this.watchInstallHandle);this.watchInstallHandle=setInterval(k,1E4);k()};this.eulaConfirmed=this.doEulaConfirm=
this.freshPluginInstall=false;this.baseInstallStates={plugin:a.Hidden,content:a.Hidden};this.curInstallStates=$.extend({},this.baseInstallStates);this.UpdateInstallState=function(b,k){if(!(!this.eulaConfirmed&&k==0)){var c=$.extend({},this.baseInstallStates,b);if($.browser.msie&&c.plugin==a.Checking&&ReadCookie("plugin_active")!==null)c.plugin=a.Restart;this.curVersion=k;$(".install_client_version").text(this.curVersion===0?"None":this.curVersion);$(".install_server_version").text(version.join("."));
if(c.plugin!=a.Restart&&c.plugin==a.Checking&&c.plugin!=this.curInstallStates.plugin)ReadCookie(ie_cookie_string)?upgrade():setTimeout(upgrade,3E3);var e=this,p=OSGetName(),x="browser_"+BrowserGetName();for(var t in c){var z=c[t],r=$("#group_"+t);if(typeof c[t]!="undefined")if(c[t]==a.Hidden)r.find(".stage").hide();else{r.find(".active_stage").removeClass("active_stage");r.find(".stage_"+z).each(function(){var m=$(this);if((m.hasClass(p)||m.hasClass("os_any"))&&(m.hasClass(x)||m.hasClass("browser_any"))&&
!m.hasClass("not"+x)&&!m.hasClass("not"+p)&&(e.freshPluginInstall&&m.hasClass("mode_install")||!e.freshPluginInstall&&m.hasClass("mode_upgrade"))){m.addClass("active_stage");m.find(".installer_url").attr("href",GetInstallerUrl())}})}this.curInstallStates[t]=c[t]}}};this.VersionOk=function(b,k){CreateCookie("QLV",k,365);clearInterval(this.watchInstallHandle);this.watchInstallHandle=null;this.UpdateInstallState({plugin:a.Completed,content:a.Checking},k);this.verificationAttempt=0;var c=this;this.verifyGameHandle=
null;this.verifyGameHandle=setInterval(function(){try{c.verificationAttempt++;c.VerifyGameInstall(b);clearInterval(c.verifyGameHandle);c.verifyGameHandle=null}catch(e){if(c.verificationAttempt>30){EraseCookie(ie_cookie_string);quakelive.PageRedirect("/user/login_redirect");clearInterval(c.verifyGameHandle);c.verifyGameHandle=null}}},1E3)};this.VersionTooOld=function(b,k){b.RemoveObject();this.UpdateInstallState({plugin:a.Checking},k);this.waitingForInstall||this.GotoPluginInstall(b)};this.VersionTooNew=
function(b,k){b.RemoveObject();this.UpdateInstallState({plugin:a.TooNew},k);this.waitingForInstall||this.GotoPluginInstall(b)};this.HandshakeFailed=function(b){b.RemoveObject();this.UpdateInstallState({plugin:a.Checking},0);this.waitingForInstall||this.GotoPluginInstall(b)};this.PluginNotInstalled=function(b){b.RemoveObject();if(!ReadCookie("newaccount")&&!this.eulaConfirmed)this.doEulaConfirm=true;this.UpdateInstallState({plugin:a.Checking},0);if(!this.waitingForInstall){this.freshPluginInstall=
true;this.GotoPluginInstall(b)}};var d=false;this.VerifyGameInstall=function(b){function k(){if(typeof qz_instance.IsGameRunning=="undefined"){quakelive.TrackEvent("plugin_error");var z={title:"QUAKE LIVE Crash Detected!",body:"Oops! We're sorry, but it appears that the QUAKE LIVE plugin has crashed. Please reload the page or restart your browser before trying again.<br /><br />If this error persists please refer to the <a href='/forum/forumdisplay.php?12-Technical-Support' target='qlforum'>Technical Support Forum</a> or <a href='javascript:;' onclick='quakelive.mod_support.GotoSupport(); return false'>Contact Support</a>."};
z.okLabel="Reload";z.ok=function(){document.location.reload()};z.cancelLabel="Logout";z.cancel=function(){quakelive.Logout()};window.onbeforeunload=null;qlPrompt(z)}else{qz_instance.IsGameRunning();setTimeout(k,100)}}function c(z){if(z.group>GROUP_BASE){t||x.waitingForInstall?x.UpdateInstallState({content:a.Completed,playnow:a.Completed},x.curVersion):quakelive.OnPluginInstalled();quakelive.RemoveHook("OnDownloadGroup",c)}}function e(z){if(z.fileName!="manifest.json"){quakelive.RemoveHook("OnFileXferStarted",
e);if(qlXfer.currentGroup<=GROUP_BASE){t=true;quakelive.AddOnceHook("OnContentLoaded",function(){x.UpdateInstallState(x.curInstallStates,x.curVersion)});quakelive.ParsePath("register/install");quakelive.LoadLayout(quakelive.activeModule.GetLayout())}}}if(!d){d=true;$("#registration_uparrow").remove();b.UnloadIEHelper();b.AttachIEEvents();CreateCookie("plugin_active",1,0);qz_instance.SetDeveloperRoot(quakelive.siteConfig.realm);qz_instance.SetSession(navigator.userAgent,b.username,b.password,parseInt(ReadCookie("xi",
"0")));quakelive.siteConfig.premiumStatus=="standard"&&qz_instance.AddContentIgnoreGroup(4);if(b=qz_instance.StartDownloads(quakelive.siteConfig.cdnUrl,quakelive.siteConfig.cdnUrl)){var p={title:"Fatal Error",body:qz_instance.GetErrorCodeString(b)||"Unknown Error"};if(b==pluginx.PluginErrors.INSTANCE_ACTIVE){p.okLabel="Reload";p.ok=function(){document.location.reload()};p.cancelLabel="Logout";p.cancel=function(){quakelive.Logout()}}else p.fatal=true;qlPrompt(p);return false}k();var x=this,t=false;
quakelive.AddHook("OnDownloadGroup",c);quakelive.AddHook("OnFileXferStarted",e);return true}}}
function qlPlugin(a,d,b,k){this.PluginErrors={NONE:0,OUT_OF_MEMEORY:1,GENERIC_FAILURE:2,INSTANCE_ACTIVE:3,GAME_RUNNING:4,INSTALLATION_ERROR:5,MANIFEST_NOT_FOUND:6,MANIFEST_PARSE_ERROR:7,MANIFEST_WRITE_ERROR:8,MANIFEST_XFER_ERROR:9,GAME_FILE_WRITE_ERROR:10,GAME_FILE_NOT_FOUND:11,GAME_FILE_XFER_ERROR:12,GAME_NOT_RUNNING:13,GETPROC_ERROR:14,EXTRACT_ERROR:15,THREAD_ERROR:16};this.pluginContainerId="#qz_handshake";this.pluginName=a;this.mimeType=d;this.classId=b;this.serverPluginVersion=k;this.password=
this.username=undefined;this.pluginRefreshNeedsReload=false;this.pluginNeedsLibraryUnloader=$.browser.msie;this.Events=[{event:"FileTransferStart",handler:"OnFileXferStarted",params:["fileName","fileSize"]},{event:"FileTransferUpdate",handler:"OnFileXferUpdate",params:["transferedAmount"]},{event:"FileTransferDone",handler:"OnFileXferDone",params:["result"]},{event:"OnManifestInfo",handler:"OnManifestInfo",params:["groupInfoList"]},{event:"GameExit",handler:"OnGameExit",params:["exitCode"]},{event:"InputEventCaptured",
handler:"OnInputEvent",params:["exitCode"]},{event:"GameVidRestart",handler:"OnVidRestart",params:[]},{event:"CvarChanged",handler:"OnCvarChanged",params:["cvarName","cvarValue","replicate"]},{event:"BindChanged",handler:"OnBindChanged",params:["keyName","keyValue"]},{event:"IM_OnConnected",handler:"IM_OnConnected",params:[]},{event:"IM_OnDisconnected",handler:"IM_OnDisconnected",params:[]},{event:"IM_OnRosterFilled",handler:"IM_OnRosterFilled",params:[]},{event:"IM_OnConnectFail",handler:"IM_OnConnectFail",
params:[]},{event:"IM_OnKicked",handler:"IM_OnKicked",params:[]},{event:"IM_OnMessage",handler:"IM_OnMessage",params:["message_json"]},{event:"IM_OnPresence",handler:"IM_OnPresence",params:["presence_json"]},{event:"IM_OnSubscribeRequest",handler:"IM_OnSubscribeRequest",params:["json"]},{event:"IM_OnItemAdded",handler:"IM_OnItemAdded",params:["json"]},{event:"IM_OnItemRemoved",handler:"IM_OnItemRemoved",params:["json"]},{event:"IM_OnItemSubscribed",handler:"IM_OnItemSubscribed",params:["json"]},{event:"IM_OnItemUpdated",
handler:"IM_OnItemUpdated",params:["json"]},{event:"IM_OnSelfPresence",handler:"IM_OnSelfPresence",params:["json"]},{event:"IM_OnPrivacyNames",handler:"IM_OnPrivacyNames",params:["json"]},{event:"IM_OnPrivacyList",handler:"IM_OnPrivacyList",params:["json"]},{event:"IM_OnPrivacyChanged",handler:"IM_OnPrivacyChanged",params:["name"]},{event:"IM_OnPrivacyResult",handler:"IM_OnPrivacyResult",params:["json"]},{event:"TourneyStart",handler:"TourneyStart",params:["errcode","json"]},{event:"TourneyMatchCheckin",
handler:"TourneyMatchCheckin",params:["errcode","json"]},{event:"TourneyBoutStart",handler:"TourneyBoutStart",params:["errcode","json"]},{event:"OnDownloadGroup",handler:"OnDownloadGroup",params:["group"]},{event:"OnDownloadError",handler:"OnDownloadError",params:["errorcode"]},{event:"LFGNotify",handler:"OnLFGNotify",params:["errcode","json"]},{event:"LFGCancel",handler:"OnLFGCancel",params:["json"]},{event:"CommNotice",handler:"OnCommNotice",params:["errorcode","json"]}];this.DetachIEEvents=function(){if($.browser.msie)if(typeof qz_instance!=
"undefined")for(var c in this.Events){var e=this.Events[c];qz_instance.detachEvent(e.event,e.boundFn);e.boundFn=null}};window.ondetach=function(){pluginx.DetachIEEvents()};this.AttachIEEvents=function(){function c(x){var t=new Function("return "+x+";");return function(){var z=t();typeof z=="function"&&z.apply(null,arguments)}}if($.browser.msie)if(typeof qz_instance!="undefined")for(var e in this.Events){var p=this.Events[e];p.boundFn=c(p.handler);qz_instance.attachEvent(p.event,p.boundFn)}};this.SetCredentials=
function(c,e){this.username=c;this.password=e};this.ieHelperHandle=null;this.LoadIEHelper=function(){if(this.ieHelperHandle!==null)return true;$("#iehelper_container").length==0&&$("body").append('<div id="iehelper_container"></div>');$("#iehelper_container").empty();CollectGarbage();try{$("#iehelper_container").html("<object id='qz_iehelper' classid='CLSID:F03A2833-E70F-485B-A557-7769CCC9DD49' style='width: 1px; height: 1px; position: absolute; top: -9999px' />");qz_iehelper.FreeLibraries();var c=
this;this.ieHelperHandle=setInterval(function(){c.IEHelperCleanup()},1E3);return true}catch(e){this.UnloadIEHelper();return false}};this.IEHelperCleanup=function(){if(typeof qz_iehelper!="undefined")try{qz_iehelper.FreeLibraries()}catch(c){}};this.UnloadIEHelper=function(){clearInterval(this.ieHelperHandle);this.ieHelperHandle=null;$("#iehelper_container").empty();try{qz_iehelper=undefined}catch(c){}typeof CollectGarbage!="undefined"&&CollectGarbage()};this.IsInstalled=function(){function c(){try{p.InjectObject();
p.CreateObjectHandle();qz_instance.IsGameRunning();e=typeof qz_instance!="undefined"}catch(z){}p.RemoveObject();return e}var e=false,p=this;if(this.pluginNeedsLibraryUnloader)if(this.LoadIEHelper())c();else e=false;else if(navigator){if(navigator.mimeTypes)for(var x=navigator.mimeTypes.length,t=0;t<x;++t)if(navigator.mimeTypes[t].type==MIME_TYPE){e=true;break}if(!e&&navigator.plugins){x=navigator.plugins.length;for(t=0;t<x;++t)if(navigator.plugins[t].name==this.pluginName){e=true;break}}}else c();
return e};this.version=this.verifiedTime=this.handshakeTime=this.injectTime=0;this.VersionCompare=function(c,e){for(var p=c.split("."),x=e.split("."),t=p.length>x.length?x.length:p.length,z=0;z<t;++z)if(p[z]<x[z])return-1;else if(p[z]>x[z])return 1;return 0};this.CreateObjectHandle=function(){if(typeof qz_instance=="undefined")try{qz_instance=document.getElementById("qz_instance")||undefined}catch(c){qz_instance=undefined}};this.AttemptHandshake=function(){if(this.handshakeCount++>=this.maxHandshakeAttempts)this.HandshakeFailed();
else{this.CreateObjectHandle();if($.browser.msie&&typeof qz_instance!="undefined")try{this.HandshakeSuccess(qz_instance.GetVersion())}catch(c){}}};this.MakeObjectTag=function(c){c='<object id="'+c+'" class="game_viewport" width="100%" height="100%" ';c+=$.browser.msie?'classid="CLSID:'+this.classId+'"':'type="'+this.mimeType+'"';c+=" />";return c};this.CheckVersion=function(c,e){if(navigator&&navigator.plugins)this.pluginRefreshNeedsReload?navigator.plugins.refresh(true):navigator.plugins.refresh();
var p=this;if(this.IsInstalled()){this.PrepareForHandshake(c,function(x){var t=p.VersionCompare(x,p.serverPluginVersion);if(t<0)e.VersionTooOld(p,x);else t>0&&$.inArray("plugin",quakelive.groups)==-1?e.VersionTooNew(p,x):e.VersionOk(p,x)},function(){e.HandshakeFailed(p)});this.InjectObject();this.AttemptHandshake()}else e.PluginNotInstalled(p)};this.EnableOnReadyHook=function(c){if(c){this.oldPluginReadyHook=window.OnPluginReady;window.OnPluginReady=function(e){pluginx.OnPluginReady(e)}}else{window.OnPluginReady=
this.oldPluginReadyHook;this.oldPluginReadyHook=null}};this.PrepareForHandshake=function(c,e,p){this.handshakeTime=(new Date).getTime();this.handshakeCount=0;this.maxHandshakeAttempts=c;this.handshakeHandle&&clearInterval(this.handshakeHandle);this.handshakeDelay=$.browser.msie?1E4:5E3;this.handshakeDone=false;this.EnableOnReadyHook(true);this.handshakeSuccessCallback=e;this.handshakeFailureCallback=p;var x=this;this.handshakeHandle=setInterval(function(){x.AttemptHandshake()},this.handshakeDelay)};
this.HandshakeSuccess=function(c){this.verifiedTime=(new Date).getTime();this.handshakeDone=this.handshakeSuccess=true;this.EnableOnReadyHook(false);if(this.handshakeHandle!==null){clearInterval(this.handshakeHandle);this.handshakeHandle=null}typeof this.handshakeSuccessCallback=="function"&&this.handshakeSuccessCallback(c)};this.HandshakeFailed=function(){this.EnableOnReadyHook(false);clearInterval(this.handshakeHandle);this.handshakeHandle=null;this.handshakeSuccess=false;this.handshakeDone=true;
typeof this.handshakeFailureCallback=="function"&&this.handshakeFailureCallback()};this.InjectObject=function(){this.injectTime=(new Date).getTime();try{$(this.pluginContainerId).html(this.MakeObjectTag("qz_instance"))}catch(c){}};this.RemoveObject=function(){this.removeTime=(new Date).getTime();$(this.pluginContainerId).empty();qz_instance=undefined;typeof CollectGarbage=="function"&&CollectGarbage()};this.IsGameRunning=function(){return typeof qz_instance!="undefined"&&qz_instance.IsGameRunning()};
this.OnPluginReady=function(c){function e(){try{qz_instance.IsGameRunning();x.HandshakeSuccess(c);clearInterval(z)}catch(r){if(t++>=p){x.HandshakeFailed();clearInterval(z)}}}clearInterval(this.handshakeHandle);this.handshakeHandle=null;var p=3,x=this,t=0,z=null;x.CreateObjectHandle();setTimeout(function(){z=setInterval(e,500);e()},100)}}window.pluginx=new qlPlugin("Quake Live",MIME_TYPE,CLSID,version.join("."));
function GetInstallMode(){switch(OSGetName()){case "os_linux":return"linux";case "os_mac":return"mac";default:if($.browser.msie)return"ie_msi";return"npapi_msi"}}
function GetInstallerUrl(){var a="";switch(GetInstallMode()){case "npapi_msi":a=quakelive.siteConfig.cdnUrl+"/QuakeLiveNP_"+BUILD_NUMBER+".msi?v="+check_version_comma;break;case "ie_msi":a=quakelive.siteConfig.cdnUrl+"/QuakeLiveIE_"+BUILD_NUMBER+".msi?v="+check_version_comma;break;case "mac":a=quakelive.siteConfig.cdnUrl+"/QuakeLivePlugin_"+BUILD_NUMBER+".dmg?v="+check_version_comma;break;case "linux":a=quakelive.siteConfig.cdnUrl+"/QuakeLivePlugin_"+BUILD_NUMBER+".xpi?v="+check_version_comma}return a}
function doInstall(){var a=GetInstallerUrl();a!==null&&$("body").append("<iframe src='"+a+"' width='0' height='0' style='display: none' />")}var ieArrowAnimated=false;
function upgrade(){$.ajax({url:"/register/upgrade/"+GetInstallMode(),complete:function(){doInstall();if(($.browser.msie&&navigator.userAgent.indexOf("Windows NT 6.1")==-1||IsLinux())&&!ieArrowAnimated){ieArrowAnimated=true;if(ReadCookie(ie_cookie_string))EraseCookie(ie_cookie_string);else{CreateCookie(ie_cookie_string,1);$("#registration_uparrow").remove();$("body").append('<div id="registration_uparrow" style="top: 30px"></div>');$("#registration_uparrow").animate({top:"-=30px"},400).animate({top:"+=30px"},
400).animate({top:"-=30px"},400).animate({top:"+=30px"},400).animate({top:"-=30px"},400).animate({top:"+=30px"},400).animate({top:"-=30px"},400).show()}}quakelive.TrackPageView("/register/upgrade/"+GetInstallMode())}})}window.GROUP_MINIMUM=1;window.GROUP_BASE=2;window.GROUP_EXTRA=3;window.GROUP_PREMIUM=4;window.GROUP_DONE=5;
function XferStatus(){this.fileName="";this.frac=this.totalDownloadsFrac=this.totalDownloadsSize=this.totalDownloads=this.totalTransferredAmount=this.transferredAmount=this.fileSize=this.fileIndex=0;this.currentGroup=this.group=GROUP_MINIMUM;this.groups=[];this.manifestInfo={groups:[{group:GROUP_MINIMUM,numfiles:0,size:0},{group:GROUP_BASE,numfiles:0,size:0},{group:GROUP_EXTRA,numfiles:0,size:0},{group:GROUP_PREMIUM,numfiles:0,size:0}]}}window.qlXfer=new XferStatus;
function ProcessOnDownloadGroup(a){if(!qlXfer.groups[a]){qlXfer.fileName="";qlXfer.fileIndex=0;qlXfer.fileSize=0;qlXfer.transferredAmount=0;switch(a){case GROUP_MINIMUM:qlXfer.totalDownloads=qlXfer.manifestInfo.required.numfiles;qlXfer.totalDownloadsSize=qlXfer.manifestInfo.required.size;qlXfer.totalTransferredAmount=0;qlXfer.totalDownloadsFrac=0;break;case GROUP_BASE:break;case GROUP_EXTRA:qlXfer.totalDownloads=qlXfer.manifestInfo.groups[a].numfiles+qlXfer.manifestInfo.groups[GROUP_PREMIUM].numfiles;
qlXfer.totalDownloadsSize=qlXfer.manifestInfo.groups[a].size+qlXfer.manifestInfo.groups[GROUP_PREMIUM].size;qlXfer.totalTransferredAmount=0;qlXfer.totalDownloadsFrac=0;break;case GROUP_PREMIUM:break}qlXfer.frac=0;for(qlXfer.currentGroup=a;qlXfer.group<=a;){qlXfer.group==GROUP_DONE&&SetPluginStatus(QL_STATUS_GAMEREADY);qlXfer.group==a&&typeof qlXfer.manifestInfo.groups[a]!="undefined"?quakelive.SendModuleMessage("OnDownloadGroup",qlXfer.manifestInfo.groups[a]):quakelive.SendModuleMessage("OnDownloadGroup",
{group:qlXfer.group,numfiles:0,size:0});qlXfer.groups[qlXfer.group]=true;qlXfer.group++}}}function OnDownloadError(a){qlPrompt({title:"File Manifest Error",body:qz_instance.GetErrorCodeString(a)||"Unknown Error",fatal:true})}function XferUpdateStatus(){SetPluginStatus(QL_STATUS_GAMEXFERUPDATE,qlXfer)}
function OnFileXferStarted(a,d){qlXfer.fileName=a;qlXfer.fileSize=d;qlXfer.transferredAmount=0;qlXfer.lastTransferredAmount=0;XferUpdateStatus();quakelive.SendModuleMessage("OnFileXferStarted",{fileName:a,fileSize:d})}var RATE_SAMPLE_TIME=1E4;
function OnFileXferUpdate(a){var d=(new Date).getTime();if(qlXfer.lastSampleTime){qlXfer.sampleBytesAccum+=a-qlXfer.lastTransferredAmount;if(d-qlXfer.lastSampleTime>=RATE_SAMPLE_TIME){qlXfer.bytesPerSec=1E3*qlXfer.sampleBytesAccum/(d-qlXfer.lastSampleTime);qlXfer.lastSampleTime=d;qlXfer.sampleBytesAccum=0}}else{qlXfer.lastSampleTime=d;qlXfer.sampleBytesAccum=0}qlXfer.lastTransferredAmount=a;qlXfer.transferredAmount=a;qlXfer.frac=qlXfer.fileSize>0?a/qlXfer.fileSize:0;qlXfer.totalDownloadsFrac=qlXfer.totalDownloadsSize>
0?(a+qlXfer.totalTransferredAmount)/qlXfer.totalDownloadsSize:0;XferUpdateStatus();quakelive.Tick()}function ProcessOnManifestInfo(a){var d=quakelive.Eval(a);a={groups:{}};for(var b in d){var k=d[b];a.groups[k.GROUP]={group:k.GROUP,numfiles:k.COUNT,size:k.SIZE}}a.required={numfiles:0,size:0};d=[GROUP_MINIMUM,GROUP_BASE];for(b in d){k=d[b];a.required.numfiles+=a.groups[k].numfiles;a.required.size+=a.groups[k].size}qlXfer.manifestInfo=a}var queuedDownloadGroups=[],hasReceivedManifest=false;
function OnManifestInfo(){ProcessOnManifestInfo.apply(null,arguments);for(var a=0;a<queuedDownloadGroups.length;++a)queuedDownloadGroups[a]();queuedDownloadGroups=[];hasReceivedManifest=true}function OnDownloadGroup(a){if(hasReceivedManifest)ProcessOnDownloadGroup.apply(null,arguments);else{var d=arguments;queuedDownloadGroups.push(function(){ProcessOnDownloadGroup.apply(null,d)})}if(a==GROUP_DONE)hasReceivedManifest=false}
function OnFileXferDone(){qlXfer.fileIndex++;qlXfer.totalTransferredAmount+=qlXfer.fileSize;XferUpdateStatus()}function OnHeartbeatTimeout(){}function OnHeartbeat(){setTimeout(OnHeartbeatTimeout,10)}window.xmppActive=false;function IM_OnConnected(){if(!xmppActive){xmppActive=true;quakelive.SendModuleMessage("IM_OnConnected")}}function IM_OnDisconnected(){if(xmppActive){xmppActive=false;quakelive.SendModuleMessage("IM_OnDisconnected")}}
function IM_OnRosterFilled(){quakelive.SendModuleMessage("IM_OnRosterFilled")}function Hook_OnGameExited(){quakelive.Tick();quakelive.SetPageTitle(quakelive.GetPageTitle())}quakelive.AddHook("OnGameExited",Hook_OnGameExited);
function OnVidRestart(a){var d=quakelive.cvars.Get("r_inBrowserMode");if(d.latched){if(typeof quakelive.cvars.screenModes[d.value]!="undefined"){w=quakelive.cvars.screenModes[d.value][0];h=quakelive.cvars.screenModes[d.value][1]}else{w=800;h=600}StartGameMode(w,h);d.latched=false}quakelive.SendModuleMessage("OnVidRestart",a)}
function join_server(a,d,b){if(quakelive.IsGameRunning()){a="connect "+a+";";if(typeof b!="undefined")a+='password "'+b+'";';qz_instance.SendGameCommand(a)}else{var k=new LaunchGameParams;k.Append("+connect "+a);k.password=b;LaunchGame(k,d)}}
function LaunchGameParams(a){this.password=$.extend({password:null,noInputGrab:false,noAudio:false,noAds:false,hasFullscreen:false,browserMode:12,shrinkViewport:false},a).password;this.hasFullscreen=quakelive.cvars.GetIntegerValue("r_fullscreen",0)!=0;this.browserMode=quakelive.cvars.GetIntegerValue("r_inbrowsermode",12);this.cmdStrings=[]}LaunchGameParams.prototype.Append=function(a){this.cmdStrings.push(a)};LaunchGameParams.prototype.Prepend=function(a){this.cmdStrings.shift(a)};
LaunchGameParams.prototype.GetCommandLine=function(){var a=quakelive.cvars.Get("model");quakelive.cvars.Set("headmodel",a.value);quakelive.cvars.Set("team_model",a.value);quakelive.cvars.Set("team_headmodel",a.value);quakelive.cfgUpdater.StoreConfig(quakelive.cfgUpdater.CFG_BIT_REP);a="";if(this.noInputGrab)a+="+set in_nograb 1 ";if(this.noAudio)a+="+set s_volume 0 ";if(this.noAds)a+="+set g_advertDelay 0 ";a+="+set r_fullscreen "+quakelive.cvars.GetIntegerValue("r_fullscreen",0)+" ";if(this.shrinkViewport)a+=
"+set r_inbrowsermode 0; +set vid_xpos 0; +set vid_ypos 0; ";a+='+set gt_user "'+pluginx.username+'" ';a+='+set gt_pass "'+pluginx.password+'" ';a+='+set gt_realm "'+quakelive.siteConfig.realm+'" ';if(typeof this.password=="string")a+='+set password "'+this.password+'" ';a+=this.cmdStrings.join(" ");return a};
function LaunchGame_Error(a){var d=quakelive.exports.LaunchStatus;if(a==d.ErrorNotRegistered)quakelive.mod_welcome.ShowRegisterPrompt();else if(a==d.ErrorNotSynced)qlPrompt({title:"Unable to Launch Game",body:"You are downloading required data and must let it finish before you can join an online match.",alert:true});else if(a==d.ErrorNotPremium)quakelive.mod_premium.ShowBrochurePopup();else a==d.ErrorMissingPassword?qlPrompt({title:"Password Required",body:"The match you are connecting to requires a password. Please enter the password below:",
input:true,password:true,okLabel:"Connect",ok:function(){var b=$("#modal-input > input").val();if(b.length>0)if(/"'/.test(b))$(".modal-content > .modal-feedback").html("Password cannot contain quotes.");else{qlHidePrompt();currentGameParams.password=b;LaunchGame(currentGameParams,currentServerInfo)}else $(".modal-content > .modal-feedback").html("You must enter a password to continue")}}):qlAlert("Unknown error occurred","Result code "+a)}function LaunchGame_Success(){}var gameLauncher;
function LaunchGame(a,d){gameLauncher=new quakelive.exports.GameLauncher;gameLauncher.Launch({params:a,serverInfo:d,userInfo:{id:quakelive.userid,isActive:quakelive.userstatus=="ACTIVE",premiumStatus:quakelive.siteConfig.premiumStatus,syncComplete:qlXfer.currentGroup>=GROUP_EXTRA,name:quakelive.username},success:LaunchGame_Success,error:LaunchGame_Error})}
function HandleCrashReport(){if(qz_instance.IsCrashDumpPresent()){quakelive.Overlay("home/crashed","CloseCrashReport()",true);return true}return false}function CloseCrashReport(){qz_instance.CancelBugReport();quakelive.CloseOverlay();quakelive.OnPluginInstalled()}
function SubmitCrashReport(){if(qz_instance){var a=[$("#USERAGENT").val(),$("#IP").val(),$("#URI").val(),$("#crashed-usermsg").val()].join("\n");qz_instance.SubmitBugReport("http://"+window.location.hostname+"/home/crashed",a);alert("Thanks for the report!")}quakelive.CloseOverlay();quakelive.OnPluginInstalled()}var gameInstallHandle=null;function StopGameInstall(){if(gameInstallHandle!=null){clearTimeout(gameInstallHandle);gameInstallHandle=null}}
function SetupInstall(){var a=GetInstallMode();quakelive.OnPluginOutdated(a,current_version,check_version_comma)}var newInstall,pluginAlreadyRun=false;
function run_plugin(a,d){if(!pluginAlreadyRun)if(a==null||a.length==0){var b={title:"Error loading user profile",body:'There appears to be a problem loading your user profile. Please log back into the site and try again. If this problem persists <a href="javascript:;" onclick="quakelive.mod_support.GotoSupport(); return false">contact support.</a>'};b.okLabel="Reload";b.ok=function(){document.location.reload()};b.cancelLabel="Logout";b.cancel=function(){quakelive.Logout()};qlPrompt(b)}else{pluginAlreadyRun=
true;newInstall=false;pluginx.SetCredentials(a,d);b=new StartupVersionListener;pluginx.CheckVersion(1,b)}}var QL_STATUS_GAMEXFERUPDATE=4,QL_STATUS_GAMEREADY=5;
function SetPluginStatus(a,d){var b=$("#qlv_statusBottom");if(qlXfer.group!=0)switch(a){case QL_STATUS_GAMEXFERUPDATE:if(!quakelive.IsGameRunning()&&d.totalDownloads>0){var k=parseInt(100*d.totalDownloadsFrac);if(k<0)k=0;else if(d.fileName=="manifest.json"){b.empty();b.removeAttr("title")}else if(k>99)k=99;var c=$("#qlv_download_status");if(c.length==0){c=$("<div id='qlv_download_status'><img src='"+quakelive.resource("/images/supernav/download_arrowb.gif")+"' /><div id='qlv_download_percent'></div></div>");
b.html(c)}$("#qlv_download_percent, .dl-percent").text(k+"%");$(".dl-bar-fill").width(k+"%");b.attr("title","Downloading "+d.fileName);b="<span class='t-hilite'>"+k+"% Complete</span>";if(qlXfer.bytesPerSec){k=parseInt((d.totalDownloadsSize-(d.totalTransferredAmount+d.transferredAmount))/qlXfer.bytesPerSec);if(k<0)k=0;c=parseInt((59+k)/60);if(c<0)c=0;k=k<60?k<=1?"1 second left":k+" seconds left":c<=1?"1 minute left":c+" minutes left";b+=" &nbsp;&nbsp;<small class='t-lolite'>"+k+"</small>";$(".dl-timeleft").text(k)}$(".dl-progress-text").html(b)}break;
case QL_STATUS_GAMEREADY:b.empty();b.removeAttr("title");break}}function OnBeforeUnload(){return"Pressing OK will disconnect you from the current server."}
function MakeFlashTag(a,d){var b=window.location.search||"";if(b.length>0)b=b.substring(1);return'<embed src="'+a+'" wmode="opaque" flashvars="'+b+'" quality="high" bgcolor="#333333" width="'+d.width+'" height="'+d.height+'" name="default" align="middle" allowscriptaccess="always" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'}function GoPremiumUpgrade(){gameLauncher.EndGameMode();quakelive.Goto("premium")}
function GameError(a){this.msg=a;this.lowerMsg=a.toLowerCase()}GameError.prototype.GeneralizeMessage=function(a){a=a.replace(/player '.*?'/g,"player 'X'");a=a.replace(/(for .*? minutes?)/g,"(for X minutes)");return a=a.replace(/\//g,"_")};GameError.prototype.IsPunkBuster=function(){var a=["punkbuster","pnkbstra.exe","pnkbstrb.exe"];for(var d in a)if(this.lowerMsg.indexOf(a[d])!=-1)return true;return false};
window.OnCommNotice=function(a,d){if(a==0){var b=quakelive.Eval(d);if(b)switch(b.MSG_TYPE){case "award_notice":b.MSG_SOURCE.toLowerCase()==quakelive.username.toLowerCase()?quakelive.notifier.Notify(quakelive.notifier.SelfAwardEarnedNotice(b.AWARD_TYPE_ID,b.AWARD_ID,b.AWARD_NAME,b.AWARD_IMG,b.AWARD_DESC,b.AWARD_FLAVOR)):quakelive.notifier.Notify(quakelive.notifier.FriendAwardEarnedNotice(b.MSG_SOURCE,b.AWARD_TYPE_ID,b.AWARD_ID,b.AWARD_NAME,b.AWARD_IMG,b.AWARD_DESC,b.AWARD_FLAVOR,b.PLAYER_MODEL));break;
case "openurl":window.open(b.URL,"_blank");break;case "session_caps":typeof QLXFire=="object"&&quakelive.siteConfig.xfire&&parseInt(b.XFIRE)!==0&&QLXFire.EnableXFire();break;case "error":b=new GameError(b.TEXT||"unknown");var k=b.IsPunkBuster()?"punkbuster":"other";quakelive.TrackEvent("server_error",k,b.GeneralizeMessage(b.msg));$.post("/e/server/"+k,{msg:b.msg});break;case "sitemessage":switch(b.type){case "matchmaking":quakelive.mod_matchmaking&&quakelive.mod_matchmaking.onMessage(b);break;case "invitation":k=
new JID(b.from||"A friend");var c=quakelive.xmppClient.roster.GetItemDetails(k.username);k=quakelive.notifier.InvitedGameNotice(k.username,c.icons.modelskin,b.ip+":"+b.port,b.server_id,b.mapname);quakelive.notifier.Notify(k);quakelive.inviteMonitor.AddInvitation();quakelive.inviteMonitor.activeInvites.push(b.server_id);quakelive.serverManager.RefreshServerDetails(b.server_id,{cacheTime:0});break;case "award":b=b.recipient.toLowerCase()==quakelive.username.toLowerCase()?quakelive.notifier.SelfAwardEarnedNotice(b.award_type_id,
b.award_id,b.award_name,b.award_img,b.award_desc,b.award_flavor):quakelive.notifier.FriendAwardEarnedNotice(b.recipient,b.award_type_id,b.award_id,b.award_name,b.award_img,b.award_desc,b.award_flavor,b.player_model);quakelive.notifier.Notify(b);break}break;case "serverinfo":quakelive.currentServerId=parseInt(b.sv_gtid||"0");quakelive.mod_join.SetJoinURL(a,d);break}}};
if(!window.JSON)window.JSON=function(){function a(z){return z<10?"0"+z:z}function d(z){c.lastIndex=0;return c.test(z)?'"'+z.replace(c,function(r){var m=x[r];if(typeof m==="string")return m;return"\\u"+("0000"+(+r.charCodeAt(0)).toString(16)).slice(-4)})+'"':'"'+z+'"'}function b(z,r){var m,l,q,u,g=e,o,y=r[z];if(y&&typeof y==="object"&&typeof y.toJSON==="function")y=y.toJSON(z);if(typeof t==="function")y=t.call(r,z,y);switch(typeof y){case "string":return d(y);case "number":return isFinite(y)?String(y):
"null";case "boolean":case "null":return String(y);case "object":if(!y)return"null";e+=p;o=[];if(typeof y.length==="number"&&!y.propertyIsEnumerable("length")){u=y.length;for(m=0;m<u;m+=1)o[m]=b(m,y)||"null";q=o.length===0?"[]":e?"[\n"+e+o.join(",\n"+e)+"\n"+g+"]":"["+o.join(",")+"]";e=g;return q}if(t&&typeof t==="object"){u=t.length;for(m=0;m<u;m+=1){l=t[m];if(typeof l==="string")if(q=b(l,y))o.push(d(l)+(e?": ":":")+q)}}else for(l in y)if(Object.hasOwnProperty.call(y,l))if(q=b(l,y))o.push(d(l)+(e?
": ":":")+q);q=o.length===0?"{}":e?"{\n"+e+o.join(",\n"+e)+"\n"+g+"}":"{"+o.join(",")+"}";e=g;return q}}Date.prototype.toJSON=function(){return this.getUTCFullYear()+"-"+a(this.getUTCMonth()+1)+"-"+a(this.getUTCDate())+"T"+a(this.getUTCHours())+":"+a(this.getUTCMinutes())+":"+a(this.getUTCSeconds())+"Z"};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()};var k=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
c=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,e,p,x={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},t;return{stringify:function(z,r,m){var l;p=e="";if(typeof m==="number")for(l=0;l<m;l+=1)p+=" ";else if(typeof m==="string")p=m;if((t=r)&&typeof r!=="function"&&(typeof r!=="object"||typeof r.length!=="number"))throw Error("JSON.stringify");return b("",{"":z})},parse:function(z,r){function m(q,
u){var g,o,y=q[u];if(y&&typeof y==="object")for(g in y)if(Object.hasOwnProperty.call(y,g)){o=m(y,g);if(o!==undefined)y[g]=o;else delete y[g]}return r.call(q,u,y)}var l;k.lastIndex=0;if(k.test(z))z=z.replace(k,function(q){return"\\u"+("0000"+(+q.charCodeAt(0)).toString(16)).slice(-4)});if(/^[\],:{}\s]*$/.test(z.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){l=eval("("+z+")");return typeof r===
"function"?m({"":l},""):l}throw new SyntaxError("JSON.parse");}}}();
(function(){quakelive.cfgUpdater=new (function(){this.commitData={};this.commitHandle=null;this.commitDelay=1;this.handlers=[];this.pauseCommit=false;this.Commit=function(a){if(!this.commitHandle){this.changeCounts={add:0,del:0};if(!this.pauseCommit)if(a){this.commitDelay=a;var d=this;this.commitHandle=setTimeout(function(){d.TryCommit()},1E3*a)}else{this.commitDelay=1;this.TryCommit()}}};this.Commit_Success=function(a){if(a&&typeof a.ECODE!="undefined"&&ECODE_SUCCESS(a.ECODE)){this.commitHandle=
null;this.commitData={}}else this.Commit_Error()};this.Commit_Error=function(){var a=this;this.commitHandle=setTimeout(function(){a.TryCommit()},1E3*this.commitDelay);this.commitDelay*=2;if(this.commitDelay>600)this.commitDelay=600};this.TryCommit=function(){if(quakelive.userid){for(var a in this.handlers)this.handlers[a].MergeChangedFields(this.commitData,this.changeCounts);if(this.changeCounts.add>0||this.changeCounts.del){var d=this;$.ajax({type:"post",dataType:"json",url:"/prefs/update",data:this.commitData,
success:function(b){d.Commit_Success(b)},error:function(){d.Commit_Error()}})}else this.commitHandle=null}};this.CFG_BIT_HW=1;this.CFG_BIT_REP=2;this.StoreConfig=function(a){if(quakelive.userid){var d="";for(var b in this.handlers)d+=this.handlers[b].GetConfigString(a);qz_instance.WriteTextFile("/repconfig.cfg",d)}};this.AddSource=function(a){this.handlers[this.handlers.length]=a}});quakelive.AddHook("OnGameModeStarted",function(){quakelive.cfgUpdater.pauseCommit=true});quakelive.AddHook("OnGameModeEnded",
function(){quakelive.cfgUpdater.pauseCommit=false;quakelive.cfgUpdater.Commit()})})();function BindInfo(a,d,b){this.action=a;this.name=d;this.index=b;this.changed=false;this.keys=[];this.deletedKeys=[]}BindInfo.prototype.Bind=function(a,d){this.keys.push(a);if(!d)this.changed=true};
BindInfo.prototype.Remove=function(a,d){if(d){this.deletedKeys=$.extend([],this.keys);this.keys=[];this.changed=true}else for(var b=0;b<this.keys.length;b++)if(this.keys[b]===a){this.deletedKeys.push(this.keys[b]);this.keys.splice(b,1);this.changed=true;return}};function BindManager(){this.handlers=[]}BindManager.prototype.keyLookup={};BindManager.prototype.actionLookup={};
BindManager.prototype.bindNames={centerview:"Center View","+zoom":"Zoom View","+forward":"Forward","+back":"Back","+moveleft":"Move Left","+moveright":"Move Right","+moveup":"Move Up / Jump","+movedown":"Move Down","+speed":"Silent Walk / Run","+attack":"Shoot",weapnext:"Weapon Next",weapprev:"Weapon Prev","weapon 1":"Gauntlet","weapon 2":"Machinegun","weapon 3":"Shotgun","weapon 4":"Grenade Launcher","weapon 5":"Rocket Launcher","weapon 6":"Lightning Gun","weapon 7":"Railgun","weapon 8":"Plasma Gun",
"weapon 9":"BFG","weapon 11":"Nailgun","weapon 12":"Prox Launcher","weapon 13":"Chaingun","+scores":"Show Scores","+button2":"Use Item","+button3":"Taunt",messagemode:"Chat",messagemode2:"Team Chat",dropweapon:"Drop Weapon",dropflag:"Drop Flag",screenshotSocial:"Social Screenshot"};BindManager.prototype.list=[];BindManager.prototype.Get=function(a){var d=this.actionLookup[a];if(d===undefined){d=this.list.length;this.list[d]=new BindInfo(a,this.bindNames[a]||"user bind",d);this.actionLookup[a]=d}return this.list[d]};
BindManager.prototype.GetByKey=function(a){a=this.keyLookup[a];return a!==undefined?this.list[a]:null};BindManager.prototype.Bind=function(a,d,b){a=a.toLowerCase();this.Remove(a);d=this.Get(d);d.Bind(a,b);this.keyLookup[a]=d.index};BindManager.prototype.Remove=function(a,d){var b=a.toLowerCase();if(this.keyLookup[b]!==undefined){var k=this.GetByKey(b);k&&k.Remove(b,d);this.keyLookup[b]=undefined}};BindManager.prototype.Import=function(a){for(var d in a)this.Bind(d,a[d],true)};
BindManager.prototype.MergeChangedFields=function(a,d){for(var b in this.list){var k=this.list[b];if(k.changed){if(k.keys.length===0){for(var c=0;c<k.deletedKeys.length;++c)if(k.deletedKeys[c]){a["deltype"+d.del]=1;a["del"+d.del]=k.deletedKeys[c];d.del++}k.deletedKeys=[]}else for(c=0;c<k.keys.length;++c)if(k.keys[c]){a["addtype"+d.add]=1;a["addkey"+d.add]=k.keys[c];a["addvalue"+d.add]=k.action;d.add++}k.changed=false}}};
BindManager.prototype.GetConfigString=function(){var a="unbindall\n";for(var d in this.list)for(var b=this.list[d],k=0;k<b.keys.length;++k)if(b.keys[k])a+="bind "+b.keys[k]+' "'+b.action+'"\n';return a};window.SetBind=window.OnBindChanged=function(a,d){quakelive.binds.Bind(a,d);quakelive.cfgUpdater.Commit(1)};quakelive.binds=new BindManager;quakelive.cfgUpdater.AddSource(quakelive.binds);
(function(){function a(b,k,c){this.name=b;this.replicate=c;this.value=this.defaultValue=k.toString();this.changed=false}function d(){this.cvarLookup={};this.cvarList=[new a("name","UnnamedPlayer",true),new a("model","sarge/default",true),new a("cg_forceEnemyModel","keel/bright",true),new a("cg_forceTeamModel","",true),new a("color1","7",true),new a("color2","25",true),new a("cg_autoswitch","0",true),new a("cg_scorePlums","1",true),new a("cg_brassTime","2500",true),new a("r_dynamiclight","1",true),
new a("cg_drawCrosshairNames","1",true),new a("r_fastsky","0",true),new a("cg_drawTeamOverlay","1",true),new a("cl_freelook","1",true),new a("m_pitch","0.022",true),new a("cg_drawCrosshair","4",true),new a("cl_run","1",true),new a("web_configVersion","8",true),new a("cg_fov","100",true),new a("r_picmip","0",true),new a("m_filter","0",false),new a("sensitivity","4",false),new a("in_nograb","0",false),new a("r_fullscreen","0",false),new a("r_mode","-2",false),new a("r_inBrowserMode","9",true),new a("r_vertexlight",
"0",true),new a("r_fullbright","0",true),new a("r_lodbias","0",false),new a("r_texturemode","GL_LINEAR_MIPMAP_LINEAR",false),new a("r_ext_compressed_textures","0",false),new a("r_texturebits","32",false),new a("r_gamma","1",false),new a("s_volume","0.8",false),new a("s_musicvolume","0.25",false),new a("s_doppler","0",false),new a("rate","16000",true)];for(var b=0;b<this.cvarList.length;++b){var k=this.cvarList[b];if(k.value===undefined)k.value=k.defaultValue;this.cvarLookup[k.name.toLowerCase()]=
k}this.screenModes={0:[320,240],1:[400,300],2:[512,384],3:[640,360],4:[640,400],5:[640,480],6:[800,450],7:[852,480],8:[800,500],9:[800,600],10:[1024,640],11:[1024,576],12:[1024,768],13:[1152,864],14:[1280,720],15:[1280,768],16:[1280,800],17:[1280,1024],18:[1440,900],19:[1600,900],20:[1600,1E3],21:[1680,1050],22:[1600,1200],23:[1920,1080],24:[1920,1200],25:[1920,1440],26:[2048,1536],27:[2560,1600]}}window.quakelive.cvars={};a.prototype.MarkChanged=function(){this.changed=true};d.prototype.Get=function(b,
k){var c=b.toLowerCase();if(this.cvarLookup[c]===undefined)this.Set(b,arguments.length==1?"":k);return this.cvarLookup[c]};d.prototype.GetIntegerValue=function(b,k){var c=this.Get(b,k||0);return parseInt(c.value)};d.prototype.Set=function(b,k,c,e){var p=b.toLowerCase(),x=this.cvarLookup[p];if(x===undefined){x=new a(b,k,e?false:true);this.cvarList[this.cvarList.length]=x;this.cvarLookup[p]=x}else x.value=k.toString();if(!c){x.MarkChanged();b=="model"&&quakelive.SendModuleMessage("OnModelIconChanged",
x)}return x};d.prototype.Parse=function(b){if(typeof b=="string"){var k=/set.?\s+(\w+)\s+\"?([^\"]*)\"?/;b=b.split(/\r?\n/);for(var c=0;c<b.length;++c){var e=b[c].match(k);e==null||e.length!=3||this.Set(e[1],e[2],true,true)}}};d.prototype.Import=function(b){for(var k in b)this.Set(k,b[k],true)};d.prototype.MergeChangedFields=function(b,k){var c=false;for(var e in this.cvarList){var p=this.cvarList[e];if(p.changed){if(p.replicate){b["addtype"+k.add]=2;b["addkey"+k.add]=p.name;b["addvalue"+k.add]=p.value;
k.add++}else c=true;p.changed=false}}c&&this.StoreHardwareCvars()};d.prototype.StoreHardwareCvars=function(){var b=this.GetConfigString(quakelive.cfgUpdater.CFG_BIT_HW);qz_instance.WriteTextFile("/qzconfig.cfg",b)};d.prototype.GetConfigString=function(b){var k=(b&quakelive.cfgUpdater.CFG_BIT_HW)!=0;b=(b&quakelive.cfgUpdater.CFG_BIT_REP)!=0;var c="";for(var e in this.cvarList){var p=this.cvarList[e];if(b&&p.replicate||k&&!p.replicate)c+="seta "+p.name+' "'+p.value+'"\n'}return c};d.prototype.LoadHardwareCvars=
function(){this.Parse(qz_instance.GetHardwareCvars())};window.SetCvar=window.OnCvarChanged=function(b,k,c){c=parseInt(c)===0;quakelive.cvars.Set(b,k,false,c);c||quakelive.cfgUpdater.Commit(1)};quakelive.cvars=new d;quakelive.cfgUpdater.AddSource(quakelive.cvars)})();
(function(a){quakelive.matchtip=new (function(){this.MATCH_CACHE_TIME=30;this.activeContext=this.updateTimeHandle=this.refreshDetailsHandle=this.hoverServer=this.pinnedServer=null;this.GetDimensions=function(b){var k={left:0,top:0,innerWidth:0,innerHeight:0};if(typeof b=="object"&&b.length>0){var c=b.offset();if(c){k.left=c.left;k.top=c.top}k.innerWidth=b.innerWidth();k.innerHeight=b.innerHeight()}return k};this.GetTooltipOffset=function(b,k,c){var e={},p={left:a(document).scrollLeft(),top:a(document).scrollTop(),
right:a(document).scrollLeft()+a("body").width(),bottom:a(document).scrollTop()+a("body").height(),width:a("body").width(),height:a("body").height()};b=this.GetDimensions(b);b={left:b.left,top:b.top,right:b.left+b.innerWidth,bottom:b.top+b.innerHeight,width:b.innerWidth,height:b.innerHeight};b.top+=16;var x={width:k.innerWidth(),height:k.innerHeight()};if(b.right+x.width+c+23>p.right){e.left=b.left-x.width-23+4;e.arrowDirection="right";e.arrowLeft=b.left-23;k.orientation="left"}else{e.left=b.left+
b.width+23;e.arrowDirection="left";e.arrowLeft=b.right+2;k.orientation="right"}e.arrowTop=b.top+b.height/2-75;if(e.arrowTop<p.top){k=p.top-e.arrowTop;if(k>b.height/2)k=b.height/2;e.arrowTop+=k}e.top=e.arrowTop-(x.height-28-28)/3;if(e.top+x.height>p.bottom)e.top-=e.top+x.height-p.bottom;e.arrowLeft-=e.left;e.arrowTop=e.arrowTop-e.top-28;return e};this.MakeTooltip=function(){var b=a("#lgi_tip");b.length>0&&b.remove();b=a("<div id='lgi_tip'><div class='srv_top srv_top_normal'><div id='lgi_srv_close' style='display: none'><a href='javascript:;' onclick='quakelive.matchtip.HideMatchTooltip(-1); return false' class='lgi_btn_close'></a></div></div><div id='lgi_srv_fill'></div><div id='lgi_srv_bot'></div></div>");
b.appendTo("body");return b};this.ShowTooltip=function(b,k,c,e,p){var x=b.find("#lgi_srv_fill");x.empty().append(a("<div id='lgi_srv_content'></div>").append(c));b.find("#lgi_srv_bot").html(e);b.css("left","-9999px");b.css("top","-9999px");b.show();k=quakelive.cvars.Get("web_advancedBrowser").value==1?this.GetTooltipOffset(k,b,0):this.GetTooltipOffset(k,b,236);b.css("left",k.left+"px");b.css("top",k.top+"px");p&&x.append("<div id='lgi_arrow_"+k.arrowDirection+"' style='position: absolute; left: "+
k.arrowLeft+"px; top: "+k.arrowTop+"px'></div>");return b};this.BuildServerContent=function(b,k){var c=mapdb.getGameTypeByID(k.game_type),e=GetSkillRankInfo(k.skillDelta);skillColor=e.color;var p;p=b.find("#lgi_host_name").length==0?a("<div><div id='lgi_host_name' class=''></div><div id='lgi_map_name' class='lgi_big'></div><div id='lgi_map_group'><div id='lgi_map'><div id='lgi_map_pic'></div><div id='lgi_map_frame' class=''><div class='server_icons'></div></div><div id='lgi_skill_level' width='163' height='18'><div id='lgi_skill_icon'></div><div id='lgi_skill_level_name' class=''></div></div><div id='lgi_play' style='display: none'><a class='lgi_play_btn' href='javascript:;' onclick='quakelive.matchtip.JoinPinnedServer(); return false'></a></div></div><div id='lgi_map_details' class='lgi_medbold'></div></div></div>"):
b.find("#lgi_host_name").parent();p.find("#lgi_host_name").html(k.host_name);p.find("#lgi_map_frame").attr("class","frame_skill"+e.delta);p.find("#lgi_skill_level").removeClass().addClass("rank_"+e.delta);p.find("#lgi_skill_level_name").attr("class","name_skill"+e.delta).html(e.desc);p.find("#lgi_skill_level_mini").removeClass().addClass("rank_"+e.delta);p.find("#lgi_skill_icon").attr("class","rankicon rank_icon_"+e.delta);p.find("#lgi_skill_level_name_mini").attr("class","name_skill"+e.delta).html(e.desc);
k.ranked!=1&&p.find("#lgi_map_frame .server_icons").append('<div class="unranked_icon" title="Unranked Match"></div>');if(k.ruleset!=1){e=k.ruleset==2?"(PQL)":"(Unknown)";p.find("#lgi_map_frame .server_icons").append('<div class="modified_icon" title="Modified Ruleset '+e+'"></div>')}e=k.GetMapTitle();p.find("#lgi_map_name").html(e);e=a("<img width='112' height='84' alt='"+e+"' />");p.find("#lgi_map_pic").empty().append(e);e={pacifier:"/images/levelshots/md/default.jpg",resource:"/images/levelshots/md/"+
k.map.toLowerCase()+".jpg",target:e};quakelive.resourceLoader.Load(e);var x=p.find("#lgi_map_details").empty();e=function(l,q,u){var g=x.find("#"+l);if(g.length==0){g=a(["<p id='",l,"' class='lgi_row'><img src='' width='16' height='16' alt='' /><span></span><div class='cl'></div></p>"].join(""));x.append(g)}g.find("img").attr("src",u);g.find("span").html(q)};k.premium&&e("lgi_premium","Premium Match",quakelive.resource("/images/lgi/premium_icon.png"));k.g_needpass&&e("lgi_match_secure","Password Secured",
quakelive.resource("/images/lgi/server_details_ranked.png"));var t=locdb.GetByID(k.location_id);if(t){t=t.IsUSA()?t.GetCityState():[t.countryAbbr,t.GetCityState()].join(", ");e("lgi_match_location",t,quakelive.resource("/images/lgi/server_details_hosted.png"))}e("lgi_match_gametype",k.GetGameTypeTitle(),quakelive.resource("/images/gametypes/xsm/"+c.name+".png"));if(self.updateTimeHandle){clearTimeout(self.updateTimeHandle);self.updateTimeHandle=null}if(k.details){t=0;var z="";if(k.game_type==mapdb.GameTypes.CTF){t=
k.capturelimit;z="Capture Limit"}else if(k.game_type==mapdb.GameTypes.CA){t=k.roundlimit;z="Round Limit"}else{t=k.fraglimit;z="Frag Limit"}e("lgi_match_scorelimit",z+": "+(t||"None"),quakelive.resource("/images/lgi/server_details_fraglimit.png"));TimeUpdater=function(){var l="";if(k.g_gamestate=="IN_PROGRESS"){l=parseInt((new Date).getTime()/1E3);l=k.timelimit*60-(l-k.g_levelstarttime);if(l>0){var q=parseInt(l/60);l-=q*60;l="Time Left: "+ZeroPad(q)+":"+ZeroPad(l);self.updateTimeHandle=setTimeout(TimeUpdater,
1E3)}else l="Time Left: None"}else l="Time Limit: "+(k.timelimit==0?"None":k.timelimit);q=b.find("#lgi_match_timeleft span");q.length>0&&q.text(l);return l};t=TimeUpdater();e("lgi_match_timeleft",t,quakelive.resource("/images/lgi/server_details_time.png"))}if(k.teamsize>0){c=k.teamsize*(c.name=="ffa"?1:2);t=k.num_players}else{c=k.max_clients;t=k.num_clients}c="Players: "+t+" / "+c;if(k.num_friends>0){if(k.num_clients>1)c+=" ("+k.num_friends+")";t=quakelive.resource("/images/lgi/server_details_friends.png")}else t=
quakelive.resource("/images/lgi/server_details_players.png");e("lgi_match_players",c,t);b.find("#lgi_scoreboard,#lgi_details_footer").remove();if(k.g_gamestate=="IN_PROGRESS"){c=[];if(mapdb.isTeamGameType(k.game_type)){if(k.g_redscore>=k.g_bluescore){e=0;t=1}else{e=1;t=0}c[e]={name:"Red Team",score:k.g_redscore,classes:"red_team_color"};c[t]={name:"Blue Team",score:k.g_bluescore,classes:"blue_team_color"}}else{t=[99999,99999];z=[0,0];for(e=0;e<k.players.length;++e)for(var r=k.players[e],m=0;m<t.length;++m)if(r.rank<
t[m]&&r.team!=d.Spec){t[m]=r.rank;z[m]=e;break}for(m=0;m<t.length;++m){e={};r=k.players[z[m]];e.name=r.name;e.clan=r.clan;e.score=r.score;c[m]=e}}if(c.length>0){t="";r=a("<div id='lgi_scoreboard'></div>").appendTo(x);r.append("<div class='lgi_row tc inprogress_txt'>Scoreboard</div>");t+="<div class='lgi_scores_section'>";for(e=0;e<c.length;++e){z=(c[e].clan?c[e].clan+" ":"")+c[e].name;t+=["<div class='lgi_separator'></div><div class='lgi_scores_row'><div class='lgi_name'>",StripColors(z),"</div><div class='lgi_score'>",
c[e].score,"</div><div class='cl'></div></div>"].join("")}t+="</div>";r.append(t)}}else{c=a("<p id='lgi_details_footer' class='lgi_row tc pregame_txt'></p>");k.players.length>0?c.text("Pre-Game Warmup"):c.text("Waiting For Players");x.append(c)}return p};this.DisplayMatchTooltip=function(b,k){var c,e,p,x=this.MakeTooltip();k&&k.invitation?x.find(".srv_top").attr("class","srv_top srv_top_invited"):x.find(".srv_top").attr("class","srv_top srv_top_normal");if(k===null){c=["<img src='",quakelive.resource("/images/loader.gif"),
"' width='62' height='13' style='padding: 5px' />"].join("");e="<p style='color: #eee'>Loading Game Info&hellip;</p>";p=false;this.UnPinMatchTooltip()}else if(typeof k=="string"){c=["<div style='padding: 5px'>",k,"</div>"].join("");e="<p style='color: #f00'>An Error Occurred</p>";p=false;this.UnPinMatchTooltip()}else if(typeof k=="object"){c=this.BuildServerContent(x,k);e=GetSkillRankInfo(k.skillDelta);e=k.disableJoin?["<p style='color: ",e.color,"'>Click for Details!</p>"].join(""):["<p style='color: ",
e.color,"' onclick='quakelive.matchtip.JoinPinnedServer(); return false' class='interactive'>Click to Join Game!</p>"].join("");p=true}return this.ShowTooltip(x,b,c,e,p)};var d={Free:0,Red:1,Blue:2,Spec:3};this.DisplayMatchPlayers=function(b){var k=a("#lgi_tip"),c=a("#lgi_cli");if(c.length==0){c=a("<div id='lgi_cli'><div id='lgi_cli_top'><div class='lgi_headcol_1'>Player Name</div><div class='lgi_headcol_2'>Score</div></div><div id='lgi_cli_fill'><div id='lgi_cli_content'></div></div><div id='lgi_cli_bot'></div></div>");
c.appendTo("body")}var e=c.find("#lgi_cli_content");e.empty();if(b.players.length>0)for(var p=0;p<b.players.length;++p){var x=b.players[p],t,z,r,m,l;m=p%2==0?"lgi_med lgi_cli_row_1":"lgi_med lgi_cli_row_2";if(x.friend)m+=" lgi_is_friend";else if(x.blocked)m+=" lgi_is_blocked";t=x.clan?StripColors(x.clan)+" ":"";z=StripColors(x.name);t+=z;if(x.bot){t+=" <i>(Bot)</i>";m+=" lgi_is_bot"}r=x.team==d.Spec?"SPEC":x.score;if(x.model){var q=x.model.toLowerCase().split("/");l=q[0]+"_";l+=q[1]?q[1]:"default"}else l=
"sarge_default";if(x.team==d.Red)l=ChangeModelSkin(l,"red");else if(x.team==d.Blue)l=ChangeModelSkin(l,"blue");q="<a href='#!profile/summary/"+StripColors(x.name)+"'>";z=quakelive.mod_friends.IsBlocked(z)?"<img src='"+quakelive.resource("/images/players/icon_gray_sm/"+l+".png")+"' class='lgi_bordercolor_"+x.team+"' width='18' height='18' />":"<img src='"+quakelive.resource("/images/players/icon_sm/"+l+".png")+"' class='lgi_bordercolor_"+x.team+"' width='18' height='18' />";t=t;if(!x.bot){z=q+z+"</a>";
t=q+t+"</a>"}e.append("<div class='"+m+"'><div class='lgi_cli_col_1'>"+z+"<span>"+t+"</span><div class='cl'></div></div><div class='lgi_cli_col_2'>"+r+"</div></div>")}else e.append("<center>No Players in Game</center>");a(document).scrollLeft();a(document).scrollTop();a(document).scrollLeft();a("body").width();a(document).scrollTop();a("body").height();a("body").width();a("body").height();b=this.GetDimensions(k);b={left:b.left,top:b.top,right:b.left+b.innerWidth,bottom:b.top+b.innerHeight,width:b.innerWidth,
height:b.innerHeight};e={width:236};e.left=k.orientation=="left"?b.left-e.width:b.right;e.top=b.top;c.css("left",e.left+"px");c.css("top",e.top+"px");c.show()};this.HideMatchTooltip=function(){this.UnPinMatchTooltip();this.activeContext=this.hoverNode=this.hoverServer=this.pinnedServer=null;a.ajaxAbort("matchdetails");a("#lgi_tip").hide();a("#lgi_cli").hide();if(this.updateTimeHandle){clearTimeout(this.updateTimeHandle);this.updateTimeHandle=null}if(this.refreshDetailsHandle){clearTimeout(this.refreshDetailsHandle);
this.refreshDetailsHandle=null}};this.HideContextualMatchTooltip=function(b){this.activeContext==b&&this.HideMatchTooltip()};this.OnHoverMatchTooltip=function(b,k,c){var e=quakelive.serverManager.GetServerInfo(k);e&&e.details?this.DisplayMatchTooltip(b,e):this.DisplayMatchTooltip(b,null);this.hoverNode=b;this.hoverServer=e;var p=this,x=function(r,m){if(!m){p.DisplayMatchTooltip(b,r);p.pinnedServer==r&&p.DisplayMatchPlayers(r)}},t=function(){p.DisplayMatchTooltip(b,"We're sorry, but we cannot load the data for this match.")};
if(this.refreshDetailsHandle){clearTimeout(this.refreshDetailsHandle);this.refreshDetailsHandle=null}var z=function(){quakelive.serverManager.RefreshServerDetails(k,{onSuccess:x,onError:t,cacheTime:p.MATCH_CACHE_TIME,cachedServerIds:c});p.refreshDetailsHandle=setTimeout(z,p.MATCH_CACHE_TIME*1E3)};z()};this.UnPinMatchTooltip=function(){this.pinnedServer&&this.pinnedOptions.onHoverOff&&this.pinnedOptions.onHoverOff(this.pinnedOptions.node,this.pinnedOptions.public_id);this.pinnedOptions=this.pinnedServer=
null;a("#lgi_cli").hide();a("#lgi_play,#lgi_srv_close").hide();a(".pinned_box,.pinned_bestpick_box").removeClass("pinned_box pinned_bestpick_box")};this.JoinPinnedServer=function(){this.pinnedServer&&this.JoinServer(this.pinnedServer)};this.PinMatchTooltip=function(b,k){var c=a("#lgi_tip");if(c.length!=0){var e=c.offset();if(e.left||e.top){this.pinnedServer=b;this.pinnedOptions=k;!b.skillTooHigh&&!b.disableJoin&&c.find("#lgi_play").show();c.find("#lgi_srv_close").show();c=a("#match_"+b.public_id);
c.hasClass("qlv_pls_box")?c.addClass("pinned_box"):c.addClass("pinned_bestpick_box")}}};this.OnClickMatchTooltip=function(b,k,c){var e=quakelive.serverManager.GetServerInfo(k);if(!(!e||e.error))if(e.details){if(this.pinnedServer&&this.pinnedServer!=e){this.OnHoverMatchTooltip(b,k);this.UnPinMatchTooltip()}this.DisplayMatchPlayers(e);this.PinMatchTooltip(e,c)}};this.OnDblClickMatchTooltip=function(b,k){var c=quakelive.serverManager.GetServerInfo(k);if(!c||c.error)return false;if(c.skillTooHigh||c.disableJoin)return false;
this.JoinServer(c);return true};this.BindMatchTooltip=function(b,k,c){if(b){c=a.extend({onHover:null,onHoverOff:null,onClick:null,onDblClick:null,targetContext:null},c);this.target=c.target;b.unbind("hover");b.unbind("click");b.unbind("dblclick");c.node=b;c.public_id=k;var e=this;b.click(function(){c.onClick&&c.onClick(b,k);if(c.targetContext)e.activeContext=c.targetContext;e.OnClickMatchTooltip(b,k,c);return false});b.dblclick(function(){c.onDblClick&&c.onDblClick(b,k);if(c.targetContext)e.activeContext=
c.targetContext;return e.OnDblClickMatchTooltip(b,k)});b.hover(function(){if(!(e.pinnedServer&&k==e.pinnedServer.public_id&&(e.hoverNode==null||b==e.hoverNode))){c.onHover&&c.onHover(b,k);if(c.targetContext)e.activeContext=c.targetContext;e.UnPinMatchTooltip();e.OnHoverMatchTooltip(b,k,c.cachedServerIds)}},function(){if(!e.pinnedServer){c.onHoverOff&&c.onHoverOff(b,k);e.HideMatchTooltip(k);e.activeContext=null}})}};this.BindBotTooltip=function(b,k){b.unbind("hover");b.unbind("click");b.unbind("dblclick");
var c=this;b.click(function(){return false});b.hover(function(){c.UnPinMatchTooltip();var e=k.MAP.toLowerCase().split("/");e=e[e.length-1].split(".");e=e[0];(e=mapdb.getBySysName(e))&&c.ShowMapInfo(b,e,"In Practice Match")},function(){c.HideMatchTooltip(-1)})};this.BindMapTooltip=function(b,k,c){b.unbind("hover");b.unbind("click");b.unbind("dblclick");var e=this;b.click(function(){return false});b.hover(function(){var p=mapdb.getBySysName(k);e.UnPinMatchTooltip();e.ShowMapInfo(b,p,c)},function(){e.HideMatchTooltip(-1)})};
this.ShowMapInfo=function(b,k,c){var e=a("#lgi_tip");e.length>0&&e.remove();e=a("<div id='lgi_tip'><div class='srv_top srv_top_normal'></div><div id='lgi_srv_fill'><div id='lgi_srv_bot_content'><h1>"+(k.name||"Unknown")+"</h1><img class='levelshot' width='112' height='84' /></div></div><div id='lgi_srv_bot'><p style='color: white;'>"+(typeof c=="function"?c(k):c)+"</p></div></div>");k={pacifier:"/images/levelshots/md/default.jpg",resource:"/images/levelshots/md/"+k.sysname+".jpg",target:e.find(".levelshot")};
quakelive.resourceLoader.Load(k);e.appendTo("body");b=this.GetTooltipOffset(b,e,0);e.css("left",b.left+"px");e.css("top",b.top+"px");e.show()};this.JoinServer=function(b){this.HideMatchTooltip(-1);if(quakelive.IsGameRunning()){qz_instance.SendGameCommand("connect "+b.host_address);quakelive.SendModuleMessage("OnGameUpdated",{isBotGame:false,serverInfo:b})}else join_server(b.host_address,b)}})})(jQuery);
(function(a){var d=new (function(){this.cache={};this.Add=function(b,k){this.cache[b]={value:k,time:new Date}};this.Get=function(b){if(this.cache[b]){if(new Date-this.cache[b].time<3E5)return this.cache[b].value;this.Remove(b)}return null};this.Remove=function(b){this.cache[b].value=undefined;this.cache[b]=undefined}});quakelive.statstip=new (function(){this.GetTooltipOffset=function(m,l){var q={},u={left:a(document).scrollLeft(),top:a(document).scrollTop(),right:a(document).scrollLeft()+a("body").width(),
bottom:a(document).scrollTop()+a("body").height(),width:a("body").width(),height:a("body").height()},g={left:m.offset().left,top:m.offset().top,right:m.offset().left+m.innerWidth(),bottom:m.offset().top+m.innerHeight(),width:m.width(),height:m.height()},o={width:l.innerWidth(),height:l.innerHeight()};q.left=g.right+o.width>u.right?g.left-o.width:g.left+g.width;q.top=g.top-o.height/3;if(q.top+o.height>u.bottom)q.top-=q.top+o.height-u.bottom;return q};this.GetVersusFrame=function(m,l,q,u,g){var o=a(quakelive.mod_stats.TPL_MATCH_VSCONTAINER),
y=l.TEAM?"xl_"+l.TEAM.toLowerCase():"xl",v=[l.PLAYER_MODEL||"sarge_default",q&&q.PLAYER_MODEL?q.PLAYER_MODEL:"sarge_default"];l=[l,q];u=[u,g];o.find(".gameTypeIcon").html('<img src="'+quakelive.resource("/images/gametypes/"+y+"/"+m+".png")+'" width="75" height="75" />');for(m=0;m<2;++m){q=l[m];var C=u[m];y=v[m];g=m+1;if(q){if(q.TEAM){o.find(".scoreNum"+g).addClass("text_team_"+q.TEAM.toLowerCase()).text(FirstDefined(C.ROUNDS_WON,C.CAPTURES,C.SCORE));y=ChangeModelSkin(y,q.TEAM.toLowerCase());o.find(".flagNum"+
g).hide();o.find(".nameNum"+g).text("Team "+q.TEAM)}else{q.PLAYER_COUNTRY&&o.find(".flagNum"+g).html('<img src="'+quakelive.resource("/images/flags/"+q.PLAYER_COUNTRY.toLowerCase()+".gif")+'" width="16" height="11" />').show();o.find(".nameNum"+g).text(q.PLAYER_NICK);o.find(".scoreNum"+g).text(q.SCORE)}q=quakelive.mod_friends.IsBlocked(q.PLAYER_NICK)?quakelive.PlayerAvatarPath.G_XL:quakelive.PlayerAvatarPath.XL;o.find(".headNum"+g).html('<img src="'+quakelive.resource(q+y+".png")+'" />')}else{o.find(".headNum"+
g).html('<img src="'+quakelive.resource("/images/empty.gif")+'" width="62" height="62" />');o.find(".scoreNum"+g).text("--");o.find(".flagNum"+g).hide();o.find(".nameNum"+g).text("N/A");o.find(".rankNum"+g).hide();o.find(".noPlayer"+g).show()}}return o};this.DisplayStatsTooltip=function(m,l){var q=a("#stats_tip");if(q.length==0)q=a(quakelive.mod_stats.TPL_MATCH_SUMMARY);var u=a("<div id='stats_srv_content'></div>");if(l){if(l.UNAVAILABLE){quakelive.mod_premium.ShowBrochurePopup();return null}var g=
this.TIP_DEFS[l.GAME_TYPE];if(!g)return;var o=[],y=[null,null];if(l.WINNING_TEAM){var v=l.WINNING_TEAM.toUpperCase(),C=l[(v=="RED"?"BLUE":"RED")+"_SCOREBOARD"];o[0]=l[v+"_SCOREBOARD"][0];o[1]=C[0];if(l.WINNING_TEAM==l.TEAM_SCOREBOARD[0].TEAM){y[0]=l.TEAM_SCOREBOARD[0];y[1]=l.TEAM_SCOREBOARD[1]}else{y[0]=l.TEAM_SCOREBOARD[1];y[1]=l.TEAM_SCOREBOARD[0]}winner=l.WINNING_TEAM}else{o[0]=l.SCOREBOARD[0];o[1]=l.SCOREBOARD[1];winner=o[0]}q.find("#stats_datacontainer").empty().append(this.GetVersusFrame(l.GAME_TYPE,
o[0],o[1],y[0],y[1])).append(quakelive.mod_stats.TPL_MATCH_SUMMARY_INNER);q.find("#match_mapshot").html('<img alt="" src="'+quakelive.resource("/images/levelshots/md/"+l.MAP_NAME_SHORT+".jpg")+'" width="112" height="84" class="placeImg" />');C='<span class="grayNameTxt">'+l.MAP_NAME+"</span><br />";C+='<span class="Norm11px"><b>Game Type:</b> '+this.FormatGameType(l)+"</span><br />";C+='<span class="Norm11px"><b>Date:</b> '+l.GAME_TIMESTAMP_NICE+" ago</span><br />";C+='<span class="Norm11px"><b>Winner:</b> ';
C+=l.WINNING_TEAM?l.WINNING_TEAM:l.SCOREBOARD[0].PLAYER_NICK;C+="</span><br />";C+='<span class="Norm11px"><b>Duration:</b> '+l.GAME_LENGTH_NICE+"</span><br />";q.find("#match_maindata").html(C);for(y=o=0;y<g.length;++y){v=g[y];if(l[v.key]){C=o++%2==0?"lghtgrayBG":"drkgrayBG";C='<div class="'+C+"\"><div class='leftCol'>"+v.name+"</div>";C+="<div class='midCol'>";C+="<img src='"+quakelive.resource("/images/flags/"+l[v.key].PLAYER_COUNTRY.toLowerCase()+".gif")+"' width='16' height='11' class='tipPlayerFlag fl' />";
var G=l[v.key].PLAYER_MODEL;if(l[v.key].PLAYER_TEAM)G=ChangeModelSkin(G,l[v.key].PLAYER_TEAM.toLowerCase());var H;H=quakelive.mod_friends.IsBlocked(l[v.key].PLAYER_NICK)?quakelive.PlayerAvatarPath.G_SM:quakelive.PlayerAvatarPath.SM;C+="<img src='"+quakelive.resource(H+G+".png")+"' width='18' height='18' class='tipPlayerIcon fl' />";C+=l[v.key].PLAYER_NICK;C+="</div>";C+="<div class='rightCol'>"+(v.fmt?v.fmt(l[v.key].NUM,l):l[v.key].NUM)+"</div>";C+="<div class='cl'></div></div>";q.find(".match_highlights").append(C)}}C=
o++%2==0?"lghtgrayBG":"drkgrayBG";q.find(".match_highlights").append('<div class="'+C+'"></div>')}q.find("#stats_srv_fill").append(u);q.css("left","0px");q.css("top","0px");q.appendTo("body");u=this.GetTooltipOffset(m,q);q.css("left",u.left+"px");q.css("top",u.top+"px");q.show();return q};this.HideStatsTooltip=function(){this.loading_public_id=0;a("#stats_tip").remove().hide();a("#stats_cli").remove().hide()};this.OnHoverStatsTooltip_Success=function(m,l,q,u){return this.DisplayStatsTooltip(m,u)};
this.OnHoverStatsTooltip_Error=function(){a("#stats_datacontainer").html('<div class="error">The match you have requested is invalid or has expired.</div>')};var b={NONE:0,SWITCHED:1,QUIT:2};this.ProcessMatchData=function(m){var l=["SCOREBOARD","RED_SCOREBOARD","BLUE_SCOREBOARD"],q={};for(var u in l){var g=l[u];q[g]||(q[g]={});for(var o in m[g]){var y=m[g][o];if(typeof y.PLAYER_NICK!="string")y.PLAYER_NICK=""+y.PLAYER_NICK;q[g][y.PLAYER_NICK]=true}}for(u in l){g=l[u];var v=g+"_QUITTERS";if(typeof m[v]!=
"undefined"){var C=1,G=[],H={};for(o in m[v]){y=m[v][o];if(typeof y.PLAYER_NICK!="string")y.PLAYER_NICK=""+y.PLAYER_NICK;for(var F in y){if(typeof H[F]=="undefined")H[F]=0;try{var J=parseInt(y[F]);if(typeof J=="number")H[F]+=J}catch(Q){}}y.QUITTERS_SUM=false;if(y.RANK=="Q"){var aa=null;if(g=="RED_SCOREBOARD")aa="BLUE_SCOREBOARD";else if(g=="BLUE_SCOREBOARD")aa="RED_SCOREBOARD";y.QUIT_STATUS=aa&&q[aa][y.PLAYER_NICK]?b.SWITCHED:b.QUIT}else y.QUIT_STATUS=b.NONE;G[C++]=y}H.QUITTERS_SUM=true;if(typeof y.TEAM!=
"undefined"){H.TEAM_RANK="Q";H.TEAM=y.TEAM}H.PLAYER_COUNTRY="";H.PLAYER_MODEL="";H.PLAYER_NICK="";g=m[v].length;for(var ca in p){C=p[ca];if(typeof H[C]!="undefined")try{H[C]=Math.round(H[C]/g)}catch(qa){}}G[0]=H;G.sort(function(ja,ga){if(ja.QUITTERS_SUM||ga.QUITTERS_SUM)return ja.QUITTERS_SUM===true&&ga.QUITTERS_SUM===false?-1:ja.QUITTERS_SUM===false&&ga.QUITTERS_SUM===true?1:0;if(ja.QUIT_STATUS<ga.QUIT_STATUS)return-1;else if(ja.QUIT_STATUS>ga.QUIT_STATUS)return 1;else{var ma=ja.PLAYER_NICK.toLowerCase(),
ka=ga.PLAYER_NICK.toLowerCase();return ma<ka?-1:ma>ka?1:0}});m[v]=G}}};this.loading_public_id=0;this.OnHoverStatsTooltip=function(m,l,q,u){this.DisplayStatsTooltip(m,null);this.loading_public_id=l;var g=d.Get(l);if(g){q=this.OnHoverStatsTooltip_Success(m,l,u,g.json);g.tip=q;q.show();this.loading_public_id=0}else{var o=this;if(o.loading_public_id==l){g="/stats/matchdetails/";g+=q!=null?l+"/"+u+"/"+q:l+"/"+u;a.ajax({url:g,dataType:"json",mode:"abort",port:"statstip",cache:true,success:function(y){o.ProcessMatchData(y);
if(l==o.loading_public_id){var v=o.OnHoverStatsTooltip_Success(m,l,u,y);if(v==null)return;v.show()}d.Add(l,{json:y,tip:null});o.loading_public_id=0},error:o.OnHoverStatsTooltip_Error})}}};this.FormatProfileLink=function(m,l){var q="";if(l.QUITTERS_SUM)q+="<b>Switched / Quit</b>";else{var u=l.PLAYER_MODEL;if(l.TEAM)u=ChangeModelSkin(l.PLAYER_MODEL,l.TEAM.toLowerCase());var g;g=quakelive.mod_friends.IsBlocked(l.PLAYER_NICK)||l.QUIT_STATUS==b.QUIT?quakelive.PlayerAvatarPath.G_SM:quakelive.PlayerAvatarPath.SM;
q+="<img src='"+quakelive.resource("/images/flags/"+l.PLAYER_COUNTRY.toLowerCase()+".gif")+"' width='16' height='11' class='boardPlayerFlag' />";q+="<img src='"+quakelive.resource(g+u+".png")+"' width='18' height='18' class='boardPlayerIcon' />";q+='<a href="#!profile/summary/'+m+'" style="color: black">'+m+"</a>"}return q};this.ToggleQuitters=function(){var m=a(this).find("a.QuittersToggleBtn");m.toggleClass("QuittersToggledBtn");a("."+m.attr("data")).toggle()};this.FormatRank=function(m,l){if(l.QUITTERS_SUM)return'<a href="javascript:;" data="'+
((l.TEAM?l.TEAM:"")+"Quitters")+'" class="QuittersToggleBtn"></a>';if(l.QUIT_STATUS)return l.QUIT_STATUS==b.SWITCHED?'<img src="'+quakelive.resource("/images/switch_arrow_2.png")+'" width="16" height="16" title="Switched Teams" />':"Quit";if(typeof m=="string"&&m.charAt(0)=="Q"||m==-1)return"--";return FormatRank(m)};this.FormatWeaponNumber=function(m){return m==0||m=="N/A"?"--":m};this.FormatTime=function(m){return FormatDuration(m)};this.FormatPercent=function(m){return m!=0&&m!="N/A"?m+"%":"--"};
var k=[{field:"TEAM_RANK",title:"Rank",extraClass:"tc",fmt:this.FormatRank},{field:"PLAYER_NICK",title:"Player",extraClass:"tl",fmt:this.FormatProfileLink},{field:"CAPTURES",title:"Caps",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:"Flag Captures"},{field:"DEFENDS",title:"Defd",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:"Flag Defends"},{field:"ASSISTS",title:"Assts",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:"Flag Assists"},{field:"THAWS",title:"Thaws",extraClass:"tc",fmt:this.FormatWeaponNumber,
alt:"Thaw Assists"},{field:"ROUNDS_WON",title:"Rounds Won",extraClass:"tc",fmt:null},{field:"SCORE",title:"Score",extraClass:"tc",fmt:null},{field:"KILLS",title:"Frags",extraClass:"tc",fmt:null},{field:"DEATHS",title:"Deaths",extraClass:"tc",fmt:null},{field:"DAMAGE_DEALT",title:"DmgD",extraClass:"tc",fmt:null,alt:"Damage Dealt"},{field:"DAMAGE_TAKEN",title:"DmgR",extraClass:"tc",fmt:null,alt:"Damage Received"},{field:"ACCURACY",title:"Acc",extraClass:"tc",fmt:this.FormatPercent,alt:"Accuracy"},{field:"MIN",
title:"Time",extraClas:"tc",fmt:this.FormatTime},{field:"EXCELLENT",title:"Exc",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:'"Excellent" medals',optional:true},{field:"IMPRESSIVE",title:"Imp",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:'"Impressive" medals',optional:true}],c=[{field:"RANK",title:"Rank",extraClass:"tc",fmt:this.FormatRank},{field:"PLAYER_NICK",title:"Player",extraClass:"tl",fmt:this.FormatProfileLink},{field:"GT",title:"GT",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:"Gauntlet"},
{field:"MG",title:"MG",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:"Machine Gun"},{field:"SG",title:"SG",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:"Shot Gun"},{field:"GL",title:"GL",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:"Grenade Launcher"},{field:"LG",title:"LG",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:"Lightning Gun"},{field:"RL",title:"RL",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:"Rocket Launcher"},{field:"RG",title:"RG",extraClass:"tc",fmt:this.FormatWeaponNumber,
alt:"Rail Gun"},{field:"PG",title:"PG",extraClas:"tc",fmt:this.FormatWeaponNumber,alt:"Plasma Gun"},{field:"BFG",title:"BFG",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:"BFG"},{field:"CG",title:"CG",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:"Chain Gun"},{field:"NG",title:"NG",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:"Nail Gun"},{field:"PM",title:"PL",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:"Prox Launcher"}],e=[{field:"TEAM_RANK",title:"Rank",extraClass:"tc",fmt:this.FormatRank},
{field:"PLAYER_NICK",title:"Player",extraClass:"tl",fmt:this.FormatProfileLink},{field:"GT",title:"GT",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:"Gauntlet"},{field:"MG",title:"MG",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:"Machine Gun"},{field:"SG",title:"SG",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:"Shot Gun"},{field:"GL",title:"GL",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:"Grenade Launcher"},{field:"LG",title:"LG",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:"Lightning Gun"},
{field:"RL",title:"RL",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:"Rocket Launcher"},{field:"RG",title:"RG",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:"Rail Gun"},{field:"PG",title:"PG",extraClas:"tc",fmt:this.FormatWeaponNumber,alt:"Plasma Gun"},{field:"BFG",title:"BFG",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:"BFG"},{field:"CG",title:"CG",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:"Chain Gun"},{field:"NG",title:"NG",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:"Nail Gun"},
{field:"PM",title:"PL",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:"Prox Launcher"}],p=["GT_A","MG_A","SG_A","GL_A","LG_A","RL_A","RG_A","PG_A","BFG_A","CG_A","NG_A","PM_A","ACCURACY"],x=[{field:"RANK",title:"Rank",extraClass:"tc",fmt:this.FormatRank},{field:"PLAYER_NICK",title:"Player",extraClass:"tl",fmt:this.FormatProfileLink},{field:"GT_A",title:"GT",extraClass:"tc",fmt:this.FormatPercent,alt:"Gauntlet"},{field:"MG_A",title:"MG",extraClass:"tc",fmt:this.FormatPercent,alt:"Machine Gun"},{field:"SG_A",
title:"SG",extraClass:"tc",fmt:this.FormatPercent,alt:"Shot Gun"},{field:"GL_A",title:"GL",extraClass:"tc",fmt:this.FormatPercent,alt:"Grenade Launcher"},{field:"LG_A",title:"LG",extraClass:"tc",fmt:this.FormatPercent,alt:"Lightning Gun"},{field:"RL_A",title:"RL",extraClass:"tc",fmt:this.FormatPercent,alt:"Rocket Launcher"},{field:"RG_A",title:"RG",extraClass:"tc",fmt:this.FormatPercent,alt:"Rail Gun"},{field:"PG_A",title:"PG",extraClas:"tc",fmt:this.FormatPercent,alt:"Plasma Gun"},{field:"BFG_A",
title:"BFG",extraClass:"tc",fmt:this.FormatPercent,alt:"BFG"},{field:"CG_A",title:"CG",extraClass:"tc",fmt:this.FormatPercent,alt:"Chain Gun"},{field:"NG_A",title:"NG",extraClass:"tc",fmt:this.FormatPercent,alt:"Nail Gun"},{field:"PM_A",title:"PL",extraClass:"tc",fmt:this.FormatPercent,alt:"Prox Launcher"}],t=[{field:"TEAM_RANK",title:"Rank",extraClass:"tc",fmt:this.FormatRank},{field:"PLAYER_NICK",title:"Player",extraClass:"tl",fmt:this.FormatProfileLink},{field:"GT_A",title:"GT",extraClass:"tc",
fmt:this.FormatPercent,alt:"Gauntlet"},{field:"MG_A",title:"MG",extraClass:"tc",fmt:this.FormatPercent,alt:"Machine Gun"},{field:"SG_A",title:"SG",extraClass:"tc",fmt:this.FormatPercent,alt:"Shot Gun"},{field:"GL_A",title:"GL",extraClass:"tc",fmt:this.FormatPercent,alt:"Grenade Launcher"},{field:"LG_A",title:"LG",extraClass:"tc",fmt:this.FormatPercent,alt:"Lightning Gun"},{field:"RL_A",title:"RL",extraClass:"tc",fmt:this.FormatPercent,alt:"Rocket Launcher"},{field:"RG_A",title:"RG",extraClass:"tc",
fmt:this.FormatPercent,alt:"Rail Gun"},{field:"PG_A",title:"PG",extraClas:"tc",fmt:this.FormatPercent,alt:"Plasma Gun"},{field:"BFG_A",title:"BFG",extraClass:"tc",fmt:this.FormatPercent,alt:"BFG"},{field:"CG_A",title:"CG",extraClass:"tc",fmt:this.FormatPercent,alt:"Chain Gun"},{field:"NG_A",title:"NG",extraClass:"tc",fmt:this.FormatPercent,alt:"Nail Gun"},{field:"PM_A",title:"PL",extraClass:"tc",fmt:this.FormatPercent,alt:"Prox Launcher"}];this.BOARD_DEFS=[{index:"SCOREBOARD",type:"normal",fields:[{field:"RANK",
title:"Rank",extraClass:"tc",fmt:this.FormatRank},{field:"PLAYER_NICK",title:"Player",extraClass:"tl",fmt:this.FormatProfileLink},{field:"SCORE",title:"Score",extraClass:"tc",fmt:null},{field:"KILLS",title:"Frags",extraClass:"tc",fmt:null},{field:"DEATHS",title:"Deaths",extraClass:"tc",fmt:null},{field:"DAMAGE_DEALT",title:"DmgD",extraClass:"tc",fmt:null,alt:"Damage Dealt"},{field:"DAMAGE_TAKEN",title:"DmgR",extraClass:"tc",fmt:null,alt:"Damage Received"},{field:"ACCURACY",title:"Acc",extraClass:"tc",
fmt:this.FormatPercent,alt:"Accuracy"},{field:"MIN",title:"Time",extraClas:"tc",fmt:this.FormatTime},{field:"EXCELLENT",title:"Exc",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:'"Excellent" medals',optional:true},{field:"IMPRESSIVE",title:"Imp",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:'"Impressive" medals',optional:true},{field:"HUMILIATION",title:"Hum",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:'"Humiliation" medals',optional:true}],weaponFields:c,weaponAccFields:x,fieldOptions:null},
{index:"SCOREBOARD_QUITTERS",type:"normal",fields:[{field:"RANK",title:"Rank",extraClass:"tc",fmt:this.FormatRank},{field:"PLAYER_NICK",title:"Player",extraClass:"tl",fmt:this.FormatProfileLink},{field:"SCORE",title:"Score",extraClass:"tc",fmt:null},{field:"KILLS",title:"Frags",extraClass:"tc",fmt:null},{field:"DEATHS",title:"Deaths",extraClass:"tc",fmt:null},{field:"ACCURACY",title:"Acc",extraClass:"tc",fmt:this.FormatPercent,alt:"Accuracy"},{field:"MIN",title:"Time",extraClas:"tc",fmt:this.FormatTime},
{field:"EXCELLENT",title:"Exc",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:'"Excellent" medals',optional:true},{field:"IMPRESSIVE",title:"Imp",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:'"Impressive" medals',optional:true},{field:"HUMILIATION",title:"Hum",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:'"Humiliation" medals',optional:true}],weaponFields:c,weaponAccFields:x,fieldOptions:{quitters_summary:true,board_class:"SCOREBOARD"}},{index:"TEAM_SCOREBOARD",type:"team",fields:[{field:"TEAM",
title:"Team",extraClass:"tl",fmt:null},{field:"CAPTURES",title:"Caps",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:"Flag Captures"},{field:"DEFENDS",title:"Defs",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:"Flag Defends"},{field:"ASSISTS",title:"Assts",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:"Flag Assists"},{field:"ROUNDS_WON",title:"Rounds",extraClass:"tc",fmt:null,alt:"Rounds Won"},{field:"SCORE",title:"Score",extraClass:"tc",fmt:null},{field:"KILLS",title:"Frags",extraClass:"tc",
fmt:null},{field:"DAMAGE_DEALT",title:"DmgD",extraClass:"tc",fmt:null,alt:"Damage Dealt"},{field:"DAMAGE_TAKEN",title:"DmgR",extraClass:"tc",fmt:null,alt:"Damage Received"},{field:"DEATHS",title:"Deaths",extraClass:"tc",fmt:null},{field:"ACCURACY",title:"Acc",extraClass:"tc",fmt:this.FormatPercent,alt:"Accuracy"},{field:"EXCELLENT",title:"Exc",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:'"Excellent" medals',optional:true},{field:"IMPRESSIVE",title:"Imp",extraClass:"tc",fmt:this.FormatWeaponNumber,
alt:'"Impressive" medals',optional:true},{field:"HUMILIATION",title:"Hum",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:'"Humiliation" medals',optional:true}],weaponFields:[{field:"TEAM",title:"Team",extraClass:"tl",fmt:null},{field:"GT",title:"GT",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:"Gauntlet"},{field:"MG",title:"MG",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:"Machine Gun"},{field:"SG",title:"SG",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:"Shot Gun"},{field:"GL",title:"GL",
extraClass:"tc",fmt:this.FormatWeaponNumber,alt:"Grenade Launcher"},{field:"LG",title:"LG",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:"Lightning Gun"},{field:"RL",title:"RL",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:"Rocket Launcher"},{field:"RG",title:"RG",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:"Rail Gun"},{field:"PG",title:"PG",extraClas:"tc",fmt:this.FormatWeaponNumber,alt:"Plasma Gun"},{field:"BFG",title:"BFG",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:"BFG"},{field:"CG",
title:"CG",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:"Chain Gun"},{field:"NG",title:"NG",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:"Nail Gun"},{field:"PM",title:"PL",extraClass:"tc",fmt:this.FormatWeaponNumber,alt:"Prox Launcher"}],weaponAccFields:[{field:"TEAM",title:"Team",extraClass:"tl",fmt:null},{field:"GT_A",title:"GT",extraClass:"tc",fmt:this.FormatPercent,alt:"Gauntlet"},{field:"MG_A",title:"MG",extraClass:"tc",fmt:this.FormatPercent,alt:"Machine Gun"},{field:"SG_A",title:"SG",
extraClass:"tc",fmt:this.FormatPercent,alt:"Shot Gun"},{field:"GL_A",title:"GL",extraClass:"tc",fmt:this.FormatPercent,alt:"Grenade Launcher"},{field:"LG_A",title:"LG",extraClass:"tc",fmt:this.FormatPercent,alt:"Lightning Gun"},{field:"RL_A",title:"RL",extraClass:"tc",fmt:this.FormatPercent,alt:"Rocket Launcher"},{field:"RG_A",title:"RG",extraClass:"tc",fmt:this.FormatPercent,alt:"Rail Gun"},{field:"PG_A",title:"PG",extraClas:"tc",fmt:this.FormatPercent,alt:"Plasma Gun"},{field:"BFG_A",title:"BFG",
extraClass:"tc",fmt:this.FormatPercent,alt:"BFG"},{field:"CG_A",title:"CG",extraClass:"tc",fmt:this.FormatPercent,alt:"Chain Gun"},{field:"NG_A",title:"NG",extraClass:"tc",fmt:this.FormatPercent,alt:"Nail Gun"},{field:"PM_A",title:"PL",extraClass:"tc",fmt:this.FormatPercent,alt:"Prox Launcher"}],fieldOptions:null},{index:"RED_SCOREBOARD",type:"red",fields:k,weaponFields:e,weaponAccFields:t,fieldOptions:null,weaponFieldOptions:{class_prefix:"WP_"}},{index:"RED_SCOREBOARD_QUITTERS",type:"red",fields:k,
weaponFields:e,weaponAccFields:t,fieldOptions:{board_type:"red",board_class:"RED_SCOREBOARD",quitters_summary:true}},{index:"BLUE_SCOREBOARD",type:"blue",fields:k,weaponFields:e,weaponAccFields:t,fieldOptions:null},{index:"BLUE_SCOREBOARD_QUITTERS",type:"blue",fields:k,weaponFields:e,weaponAccFields:t,fieldOptions:{board_type:"blue",board_class:"BLUE_SCOREBOARD",quitters_summary:true}}];this.TIP_DEFS={ffa:[{name:"Most Frags",key:"MOST_FRAGS",fmt:null},{name:"Fewest Deaths",key:"LEAST_DEATHS",fmt:null},
{name:"Most Deaths",key:"MOST_DEATHS",fmt:null},{name:"Damage Delivered",key:"DMG_DELIVERED",fmt:null},{name:"Damage Taken",key:"DMG_TAKEN",fmt:null},{name:"Most Accurate",key:"MOST_ACCURATE",fmt:this.FormatPercent}],ctf:[{name:"Fewest Deaths",key:"LEAST_DEATHS",fmt:null},{name:"Most Assists",key:"MOST_ASSISTS",fmt:null},{name:"Most Captures",key:"MOST_CAPTURES",fmt:null},{name:"Most Defends",key:"MOST_DEFENDS",fmt:null},{name:"Most Kills",key:"MOST_KILLS",fmt:null}],tdm:[{name:"Most Frags",key:"MOST_FRAGS",
fmt:null},{name:"Fewest Deaths",key:"LEAST_DEATHS",fmt:null},{name:"Most Deaths",key:"MOST_DEATHS",fmt:null},{name:"Damage Delivered",key:"DMG_DELIVERED",fmt:null},{name:"Damage Taken",key:"DMG_TAKEN",fmt:null},{name:"Most Accurate",key:"MOST_ACCURATE",fmt:this.FormatPercent}],ca:[{name:"Fewest Deaths",key:"LEAST_DEATHS",fmt:null},{name:"Most Deaths",key:"MOST_DEATHS",fmt:null},{name:"Damage Delivered",key:"DMG_DELIVERED",fmt:null},{name:"Damage Taken",key:"DMG_TAKEN",fmt:null},{name:"Most Accurate",
key:"MOST_ACCURATE",fmt:this.FormatPercent}],duel:[{name:"Most Frags",key:"MOST_FRAGS",fmt:null},{name:"Fewest Deaths",key:"LEAST_DEATHS",fmt:null},{name:"Most Deaths",key:"MOST_DEATHS",fmt:null},{name:"Damage Delivered",key:"DMG_DELIVERED",fmt:null},{name:"Damage Taken",key:"DMG_TAKEN",fmt:null},{name:"Most Accurate",key:"MOST_ACCURATE",fmt:this.FormatPercent}],ft:[{name:"Most Freezes",key:"MOST_FREEZES",fmt:null},{name:"Most Thaws",key:"MOST_THAWS",fmt:null},{name:"Most Frozen",key:"MOST_FROZEN",
fmt:null},{name:"Damage Delivered",key:"DMG_DELIVERED",fmt:null},{name:"Damage Taken",key:"DMG_TAKEN",fmt:null}]};this.OnShowStatsDetails_Error=function(){a("#match_gametype").html("Unable to load match");a("#stats_datacontainer").html('<div class="error">The match you have requested is invalid or has expired.</div>')};this.OnShowStatsDetails_Success=function(m,l,q,u){a("#stats_datacontainer").html(quakelive.mod_stats.TPL_MATCH_DETAILS_INNER);l=[];q=[null,null];if(u.WINNING_TEAM){var g=u.WINNING_TEAM.toUpperCase(),
o=u.WINNING_TEAM!="NA"?u[(g=="RED"?"BLUE":"RED")+"_SCOREBOARD"]:u.BLUE_SCOREBOARD;l[0]=(u.WINNING_TEAM!="NA"?u[g+"_SCOREBOARD"]:u.RED_SCOREBOARD)[0];l[1]=o[0];if(u.WINNING_TEAM==u.TEAM_SCOREBOARD[0].TEAM){q[0]=u.TEAM_SCOREBOARD[0];q[1]=u.TEAM_SCOREBOARD[1]}else{q[0]=u.TEAM_SCOREBOARD[1];q[1]=u.TEAM_SCOREBOARD[0]}winner=u.WINNING_TEAM}else{l[0]=u.SCOREBOARD[0];l[1]=u.SCOREBOARD[1];winner=l[0]}m.find("#match_vscontainer").empty().append(this.GetVersusFrame(u.GAME_TYPE,l[0],l[1],q[0],q[1]));m.find("#match_gametype").html(this.FormatGameType(u));
m.find("#match_mapshot").html('<img alt="" src="'+quakelive.resource("/images/levelshots/md/"+u.MAP_NAME_SHORT+".jpg")+'" width="112" height="84" class="placeImg" />');l='<span class="grayNameTxt">'+u.MAP_NAME+"</span><br />";l+='<span class="Norm11px"><b>Date:</b> <span class="text_tooltip" title="'+u.GAME_TIMESTAMP+'">'+u.GAME_TIMESTAMP_NICE+" ago</span><br />";l+='<span class="Norm11px"><b>Winner:</b> ';l+=u.WINNING_TEAM?u.WINNING_TEAM:u.SCOREBOARD[0].PLAYER_NICK;l+="</span><br />";l+='<span class="Norm11px"><b>Duration:</b> '+
u.GAME_LENGTH_NICE+"</span><br />";l+='<span class="Norm11px"><b>Ranked:</b> '+(u.RANKED==1?"Yes":"No")+"</span><br />";m.find("#match_maindata").html(l);l=m.find(".match_scoreboard").empty();q=m.find(".match_weapons").empty();g=m.find(".match_weaponaccuracy").empty();o=0;var y=["SCOREBOARD","TEAM_SCOREBOARD"];if(u.WINNING_TEAM)if(u.WINNING_TEAM.toLowerCase()=="red"){y[y.length]="RED_SCOREBOARD";y[y.length]="BLUE_SCOREBOARD"}else{y[y.length]="BLUE_SCOREBOARD";y[y.length]="RED_SCOREBOARD"}for(var v in y)for(var C=
y[v],G=0;G<this.BOARD_DEFS.length;++G){var H=this.BOARD_DEFS[G];if(u[H.index]&&H.index==C){if(o++>0){l.append("<br />");q.append("<br />");g.append("<br />")}l.append(this.GetScoreboard(u,H));q.append(this.GetWeaponDetails(u,H));g.append(this.GetWeaponAccuracyDetails(u,H));if(H.index=="RED_SCOREBOARD"||H.index=="BLUE_SCOREBOARD"||H.index=="SCOREBOARD")if(u[H.index+"_QUITTERS"]){C=this.BOARD_DEFS[G+1];l.append(this.GetScoreboard(u,C));q.append(this.GetWeaponDetails(u,C));g.append(this.GetWeaponAccuracyDetails(u,
C))}break}}a.tablesorter.addParser({id:"names",is:function(){return false},format:function(Q){return Q=(Q=a(Q)[2])?Q.innerHTML.toLowerCase():"-"},type:"text"});a.tablesorter.addParser({id:"int",is:function(Q){return Q.split(":").length!==2},format:function(Q){return a.tablesorter.formatInt(Q)},type:"numeric"});a.tablesorter.addParser({id:"time",is:function(Q){return Q.split(":").length===2},format:function(Q){Q=Q.split(":");return Q[0]*60+Q[1]}});a.tablesorter.defaults.sortList=[[0,0]];a.tablesorter.defaults.widgets=
["zebra"];a.tablesorter.defaults.widgetZebra={css:["normalZebraOff","normalZebraOn"]};a.tablesorter.defaults.cssHeader="";a.tablesorter.defaults.headers={1:{sorter:"names"},2:{sorter:"numeric"},3:{sorter:"numeric"},4:{sorter:"numeric"},5:{sorter:"numeric"},6:{sorter:"numeric"},7:{sorter:"numeric"},8:{sorter:"numeric"},9:{sorter:"numeric"},10:{sorter:"numeric"},11:{sorter:"numeric"},12:{sorter:"numeric"},13:{sorter:"numeric"}};a("div#stats_datacontainer table:not(.teamBG, .quitterstable_normal, .quitterstable_red, .quitterstable_blue)").tablesorter();
a("table.teamBG").tablesorter({sortList:[[1,0]],headers:{0:{sorter:"text"},1:{sorter:"numeric"}}});v=a(".quitterstable_normal, .quitterstable_red, .quitterstable_blue");v.find("tbody tr:even").addClass("normalZebraOff");v.find("tbody tr:odd").addClass("normalZebraOn");v.find("thead tr").click(this.ToggleQuitters);a(".match_scoreboard > .board_blue > table,.match_scoreboard > .board_red > table,.match_scoreboard > .board_team > table,.match_scoreboard > .board_normal > table,.match_weaponaccuracy > .board_normal > table,.match_weaponaccuracy > .board_team > table,.match_weaponaccuracy > .board_blue > table,.match_weaponaccuracy > .board_red > table").each(function(Q,
aa){for(var ca=[],qa=[],ja=aa.rows,ga=0;ga<ja.length;ga++)for(var ma=ja[ga].getElementsByTagName("td"),ka=0;ka<ma.length;ka++){if(ca[ka]===undefined)ca[ka]=[];var S=ma[ka].className;if(!/(SCOREBOARD_TEAM_RANK|SCOREBOARD_PLAYER_NICK|SCOREBOARD_MIN|SCOREBOARD_RANK)/.test(S)){var fa=parseInt(ma[ka].innerHTML);if(/(SCOREBOARD_DEATHS|SCOREBOARD_DAMAGE_TAKEN)/.test(S)?!isNaN(fa)&&(fa<qa[ka]||qa[ka]==undefined):!isNaN(fa)&&(fa>qa[ka]||qa[ka]==undefined)){ca[ka]=[ma[ka]];qa[ka]=fa}else fa==qa[ka]&&ca[ka].push(ma[ka])}}for(ga=
0;ga<ca.length;ga++)for(ka=0;ka<ca[ga].length;ka++)a(ca[ga][ka]).addClass("maxTableValue")});var F=quakelive.siteConfig.baseUrl+"/r/"+quakelive.UndecorateAnchor(window.location.hash);v="QUAKE LIVE Game Details\n\n";l="Check out the details of this QUAKE LIVE game here:\n\n"+quakelive.siteConfig.baseUrl+"/"+window.location.hash+"\n\nArena: "+u.MAP_NAME+"\nGame type: "+this.FormatGameType(u)+"\nDate played: "+u.GAME_TIMESTAMP+"\n\nNote: This link will expire at "+u.GAME_EXPIRES_FULL+"\n\nQUAKE LIVE is a totally FREE online multiplayer game from id Software, the makers of DOOM and QUAKE.  Easily play against friends or others at your skill level in more than 30 arenas and 5 exciting game modes. Check us out at www.quakelive.com.\n";
v=v.replace(/ /g,"%20");l=l.replace(/ /g,"%20").replace(/\n/g,"%0D").replace(/#/g,"%23");m.find(".share_email").attr("href","mailto:?subject="+v+"&body="+l);var J=this;m.find(".share_link").click(function(){qlPrompt({title:"Link to this match",body:"Copy and paste the below URL to link to this match.<br/><br/><b>Arena:</b> "+u.MAP_NAME+"<br/><b>Game type:</b> "+J.FormatGameType(u)+"<br/><b>Date played:</b> "+u.GAME_TIMESTAMP+"<br/><br/><center>This link will expire at "+u.GAME_EXPIRES_FULL+"</center>",
input:true,inputLabel:F,inputReadOnly:true,alert:true})});if(typeof addthis!="undefined"){v=a("<a class='addthis_button' href='http://www.addthis.com/bookmark.php?v=250&pub=idsoftware'><img src='"+quakelive.resource("/images/share_button.gif")+"' width='67' height='15' alt='Bookmark and Share' style='border:0'/></a>");l={url:F,title:"Quake Live Match - "+this.FormatGameType(u)+" on "+u.MAP_NAME,templates:{twitter:quakelive.mod_profile&&quakelive.mod_profile.activeProfileName?"Check out this "+this.FormatGameTypeShort(u)+
" match on "+u.MAP_NAME+" that "+quakelive.mod_profile.activeProfileName+" played @QuakeLive! {{url}} #QLmatch":"Check out this "+this.FormatGameTypeShort(u)+" match on "+u.MAP_NAME+" @QuakeLive! {{url}} #QLmatch"}};addthis.button(v.get(),addthis_config,l);m.find(".addthis_container").empty().append(v)}this.ShowVerts(m)};this.GetHtmlForFields=function(m,l,q,u){u=a.extend({},{board_data:null,board_type:l.type,board_class:l.index,show_optional:true},u);if(u.class_prefix)u.board_class=u.class_prefix+
u.board_class;m=u.board_data||m[l.index];var g="<div class='"+(u.quitters_summary?"":"board_"+u.board_type)+"'>";if(u.quitters_summary)g+="<table class='quitterstable_"+u.board_type+"'><thead>";else{g+="<table class='"+u.board_type+"BG'>";g+="<thead><tr>";for(var o in q){var y=q[o];if(typeof m[0][y.field]!="undefined")if(!(y.optional&&u.show_optional==false)){g+="<th class='"+u.board_class+"_"+y.field+" "+y.extraClass+"'";if(y.alt)g+=' title="'+y.alt+'"';g+=">"+y.title+"</th>"}}g+="</tr></thead>"}for(var v=
0;v<m.length;v++){var C=m[v];g+="<tr class='";if(u.quitters_summary&&!C.QUITTERS_SUM)g+=" "+(C.TEAM?C.TEAM:"")+"Quitters";g+="'";if(u.quitters_summary&&!C.QUITTERS_SUM)g+=" style='display: none'";g+=">";for(o in q){y=q[o];if(!(y.optional&&u.show_optional==false))if(typeof C[y.field]!="undefined"){var G=C[y.field];if(y.fmt)G=y.fmt(G,C,l);if(typeof G=="undefined"||typeof G=="NaN")G="";var H=C.QUITTERS_SUM?"th":"td";g+="<"+H+" class='"+u.board_class+"_"+y.field+" "+y.extraClass+"'>"+G+"</+"+H+">"}}g+=
"</tr>";if(C.QUITTERS_SUM)g+="</thead>"}g+="</table>";return g};this.GetScoreboard=function(m,l,q){q=a.extend({},l.fieldOptions,q);return this.GetHtmlForFields(m,l,l.fields,q)};this.GetWeaponDetails=function(m,l,q){q=a.extend({},l.fieldOptions,{class_prefix:"WP_"},q);return this.GetHtmlForFields(m,l,l.weaponFields,q)};this.GetWeaponAccuracyDetails=function(m,l,q){q=a.extend({},l.fieldOptions,{class_prefix:"WP_"},q);return this.GetHtmlForFields(m,l,l.weaponAccFields,q)};this.SetDetailsMode=function(m){var l=
["scoreboard","weapons","weaponaccuracy"];for(var q in l)if(m!=l[q]){a(".match_"+l[q]).hide();a(".nav_"+l[q]).removeClass("selected")}a(".match_"+m).show();a(".nav_"+m).addClass("selected");a(".Quitters,.RedQuitters,.BlueQuitters").hide();a(".QuittersToggledBtn").removeClass("QuittersToggledBtn")};var z={};this.ShowVerts=function(m){var l;l=m.find("#stats_details_top_vert");z.top&&l.length!=0&&l.empty().append(z.top);l=m.find("#stats_details_bot_vert");z.bot&&l.length!=0&&l.empty().append(z.bot)};
this.LoadVerts=function(m){var l=this;z={};quakelive.LoadVerts([{zone:quakelive.VERT_ZONES.game_details_header,display:function(q,u,g){g||(z.top=u)}},{zone:quakelive.VERT_ZONES.game_details_full_banner,display:function(q,u,g){g||(z.bot=u)}}],{timeout:2E3},function(){l.ShowVerts(m)})};this.HideStatsDetails=function(){a("#stats_details").remove()};this.ShowStatsDetails=function(m,l,q){this.HideStatsTooltip();quakelive.ScrollToTop();a("#stats_details").size()&&a("#stats_details").remove();var u=a(quakelive.mod_stats.TPL_MATCH_DETAILS).appendTo("#qlv_contentBody"),
g=d.Get(m);this.LoadVerts(u);var o="/stats/matchdetails/";o+=l!=null?m+"/"+q+"/"+l:m+"/"+q;if(g)this.OnShowStatsDetails_Success(u,m,q,g.json);else{var y=this;a.ajax({url:o,dataType:"json",mode:"abort",port:"statstip",cache:true,success:function(v){if(v.UNAVAILABLE){a("#stats_details").remove();quakelive.mod_premium.ShowBrochurePopup()}else{y.ProcessMatchData(v);var C=y.OnShowStatsDetails_Success(u,m,q,v);d.Add(m,{json:v,tip:C})}},error:this.OnShowStatsDetails_Error})}};this.OnCloseStatsTooltip=function(){a.ajaxAbort("statstip");
this.HideStatsDetails();var m=quakelive.BuildSubPath(quakelive.pathParts.length-2);quakelive.StopPathMonitor();quakelive.SetAnchor(m);quakelive.ParsePath();quakelive.StartPathMonitor()};this.OnClickStatsTooltip=function(m,l,q,u,g){m=q!=null?g+"/"+l+"/"+u+"/"+q:g+"/"+l+"/"+u;quakelive.StopPathMonitor();quakelive.SetAnchor(m);quakelive.ParsePath();quakelive.StartPathMonitor();quakelive.statstip.ShowStatsDetails(l,q,u)};this.BindStatsTooltip=function(m,l,q,u,g){var o=this;m.unbind("hover").unbind("click").click(function(y){o.options.onClick(m,
l,q,u,g);y.preventDefault()}).hoverIntent(function(){o.OnHoverStatsTooltip(m,l,q,u)},function(){o.HideStatsTooltip()})};var r=this;this.defaultOptions={onClick:function(m,l,q,u,g){r.OnClickStatsTooltip(m,l,q,u,g)},onClose:function(){r.OnCloseStatsTooltip()}};this.options=a.extend({},this.defaultOptions);this.SetOptions=function(m){this.options=a.extend(this.defaultOptions,m)};this.CloseStatsDetails=function(){this.options.onClose()};this.FormatGameType=function(m){return m.INSTAGIB?"Unranked Instagib":
m.GAME_TYPE_FULL};this.FormatGameTypeShort=function(m){var l=m.GAME_TYPE.toUpperCase();if(l=="DM")l="FFA";if(m.INSTAGIB)l="I"+l;return l}})})(jQuery);
(function(a){quakelive.notifier=new (function(){var d={noticeHeight:"135px",animInTime:500,animOutTime:500,animEaseType:"swing",displayTime:5E3,styleClass:"qln_base",allowClose:true,icon:quakelive.resource("/images/awards/lg/last_man.png"),title:"QUAKE LIVE: Notice",body:"",bodyTop:"",bodyBot:"",onNodeCreated:null};this.filters={};this.noticeQueue=[];this.CreateNotice=function(k){var c=a('<div class="ql_notice '+k.styleClass+'"><div class="notice_header">'+k.title+"</div>"+(k.allowClose?'<a href="javascript:;" class="notice_close_btn"></a>':
"")+'<div class="notice_data"><h1>'+k.bodyTop+"</h1>"+k.body+"<h4>"+k.bodyBot+'</h4></div><div class="notice_icon" style="background:url('+k.icon+') no-repeat"></div></div>');k.onNodeCreated&&k.onNodeCreated(c);return c};this.LoadFilters=function(){var k=(quakelive.userinfo.IGNORED_NOTICES||"").split(",");this.filters={};for(var c in k)this.filters[k[c]]=true};this.IsNoticeFiltered=function(k){return this.filters[k]||false};this.Notify=function(k){if(quakelive.userstatus=="ACTIVE")if(qz_instance.IsGameRunning()!==
true)if(!(qlXfer.group<GROUP_EXTRA))if(k){if(typeof k!="object")k={body:k};var c=a.extend({},d,k||{},{startTime:(new Date).getTime()});k=this.CreateNotice(c);k.data("options",c).hover(function(){c.paused=true},function(){var e=(new Date).getTime();c.paused=false;if(e-c.startTime>c.displayTime/2)c.startTime=e-c.displayTime/2}).find(".notice_close_btn").click(function(){if(!quakelive.userinfo.IGNORED_NOTICES){quakelive.userinfo.IGNORED_NOTICES=" ";a.get("/user/clearalerts");confirm('Would you like to be taken to the "Edit Account" page to configure which alerts you see?',
"You are about to close an alert")&&quakelive.GotoSecure("account")}c.startTime=0;quakelive.matchtip.HideMatchTooltip(-1)}).end().appendTo(a("#ql_notifier"));c.animSettings=[{height:c.noticeHeight},c.animInTime,c.animEaseType];if(a("#ql_notifier .ql_notice").length>3){c.paused=true;this.noticeQueue.push(k)}else k.animate.apply(k,c.animSettings)}};this.CheckNext=function(){var k=this.noticeQueue.shift();if(k){var c=k.data("options");setTimeout(function(){c.paused=false;c.startTime=(new Date).getTime();
k.animate.apply(k,c.animSettings)},c.animOutTime)}};this.CycleNotifications=function(){if(!quakelive.IsGameRunning()||quakelive.cvars.GetIntegerValue("r_fullscreen")===0){var k=false;a("#ql_notifier .ql_notice").each(function(e,p){var x=a(p),t=x.data("options");if(!t.isClosing&&!k&&(!t.paused||t.startTime==0)&&t.startTime+t.displayTime<(new Date).getTime()){k=true;t.isClosing=true;x.animate({height:0},t.animOutTime,t.animEaseType,function(){x.remove();k=false;quakelive.notifier.CheckNext()})}})}var c=
this;setTimeout(function(){c.CycleNotifications()},250)};this.CycleNotifications();this.ContactPresenceNotice=function(k,c){if(this.IsNoticeFiltered("friend_online"))return null;return{body:"A friend has come online.",bodyTop:k+" is online",bodyBot:'<a href="#!profile/summary/'+k+'">View Profile</a>',title:"Your friend has come online!",icon:quakelive.resource("/images/players/icon_xl/"+c.modelskin+".png"),displayTime:5E3,onNodeCreated:function(e){e.find(".notify_link").click(function(){e.data("options").startTime=
0})}}};var b=false;this.PendingInviteSummaryNotice=function(k){if(b!==true){if(this.IsNoticeFiltered("login_invites"))return null;b=true;var c=k!=1;return{body:k+" friend "+(c?"invites are":"invite is")+" waiting for you.",bodyTop:"Pending Invite",bodyBot:"<a href='#!friends/incoming' class='notify_link'>Click to view your friend "+(c?"invites":"invite")+"</a>",title:"You have "+(c?"pending friend invites!":"a pending friend invite!"),icon:quakelive.resource("/images/awards/lg/veteran.png"),displayTime:1E4,
onNodeCreated:function(e){e.find(".notify_link").click(function(){e.data("options").startTime=0})}}}};this.PendingInviteNotice=function(k,c,e){if(this.IsNoticeFiltered("new_invite"))return null;return{body:c+" has requested to be your friend.",bodyTop:"New Friend Invite",bodyBot:"<a href='#!profile/summary/"+c+"' class='fl'>View Profile</a><span class='fl'>&nbsp;&nbsp;|&nbsp;&nbsp;</span> <a href='javascript:;' class='accept_link'>Accept Invite</a><div class='cl'></div>",title:"You have a new friend invite!",
icon:quakelive.resource("/images/players/icon_xl/"+e+".png"),displayTime:5E3,onNodeCreated:function(p){p.find(".accept_link").click(function(){quakelive.mod_friends.AnswerSubscriptionRequest(k,true);p.data("options").startTime=0;return false})}}};this.FriendInGameNotice=function(k,c,e,p){if(this.IsNoticeFiltered("friend_ingame"))return null;return{body:k+" is playing now!<h3><a class='notify_link' href='#!join/"+p+"'>Join Game</a></h3>",bodyTop:"Friend In-Game Now",bodyBot:"Hover over tooltip to view details.",
title:"Friend in-game now!",icon:quakelive.resource("/images/players/icon_xl/"+c+".png"),displayTime:8E3,onNodeCreated:function(x){x=x.find(".notice_data");quakelive.matchtip.BindMatchTooltip(x,p)}}};this.SelfAwardEarnedNotice=function(k,c,e,p,x,t){if(!this.awardMarkHandle){var z=this;this.awardsToMark=this.awardsToMark||[];this.awardMarkHandle=setTimeout(function(){var r=z.awardsToMark.join(",");z.awardsToMark=[];a.ajax({type:"post",url:"/profile/mark_awards",data:{awards:r},dataType:"json",success:function(){z.awardMarkHandle=
null},error:function(){z.awardMarkHandle=null}})},1E3)}this.awardsToMark[this.awardsToMark.length]=c;if(this.IsNoticeFiltered("self_award"))return null;return{body:x,bodyTop:e,bodyBot:"<a class='notify_link' href='#!profile/awards/"+quakelive.username+";type="+k+";award="+c+"'>View Award</a>",title:"You have earned an award!",icon:quakelive.resource("/images/awards/lg/"+p+".png"),displayTime:1E4,onNodeCreated:function(r){r.find(".notice_icon").attr("title",t);r.find(".notify_link").click(function(){r.data("options").startTime=
0})}}};this.FriendAwardEarnedNotice=function(k,c,e,p,x,t,z,r){if(this.IsNoticeFiltered("friend_award"))return null;var m="profile/awards/"+k+";type="+c+";award="+e;return{body:t,bodyTop:"<a class='fl' href='#!profile/summary/"+k+"'><img src='"+quakelive.resource("/images/players/icon_sm/"+r+".png")+"' style='border: 1px solid #666; position: relative; top: 2px; margin-right: 5px' /></a> "+k,bodyBot:"<a class='fl' href='#!"+m+"'>View Award</a> <span class='fl'>&nbsp;&nbsp;|&nbsp;&nbsp;</span><a class='fl' href='#!profile/summary/"+
k+"'>View Profile</a><div class='cl'></div>",title:"<b>"+p+"</b> has been awarded!",icon:quakelive.resource("/images/awards/lg/"+x+".png"),displayTime:5E3,onNodeCreated:function(l){l.find(".notice_icon").addClass("interactive").click(function(){quakelive.Goto(m)}).attr("title",z)}}};this.InvitedGameNotice=function(k,c,e,p,x){if(this.IsNoticeFiltered("friend_invite"))return null;e=mapdb.getBySysName(x);if(!e)return null;return{body:k+" wants you to join them in a match on <b>"+e.name+"</b>. <h3><a href='#!join/"+
p+"'>Click Here to Join</a></h3>",bodyTop:"Match Invitation",bodyBot:"Hover over tooltip to view details.",title:k+" has invited you to a match!",icon:quakelive.resource("/images/players/icon_xl/"+c+".png"),displayTime:15E3,onNodeCreated:function(t){t=t.find(".notice_data");quakelive.matchtip.BindMatchTooltip(t,p)}}};this.PendingClanInvites=function(k){if(this.IsNoticeFiltered("login_invites"))return null;b=true;var c=k!=1;return{body:k+" clan "+(c?"invites are":"invite is")+" waiting for you.",bodyTop:"Pending Clan Invite",
bodyBot:"<a class='notify_link' href='#!clans/inbox'>Click to view your clan "+(c?"invites":"invite")+"</a>",title:"You have "+(c?"pending clan invites!":"a pending clan invite!"),icon:quakelive.resource("/images/clan_avatars/lg/skull.png"),displayTime:1E4,onNodeCreated:function(e){e.find(".notify_link").click(function(){e.data("options").startTime=0})}}}});quakelive.AddHook("OnAuthenticatedInit",function(){quakelive.notifier.LoadFilters()})})(jQuery);
(function(a){function d(l){var q=false,u=l.complete;l.complete=function(o,y){if(!q){q=true;u&&u(o,y)}};setTimeout(function(){if(!q){q=true;l.ajaxBlockedError()}},l.timeout+50);try{a.ajax(l)}catch(g){}}function b(l,q){var u=q.length==0||l.defaultRegex&&l.defaultRegex.test(q),g=a(q);if(l.display)l.display(l,g,u,q);else if(u)l.defaultHtml&&a(l.target).html(l.defaultHtml);else if(u=quakelive.ParseMetaVert(q,{})){g=l.target.id;if(typeof u.keyvals.iframe!="undefined")a(l.target).empty().html('<iframe src="'+
quakelive.resource(u.keyvals.iframe)+'" style="border: 0; width: '+u.keyvals.width+"px; height: "+u.keyvals.height+'px"></iframe>');else if(typeof u.keyvals.google_ad_client!="undefined"){g="";for(var o in u.keyvals){window[o]=u.keyvals[o];g+=window[o]+'="'+u.keyvals[o]+'";'}a(l.target).empty().writeCapture().html('<script type="text/javascript">'+g+'<\/script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"><\/script>')}else if(typeof u.keyvals.code!="undefined"){a(l.target).empty();
if(typeof dapMgr!="undefined"){dapMgr.enableACB(g,false);dapMgr.renderAd(g,u.keyvals.code,u.keyvals.width,u.keyvals.height)}}}else a(l.target).empty().append(g)}function k(l){for(var q in l)b(l[q],"")}function c(l){if(!l.target&&!l.display)return false;return true}function e(){z&&r&&a("#valance_clicker").length==0&&a("#qlv_container").before('<a id="valance_clicker" href="'+r+'" target="_blank" style="display: block; position: fixed; width: 100%; height: 100%; left: 0; top: 0; cursor: pointer"></a>')}
var p={},x={defaultRegex:/\/qldefault\//,defaultHtml:"",target:null,display:null};quakelive.LoadVerts=function(l,q,u){if(!quakelive.IsSecure()){q=a.extend({timeout:15E3},q);var g=quakelive.siteConfig.deliveryUrl,o=[];if(l instanceof Array)for(var y in l){l[y]=a.extend({},x,l[y]);if(c(l[y]))o[o.length]=l[y].zone}else{l=[a.extend({},x,l)];if(c(l[0]))o[0]=l[0].zone}if(o.length!=0){g+="?blockcampaign=1&zones="+escape(o.join("|"));g+="&r="+Math.floor(Math.random()*99999999);g+=document.charset?"&charset="+
document.charset:document.characterSet?"&charset="+document.characterSet:"";if(window.location)g+="&loc="+escape(window.location.href);if(document.referrer)g+="&referer="+escape(document.referrer);d({type:"get",cache:false,url:g,dataType:"script",global:false,timeout:q.timeout,success:function(){if(typeof OA_output!="undefined"&&OA_output){var v=l,C=OA_output;for(var G in v){var H=v[G];b(H,C[H.zone]||"")}OA_output=null}else k(l)},error:function(){k(l)},complete:u,ajaxBlockedError:function(){k(l);
u&&u()}})}}};var t=false,z=false,r=null;quakelive.ConnectValance=e;quakelive.FlushVertCache=function(){p={}};quakelive.FillVertList=function(l){a(".ql_vert_frame").each(function(){var u=a(this),g=u.attr("id"),o=u.attr("title");if(p[g])o=p[g].title;else{p[g]={title:o,time:0};u.removeAttr("title")}u=(new Date).getTime();if(u-p[g].time>=2E4){p[g].time=u;g={};u={};o=o.split("&");for(var y in o){var v=o[y].split("=");u[v[0]]=v[1]}if(quakelive.VERT_ZONES[u.zone]){g.zone=quakelive.VERT_ZONES[u.zone]||u.zone;
if(u["default"])g.defaultHtml='<div style="background: url('+quakelive.resource(u["default"])+') no-repeat center center; width: 100%; height: 100%"></div>';g.target=this;l[l.length]=g}}});if(t)e();else{var q={"background-repeat":"no-repeat","background-position":"top center","background-image":"","background-color":"#000","background-attachment":"fixed"};l[l.length]={zone:quakelive.VERT_ZONES.site_valance,display:function(u,g,o,y){if(u=quakelive.ParseMetaVert(y,q)){z=true;for(var v in u.keyvals)v==
"background-image"?a("body").css(v,"url("+u.keyvals[v]+")"):a("body").css(v,u.keyvals[v]);r=u.href;e()}}};t=true}};quakelive.ReloadVerts=function(){var l=[];quakelive.FillVertList(l);l.length>0&&quakelive.LoadVerts(l,{timeout:15E3})};quakelive.ParseMetaVert=function(l,q){var u=/^\s*(\S+)\s*=\s*(.*)\s*$/,g={},o=/^\s*<a\s*href=[\"\']([^\"\']+)[\"\']/i.exec(l);g.href=o?o[1]:"";g.keyvals={};o=l.split("{{",2);if(o.length==2){o=o[1].split("}}",2);if(o.length==2){o=o[0].split("\n");for(var y in o){var v=
u.exec(o[y]);if(v){var C=v[1].toLowerCase();g.keyvals[C]=v[2]||q[C]}}}else return null}else return null;return g};var m=false;quakelive.HookVertLoading=function(){if(m||quakelive.IsSecure())return false;quakelive.AddHook("OnContentLoaded",quakelive.ReloadVerts);quakelive.AddHook("OnLayoutLoaded",quakelive.ReloadVerts);return m=true}})(jQuery);
(function(a){function d(){this.resourceCache={}}d.prototype.ApplyResource=function(b,k){var c;c=typeof k.target=="string"?a(k.target):k.target;switch(k.targetType){case "css":c.css("background-image","url("+b+")");break;case "tag":c.attr("src",b);break;default:break}};d.prototype.FadeResource=function(b,k){var c;c=typeof k.target=="string"?a(k.target):k.target;switch(k.targetType){case "css":c.css("background-image","url("+b+")");break;case "tag":c.fadeOut(k.animationSpeed,function(){c.attr("src",
b).fadeIn(k.animationSpeed)});break;default:break}};d.prototype.Load=function(b){var k=a.extend({targetType:"tag",target:"",pacifier:"",resource:"",animationSpeed:"fast"},b);this.ApplyResource(quakelive.resource(k.pacifier),k);var c=quakelive.resource(k.resource);if(this.resourceCache[c])this.ApplyResource(c,k);else{var e=this;a("<img />").load(function(){e.resourceCache[c]=true;e.FadeResource(c,k)}).attr("src",c)}};quakelive.resourceLoader=new d})(jQuery);
(function(){function a(b,k,c){this.sysname=b;this.name=k;this.modelskin=c}var d=window.botdb=new (function(){this.bots=[];this.botNames=[];this.append=function(b){this.bots[b.sysname]=b;this.botNames.push(b.sysname)}});d.append(new a("anarki","Anarki","anarki_default"));d.append(new a("angel","Angel","lucy_angel"));d.append(new a("biker","Biker","biker_default"));d.append(new a("bitterman","Bitterman","bitterman_default"));d.append(new a("bones","Bones","bones_default"));d.append(new a("crash","Crash",
"crash_default"));d.append(new a("daemia","Daemia","major_daemia"));d.append(new a("doom","Doom","doom_default"));d.append(new a("gorre","Gorre","visor_gorre"));d.append(new a("grunt","Grunt","grunt_default"));d.append(new a("hossman","Hossman","biker_hossman"));d.append(new a("hunter","Hunter","hunter_default"));d.append(new a("keel","Keel","keel_default"));d.append(new a("klesk","Klesk","klesk_default"));d.append(new a("lucy","Lucy","lucy_default"));d.append(new a("major","Major","major_default"));
d.append(new a("mynx","Mynx","mynx_default"));d.append(new a("orbb","Orbb","orbb_default"));d.append(new a("patriot","Patriot","razor_patriot"));d.append(new a("phobos","Phobos","doom_phobos"));d.append(new a("ranger","Ranger","ranger_default"));d.append(new a("razor","Razor","razor_default"));d.append(new a("sarge","Sarge","sarge_default"));d.append(new a("slash","Slash","slash_default"));d.append(new a("sorlag","Sorlag","sorlag_default"));d.append(new a("stripe","Stripe","grunt_stripe"));d.append(new a("tankjr",
"Tankjr","tankjr_default"));d.append(new a("uriel","Uriel","uriel_default"));d.append(new a("visor","Visor","visor_default"));d.append(new a("wrack","Wrack","ranger_wrack"));d.append(new a("xaero","Xaero","xaero_default"))})(jQuery);
(function(a){function d(c,e,p){p||(p={});this.gametype=c;this.rating=e;this.avg_players=parseInt((p.max_players+p.min_players)/2)||0;this.min_players=p.min_players||null;this.max_players=p.max_players||null}function b(c,e,p,x,t){this.addGameType=function(z){if(!z.min_players)z.min_players=this.min_players;if(!z.max_players)z.max_players=this.max_players;this.gametypes[z.gametype]=z};this.sysname=c;this.name=e;this.min_players=p;this.max_players=x;this.tag_list=t.tag_list||[];this.gametypes={};this.hasTag=
function(z){z=typeof z=="object"?z.name:z;for(var r in this.tag_list)if(this.tag_list[r]==z)return true;return false};this.hasGameType=function(z){return typeof this.gametypes[z]!="undefined"}}function k(c,e){this.name=c;this.title=e}window.mapdb=new (function(){this.maps={};this.gameTypeMaps={};this.Tags={};this.TagCategories={};this.TAG_NONE=new k("","");this.GameTypeList=[{id:0,ordinal:0,team:false,premium:false,name:"ffa",title:"Free For All",desc:"Free for all combat where the player with the most frags wins."},
{id:1,ordinal:5,team:false,premium:false,name:"duel",title:"Duel",desc:"A 1 vs. 1 test of skill. Just you, your opponent, and the arena. Most frags wins."},{id:3,ordinal:4,team:true,premium:false,name:"tdm",title:"Team Deathmatch",desc:"Team-based Free For All. The team with the most frags wins."},{id:4,ordinal:2,team:true,premium:false,name:"ca",title:"Clan Arena",desc:"Two teams compete to eliminate each other. Team with the last man standing wins the round."},{id:6,ordinal:6,team:true,premium:false,
name:"1fctf",title:"Capture The Flag",desc:"Two teams, fighting to capture the opponent's flag and return it to their base."},{id:5,ordinal:1,team:true,premium:false,name:"ctf",title:"Capture The Flag",desc:"Two teams, fighting to capture the opponent's flag and return it to their base."},{id:9,ordinal:3,team:true,premium:true,name:"ft",title:"Freeze Tag",desc:"Two teams, fighting to freeze all players on the opposing team to score a point."}];this.GameTypes={};this.GameTypesByName={};this.GameTypeObjects=
{};this.TotalGameTypes=0;this.OrderedGameTypes=[];var c=-1;for(var e in this.GameTypeList){var p=this.GameTypeList[e];this.TotalGameTypes++;this.GameTypes[p.name.toUpperCase()]=p.id;if(p.id>c)c=p.id;this.GameTypeObjects[p.id]=p;this.GameTypesByName[p.name]=p;this.OrderedGameTypes.push(p.id)}this.GameTypes.NONE=-1;this.GameTypes.MAX=c;var x=this;this.OrderedGameTypes.sort(function(t,z){return x.GameTypeObjects[t].ordinal-x.GameTypeObjects[z].ordinal});this.getGameTypeByID=function(t){if(typeof this.GameTypeObjects[t]==
"undefined")return{id:255,ordinal:255,team:false,premium:false,name:"unknown",title:"Unknown Game Type",desc:"Unknown Game Type"};return this.GameTypeObjects[t]};this.getGameTypeByName=function(t){for(var z in this.GameTypeObjects){var r=this.GameTypeObjects[z];if(r.name==t)return r}return this.getGameTypeByID(-1)};this.append=function(t){this.maps[t.sysname]=t};this.getBySysName=function(t){return this.maps[t]};this.getFirstByGameType=function(t){return this.gameTypeMaps[t][0]};this.getAllByGameType=
function(t){return this.gameTypeMaps[t]};this.getAllByTag=function(t){var z=[];for(var r in this.maps){var m=this.maps[r];m.hasTag(t)&&z.push(m)}return z};this.isTeamGameType=function(t){return typeof this.GameTypeObjects[t]!="undefined"&&this.GameTypeObjects[t].team};this.isPrepared=false;this.prepareMapDB=function(){if(!this.isPrepared){this.isPrepared=true;this.orderedMaps=[];this.gameTypeMaps={};for(var t in this.maps){var z=this.maps[t];this.orderedMaps.push(t);for(var r in z.gametypes){var m=
z.gametypes[r];this.gameTypeMaps[m.gametype]||(this.gameTypeMaps[m.gametype]=[]);this.gameTypeMaps[m.gametype].push(z)}}var l=this;this.orderedMaps.sort(function(q,u){var g=l.maps[q].name,o=l.maps[u].name;return g>o?1:g<o?-1:0})}};this.Load=function(t){for(var z in t){var r=t[z],m=new b(r.sysname,r.name,r.min_players,r.max_players,{tag_list:r.tag_list});for(var l in r.gametypes){var q=r.gametypes[l];m.addGameType(new d(q.gametype,q.rating,{min_players:q.min_players,max_players:q.max_players}))}this.append(m)}this.prepareMapDB()};
this.LoadTags=function(t){var z={},r={};for(var m in t){var l=[];r[m]=[];for(var q in t[m]){var u=t[m][q];u=new k(u[0],u[1]);l.push(u);r[m].push(u);z[u.name]=u}}this.Tags=z;this.TagCategories=r};this.GetTag=function(t){if(typeof this.Tags[t]=="undefined")return this.TAG_NONE;return this.Tags[t]};this.AddTagOptionGroups=function(t){var z;for(var r in mapdb.TagCategories){z=a('<optgroup label="'+r+'"></optgroup>');var m=mapdb.TagCategories[r];for(var l in m)z.append('<option class="filter_tag" value="'+
m[l].name+'">'+m[l].title+"</option>");t.append(z)}};this.getRandomByGameType=function(t){t=this.gameTypeMaps[t];return t[Math.floor(Math.random()*t.length)]}})})(jQuery);
(function(a){function d(b){this.id=parseInt(b.location_id);this.location=b.name;this.shortName=b.short_abbr;this.city=b.display_city;this.region=b.display_region;this.countryAbbr=b.display_country_abbr;this.country=b.display_country;this.ordinal=b.display_ordinal;this.pub=parseInt(b.pub);this.latitude=b.latitude;this.longitude=b.longitude;this.tagNames=a.extend([],b.tags);this.groupNames=a.extend([],b.group_names)}d.prototype.GetCityState=function(){return this.IsUSA()?[this.region,this.city].join(", "):
this.city};d.prototype.GetFlagIcon=function(){return"/images/flags3cc/"+this.countryAbbr.toLowerCase()+".gif"};d.prototype.IsUSA=function(){return this.countryAbbr.toLowerCase()=="usa"};d.prototype.GetNiceName=function(){var b="";this.IsUSA()||(b+=this.countryAbbr+", ");b+=this.GetCityState();if(this.ordinal>1)b+=" #"+this.ordinal;return b};d.prototype.HasTag=function(b){return InArray(b,this.tagNames)};window.locdb=new (function(){this.Reset=function(){this.locations={};this.orderedGroups=this.locsByGroup=
this.orderedTags=this.locsByTag=this.orderedCountries=this.locsByCountry=null};this.Reset();this.Append=function(b){this.locations[b.id]=b};this.GetByID=function(b){return this.locations[b]};this.GetCountryLocations=function(b){return this.locsByCountry[b]};this.GetTagLocations=function(b){return this.locsByTag[b]};this.GetGroupLocations=function(b){return this.locsByGroup[b]};this.PrepareLocations=function(){function b(t,z){return t>z?1:t<z?-1:0}this.locsByCountry={};this.orderedCountries=[];this.locsByTag=
{};this.orderedTags=[];this.locsByGroup={};this.orderedGroups=[];for(var k in this.locations){var c=this.locations[k];if(!c.HasTag("LAN Event")){if(typeof this.locsByCountry[c.countryAbbr]=="undefined"){this.locsByCountry[c.countryAbbr]=[];this.orderedCountries.push(c.countryAbbr)}this.locsByCountry[c.countryAbbr].push(c)}for(var e in c.tagNames){var p=c.tagNames[e];if(typeof this.locsByTag[p]=="undefined"){this.locsByTag[p]=[];p!="LAN Event"&&this.orderedTags.push(p)}this.locsByTag[p].push(c)}for(var x in c.groupNames){p=
c.groupNames[x];if(typeof this.locsByGroup[p]=="undefined"){this.locsByGroup[p]=[];this.orderedGroups.push(p)}this.locsByGroup[p].push(c)}}this.orderedCountries.sort(b);this.orderedTags.sort(b);this.orderedGroups.sort(b)};this.LoadLocations=function(b){for(var k in b){var c=new d(b[k]);quakelive.config("hide_private_locs",true)&&!c.pub||this.Append(c)}this.PrepareLocations()};this.UpdateLocations=function(b){this.Reset();this.LoadLocations(b)};this.InitLocationFilter=function(b,k){var c=a.extend({showLAN:false,
showRegion:false,showStandard:false},k);if(c.showLAN){var e=locdb.locsByTag["LAN Event"];if(e){var p=typeof c.showLAN=="function"?c.showLAN:null,x=false,t=b.find(".lan_optgroup");if(t.length==0)t=a('<optgroup class="lan_optgroup" label="LAN Events"></optgroup>');for(var z in e){var r=e[z];if(!p||p(r)){t.append('<option value="'+r.id+'">'+r.location+"</option>");x=true}}x&&b.append(t)}}if(c.showRegion){e=b.find(".region_optgroup");if(e.length==0)e=a('<optgroup class="region_optgroup" label="Region"></optgroup>');
for(z in locdb.orderedTags){p=locdb.orderedTags[z];e.append('<option value="'+p+'">'+p+"</option>")}b.append(e)}c.showStandard&&this.AppendLocationOptions(b)};this.AppendLocationOptions=function(b){var k="";for(var c in locdb.orderedCountries){var e=locdb.GetCountryLocations(locdb.orderedCountries[c]),p=e[0].countryAbbr;e[0].IsUSA()||(p+=" ("+e[0].country+")");k+='<optgroup label="'+p+'">';for(var x in e){p=e[x];k+='<option value="'+p.id+'">'+p.GetNiceName()+"</option>";prevLoc=p}k+="</optgroup>"}b.append(k)}})})(jQuery);
(function(a){var d={};window.nav=d;window.SUBMENU_END={};d.defaultSettings={location:"body",object:d.navbar,recursive:true,supernav_class:"sf-menu",supernav_id:"supernav"};d.checkDirection=function(){this.offset().left+this.width()>document.documentElement.clientWidth&&this.addClass("overflowLeft")};d.initNav=function(b){b=jQuery.extend({},d.defaultSettings,b);var k=d.processNode(b);a(b.location).html(k);a("ul.sf-menu").superfish({delay:125,speed:1,animation:{opacity:"show"},dropShadows:false,onShow:d.checkDirection,
onHide:function(){this.removeClass("overflowLeft")},disableHI:true})};d.processNode=function(b){var k=a("<ul></ul>");k.addClass(b.supernav_class);k.attr("id",b.supernav_id);var c=0,e=b.object;for(var p in e){var x=a("<li></li>");x.html(p);var t=false;for(var z in e[p]){var r="";r=b.supernav_id?"&nbsp;":p;switch(z){case "goto_s":x.html('<a href="javascript:;" onclick="quakelive.GotoSecure(\''+e[p].goto_s+"'); return false;\">"+r+"</a>");break;case "href":x.html('<a href="'+e[p].href+'">'+r+"</a>");
break;case "newwindow":x.html('<a href="'+e[p].newwindow+'" target="_blank">'+r+"</a>");break;case "class":x.addClass(e[p]["class"]);break;case "id":x.attr("id",e[p].id);break;case "callback":x.html('<a href="javascript:;" onclick="'+e[p].callback+'; return false; ">'+r+"</a>");break;default:continue}t=true;c++}if(b.recursive===true)if(e[p].submenu){r=d.processNode({object:e[p].submenu,recursive:true});r!==null&&x.append(r)}t&&k.append(x)}return c>0?k:null};d.initTopBar=function(){var b=quakelive.activeModule?
quakelive.activeModule.GetLayout():"";b!=="bare"&&b!=="postlogin_bare"&&nav.initNav({location:"#newnav_top",supernav_id:"topNav",object:nav.navbar})};quakelive.AddHook("OnLayoutLoaded",d.initTopBar)})(jQuery);
(function(a){function d(t){this.name=t.name;this.clan=t.clan;this.score=parseInt(t.score);this.rank=parseInt(t.rank);this.bot=parseInt(t.bot);this.team=parseInt(t.team);this.model=t.model;this.blocked=this.friend=false;if(!this.bot){t=StripColors(this.name);if(quakelive.mod_friends.IsOnRoster(t))this.friend=true;else if(quakelive.mod_friends.IsBlocked(t))this.blocked=true}}function b(){this.error=this.details=false;this.num_blocked=this.num_friends=this.detailsTime=this.basicsTime=this.ordinal=0;
this.disableJoin=this.hidden=false;this.game_type=this.public_id=0;this.host_name="";this.ranked=0;this.premium=false;this.map="";this.location_id=this.g_needpass=this.g_instagib=this.teamsize=this.max_clients=this.num_players=this.num_clients=0;this.host_address="";this.skillDelta=0;this.owned=this.invitation=this.skillTooHigh=false;this.owner="";this.localServer=false;this.g_bluescore=this.g_redscore=this.roundtimelimit=this.roundlimit=this.capturelimit=this.fraglimit=this.timelimit=this.g_levelstarttime=
this.g_gamestate=this.ruleset=0;this.players=[]}function k(t){this.params=a.extend({},p,t);this.listener=null}function c(){c.prototype.OnRefreshServersSuccess=function(){};c.prototype.OnRefreshServersError=function(){};c.prototype.OnStartRefreshServers=function(){};c.prototype.OnSaveFilterSuccess=function(){};c.prototype.OnSaveFilterError=function(){}}function e(){this.serversById={};this.servers=[]}b.prototype.UpdateBasics=function(t){this.basicsTime=(new Date).getTime();this.public_id=parseInt(t.public_id);
this.premium=t.premium?true:false;this.game_type=parseInt(t.game_type);this.host_name=t.host_name;this.ranked=parseInt(t.ranked);this.map=t.map;this.num_clients=parseInt(t.num_clients);this.num_players=parseInt(t.num_players);this.max_clients=parseInt(t.max_clients);this.teamsize=parseInt(t.teamsize);this.g_instagib=parseInt(t.g_instagib);this.g_needpass=parseInt(t.g_needpass);this.location_id=parseInt(t.location_id);this.host_address=t.host_address;this.skillDelta=parseInt(t.skillDelta);this.skillTooHigh=
parseInt(t.skillTooHigh);this.invitation=t.invitation?true:false;this.owned=t.owned?true:false;this.owner=t.owner;this.ruleset=parseInt(t.ruleset);if(typeof t.localServer!="undefined"){this.disableJoin=!t.localServer;this.localServer=t.localServer}else this.localServer=this.disableJoin=false};b.prototype.GetMapTitle=function(){var t=this.map.toLowerCase(),z=mapdb.getBySysName(t);if(z)return z.name;return t};b.prototype.GetGameTypeTitle=function(){return mapdb.getGameTypeByID(this.game_type).title};
b.prototype.UpdateDetails=function(t){this.details=true;this.detailsTime=(new Date).getTime();this.g_gamestate=t.g_gamestate;this.g_levelstarttime=parseInt(t.g_levelstarttime);this.timelimit=parseInt(t.timelimit);this.fraglimit=parseInt(t.fraglimit);this.capturelimit=parseInt(t.capturelimit);this.roundlimit=parseInt(t.roundlimit);this.roundtimelimit=parseInt(t.roundtimelimit);this.g_redscore=parseInt(t.g_redscore);this.g_bluescore=parseInt(t.g_bluescore);this.owner=t.owner;this.num_blocked=this.num_friends=
0;var z=[];if(t.players)for(var r=0;r<t.players.length;++r){var m=new d(t.players[r]);z.push(m);if(m.friend)this.num_friends++;else m.blocked&&this.num_blocked++}z.sort(function(l,q){return l.friend==q.friend?l.blocked==q.blocked?l.bot==q.bot?l.team==q.team?l.score<q.score?1:l.score>q.score?-1:0:l.team<q.team?-1:l.team>q.team?1:0:l.bot<q.bot?-1:l.bot>q.bot?1:0:l.blocked?1:-1:l.friend?-1:1});this.players=z};var p={filters:{group:"any",game_type:"any",arena:"any",state:"any",difficulty:"any",location:"any",
"private":0},arena_type:"",players:[],game_types:[],ig:0};k.prototype.DEFAULT_FILTER=new k;k.prototype.GetBase64=function(){return Base64.encode(JSON.stringify(this.params))};e.prototype.FlushCache=function(){for(var t in this.serversById){this.serversById[t].detailsTime=0;this.serversById[t].details=0}};e.prototype.GetServers=function(){return this.servers};e.prototype.GetServerInfo=function(t){return typeof this.serversById[t]=="object"?this.serversById[t]:null};e.prototype.OnRefreshServersError=
function(){this.listener&&this.listener.OnRefreshServersError(this)};e.prototype.OnRefreshServersSuccess=function(t){this.listener&&this.listener.OnRefreshServersSuccess(this,t)};e.prototype.OnStartRefreshServers=function(){this.listener&&this.listener.OnStartRefreshServers(this)};e.prototype.OnAddServer=function(t){this.listener&&this.listener.OnAddServer(this,t)};e.prototype.OnRemoveServer=function(t){this.listener&&this.listener.OnRemoveServer(this,t)};e.prototype.OnUpdateServer=function(t){this.listener&&
this.listener.OnUpdateServer(this,t)};e.prototype.UpdateServers=function(t,z){for(var r={},m=0;m<t.length;++m){var l=t[m],q=this.GetServerInfo(l.public_id);q||(q=new b);q.ordinal=m;q.UpdateBasics(l);z&&q.UpdateDetails(l);r[q.public_id]=q}m=[];l=[];q=[];for(var u in this.serversById){var g=this.serversById[u],o=r[u];if(typeof o!="object")l.push(g);else{q.push(o);m.push(o)}}for(u in r){g=this.serversById[u];o=r[u];if(typeof g!="object"){q.push(o);m.push(o)}}m.sort(function(y,v){return y.ordinal==v.ordinal?
0:y.ordinal<v.ordinal?-1:1});this.servers=m;this.serversById=r;for(m=0;m<l.length;++m)this.OnRemoveServer(l[m]);for(m=0;m<q.length;++m)this.OnUpdateServer(q[m])};e.prototype.RefreshServersSuccess=function(t){t=quakelive.Eval(t);if(!t||!t.servers)this.OnRefreshServersError();else{this.UpdateServers(t.servers);this.OnRefreshServersSuccess(t)}};e.prototype.RefreshServersError=function(){this.OnRefreshServersError()};e.prototype.RefreshServers=function(t){if(!quakelive.IsGameRunning()){this.OnStartRefreshServers();
var z=this;a.ajax({type:"get",mode:"abort",port:"serverlist",data:{filter:Base64.encode(JSON.stringify(t))},url:"/browser/list",success:function(){z.RefreshServersSuccess.apply(z,arguments)},error:function(){z.RefreshServersError.apply(z,arguments)}})}};e.prototype.RefreshServerDetailsSuccess=function(t){t=quakelive.Eval(t);if(!t||!t.servers)this.OnRefreshServersError();else{this.UpdateServers(t.servers);this.OnRefreshServersSuccess(t)}};e.prototype.RefreshServerDetailsError=function(){};var x={onSuccess:function(){},
onError:function(){},cacheTime:0,port:"matchdetails"};e.prototype.RefreshServerDetails=function(t,z){var r=a.extend({cachedServerIds:[t]},x,z),m=r.cachedServerIds,l=true,q=null;InArray(t,m)||m.push(t);for(var u=0;u<m.length;u++){var g=this.GetServerInfo(m[u]);if(g){var o=(new Date).getTime();r.cacheTime!=0&&o-g.detailsTime<=1E3*r.cacheTime||(l=false)}else{g=new b;g.hidden=true;g.public_id=m[u];this.serversById[m[u]]=g;this.servers.push(g);l=false}if(g.public_id==t)q=g}if(l)r.onSuccess(q,true);else{var y=
this;a.ajax({url:"/browser/details",data:{ids:m.join(",")},dataType:"json",mode:"abort",port:r.port,success:function(v){if(!a.isArray(v)||v.length==0)r.onError("No valid servers were found");else for(var C=0;C<v.length;C++){var G=v[C],H=y.GetServerInfo(G.public_id);if(a.inArray(G.public_id,quakelive.inviteMonitor.activeInvites)!=-1){H.invitation=true;G.invitation=true}if(typeof H.map=="string"){H.error=false;H.UpdateBasics(G);H.UpdateDetails(G);y.OnUpdateServer(H);G.public_id==t&&r.onSuccess(H,false)}else{H.error=
true;G.public_id==t&&r.onError(H)}}},error:function(){g.error=true;r.onError(g)}})}};e.prototype.SaveFilter=function(){var t=this;a.ajax({type:"post",mode:"abort",port:"filterupdate",url:"/browser/filter/update",data:{filter_obj:JSON.stringify(module.filter)},success:function(){t.SaveFilterSuccess.apply(t,arguments)},error:function(){t.SaveFilterError.apply(t,arguments)}})};e.prototype.SaveFilterSuccess=function(){this.OnSaveFilterSuccess()};e.prototype.SaveFilterError=function(){this.OnSaveFilterError()};
e.LoadFilterSuccess=function(){};e.LoadFilterError=function(){};e.prototype.LoadFilter=function(){};e.ResetFilterSuccess=function(){this.OnResetFilterSuccess()};e.ResetFilterError=function(){this.OnResetFilterError()};quakelive.ServerManager=e;quakelive.ServerManagerListener=c;quakelive.ServerFilter=k})(jQuery);
(function(a){function d(e){this.defaultProps=a.extend({},c,e)}function b(){}function k(){}var c={target:"qlv_postlogin_matches",max:0,hide_best_pick:false,group_cache_size:6};d.prototype=new quakelive.ServerManagerListener;d.prototype.SetDisplayProps=function(e){this.props=a.extend({},this.defaultProps,e)};d.prototype.GetContainerNodeId=function(){return this.props.target};d.prototype.GetServerNodeId=function(e){return"match_"+e.public_id};d.prototype.UpdateServerNode=function(e,p){var x=mapdb.getGameTypeByID(e.game_type),
t,z;if(e.teamsize>0){t=e.teamsize*(x.name=="ffa"?1:2);z=e.num_players}else{t=e.max_clients;z=e.num_clients}t=z+"/"+t;var r;if(r=locdb.GetByID(e.location_id)){z=r.GetCityState();r=r.GetFlagIcon()}else{z="QUAKE LIVE";r="/images/flags3cc/usa.gif"}var m=GetSkillRankInfo(e.skillDelta);p.find(".qlv_inner_box").length==0&&p.html('<div class="gamerank" class="rank_1"><div class="rankicon"></div><div class="gamelabel"></div><div class="gamelabel_shadow"></div></div><img src="" alt="" width="165" height="124" class="thumb" /><div class="server_icons"></div><div class="qlv_pls_bg"><div class="pls_play"><a class="pls_play_btn" href="javascript:;"></a></div><div class="pls_premium"></div><div class="qlv_inner_box"><img src="" class="gameicon" /><div class="gametype"></div><div class="players"></div><img class="location_flag" src="" width="16" height="11" /><div class="location_text"></div></div></div>');
var l={pacifier:"/images/levelshots/lg/default.jpg",resource:"/images/levelshots/lg/"+e.map.toLowerCase()+".jpg",target:p.find(".thumb")};quakelive.resourceLoader.Load(l);p.find(".gamelabel,.gamelabel_shadow").text(e.host_name);p.find(".gamerank").attr("class","gamerank rank_"+m.delta);p.find(".rankicon").attr("class","rankicon rank_icon_"+m.delta);p.find(".gameicon").attr("src",quakelive.resource("/images/gametypes/sm/"+x.name+".png"));m=[];e.ranked||m.push("<div class='unranked_icon' title='Unranked Match'></div>");
e.g_needpass&&m.push("<div class='locked_icon' title='Password Protected'></div>");if(e.ruleset>1)m.push('<div class="modified_icon" title="Modified Ruleset '+(e.ruleset==2?"(PQL)":"(Unknown)")+'"></div>');m.length>0&&p.find(".server_icons").html(m.join(""));if(e.premium&&quakelive.IsLoggedIn()){p.find(".pls_premium").attr("class","pls_premium qlv_pls_premium");p.find(".pls_play").attr("class","pls_play pls_play_premium");quakelive.siteConfig.premiumStatus=="standard"&&!e.invitation?p.find(".pls_play_btn").addClass("pls_gopro_btn"):
p.find(".pls_play_btn").removeClass("pls_gopro_btn")}p.find(".gametype").text(x.title);p.find(".players").text(t);p.find(".location_flag").attr("src",quakelive.resource(r));p.find(".location_text").text(z);p.find(".pls_play_btn").unbind("click").click(function(q){q.stopPropagation();quakelive.matchtip.JoinServer(e);return false});p.addClass("qlv_pls_box");return p};d.prototype.ServerJoin=function(e){if(e){var p=new LaunchGameParams;p.Append("+connect "+e.host_address);LaunchGame(p,e)}};d.prototype.OnRefreshServersSuccess=
function(e,p){quakelive.SendModuleMessage("OnServerListReload",e);typeof p!="undefined"&&typeof p.player_tier!="undefined"&&a("#debug_tier").text("[DEV] Your tier is "+p.player_tier);this.DisplayServerList(e);this.SortServerList(e)};d.prototype.OnRefreshServersError=function(){};d.prototype.OnRemoveServer=function(e,p){var x=a("#"+this.GetServerNodeId(p));x.length>0&&x.remove();quakelive.matchtip.HideMatchTooltip(p.public_id)};d.prototype.OnUpdateServer=function(e,p){if(!p.hidden){var x=a("#"+this.GetServerNodeId(p));
if(x.length==0){x=a('<div id="'+this.GetServerNodeId(p)+'"></div>');p.node=x}this.OnBeforeUpdateServerNode(p,x);this.UpdateServerNode(p,x);return x}};d.prototype.DisplayServerList=function(e){var p=a("#"+this.GetContainerNodeId());e=e.GetServers();p.empty();this.OnBeforeDisplayServerList(p,e);if(e.length>0){for(var x=this,t=[],z=0,r=0;r<e.length;r+=this.props.group_cache_size){for(var m=[],l=0;l<this.props.group_cache_size&&r+l<e.length;l++){var q=e[r+l];m[l]=q.public_id;t[z]=m}z++}z={onHover:function(u,
g){u.find(".pls_play").show();return x.OnMatchHover(u,g)},onHoverOff:function(u,g){u.find(".pls_play").hide();return x.OnMatchHoverOff(u,g)},onClick:function(){return x.OnMatchClick()},onDblClick:function(){return x.OnMatchDoubleClick()},target:this.props.target};m=this.props.max==0?e.length:this.props.max;for(r=0;r<m;++r){q=e[r];z.cachedServerIds=t[parseInt(r/this.props.group_cache_size)];quakelive.matchtip.BindMatchTooltip(q.node,q.public_id,z);p.append(q.node)}}this.OnAfterDisplayServerList(p,
e)};d.prototype.SortServerList=function(e){a("#"+this.GetContainerNodeId()).children();e=e.GetServers();for(var p=0;p<e.length-1;++p){var x=a("#"+this.GetServerNodeId(e[p])),t=a("#"+this.GetServerNodeId(e[p+1]));x.after(t)}};d.prototype.OnMatchHover=function(){};d.prototype.OnMatchHoverOff=function(){};d.prototype.OnMatchClick=function(){};d.prototype.OnMatchDoubleClick=function(){};d.prototype.OnBeforeDisplayServerList=function(){};d.prototype.OnAfterDisplayServerList=function(){};d.prototype.OnBeforeUpdateServerNode=
function(){};b.prototype=new d({group_cache_size:3});quakelive.ServerPreviewIconView=b;k.prototype=new d({group_cache_size:6});k.prototype.OnBeforeDisplayServerList=function(e,p){p.length>0&&a("#qlv_welcome .welcome_matches_header").css("visibility","visible")};k.prototype.OnAfterDisplayServerList=function(e,p){if(p.length==0){var x="No Public Matches Found";if(quakelive.mod_home.filter.filters.invitation_only!=0)x="No Invited Matches Found";else if(quakelive.mod_home.filter.filters["private"]!=0)x=
"No Private Matches Found";e.append('<p class="tc thirtyPxTxt sixtypxv midGrayTxt">'+x+"</p>");e.append('<p class="tc TwentyPxTxt midGrayTxt"><a href="#" class="TwentyPxTxt midGrayTxt customize_link">Check your Customize settings</a> or <a href="#" class="TwentyPxTxt midGrayTxt reset_link">clear all filters</a> to continue.</p>');e.find(".customize_link").click(function(){quakelive.mod_home.ToggleFilterBar();return false});e.find(".reset_link").click(function(){quakelive.mod_home.ResetBrowserFilter();
return false})}};k.prototype.OnRefreshServersError=function(){a("#"+this.GetContainerNodeId()).empty().append('<p class="tc TwentyPxTxt midGrayTxt" style="width: 80%; margin: auto; color: #f00">We\'ve encountered an error loading the list of games. Please wait and we will try to reload the list.</p>')};quakelive.ServerIconView=k})(jQuery);
(function(a){function d(c){this.defaultProps=a.extend({},k,c)}function b(){}var k={target:"listViewBrowser",max:0,hide_best_pick:false,group_cache_size:6};d.prototype=new quakelive.ServerManagerListener;d.prototype.SetDisplayProps=function(c){this.props=a.extend({},this.defaultProps,c)};d.prototype.GetContainerNodeId=function(){return this.props.target};d.prototype.GetServerNodeId=function(c){return"match_"+c.public_id};d.prototype.UpdateServerNode=function(c,e){var p=mapdb.getGameTypeByID(c.game_type),
x,t;if(c.teamsize>0){x=c.teamsize*(p.name=="ffa"?1:2);t=c.num_players}else{x=c.max_clients;t=c.num_clients}x=t+"/"+x;var z;if(z=locdb.GetByID(c.location_id)){t=z.GetCityState();z=z.GetFlagIcon()}else{t="QUAKE LIVE";z="/images/flags3cc/usa.gif"}var r=GetSkillRankInfo(c.skillDelta);e.find(".qlv_inner_box").length==0&&e.html('<td class="table_location"><img class="location_flag" src="" width="16" height="11" /><span class="location_text"></span></td><td class="table_gameicon"><img src="" class="gameicon"/></td><td class="table_icons"></td><td class="gamelabel"></td><td class="servername"></td><td class="players"></td><td class="table_rankicon"><div class="rankicon"></div></td>');
e.find(".gamelabel").text(c.host_name);e.find(".rankicon").attr({"class":"rankicon rank_icon_"+r.delta,title:r.desc});e.find(".gameicon").attr({src:quakelive.resource("/images/gametypes/sm/"+p.name+".png"),alt:p.title,title:p.title});r=mapdb.getBySysName(c.map.toLowerCase());r=r==undefined?c.map.toLowerCase():r.name;e.find(".servername").text(r);r=[];c.premium&&r.push("<div class='premium_icon' title='Premium Match'></div>");c.ranked||r.push("<div class='unranked_icon' title='Unranked Match'></div>");
c.g_needpass&&r.push("<div class='locked_icon' title='Password Protected'></div>");if(c.ruleset>1)r.push('<div class="modified_icon" title="Modified Ruleset '+(c.ruleset==2?"(PQL)":"(Unknown)")+'"></div>');r.length>0&&e.find(".table_icons").html(r.join(""));if(c.premium&&quakelive.IsLoggedIn()){e.find(".pls_premium").attr("class","pls_premium qlv_pls_premium");e.find(".pls_play").attr("class","pls_play pls_play_premium");quakelive.siteConfig.premiumStatus=="standard"&&!c.invitation?e.find(".pls_play_btn").addClass("pls_gopro_btn"):
e.find(".pls_play_btn").removeClass("pls_gopro_btn")}e.find(".gametype").text(p.title);e.find(".players").text(x);e.find(".location_flag").attr("src",quakelive.resource(z));e.find(".location_text").text(t);e.find(".pls_play_btn").unbind("click").click(function(m){m.stopPropagation();quakelive.matchtip.JoinServer(c);return false});return e};d.prototype.ServerJoin=function(c){if(c){var e=new LaunchGameParams;e.Append("+connect "+c.host_address);LaunchGame(e,c)}};d.prototype.OnRefreshServersSuccess=
function(c,e){quakelive.SendModuleMessage("OnServerListReload",c);typeof e!="undefined"&&typeof e.player_tier!="undefined"&&a("#debug_tier").text("[DEV] Your tier is "+e.player_tier);this.DisplayServerList(c);this.SortServerList(c)};d.prototype.OnRefreshServersError=function(){};d.prototype.OnRemoveServer=function(c,e){var p=a("#"+this.GetServerNodeId(e));p.length>0&&p.remove();quakelive.matchtip.HideMatchTooltip(e.public_id)};d.prototype.OnUpdateServer=function(c,e){if(!e.hidden){var p=a("#"+this.GetServerNodeId(e));
if(p.length==0){p=a('<tr id="'+this.GetServerNodeId(e)+'"></tr>');e.node=p}this.OnBeforeUpdateServerNode(e,p);this.UpdateServerNode(e,p);return p}};d.prototype.DisplayServerList=function(c){var e=a("#"+this.GetContainerNodeId());c=c.GetServers();e.empty();this.OnBeforeDisplayServerList(e,c);if(c.length>0){for(var p=this,x=[],t=0,z=0;z<c.length;z+=this.props.group_cache_size){for(var r=[],m=0;m<this.props.group_cache_size&&z+m<c.length;m++){var l=c[z+m];r[m]=l.public_id;x[t]=r}t++}t={onHover:function(q,
u){q.find(".pls_play").show();return p.OnMatchHover(q,u)},onHoverOff:function(q,u){q.find(".pls_play").hide();return p.OnMatchHoverOff(q,u)},onClick:function(){return p.OnMatchClick()},onDblClick:function(){return p.OnMatchDoubleClick()},target:this.props.target};r=this.props.max==0?c.length:this.props.max;for(z=0;z<r;++z){l=c[z];t.cachedServerIds=x[parseInt(z/this.props.group_cache_size)];quakelive.matchtip.BindMatchTooltip(l.node,l.public_id,t);e.append(l.node)}}this.OnAfterDisplayServerList(e,
c)};d.prototype.SortServerList=function(c){a("#"+this.GetContainerNodeId()).children("tr").detach().appendTo("#listViewBrowser tbody");c=c.GetServers();for(var e=0;e<c.length-1;++e){var p=a("#"+this.GetServerNodeId(c[e])),x=a("#"+this.GetServerNodeId(c[e+1]));p.after(x)}if(quakelive.IsMSIE()){a("#listViewBrowser tr").removeClass("odd");a("#listViewBrowser tr:odd").addClass("odd")}};d.prototype.OnMatchHover=function(){};d.prototype.OnMatchHoverOff=function(){};d.prototype.OnMatchClick=function(){};
d.prototype.OnMatchDoubleClick=function(){};d.prototype.OnBeforeDisplayServerList=function(){};d.prototype.OnAfterDisplayServerList=function(){};d.prototype.OnBeforeUpdateServerNode=function(){};b.prototype=new d({group_cache_size:6});b.prototype.OnBeforeDisplayServerList=function(c,e){if(e.length>0){a("#qlv_welcome .welcome_matches_header").css("visibility","visible");a("#qlv_postlogin_matches").append('<table id="listViewBrowser"><thead><tr><th>Location</th><th colspan="2">Game Type</th><th>Match Name</th><th>Arena</th><th colspan="2">Players</th></tr></thead><tbody></tbody></table>')}};
b.prototype.OnAfterDisplayServerList=function(c,e){if(e.length==0){var p="No Public Matches Found";if(quakelive.mod_home.filter.filters.invitation_only!=0)p="No Invited Matches Found";else if(quakelive.mod_home.filter.filters["private"]!=0)p="No Private Matches Found";c.append('<p class="tc thirtyPxTxt sixtypxv midGrayTxt">'+p+"</p>");c.append('<p class="tc TwentyPxTxt midGrayTxt"><a href="#" class="TwentyPxTxt midGrayTxt customize_link">Check your Customize settings</a> or <a href="#" class="TwentyPxTxt midGrayTxt reset_link">clear all filters</a> to continue.</p>');
c.find(".customize_link").click(function(){quakelive.mod_home.ToggleFilterBar();return false});c.find(".reset_link").click(function(){quakelive.mod_home.ResetBrowserFilter();return false})}};b.prototype.OnRefreshServersError=function(){a("#"+this.GetContainerNodeId()).empty().append('<p class="tc TwentyPxTxt midGrayTxt" style="width: 80%; margin: auto; color: #f00">We\'ve encountered an error loading the list of games. Please wait and we will try to reload the list.</p>')};quakelive.ServerListView=
b})(jQuery);var MONTH_NAMES=Array("January","February","March","April","May","June","July","August","September","October","November","December","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"),DAY_NAMES=Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sun","Mon","Tue","Wed","Thu","Fri","Sat");function LZ(a){return(a<0||a>9?"":"0")+a}function isDate(a,d){if(getDateFromFormat(a,d)==0)return false;return true}
function compareDates(a,d,b,k){a=getDateFromFormat(a,d);b=getDateFromFormat(b,k);if(a==0||b==0)return-1;else if(a>b)return 1;return 0}
function formatDate(a,d){d+="";var b="",k=0,c="",e="";c=a.getYear()+"";e=a.getMonth()+1;var p=a.getDate(),x=a.getDay(),t=a.getHours(),z=a.getMinutes(),r=a.getSeconds(),m={};if(c.length<4)c=""+(c-0+1900);m.y=""+c;m.yyyy=c;m.yy=c.substring(2,4);m.M=e;m.MM=LZ(e);m.MMM=MONTH_NAMES[e-1];m.NNN=MONTH_NAMES[e+11];m.d=p;m.dd=LZ(p);m.E=DAY_NAMES[x+7];m.EE=DAY_NAMES[x];m.H=t;m.HH=LZ(t);m.h=t==0?12:t>12?t-12:t;m.hh=LZ(m.h);m.K=t>11?t-12:t;m.k=t+1;m.KK=LZ(m.K);m.kk=LZ(m.k);m.a=t>11?"PM":"AM";m.m=z;m.mm=LZ(z);
m.s=r;for(m.ss=LZ(r);k<d.length;){c=d.charAt(k);for(e="";d.charAt(k)==c&&k<d.length;)e+=d.charAt(k++);b=m[e]!=null?b+m[e]:b+e}return b}function _isInteger(a){for(var d=0;d<a.length;d++)if("1234567890".indexOf(a.charAt(d))==-1)return false;return true}function _getInt(a,d,b,k){for(k=k;k>=b;k--){var c=a.substring(d,d+k);if(c.length<b)return null;if(_isInteger(c))return c}return null}
function getDateFromFormat(a,d){a+="";d+="";var b=0,k=0,c="",e="",p,x,t=new Date,z=t.getYear(),r=t.getMonth()+1,m=1,l=t.getHours(),q=t.getMinutes();t=t.getSeconds();for(var u="";k<d.length;){c=d.charAt(k);for(e="";d.charAt(k)==c&&k<d.length;)e+=d.charAt(k++);if(e=="yyyy"||e=="yy"||e=="y"){if(e=="yyyy")x=p=4;if(e=="yy")x=p=2;if(e=="y"){p=2;x=4}z=_getInt(a,b,p,x);if(z==null)return 0;b+=z.length;if(z.length==2)z=z>70?1900+(z-0):2E3+(z-0)}else if(e=="MMM"||e=="NNN"){for(c=r=0;c<MONTH_NAMES.length;c++){var g=
MONTH_NAMES[c];if(a.substring(b,b+g.length).toLowerCase()==g.toLowerCase())if(e=="MMM"||e=="NNN"&&c>11){r=c+1;if(r>12)r-=12;b+=g.length;break}}if(r<1||r>12)return 0}else if(e=="EE"||e=="E")for(c=0;c<DAY_NAMES.length;c++){e=DAY_NAMES[c];if(a.substring(b,b+e.length).toLowerCase()==e.toLowerCase()){b+=e.length;break}}else if(e=="MM"||e=="M"){r=_getInt(a,b,e.length,2);if(r==null||r<1||r>12)return 0;b+=r.length}else if(e=="dd"||e=="d"){m=_getInt(a,b,e.length,2);if(m==null||m<1||m>31)return 0;b+=m.length}else if(e==
"hh"||e=="h"){l=_getInt(a,b,e.length,2);if(l==null||l<1||l>12)return 0;b+=l.length}else if(e=="HH"||e=="H"){l=_getInt(a,b,e.length,2);if(l==null||l<0||l>23)return 0;b+=l.length}else if(e=="KK"||e=="K"){l=_getInt(a,b,e.length,2);if(l==null||l<0||l>11)return 0;b+=l.length}else if(e=="kk"||e=="k"){l=_getInt(a,b,e.length,2);if(l==null||l<1||l>24)return 0;b+=l.length;l--}else if(e=="mm"||e=="m"){q=_getInt(a,b,e.length,2);if(q==null||q<0||q>59)return 0;b+=q.length}else if(e=="ss"||e=="s"){t=_getInt(a,b,
e.length,2);if(t==null||t<0||t>59)return 0;b+=t.length}else if(e=="a"){if(a.substring(b,b+2).toLowerCase()=="am")u="AM";else if(a.substring(b,b+2).toLowerCase()=="pm")u="PM";else return 0;b+=2}else if(a.substring(b,b+e.length)!=e)return 0;else b+=e.length}if(b!=a.length)return 0;if(r==2)if(z%4==0&&z%100!=0||z%400==0){if(m>29)return 0}else if(m>28)return 0;if(r==4||r==6||r==9||r==11)if(m>30)return 0;if(l<12&&u=="PM")l=l-0+12;else if(l>11&&u=="AM")l-=12;return(new Date(z,r-1,m,l,q,t)).getTime()}
function parseDate(a){var d=arguments.length==2?arguments[1]:false;generalFormats=Array("y-M-d","MMM d, y","MMM d,y","y-MMM-d","d-MMM-y","MMM d");monthFirst=Array("M/d/y","M-d-y","M.d.y","MMM-d","M/d","M-d");dateFirst=Array("d/M/y","d-M-y","d.M.y","d-MMM","d/M","d-M");d=Array("generalFormats",d?"dateFirst":"monthFirst",d?"monthFirst":"dateFirst");for(var b=null,k=0;k<d.length;k++)for(var c=window[d[k]],e=0;e<c.length;e++){b=getDateFromFormat(a,c[e]);if(b!=0)return new Date(b)}return null}
(function(a){function d(){a("#qlv_game_mode_viewport,#qz_handshake").addClass("ingame_minimized")}function b(){this.launchSequence=null}function k(){}function c(){}function e(){}function p(){}function x(){}function t(){}function z(u){this.options=a.extend({params:{isBotGame:false,isTraining:false},serverInfo:{premium:false,invitation:false,g_needpass:false},userInfo:{id:0,name:"",isActive:false,premiumStatus:"standard",syncComplete:false},error:function(){},success:function(){}},u)}function r(){}
var m={Ok:0,ErrorNotRegistered:1,ErrorNotSynced:2,ErrorNotActive:3,ErrorNotPremium:4,ErrorMissingPassword:5};k.prototype.Run=function(){return true};c.prototype=new k;c.prototype.Run=function(u){var g=u.launchRequest,o=g.options.serverInfo;g=g.options.params;quakelive.HideTooltip();quakelive.ScrollToTop();qlHidePrompt();var y,v;v=quakelive.cvars.Get("r_inbrowsermode");if(typeof quakelive.cvars.screenModes[v.value]!="undefined"){y=quakelive.cvars.screenModes[v.value][0];v=quakelive.cvars.screenModes[v.value][1]}else{y=
800;v=600}u.StartGameMode(y,v);quakelive.SetPageTitle("QUAKE LIVE - Now Playing!");quakelive.SendModuleMessage("OnGameStarted",{isBotGame:g.isBotGame,serverInfo:o});g.isBotGame||qz_instance.StopDownloads();quakelive.TrackEvent("game_session","start_"+quakelive.siteConfig.premiumStatus,g.isBotGame?"practice":"online");u.NextStep()};e.prototype=new k;e.prototype.StartVertMode=function(u){u=u.launchRequest;d();SetCvar("r_fullscreen","0");this.browserMode=quakelive.cvars.GetIntegerValue("r_inbrowsermode",
12);if(this.browserMode==0)this.browserMode=12;this.browserX=quakelive.cvars.GetIntegerValue("vid_xpos",0);this.browserY=quakelive.cvars.GetIntegerValue("vid_ypos",0);if(!quakelive.CanEmbedViewport()){SetCvar("r_inbrowsermode",0);SetCvar("vid_xpos",0);SetCvar("vid_ypos",0)}this.soundVolume=quakelive.cvars.Get("s_volume","0.8").value;SetCvar("s_volume",0);if(!quakelive.IsLinux())u.options.params.noInputGrab=true;u.options.params.noAudio=true;u=a("#qlv_game_mode");u.find(".action_txt").unbind("click").html("QUAKE LIVE is loading now!");
u.find(".url_link").unbind("click").html("Please watch this video from our sponsors&hellip;");u.find(".action_img").unbind("click").html("<img src='"+quakelive.resource("/images/lgi/server_details_time.png")+"' width='16' height='16' />")};e.prototype.EndVertMode=function(u){a("#qlv_game_mode_preroll").hide();a(".interestitial_ad_container").hide();u.SetGameModeDefaults();setTimeout(function(){quakelive.mod_friends.MoveTo("#qlv_game_mode_chatlist")},100);u=[];if(!quakelive.IsLinux()){SetCvar("in_nograb",
0);u.push("in_nograb 0;");u.push("in_restart;")}if(currentGameParams){var g=false;if(currentGameParams.hasFullscreen){SetCvar("r_fullscreen",1);u.push("r_fullscreen 1;");g=true}if(!quakelive.CanEmbedViewport()){SetCvar("r_inbrowsermode",this.browserMode);SetCvar("vid_xpos",this.browserX);SetCvar("vid_ypos",this.browserY);u.push("r_inbrowsermode "+this.browserMode+";");u.push("vid_xpos "+this.browserX+";");u.push("vid_ypos "+this.browserY+";");g=true}g&&u.push("vid_restart;")}SetCvar("s_volume",this.soundVolume);
u.push("s_volume "+this.soundVolume+";");u.push("advert_done;");qz_instance.SendGameCommand(u.join(" "))};e.prototype.StartVertTimer=function(u,g){this.vertTimeLeft=g.isFailover?10:15;this.TickVertTimer(u,g);this.aborted=false;this.timeoutHandle=null;var o=this;quakelive.AddOnceHook("OnGameExited",function(){o.timeoutHandle&&clearTimeout(o.timeoutHandle);o.aborted=true})};e.prototype.TickVertTimer=function(u,g){if(!this.aborted){var o=this.vertTimeLeft!=1?"seconds left&hellip;":"second left&hellip;";
a("#qlv_game_mode").find(".action_txt").html(this.vertTimeLeft+" "+o);this.vertTimeLeft--;if(this.vertTimeLeft<=0)this.EndVertMode(u);else{var y=this;this.timeoutHandle=setTimeout(function(){y.TickVertTimer(u,g)},1E3)}}};e.prototype.StartHouseVert=function(u,g){this.StartVertTimer(u,g);quakelive.LoadVerts({zone:quakelive.VERT_ZONES.pre_game_interstitial,display:function(o,y,v,C){o=quakelive.ParseMetaVert(C,{type:""});y={width:600,height:400};y.src=o&&o.keyvals.type=="flash"?quakelive.resource(o.keyvals.src):
quakelive.resource("/flash/verts/ql_600400_1.swf");v=a("#house_flash_node");if(v.length==0){v=a('<div id="house_flash_node"></div>');g.$adNode.append(v)}g.$adNode.children().hide();o&&o.keyvals.type=="flash"?v.empty().show().flash(y):v.empty().show().append(C)}},{timeout:4E3},function(){qz_instance.IsGameRunning()||u.StartGame()})};e.prototype.SetupVertDOM=function(){var u=false,g=a("#qlv_game_mode_preroll").show(),o=a("#video_ad_container");if(o.length==0)o=a('<div id="video_ad_container"/>').appendTo("body");
else u=true;var y=g.find(".interstitial_ad_container");if(y.length==0){y=a('<div class="interstitial_ad_container"></div>');var v=a('<div class="content"></div>').append("<h1>Now connecting to your match&hellip;</h1>").append(o),C=["<h2>Want to get into game faster? <a>Click here to upgrade</a> and get right into game!</h2>","<h2>Don't want to see these video ads? <a>Click here to upgrade</a> and get right into game!</h2>"];C=a(C[parseInt(Math.random()*C.length)]);v.append(C);y.append(v);g.append(y);
C.find("a").attr({href:quakelive.BuildGotoURL("premium",null,true),target:"_blank"})}return{isReload:u,isFailover:false,$preRoll:g,$adNode:o,$adContainer:y}};p.prototype=new e;p.prototype.StartTremorVert=function(u,g){var o=this,y=null;window.onAdNotFound=function(){if(y){clearTimeout(y);y=null}quakelive.TrackEvent("game_session","ad_completed","not_found");g.isFailover=true;o.StartHouseVert(u,g)};window.onError=function(){if(y){clearTimeout(y);y=null}quakelive.TrackEvent("game_session","ad_completed",
"error");g.isFailover=true;o.StartHouseVert(u,g)};window.onAdEnd=function(){if(y){clearTimeout(y);y=null}quakelive.TrackEvent("game_session","ad_completed","success");o.EndVertMode(u)};window.onAdVideoEnd=function(){if(y){clearTimeout(y);y=null}quakelive.TrackEvent("game_session","ad_completed","success");o.EndVertMode(u)};window.onAdStart=function(){if(y){clearTimeout(y);y=null}quakelive.TrackEvent("game_session","ad_started");quakelive.LoadVerts({zone:quakelive.VERT_ZONES.pre_game_interstitial,
display:function(){}},{timeout:4E3})};y=setTimeout(function(){onAdEnd()},35E3);var v={write:document.write,writeln:document.writeln};document.write=function(C){g.$adNode.append(C)};document.writeln=function(C){g.$adNode.append(C)};tmObj.set("javascriptEvents","true");if(g.isReload){g.$adNode.children().hide();a("#tmVideoApplication").show();tmObj.reloadVideo()}else tmObj.start(quakelive.config("tremorPolicy",quakelive.siteConfig.adPolicy));document.write=v.write;document.writeln=v.writeln};p.prototype.Run=
function(u){this.StartVertMode(u);var g=this.SetupVertDOM();if(typeof tmObj!="undefined"&&a.isPlainObject(tmObj))this.StartTremorVert(u,g);else{quakelive.TrackEvent("game_session","ad_blocked");this.StartHouseVert(u,g)}u.StartGame()};x.prototype=new e;x.prototype.Run=function(u){this.StartVertMode(u);var g=this.SetupVertDOM();this.StartHouseVert(u,g);u.StartGame()};t.prototype=new k;t.prototype.Run=function(u){var g=u.launchRequest.options;if(g.userInfo.premiumStatus!="standard")g.params.noAds=true;
else g.params.shrinkViewport=true;quakelive.mod_friends.MoveTo("#qlv_game_mode_chatlist");a("#body-container").hide();u.StartGame()};b.prototype.Launch=function(u){var g=u.options.serverInfo,o=u.options.params;if(quakelive.IsGameRunning()){u="connect "+g.host_address+";";if(typeof o.password=="string")u+="password "+o.password+";";qz_instance.SendGameCommand(u);quakelive.TrackEvent("game_session","follow_"+quakelive.siteConfig.premiumStatus)}else{var y=this;window.OnGameExit=function(C){quakelive.TrackEvent("game_session",
C==0?"end_success":"end_error");window.lastGameExitCode=C;y.EndGameMode();quakelive.SendModuleMessage("OnGameExited",lastGameExitCode)};o=[new c];g=false;if(u.IsAdvertisable()){var v=quakelive.config("videoService","tremor");if(v=="tremor"){o.push(new p);g=true}else if(v=="house"){o.push(new x);g=true}}g||o.push(new t);this.launchSequence=o;this.launchRequest=u;this.NextStep()}};b.prototype.NextStep=function(){if(this.launchSequence.length==0)return false;this.launchSequence.shift().Run(this);return true};
z.prototype.IsAdvertisable=function(){var u=this.options;return quakelive.config("forceVideoAds",false)||u.userInfo.premiumStatus=="standard"&&u.userInfo.isActive&&!u.params.isTraining};z.prototype.RaiseError=function(u){this.options.error(u)};z.prototype.IsLaunchable=function(){var u=this.options.userInfo,g=this.options.params,o=this.options.serverInfo;if(!u.id)return m.ErrorNotRegistered;if(!g.isBotGame&&!g.isTraining){if(!u.syncComplete)return m.ErrorNotSynced;if(!u.isActive)return m.ErrorNotActive;
if(o){if(u.premiumStatus=="standard"&&o.premium&&!o.invitation)return m.ErrorNotPremium;if(o.g_needpass&&!o.invitation&&o.owner.toLowerCase()!=u.name.toLowerCase()&&!quakelive.IsMemberOf("id")&&typeof g.password=="undefined")return m.ErrorMissingPassword}}return m.Ok};b.prototype.SetGameModeDefaults=function(){var u=this,g=a("#qlv_game_mode").css("top","0");g.find(".greeting_txt").text("Quake Live");a("<a>").click(function(){u.EndGameMode()});g.find(".action_txt").text("Back to Website").unbind("click").click(function(){u.EndGameMode()});
g.find(".action_img").html("<img src='"+quakelive.resource("/images/sf/general/close_xpic.gif")+"' width='18' height='16' />").unbind("click").click(function(){u.EndGameMode()});a("#qlv_game_mode_viewport,#qz_handshake").removeClass("ingame_minimized")};b.prototype.StartGameMode=function(u,g){window.onbeforeunload=OnBeforeUnload;qlHidePrompt();this.SetGameModeDefaults();var o="";o=u<=640?"game_decoration_640":u<=800?"game_decoration_800":"game_decoration_1024";a("#qlv_game_mode").attr("class",o);
quakelive.SendModuleMessage("OnGameModeStarted",{width:u,height:g})};b.prototype.EndGameMode=function(){window.onbeforeunload=null;quakelive.ShutdownGame();d();a("#qlv_game_mode").css("top","-9999px");a("#body-container").show();quakelive.mod_friends.MoveTo("#qlv_chatControl");quakelive.siteConfig.premiumStatus=="standard"&&qz_instance.AddContentIgnoreGroup(4);qz_instance.StartDownloads(quakelive.siteConfig.cdnUrl,quakelive.siteConfig.cdnUrl);quakelive.ReloadVerts();quakelive.SendModuleMessage("OnGameModeEnded")};
var l=undefined;b.prototype.StartGame=function(){if(l===undefined){var u=this.launchRequest;l=setTimeout(function(){l=undefined;var g=qz_instance.LaunchGameWithCmdBuffer(u.options.params.GetCommandLine());if(g){OnGameExit(g);qlPrompt({title:"Fatal Error",body:qz_instance.GetErrorCodeString(g)||"Unknown Error",fatal:true})}},20)}};var q=new b;r.prototype.Launch=function(u){u=new z(u);var g=u.IsLaunchable();window.currentGameParams=u.options.params;window.currentServerInfo=u.options.serverinfo;g==m.Ok?
q.Launch(u):u.RaiseError(g)};r.prototype.StartGameMode=function(u,g){q.StartGameMode(u,g)};r.prototype.EndGameMode=function(){q.EndGameMode()};quakelive.exports.GameLauncher=r;quakelive.exports.LaunchStatus=m})(jQuery);
(function(a){function d(){var g=a("#home_carousel");if(g.length>0){for(var o=g.find("li").length,y=[],v=[],C=0;C<o;++C){y.push(".carousel_item_"+C);v.push('<span class="carousel_nav_item carousel_item_'+C+(C==0?" carousel_nav_selitem":"")+'">'+(C+1)+"</span> ")}v.push('<div class="cl"><div>');a("#home_carousel_nav .inner").html(v.join(""));g.jCarouselLite({auto:15E3,speed:500,visible:1,circluar:true,btnGo:y,afterEnd:function(G,H){var F=(H-1)%o;a(".carousel_nav_selitem").removeClass("carousel_nav_selitem");
a(".carousel_item_"+F).addClass("carousel_nav_selitem")},beforeStart:function(){}})}}function b(){q.filter.filters.group=this.value;q.ChangeSocialFilter(this.value);l(this)}function k(){q.ChangeGameTypeFilter(this.value,true);l(this)}function c(){q.ChangeArenaFilter();l(this)}function e(){q.filter.filters.state=this.value;l(this)}function p(){q.filter.filters.difficulty=this.value;l(this)}function x(){q.filter.filters.location=this.value;l(this)}function t(){q.UpdateFilterURL(this.name,this.checked===
true?1:0);q.filter.filters.premium_only=this.checked===true?1:0;q.ReloadServerList();q.UI_RefreshFilter()}function z(){var g=a("input[name='private']").fieldValue()[0];q.UpdateFilterURL("private",g);q.filter.filters["private"]=g;q.ReloadServerList();q.UI_RefreshFilter()}function r(){q.UpdateFilterURL(this.name,this.value);switch(this.name){case "group":q.ChangeSocialFilter(q.filter.filters.group);break;case "game_type":q.ChangeGameTypeFilter(q.filter.filters.game_type,false);break;case "difficulty":q.ChangeDifficultyFilter();
break;default:break}l(this);q.UI_RefreshFilter();q.ReloadServerList()}function m(){var g=a("#ctrl_filter_arena");g.empty();g.append('<option value="any">All Arenas</option>');mapdb.AddTagOptionGroups(g);g.append('<optgroup label="Specific Arena"></optgroup>')}function l(g){g.options.selectedIndex==0?a(g).parent(".filter_control").find("label").removeClass("selected"):a(g).parent(".filter_control").find("label").addClass("selected")}var q={};q.TITLE="Home";q.defaultFilter='{"filters":{"group": "any", "game_type": "any", "arena": "any", "state": "any", "difficulty": "any", "location": "any", "private": 0, "premium_only": 0 }, "arena_type": "", "players": [], "game_types": [], "ig": 0 }';
q.savedFilter={};q.filter={};q.bHasCustomFilter=false;var u={0:{IG:0,GT:[mapdb.GameTypes.CTF,mapdb.GameTypes.CA,mapdb.GameTypes.TDM,mapdb.GameTypes.FFA,mapdb.GameTypes.DUEL]},1:{IG:0,GT:[mapdb.GameTypes.CTF,mapdb.GameTypes.CA,mapdb.GameTypes.TDM,mapdb.GameTypes.FT]},2:{IG:0,GT:[mapdb.GameTypes.FFA]},3:{IG:0,GT:[mapdb.GameTypes.CTF]},4:{IG:0,GT:[mapdb.GameTypes.CA]},5:{IG:0,GT:[mapdb.GameTypes.FT]},6:{IG:0,GT:[mapdb.GameTypes.TDM]},7:{IG:0,GT:[mapdb.GameTypes.DUEL]},8:{IG:1,GT:[mapdb.GameTypes.FFA]},
9:{IG:1,GT:[mapdb.GameTypes.CTF]},10:{IG:1,GT:[mapdb.GameTypes.FT]},11:{IG:1,GT:[mapdb.GameTypes.TDM]},12:{IG:"any",ranked:1,GT:[mapdb.GameTypes.CTF,mapdb.GameTypes.CA,mapdb.GameTypes.TDM,mapdb.GameTypes.FFA,mapdb.GameTypes.DUEL,mapdb.GameTypes.FT]},13:{IG:"any",ranked:0,GT:[mapdb.GameTypes.CTF,mapdb.GameTypes.CA,mapdb.GameTypes.TDM,mapdb.GameTypes.FFA,mapdb.GameTypes.DUEL,mapdb.GameTypes.FT]},14:{IG:1,ranked:0,GT:[mapdb.GameTypes.CA]}};q.waitHandle=null;q.refreshCount=0;q.lastQuickStatsRefresh=0;
q.quickStatsCache=undefined;q.GetLayout=function(){return quakelive.IsLoggedIn()||quakelive.pathParts[1]=="advertise"?"postlogin":"prelogin"};quakelive.AddHook("OnModelIconChanged",function(g){q.LoadModelIcon(g)});q.Init=function(){if(quakelive.IsLoggedIn()){q.DISPLAY={friends:true};q.FetchFilter()}else q.DISPLAY={friends:false};quakelive.AddHook("OnContentLoaded",q.Hook_OnContentLoaded);quakelive.AddHook("OnGameStarted",q.Hook_OnGameStarted)};q.FetchFilter=function(){var g=quakelive.Eval(q.defaultFilter),
o=quakelive.userinfo.BROWSER_FILTER;if(o.length>0){o=quakelive.Eval(o);if(typeof o=="object"){q.bHasCustomFilter=true;q.filter=a.extend(g,o);q.savedFilter=a.extend(g,o)}else q.savedFilter=q.filter=g}else q.savedFilter=q.filter=g};q.Hook_OnContentLoaded=function(g){g!=q&&q.StopMatchRefresh()};q.OnLayoutLoaded=function(){if(quakelive.IsLoggedIn())q.LoadModelIcon(quakelive.cvars.Get("model"));else if(document.loginform){a("#loginform").one("submit",q.browserCheck);a("#in_email").focus()}};q.browserCheck=
function(){if(navigator.userAgent.indexOf("Windows NT 6.1")!=-1&&a.browser.msie){var g=quakelive.resource("/images/ie_as_admin.png");qlPrompt({title:"Compatibility Issues",body:'<p>We have detected that you are using Internet Explorer on Windows 7. Due to changes in Windows 7, you may have difficulties launching the game.</p> <p>In order to work around this, run the browser as an administrator by right clicking and selecting "Run as administrator." Alternatively, you may use another supported browser. We recommend Mozilla Firefox on Windows 7.</p><br/><img src="'+
g+'"/>',ok:function(){a("#prompt").jqmHide();a("#loginform .goButton").click()},alert:true});return false}};q.LoadModelIcon=function(g){g=ParseModelSkin(g.value);q.playericons=new PlayerIconSet(g.model,g.skin);quakelive.playericons=q.playericons;var o={callback:function(){quakelive.mod_prefs.ShowOverlay();return false},status:quakelive.siteConfig.premiumStatus};a(".nametag-icon").empty().append(BuildPlayerIcon(q.playericons.modelskin,"xl",o));a(".nametag-body-md").css("background","url("+quakelive.resource("/images/players/"+
g.model+"/body_"+g.skin+"_md.png")+") no-repeat")};q.ReloadServerList=function(){if(quakelive.IsLoggedIn()&&!quakelive.IsGameRunning()){q.filter.filters.invitation_only=q.filter.filters["private"]==2?1:0;q.ChangeSocialFilter(q.filter.filters.group);q.StopMatchRefresh();var g=function(){quakelive.serverManager.RefreshServers(q.filter);q.waitHandle=setTimeout(g,45E3)};g()}};q.JoinServer=function(g){join_server(g)};q.StopMatchRefresh=function(){if(q.waitHandle!=null){clearTimeout(q.waitHandle);q.waitHandle=
null}};q.ShowContent=function(g){if(quakelive.siteConfig.homeOverride)quakelive.Goto(quakelive.siteConfig.homeOverride);else if(quakelive.IsLoggedIn()&&quakelive.userstatus!="ACTIVE")quakelive.Goto("welcome");else{quakelive.ShowContent(g);if(quakelive.IsLoggedIn()){quakelive.MakeHomeChooser("home");g=quakelive.cvars.Get("web_advancedBrowser").value==1||false;q.SetBrowserView(g?new quakelive.ServerListView:new quakelive.ServerIconView);q.UI_UpdateListViewButton();quakelive.params.showgamesettings&&
quakelive.mod_prefs.ShowOverlay();q.InitFilters();q.ReloadServerList();q.LoadQuickStats()}else d()}};q.SetBrowserView=function(g){g.SetDisplayProps({target:"qlv_postlogin_matches"});quakelive.serverManager.listener=g};q.filtersInitialized=false;q.InitFilters=function(){locdb.InitLocationFilter(a("#ctrl_filter_location"),{showLAN:true,showRegion:true,showStandard:true});a(".filterbar_content select").unbind();m();for(var g in quakelive.params)if(typeof q.filter.filters[g]!="undefined"){q.filter.filters[g]=
quakelive.params[g];q.UpdateFilterURL(g,quakelive.params[g])}a(".filterbar_content select").each(function(){if(typeof q.filter.filters[this.name]!="undefined"){a(this).selectOptions(q.filter.filters[this.name]);l(this)}});a("#ctrl_filter_social").change(b);a("#ctrl_filter_gametype").each(k).change(k);a("#ctrl_filter_arena").change(c);a("#ctrl_filter_gamestate").change(e);a("#ctrl_filter_difficulty").change(p);a("#ctrl_filter_location").change(x);a('input[name="private"]').click(z);a("#premium_only").change(t);
a("#ctrl_filter_arena").selectOptions(q.filter.filters.arena);l(a("#ctrl_filter_arena")[0]);a(".filterbar_content select").change(r);var o;if(quakelive.HasParam("private")){try{o=parseInt(quakelive.params["private"])}catch(y){o=0}q.filter.filters["private"]=o;q.ReloadServerList()}else{o=parseInt(q.filter.filters["private"]||0);q.UpdateFilterURL("private",o)}q.filter.filters.premium_only==1&&a("#premium_only").attr("checked","checked");if(o==1)a("#privateServer").attr("checked","checked");else o==
2?a("#invitedServer").attr("checked","checked"):a("#publicServer").attr("checked","checked");q.UI_RefreshFilter()};q.ChangeSocialFilter=function(g){q.filter.players=[];if(g=="friends"){g=quakelive.mod_friends.roster.fullRoster;for(var o=0;o<g.length;++o)g[o].IsSubscribed()&&g[o].IsOnline()&&q.filter.players.push(g[o].name)}};q.ChangeGameTypeFilter=function(g){if(typeof u[g]=="undefined")g=0;var o=u[g];q.filter.filters.game_type=g==0?"any":g;q.filter.filters.ranked=o.ranked!=undefined?o.ranked:"any";
q.filter.ig=o.IG;q.filter.game_types=[];var y=a("#ctrl_filter_arena > optgroup:last").empty(),v="",C={};for(var G in o.GT){var H=o.GT[G],F=mapdb.getAllByGameType(H);for(var J in F){var Q=F[J];if(!C[Q.sysname]){C[Q.sysname]=true;v+='<option class="filter_map" value="'+Q.sysname+'">'+Q.name+"</option>"}}g!="any"&&g!="instagib"&&q.filter.game_types.push(H)}y.append(v);g=y.children();q.SortOptions(g)};q.ChangeDifficultyFilter=function(){if(quakelive.userinfo.NEW_PLAYER&&!q.bHasCustomFilter){a("#ctrl_filter_difficulty").selectOptions("1");
q.filter.filters.difficulty=1}};q.ChangeArenaFilter=function(){var g=a("#ctrl_filter_arena").selectedOptions()[0];q.filter.arena_type=a(g).attr("class")=="filter_tag"?"tag":a(g).attr("class")=="filter_map"?"map":"";q.filter.filters.arena=g.value};q.UpdateFilterURL=function(g,o){o==0||o=="any"?quakelive.RemoveParam(g):quakelive.AddParam(g,o);quakelive.StopPathMonitor();var y=quakelive.MergeParams(quakelive.params);y.length>0?quakelive.SetAnchor(quakelive.path+";"+y):quakelive.SetAnchor(quakelive.path);
quakelive.StartPathMonitor()};q.UI_RefreshFilter=function(){var g=0;a(".filterbar_content select").each(function(y,v){v.options.selectedIndex!=0&&g++});var o;switch(SafeParseInt(a("input[name='private']").fieldValue()[0])){case 1:o="matchlist_header_private";g++;break;case 2:o="matchlist_header_invite";g++;break;default:o="matchlist_header_public";break}a("input[name='premium_only']").get(0).checked&&g++;a("#matchlist_header").attr("class",o);g>0?a(".filterbar_notice").css("visibility","visible"):
a(".filterbar_notice").css("visibility","hidden")};q.SortOptions=function(g){for(var o=g.length,y=[],v=0;v<o;v++)y[v]={v:g[v].value,t:g[v].text};y.sort(function(C,G){var H=C.t.toLowerCase(),F=G.t.toLowerCase();return H==F?0:H<F?-1:1});for(v=0;v<o;v++){g[v].text=y[v].t;g[v].value=y[v].v}};q.OnDownloadGroup=function(g){if(g.group==GROUP_DONE){g=quakelive.cvars.Get("web_configVersion");if(g.value<1){var o=[a(window).width(),a(window).height()],y=[310,130];if(o[0]>=1024+y[0]&&o[1]>=768+y[1])quakelive.cvars.Set("r_inBrowserMode",
12);else o[0]>=800+y[0]&&o[1]>=600+y[1]?quakelive.cvars.Set("r_inBrowserMode",9):quakelive.cvars.Set("r_inBrowserMode",5);SetCvar("web_configVersion",1)}if(g.value<2){SetBind("F3","readyup");SetBind("h","+chat");SetCvar("web_configVersion",2)}if(g.value<4){SetCvar("m_filter",0);SetCvar("web_configVersion",4)}if(g.value<5){SetCvar("cg_hitBeep",2);SetCvar("web_configVersion",5)}if(g.value<6){SetCvar("net_noipx",1);SetCvar("web_configVersion",6)}if(g.value<7){SetCvar("net_noipx",0);SetCvar("web_configVersion",
7)}if(g.value<8){g=[];g[2]=5;g[3]=13;g[4]=9;g[5]=21;g[6]=17;g[7]=26;o=["color1","color2"];for(var v in o){y=quakelive.cvars.GetIntegerValue(o[v],0);typeof g[y]!="undefined"&&SetCvar(o[v],g[y])}SetCvar("web_configVersion",8)}}};q.OnOverlayLoaded=function(g){if(g[0]=="home"&&g[1]=="crashed"){g=qz_instance.GetCrashReport();a("#crashed-report").val(g)}};q.Hook_OnGameStarted=function(){q.StopMatchRefresh()};q.ShowServerListError=function(g){a("#qlv_postlogin_matches").html('<p class="tc thirtyPxTxt sixtypxv midGrayTxt">Unable to load the server list</p><p class="tc TwentyPxTxt midGrayTxt">'+
g+'</p><p class="tc TwentyPxTxt midGrayTxt">Please try again in a few minutes&hellip;</p>');q.StopMatchRefresh();q.waitHandle=setTimeout(q.ReloadServerList,6E4)};q.StartWarmupGame=function(){qlXfer.currentGroup<GROUP_BASE||quakelive.mod_offlinegame.ReplayTrainingGame()};q.ToggleFilterBar=function(){var g=a(".filterbar"),o=g.hasClass("filterbar_expanded"),y=a("#qlv_postlogin_matches").height();quakelive.matchtip.HideMatchTooltip();if(o){o=g.height();g.removeClass("filterbar_expanded");a("#qlv_postlogin_matches").css("height",
y+o+"px");a(".filterbar_toggle").removeClass("selected")}else{g.addClass("filterbar_expanded");a("#qlv_postlogin_matches").css("height",y-g.height()+"px");a(".filterbar_toggle").addClass("selected")}};q.ResetBrowserFilter=function(){confirm("Are you sure you want to reset to the default online games view?")&&a.ajax({type:"get",url:"/browser/filter/reset",mode:"abort",port:"filterreset",success:q.ResetBrowserFilter_Success,error:q.ResetBrowserFilter_Error})};q.ResetBrowserFilter_Success=function(){a(".filterbar_content select").each(function(g,
o){o.options.selectedIndex=0;quakelive.RemoveParam(this.name);l(this)});a("#publicServer").attr("checked","checked");a("#premium_only").removeAttr("checked");a(".filterbar_notice").css("visibility","hidden");quakelive.StopPathMonitor();quakelive.SetAnchor("home");quakelive.StartPathMonitor();q.filter=quakelive.Eval(q.defaultFilter);q.ReloadServerList()};q.ResetBrowserFilter_Error=function(){};q.SaveBrowserFilter=function(){a.ajax({type:"post",url:"/browser/filter/update",mode:"abort",port:"filterupdate",
dataType:"json",data:"filter_obj="+JSON.stringify(q.filter),success:q.SaveBrowserFilter_Success,error:q.SaveBrowserFilter_Error})};q.SaveBrowserFilter_Success=function(){var g=0;a(".filterbar_content select").each(function(o,y){y.options.selectedIndex!=0&&g++});a(".filterbar_notice > a").text("View has been saved.");setTimeout(function(){a(".filterbar_notice > a").text("This view has been customized.")},5E3);g>0?a(".filterbar_notice").css("visibility","visible"):a(".filterbar_notice").css("visibility",
"hidden");q.ToggleFilterBar();q.savedFilter=q.filter};q.SaveBrowserFilter_Error=function(){};q.LoadQuickStats=function(){if(a(".bare_personal_stats").length>0){var g=function(){a(".bare_personal_stats").html(q.quickStatsCache)},o=function(v){a(".charNameStats .headName").text(v)},y=new Date;y=y.getTime();!q.quickStatsCache||y-q.lastQuickStatsRefresh>12E5?a.ajax({url:"/home/quickstats",success:function(v){if(v=="disabled")o("Temporarily disabled");else if(a(v).attr("class")!="personal_stats")o("Unable to load QuickStats");
else{q.quickStatsCache=v;q.lastQuickStatsRefresh=(new Date).getTime();g()}},error:function(){o("Unable to load QuickStats")},dataType:"html"}):g()}};q.UI_UpdateListViewButton=function(){var g=quakelive.cvars.Get("web_advancedbrowser");parseInt(g.value,10)?a(".toggle_list").addClass("enabled"):a(".toggle_list").removeClass("enabled")};q.ToggleListView=function(){var g=quakelive.cvars.Get("web_advancedbrowser");quakelive.cvars.Set("web_advancedbrowser",parseInt(g.value,10)?0:1);q.SetBrowserView(parseInt(g.value,
10)?new quakelive.ServerListView:new quakelive.ServerIconView);q.UI_UpdateListViewButton();a("#qlv_postlogin_matches").empty();q.ReloadServerList()};quakelive.RegisterModule("home",q)})(jQuery);
(function(a){var d={};d.TITLE="News";d.GetLayout=function(){return"postlogin"};d.ShowContent=function(b){quakelive.ShowContent(b);b=quakelive.pathParts.length>1?quakelive.pathParts[1]:"site_news";a(".qlv_newsNav .selected").removeClass("selected");a(".qlv_newsNav .nav_"+b).addClass("selected");typeof addthis!="undefined"&&addthis.button(".addthis_button")};quakelive.RegisterModule("news",d)})(jQuery);
(function(a){function d(r,m,l,q,u,g){var o=quakelive.cvars.Get(r),y=a("#slider_"+r);u=u||100;q=q||1;y.slider({min:m*u,max:l*u,stepping:q,value:u*o.value,change:function(v,C){SetCvar(r,C.value/u);g&&g(C.value/u)}});g&&g(o.value)}function b(r,m){for(var l=quakelive.cvars.Get(r),q=a("#select_"+r).empty(),u=0;u<m.length;u+=2){var g=a('<option value="'+m[u]+'">'+m[u+1]+"</option>");m[u]==l.value&&g.attr("selected","selected");q.append(g)}q.change(function(){SetCvar(q.attr("name"),q.val())})}function k(r,
m){var l=quakelive.cvars.Get(r);m||(m=[1,0]);var q=a("#"+r);l=l.value!=m[1];q.empty();q.append("On ");var u;u='<input type="radio" name="'+r.toLowerCase()+'" value="1" ';if(l)u+=' checked="checked" ';u+=" onclick=\"SetCvar('"+r+"', '"+m[0]+"')\" ";u+=" />";q.append(u);q.append(" &nbsp;&nbsp; ");q.append("Off ");u='<input type="radio" name="'+r.toLowerCase()+'" value="0" ';l||(u+=' checked="checked" ');u+=" onclick=\"SetCvar('"+r+"', '"+m[1]+"')\" ";u+=" />";q.append(u)}function c(){for(var r=0;r<
2;++r){var m="color"+(r+1);x[m]=a("#"+m+"_"+quakelive.cvars.Get(m,"1").value);x[m].addClass("selected")}}function e(){var r=quakelive.cvars.Get("cg_drawCrosshair","1");t=a("#crosshair_"+r.value);t.addClass("selected")}var p={};p.keyboardNode=null;p.overlayNode=null;p.Init=function(){window.OnInputEvent=p.OnInputEvent;p.keyboardNode=a(p.TPL_KEYBOARD);p.overlayNode=a(p.TPL_OVERLAY_CONTAINER)};p.OnDownloadGroup=function(r){r.group==GROUP_MINIMUM&&quakelive.cvars.LoadHardwareCvars()};p.LoadConfigPage=
function(){p.Nav("character")};p.LoadModels_Error=function(){a("#character_list").html("<div style='width: 200px; height: 200px; margin: 0 auto; text-align: center'>Failed to load model list.<br /><div style='cursor: pointer' onclick='quakelive.mod_prefs.LoadModels(); return false'>Click here to reload the list.</div></div>")};p.LoadModels_Success=function(r){if(r.length>0){var m=a("#character_list").empty(),l=a("<div></div>");p.models=r;var q=quakelive.cvars.Get("model","sarge/default").value.toLowerCase().split("/"),
u=0,g,o;if(q.length==1){g=q[0];o="default"}else{g=q[0];o=q[1];if(o=="red"||o=="blue")o="default"}for(var y=0;y<r.length;++y){var v=r[y];if(!(v.SKIN=="red"||v.SKIN=="blue")){if(v.MODEL==g&&v.SKIN==o)u=y;if(l.size()>8){m.append(l);l=a("<div></div>")}l.append("<a id='cfg_model_"+y+"' href='javascript:;' onclick='quakelive.mod_prefs.SelectPlayerModel("+y+"); return false'><img src='"+quakelive.resource("/images/players/icon_md/"+v.MODEL+"_"+v.SKIN+".png")+"' /></a>")}}m.append(l);p.SelectPlayerModel(u,
q[1])}else p.LoadModels_Error()};p.LoadModels=function(){p.models?p.LoadModels_Success(p.models):a.ajax({url:"/prefs/listmodels",mode:"abort",port:"listmodels",type:"post",dataType:"json",error:p.LoadModels_Error,success:p.LoadModels_Success})};var x={};p.SelectColor=function(r,m){x[r]&&x[r].removeClass("selected");x[r]=a("#"+r+"_"+m);x[r].addClass("selected");SetCvar(r,m)};var t=null;p.SelectCrosshair=function(r){t&&t.removeClass("selected");t=a("#crosshair_"+r);t.addClass("selected");SetCvar("cg_drawCrosshair",
r)};p.SelectPlayerModel=function(r,m){var l=p.models[r],q=l.MODEL+"/"+l.SKIN,u=m||l.SKIN,g=quakelive.cvars.Get("model").value.toLowerCase().split("/");if(g)if(g.length==1)g[1]="default";else{if(g[1]=="red"||g[1]=="blue")g[1]="default"}else g=["sarge","default"];q!=g.join("/")&&SetCvar("model",q);a("#character_list").find(".selected").removeClass("selected");a("#cfg_model_"+r).addClass("selected");l.SKIN=="default"||l.SKIN=="blue"||l.SKIN=="red"||l.SKIN=="sport"||l.SKIN=="bright"?a("#cfg_char_name").css("background",
"transparent url("+quakelive.resource("/images/player_names/"+l.MODEL+".png")+") no-repeat left top"):a("#cfg_char_name").css("background","transparent url("+quakelive.resource("/images/player_names/"+l.NAME+".png")+") no-repeat left top");a("#cfg_char_race").css("background","url("+quakelive.resource("/images/player_races/"+l.RACE+".png")+") no-repeat left top");a("#cfg_char_description").html(l.DESC);a("#cfg_char_body").css("background","url('"+quakelive.resource("/images/players/body_lg/"+l.MODEL+
"_"+u+".png")+"') no-repeat 0 0");a("#cfg_char_redteam").html("<div class='interactive' style='width: 116px; height: 100px; background: url("+quakelive.resource("/images/players/body_sm/"+l.MODEL+"_red.png")+") center top no-repeat;'></div>").unbind("click").click(function(){p.SelectPlayerModel(r,"red");SetCvar("model",l.MODEL+"/red")});a("#cfg_char_blueteam").html("<div class='interactive' style='width: 116px; height: 100px; background: url("+quakelive.resource("/images/players/body_sm/"+l.MODEL+
"_blue.png")+") center top no-repeat;'></div>").unbind("click").click(function(){p.SelectPlayerModel(r,"blue");SetCvar("model",l.MODEL+"/blue")});a("#cfg_char_lgicon").css("background","url('"+quakelive.resource("/images/players/icon_xl/"+l.MODEL+"_"+l.SKIN+".png")+"') no-repeat 0 0").unbind("click").click(function(){p.SelectPlayerModel(r);SetCvar("model",q)});quakelive.SendModuleMessage("OnCharacterChanged",r)};var z={controls_movement:[["+forward","+back","+moveleft","+moveright"],["+moveup","+movedown",
"+speed","centerview"]],controls_actions:[["+attack","weapnext","weapprev","+zoom","+button2"],["messagemode","messagemode2","+button3","dropweapon","dropflag"]],controls_weapons:[["weapon 1","weapon 2","weapon 3","weapon 4","weapon 5","weapon 6"],["weapon 7","weapon 8","weapon 9","weapon 11","weapon 12","weapon 13"]]};p.OnInputEvent=function(r){if(r!="ESCAPE"){if(r=="BACKSPACE")p.targetBindKey!==undefined&&quakelive.binds.Remove(p.targetBindKey,true);else quakelive.binds.Bind(r,p.targetBindAction);
quakelive.cfgUpdater.Commit()}p.targetBindKey=p.targetBindKey2=p.targetBindAction=null;p.ShowKeyboard();try{p.ShowBinds(p.selectedNav)}catch(m){}a("#qlv_site_popup").hide()};p.ShowBindPopup=function(r){var m=null;m=r.keys[0]&&r.keys[1]?'<span class="orangeTxt twentyfourPxTxt"><b>'+r.keys[0].toUpperCase()+"</b> and <b>"+r.keys[1].toUpperCase()+"</b></span>":r.keys[0]?'<span class="orangeTxt twentyfourPxTxt"><b>'+r.keys[0].toUpperCase()+"</b></span>":null;if(r.keys.length>0)m='<span class="orangeTxt twentyfourPxTxt"><b>'+
r.keys.join(", ").toUpperCase()+"</b></span>";p.targetBindKey=r.keys[0];p.targetBindKey2=r.keys[1];p.targetBindAction=r.action;r='<div id="assignKeyBox"><div class="tc twentyfourPxTxt" id="assignKeyInfo">Press your desired key or button for <span class="orangeTxt twentyfourPxTxt">"'+r.name+'"</span><br /><br /><p class="TwentyPxTxt">'+(m?"Current assignment: "+m:"")+'</p></div><div id="escapeText">Press <span class="bold">ESCAPE</span> to cancel or <span class="bold">BACKSPACE</span> to clear this binding.</div></div>';
a("#qlv_site_popup").html(r).css("z-index",999990).show();qz_instance.CaptureNextInputEvent()};p.StartBinding=function(r){(r=quakelive.binds.Get(r))&&p.ShowBindPopup(r)};p.keyNameToCSS={};p.HighlightBindsOnOtherPages=function(r){for(var m in z)if(m!=r)for(var l=0;l<2;++l){var q=z[m][l];for(var u in q){var g=quakelive.binds.Get(q[u]);if(g.keys[0]){var o=p.keyNameToCSS[g.keys[0]]||g.keys[0].toUpperCase();a("#qlv_keyboard").find(".key_"+o).addClass("boundOtherPage")}if(g.keys[1]){o=p.keyNameToCSS[g.keys[1]]||
g.keys[1].toUpperCase();a("#qlv_keyboard").find(".key_"+o).addClass("boundOtherPage")}}}};p.ShowBindSection=function(r,m){var l="";for(var q in m){var u=quakelive.binds.Get(m[q]),g=null,o=u.keys.length;if(o===0)g="&nbsp;";else if(o===1)g=u.keys[0].toUpperCase();else if(o>=2)g=u.keys[o-1].toUpperCase()+" or "+u.keys[o-2].toUpperCase();if(o>2)g+=" (+"+(o-2)+" more)";l+='<div class="row"><div class="medlong fl twentypxh middleAlign">'+u.name+'</div><div class="fl middleAlign" style="cursor: pointer; width: 180px;" onclick="quakelive.mod_prefs.StartBinding(\''+
u.action+"', this); return false\">"+g+'</div><div class="cl"></div></div>';if(u.keys[0]){g=p.keyNameToCSS[u.keys[0]]||u.keys[0].toUpperCase();a("#qlv_keyboard").find(".key_"+g).addClass("boundThisPage")}if(u.keys[1]){g=p.keyNameToCSS[u.keys[1]]||u.keys[1].toUpperCase();a("#qlv_keyboard").find(".key_"+g).addClass("boundThisPage")}}a("#"+r).html(l)};p.ShowBinds=function(r){p.ShowBindSection(r+"_binds0",z[r][0]);p.ShowBindSection(r+"_binds1",z[r][1]);p.HighlightBindsOnOtherPages(r)};p.ShowKeyboard=
function(){p.keyboardNode.remove().appendTo(a(".keyboard_container"));a("#qlv_keyboard").find(".boundThisPage,.boundOtherPage").removeClass("boundThisPage").removeClass("boundOtherPage")};p.Nav=function(r){var m=a("#configContainer");switch(r){case "character":m.html(p.TPL_CHARACTER);p.LoadModels();break;case "settings_basic":m.html(p.TPL_SETTINGS_BASIC);c();e();d("s_volume",0,1,0.1,20,function(l){a("#effects_volume_value").text(parseInt(l*100)+"%")});d("s_musicvolume",0,1,0.1,20,function(l){a("#music_volume_value").text(parseInt(l*
100)+"%")});d("r_gamma",0,2,0.1,50,function(l){a("#brightness_value").text(parseInt(l*100)+"%")});k("r_fullscreen");k("cg_autoswitch");b("r_mode",[0,"320x240",1,"400x300",2,"512x384",3,"640x360",4,"640x400",5,"640x480",6,"800x450",7,"852x480",8,"800x500",9,"800x600",10,"1024x640",11,"1024x576",12,"1024x768",13,"1152x864",14,"1280x720",15,"1280x768",16,"1280x800",17,"1280x1024",18,"1440x900",19,"1600x900",20,"1600x1000",21,"1680x1050",22,"1600x1200",23,"1920x1080",24,"1920x1200",25,"1920x1440",26,
"2048x1536",27,"2560x1600",-2,"Maximum"]);b("r_inbrowsermode",[5,"640x480",9,"800x600",12,"1024x768"]);break;case "settings_advanced":m.html(p.TPL_SETTINGS_ADVANCED);k("s_doppler");k("cg_drawtargetnames");k("cg_allowtaunt");k("r_ext_compressed_textures");b("r_texturemode",["GL_LINEAR_MIPMAP_NEAREST","Bilinear","GL_LINEAR_MIPMAP_LINEAR","Trilinear"]);b("r_picmip",[2,"Low",1,"Normal",0,"High"]);b("r_lodbias",[2,"Low",1,"Medium",0,"High"]);b("r_vertexlight",[1,"Vertex",0,"Lightmap"]);d("cg_fov",75,130,
1,1,function(l){a("#fov_value").text(l+" degrees")});break;case "controls_actions":m.html(p.TPL_CONTROLS_ACTIONS);p.ShowKeyboard();p.ShowBinds(r);break;case "controls_movement":m.html(p.TPL_CONTROLS_MOVEMENT);p.ShowKeyboard();p.ShowBinds(r);break;case "controls_weapons":m.html(p.TPL_CONTROLS_WEAPONS);p.ShowKeyboard();p.ShowBinds(r);break;case "controls_mouse":m.html(p.TPL_CONTROLS_MOUSE);p.ShowKeyboard();k("m_pitch",[-0.022,0.022]);d("sensitivity",0,10,1,10,function(l){a("#mouse_sens_value").text(l)});
break}p.selectedNav=r};p.ResetDefaults=function(){if(confirm("This will reset ALL options to their default values. Are you sure you want to continue?")){qz_instance.SetHardwareCvars("");jQuery.ajax({cache:false,url:"/prefs/reset",success:function(){quakelive.PageRedirect("/user/login_redirect")},error:function(){},complete:function(){}})}};p.overlayVisible=false;p.ShowOverlay=function(){if(quakelive.IsSecure()){quakelive.GotoInsecure("home;showgamesettings=1");return false}p.CloseOverlay();p.overlayNode.css("position",
"absolute");p.overlayNode.css("z-index","100001");a("#qlv_OverlayContent").append(p.overlayNode);p.overlayVisible=true;p.LoadConfigPage()};p.CloseOverlay=function(){if(p.overlayVisible){p.overlayNode.remove();p.overlayVisible=false}};quakelive.RegisterModule("prefs",p)})(jQuery);
(function(a){function d(r,m){a(r).removeClass("ff_state_ok").addClass("ff_state_error").find(".ff_status_text").text(m)}function b(r,m){var l=a(".f_reg_nametag input").val();l.length!=0&&a.ajax({type:"post",url:"/register/verify/nametag",dataType:"json",data:{value:l},success:function(q){q.ECODE===0?r():m(q.MSG)}})}function k(r,m){var l=a(".f_reg_email input").val();if(l.length!=0)isEmailValid(l)?a.ajax({type:"post",url:"/register/verify/email",dataType:"json",data:{value:l},success:function(q){q.ECODE===
0?r():m(q.MSG)}}):m("Invalid email format")}function c(r,m){var l=a(".f_reg_password input"),q=a(".f_reg_password2 input");if(!(l.val().length==0||q.val().length==0))if(l.val()!=q.val())m("Passwords do not match");else{r();a.ajax({type:"post",url:"/register/verify/password",dataType:"json",data:{value:l.val()},success:function(u){u.ECODE===0?r():m(u.MSG)}})}}function e(r,m){var l=a(".f_reg_birthdate .ff_select_month").val(),q=a(".f_reg_birthdate .ff_select_day").val(),u=a(".f_reg_birthdate .ff_select_year").val();
if(!(l==0||q==0||u==0)){var g=new Date;g=[1+g.getMonth(),g.getDate(),g.getFullYear()];l=[l,q,u];q=[];for(u=0;u<3;++u)q[u]=g[u]-l[u];if(q[0]<0||q[0]==0&&q[1]<0)q[2]--;q[2]<13?m("You must be at least 13 years old to sign up."):r()}}function p(r,m){a(r).each(function(l,q){var u=a(q);if(m.type=="text"||m.type=="password"){var g=a(t[m.type]);a("label",g).text(m.title);a("input",g).focus(function(){if(!u.hasClass("ff_state_error")){a(".ff_status_text",g).html(m.help);g.addClass("ff_state_focus")}}).blur(function(){g.removeClass("ff_state_focus ff_state_error ff_state_ok");
if(m.validate){var G=g;if(m.type=="password")G=a(".ff_type_password");m.validate(function(){G.removeClass("ff_state_error").addClass("ff_state_ok")},function(H){G.removeClass("ff_state_ok").addClass("ff_state_error");a(".ff_status_text",G).html(H)})}}).attr("tabindex",m.tabindex||0).attr("name",m.name);m.maxlength&&a("input",g).attr("maxlength",m.maxlength);u.empty().append(g)}else if(m.type=="birthdate"){g=a(t[m.type]);a("label",g).text(m.title);var o,y,v=function(){if(m.validate){var G=g;m.validate(function(){G.removeClass("ff_state_error").addClass("ff_state_ok")},
function(H){G.removeClass("ff_state_ok").addClass("ff_state_error");a(".ff_status_text",G).html(H)})}};o=a(".ff_select_month",g).attr("tabindex",m.tabindex+0).attr("name",m.name+"_month").change(v);y='<option value="0">Month</option>';var C="January|February|March|April|May|June|July|August|September|October|November|December".split("|");for(l=0;l<C.length;++l)y+='<option value="'+(l+1)+'">'+C[l]+"</option>";o.empty().append(y);o=a(".ff_select_day",g).attr("tabindex",m.tabindex+1).attr("name",m.name+
"_day").change(v);y='<option value="0">Day</option>';for(l=0;l<31;++l)y+='<option value="'+(l+1)+'">'+(l+1)+"</option>";o.empty().append(y);o=a(".ff_select_year",g).attr("tabindex",m.tabindex+2).attr("name",m.name+"_year").change(v);y='<option value="0">Year</option>';v=(new Date).getFullYear();for(l=0;l<100;++l)y+='<option value="'+(v-l)+'">'+(v-l)+"</option>";o.empty().append(y);u.empty().append(g)}else if(m.type=="captcha"){g=a(t[m.type]);a("label",g).text(m.title);a("input",g).focus(function(){if(!u.hasClass("ff_state_error")){a(".ff_status_text",
g).html(m.help);g.addClass("ff_state_focus")}}).blur(function(){g.removeClass("ff_state_focus");if(m.validate){var G=g;m.validate(function(){G.removeClass("ff_state_error").addClass("ff_state_ok")},function(H){G.removeClass("ff_state_ok").addClass("ff_state_error");a(".ff_status_text",G).html(H)})}}).attr("tabindex",m.tabindex||0).attr("name",m.name);u.empty().append(g);a(".btn_refresh",g).click(function(){a("input",g).val("").focus()})}})}var x={};x.GetLayout=function(){return quakelive.path=="register"?
"prelogin":quakelive.IsLoggedIn()?"postlogin_bare":"bare"};var t={text:'<div class="ff_type_text"><div class="ff_status_icon"></div><label></label><div class="ff_field_wrapper"><div class="ff_input_wrapper"><input type="text" /></div><div class="ff_status_text">&nbsp;</div></div></div>',password:'<div class="ff_type_password"><div class="ff_status_icon"></div><label></label><div class="ff_field_wrapper"><div class="ff_input_wrapper"><input type="password" /></div><div class="ff_status_text">&nbsp;</div></div></div>',
birthdate:'<div class="ff_type_birthdate"><div class="ff_status_icon"></div><label></label><div class="ff_field_wrapper"><div class="ff_input_wrapper"><select class="ff_select_month"></select></div><div class="ff_input_wrapper"><select class="ff_select_day"></select></div><div class="ff_input_wrapper"><select class="ff_select_year" style="margin: 0"></select></div><div class="cl"></div><div class="ff_status_text">&nbsp;</div></div></div>'};if(SITECONFIG.enableRegCaptcha!="")t.captcha='<div class="ff_type_captcha"><label></label><div id="recaptcha" class="f_reg_captcha"><div class="ff_field_wrapper"><div id="recaptcha_image" class="ff_captcha_img"></div><span>Enter Code:</span><span class="ff_input_wrapper"><input id="recaptcha_response_field" name="recaptcha_response_field"/></span><div class="ff_captcha_refresh"><a href="javascript:Recaptcha.reload();" class="btn_refresh"></a></div><div class="cl"></div><div class="ff_status_text">&nbsp;</div></div></div></div>';
x.ShowContent=function(r){quakelive.ShowContent("");a("#qlv_OverlayContent").html(r);SITECONFIG.enableRegCaptcha!=""&&a("#recaptcha_response_field").length>0&&a.getScript("http://www.google.com/recaptcha/api/js/recaptcha_ajax.js",function(){Recaptcha.create("6LdqLsASAAAAAJIuAN8u5VnejtsbvwA8eguRNeMu","recaptcha_image",{theme:"custom"})});a("#register_form").bind("submit",quakelive.mod_register.VerifyForm);p(".f_reg_email",{name:"email",title:"Email:",type:"text",help:"You will use this to log into QUAKE LIVE.",
tabindex:1,validate:k});p(".f_reg_nametag",{name:"nametag",title:"Name Tag:",type:"text",help:"The name you will use while in-game.",maxlength:15,tabindex:2,validate:b});p(".f_reg_password",{name:"password",title:"Password:",type:"password",help:"6 char minimum, no spaces, can't start with 0.",validate:c,tabindex:3});p(".f_reg_password2",{name:"password2",title:"Verify Password:",type:"password",help:"Confirm your password.",validate:c,tabindex:4});p(".f_reg_birthdate",{name:"birthdate",title:"Birthdate:",
type:"birthdate",help:"",tabindex:5,validate:e});p(".f_reg_captcha",{name:"captcha",title:"Are you human?",type:"captcha",help:"Enter the code that appears in the image.",validate:undefined,tabindex:8});a(".f_reg_email input").focus();if(quakelive.pathParts.length==2&&quakelive.pathParts[1]!="install"){r=false;var m=quakelive.Eval(Base64.decode(quakelive.pathParts[1]));if(m.ERRORS)for(var l in m.ERRORS){var q=a(".f_reg_"+l).find(":input");if(q.length){r=true;var u;u=l=="birthdate"?a(".ff_type_birthdate"):
l=="password"?a(".ff_type_password"):q.parents(".ff_field_wrapper").parent();u.length&&d(u,m.ERRORS[l]);l=="captcha"&&q.val("")}}if(m.FIELDS)for(l in m.FIELDS){q=a(".f_reg_"+l).find(":input");q.length&&m.FIELDS[l]&&q.val(m.FIELDS[l])}r||qlAlert("Unable to Create Your Account","An error has occurred trying to create your account. Please try again in a little while.")}};var z=new qlLock("create_account");x.VerifyForm=function(){if(z.IsLocked())return false;qlProcessing("Creating Your Account","Please Wait&hellip;");
var r={},m=[],l={mailinglist:true},q=a("#qlv_newRegistrationContent input, #qlv_newRegistrationContent select");z.Acquire();q.each(function(){var g=a(this),o=this.tagName.toLowerCase();if(o=="input"){o=g.attr("type").toLowerCase();if(o!="submit")if(o=="checkbox"){r[this.name]=g.attr("checked")?1:0;r[this.name]==0&&!l[this.name]&&m.push(g.parents(".ff_field_wrapper").parent())}else{r[this.name]=g.val();r[this.name].length==0&&!l[this.name]&&m.push(g.parents(".ff_field_wrapper").parent())}}else if(o==
"select"){r[this.name]=parseInt(g.val());r[this.name]==0&&!l[this.name]&&m.push(g.parents(".ff_field_wrapper").parent())}});if(m.length>0){qlAlert("New Account Form is not Complete","Not all fields have been completed. Please fill out the entire form before submitting.");for(var u in m)d(m[u],"This field is required");z.Release();return false}if(!r.eula){qlAlert("New Account Form is not Complete","You must accept the QUAKE LIVE and Punkbuster Software License Agreement in order to create an account.");
z.Release();return false}a(".btn_register").addClass("btn_register_proc");return true};x.Close=function(){qlConfirm("Are you sure you want to close registration?","",function(){quakelive.params.returnto?quakelive.Goto(quakelive.params.returnto):quakelive.Goto("home")},null)};x.Logout=function(){qlConfirm("Are you sure you want to log out?","",quakelive.Logout,null)};x.InstallPlugin=function(){CreateCookie(ie_cookie_string,1,1);upgrade()};quakelive.RegisterModule("register",x)})(jQuery);
(function(a){function d(v){v=v.replace(/\&/g,"&amp;");v=v.replace(/\</g,"&lt;");return v=v.replace(/\>/g,"&gt;")}function b(v){this.bare=v;var C=v.indexOf("@");if(C!=-1)this.username=v.substring(0,C);else{this.username=v;this.bare=v+"@"+quakelive.siteConfig.xmppDomain}this.Clone=function(){return new b(this.bare)}}function k(v,C,G,H){this.jid=v.Clone();this.name=C||this.jid.username;this.unreadMsgCount=0;this.presence=H;this.subscription=G;this.history=[];this.group=g.None;v=o.rosterData[this.name.toLowerCase()];
this.player_id=0;this.player_nick=this.name;this.clan="";this.last_online_date=this.last_online=this.join_date=null;this.bio="";this.inGame=false;this.prevServerID=0;this.model="sarge";this.skin="default";this.country="US";this.country_name="United States";this.node=e(this.name);this.icons=new PlayerIconSet("sarge","default");this.UpdateDetails=function(F){this.player_id=F.PLAYER_ID;this.name=this.player_nick=F.PLAYER_NICK;this.clan=F.PLAYER_CLAN||"";this.join_date=F.JOIN_DATE;this.last_online=F.LAST_ONLINE;
this.last_online_date=F.LAST_ONLINE_DATE;this.bio=F.BIO;this.icons=new PlayerIconSet(F.MODEL,F.SKIN);this.model=F.MODEL;this.skin=F.SKIN;this.country=F.COUNTRY_ABBREV;this.country_name=F.COUNTRY_NAME};this.DisplayChatIcon=function(){var F=a("<a href='#!profile/summary/"+this.player_nick+"'></a>").append(this.icons.small);this.node.find(".rosteritem-playericon").empty().append(F);F="<span class='player_name'>";if(this.clan)F+="<small>"+StripColors(this.clan)+"</small>";F+=this.player_nick;F+="</span>";
this.node.find(".rosteritem-name").html(F)};v&&this.UpdateDetails(v);this.CanDisplayOnRoster=function(){return this.presence!=z.Unavailable&&this.subscription==r.Both};this.IsSubscribed=function(){return this.subscription>=r.FromOut};this.IsInvited=function(){return this.subscription==r.NoneOut||this.subscription==r.To};this.IsOnline=function(){return this.presence!=z.Unavailable&&this.presence!=z.Unknown&&this.subscription==r.Both};this.StartInactivityTimeout=function(){this.timeoutHandle&&clearTimeout(this.timeoutHandle);
var F=this;this.timeoutHandle=setTimeout(function(){if(o.selectedContact!=F){if(F.group==g.Active){F.CanDisplayOnRoster()?F.UI_PlaceInGroup(g.Online):F.UI_RemoveFromGroup();F.timeoutHandle=null}}else F.StartInactivityTimeout()},18E4)};this.ReceivedMsg=function(F){this.UI_PlaceInGroup(g.Active);o.selectedContact==null&&o.SelectContact(this);this.history[this.history.length]={origin:1,msg:F,date:new Date};if(o.selectedContact==this){this.AppendToHistory(this.history[this.history.length-1]);o.ScrollChatToBottom()}else{this.unreadMsgCount++;
this.unreadMsgCount==1&&this.node.addClass("chat-unread")}this.StartInactivityTimeout()};this.SendMessage=function(F){quakelive.Tick();this.history[this.history.length]={origin:0,msg:F,date:new Date};this.AppendToHistory(this.history[this.history.length-1]);o.ScrollChatToBottom();this.group!=g.Active&&this.UI_PlaceInGroup(g.Active);this.StartInactivityTimeout();F=F.substring(0,2048);qz_instance.IM_SendMessage(this.jid.bare,F)};this.prevChatOrigin=-1;this.prevChatNode=null;this.AppendToHistory=function(F){var J=
"";if(quakelive.cvars.GetIntegerValue("web_chattimestamps")){J=ZeroPad(F.date.getMinutes());var Q=ZeroPad(F.date.getSeconds());J='<span class="chat-timestamp">('+F.date.getHours()+":"+J+":"+Q+")</span> "}if(this.prevChatOrigin!=F.origin){Q=a("<div></div>");if(F.origin==0){Q.attr("class","chat-history-me");Q.append(quakelive.mod_home.playericons.medium);Q.append("<h1>"+quakelive.username+"</h1>")}else{Q.attr("class","chat-history-them");Q.append(this.icons.medium);var aa=this.player_nick;if(this.broadcaster)aa=
aa.toUpperCase();Q.append("<h1>"+aa+"</h1>")}Q.append("<div>"+J+d(F.msg)+"</div>");this.prevChatNode=Q;t.node.find("#im-chat-body-bottom").before(this.prevChatNode);this.prevChatOrigin=F.origin}else this.prevChatNode.children("div").append("<br />"+J+d(F.msg))};this.FriendsContextMenuHandler=function(F,J){var Q=J.data("contact");switch(F){case "join":quakelive.Goto("join/"+Q.gameStatus.SERVER_ID);break;case "copy":qlPrompt({input:true,readonly:true,alert:true,title:"Link to this match",body:"Use the URL below to link to this match directly.",
inputLabel:quakelive.siteConfig.baseUrl+"/r/join/"+Q.gameStatus.PUBLIC_ID});break;case "send":o.SelectContact(Q);break;case "view":quakelive.Goto("profile/summary/"+Q.player_nick);break;case "invite":a.ajax({url:"/request/invite",type:"post",dataType:"json",data:{user:Q.player_nick,server_id:quakelive.currentServerId}});break;default:break}};this.InitContextMenu=function(){if(quakelive.siteConfig.showContextMenus){this.node.data("contact",this);var F=this;this.node.contextMenu({menu:"friendsContext",
inSpeed:0,outSpeed:0,onBeforeShow:function(J){F.inGame&&!F.gameStatus.BOT_GAME?J.enableContextMenuItems("#join"):J.disableContextMenuItems("#join");quakelive.IsGameRunning()&&quakelive.currentServerId?J.enableContextMenuItems("#invite"):J.disableContextMenuItems("#invite")}},this.FriendsContextMenuHandler)}};this.UI_PlaceInGroup=function(F,J){this.DisplayChatIcon();if(J||this.group!=F){var Q=this.group;this.UI_RemoveFromGroup();this.group=F;var aa=this;this.node.click(function(){o.SelectContact(aa)}).appendTo(t.node.find("#im-"+
F+" .itemlist"));this.InitContextMenu();t.UI_SortRoster(F);t.node.find("#im-"+F).show();this.UI_SetGameStatus(this.gameStatus);if(this.group==g.None&&o.selectedContact==aa){a("#chat-msg").attr({disabled:"disabled",value:"User is offline..."});a("#im-chat-send").hide()}else if(this.group==g.Online&&o.selectedContact==aa){a("#chat-msg").removeAttr("disabled");a("#chat-msg").val("");a("#im-chat-send").show()}if(!o.skipNotices&&this.group==g.Online&&(Q==g.Offline||Q==g.None))quakelive.notifier.Notify(quakelive.notifier.ContactPresenceNotice(this.player_nick,
this.icons))}};this.UI_RemoveFromGroup=function(){if(this.group!=g.None){!this.node[0].nextSibling&&!this.node[0].previousSibling&&t.node.find("#im-"+this.group).hide();this.node.detach();this.group=g.None}};this.UI_SetGameStatus=function(F){var J=this.node.children(".rosteritem-gameicon").empty();this.gameStatus=a.extend({},F);this.gameStatus.SERVER_ID=parseInt(this.gameStatus.SERVER_ID);this.gameStatus.BOT_GAME=parseInt(this.gameStatus.BOT_GAME);this.gameStatus.PUBLIC_ID=parseInt(this.gameStatus.PUBLIC_ID);
this.inGame=false;if(this.gameStatus.BOT_GAME||this.gameStatus.ADDRESS=="loopback"||this.gameStatus.ADDRESS=="bot"){this.inGame=true;F=a('<img src="'+quakelive.resource("/images/im/icon_botmatch.png")+'" style="cursor: pointer" id="icon_'+this.jid.username+'" />');quakelive.matchtip.BindBotTooltip(F,this.gameStatus);J.append(F)}else if(this.gameStatus.SERVER_ID>0){this.inGame=true;F=a('<img src="'+quakelive.resource("/images/im/icon_qz.png")+'" style="cursor: pointer" id="icon_'+this.jid.username+
'" />');quakelive.matchtip.BindMatchTooltip(F,this.gameStatus.SERVER_ID,{targetContext:this.jid.username});J.append(F);if(this.gameStatus.SERVER_ID!=0&&this.prevServerID!=this.gameStatus.SERVER_ID){this.prevServerID=this.gameStatus.SERVER_ID;quakelive.notifier.Notify(quakelive.notifier.FriendInGameNotice(this.player_nick,this.icons.modelskin,this.gameStatus.ADDRESS,this.gameStatus.SERVER_ID,this.gameStatus.MAP))}}else quakelive.matchtip.HideContextualMatchTooltip(this.jid.username)};this.OnSelected=
function(){this.node.addClass("rosteritem-selected");this.node.removeClass("chat-unread");this.unreadMsgCount=0;this.prevChatOrigin=-1;this.prevChatNode=null};this.OnDeselected=function(){this.node.removeClass("rosteritem-selected")}}function c(v,C,G,H,F){this.id=v;this.name=C;this.status=G;this.met=H;this.game=F;this.node=new e(this.name);this.icons=new PlayerIconSet("sarge","default");var J=this;a.ajax({url:"/friends/details/"+this.name,dataType:"json",success:function(Q){J.icons=new PlayerIconSet(Q.MODEL,
Q.SKIN);J.node.find(".rosteritem-playericon").html(J.icons.small)}});this.UI_PlaceInGroup=function(Q){this.node.click(function(){quakelive.Goto("profile/summary/"+this.name)}).appendTo(t.node.find("#im-"+Q+" .itemlist"));t.node.find("#im-"+Q).show()}}function e(v){this.name=v;v=a("<div class='rosteritem'></div>");v.append("<span class='rosteritem-playericon'></span>");v.append("<span class='rosteritem-name'>"+this.name+"</span>");v.append("<span class='rosteritem-gameicon'></span>");return v}function p(v){this.action=
v.action;this.packet=v.packet;this.type=v.type;this.value=v.value}function x(){var v=true,C=0;a(".qlv_inviteEmails > input").each(function(){if(a(this).val().length>0){if(!isEmailValid(a(this).val())){v=false;a(this).effect("highlight",{color:"#FF0000"},3E3)}C++}});if(C==0){v=false;a(".qlv_title:eq(1)").text("Entering an email address is the point of this procedure.")}else v||a(".qlv_title:eq(1)").text("The following don't seem to be email addresses.");return v}var t={},z={Unknown:0,Available:1,Chat:2,
Away:3,Dnd:4,Xa:5,Unavailable:6},r={None:0,NoneOut:1,NoneIn:2,NoneOutIn:3,To:4,ToIn:5,From:6,FromOut:7,Both:8},m="qlbroadcast@"+quakelive.siteConfig.xmppDomain,l={Allow:"allow",Deny:"deny"},q={StoreSuccess:0,ActivateSuccess:1,DefaultSuccess:2,RemoveSuccess:3,RequestNamesSuccess:4,RequestListsSuccess:5,Conflict:6,ItemNotFound:7,BadRequest:8,UnknownError:9},u=null,g={None:"",Online:"online",Offline:"offline",Active:"active",Recent:"recent"},o=t.roster=new (function(){this.selectedContact=null;this.pendingRequests=
[];this.fullRoster=[];this.rosterData={};this.ImportRoster=function(){var H;H=qz_instance.IM_GetRoster();H=quakelive.Eval(H)||{};this.UI_Show();for(var F in H){var J=H[F],Q=new b(F),aa=o.GetContactByJID(Q);if(!aa||!o.rosterData[aa.player_nick.toLowerCase()]){aa=new k(Q,J.NAME,J.SUBSCRIPTION,J.ONLINE?z.Available:z.Unavailable);o.AddContact(aa)}else{aa.name=J.NAME;aa.subscription=J.SUBSCRIPTION;aa.UpdateDetails(o.rosterData[aa.player_nick.toLowerCase()])}aa.CanDisplayOnRoster()&&aa.UI_PlaceInGroup(g.Online);
if(aa.subscription==r.From){J={};J.jid=F;o.AddPendingRequest(J)}}if(quakelive.activeModule==t)if(quakelive.pathParts[1]=="manage")t.LoadManageItems();else quakelive.pathParts[1]=="pending"&&t.LoadPending()};this.ImportRosterData=function(H){for(var F in H){var J=new b(F);quakelive.xmppClient.roster.AddItemDetails(J.username,H[F])}o.rosterData=H;o.ImportRoster();o.UI_OnRosterUpdated();o.DisplayChatAreaHelp();quakelive.SendModuleMessage("IM_OnRosterChanged")};this.emptyRoster=function(){for(var H=0;H<
this.fullRoster.length;++H)this.fullRoster[H].UI_RemoveFromGroup();o.fullRoster=[]};this.GetIndexByJID=function(H){for(var F=-1,J=0;J<this.fullRoster.length;++J)if(this.fullRoster[J].jid.bare==H.bare){F=J;break}return F};this.GetContactByJID=function(H){H=this.GetIndexByJID(H);return H!=-1?this.fullRoster[H]:null};this.GetIndexByName=function(H){var F=-1;H=H.toLowerCase();for(var J=0;J<this.fullRoster.length;++J)if(this.fullRoster[J].name.toLowerCase()==H){F=J;break}return F};this.AddContact=function(H){if(this.GetIndexByJID(H.jid)==
-1)this.fullRoster[this.fullRoster.length]=H};this.AddPendingRequest=function(H){H=new b(H.jid);for(var F=0;F<this.pendingRequests.length;++F)if(this.pendingRequests[F].bare==H.bare)break;if(F==this.pendingRequests.length)this.pendingRequests[this.pendingRequests.length]=H;quakelive.pathParts[0]=="friends"&&quakelive.pathParts[1]=="pending"&&t.UI_AddPendingItem(H,-1)};this.HasPendingRequests=function(){return this.pendingRequests.length>0?true:false};this.RemoveContactByName=function(H){this.RemoveContactByIndex(this.GetIndexByName(H))};
this.RemoveContactByJID=function(H){this.RemoveContactByIndex(this.GetIndexByJID(H))};this.RemoveContactByIndex=function(H){var F=null;if(H!=-1){F=this.fullRoster[H];this.selectedContact==F&&this.DeselectContact();this.fullRoster=RemoveArrayIndex(this.fullRoster,H)}F&&F.UI_RemoveFromGroup()};this.GetIncomingValues=function(){for(var H=[],F=0;F<this.pendingRequests.length;F++)H.push(this.pendingRequests[F].bare.split("@")[0]);return H};this.GetOutgoingValues=function(){for(var H=[],F=0;F<this.fullRoster.length;++F)this.fullRoster[F].IsInvited()&&
H.push(this.fullRoster[F].name.toLowerCase());return H};this.DeselectContact=function(){if(this.selectedContact!=null){t.node.find("#im-chat").remove();this.selectedContact.OnDeselected();this.selectedContact=null}this.DisplayChatAreaHelp()};this.DisplayChatAreaHelp=function(){var H=a("<div style='padding: 60px 20px; text-align: center; line-height: 22px'></div>"),F="";if(this.fullRoster.length>0){F=["Tip: You can join a friend who is playing Quake LIVE by clicking the <img src='"+quakelive.resource("/images/im/icon_qz.png")+
"' /> icon next to their name.","Tip: You can find new friends to add to your roster by browsing the <a href='#!profile/summary/"+quakelive.username+"'>QUAKE LIVE Profile</a> pages."];F=F[Math.floor(Math.random()*F.length)]}else F="Your friends list is empty. Use the <a href='#!friends'>Friends Manager</a> to add friends to your Quake LIVE account.";H.append(F);t.node.find("#im-footer").html(H)};this.BindChatEvents=function(H){t.node.find("#im-chat-close").click(function(){o.DeselectContact()});if(!H.isAdmin){var F=
function(){var Q=t.node.find("#chat-msg"),aa=Q.val();if(aa.length>0){H.SendMessage(aa);Q.val("")}t.node.find("#chat-msg").focus()},J=t.node.find("#chat-msg").keyup(function(Q){if(Q.keyCode==13){F();Q.preventDefault()}});quakelive.IsGameRunning()||J.focus();t.node.find("#im-chat-send").click(F)}};this.UnbindChatEvents=function(){t.node.find("#im-chat-close").unbind("click");t.node.find("#chat-msg").unbind("keyup");t.node.find("#im-chat-send").unbind("click")};this.SelectContact=function(H){if(this.selectedContact==
H)quakelive.IsGameRunning()||t.node.find("#chat-msg").focus();else{this.DeselectContact();this.selectedContact=H;H.OnSelected();H.isAdmin?t.node.find("#im-footer").html("<div id='im-chat'><div id='im-chat-close'></div><div id='im-chat-body'><div id='im-chat-body-bottom'></div></div></div>"):t.node.find("#im-footer").html("<div id='im-chat'><div id='im-chat-close'></div><div id='im-chat-body'><div id='im-chat-body-bottom'></div></div><input id='chat-msg' type='text' /><div id='im-chat-send'></div></div>");
this.UnbindChatEvents();this.BindChatEvents(H);for(var F=0;F<H.history.length;++F)H.AppendToHistory(H.history[F]);o.ScrollChatToBottom()}};this.ScrollChatToBottom=function(){t.node.find("#im-chat-body").scrollTop(1E7)};var v=["You can join a friend who is playing by clicking the QUAKE LIVE icon next to their name.","Your <a href='#!profile/summary/%PLAYER_NICK%'>QUAKE LIVE profile</a> displays your recent matches, awards, and <a href='#!profile/stats/%PLAYER_NICK%'>statistics.</a>"];this.GetOverlayTip=
function(){var H=v[Math.floor(Math.random()*v.length)];return H=H.replace(/%PLAYER_NICK%/g,quakelive.username)};this.SwapOverlayTip=function(){if(!(this.GetNumOnlineContacts()>0)){quakelive.IsGameRunning()||t.node.find("#im-overlay-footer").html("<p>"+this.GetOverlayTip()+"</p>");var H=this;setTimeout(function(){H.SwapOverlayTip()},3E4)}};var C=["QUAKE LIVE is free to play. <a href='javascript:;' onclick='quakelive.mod_register.ShowRegistration(); return false'>Join now</a> to get started!","QUAKE LIVE allows you to quickly get into a game with your friends. <a href='javascript:;' onclick='quakelive.mod_register.ShowRegistration(); return false'>Join now!</a>",
"QUAKE LIVE will match you with equally skilled players. <a href='javascript:;' onclick='quakelive.mod_register.ShowRegistration(); return false'>Click here to join!</a>"];this.GetPreLoginTip=function(){return C[Math.floor(Math.random()*C.length)]};this.SwapPreLoginTip=function(){if(!(a("#chatfill-footer").size()==0||quakelive.IsLoggedIn())){a("#chatfill-footer").html("<p>"+this.GetPreLoginTip()+"</p>");var H=this;setTimeout(function(){H.SwapPreLoginTip()},3E4)}};var G=this;quakelive.AddHook("OnLayoutLoaded",
function(){G.SwapPreLoginTip();G.UI_ShowVert()});this.ui_state="";this.ui_advert_started=this.ui_advert_shown=false;this.UI_Show=function(){var H="";H=this.GetNumOnlineContacts()>0?"friends":"nofriends";if(this.ui_advert_shown){if(H!=this.ui_state){switch(H){case "friends":this.UI_ShowApp();break;case "nofriends":this.UI_ShowOverlay();break}this.ui_state=H}}else this.UI_ShowVert()};this.UI_FinishAnimateVert=function(){if(this.ui_advert_handle){clearTimeout(this.ui_advert_handle);this.ui_advert_handle=
null}G.ui_advert_shown=true;G.UI_Show()};this.UI_StartAnimateVert=function(){var H=this;this.ui_advert_handle=setTimeout(function(){a("#spon_large_vert").animate({height:"0px"},750,"linear",function(){a("#spon_large_vert").remove();a("#spon_vert").show().css("overflow","hidden").css("height","0").animate({height:"260px"},325,"linear",function(){a("#post_spon_content").slideUp(0).slideDown(400);H.UI_FinishAnimateVert()})})},4E3)};this.UI_ShowVert=function(){if(!this.ui_advert_started){if(a("#spon_large_vert").length!=
0){this.ui_advert_started=true;var H=this,F=[];if(quakelive.IsLoggedIn())F[F.length]={zone:quakelive.VERT_ZONES.sidebar_half_page_ad,display:function(J,Q,aa){if(aa){a("#spon_large_vert").remove();a("#spon_vert,#spon_vert .ql_vert_frame,#post_spon_content").show();H.UI_FinishAnimateVert()}else{a("#spon_large_vert").empty().append(Q);H.UI_StartAnimateVert()}}};quakelive.FillVertList(F);quakelive.LoadVerts(F,{timeout:1500})}quakelive.HookVertLoading()}};this.UI_ShowOverlay=function(){t.node.html("<div id='im-overlay-header'></div><div id='im-overlay-body'><p>Finding friends and opponents is EASY!  <a href='#!friends/search'>Click here to start your search.</a><a class='btn_friends' href='#!friends/search'></a>Click the button above to access the friends manager and <a href='#!friends/search'>add more players to your friends list</a>.</div><div id='im-overlay-footer'></div>");
this.SwapOverlayTip();t.FitToParent()};this.UI_ShowApp=function(){t.node.html(t.TPL_FRIENDS_LIST);for(var H in this.fullRoster){var F=this.fullRoster[H];F.CanDisplayOnRoster()&&F.group!=g.None&&F.UI_PlaceInGroup(F.group,true)}t.FitToParent()};this.GetNumOnlineContacts=function(){var H=0;for(var F in this.fullRoster)this.fullRoster[F].CanDisplayOnRoster()&&H++;return H};this.UI_OnRosterUpdated=function(){var H=this.GetNumOnlineContacts();this.UI_Show();if(H>0)t.node.find("#im-header").html("<span>"+
H+" friend"+(H==1?"":"s")+" online</span>")}}),y=t.privlist=new (function(v){this.listname=v;this.privItems=[];this.ImportPrivList=function(C){this.privItems.length=0;for(var G=false,H=false,F=0;F<C.items.length;F++)if(C.items[F].type=="subscription")G=true;else if(C.items[F].type=="jid"&&C.items[F].value==m)H=true;else this.AddItem(new p(C.items[F]));G&&H?qz_instance.IM_ActivatePrivacyList("quakelive"):this.SaveList()};this.AddItem=function(C){if(this.GetIndexByValue(C.value)==-1)this.privItems[this.privItems.length]=
C};this.RemoveItemByValue=function(C){C=this.GetIndexByValue(C);if(C!=-1)this.privItems=RemoveArrayIndex(this.privItems,C)};this.GetIndexByValue=function(C){for(var G=-1,H=0;H<this.privItems.length;++H)if(this.privItems[H].value==C){G=H;break}return G};this.GetItemByValue=function(C){C=this.GetIndexByValue(C);return C!=-1?this.privItems[C]:null};this.GetValueList=function(){for(var C=[],G=0;G<this.privItems.length;++G)C.push(this.privItems[G].value.split("@")[0]);return C};this.SaveList=function(){var C=
{};C.items=this.privItems;C.name="quakelive";C.items[this.privItems.length]={type:"jid",action:l.Allow,value:m,packet:1};C.items[this.privItems.length]={type:"subscription",action:l.Deny,value:"none",packet:1};qz_instance.IM_SetPrivacyList("quakelive",JSON.stringify(C));qz_instance.IM_ActivatePrivacyList("quakelive")};this.BlockUser=function(C){var G=this.GetIndexByValue(C);if(G>-1)this.privItems[G].action=l.Deny;else{C=new b(C.toLowerCase());this.AddItem(new p({type:"jid",action:l.Deny,packet:15,
value:C.bare}))}this.SaveList()};this.UnblockUser=function(C){this.GetIndexByValue(C);this.RemoveItemByValue((new b(C.toLowerCase())).bare);this.SaveList()}})("quakelive");t.Init=function(){t.node=a("<div id='im'></div>")};t.LAYOUT="postlogin";t.TITLE="Friends";t.ShowContent=function(v){a("#qlv_contentBody").html(v);v="";switch(quakelive.pathParts[1]){case "manage":v="No Friends to Manage";t.UI_SetupEmptyMessage(v);t.LoadManageItems();break;case "incoming":v="No Invites Received";t.UI_SetupEmptyMessage(v);
t.LoadIncoming();break;case "outgoing":v="No Invites Outstanding";t.UI_SetupEmptyMessage(v);t.LoadOutgoing();break;case "search":if(quakelive.pathParts[2])switch(quakelive.pathParts[2]){case "email":t.UI_SetupSearchContacts();break;case "invite":t.UI_SetupInvite();break}else t.UI_SetupSearchKeyword();break;case "unblock":v="No Players Blocked";t.UI_SetupEmptyMessage(v);t.LoadBlockItems();break}};t.LoadManageItems=function(){if(o.fullRoster.length==0)a("#fr_empty").show();else for(var v=0;v<o.fullRoster.length;v++)o.fullRoster[v].IsSubscribed()&&
t.UI_AddManagedItem(o.fullRoster[v])};t.LoadIncoming=function(){a.ajax({url:"/friends/outgoing/items",type:"POST",data:{users:JSON.stringify(o.GetIncomingValues())},dataType:"json",success:function(v){if(v.ECODE==0)if(v.PENDING.length==0)a("#fr_empty").show();else{a(".prf_friend").remove();for(var C=0;C<v.PENDING.length;C++)t.UI_AddIncomingItem(v.PENDING[C])}}})};t.LoadOutgoing=function(){a.ajax({url:"/friends/outgoing/items",type:"POST",data:{users:JSON.stringify(o.GetOutgoingValues())},dataType:"json",
success:function(v){if(v.ECODE==0)if(v.PENDING.length==0)a("#fr_empty").show();else for(var C=0;C<v.PENDING.length;C++)t.UI_AddOutgoingItem(v.PENDING[C])}})};t.LoadBlockItems=function(){y.privItems.length>0?a.ajax({url:"/friends/unblock/items",type:"POST",data:{users:JSON.stringify(y.GetValueList())},dataType:"json",success:function(v){if(v.ECODE==0)if(v.BLOCKED.length==0)a("#fr_empty").show();else for(var C=0;C<v.BLOCKED.length;C++)t.UI_AddBlockedItem(v.BLOCKED[C])}}):a("#fr_empty").show()};t.FitToParent=
function(){var v={"#im-body":250,"#im-overlay-body":116},C=t.node.parent().innerHeight();for(var G in v)if(C==undefined)t.node.find(G).css("height","0px");else{var H=C-v[G];t.node.find(G).css("height",H+"px")}};t.MoveTo=function(v){v=a(v);var C=a("#im-chat-body").get(0),G=0;if(C!==undefined)G=C.scrollTop;t.node.parentNode&&t.node.detach();t.node.appendTo(v);if(C!==undefined)C.scrollTop=G;setTimeout(function(){t.FitToParent()},100)};t.IsOnRoster=function(v){return o.GetIndexByName(v)!=-1};t.IsBlocked=
function(v){if(!y.privItems.length>0)return false;v=v.toLowerCase();v=new b(v);var C=y.GetItemByValue(v.bare);if(C!=null)if(C.type=="jid"&&C.value==v.bare)return true;return false};t.BlockPlayer=function(v){y.BlockUser(v+"@"+quakelive.siteConfig.xmppDomain)};t.UnblockPlayer=function(v){y.UnblockUser(v+"@"+quakelive.siteConfig.xmppDomain)};t.GetRecentPlayers=function(){a.ajax({url:"/friends/recent",dataType:"json",success:function(v){if(v.PLAYERS!="NO_DATA"){var C=v.PLAYERS;C.sort(function(G,H){var F=
G.PLAYER_NICK,J=H.PLAYER_NICK;return F<J?-1:F>J?1:0});for(i=0;i<C.length;i++)(new c(v.PLAYERS[i].PLAYER_ID,v.PLAYERS[i].PLAYER_NICK,v.PLAYERS[i].STATUS,v.PLAYERS[i].DATE_MET,v.PLAYERS[i].PUBLIC_ID)).UI_PlaceInGroup(g.Recent)}}})};t.ImportRosterData=function(){a.ajax({url:"/friends/manage/items",dataType:"json",success:o.ImportRosterData})};t.ValidateSubscribe=function(v){a.ajax({url:"/friends/validate/"+v,dataType:"text",mode:"queue",port:"friends",success:function(C){C>0&&quakelive.mod_friends.Subscribe(v)}})};
t.SendMailInvites=function(){if(x()){var v=[];a(".qlv_inviteEmails > input").each(function(){a(this).val().length>0&&v.push(a(this).val())});a.ajax({url:"/friends/mail",type:"POST",dataType:"json",data:"emails="+JSON.stringify(v)+"&subject="+a(".qlv_inviteSubject").val()+"&msg="+a(".qlv_inviteMessage").val(),success:function(){a(".qlv_inviteEmails > input").length==1?a(".qlv_title:eq(1)").text("Invite sent!"):a(".qlv_title:eq(1)").text("Invites sent!");a(".qlv_title:eq(1)").show();a(".qlv_inviteEmails > input:gt(0)").remove();
a(".qlv_inviteEmails > input:eq(0)").val("");a(".qlv_inviteSubject").val("");a(".qlv_inviteMessage").val("")}})}else a(".qlv_title:eq(1)").show()};t.SendSearchKeywordRequest=function(v,C){a.ajax({url:"/friends/search_items/"+v+"/100/1/"+C,dataType:"json",success:function(G){if(G.ECODE==0){var H=G.MSG;G=G.MSG.PLAYERS;var F=true;a(".qlv_resultsTable > tbody").empty();a(".qlv_searchFormResultsSummary").text(H.COUNT+' Member(s) found containing "'+jQuery.trim(a(".qlv_keywordInput").val())+'".');a(".qlv_keywordInput").val("");
H.COUNT>0?a(".qlv_resultsListNA").hide():a(".qlv_resultsListNA").show();for(H=0;H<G.length;H++){var J;J=F==true?a('<tr class="odd"></tr>'):a("<tr></tr>");var Q=new PlayerIconSet(G[H].MODEL,G[H].SKIN);J.append("<td></td>");J.find("td").append(Q.small);J.append("<td>"+G[H].PLAYER_NICK+"</td>");G[H].STATUS==1?J.append('<td><img alt="" src="'+quakelive.resource("/images/sf/friends/online_icon.gif")+'"/></td>'):J.append("<td></td>");J.append("<td>"+FormatTimeDelta(G[H].LAST_ONLINE)+"</td>");J.append("<td>"+
(G[H].FNAME||"")+"</td>");J.append('<td><a class="qlv_btnSearchView" href="#!profile/summary/'+G[H].PLAYER_NICK+'" /></td>');if(t.IsOnRoster(G[H].PLAYER_NICK.toLowerCase())||G[H].PLAYER_NICK.toLowerCase()==quakelive.username.toLowerCase())J.append('<td><img alt="" src="'+quakelive.resource("/images/sf/friends/plus_icon_gray.gif")+'"/></td>');else{Q=a('<a class="qlv_btnSearchAdd" href="javascript:;" onclick="quakelive.mod_friends.Subscribe(\''+G[H].PLAYER_NICK.toLowerCase()+"');\" />");Q.click(function(){a(this).parent("td").parent("tr").effect("pulsate",
{times:1},1E3);a(this).replaceWith('<img src="'+quakelive.resource("/images/sf/friends/plus_icon_gray.gif")+'"/>');a(this).attr("onclick","");a(this).unbind();return false});Q=a("<td></td>").append(Q);J.append(Q)}a(".qlv_resultsTable > tbody").append(J);F==true?F=false:F=true}}}})};t.AnswerSubscriptionRequest=function(v,C){for(var G=v.split("@")[0],H=o.pendingRequests,F=0;F<H.length;++F)if(H[F].username==G)break;o.pendingRequests=RemoveArrayIndex(H,F);if(quakelive.pathParts[0]=="friends"&&(quakelive.pathParts[1]==
"incoming"||quakelive.pathParts[1]=="outgoing"))t.UI_RemoveItem(v);qz_instance.IM_AnswerSubscribeRequest(G,C)};t.Subscribe=function(v){v.toLowerCase()!=quakelive.username.toLowerCase()&&qz_instance.IM_Subscribe(v)};t.Unsubscribe=function(v){v=new b(v);qz_instance.IM_Unsubscribe(v.bare)};t.IM_GetPrivacyListNames=function(){qz_instance.IM_GetPrivacyListNames()};t.IM_GetPrivacyList=function(v){qz_instance.IM_GetPrivacyList(v)};t.IM_RemovePrivacyList=function(v){qz_instance.IM_RemovePrivacyList(v)};t.UI_SetupEmptyMessage=
function(v){a("#qlv_friendListContainer").append('<p id="fr_empty" style="display:none;" class="tc thirtyPxTxt sixtypxv midGrayTxt">'+v+"</p>")};t.UI_AddManagedItem=function(v){a("#fr_empty").hide();var C=t.TPL_MANAGE_ITEM;C=jQuery(C);C.attr("id",v.jid.bare);C.find(".head_icon").empty().append(BuildPlayerIcon(v.model+"_"+v.skin,"lg"));C.find(".player_name > a").html("<span class='clan'>"+StripColors(v.clan)+"</span>"+v.player_nick);C.find(".player_name > img").attr("src",quakelive.resource("/images/flags/"+
v.country.toLowerCase()+".gif"));C.find(".player_name > img").attr("title",v.country_name);if(v.IsOnline()){C.find(".online").show();C.find(".info_left").html("<b>Online Now!</b>")}else C.find(".info_left").html('<b>Last online:</b> <span title="'+v.last_online_date+'">'+FormatTimeDelta(v.last_online)+" ago</span>");if(v.bio)C.find(".info_middle").html(v.bio);else{C.find(".info_middle").html("<b>This person has no bio entered yet.  </b>");C.find(".info_middle > b").after('To view more data on this user click the "view profile" button.')}C.find(".head_icon").click(function(){quakelive.Goto("profile/summary/"+
v.name)});C.find(".player_name > a").attr("href","#!profile/summary/"+v.name);C.find(".btn_fr_view_profile").attr("href","#!profile/summary/"+v.name);C.find(".btn_fr_delete_friend").click(function(){if(confirm("Are you sure you want to remove this friend?")){t.UI_RemoveItem(v.jid.bare);t.Unsubscribe(v.jid.bare)}});a("#qlv_friendListContainer").append(C)};t.UI_AddIncomingItem=function(v){a("#fr_empty").hide();var C=t.TPL_INCOMING_ITEM;C=jQuery(C);var G=new b(v.PLAYER_NICK.toLowerCase());C.attr("id",
G.bare);C.find(".head_icon").empty().append(BuildPlayerIcon(v.MODEL+"_"+v.SKIN,"lg"));C.find(".player_name > a").html("<span class='clan'>"+StripColors(v.PLAYER_CLAN)+"</span>"+v.PLAYER_NICK);C.find(".player_name > img").attr("src",quakelive.resource("/images/flags/"+v.COUNTRY_ABBREV.toLowerCase()+".gif"));C.find(".player_name > img").attr("title",v.COUNTRY_NAME);if(v.STATUS==1){C.find(".online").show();C.find(".info_left").html("<b>Online Now!</b>")}else C.find(".info_left").html('<b>Last online:</b> <span title="'+
v.LAST_ONLINE_DATE+'">'+FormatTimeDelta(v.LAST_ONLINE)+" ago</span>");C.find(".head_icon").click(function(){quakelive.Goto("profile/summary/"+v.PLAYER_NICK)});C.find(".player_name > a").attr("href","#!profile/summary/"+v.PLAYER_NICK);C.find(".btn_fr_view_profile").attr("href","#!profile/summary/"+v.PLAYER_NICK);C.find(".btn_fr_accept_invite").click(function(){t.AnswerSubscriptionRequest(G.bare,true)});C.find(".btn_fr_decline_invite").click(function(){t.AnswerSubscriptionRequest(G.bare,false)});C.find(".btn_fr_block_player").click(function(){y.BlockUser(G.bare);
t.AnswerSubscriptionRequest(G.bare,false)});a("#qlv_friendListContainer").append(C)};t.UI_AddOutgoingItem=function(v){a("#fr_empty").hide();var C=t.TPL_OUTGOING_ITEM;C=jQuery(C);var G=new b(v.PLAYER_NICK.toLowerCase());C.attr("id",G.bare);C.find(".head_icon").empty().append(BuildPlayerIcon(v.MODEL+"_"+v.SKIN,"lg"));C.find(".player_name > a").html("<span class='clan'>"+StripColors(v.PLAYER_CLAN)+"</span>"+v.PLAYER_NICK);C.find(".player_name > img").attr("src",quakelive.resource("/images/flags/"+v.COUNTRY_ABBREV.toLowerCase()+
".gif"));C.find(".player_name > img").attr("title",v.COUNTRY_NAME);if(v.STATUS==1){C.find(".online").show();C.find(".info_left").html("<b>Online Now!</b>")}else C.find(".info_left").html('<b>Last online:</b> <span title="'+v.LAST_ONLINE_DATE+'">'+FormatTimeDelta(v.LAST_ONLINE)+" ago</span>");if(v.BIO)C.find(".info_middle").html(v.BIO);else{C.find(".info_middle").html("<b>This person has no bio entered yet.  </b>");C.find(".info_middle > b").after('To view more data on this user click the "view profile" button.')}C.find(".head_icon").click(function(){quakelive.Goto("profile/summary/"+
v.PLAYER_NICK)});C.find(".player_name > a").attr("href","#!profile/summary/"+v.PLAYER_NICK);C.find(".btn_fr_view_profile").click(function(){quakelive.Goto("profile/summary/"+v.PLAYER_NICK)});C.find(".btn_fr_revoke_invite").click(function(){t.UI_RemoveItem(G.bare);t.Unsubscribe(G.bare)});a("#qlv_friendListContainer").append(C)};t.UI_AddBlockedItem=function(v){a("#fr_empty").hide();var C=t.TPL_BLOCK_ITEM;C=jQuery(C);var G=new b(v.PLAYER_NICK.toLowerCase());C.attr("id",G.bare);C.find(".head_icon").empty().append(BuildPlayerIcon(v.MODEL+
"_"+v.SKIN,"lg",{gray:true}));C.find(".player_name > a").text(StripColors(v.PLAYER_CLAN)+v.PLAYER_NICK);C.find(".player_name > img").attr("src",quakelive.resource("/images/flags/"+v.COUNTRY_ABBREV.toLowerCase()+".gif"));C.find(".player_name > img").attr("title",v.COUNTRY_NAME);if(v.STATUS==1){C.find(".online").show();C.find(".info_left").html("<b>Online Now!</b>")}else C.find(".info_left").html('<b>Last online:</b> <span title="'+v.LAST_ONLINE_DATE+'">'+FormatTimeDelta(v.LAST_ONLINE)+" ago</span>");
if(v.BIO)C.find(".info_middle").html(v.BIO);else{C.find(".info_middle").html("<b>This person has no bio entered yet.  </b>");C.find(".info_middle > b").after('To view more data on this user click the "view profile" button.')}C.find(".head_icon").click(function(){quakelive.Goto("profile/summary/"+G.username)});C.find(".player_name > a").attr("href","#!profile/summary/"+G.username);C.find(".btn_fr_view_profile").click(function(){quakelive.Goto("profile/summary/"+G.username)});C.find(".btn_fr_unblock_player").click(function(){y.UnblockUser(G.bare);
t.UI_RemoveItem(G.bare)});a("#qlv_friendListContainer").append(C)};t.UI_RemoveItem=function(v){a('div[id="'+v+'"]').remove();a("#qlv_friendListContainer").children("div").length==0&&a("#fr_empty").show()};t.REMOTE_CONTACTS=[];t.LOCAL_CONTACTS=[];t.InviteRemoteContacts=function(v){v.length>0&&a.ajax({url:"/friends/social/invite",type:"POST",dataType:"json",data:"emails="+v,success:t.UI_RemoteInviteSuccess})};t.UI_RemoteInviteSuccess=function(v){var C="";C=v.COUNT==0||v.COUNT>1?v.COUNT+" Invites Sent":
v.COUNT+" Invite Sent";a(".qlv_resultsListNA").text(C);setTimeout(function(){self.close()},4E3)};t.UI_ResetContactSearch=function(){quakelive.Goto("friends/social");t.LOCAL_CONTACTS=[];t.REMOTE_CONTACTS=[]};t.IsLocalContact=function(v){var C=-1;v=v.toLowerCase();for(var G=0;G<t.LOCAL_CONTACTS.length;++G)if(t.LOCAL_CONTACTS[G].EMAIL.toLowerCase()==v){C=G;break}return C};t.UI_SearchContactRemote=function(){var v=t.TPL_SEARCH_EMAIL_REMOTE,C=t.REMOTE_CONTACTS,G=true;a(".qlv_resultsBody").empty();a(".qlv_resultsBody").html(v);
a("#qlv_selectAllEmail").click(function(){if(a("#qlv_selectAllEmail").attr("checked")==true)a(".qlv_emailInviteItem:not(:disabled)").attr("checked",true);else a("#qlv_selectAllEmail").attr("checked")==false&&a(".qlv_emailInviteItem:not(:disabled)").attr("checked",false)});a(".qlv_invitebutton").click(function(){var F=[];a(".qlv_emailInviteItem:checked").each(function(){F.push(this.value)});a(".qlv_resultsListNA").text("Sending Invites");a(".qlv_resultsListNA").show();a(".qlv_resultsTable").hide();
t.InviteRemoteContacts(JSON.stringify(F));t.REMOTE_CONTACTS=[];t.LOCAL_CONTACTS=[]});a(".qlv_skipbutton > a").click(function(){self.close()});for(v=0;v<C.length;v++)if(t.IsLocalContact(C[v].email)<0){var H=a("<tr></tr>");G==true&&H.addClass("odd");H.append('<td width="39"><div align="center"><input type="checkbox" value="'+C[v].email+'" class="qlv_emailInviteItem" /></div></td>');H.append("<td></td>");H.append('<td width="493">'+C[v].name+"</td>");H.append("<td></td>");a(".qlv_resultsTable > tbody:last").append(H);
G==true?G=false:G=true}};t.UI_SearchContactSuccess=function(v,C,G){a(".qlv_password").val("");if(v.LOCAL_LENGTH>0||v.REMOTE_LENGTH>0){window.resizeTo(700,800);window.location="http://"+document.domain+"/friends/social/b/"+C+"/"+G+window.location.search}else{a(".qlv_resultsListNA").text("No Results");a(".qlv_resultsListNA").effect("highlight",{color:"#FF0000"},3E3)}};t.UI_SearchContactError=function(v){if(v.FIELDS){v=v.FIELDS;for(var C=0;C<v.length;C++)switch(v[C]){case "account":break;case "domain":a(".qlv_email_server").effect("highlight",
{color:"#FF0000"},3E3);break;case "network":break;case "pw":a(".qlv_password").effect("highlight",{color:"#FF0000"},3E3);break;case "user":a(".qlv_email_user").effect("highlight",{color:"#FF0000"},3E3);break;default:break}a(".qlv_resultsListNA").text("Error with flashing fields.")}else if(v.MSG){v=v.MSG;a(".qlv_resultsListNA").text(v)}a(".qlv_resultsListNA").effect("highlight",{color:"#FF0000"},3E3)};t.UI_SetupSearchContacts=function(){var v={url:"/friends/social/search",type:"POST",dataType:"json",
success:function(C){C.ECODE==0?t.UI_SearchContactSuccess(C,a(".qlv_network").val(),a(".qlv_email_user").val()):t.UI_SearchContactError(C)},beforeSubmit:function(){a(".qlv_resultsListNA").text("Searching...")}};a("#socialform").ajaxForm(v);a(".qlv_findFriendsBtn").click(function(){a(".qlv_resultsTable > tbody").empty();a(".qlv_resultsListNA").show();a(".qlv_resultsListNA").text("Searching...");a("#socialform").submit()})};t.UI_SetupContactInvite=function(){a(".qlv_email_user").val("");a(".qlv_password").val("");
a(".qlv_network").attr("disabled","true");a(".qlv_email_user").attr("disabled","true");a(".qlv_password").attr("disabled","true");a(".qlv_findFriendsBtn").attr("disabled","true");var v=quakelive.Eval(a("#contacts_json").html())||[];t.LOCAL_CONTACTS=v.LOCAL;t.REMOTE_CONTACTS=v.REMOTE;v=t.LOCAL_CONTACTS;a("#qlv_selectAllEmail").click(function(){if(a("#qlv_selectAllEmail").attr("checked")==true)a(".qlv_emailInviteItem:not(:disabled)").attr("checked",true);else a("#qlv_selectAllEmail").attr("checked")==
false&&a(".qlv_emailInviteItem:not(:disabled)").attr("checked",false)});a(".qlv_invitebutton > a").click(function(){a(".qlv_emailInviteItem").each(function(){if(this.checked==true&&this.disabled==false){var J=a(this).attr("id");a(this).attr("disabled","true");var Q=a(this).parent("td").parent("tr");Q.effect("pulsate",{times:1},1E3);Q.find(".qlv_btnSearchAdd").replaceWith('<img src="'+quakelive.resource("/images/sf/friends/plus_icon_gray.gif")+'"/>');t.Subscribe(J)}});t.REMOTE_CONTACTS.length>0&&t.UI_SearchContactRemote();
return false});var C=true;if(t.LOCAL_CONTACTS.length>0){a(".qlv_resultsListNA").hide();for(var G=0;G<v.length;G++){var H=a("<tr></tr>");C==true&&H.addClass("odd");v[G].STATUS==1&&H.addClass("online");var F=new PlayerIconSet(v[G].MODEL,v[G].SKIN);H.append('<td><input id="'+v[G].PLAYER_NICK.toLowerCase()+'" class="qlv_emailInviteItem" type="checkbox" /></td>');H.append("<td></td>");H.find("td:last").append(F.small);H.append("<td>"+v[G].PLAYER_NICK+"</td>");v[G].STATUS==1?H.append('<td><img alt="" src="'+
quakelive.resource("/images/sf/friends/online_icon.gif")+'"/></td>'):H.append("<td></td>");H.append("<td>"+FormatTimeDelta(v[G].LAST_ONLINE)+"</td>");H.append("<td>"+v[G].FNAME+"</td>");H.append('<td><a class="qlv_btnSearchView" href="javascript:;" onclick="self.opener.quakelive.Goto(\'profile/summary/'+v[G].PLAYER_NICK+"'); return false\" /></td>");if(self.opener.quakelive.mod_friends.IsOnRoster(v[G].PLAYER_NICK.toLowerCase())||v[G].PLAYER_NICK.toLowerCase()==quakelive.username.toLowerCase()){H.append('<td><img alt="" src="'+
quakelive.resource("/images/sf/friends/plus_icon_gray.gif")+'"/></td>');H.find(".qlv_emailInviteItem").attr("disabled","true")}else{F=a('<a class="qlv_btnSearchAdd" href="javascript:;" onclick="self.opener.quakelive.mod_friends.Subscribe(\''+v[G].PLAYER_NICK.toLowerCase()+"');\" />");F.click(function(){a(this).parent("td").parent("tr").find(".qlv_emailInviteItem").attr("disabled","true");a(this).parent("td").parent("tr").effect("pulsate",{times:1},1E3);a(this).replaceWith('<img src="'+quakelive.resource("/images/sf/friends/plus_icon_gray.gif")+
'"/>');a(this).attr("onclick","");a(this).unbind();return false});F=a("<td></td>").append(F);H.append(F)}a(".qlv_resultsTable > tbody").append(H);C==true?C=false:C=true}}else t.UI_SearchContactRemote();if(t.REMOTE_CONTACTS.length>0){a(".qlv_skipbutton").show();a(".qlv_skipbutton > a").click(function(){t.UI_SearchContactRemote()})}};t.UI_SetupInvite=function(){a(".qlv_plusOption > a").click(function(){a(".qlv_inviteEmails > input:last").after('<input type="text" class="qlv_textfield" />')});a(".qlv_invitebutton > a").click(function(){t.SendMailInvites()})};
t.UI_PerformSearch=function(v){var C=a(".qlv_keywordInput").val();C.length>0&&t.SendSearchKeywordRequest(C,v)};t.UI_SetupSearchKeyword=function(){a(".qlv_keywordInput").focus();a(".qlv_keywordButtonEmail").click(function(){t.UI_PerformSearch("EMAIL");return false});a(".qlv_keywordButtonLastName").click(function(){t.UI_PerformSearch("LNAME");return false});a(".qlv_keywordButtonNameTag").click(function(){t.UI_PerformSearch("PLAYER_NICK");return false})};t.UI_SortRoster=function(v){a.each(t.node.find("#im-"+
v+" .itemlist div"),function(C,G){a.each(t.node.find("#im-"+v+" .itemlist div"),function(H,F){a(G).find(">span.rosteritem-name").text().toLowerCase()<a(F).find(">span.rosteritem-name").text().toLowerCase()&&a(F).before(G)})})};quakelive.AddHook("IM_OnRosterFilled",function(){o.skipNotices=true;o.emptyRoster();t.ImportRosterData();t.IM_GetPrivacyList("quakelive");setTimeout(function(){o.pendingRequests.length>0&&quakelive.notifier.Notify(quakelive.notifier.PendingInviteSummaryNotice(o.pendingRequests.length));
o.skipNotices=false},6E3)});window.IM_OnMessage=function(v){quakelive.SendModuleMessage("IM_OnMessage",v);v=quakelive.Eval(v);var C=new b(v.who),G=o.GetContactByJID(C);if(!G){G=new k(C,C.username,z.Available);G.subscription=r.Both;o.AddContact(G)}if(v.to=="all@broadcast."+quakelive.siteConfig.xmppDomain){G.icons.small="<img src='"+quakelive.resource("/images/idlogo_sm.png")+"' width='18' height='18' style='border: 1px solid transparent' />";G.icons.medium="<img src='"+quakelive.resource("/images/idlogo_md.png")+
"' width='30' height='30' style='border: 1px solid transparent' />";G.icons.large="<img src='"+quakelive.resource("/images/idlogo_lg.png")+"' width='43' height='43' style='border: 1px solid transparent' />";G.broadcaster=true;G.player_nick=G.player_nick.toUpperCase();G.DisplayChatIcon();qlBroadcast({body:"Global announcement from QUAKE LIVE: "+v.what})}G.ReceivedMsg(v.what)};window.IM_OnPresence=function(v){quakelive.SendModuleMessage("IM_OnPresence",v);if(v=quakelive.Eval(v)){var C=new b(v.who),
G=o.GetContactByJID(C);if(!G){G=new k(C,C.username,r.Both,v.presence);o.AddContact(G)}C=quakelive.Eval(v.status);G.UI_SetGameStatus(C);G.presence=v.presence;G.CanDisplayOnRoster()?G.UI_PlaceInGroup(g.Online):G.UI_PlaceInGroup(g.None);o.UI_OnRosterUpdated()}};window.IM_OnSubscribeRequest=function(v){quakelive.SendModuleMessage("IM_OnSubscribeRequest",v);var C=quakelive.Eval(v);o.AddPendingRequest(C);if(!o.skipNotices){v=new b(C.jid);a.ajax({url:"/friends/details/"+v.username,dataType:"json",success:function(G){var H=
(G.MODEL+"_"+G.SKIN).toLowerCase();quakelive.notifier.Notify(quakelive.notifier.PendingInviteNotice(C.jid,G.PLAYER_NICK,H));quakelive.pathParts[0]=="friends"&&quakelive.pathParts[1]=="incoming"&&t.UI_AddIncomingItem(G)}})}};window.IM_OnItemAdded=function(v){quakelive.SendModuleMessage("IM_OnItemAdded",v);if(v=quakelive.Eval(v)){var C=new b(v.jid),G=new k(C,C.username,r.None,z.Unavailable);a.ajax({url:"/friends/details/"+v.jid.split("@")[0],dataType:"json",success:function(H){H.ECODE==0&&G.UpdateDetails(H)}});
o.AddContact(G)}};window.IM_OnItemRemoved=function(v){quakelive.SendModuleMessage("IM_OnItemRemoved",v);if(v=quakelive.Eval(v)){o.RemoveContactByJID(new b(v.jid));o.UI_OnRosterUpdated();if(quakelive.pathParts[0]=="friends"&&quakelive.pathParts[1]=="manage"){t.UI_RemoveItem(v.jid);o.fullRoster.length<1&&quakelive.Goto("friends/search")}quakelive.SendModuleMessage("IM_OnRosterChanged")}};window.IM_OnItemSubscribed=function(v){quakelive.SendModuleMessage("IM_OnItemSubscribed",v);if(v=quakelive.Eval(v)){var C=
o.GetContactByJID(new b(v.jid));if(C){C.subscription=v.subscription;o.UI_Show();o.UI_OnRosterUpdated();quakelive.pathParts[0]=="friends"&&quakelive.pathParts[1]=="manage"&&t.UI_AddManagedItem(C);quakelive.SendModuleMessage("IM_OnRosterChanged")}}};window.IM_OnItemUnsubscribed=function(v){quakelive.SendModuleMessage("IM_OnItemUnsubscribed",v);if(v=quakelive.Eval(v)){var C=o.GetContactByJID(new b(v.jid));if(C){C.subscription=v.subscription;o.UI_OnRosterUpdated();C.UI_PlaceInGroup(g.None);quakelive.SendModuleMessage("IM_OnRosterChanged")}}};
window.IM_OnItemUpdated=function(v){quakelive.SendModuleMessage("IM_OnItemUpdated",v);if(v=quakelive.Eval(v)){var C=o.GetContactByJID(new b(v.jid));if(C){C.subscription=v.subscription;if(C.subscription==r.Both){C.CanDisplayOnRoster()&&C.UI_PlaceInGroup(g.Online);o.UI_OnRosterUpdated()}quakelive.SendModuleMessage("IM_OnRosterChanged")}}};window.IM_OnPrivacyNames=function(v){quakelive.SendModuleMessage("IM_OnPrivacyNames",v)};window.IM_OnPrivacyList=function(v){quakelive.SendModuleMessage("IM_OnPrivacyList",
v);y.ImportPrivList(quakelive.Eval(v)||null)};window.IM_OnPrivacyChanged=function(v){quakelive.SendModuleMessage("IM_OnPrivacyChanged",v);t.IM_GetPrivacyList(v)};window.IM_OnPrivacyResult=function(v){quakelive.SendModuleMessage("IM_OnPrivacyResult",v);switch((quakelive.Eval(v)||{}).result){case q.StoreSuccess:y.privItems.length==0&&t.IM_GetPrivacyList("quakelive");break;case q.ActivateSuccess:break;case q.DefaultSuccess:break;case q.RemoveSuccess:u=null;break;case q.ItemNotFound:y.privItems.length==
0&&y.SaveList();u=null;break}};window.IM_OnSelfPresence=function(v){quakelive.SendModuleMessage("IM_OnSelfPresence",v)};window.IM_OnConnectFail=function(){quakelive.SendModuleMessage("IM_OnConnectFail");var v="We're sorry, but it appears you are having problems connecting to the QUAKE LIVE network. If you are behind a firewall you must make sure that it permits the following connection:<br /><br />Protocol: TCP<br />Host: "+quakelive.siteConfig.xmppDomain+"<br />Port: 5222<br /><br />Contact your network administrator for further instructions, or visit the <a href='/forum/'>QUAKE LIVE forums</a> to look for help.<br /><br />Click <b>reload</b> to try again or <a href='javascript:;' onclick='quakelive.Logout(); return false'>click here</a> to log out.</p>",
C=((new Date).getTime()-quakelive.initTime)/1E3;a.post("/user/xmpp_connect_fail/"+quakelive.userstatus+"/"+OSGetName()+"/"+BrowserGetName()+"/"+quakelive.userid+"/"+C);quakelive.TrackPageView("/user/xmpp_connect_fail/"+quakelive.userstatus+"/"+quakelive.userid);qlPrompt({title:"XMPP Connection Failure",body:v,fatal:true})};window.IM_OnKicked=function(){quakelive.SendModuleMessage("IM_OnKicked");window.onbeforeunload=undefined;quakelive.ShutdownGame();quakelive.PageRedirect("/user/logout/kicked")};
t.OnVidRestart=function(){quakelive.cvars.GetIntegerValue("r_fullscreen")!=0?a("#qlv_game_mode_chatlist").hide():a("#qlv_game_mode_chatlist").show()};t.OnGameStarted=function(){t.OnVidRestart()};quakelive.RegisterModule("friends",t)})(jQuery);
(function(a){var d={LAYOUT:"postlogin"};d.UpdateTier=function(b){qlProcessing("Updating Skill Tier to "+b+"...","");a.ajax({url:"/user/settier",type:"POST",data:{tier:b},dataType:"json",success:function(){quakelive.serverManager.RefreshServers(quakelive.mod_home.filter)},complete:function(){qlHidePrompt()}})};quakelive.RegisterModule("user",d)})(jQuery);
(function(a){var d={};d.ReloadOverallStats=function(){};d.CanShowStats=function(){if(!quakelive.IsLoggedIn())return false;if(!qz_instance||qz_instance.IsGameRunning())return false;return true};d.Init=function(){function b(){d.CanShowStats()&&d.ReloadOverallStats(true)}function k(){if(d.CanShowStats()){b();setInterval(b,6E5);quakelive.RemoveHook("OnLayoutLoaded",k)}}quakelive.AddHook("OnLayoutLoaded",k)};d.overallStatsData=null;d.reloadCount=0;d.DisplayStatsData=function(){var b=d.overallStatsData,
k="";if(b){var c={NUM_PLAYERS:"Online Players",NUM_FRAGS:"Frags Last Hour",NUM_GAMES:"Games Last Hour"},e=[];for(var p in c)if(b[p]>1)e[e.length]=p;if(e.length>0){p=e[d.reloadCount++%e.length];k+=b[p]+" "+c[p]}}a("#qlv_siteStatus").fadeOut("fast",function(){a("#qlv_siteStatus .front,#qlv_siteStatus .outline").html(k);a("#qlv_siteStatus").fadeIn()})};d.ReloadOverallStats_Success=function(b){b=quakelive.Eval(b);d.overallStatsData=b};quakelive.RegisterModule("stats",d)})(jQuery);
(function(a){var d={};d.LAYOUT="postlogin";d.bFriendBoards=false;d.BASE_FILTERS={view:"FRAGS",startrec:1,numrecs:50,gt:"ALL",tf:"30DAY",map:"ALL",ctry:"ALL",social:"ALL"};d.SUMMARY_FILTER_ORDER=["tf","ctry"];d.FRIEND_SUMMARY_FILTER_ORDER=["gt","tf","map","ctry"];d.FILTER_ORDER=["view","startrec","numrecs","tf","ctry"];d.FRIEND_FILTER_ORDER=["view","gt","tf","map","ctry"];d.Init=function(){d.filter_params=a.extend({},d.BASE_FILTERS)};d.ShowContent=function(c){a("#qlv_contentBody").html(c);for(var e in quakelive.params)if(quakelive.params[e])d.filter_params[e]=
quakelive.params[e];a(".filter").each(function(){a(this).val(d.filter_params[this.name])});quakelive.IsLoggedIn()&&d.toggleSocialFilter(true);switch(quakelive.pathParts[1]){case "summary":d.filter_params.view="SUMMARY";a(".corner_img").each(function(p,x){var t=a(x);if(quakelive.mod_friends.IsBlocked(t.attr("id"))){var z=quakelive.SwapAvatarPath(t.attr("style"),quakelive.PlayerAvatarPath.G_LG);t.attr("style",z)}});break}};d.GetLoadPath=function(){switch(quakelive.pathParts[1]){case "friendsummary":for(var c=
"/leaders/friendsummary/full",e=0;e<this.FRIEND_SUMMARY_FILTER_ORDER.length;++e)c+="/"+(quakelive.params[this.FRIEND_SUMMARY_FILTER_ORDER[e]]||this.filter_params[this.FRIEND_SUMMARY_FILTER_ORDER[e]]);return c;case "summary":c="/leaders/summary/full";for(e=0;e<this.SUMMARY_FILTER_ORDER.length;++e)c+="/"+(quakelive.params[this.SUMMARY_FILTER_ORDER[e]]||this.filter_params[this.SUMMARY_FILTER_ORDER[e]]);return c;case "friends":c="/leaders/friends/full";for(e=0;e<this.FRIEND_FILTER_ORDER.length;++e)c+=
"/"+(quakelive.params[this.FRIEND_FILTER_ORDER[e]]||this.filter_params[this.FRIEND_FILTER_ORDER[e]]);return c;case "details":c="/leaders/details/full";for(e=0;e<this.FILTER_ORDER.length;++e)c+="/"+(quakelive.params[this.FILTER_ORDER[e]]||this.filter_params[this.FILTER_ORDER[e]]);return c}};d.set_filter_params=function(c,e){d.filter_params[c]=e;c=="social"&&d.toggleGranularFilters(e);if(c=="gt"&&e=="ALL")d.toggleMapFilter(true);else if(c=="gt"&&e!="ALL")d.toggleMapFilter(false);else if(c=="map"&&e==
"ALL")d.toggleGTFilter(true);else c=="map"&&e!="ALL"&&d.toggleGTFilter(false);d.RefreshLeaderBoardView()};d.SetFilter=function(c){a(".postlogin_nav > ul > .selected").removeClass("selected");a("#nav_"+c.toLowerCase()).addClass("selected");d.filter_params.startrec=1;d.set_filter_params("view",c)};d.toggleSocialFilter=function(c){if(c){a("#ctrl_filter_social").attr("disabled",false);a("#ctrl_filter_social")[0].style.color=""}else{a("#ctrl_filter_social").attr("disabled",true);a("#ctrl_filter_social")[0].style.color=
"#aaa";d.filter_params.social="ALL";a("#ctrl_filter_social").val("ALL")}};d.toggleGTFilter=function(c){if(c){a("#ctrl_filter_gt").attr("disabled",false);a("#ctrl_filter_gt")[0].style.color=""}else{a("#ctrl_filter_gt").attr("disabled",true);a("#ctrl_filter_gt")[0].style.color="#aaa";d.filter_params.gt="ALL";a("#ctrl_filter_gt").val("ALL")}};d.toggleMapFilter=function(c){if(c){a("#ctrl_filter_map").attr("disabled",false);a("#ctrl_filter_map")[0].style.color=""}else{a("#ctrl_filter_map").attr("disabled",
true);a("#ctrl_filter_map")[0].style.color="#aaa";d.filter_params.map="ALL";a("#ctrl_filter_map").val("ALL")}};d.toggleGranularFilters=function(c){if(c=="FRIENDS"){d.toggleMapFilter(true);d.toggleGTFilter(true)}else{d.toggleMapFilter(false);d.toggleGTFilter(false)}};d.make_lb_urlhash=function(c){c=quakelive.DecorateAnchor(c);if(d.filter_params.view=="SUMMARY")return c;c=[c];for(var e in d.filter_params){param_string=e+"="+d.filter_params[e];c.push(param_string)}return c.join(";")};d.set_lb_url=function(c){c=
d.make_lb_urlhash(c);quakelive.SetMonitorPath(c);quakelive.SetAnchor(c);quakelive.ParsePath()};d.RefreshLeaderBoardView=function(){var c=d.filter_params.view,e=d.filter_params.social;if(c.toUpperCase()=="SUMMARY"&&e.toUpperCase()=="FRIENDS"){d.set_lb_url("leaders/friendsummary");d.LoadFriendSummaryBoards()}else if(c.toUpperCase()=="SUMMARY"){d.set_lb_url("leaders/summary");d.LoadSummaryLeaderBoards()}else if(e.toUpperCase()=="FRIENDS"){d.set_lb_url("leaders/friends");d.LoadFriendBoard(c.toUpperCase())}else{d.set_lb_url("leaders/details");
d.LoadLeaderBoard(c.toUpperCase())}};d.LoadLeaderBoard=function(c,e,p){quakelive.ReloadVerts();e=e||d.filter_params.startrec;p=p||d.filter_params.numrecs;d.filter_params.startrec=e;d.filter_params.numrecs=p;d.set_lb_url("leaders/details");e=[c,e,p,d.filter_params.tf,d.filter_params.ctry];if(a("#leaderboard_data").size()>0){e="/leaders/details/part/"+e.join("/");a.ajax({url:e,mode:"abort",port:"leaders",type:"get",error:function(){d.SetFindPlayerMsg("Error loading leaderboard")},success:function(x){a("#lb_section_header").attr("src",
quakelive.resource("/images/sf/leaderboard/hdr_"+c.toLowerCase()+".gif"));a("#leaderboard_data").html(x)}})}else{e="/leaders/details/full/"+e.join("/");a.ajax({url:e,mode:"abort",port:"leaders",type:"get",error:function(){d.SetFindPlayerMsg("Error loading leaderboard")},success:function(x){a("#qlv_contentBody").html(x)}})}};d.LoadSummaryLeaderBoards=function(){quakelive.ReloadVerts();d.set_lb_url("leaders/summary");var c=[d.filter_params.tf,d.filter_params.ctry];if(a("#leaderboard_data").size()>0){c=
"/leaders/summary/part/"+c.join("/");a.ajax({url:c,mode:"abort",port:"leaders",type:"get",error:function(){d.SetFindPlayerMsg("Error loading leaderboard summary")},success:function(e){a("#lb_section_header").attr("src",quakelive.resource("/images/sf/leaderboard/hdr_summary.gif"));a("#leaderboard_data").html(e)}})}else{c="/leaders/summary/full/"+c.join("/");a.ajax({url:c,mode:"abort",port:"leaders",type:"get",error:function(){d.SetFindPlayerMsg("Error loading leaderboard summary")},success:function(e){a("#qlv_contentBody").html(e)}})}};
d.LoadFriendBoard=function(c){quakelive.IsLoggedIn()||d.LoadLeaderBoard(c);quakelive.ReloadVerts();d.set_lb_url("leaders/friends");for(var e=[c,d.filter_params.gt,d.filter_params.tf,d.filter_params.map,d.filter_params.ctry],p=[],x=0;x<quakelive.mod_friends.roster.fullRoster.length;x++)quakelive.mod_friends.roster.fullRoster[x].IsSubscribed()&&p.push(quakelive.mod_friends.roster.fullRoster[x].player_id);p.length>0&&e.push(Base64.encode(p.join(",")));if(a("#leaderboard_data").size()>0){e="/leaders/friends/part/"+
e.join("/");a.ajax({url:e,mode:"abort",port:"leaders",type:"get",error:function(){d.SetFindPlayerMsg("Error loading friends leaderboard")},success:function(t){a("#lb_section_header").attr("src",quakelive.resource("/images/sf/leaderboard/hdr_"+c.toLowerCase()+".gif"));a("#leaderboard_data").html(t)}})}else{e="/leaders/friends/full/"+e.join("/");a.ajax({url:e,mode:"abort",port:"leaders",type:"get",error:function(){d.SetFindPlayerMsg("Error loading friends leaderboard")},success:function(t){a("#qlv_contentBody").html(t)}})}};
d.LoadFriendSummaryBoards=function(){quakelive.IsLoggedIn()||d.LoadSummaryLeaderBoards();quakelive.ReloadVerts();d.set_lb_url("leaders/friendsummary");for(var c=[d.filter_params.gt,d.filter_params.tf,d.filter_params.map,d.filter_params.ctry],e=[],p=0;p<quakelive.mod_friends.roster.fullRoster.length;p++)quakelive.mod_friends.roster.fullRoster[p].IsSubscribed()&&e.push(quakelive.mod_friends.roster.fullRoster[p].player_id);e.length>0&&c.push(Base64.encode(e.join(",")));if(a("#leaderboard_data").size()>
0){c="/leaders/friendsummary/part/"+c.join("/");a.ajax({url:c,mode:"abort",port:"leaders",type:"get",error:function(){d.SetFindPlayerMsg("Error loading friend leaderboard summary")},success:function(x){a("#lb_section_header").attr("src",quakelive.resource("/images/sf/leaderboard/hdr_summary.gif"));a("#leaderboard_data").html(x)}})}else{c="/leaders/friendsummary/full/"+c.join("/");a.ajax({url:c,mode:"abort",port:"leaders",type:"get",error:function(){d.SetFindPlayerMsg("Error loading friend leaderboard summary")},
success:function(x){a("#qlv_contentBody").html(x)}})}};d.SetFindPlayerMsg=function(c){a("#find_player_msg").text(c);c.length>0&&setTimeout(function(){a("#find_player_msg").fadeOut()},15E3)};d.FindPlayerClick=function(){d.SetFindPlayerMsg("");var c=d.filter_params.view;if(c=="SUMMARY")c="WINS";var e=a("#find_player_input").val();if(typeof e=="undefined")d.SetFindPlayerMsg("Missing Player Name");else{e=a.trim(e);if(e.length==0)d.SetFindPlayerMsg("Empty Player Name");else{a.ajax({url:"/leaders/findplayer/"+
e+"/"+c+"/"+d.filter_params.tf+"/"+d.filter_params.ctry,mode:"abort",port:"leaders",type:"get",error:function(){d.SetFindPlayerMsg("Internal error - try again")},success:function(p){a("#lb_section_header").attr("src",quakelive.resource("/images/sf/leaderboard/hdr_"+c.toLowerCase()+".gif"));a("#leaderboard_data").html(p)}});return false}}};d.ToggleCustomize=function(){var c=a(".filterbar"),e=c.hasClass("filterbar_expanded"),p=a("#leaderboard_data").height(),x=c.height();if(e){c.removeClass("filterbar_expanded");
a("#leaderboard_data").css("height",p+x+"px");a(".filterbar_toggle").removeClass("selected")}else{c.addClass("filterbar_expanded");a("#leaderboard_data").css("height",p+x+"px");a(".filterbar_toggle").addClass("selected")}};var b=0,k="";d.FocusFindPlayer=function(c){c=a(c);if(b++==0)k=c.val();c.val()==k&&c.val("").removeClass("input_default")};d.BlurFindPlayer=function(c){c=a(c);c.val()==""&&c.val(k).addClass("input_default")};quakelive.RegisterModule("leaders",d)})(jQuery);
(function(a){var d={MINIMIZED:0,NORMAL:1,INQUEUE:2,READY:3},b={DISABLED:0,ENABLED:1,IN_CANCELLED:2,OUT_CANCELLED:3,ACCEPTED:4,DECLINED:5},k={};k.MenuStates=d;var c=d.MINIMIZED;k.haveAssets=false;k.isConnected=true;k.lastLFGType=-1;k.lastLFGState=b.DISABLED;k.lastLFGRequests=0;k.cancelMessage=null;k.cancelTimeoutHandle=null;k.shown=false;k.ShowLFG=function(){if(!a("#lfg").is(":visible"))if(k.isConnected&&k.haveAssets&&quakelive.userstatus=="ACTIVE"){k.UpdateLFGMessage(k.lastLFGRequests);k.SetQueue(k.lastLFGType,
b.DISABLED,true);k.shown=true}};k.Init=function(){quakelive.AddHook("IM_OnConnected",function(){k.isConnected=true;k.ShowLFG()});quakelive.AddHook("OnDownloadGroup",function(e){if(e.group==GROUP_EXTRA){k.haveAssets=true;k.ShowLFG()}});quakelive.AddHook("OnGameExited",function(){c!=d.MINIMIZED&&c!=d.NORMAL&&k.CloseGameNotify(b.DISABLED)});quakelive.AddHook("OnServerListReload",function(e){k.UpdateLFGMessage(e.lfg_requests)});quakelive.AddHook("OnContentLoaded",k.ShowLFG)};k.SetQueue=function(e,p,x){if(k.lastLFGState==
b.DISABLED&&p==b.DISABLED)k.ChangeState(d.MINIMIZED);else{k.lastLFGType=e;k.lastLFGState=p;a.ajax({url:"/lfg/setqueue",data:{type:e,state:p},type:"post",dataType:"json",mode:"abort",port:"lfg_queue",success:function(){if(x)if(p==b.DISABLED||p==b.DECLINED)c==d.MINIMIZED?k.ChangeState(d.MINIMIZED):k.ChangeState(d.NORMAL);else c==d.NORMAL||c==d.READY?k.ChangeState(d.INQUEUE):k.ChangeState(d.NORMAL)},error:function(){}})}};k.UpdateLFGMessage=function(e){k.lastLFGRequests=e;e=e>1?"<b>"+e+"</b> players requesting games":
"Let us find a match for you!";if(c==d.NORMAL)a("#lfg_normal .footer").html(e);else c==d.MINIMIZED&&a("#lfg_minimized .footer").html(e)};k.CloseGameNotify=function(e){if(k.notifyTimeoutHandle){clearTimeout(k.notifyTimeoutHandle);k.notifyTimeoutHandle=null}k.notifyServer=null;e>-1?k.SetQueue(k.lastLFGType,e,true):k.ChangeState(d.NORMAL)};k.JoinGame=function(){k.SetQueue(k.lastLFGType,b.ACCEPTED,false);var e=new LaunchGameParams;e.Append("+connect "+k.notifyServer.host_address);LaunchGame(e,k.notifyServer)};
k.WatchNotifyTimer=function(){a("#lfg").find(".timer").text(k.notifyTimeLeft);if(k.notifyTimeLeft==0){k.cancelMessage="Timed out waiting for user input. You must join your match within 60 seconds of being found.";k.CloseGameNotify(b.DISABLED)}else k.notifyTimeoutHandle=setTimeout(k.WatchNotifyTimer,1E3);k.notifyTimeLeft--};k.CancelNotifyTimer=function(){if(k.notifyTimeoutHandle){clearTimeout(k.notifyTimeoutHandle);k.notifyTimeoutHandle=null}};k.ChangeState=function(e){var p=a("#lfg");c=e;switch(e){case d.MINIMIZED:p.html(k.TPL_MODE_MINIMIZED);
p.find(".lfg_content").click(function(){k.ChangeState(d.NORMAL)});k.UpdateLFGMessage(k.lastLFGRequests);break;case d.NORMAL:p.html(k.TPL_MODE_NORMAL);p.find("ul.jd_menu").jdMenu();p.find(".collapse_proxy").click(function(){k.ChangeState(d.MINIMIZED)});k.UpdateLFGMessage(k.lastLFGRequests);p.find(".select_gt_5").click(function(){k.SetQueue(5,b.ENABLED,true)});e=function(){p.find(".cancel_blurb").hide();p.find(".blurb").show()};if(k.cancelMessage){p.find(".blurb").hide();p.find(".cancel_blurb").text(k.cancelMessage).show();
k.cancelTimeoutHandle&&clearTimeout(k.cancelTimeoutHandle);k.cancelTimeoutHandle=setTimeout(e,2E4);k.cancelMessage=null}else e();break;case d.INQUEUE:p.html(k.TPL_MODE_INQUEUE);p.find(".collapse_proxy, .btn_stop").click(function(){confirm("Stop searching for a Duel?")&&k.SetQueue(k.lastLFGType,b.DISABLED,true)});k.UpdateLFGMessage(k.lastLFGRequests);break;case d.READY:p.html(k.TPL_MODE_READY);p.find(".levelshot").css("background-image","url("+quakelive.resource("/images/levelshots/sm/"+k.notifyServer.map+
".jpg")+")");p.find(".description").text(k.notifyServer.map_title+" / "+k.notifyServer.game_type_title);p.find(".play").click(k.JoinGame);p.find(".decline").click(function(){k.CloseGameNotify(b.DECLINED)});quakelive.matchtip.BindMatchTooltip(a("#lfg_ready_tooltip"),k.notifyServer.public_id);k.notifyTimeLeft=60;k.WatchNotifyTimer();break;default:return}p.show()};window.OnLFGNotify=function(e,p){if(k.notifyTimeoutHandle==null){var x=quakelive.Eval(p);server=quakelive.Eval(x.DATA);k.SetQueue(k.lastLFGType,
b.ENABLED,false);k.notifyServer=server;k.ChangeState(d.READY)}};window.OnLFGCancel=function(e){e=quakelive.Eval(e);k.cancelMessage=e.MESSAGE=="OK"?null:e.MESSAGE;k.CloseGameNotify(-1)};quakelive.RegisterModule("lfg",k)})(jQuery);
(function(a){function d(r,m){var l=new Date,q=getDateFromFormat(m,"yyyy-MM-dd");if(Math.abs(Math.round((q-l)/864E5))>28&&quakelive.siteConfig.premiumStatus=="standard"){quakelive.mod_premium.ShowBrochurePopup();return false}return true}var b={LAYOUT:"postlogin",TITLE:"Profile"};quakelive.AddHook("OnGameExited",function(){setTimeout(function(){b.TriggerPendingAwards()},3E3)});quakelive.AddHook("IM_OnConnected",function(){b.TriggerPendingAwards()});quakelive.AddHook("IM_OnRosterChanged",function(){b.OnRosterChanged_Hook()});
b.BindRecentMatches=function(){var r=quakelive.BuildSubPath(3);quakelive.statstip.SetOptions(null);a(".recent_match").each(function(){var m=this.id.split("_"),l=null;if(m.length>=3)l=m[2];quakelive.statstip.BindStatsTooltip(a(this),m[1],l,m[0],r)})};b.GetTitle=function(){return typeof b.activeProfileName=="string"&&b.activeProfileName.length>0?"Profile: "+b.activeProfileName:""};b.GetFriendStatus=function(r){var m={friend:false,blocked:false};if(quakelive.mod_friends.IsOnRoster(r)||r.toLowerCase()==
quakelive.username.toLowerCase())m.friend=true;else if(quakelive.mod_friends.IsBlocked(r))m.blocked=true;return m};var k=false;b.SetupVSFriendControls=function(){if(k){var r=a("#prf_player_name").text(),m=a("#prf_friend_controls").empty(),l=b.GetFriendStatus(r);if(quakelive.username.toLowerCase()!=r.toLowerCase())if(l.friend)m.html('<div title="Already on friends list" class="btn_yourfriend"></div><a href="javascript:;" title="Remove from Friends" onclick="quakelive.mod_profile.UninvitePlayer( \''+
r+'\' ); return false" class="btn_unfriend"></a>');else l.blocked?m.html('<a href="javascript:;" onclick="quakelive.mod_profile.UnblockPlayer( \''+r+'\' ); return false" class="btn_fr_unblock_player"></a>'):m.html('<a href="javascript:;" title="Add to Friends" onclick="quakelive.mod_profile.InvitePlayer( \''+r+'\' ); return false" class="btn_friendinvite"></a><a href="javascript:;" title="Add to Blocked Players" onclick="quakelive.mod_profile.BlockPlayer( \''+r+'\' ); return false" class="btn_block"></a>')}};
b.SetupFriendControls=function(){k&&a(".prf_friend").each(function(r,m){var l=a(m),q=l.find(".invite_controls"),u=q.attr("id"),g=u.indexOf("_");if(g!=-1){u=u.substr(g+1);g=b.GetFriendStatus(u);if(g.friend){q.html('<div title="'+u+' is already your friend" class="btn_fr_invite_inactive rpad_btn fl"></div><div class="cl"></div>');l.removeClass("is_blocked is_friend").addClass("is_friend")}else if(g.blocked){q=quakelive.SwapAvatarPath(l.find(".head_icon").attr("style"),quakelive.PlayerAvatarPath.G_LG);
l.find(".head_icon").attr("style",q);l.removeClass("is_blocked is_friend").addClass("is_blocked")}else q.html('<a href="javascript:;" onclick="quakelive.mod_profile.InvitePlayer( \''+u+'\' ); return false" class="btn_fr_invite rpad_btn fl"></a><div class="cl"></div>')}})};b.InvitePlayer=function(r){confirm("Are you sure you want to add "+r+" to your friends list?")&&quakelive.mod_friends.Subscribe(r)};b.UninvitePlayer=function(r){confirm("Are you sure you want to remove "+r+" from your friends list?")&&
quakelive.mod_friends.Unsubscribe(r)};b.BlockPlayer=function(r){if(confirm("Are you sure you want to block the player "+r+"?")){quakelive.mod_friends.BlockPlayer(r);b.SetupVSFriendControls()}};b.UnblockPlayer=function(r){if(confirm("Are you sure you want to unblock the player "+r+"?")){quakelive.mod_friends.UnblockPlayer(r);b.SetupVSFriendControls()}};b.OnRosterChanged_Hook=function(){k=true;if(quakelive.activeModule==b){var r=b.sections[b.activeSection];r&&r.OnRosterChanged&&r.OnRosterChanged()}};
b.AlterSummaryContent=function(){b.BindRecentMatches();b.SetupVSFriendControls();b.CheckRecentCompetitors()};b.AlterStatisticsContent=function(){b.BindRecentMatches();b.SetupVSFriendControls()};b.AlterAwardsContent=function(){};b.AlterFriendsContent=function(){b.SetupFriendControls()};b.AlterCompetitorsContent=function(){b.BindRecentMatches();b.SetupFriendControls()};b.AlterMatchesContent=function(){};b.CheckRecentCompetitors=function(){a(".icon_holder > img").each(function(r,m){var l=a(m);if(quakelive.mod_friends.IsBlocked(l.attr("id"))){var q=
quakelive.SwapAvatarPath(l.attr("src"),quakelive.PlayerAvatarPath.G_MD);l.attr("src",q)}})};b.activeSection="";b.sections={summary:{OnShow:b.AlterSummaryContent,OnRosterChanged:b.SetupVSFriendControls},statistics:{OnShow:b.AlterStatisticsContent,OnRosterChanged:b.SetupVSFriendControls},awards:{OnShow:b.AlterAwardsContent,OnRosterChanged:null},friends:{OnShow:b.AlterFriendsContent,OnRosterChanged:b.SetupFriendControls},competitors:{OnShow:b.AlterCompetitorsContent,OnRosterChanged:b.SetupFriendControls},
matches:{OnShow:b.AlterMatchesContent,OnRosterChanged:null}};var c=undefined,e={syncerror:"/images/devvalances/syncerror.jpg",sponge:"/images/devvalances/sponge.jpg",bramlett3:"/images/devvalances/brad.jpg",comfort:"/images/devvalances/comfort.jpg",bargle:"/images/devvalances/bargle.jpg",teekteek:"/images/devvalances/teekteek.jpg"};b.Hook_OnContentLoaded=function(r){if(r==b){r=b.activeProfileName.toLowerCase();var m=e[r];if(c==r)return;else if(m){c=r;a("body").css({"background-image":"url("+quakelive.resource(m)+
")","background-color":"black"});return}}if(c){a("body").css({"background-image":"","background-color":""});quakelive.mod_valance.Init();c=undefined}};quakelive.AddHook("OnContentLoaded",b.Hook_OnContentLoaded);b.activeProfileName="";b.ShowContent=function(r){a("#qlv_contentBody").html(r);if(quakelive.pathParts[0]=="profile"){b.activeSection=quakelive.pathParts[1];(r=b.sections[b.activeSection])&&r.OnShow&&r.OnShow()}b.activeProfileName=quakelive.pathParts[2];if(quakelive.pathParts.length==6){r=quakelive.pathParts.length-
3;quakelive.pathParts[r]&&quakelive.statstip.ShowStatsDetails(quakelive.pathParts[r],quakelive.pathParts[r+2],quakelive.pathParts[r+1])}else{r=quakelive.pathParts.length-2;quakelive.pathParts[r]&&quakelive.pathParts[r]==parseInt(quakelive.pathParts[r])&&quakelive.statstip.ShowStatsDetails(quakelive.pathParts[r],null,quakelive.pathParts[r+1])}switch(quakelive.pathParts[1]){case "awards":r=quakelive.GetParam("award")||0;var m=quakelive.GetParam("type")||1;t=-1;b.AwardsSelectBar(m,quakelive.pathParts[2],
r);break;case "matches":r=new Date;r=formatDate(r,"yyyy-MM-dd");b.LoadMatchesForWeek(quakelive.pathParts[2],quakelive.pathParts[3]||r);break;case "arenas":b.LoadArenas(quakelive.pathParts[2]);break}a("img.tier_gt_ffa").click(function(){a(".hidden_desc").fadeIn(2E3)})};var p=0,x="";b.FocusProfileJump=function(r){r=a(r);if(p++==0)x=r.val();r.val()==x&&r.val("").removeClass("input_default")};b.BlurProfileJump=function(r){r=a(r);r.val()==""&&r.val(x).addClass("input_default")};b.SetProfileJumpMsg=function(r){a("#profil_jump_msg").text(r);
r.length>0&&setTimeout(function(){a("#profile_jump_msg").fadeOut()},15E3)};b.ProfileJumpClick=function(){b.SetProfileJumpMsg("");var r=a("#profile_jump_input").val();if(typeof r=="undefined")b.SetProfileJumpMsg("Missing Player Name");else{r=a.trim(r);if(r.length==0)b.SetProfileJumpMsg("Empty Player Name");else{quakelive.Goto("profile/summary/"+r);return false}}};var t=-1;b.AwardsSelectBar=function(r,m,l){var q=a(".awardTypeId"+r);if(t!=r){t!=-1&&a(".awardTypeId"+t).removeClass("awardBarSel").addClass("awardBar");
t=r;q.removeClass("awardBar").addClass("awardBarSel");a(".selectedInfo").remove();l='<div class="selectedInfo"><div style="padding: 5px"><h1>Loading&hellip;</h1><br /><img src="'+quakelive.resource("/images/loader.gif")+'" width="62" height="13" style="margin: 0 auto; display: block" /></div></div>';q.after(a(l));a.ajax({url:"/profile/awards/"+m+"/"+r,mode:"abort",port:"ql_profile",dataType:"html",success:function(u){a(".selectedInfo").html(u)},error:function(){a(".selectedInfo").html("<h1>Error loading award data.<br />Please Try again later</h1>")}})}else if(!l){a(".awardTypeId"+
t).removeClass("awardBarSel").addClass("awardBar");a(".selectedInfo").remove();t=-1}};b.TriggerPendingAwards=function(){quakelive.IsGameRunning()||a.ajax({type:"get",url:"/profile/trigger_pending_awards",port:"trigger_awards",dataType:"json"})};a.fn.extend({loading:function(){return this.html('<div style="width: 100%; height: 100%"><img src="'+quakelive.resource("/images/loader.gif")+'" width="62" height="13" style="margin: 0 auto" /></div>')}});b.LoadMatchesForWeek=function(r,m){a("#matchesBlock").html('<div style="padding: 20px"><span class="verdanaBblk_11">Loading matches...</span><br /><br /><br /><img src="'+
quakelive.resource("/images/loader.gif")+'" width="62" height="13" style="margin: 0 auto" /></div>');a.ajax({type:"get",url:"/profile/matches_by_week/"+r+"/"+m,success:function(l){l=a("#matchesBlock").html(l).find(".selectedBG:first").prev();l.size()>0&&b.MatchSelectBar(l.get());a("#datepicker").datepicker({showOn:"both",buttonImage:quakelive.resource("/images/calendar.gif"),buttonImageOnly:true,numberOfMonths:1,dateFormat:"yy-mm-dd",maxDate:+0,minDate:"-1y",showOtherMonths:true,showButtonPanel:true});
a("#datepicker").change(b.MatchDateChanged);a("#trigger_premium")[0]&&quakelive.mod_premium.ShowBrochurePopup()},error:function(){a("#matchesBlock").html("Load failed")}})};b.SwitchToPreLoadedMatchWeek=function(r,m,l){if(d(r,m)){var q="btn_last_7_days";switch(l){default:case 0:q="btn_last_7_days";break;case 1:q="btn_1_to_2_weeks";break;case 2:q="btn_2_to_3_weeks";break;case 3:q="btn_3_to_4_weeks";break}b.LoadMatchesForWeek(r,m);a(".maincontent div:first").find("div a").removeClass("selected");a("."+
q+" a").addClass("selected");l=quakelive.BuildSubPath(2);l+="/"+r+"/"+m;quakelive.StopPathMonitor();quakelive.SetAnchor(l);quakelive.ParsePath();quakelive.StartPathMonitor()}};b.GoToMatchWeek=function(r,m){d(r,m)&&quakelive.Goto("/profile/matches/"+r+"/"+m)};b.MatchDateChanged=function(){var r=a("#datepicker").val();d(quakelive.pathParts[2],r)&&quakelive.Goto("profile/matches/"+quakelive.pathParts[2]+"/"+r)};var z=null;b.MatchSelectBar=function(r){z=r;a(r).hasClass("selectedMatchBar")?b.DeactivateMatchBar(r):
b.ActivateMatchBar(r)};b.ActivateMatchBar=function(r){a(r).removeClass("matchBar").addClass("selectedMatchBar").next().show();quakelive.statstip.SetOptions(null);var m=quakelive.BuildSubPath(4);a(r).next().find(".areaMapC").each(function(){var l=this.id.split("_"),q=null;if(l.length>=3)q=l[2];quakelive.statstip.BindStatsTooltip(a(this),l[1],q,l[0],m)})};b.DeactivateMatchBar=function(r){a(r).addClass("matchBar").removeClass("selectedMatchBar").next().hide()};b.LoadArenas=function(r){var m=a("#qlv_profileContainer"),
l={},q=function(){a(".prf_arenas_box:hidden").show();switch(a("#arena_gametype").val()){case "ctf_only":a(".prf_arenas_box.normal:visible").hide();break;case "other_arenas":a(".prf_arenas_box.ctf:visible").hide();break}switch(a("#arena_level").val()){case "premium_only":a(".prf_arenas_box.standard:visible").hide();break;case "standard_only":a(".prf_arenas_box.premium:visible").hide();break}a("#disabled_arenas").attr("checked")||a(".prf_arenas_box.disabled:visible").hide()};a("#qlv_arenaStatsFilter input, #qlv_arenaStatsFilter select").change(q);
var u=function(g){a("#qlv_profileContainer .selectedInfo h1").text(g);a("#qlv_profileContainer .selectedInfo img").hide()};a.ajax({url:"/profile/arenas/"+r+"/data",dataType:"json",success:function(g){if(g.ECODE&&g.ECODE<0)u(g.MSG);else{for(var o=0;o<mapdb.orderedMaps.length;o++){var y=mapdb.getBySysName(mapdb.orderedMaps[o]);l[mapdb.orderedMaps[o]]={NUM_GAMES:0,CAPTURES:0,DEFENDS:0,FINISHED:0,ASSISTS:0,WINS:0,MAP_NAME:y.name,MAP_SHORT_NAME:y.sysname,PLAY_TIME:0,CTF:y.hasGameType(5),PREMIUM:y.hasTag("PREMIUM")}}for(o in g){y=
g[o];var v=["ASSISTS","CAPTURES","DEFENDS","FINISHED","NUM_GAMES","PLAY_TIME","WINS"];for(var C in v){var G=v[C];if(l[y.MAP_SHORT_NAME])l[y.MAP_SHORT_NAME][G]=y[G]}}g=[];for(o in l){y=l[o];v=y.MAP_NAME!="None"?y.MAP_NAME:y.MAP_SHORT_NAME;C=[y.PREMIUM?"premium":"standard",y.CTF?"ctf":"normal"].join(" ");if(y.NUM_GAMES==0)g.push(['<div class="prf_arenas_box disabled ',C,'"><img class="prf_levelshot" src="',quakelive.resource("/images/levelshots/sm/"+y.MAP_SHORT_NAME+".jpg"),'"/><div class="prf_infobox"><div class="prf_mapname">',
v,'</div>Never Played</div><div style="clear: both"></div></div>'].join(""));else{C=['<div class="prf_arenas_box ',C,'">','<img class="prf_levelshot" src="',quakelive.resource("/images/levelshots/sm/"+y.MAP_SHORT_NAME+".jpg"),'"/>','<div class="prf_infobox">','<div class="prf_record">Record <div class="prf_bignumber">',y.WINS," - ",y.NUM_GAMES-y.WINS,"</div></div>"];C.push(['<div class="prf_mapname">',v,'</div><div class="prf_total_games">Total Games: ',y.NUM_GAMES,"</div>"].join(""));C.push('</div><div style="clear: both"></div></div>');
g.push(C.join(""))}}m.html(g.join(""));q()}},error:function(){u("Unable to retrieve arena stats")}})};quakelive.RegisterModule("profile",b)})(jQuery);(function(){var a={};a.skipMatchingPathUpdates=/^faq\b/;a.LAYOUT="postlogin";quakelive.RegisterModule("faq",a)})(jQuery);(function(){var a={};a.skipMatchingPathUpdates=/^guide\b/;a.LAYOUT="postlogin";quakelive.RegisterModule("guide",a)})(jQuery);
(function(a){var d={};d.GetLayout=function(){return quakelive.pathParts[1]=="eula_updated"?"bare":"postlogin"};d.ConfirmEulaClose=function(){qlConfirm("You must agree to the SLA in order to play","You must agree to the license changes in order to continue playing Quake Live. If you do not wish to agree at this time you will be logged out.<br /><br />Are you sure you want to log out?",function(){qlProcessing("Logging out&hellip;","You are now being logged out.");quakelive.PageRedirect("/user/logout")},
function(){})};d.ConfirmEula=function(){a.ajax({url:"/legals/accept_eula",type:"post",dataType:"json",success:function(){quakelive.userinfo.EULA_OUTDATED=0;quakelive.onAfterEulaConfirm?quakelive.onAfterEulaConfirm():quakelive.PageRedirect("/user/login_redirect")}})};quakelive.RegisterModule("legals",d)})(jQuery);
(function(a){var d={};d.LAYOUT="bare";var b={forgot:["email","recaptcha_response_field"],"forgot/validate":["email","code","password","password2"]};d.ShowContent=function(k){quakelive.ShowContent(k);d.ResetFieldStyles();a.getScript("http://www.google.com/recaptcha/api/js/recaptcha_ajax.js",function(){Recaptcha.create("6LdqLsASAAAAAJIuAN8u5VnejtsbvwA8eguRNeMu","recaptcha_image",{theme:"custom"})});switch(quakelive.path){case "forgot":a("#email").focus();break;case "forgot/validate":a("#email").val(quakelive.params.email||
"");a("#code").val(quakelive.params.code||"");if(a("#email").val().length&&a("#code").val().length)a("#password").focus();else a("#email").val().length?a("#code").focus():a("#email").focus();break}};d.ResetFieldStyles=function(){if(b[quakelive.path]){var k=b[quakelive.path];for(var c in k){formStyler.StyleAsDefault(k[c]);a("#"+k[c]).focus(formStyler.FocusField);a("#"+k[c]).blur(formStyler.BlurField)}}};d.RequestPasswordMail=function(){var k={email:a("#email").val(),recaptcha_challenge_field:Recaptcha.get_challenge(),
recaptcha_response_field:Recaptcha.get_response()};a.ajax({type:"post",dataType:"json",url:"/forgot/request_mail",data:k,success:d.RequestPasswordMail_Success,error:d.RequestPasswordMail_Error})};d.RequestPasswordMail_Success=function(k){if(k.ECODE==0)quakelive.Goto("forgot/validate;email="+k.EMAIL);else{d.ResetFieldStyles();for(var c in k.ERRORS){formStyler.StyleAsError(c);a("#help_"+c).append("<span class='error'>"+k.ERRORS[c]+"</span>");Recaptcha.reload()}}};d.RequestPasswordMail_Error=function(){d.RequestPasswordMail_Success({ECODE:-1,
ERRORS:{email:"Failed to reset password"}})};d.ChangePassword=function(){var k={email:a("#email").val(),code:a("#code").val(),password:a("#password").val(),password2:a("#password2").val()};a.ajax({type:"post",dataType:"json",url:"/forgot/change_password",data:k,success:d.ChangePassword_Success,error:d.ChangePassword_Error})};d.ChangePassword_Success=function(k){if(k.ECODE==0){qlPrompt({title:"Password Changed",body:"Your password has been changed!"});quakelive.Goto("home")}else{d.ResetFieldStyles();
for(var c in k.ERRORS){formStyler.StyleAsError(c);a("#help_"+c).append("<span class='error'>"+k.ERRORS[c]+"</span>")}}};d.ChangePassword_Error=function(){d.ChangePassword_Success({ECODE:-1,ERRORS:{email:"Failed to change password"}})};quakelive.RegisterModule("forgot",d)})(jQuery);(function(){var a={};a.LAYOUT="prelogin";quakelive.RegisterModule("logoff",a)})(jQuery);(function(){var a={};a.LAYOUT="postlogin";quakelive.RegisterModule("sorry",a)})(jQuery);
(function(a){var d={LAYOUT:"postlogin",TITLE:"Forum Signature"};d.ShowContent=function(b){quakelive.ShowContent(b);a("#mod_sig input").each(function(){a(this).click(function(){this.select()})})};quakelive.RegisterModule("sig",d)})(jQuery);
(function(a){var d={LAYOUT:"postlogin",TITLE:"Practice"},b={AUTO:1,MANUAL:2};d.expandMode=b.MANUAL;d.baseDefaultGameCfg={game_type:mapdb.GameTypes.FFA,arena:"arenagate",difficulty:0,player_slots:8,player_slots_used:1,time_limit:10,round_limit:8,frag_limit:30,capture_limit:8,friendly_fire:0,dmflags:0,map_tag:""};d.gameTypeDefaults={};d.gameTypeDefaults[mapdb.GameTypes.FFA]={arena:"retribution",time_limit:20,frag_limit:30,friendly_fire:0,dmflags:0};d.gameTypeDefaults[mapdb.GameTypes.DUEL]={arena:"powerstation",
time_limit:10,frag_limit:0,friendly_fire:0,dmflags:0};d.gameTypeDefaults[mapdb.GameTypes.TDM]={arena:"campgrounds",time_limit:15,frag_limit:0,friendly_fire:1,dmflags:0};d.gameTypeDefaults[mapdb.GameTypes.CA]={arena:"asylum",time_limit:20,round_limit:10,friendly_fire:0,dmflags:28};d.gameTypeDefaults[mapdb.GameTypes.CTF]={arena:"duelingkeeps",time_limit:20,capture_limit:8,friendly_fire:0,dmflags:0};d.OnModuleInit=function(){d.gameTypeData={};for(var l in d.gameTypeDefaults){var q={};q.cfg=a.extend({},
d.baseDefaultGameCfg,d.gameTypeDefaults[l]);q.defaultCfg=a.extend({},d.baseDefaultGameCfg,d.gameTypeDefaults[l]);q.lockedCfg={};d.gameTypeData[l]=q}d.LoadSettings();d.gameCfg=null;d.defaultGameCfg=null;d.gameCfgDelta={};for(var u in d.gameCfg)d.gameCfgDelta[u]=false};var k=function(){this.vector={};for(var l=0;l<arguments.length;++l)this.vector[arguments[l]]=true;this.hasGameType=function(q){return typeof this.vector[q]!="undefined"};this.getRandom=function(){var q=[];for(var u in this.vector)q.push(u);
return q[Math.floor(Math.random()*q.length)]}},c=new k(mapdb.GameTypes.FFA,mapdb.GameTypes.DUEL,mapdb.GameTypes.TDM,mapdb.GameTypes.CA,mapdb.GameTypes.CTF),e=function(l){var q=a.extend({sentinel:"",box:"",margin:10},l),u;this.Scroll=function(){if(a(q.sentinel).length){var g=a(q.sentinel).offset().top,o=a(window).scrollTop();o>g?u.css("padding-top",o-g+q.margin+"px"):u.css("padding-top","0px")}};this.Prepare=function(){a(window).scroll(this.Scroll);u=a(q.box)}};d.ShowContent=function(l){quakelive.ShowContent(l);
if(quakelive.IsLoggedIn()){quakelive.MakeHomeChooser(quakelive.path||"practice");for(var q=l=0;q<quakelive.session.length;++q)l+=quakelive.session.charCodeAt(q);var u=[],g=a("#bot_sk").text();for(q=0;q<g.length;++q){var o=(1+q)*l%65,y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(g[q]);if(y<o)y+=65;u[q]=y-o}p=u}l={};for(var v in d.gameCfg)l[v]=true;for(v=0;v<2;++v)for(var C in r){q=r[C];if(v==m.Wire){q.$panel=a("#"+C);d[C]=r[C]}else v==m.Prepare&&q.Prepare()}for(C in r){q=
r[C];q.Modify(d.gameCfg,l)}d.SetGameType(d.defaultGameType);d.GameCfgUpdated();(quakelive.pathParts[1]=="training"?new e({sentinel:"#prac_guidenavpanel_sentinel",box:".prac_guidenavpanel"}):new e({sentinel:"#summary_sentinel",box:".prac_summary"})).Prepare();d.BarClicked("panel_gametype",true)};var p=[0,0,0,0,0,0,0],x={game_type:"g_gametype",time_limit:"timelimit",round_limit:"roundlimit",frag_limit:"fraglimit",capture_limit:"capturelimit",friendly_fire:"g_friendlyfire",dmflags:"dmflags"};d.GetGameParams=
function(){var l=new LaunchGameParams({isBotGame:true});for(var q in x)l.Append("+set "+x[q]+" "+d.gameCfg[q]);l.Append("+set sv_maxclients 16");if(d.gameCfg.game_type==mapdb.GameTypes.CA){l.Append("+set g_startingArmor 100");l.Append("+set g_startingHealth 200");l.Append("+set g_startingWeapons 255")}q=d.gameCfg.difficulty;if(q==0){q=p[d.gameCfg.game_type];l.Append("+set bot_dynamicSkill 1")}l.Append("+set g_spSkill "+q);l.Append("+set bot_startingSkill "+q);l.Append("+set com_hunkMegs 128");l.Append("+set g_forcePremium 1");
l.Append("+map "+d.gameCfg.arena);var u=0,g=["red","blue"],o=mapdb.isTeamGameType(d.gameCfg.game_type);o&&l.Append("+wait +team "+g[u++]);for(var y=1;y<d.gameCfg.player_slots;++y){var v;v=y-1<z.length?z[y-1]:botdb.botNames[Math.floor(Math.random()*botdb.botNames.length)];o?l.Append("+addbot "+v+" "+q+" "+g[u++%2]):l.Append("+addbot "+v+" "+q);l.Append("+wait")}return l};var t={game_type:true,player_slots_used:true,map_tag:true};d.SaveSettings=function(){var l=d.gameTypeData[d.gameCfg.game_type],q=
{};for(var u in l.cfg)t[u]||(q[u]=l.cfg[u]);SetCvar("web_practice_settings_"+d.gameCfg.game_type,JSON.stringify(q));SetCvar("web_practice_gametype",d.gameCfg.game_type)};d.LoadSettings=function(){for(var l in d.gameTypeData){var q=d.gameTypeData[l],u=quakelive.cvars.Get("web_practice_settings_"+l,"{}").value;u=quakelive.Eval(u);if(!u){SetCvar("web_practice_settings_"+l,"{}");u={}}if(u.arena&&mapdb.maps[u.arena]&&mapdb.maps[u.arena].hasGameType(l))q.cfg=a.extend(q.cfg,u)}d.defaultGameType=quakelive.cvars.Get("web_practice_gametype",
mapdb.GameTypes.FFA).value};d.Play=function(){d.SaveSettings();LaunchGame(d.GetGameParams())};d.SetGameType=function(l){var q=d.gameTypeData[l],u=d.gameCfg;d.gameCfg=q.cfg;d.defaultGameCfg=q.defaultCfg;d.lockedGameCfg=q.lockedCfg;for(var g in d.gameCfg)d.SetGameCfg(g,d.gameCfg[g]);if(u){d.SetGameCfg("player_slots_used",u.player_slots_used);d.SetGameCfg("map_tag",u.map_tag)}d.gameCfg.game_type=null;d.SetGameCfg("game_type",l);d.CheckPlayerSlots(d.gameCfg)};d.CheckPlayerSlots=function(l){var q=mapdb.maps[l.arena];
if(q){q=q.gametypes[l.game_type];var u=l.player_slots;if(u!=1){if(u<q.min_players)u=q.min_players;else if(u>q.max_players)u=q.max_players;if(l.game_type==mapdb.GameTypes.DUEL)u=2}var g=a("#select_player_slots").empty();g.append('<option value="1">Just Me</option>');for(var o=q.min_players;o<=q.max_players;o+=2)g.append('<option value="'+o+'">'+o+" Players</option>");d.panel_customize.SetField("player_slots",u);u!=l.player_slots&&d.SetGameCfg("player_slots",u)}};d.ResetCustomize=function(){for(var l in d.defaultGameCfg)d.panel_customize.settingsLookup[l]&&
d.SetGameCfg(l,d.defaultGameCfg[l]);d.CheckPlayerSlots(d.gameCfg);d.GameCfgUpdated()};var z=[];d.PlayerClicked=function(l,q){var u=a(l);if(u.hasClass("plaque_selected")){for(var g=0;g<z.length;++g)if(z[g]==q){z.splice(g,1);break}u.removeClass("plaque_selected");d.SetGameCfg("player_slots_used",d.gameCfg.player_slots_used-1);d.GameCfgUpdated()}else if(d.gameCfg.player_slots_used<d.gameCfg.player_slots){z[z.length]=q;u.addClass("plaque_selected");d.SetGameCfg("player_slots_used",d.gameCfg.player_slots_used+
1);d.GameCfgUpdated()}};var r={panel_gametype:new (function(){var l=[{id:mapdb.GameTypes.FFA,name:"ffa",title:"Free For All",desc:"If it has 2 legs and moves - shoot it! Most frags wins."},{id:mapdb.GameTypes.CTF,name:"ctf",title:"Capture The Flag",desc:"Two teams, fighting to capture the opponent's flag and return it to their base."},{id:mapdb.GameTypes.CA,name:"ca",title:"Clan Arena",desc:"Two teams compete to eliminate each other. Team with the last man standing wins the round."},{id:mapdb.GameTypes.TDM,
name:"tdm",title:"Team Deathmatch",desc:"Team-based Free For All. The team with the most frags wins."},{id:mapdb.GameTypes.DUEL,name:"duel",title:"Duel",desc:"A 1 vs. 1 test of skill. Just you, your opponent, and the arena. Most frags wins."}];this.Prepare=function(){var q=a("<div></div>"),u=null,g;for(var o in l){if(o%5==0){g=l.length-o;if(g>5)g=5;g=100/g-0.5;if(u){u.append('<div class="cl"></div>');q.append(u);q.append('<div class="rowSeparator">&nbsp;</div>')}u=a('<div class="cl" style="margin: 0 auto"></div>')}var y=
l[o],v='<div class="btn_gametype gametype_container gt_'+y.id+'" style="width:'+g+'%" onclick="quakelive.mod_practice.GameTypeClicked(\''+y.id+"'); return false\"></a>";v+='<div class="gametype_icon"><img src="/images/gametypes/md/'+y.name+'.png" width="45" height="45" /></div>';v+='<div class="gametype_name">'+y.title+"</div>";v+="</div>";u.append(v)}u.append('<div class="cl"></div>');q.append(u);this.$panel.find(".gametypes").empty().append(q)};this.Show=function(){};this.Hide=function(){};this.Modify=
function(q,u){if(u.game_type){var g=mapdb.getGameTypeByID(q.game_type);this.$panel.find(".params").text(g.title);this.$panel.find(".btn_gametype").each(function(){var o=a(this);if(o.hasClass("gt_"+q.game_type))o.addClass("selected_gametype");else o.hasClass("selected_gametype")&&o.removeClass("selected_gametype")})}}}),panel_arena:new (function(){this.$container=null;this.Prepare=function(){var l=a("<div></div>");for(var q in mapdb.orderedMaps){var u=mapdb.maps[mapdb.orderedMaps[q]],g=[],o=["btn_arena",
"map_"+u.sysname];if(!(quakelive.siteConfig.premiumStatus=="standard"&&u.hasTag("PREMIUM"))){for(var y in u.tag_list){o.push("tag_"+u.tag_list[y]);g.push(mapdb.GetTag(u.tag_list[y]).title)}for(y in u.gametypes)o.push("gt_"+u.gametypes[y].gametype);g=a('<a title="Tags: '+g.join(", ")+'" class="'+o.join(" ")+'" href="javascript:;" onclick="quakelive.mod_practice.ArenaClicked(\''+u.sysname+"'); return false\"></a>").append('<img class="levelshot" />').append("<br />"+u.name).appendTo(l);u={pacifier:"/images/levelshots/sm/default.jpg",
resource:"/images/levelshots/sm/"+u.sysname+".jpg",target:g.find(".levelshot")};quakelive.resourceLoader.Load(u)}}l.append("<div class='cl'></div>");this.$panel.find(".arenas").append(l);mapdb.AddTagOptionGroups(a("#arena_filter"));this.$container=l};this.Show=function(){};this.Hide=function(){};this.Modify=function(l,q){if(!(!q.game_type&&!q.map_tag&&!q.arena)){var u="map_"+l.arena;if(q.arena){this.$panel.find(".params").text(mapdb.maps[l.arena].name);this.$panel.find(".selected_arena").removeClass("selected_arena");
this.$panel.find("."+u).addClass("selected_arena")}if(q.game_type||q.map_tag)this.$container.find(".btn_arena").each(function(){var g=a(this),o=true;g.hasClass("gt_"+l.game_type)||(o=false);if(l.map_tag&&!g.hasClass("tag_"+l.map_tag))o=false;if(o){g.hasClass(u)?g.addClass("selected_arena"):g.removeClass("selected_arena");g.show()}else g.hide()})}}}),panel_customize:new (function(){function l(o){return function(){g||(d.lockedGameCfg[o]=true);d.SetGameCfg(o,a("#select_"+o).val());d.GameCfgUpdated()}}
this.settings=[{title:"Difficulty",description:"Skill level of AI opponents in the match.",field:"difficulty",game_types:c,"default":0,values:[{name:"My Skill",value:0},{name:"I Can Win",value:1},{name:"Bring It On",value:2},{name:"Hurt Me Plenty",value:3},{name:"Hardcore",value:4},{name:"Nightmare",value:5}]},{title:"Total Players",description:"Number of players to have on the server.",field:"player_slots",game_types:new k(mapdb.GameTypes.FFA,mapdb.GameTypes.TDM,mapdb.GameTypes.CA,mapdb.GameTypes.CTF),
"default":0,values:[{name:"None",value:0},{name:"2 Players",value:2},{name:"4 Players",value:4},{name:"6 Players",value:6},{name:"8 Players",value:8},{name:"10 Players",value:10},{name:"12 Players",value:12},{name:"14 Players",value:14},{name:"16 Players",value:16}]},{title:"Time Limit",description:"Maximum duration of a single match.",field:"time_limit",game_types:c,"default":0,values:[{name:"None",value:0},{name:"5 Minutes",value:5},{name:"10 Minutes",value:10},{name:"15 Minutes",value:15},{name:"20 Minutes",
value:20},{name:"30 Minutes",value:30}]},{title:"Round Limit",description:"The number of rounds to play.",field:"round_limit",game_types:new k(mapdb.GameTypes.CA),"default":0,values:[{name:"None",value:0},{name:"6 Rounds",value:6},{name:"8 Rounds",value:8},{name:"10 Rounds",value:10},{name:"12 Rounds",value:12}]},{title:"Frag Limit",description:"Total frags needed to finish the match.",field:"frag_limit",game_types:new k(mapdb.GameTypes.FFA,mapdb.GameTypes.DUEL,mapdb.GameTypes.TDM),"default":0,values:[{name:"None",
value:0},{name:"10 Frags",value:10},{name:"20 Frags",value:20},{name:"30 Frags",value:30},{name:"40 Frags",value:40},{name:"50 Frags",value:50}]},{title:"Capture Limit",description:"Number of captures to finish the match.",field:"capture_limit",game_types:new k(mapdb.GameTypes.CTF),"default":0,values:[{name:"None",value:0},{name:"4 Captures",value:4},{name:"6 Captures",value:6},{name:"8 Captures",value:8},{name:"10 Captures",value:10},{name:"12 Captures",value:12}]},{title:"Friendly Fire",description:"Whether your attacks damage teammates.",
field:"friendly_fire",game_types:new k(mapdb.GameTypes.TDM),"default":1,values:[{name:"Disabled",value:0},{name:"Enabled",value:1}]}];this.GetNameForIntegerValue=function(o,y){y=parseInt(y);for(var v in o.values)if(o.values[v].value==y)return o.values[v].name;return y};this.settingsLookup={};for(var q in this.settings){var u=this.settings[q];this.settingsLookup[u.field]=u}var g=false;this.$container=null;this.Prepare=function(){var o=a("<div>");for(var y in this.settings){for(var v=this.settings[y],
C=a('<div class="setting" id="'+v.field+'">'),G=0;G<mapdb.GameTypes.MAX;++G)v.game_types.hasGameType(G)&&C.addClass("gt_"+G);G=a('<div class="field">');G.append("<label>"+v.title+"</label>");G.append("<span>"+v.description+"</span>");var H=a('<div class="value">'),F=a('<select id="select_'+v.field+'">').change(l(v.field));for(y in v.values){var J=v.values[y];F.append('<option value="'+J.value+'">'+J.name+"</option>")}H.append(F);C.append(a('<div class="field_box"></div>').append(G));C.append(a('<div class="value_box"></div>').append(H));
C.append('<div class="cl"></div>');o.append(C)}this.$container=o;this.$panel.find(".customizations").empty().append(this.$container)};this.Show=function(){};this.Hide=function(){};this.Modify=function(o,y){if(y.game_type||y.arena){this.$panel.find(".params").text("Default");var v=this;this.$container.find(".setting").each(function(){var H=a(this);v.settingsLookup[this.id].game_types.hasGameType(o.game_type)?H.show():H.hide()})}var C=false;for(var G in y)if(this.settingsLookup[G]){this.SetField(G,
o[G]);if(o[G]!=d.defaultGameCfg[G])C=true}this.$panel.find(".params").text(C?"Customized":"Default")};this.SetField=function(o,y,v){g=v;a("#select_"+o).val(y);g=false}}),panel_players:new (function(){this.$container=null;this.Prepare=function(){var l=a("<div>"),q,u={};for(q in z)u[z[q]]=true;var g=quakelive.username||"My Account",o=quakelive.playericons?quakelive.playericons.modelskin:"sarge_default";q=a('<a href="javascript:;" class="plaque plaque_selected"></a>');q.append('<img class="modelskin" src="'+
quakelive.resource("/images/players/icon_md/"+o+".png")+'" />');q.append("<h1>"+g+"</h1>");q.append('<div class="cl"></div>');l.append(a('<div class="plaque_box"></div>').append(q));for(var y in botdb.bots){g=botdb.bots[y];q="plaque";if(u[g.sysname])q+=" plaque_selected";q=a('<a href="javascript:;" class="'+q+'" id="'+g.sysname+'" onclick="quakelive.mod_practice.PlayerClicked(this, \''+g.sysname+'\'); return false"><div class="add"></div><div class="remove"></div></a>');q.append('<img class="modelskin" src="'+
quakelive.resource("/images/players/icon_md/"+g.modelskin+".png")+'" />');q.append("<h1>"+g.name+"</h1>");q.append('<div class="cl"></div>');l.append(a('<div class="plaque_box"></div>').append(q))}l.append('<div class="cl"></div>');this.$container=l;this.$panel.find(".players").empty().append(this.$container)};this.Modify=function(l,q){if(q.player_slots_used||q.player_slots){if(q.player_slots&&l.player_slots<l.player_slots_used){for(var u=l.player_slots_used-l.player_slots,g=z.length-u;g<z.length;++g)this.$container.find("#"+
z[g]).removeClass("plaque_selected");z.splice(z.length-u,u);d.SetGameCfg("player_slots_used",1+z.length);d.GameCfgUpdated()}u=l.player_slots_used+" of "+l.player_slots+" slots filled";this.$panel.find(".params").text(u);l.player_slots_used>=l.player_slots?this.$panel.find(".players").addClass("players_noslots"):this.$panel.find(".players").removeClass("players_noslots")}};this.Show=function(){};this.Hide=function(){}}),panel_launcher:new (function(){this.Prepare=function(){var l=d.panel_customize.settings,
q=a(".summary_settings").empty();for(var u in l){var g=l[u];q.append('<li class="summary_field_'+g.field+'">'+g.title+": <b></b></li>")}};this.Modify=function(l,q){for(var u in q){var g=d.panel_customize.settingsLookup[u];if(g){g=d.panel_customize.GetNameForIntegerValue(g,l[u]);a(".summary_field_"+u+" b").text(g)}}if(q.arena){u=mapdb.maps[l.arena];g={pacifier:"/images/levelshots/lg/default.jpg",resource:"/images/levelshots/lg/"+u.sysname+".jpg",target:a(".prac_summary .summary_header"),targetType:"css"};
quakelive.resourceLoader.Load(g);a(".prac_summary .map_title").text(u.name);u=d.panel_customize.settings;for(var o in u){g=u[o];g.game_types.hasGameType(l.game_type)?a(".summary_field_"+g.field).show():a(".summary_field_"+g.field).hide()}}if(q.game_type){o=mapdb.getGameTypeByID(l.game_type);a(".prac_summary .summary_gametype").css("background-image","url("+quakelive.resource("/images/gametypes/sm/"+o.name+".png")+")").text(o.title)}if(q.player_slots||q.player_slots_used){u=quakelive.username||"My Account";
g=quakelive.playericons?quakelive.playericons.modelskin:"sarge_default";var y=a("<div>");for(o=0;o<l.player_slots;++o){var v,C;$r=a('<div class="chosen_player"></div>');if(o==0){C="/images/players/icon_md/"+g+".png";v=u}else if(o-1<z.length){v=botdb.bots[z[o-1]];C="/images/players/icon_md/"+v.modelskin+".png";v=v.name}else{C="/images/start_match/random_ai.png";v="Random AI Player"}$r.append('<img class="modelskin" src="'+quakelive.resource(C)+'" />');$r.append("<h1>"+v+"</h1>");$r.append('<div class="cl"></div>');
y.append(a('<div class="chosen_player_box"></div>').append($r))}a(".prac_summary .playerlist .pl_body").empty().append(y)}};this.Show=function(){};this.Hide=function(){}})};d.ph=r;var m={Wire:0,Prepare:1,Modify:2};d.SetGameCfg=function(l,q){if(typeof d.gameCfg[l]!="undefined"){d.gameCfgDelta[l]=true;d.gameCfg[l]=q}};d.GameCfgUpdated=function(){var l=d.gameCfgDelta;d.gameCfgDelta={};for(var q in r)r[q].Modify(d.gameCfg,l)};d.BarClicked=function(l,q){var u=r[l];if(u)if(!q&&u.$panel.hasClass("panel_expanded")){u.$panel.removeClass("panel_expanded");
u.Hide()}else{d.expandMode==b.AUTO&&a(".panel_expanded").removeClass("panel_expanded");u.$panel.addClass("panel_expanded").show();u.Show()}};d.ShuffleClicked=function(){var l=c.getRandom(),q=mapdb.getRandomByGameType(l);d.SetGameCfg("arena",q.sysname);d.SetGameType(l);d.GameCfgUpdated()};d.GameTypeClicked=function(l){d.SetGameType(l);d.GameCfgUpdated()};d.ArenaClicked=function(l){d.SetGameCfg("arena",l);d.CheckPlayerSlots(d.gameCfg);d.GameCfgUpdated()};d.LaunchTraining=function(l){var q=new LaunchGameParams({isTraining:true});
l=="qztraining"?q.Append("+set sv_maxclients 16 +set bot_dynamicSkill 1 +set g_gametype 0 +set bot_startingSkill "+p[mapdb.GameTypes.DUEL]+" +map qztraining"):q.Append("+set g_gametype 0 +set dmflags 28 +set practiceflags 3 +map "+l+" +wait +wait +team f");LaunchGame(q)};d.LaunchDemo=function(l){a(".video_embed").parent().hide();var q=new LaunchGameParams({isTraining:true});q.Append("+set practiceflags 3 +demo "+l);LaunchGame(q)};quakelive.RegisterModule("practice",d)})(jQuery);
(function(a){var d={};d.Init=function(){};d.GetLayout=function(){return"bare"};d.OnLayoutLoaded=function(){};d.ShowContent=function(k){quakelive.ShowContent(k);d.ResetFieldStyles();a("#in_email").focus();typeof quakelive.params.email!="undefined"&&a("#in_email").val(unescape(quakelive.params.email));typeof quakelive.params.error!="undefined"&&d.ShowLoginError(quakelive.params.error);nav.initNav({location:"#newnav_top",object:nav.navbar})};d.VerifyLoginForm=function(){if(a("#in_email").val().length==
0||a("#in_password").val().length==0){d.ShowLoginError("You must enter your email and password.");return false}return true};var b;d.ShowLoginError=function(k){if(b){clearTimeout(b);b=null}k=a("<p></p>").text(unescape(k));a("#loginError").fadeIn().html(k);a("#loginError p").effect("pulsate",{times:1},1E3);b=setTimeout(function(){b=null;a("#loginError").fadeOut()},3E4);quakelive.TrackEvent("Login","Error")};d.ResetFieldStyles=function(){var k=["in_email","in_password"];for(var c in k){formStyler.StyleAsDefault(k[c]);
a("#"+k[c]).focus(formStyler.FocusField);a("#"+k[c]).blur(formStyler.BlurField)}};quakelive.RegisterModule("login",d)})(jQuery);
(function(a){var d={},b=null;d.Init=function(){quakelive.AddHook("OnLayoutLoaded",d.checkSection)};d.LAYOUT="postlogin";d.ShowContent=function(k){quakelive.ShowContent(k);a("#previews > a").lightbox()};d.checkSection=function(){try{var k=true,c=a("#v-"+quakelive.valanceData.name);if(quakelive.pathParts[0]=="preview"){if(!b){b={};var e=["background-color","background-image","background-repeat","background-position"];for(var p in e){var x=e[p];b[x]=c.css(x)}}var t={dcmap07:"2009-6m6w-1",coldcaptures:"2009-6m6w-2",
bloodlust:"2009-6m6w-3",classicduel:"2009-6m6w-4",conundrum:"2009-6m6w-5",quarantine:"2009-6m6w-6"}[quakelive.pathParts[1]];if(t){c.css("background-color","#000033");c.css("background-image","url("+quakelive.resource("/css/valances/"+t+"/default.jpg")+")");c.css("background-repeat","no-repeat");c.css("background-position","center top");k=false}}if(k)for(x in b)c.css(x,b[x])}catch(z){}};d.ChooseModel=function(k){quakelive.userid&&SetCvar("model",k)};quakelive.RegisterModule("preview",d)})(jQuery);
(function(a){function d(O){var P=false;for(var R in O){var X=O[R],M=false;M=X==ca?parseInt(l.gameCfg[R])!=0:X==qa?parseInt(l.gameCfg[R])==0:l.gameCfg[R]==X;if(!M){P=true;break}}return!P}function b(O){return O.musthave&&!d(O.musthave)||O.canthave&&d(O.canthave)}function k(){var O=[],P=[],R=[],X=[];for(var M in ga){var W=ga[M];W.validGameType==false?P.push("#"+W.field):O.push("#"+W.field);b(W)?R.push("#"+W.field):X.push("#"+W.field)}O.length>0&&a(O.join(",")).show();P.length>0&&a(P.join(",")).hide();
R.length>0&&a(R.join(",")).addClass("setting_disabled");X.length>0&&a(X.join(",")).removeClass("setting_disabled")}function c(O,P){if(P.ECODE===0){var R=mapdb.getGameTypeByName(P.SERVER_INFO.GAME_TYPE),X=mapdb.getBySysName(P.SERVER_INFO.MAP_NAMES[0]),M=locdb.GetByID(P.SERVER_INFO.LOCATION_ID),W=quakelive.siteConfig.baseUrl+"/r/join/"+P.SERVER_INFO.INVITATION_CODE;quakelive.SendModuleMessage("OnPrivateServerLaunched",P.SERVER_INFO);qlPrompt({body:'<div id="match_invite"></div>',title:"Your match is now ready!",
customWidth:440,alert:true,okLabel:"Close"});var ea=a("#match_invite");ea.html(['Click the icon below or use the provided link to join your match:<br/><br/><div id=\'srvreq_match_details\'><div class=\'qlv_pls_box\' onclick=\'qlProcessing("Connecting to your match", "Please wait&hellip;", "Abort", function() { quakelive.mod_request.AbortPoll("',O,'") }); qlHidePrompt(); join_server("',P.SERVER_INFO.IP,":",P.SERVER_INFO.PORT,'", null, "',P.SERVER_INFO.PASSWORD,'"); return false\'><div class=\'gamerank rank_1\'><div class=\'rankicon rank_icon_1\'></div><div class=\'gamelabel\'></div><div class=\'gamelabel_shadow\'></div></div><img src="" alt="" width="165" height="124" class="thumb" /><div class="server_icons"></div><div class="qlv_pls_bg"><div class="pls_play"><a class="pls_play_btn" href="javascript:;"></a></div><div class="pls_premium"></div><div class="qlv_inner_box"><img src="" class="gameicon" /><div class="gametype"></div><img class="location_flag" src="" width="16" height="11" /><div class="location_text"></div></div></div></div><br /><input type=\'text\' value=\'',
W,"' readonly='readonly' onfocus='this.select()'/><br /><i>Your match will remain online until it has been empty for 15 minutes.</i></div>"].join(""));W={pacifier:"/images/levelshots/lg/default.jpg",resource:"/images/levelshots/lg/"+X.sysname+".jpg",target:ea.find(".thumb")};ea.find(".gametype").text(R.title);ea.find(".gamelabel,.gamelabel_shadow").text(X.name);ea.find(".gameicon").attr("src",quakelive.resource("/images/gametypes/sm/"+P.SERVER_INFO.GAME_TYPE+".png"));ea.find(".location_flag").attr("src",
quakelive.resource(M.GetFlagIcon()));ea.find(".location_text").text(M.GetCityState());quakelive.resourceLoader.Load(W);quakelive.TrackEvent("StartMatch","Started","",p())}else if(P.ECODE>0){qlProcessing("Starting your match",P.MSG+'&hellip;<br /><br /><i style="font-weight: normal">Please be patient, this may take a few minutes&hellip;</i><br /><br />',"Abort",function(){quakelive.mod_request.AbortPoll(O)});J=setTimeout(function(){e(O)},F)}else if(P.ECODE<0){qlAlert("Unable to start match",P.MSG);
quakelive.TrackEvent("StartMatch","Error",P.MSG,p())}}function e(O){a.ajax({url:"/request/status",type:"get",data:{token:O},dataType:"json",mode:"abort",port:"mod_request",retry:{attempts:3},success:function(P){P||(P={ECODE:1});c(O,P)},error:function(P,R){qlAlert("Error Checking Server Status","An internal error has occurred while checking your server's status");quakelive.TrackEvent("StartMatch","Error",R,p())}})}function p(){return parseInt(((new Date).getTime()-Q)/1E3)}function x(O,P){function R(na,
sa,la){return function(){var pa;pa=sa?a("#input_"+na).val():a("#select_"+na).val();if(la=="integer")pa=parseInt(pa);if(na=="premium"&&!pa)if(mapdb.getGameTypeByID(l.gameCfg.game_type).premium){a(this).val(g.premium);qlAlert("Freeze Tag Is Premium Only","You cannot choose to run a standard server with the Freeze Tag game type.");return false}l.SetGameCfg(na,pa);l.GameCfgUpdated();return true}}for(var X=[],M=0;M<P.length;++M)P[M].category==O&&X.push(P[M]);this.settings=X;X={};for(M in this.settings){var W=
this.settings[M];X[W.field]=W}this.settingsLookup=X;var ea=false;this.$container=null;this.Prepare=function(){var na=a("<div></div>");for(var sa in this.settings){var la=this.settings[sa];if(!(la.realm&&!quakelive.IsRealm(la.realm))){if(la.show){var pa=true;if(la.show=="headless_only")pa=quakelive.headless;if(!pa)continue}pa=a('<div class="setting" id="'+la.field+'">');for(var ua=0;ua<mapdb.GameTypes.MAX;++ua)la.game_types.hasGameType(ua)&&pa.addClass("gt_"+ua);ua=a('<div class="field">');ua.append("<label>"+
la.title+"</label>");ua.append("<span>"+la.description+"</span>");var ta=a('<div class="value">');if(la.input){la=a('<input id="input_'+la.field+'" type="'+(la.type=="password"?"password":"text")+'" maxlength="'+la.max_length+'" />').change(R(la.field,la.input,la.type));ta.append(la)}else{var za=a('<select id="select_'+la.field+'">').change(R(la.field,la.input,la.type));if(la.field=="location"){za.append('<option value="0">In My Vicinity</option>');locdb.InitLocationFilter(za,{showLAN:function(Ja){return quakelive.IsMemberOfAny(Ja.groupNames)},
showStandard:true})}else for(sa in la.values){var Ca=la.values[sa];za.append('<option value="'+Ca.value+'">'+Ca.name+"</option>")}ta.append(za)}pa.append(a('<div class="field_box"></div>').append(ua));pa.append(a('<div class="value_box"></div>').append(ta));pa.append('<div class="disabled_text">Not Applicable</div>');pa.append('<div class="cl"></div>');na.append(pa)}}sa=na.find("#select_player_slots").empty();sa.append('<option value="1">Just Me</option>');for(ua=2;ua<=24;ua+=2)sa.append('<option value="'+
ua+'">'+ua+" Players</option>");this.$container=na;this.$panel.find(".customizations").empty().append(this.$container)};this.Show=function(){};this.Hide=function(){};this.Modify=function(na,sa){if(sa.game_type||sa.arenas){this.$panel.find(".params").text("Default");var la=this;this.$container.find(".setting").each(function(){a(this);var za=la.settingsLookup[this.id];za.validGameType=za.game_types.hasGameType(na.game_type)?true:false})}if(sa.location){var pa=this.settingsLookup.sv_hostname;if(pa){pa=
pa.max_length;if(pa<4)pa=4;a("#input_sv_hostname").attr("maxlength",pa);var ua=na.sv_hostname;if(ua.length>pa)ua=ua.substr(0,pa);l.SetGameCfg("sv_hostname",ua);l.GameCfgUpdated()}}ua=false;for(var ta in this.settingsLookup){a("#"+ta).removeClass("setting_modified");if((pa=this.settingsLookup[ta])&&pa.validGameType!=false&&!b(pa)){this.SetField(ta,na[ta]);if(na[ta]!=l.defaultGameCfg[ta]){ua=true;a("#"+ta).addClass("setting_modified")}}}if(this.$panel.attr("id")=="panel_customize")this.$panel.find(".params").text("Required");
else if(this.$panel.attr("id")=="panel_unranked")this.$panel.find(".params").text(ua?"Unranked":"Ranked");k()};this.SetField=function(na,sa,la){ea=la;a("#select_"+na+", #input_"+na).val(sa);ea=false}}function t(O){var P;for(P=0;P<l.gameCfg.arenas.length;P++)if(l.gameCfg.arenas[P]==O.sysname)break;if(P==l.gameCfg.arenas.length)return"";return"Arena #"+(P+1)+" of "+l.gameCfg.arenas.length}function z(){a.ajax({url:"/request/myserver",type:"get",dataType:"json",success:function(O){if(O.ECODE==-1||!a.isArray(O.servers)||
O.servers.length==0)r();else{O=O.servers[0];m(O.public_id,O.host_address)}},error:function(){r()}})}function r(){if(ha){clearInterval(ha);ha=null}a("#my_server").hide()}function m(O,P){l.serverId=O;l.serverAddress=P;a("#my_server").show();ha||(ha=setInterval(z,fa))}var l={LAYOUT:"postlogin",TITLE:"Start a Match"},q={AUTO:1,MANUAL:2},u=q.MANUAL,g={game_type:mapdb.GameTypes.CTF,arenas:[],location:0,sv_hostname:"",sv_maxclients:"16",teamsize:"5",g_password:"",g_instagib:0,g_spawnarmor:1,player_slots:32,
player_invite_count:0,time_limit:10,round_limit:10,frag_limit:30,capture_limit:8,mercylimit:0,friendly_fire:0,dmflags:0,access:"public",friends_filter:"online",premium:1,map_tag:"",ruleset:1,pmove_AirControl:0,pmove_RampJump:0,armor_tiered:0,web_callVoteOptions:1,g_forceDmgThroughSurface:0,g_gravity:800,web_instantWeaponSwitch:0,g_spawnItemRune:1,g_spawnItemPowerup:1,g_quadDamageFactor:3,g_timeoutCount:3,g_timeoutLen:30,g_freezeEnvironmentalRespawnDelay:0,g_freezeResetArmorOnRound:0,g_freezeResetHealthOnRound:0,
g_freezeResetWeaponsOnRound:0,g_freezeRemovePowerupsOnRound:1,g_freezeThawWinningTeam:1,g_freezeRoundDelay:4E3,g_freezeThawTick:1,web_freezeWeapons:1,web_spawnSkillMatched:0},o={};o[mapdb.GameTypes.FFA]={arenas:["battleforged"],time_limit:15,frag_limit:50,friendly_fire:0,dmflags:0};o[mapdb.GameTypes.DUEL]={arenas:["aerowalk"],time_limit:10,frag_limit:0,friendly_fire:0,dmflags:0};o[mapdb.GameTypes.TDM]={arenas:["leviathan"],time_limit:20,frag_limit:0,friendly_fire:1,dmflags:0,teamsize:"4"};o[mapdb.GameTypes.FT]=
{arenas:["coldwar"],time_limit:20,frag_limit:0,friendly_fire:0,dmflags:0,teamsize:"6"};o[mapdb.GameTypes.CA]={arenas:["blackcathedral"],time_limit:20,round_limit:10,friendly_fire:0,dmflags:28,teamsize:"5"};o[mapdb.GameTypes.CTF]={arenas:["stonekeep"],time_limit:20,capture_limit:8,friendly_fire:0,dmflags:0,teamsize:"5"};l.OnModuleInit=function(){l.gameTypeData={};for(var O in o){var P={};P.cfg=a.extend({},g,o[O]);P.defaultCfg=a.extend({},g,o[O]);P.lockedCfg={};l.gameTypeData[O]=P}l.LoadSettings();
l.gameCfg=null;l.defaultGameCfg=null;l.gameCfgDelta={};for(var R in l.gameCfg)l.gameCfgDelta[R]=false};var y=function(){this.vector={};for(var O=0;O<arguments.length;++O)this.vector[arguments[O]]=true;this.hasGameType=function(P){return typeof this.vector[P]!="undefined"};this.getRandom=function(){var P=[];for(var R in this.vector)P.push(R);return P[Math.floor(Math.random()*P.length)]}},v=new y(mapdb.GameTypes.FFA,mapdb.GameTypes.DUEL,mapdb.GameTypes.FT,mapdb.GameTypes.TDM,mapdb.GameTypes.CA,mapdb.GameTypes.CTF),
C=new y(mapdb.GameTypes.FT,mapdb.GameTypes.TDM,mapdb.GameTypes.CA,mapdb.GameTypes.CTF),G=function(O){var P=a.extend({sentinel:"",box:"",margin:10},O),R;this.Scroll=function(){if(a(P.sentinel).length){var X=a(P.sentinel).offset().top,M=a(window).scrollTop();M>X?R.css("padding-top",M-X+P.margin+"px"):R.css("padding-top","0px")}};this.Prepare=function(){a(window).scroll(this.Scroll);R=a(P.box)}};l.ShowContent=function(O){if(!quakelive.IsLoggedIn()||quakelive.IsSecure())return false;quakelive.ShowContent(O);
quakelive.MakeHomeChooser("request");O={};for(var P in l.gameCfg)O[P]=true;for(P=0;P<2;++P)for(var R in ka){var X=ka[R];if(P==S.Wire){X.$panel=a("#"+R);l[R]=ka[R]}else P==S.Prepare&&X.Prepare()}l.SetGameType(l.defaultGameType);for(R in ka){X=ka[R];X.Modify(l.gameCfg,O)}l.GameCfgUpdated();(quakelive.pathParts[1]=="training"?new G({sentinel:"#prac_guidenavpanel_sentinel",box:".prac_guidenavpanel"}):new G({sentinel:"#summary_sentinel",box:".prac_summary"})).Prepare();l.BarClicked("panel_gametype",true);
l.BarClicked("panel_customize",true);l.BarClicked("panel_arena",true);l.BarClicked("panel_friends",true)};var H={game_type:true,player_invite_count:true,map_tag:true,friends_filter:true};l.SaveSettings=function(){var O=l.gameTypeData[l.gameCfg.game_type],P={};for(var R in O.cfg)H[R]||(P[R]=O.cfg[R]);P.ver=3;SetCvar("web_start_settings_"+l.gameCfg.game_type,JSON.stringify(P));SetCvar("web_start_gametype",l.gameCfg.game_type)};l.settingsLoaded=false;l.LoadSettings=function(){if(!l.settingsLoaded){l.settingsLoaded=
true;for(var O in l.gameTypeData){var P=l.gameTypeData[O],R=quakelive.cvars.Get("web_start_settings_"+O,"{}").value;R=quakelive.Eval(R);if(!R||typeof R.ver=="undefined"||parseInt(R.ver)!=3){SetCvar("web_start_settings_"+O,"{}");R={}}if(a.isArray(R.arenas)){for(var X=[],M=0;M<R.arenas.length;++M){var W=mapdb.getBySysName(R.arenas[M]);W&&W.hasGameType(O)&&X.push(W.sysname)}R.arenas=X;P.cfg=a.extend(P.cfg,R)}}l.defaultGameType=quakelive.cvars.Get("web_start_gametype",mapdb.GameTypes.CA).value}};var F=
1E3,J=null;l.AbortPoll=function(O){a.ajax({url:"/request/abort",type:"post",data:{token:O}});if(J){clearTimeout(J);J=null;a.ajaxAbort("mod_request")}qlHidePrompt();quakelive.TrackEvent("StartMatch","Abort","",p())};var Q;l.Play=function(){Q=(new Date).getTime();l.SaveSettings();if(l.gameCfg.arenas.length==0)qlPrompt({title:"Error Launching Server",body:"You must choose one or more arena in order to start a match.",alert:true});else{qlProcessing("Starting your server","Requesting server&hellip;<br /><br /><i style='font-weight: normal'>Please be patient, this may take a few minutes&hellip;</i><br /><br />");
var O=[];for(var P in aa)O.push(aa[P].jid.username);P=a.extend({},l.gameCfg);P.invitations=O;for(var R in P)if(a.isArray(P[R]))P[R]=P[R].join(",");O=mapdb.getGameTypeByID(l.gameCfg.game_type);P.gametype=O.name;quakelive.TrackEvent("StartMatch","Start");a.ajax({url:"/request/start",type:"post",data:P,retry:{attempts:3,tick:function(X){qlProcessing("Starting your server","Requesting server&hellip; Attempt "+X.failures+" of "+X.attempts+".<br /><br /><i style='font-weight: normal'>Please be patient, this may take a few minutes&hellip;</i><br /><br />")}},
dataType:"json",mode:"abort",port:"mod_request",success:function(X){if(X.ECODE!=0){qlAlert("Unable to start your match",X.MSG);quakelive.TrackEvent("StartMatch","Error",X.MSG)}else e(X.TOKEN)},error:function(X,M){qlAlert("Unable to launch your server","There was a problem launching your server.");quakelive.TrackEvent("StartMatch","Error",M)}})}};l.CheckArenaSlots=function(){l.gameCfg.arenas.length>=12?a("#panel_arena .content").addClass("arenas_noslots"):a(".arenas_noslots").removeClass("arenas_noslots")};
l.SetGameType=function(O){var P=l.gameTypeData[O],R=l.gameCfg;l.gameCfg=P.cfg;l.defaultGameCfg=P.defaultCfg;for(var X in l.gameCfg)l.SetGameCfg(X,l.gameCfg[X]);l.CheckArenaSlots();if(R){l.SetGameCfg("player_invite_count",R.player_invite_count);l.SetGameCfg("map_tag",R.map_tag);l.SetGameCfg("friends_filter",R.friends_filter);l.SetGameCfg("sv_hostname",R.sv_hostname);l.SetGameCfg("g_password",R.g_password);l.SetGameCfg("location",R.location);l.SetGameCfg("premium",R.premium);l.SetGameCfg("web_spawnSkillMatched",
R.web_spawnSkillMatched);l.SetGameCfg("access",R.access);l.SetGameCfg("sv_maxClients",R.sv_maxclients)}mapdb.getGameTypeByID(O).premium==true&&l.SetGameCfg("premium",1);l.gameCfg.game_type=null;l.SetGameCfg("game_type",O)};l.GetHostName=function(){var O="";if(l.gameCfg)O+=l.gameCfg.sv_hostname;return O};l.ResetCustomize=function(){for(var O in l.defaultGameCfg)l.panel_customize.settingsLookup[O]&&l.SetGameCfg(O,l.defaultGameCfg[O]);l.GameCfgUpdated()};l.PlayerClicked=function(O,P){var R=a(O);if(R.hasClass("plaque_selected")){for(var X=
0;X<aa.length;++X)if(aa[X].jid.username==P.jid.username){aa.splice(X,1);break}R.removeClass("plaque_selected");l.SetGameCfg("player_invite_count",l.gameCfg.player_invite_count-1);l.GameCfgUpdated()}else if(aa.length<32){aa.push(P);R.addClass("plaque_selected");l.SetGameCfg("player_invite_count",l.gameCfg.player_invite_count+1);l.GameCfgUpdated()}};var aa=[],ca="TRUE_VALUE",qa="FALSE_VALUE",ja={},ga=[{category:"normal",title:"Match Name",description:"The name to display for your match",field:"sv_hostname",
game_types:v,input:true,type:"string",max_length:"20",show:"headless_only"},{category:"normal",title:"Match Location",description:"Where in the world to host your match",field:"location",game_types:v,"default":0,values:[]},{category:"normal",title:"Match Visibility",description:"Control the players that can see your match",field:"access",game_types:v,"default":"public",type:"string",values:[{name:"All Players",value:"public"},{name:"Invited Players Only",value:"private"},{name:"Friends Only",value:"friends"}]},
{category:"normal",title:"Membership Level",description:"Minimum membership level needed to join",field:"premium",game_types:v,"default":1,type:"integer",values:[{name:"Premium",value:1},{name:"Standard",value:0}]},{category:"normal",title:"Skill Restriction",description:"Set the advertised skill level of the match",field:"web_spawnSkillMatched",game_types:v,"default":"0",type:"string",values:[{name:"Unrestricted",value:0},{name:"My Skill Level",value:1}]},{category:"normal",title:"Match Size",description:"Total players allowed in your match",
field:"sv_maxclients",game_types:v,"default":"public",type:"string",values:[{name:"2 players",value:2},{name:"4 players",value:4},{name:"6 players",value:6},{name:"8 players",value:8},{name:"10 players",value:10},{name:"12 players",value:12},{name:"14 players",value:14},{name:"16 players",value:16}]},{category:"advanced",title:"Match Password",description:"Secures access to your game (optional)",field:"g_password",game_types:v,"default":0,input:true,type:"string",max_length:"20",optional:true},{category:"advanced",
title:"Time Limit",description:"Length of the match in minutes",field:"time_limit",game_types:v,"default":"20",musthave:{premium:ca},type:"string",values:[{name:"None",value:0},{name:"5 Minutes",value:5},{name:"10 Minutes",value:10},{name:"15 Minutes",value:15},{name:"20 Minutes",value:20},{name:"30 Minutes",value:30}]},{category:"advanced",title:"Frag Limit",description:"End the game when frag limit is reached",field:"frag_limit",game_types:new y(mapdb.GameTypes.FFA,mapdb.GameTypes.TDM,mapdb.GameTypes.DUEL),
"default":"50",musthave:{premium:ca},type:"string",values:[{name:"None",value:0},{name:"10 Frags",value:10},{name:"20 Frags",value:20},{name:"30 Frags",value:30},{name:"50 Frags",value:50},{name:"100 Frags",value:100}]},{category:"advanced",title:"Round Limit",description:"End the game when team reaches round limit",field:"round_limit",game_types:new y(mapdb.GameTypes.FT,mapdb.GameTypes.CA),musthave:{premium:ca},"default":"10",type:"string",values:[{name:"None",value:0},{name:"2 Rounds",value:2},
{name:"5 Rounds",value:5},{name:"8 Rounds",value:8},{name:"10 Rounds",value:10},{name:"15 Rounds",value:15},{name:"20 Rounds",value:20}]},{category:"advanced",title:"Capture Limit",description:"End the game when team reaches round limit",field:"capture_limit",game_types:new y(mapdb.GameTypes.CTF),"default":"8",type:"string",musthave:{premium:ca},values:[{name:"None",value:0},{name:"5 Captures",value:5},{name:"8 Captures",value:8},{name:"10 Captures",value:10},{name:"15 Captures",value:15}]},{category:"advanced",
title:"Mercy Limit",description:"End the game when a team is winning by more than this amount",field:"mercylimit",game_types:C,"default":"0",type:"string",input:"true",max_length:"4",optional:"true"},{category:"advanced",title:"Team Size",description:"Number of players allowed per team",field:"teamsize",game_types:C,"default":"public",type:"string",values:[{name:"1 vs. 1",value:1},{name:"2 vs. 2",value:2},{name:"3 vs. 3",value:3},{name:"4 vs. 4",value:4},{name:"5 vs. 5",value:5},{name:"6 vs. 6",value:6},
{name:"7 vs. 7",value:7},{name:"8 vs. 8",value:8}]},{category:"advanced",title:"Friendly Fire",description:"Watch your fire!",field:"friendly_fire",game_types:C,"default":"0",type:"string",musthave:{premium:ca},values:[{name:"Off",value:0},{name:"On",value:1}]},{category:"advanced",title:"Damage Through Floors",description:"Rocket splash damage will penetrate floors",field:"g_forceDmgThroughSurface",game_types:v,"default":"0",type:"string",musthave:{premium:ca},canthave:{g_instagib:ca},values:[{name:"Off",
value:0},{name:"On",value:1}]},{category:"advanced",title:"Allow Callvote",description:"Adjust when in-game callvoting is allowed",field:"web_callVoteOptions",game_types:v,"default":"1",type:"string",values:[{name:"Disabled",value:0},{name:"Pre-game Only",value:1},{name:"Always",value:2}]},{category:"advanced",title:"Powerups",description:"Toggle powerup spawning",field:"g_spawnItemPowerup",game_types:new y(mapdb.GameTypes.FFA,mapdb.GameTypes.TDM,mapdb.GameTypes.DUEL,mapdb.GameTypes.CTF,mapdb.GameTypes.FT),
"default":"1",type:"string",musthave:{premium:ca},canthave:{g_instagib:1},values:[{name:"Off",value:0},{name:"On",value:1}]},{category:"advanced",title:"Runes",description:"Toggle rune spawning",field:"g_spawnItemRune",game_types:new y(mapdb.GameTypes.CTF),"default":"1",type:"string",musthave:{premium:ca},canthave:{g_instagib:ca},values:[{name:"Off",value:0},{name:"On",value:1}]},{category:"advanced",title:"Timeout Count",description:"Amount of timeouts a player/team has in a match",field:"g_timeoutCount",
game_types:v,"default":"3",type:"string",values:[{name:"0",value:0},{name:"1",value:1},{name:"2",value:2},{name:"3",value:3},{name:"4",value:4},{name:"5",value:5}]},{category:"advanced",title:"Timeout Length",description:"Length in seconds of a timeout",field:"g_timeoutLen",game_types:v,"default":"30",type:"string",canthave:{g_timeoutCount:0},values:[{name:"15",value:15},{name:"30",value:30},{name:"60",value:60},{name:"120",value:120}]},{category:"unranked",title:"Instagib Mode",description:"Start your match with instagib game settings",
field:"g_instagib",game_types:v,"default":"0",type:"string",values:[{name:"Off",value:0},{name:"On",value:1}]},{category:"unranked",title:"Ruleset",description:"Choose between the standard Quake Live and the advanced PQL physics.",field:"ruleset",game_types:v,"default":"1",type:"string",musthave:{premium:ca},values:[{name:"QL",value:1},{name:"PQL",value:2}]},{category:"unranked",title:"Air Control",description:"Allows a player to move in the direction they look, while airborn.",field:"pmove_AirControl",
game_types:v,"default":"0",type:"string",musthave:{premium:ca},canthave:{ruleset:2},values:[{name:"Off",value:0},{name:"On",value:1}]},{category:"unranked",title:"Ramp Jumping",description:"Jumping speed is added to vertical speed",field:"pmove_RampJump",game_types:v,"default":"0",type:"string",musthave:{premium:ca},canthave:{ruleset:2},values:[{name:"Off",value:0},{name:"On",value:1}]},{category:"unranked",title:"Tiered Armor",description:"Tiered armors offer increasingly stronger levels of protection.",
field:"armor_tiered",game_types:new y(mapdb.GameTypes.FFA,mapdb.GameTypes.DUEL,mapdb.GameTypes.TDM,mapdb.GameTypes.CTF,mapdb.GameTypes.FT),"default":"0",type:"string",musthave:{premium:ca},canthave:{ruleset:2},values:[{name:"Off",value:0},{name:"On",value:1}]},{category:"unranked",title:"Weapon Switch Speed",description:"Adjust how quickly weapons come out when switched",field:"web_instantWeaponSwitch",game_types:v,"default":"0",type:"string",musthave:{premium:ca},canthave:{ruleset:2},values:[{name:"Default",
value:0},{name:"Instant",value:1}]},{category:"unranked",title:"Quad Damage Factor",description:"Adjust the power of the Quad",field:"g_quadDamageFactor",game_types:new y(mapdb.GameTypes.FFA,mapdb.GameTypes.TDM,mapdb.GameTypes.DUEL,mapdb.GameTypes.CTF,mapdb.GameTypes.FT),"default":"0",type:"string",musthave:{g_spawnItemPowerup:ca},canthave:{g_instagib:ca},values:[{name:"Weak (2x)",value:2},{name:"Standard (3x)",value:3},{name:"Powerful (4x)",value:4},{name:"Excessive (6x)",value:6}]},{category:"unranked",
title:"Gravity",description:"Modify world gravity (100-1500, default 800)",field:"g_gravity",game_types:v,"default":"800",type:"string",musthave:{premium:ca},input:"true",max_length:"4",optional:"true"},{category:"unranked",title:"Environmental Respawn Delay",description:"Delay respawn by 5 seconds when player is killed by environment",field:"g_freezeEnvironmentalRespawnDelay",game_types:new y(mapdb.GameTypes.FT),"default":"0",type:"string",values:[{name:"Off",value:0},{name:"On",value:5E3}]},{category:"unranked",
title:"Reset Armor on Round",description:"Restores armor to starting value each round",field:"g_freezeResetArmorOnRound",game_types:new y(mapdb.GameTypes.FT),"default":"0",type:"string",canthave:{g_instagib:1},values:[{name:"Off",value:0},{name:"On",value:1}]},{category:"unranked",title:"Reset Health on Round",description:"Restores health to starting value each round",field:"g_freezeResetHealthOnRound",game_types:new y(mapdb.GameTypes.FT),"default":"0",type:"string",canthave:{g_instagib:1},values:[{name:"Off",
value:0},{name:"On",value:1}]},{category:"unranked",title:"Reset Weapons on Round",description:"Restores weapons to initial loadout each round",field:"g_freezeResetWeaponsOnRound",game_types:new y(mapdb.GameTypes.FT),"default":"0",type:"string",canthave:{g_instagib:1},values:[{name:"Off",value:0},{name:"On",value:1}]},{category:"unranked",title:"Reset Powerups on Round",description:"Removes all active powerups each round",field:"g_freezeRemovePowerupsOnRound",game_types:new y(mapdb.GameTypes.FT),
"default":"0",type:"string",musthave:{g_spawnItemPowerup:1},canthave:{g_instagib:1},values:[{name:"Off",value:0},{name:"On",value:1}]},{category:"unranked",title:"Thaw Winning Team",description:"Automatically thaw all players each round",field:"g_freezeThawWinningTeam",game_types:new y(mapdb.GameTypes.FT),"default":"1",type:"string",values:[{name:"Off",value:0},{name:"On",value:1}]},{category:"unranked",title:"Enable Round Delay",description:"Allow 4 second countdown in between rounds",field:"g_freezeRoundDelay",
game_types:new y(mapdb.GameTypes.FT),"default":"4000",type:"string",values:[{name:"Enabled",value:4E3},{name:"Disabled",value:0}]},{category:"unranked",title:"Thaw Tick",description:"Modify behavior of ticking sound while thawing",field:"g_freezeThawTick",game_types:new y(mapdb.GameTypes.FT),"default":"1",type:"string",values:[{name:"Disabled",value:0},{name:"Teammates Only",value:1},{name:"Global",value:2}]},{category:"unranked",title:"Additional Starting Weapons",description:"Change which additional weapons players spawn with",
field:"web_freezeWeapons",game_types:new y(mapdb.GameTypes.FT),"default":"1",type:"string",canthave:{g_instagib:ca},values:[{name:"None",value:0},{name:"SG + PG",value:1},{name:"All Weapons",value:2}]}];for(var ma in ga){y=a.extend({musthave:null,canthave:null},ga[ma]);ga[ma]=y;ja[y.field]=y}var ka={panel_gametype:new (function(){var O=[mapdb.GameTypes.FFA,mapdb.GameTypes.CA,mapdb.GameTypes.CTF,mapdb.GameTypes.FT,mapdb.GameTypes.TDM,mapdb.GameTypes.DUEL];this.Prepare=function(){function P(la){return function(){quakelive.mod_request.GameTypeClicked(la.id);
return false}}var R=a("<div></div>"),X=null,M;for(var W in O){if(W%3==0){M=O.length-W;if(M>3)M=3;M=100/M-0.5;if(X){X.append('<div class="cl"></div>');R.append(X)}X=a('<div class="cl" style="margin: 0 auto"></div>')}var ea=mapdb.getGameTypeByID(O[W]),na="/images/gametypes/md/"+ea.name+".png",sa=["btn_gametype","gt_"+ea.id];ea.premium&&sa.push("tag_PREMIUM");na={classes:sa.join(" "),perc:M,gt:ea,gt_url:quakelive.resource(na)};ea=a(ParseTemplate('<div class="<#=classes#>" style="width: <#=perc#>%"><div class="gametype_icon"><img src="<#=gt_url#>" width="45" height="45" /></div><div class="gametype_name"><#=gt.title#></div></div>',
na)).click(P(ea));X.append(ea)}X.append('<div class="cl"></div>');R.append(X);this.$panel.find(".gametypes").empty().append(R)};this.Show=function(){};this.Hide=function(){};this.Modify=function(P,R){if(R.game_type||R.premium){var X=mapdb.getGameTypeByID(P.game_type);this.$panel.find(".params").text(X.title);this.$panel.find(".btn_gametype").each(function(){var M=a(this);if(M.hasClass("gt_"+P.game_type))M.addClass("selected_gametype");else M.hasClass("selected_gametype")&&M.removeClass("selected_gametype")});
if(X.premium){a("#premium").addClass("setting_disabled");a("#select_premium").attr("disabled","disabled")}else{a("#premium").removeClass("setting_disabled");a("#select_premium").removeAttr("disabled")}}}}),panel_arena:new (function(){this.$container=null;this.Prepare=function(){var O=a("<div></div>");for(var P in mapdb.orderedMaps){var R=mapdb.maps[mapdb.orderedMaps[P]],X=[],M=["btn_arena","map_"+R.sysname,"plaque"];for(var W in R.tag_list){M.push("tag_"+R.tag_list[W]);var ea=mapdb.GetTag(R.tag_list[W]);
ea.title.length>0&&X.push(ea.title)}for(W in R.gametypes)M.push("gt_"+R.gametypes[W].gametype);X={levelshot:quakelive.resource("/images/levelshots/sm/"+R.sysname+".jpg"),classes:M.join(" "),tags:X.join(", "),map:R};X=a(ParseTemplate('<a title="Tags: <#=tags#>" class="<#=classes#>" href="javascript:;" onclick="quakelive.mod_request.ArenaClicked(this, \'<#=map.sysname#>\'); return false"><img class="levelshot" src="<#=levelshot#>" /><br /><#=map.name#><div class="add"></div><div class="remove"></div></a>',
X));O.append(X);R={pacifier:"/images/levelshots/sm/default.jpg",resource:"/images/levelshots/sm/"+R.sysname+".jpg",target:X.find(".levelshot")};quakelive.resourceLoader.Load(R)}O.append("<div class='cl'></div>");this.$panel.find(".arenas").append(O);mapdb.AddTagOptionGroups(a("#arena_filter"));this.$container=O};this.Show=function(){};this.Hide=function(){};this.CanShowMap=function(O,P){var R="tag_"+P.map_tag,X="gt_"+P.game_type;return(!P.map_tag||O.hasClass(R))&&O.hasClass(X)};this.Modify=function(O,
P){if(!(!P.game_type&&!P.map_tag&&!P.arenas&&!P.premium)){l.CheckArenaSlots();if(P.arenas){str=O.arenas.length==1?mapdb.getBySysName(O.arenas[0]).name:O.arenas.length>1?O.arenas.length+" arena rotation":"";this.$panel.find(".params").text(str)}if(P.game_type||P.map_tag||P.premium){a("#panel_arena .plaque_selected,#panel_arena .selected_arena").removeClass("plaque_selected selected_arena").addClass("plaque");for(var R in l.gameCfg.arenas){var X=mapdb.getBySysName(l.gameCfg.arenas[R]);a("#panel_arena .map_"+
X.sysname).addClass("plaque_selected selected_arena")}var M=this;this.$container.find(".btn_arena").each(function(){var W=a(this);!O.premium&&W.hasClass("tag_PREMIUM")?W.addClass("disabled"):W.removeClass("disabled");M.CanShowMap(W,O)?W.show():W.hide()})}P.premium&&parseInt(O.premium)==0&&l.RemovePremiumArenasFromList()}}}),panel_unranked:new x("unranked",ga),panel_advanced:new x("advanced",ga),panel_customize:new x("normal",ga),panel_friends:new (function(){this.$container=null;this.GetItemDetails=
function(){return null};this.FillData=function(){function O(M){var W="plaque";if(P[M.jid.username])W+=" plaque_selected";var ea=quakelive.xmppClient.roster.GetItemDetails(M.jid.username),na;na=M.IsVisible()?"/images/players/icon_sm/"+ea.icons.modelskin+".png":"/images/players/icon_gray_sm/"+ea.icons.modelskin+".png";W={id:M.jid.username,cssclass:W,imageUrl:quakelive.resource(na),playerName:StripColors(ea.clan.length>0?ea.clan+" "+ea.name:ea.name)};W=ParseTemplate('<div class="plaque_box"><a href="javascript:;" id="<#= id #>" class="<#= cssclass #>"><div class="add"></div><div class="remove"></div><img class="modelskin" src="<#= imageUrl #>" /><h1><#= playerName #></h1><div class="cl"></div></a></div>',
W);W=a(W);W.find("a").click(function(){l.PlayerClicked(this,M)});X.$container.append(W)}var P={};for(var R in aa)P[aa[R].jid.username]=true;var X=this;this.$container.empty();(l.gameCfg.friends_filter=="online"?quakelive.xmppClient.roster.IteratePresenceGroup(PresType.Available,O):l.gameCfg.friends_filter=="offline"?quakelive.xmppClient.roster.IteratePresenceGroup(PresType.Unavailable,O):quakelive.xmppClient.roster.Iterate(O))==0&&this.$container.append('<h1 class="panel_error">No friends match your filter</h1>');
this.$container.append('<div class="cl"></div>')};this.Prepare=function(){this.$container=a("<div>Waiting for Friends Roster&hellip;</div>");this.$panel.find(".players").empty().append(this.$container)};this.Modify=function(O,P){if(!(!P.player_invite_count&&!P.player_slots&&!P.friends_filter)){var R;R=O.player_invite_count==1?O.player_invite_count+" invitation":O.player_invite_count>0?O.player_invite_count+" invitations":"";this.$panel.find(".params").text(R);O.player_invite_count>=32?this.$panel.find(".content").addClass("players_noslots"):
this.$panel.find(".content").removeClass("players_noslots");if(P.player_invite_count){R=a(".summary_field_invitations .summary_field_data");R.empty();for(var X in aa)R.append(X+" ")}P.friends_filter&&this.FillData()}};this.Show=function(){};this.Hide=function(){}}),panel_launcher:new (function(){this.Prepare=function(){var O=ga,P=a(".summary_settings").empty(),R="normal";for(var X in O){var M=O[X];if(M.category!=R)R=M.category;P.append('<div class="category_'+R+" summary_field summary_field_"+M.field+
'"><span class="summary_field_name">'+M.title+'</span>: <span class="summary_field_data"></span></div>')}P.append('<br /><div class="summary_field summary_field_arenas" style="display: none"><b>Arena Rotation</b><br /><span class="summary_field_data"></span></div>');P.append('<div class="summary_field summary_field_invitations" style="display: none"><span class="summary_field_name">Invitations</span><br /><span class="summary_field_data"></span></div>')};this.UpdateFieldListing=function(O){for(var P in ja){var R=
ja[P];if(R){var X;a:{X=R;var M=O[P];if(X.type=="integer")M=parseInt(M);for(var W in X.values)if(X.values[W].value==M){X=X.values[W].name;break a}X=M}if(X.length==0&&R.optional)a(".summary_field_"+P).hide();else if(R.validGameType==false||b(R))a(".summary_field_"+P).hide();else{a(".summary_field_"+P).show();if(X.length==0){X='<span class="noneText">None</span>';a(".summary_field_"+P+" .summary_field_data").html(X)}else{if(P=="sv_hostname")X=l.GetHostName();else if(P=="location")if(X==0)X="In My Vicinity";
else{R=locdb.GetByID(X);if(!R){for(var ea in locdb.locations){R=locdb.locations[ea];break}l.gameCfg.location=R?R.id:0}if(R)X=R.countryAbbr+", "+R.GetCityState()}a(".summary_field_"+P+" .summary_field_data").text(X)}}}}};this.Modify=function(O,P){this.UpdateFieldListing(O,P);if(P.arenas){var R=a(".prac_summary .summary_field_arenas");if(l.gameCfg.arenas.length>0){var X=mapdb.getBySysName(l.gameCfg.arenas[0]),M={pacifier:"/images/levelshots/lg/default.jpg",resource:"/images/levelshots/lg/"+X.sysname+
".jpg",target:a(".prac_summary .summary_header"),targetType:"css"};quakelive.resourceLoader.Load(M);a(".prac_summary .map_title").text(X.name);var W=a("<div></div>"),ea=a('<div class="chosen_player_box"></div>');W.append(ea);for(var na in l.gameCfg.arenas){X=mapdb.getBySysName(l.gameCfg.arenas[na]);var sa=a('<img class="modelskin" width="32" height="24" title="'+X.name+'" />');M={pacifier:"/images/levelshots/xsm/default.jpg",resource:"/images/levelshots/xsm/"+X.sysname+".jpg",target:sa};quakelive.resourceLoader.Load(M);
quakelive.matchtip.BindMapTooltip(sa,X.sysname,t);ea.append(sa)}R.find(".summary_field_data").empty().append(W);R.show()}else{a(".prac_summary .summary_header").css({"background-image":"","background-color":"#8f8f8f"});a(".prac_summary .map_title").text("");R.hide()}}if(P.game_type){R=mapdb.getGameTypeByID(O.game_type);a(".prac_summary .summary_gametype").html('<img src="'+quakelive.resource("/images/gametypes/sm/"+R.name+".png")+'" /> <span style="position: relative; top: -9px;">'+R.title+"</span>")}if(P.player_slots||
P.player_invite_count){R=a(".prac_summary .summary_field_invitations");if(O.player_invite_count>0){W=a("<div>");ea=a('<div class="chosen_player_box"></div>');W.append(ea);for(var la in aa){X=quakelive.xmppClient.roster.GetItemDetails(aa[la].jid.username);ea.append('<img class="modelskin" src="'+quakelive.resource("/images/players/icon_sm/"+X.icons.modelskin+".png")+'" width="18" height="18" title="'+X.name+'" />')}R.find(".summary_field_data").empty().append(ea);R.show()}else R.hide()}for(la in ga){R=
ga[la];!R.game_types.hasGameType(O.game_type)||l.gameCfg[R.field]==g[R.field]||R.validGameType==false||b(R)?a(".summary_field_"+R.field).hide():a(".summary_field_"+R.field).show()}};this.Show=function(){};this.Hide=function(){}})};l.ph=ka;var S={Wire:0,Prepare:1,Modify:2};l.SetGameCfg=function(O,P){if(typeof l.gameCfg[O]!="undefined"){l.gameCfgDelta[O]=true;l.gameCfg[O]=P}};l.GameCfgUpdated=function(){var O=l.gameCfgDelta;l.gameCfgDelta={};for(var P in ka)ka[P].Modify(l.gameCfg,O)};l.BarClicked=function(O,
P){var R=ka[O];if(R)if(!P&&R.$panel.hasClass("panel_expanded")){R.$panel.removeClass("panel_expanded");R.Hide()}else{u==q.AUTO&&a(".panel_expanded").removeClass("panel_expanded");R.$panel.addClass("panel_expanded").show();R.Show()}};l.GameTypeClicked=function(O){l.SetGameType(O);l.GameCfgUpdated()};l.RemoveArenaFromList=function(O,P){P||(P=a(".map_"+O));for(var R in l.gameCfg.arenas)if(mapdb.getBySysName(l.gameCfg.arenas[R]).sysname==O){l.gameCfg.arenas.splice(R,1);break}P.removeClass("plaque_selected selected_arena").addClass("plaque");
l.SetGameCfg("arenas",l.gameCfg.arenas);l.GameCfgUpdated()};l.RemovePremiumArenasFromList=function(){var O=[],P=[];for(var R in l.gameCfg.arenas){var X=mapdb.getBySysName(l.gameCfg.arenas[R]);X.hasTag("PREMIUM")?P.push(X.sysname):O.push(X.sysname)}for(R in P)a(".selected_arena.tag_PREMIUM.map_"+P[R]).removeClass("plaque_selected selected_arena").addClass("plaque");P.length>0&&l.SetGameCfg("arenas",O)};l.AddArenaToList=function(O,P){P||(P=a(".map_"+O));if(l.gameCfg.arenas.length<12){l.gameCfg.arenas.push(O);
P.addClass("plaque_selected selected_arena").removeClass("plaque");l.SetGameCfg("arenas",l.gameCfg.arenas);l.GameCfgUpdated()}};l.ArenaClicked=function(O,P){var R=a(O);!l.gameCfg.premium&&R.hasClass("tag_PREMIUM")||(R.hasClass("plaque_selected")?l.RemoveArenaFromList(P,R):l.AddArenaToList(P,R))};l.server=null;l.serverId=0;l.serverAddress=null;l.ShutdownMyServer=function(){a.post("/request/stopserver",{server_id:l.serverId});r()};l.JoinMyServer=function(){join_server(l.serverAddress)};var fa=6E4,ha=
null;quakelive.AddHook("OnPrivateServerLaunched",function(O){m(O.SERVER_ID,O.IP+":"+O.PORT)});quakelive.AddOnceHook("OnContentLoaded",function(){quakelive.siteConfig.premiumStatus=="pro"&&!quakelive.IsSecure()&&!ha&&z()});quakelive.RegisterModule("request",l)})(jQuery);
(function(a){var d={};d.LAYOUT="postlogin";var b=undefined;d.latest=0;d.timeoutHandle=undefined;d.updateTime=15E3;d.Init=function(){};d.OnLayoutLoaded=function(){};d.Hook_OnContentLoaded=function(k){k!=d&&d.StopUpdates()};d.ShowContent=function(k){d.latest=0;quakelive.ShowContent(k);b=a("#recent_matches");d.StartUpdates()};d.StopUpdates=function(){if(d.timeoutHandle!=null){clearTimeout(d.timeoutHandle);d.timeoutHandle=null}};d.StartUpdates=function(){d.StopUpdates();d.DoUpdate()};d.DoUpdate=function(){a.ajax({type:"GET",
url:"/tracker/from/"+d.latest,dataType:"json",success:function(k){d.UpdateDisplay(k)},complete:function(){d.timeoutHandle=setTimeout(d.DoUpdate,d.updateTime)}});quakelive.Tick()};d.UpdateDisplay=function(k){if(k.length!=0){d.latest==0&&b.empty();d.latest=k[0].GAME_TIMESTAMP;for(var c=k.length-1;c>=0;c--){var e=k[c],p=a('<div class="matchDiv"><div class="map" title="Click for Details"></div><div class="content"></div></div>'),x=new Date(parseInt(e.GAME_TIMESTAMP,10)*1E3);x=[["Jan.","Feb.","Mar.","Apr.",
"May","Jun.","Jul.","Aug.","Sep.","Oct.","Nov.","Dec."][x.getMonth()]," ",x.getDate(),", ",x.getHours(),":",ZeroPad(x.getMinutes())].join("");var t=p.find(".map");t.append('<div class="levelshot"/>');var z=t.find(".levelshot");z.css("background-image",'url("'+quakelive.resource("/images/levelshots/md/"+e.MAP_NAME_SHORT+".jpg")+'")');z.append('<div class="gametype"><img src="'+quakelive.resource("/images/gametypes/sm/"+e.GAME_TYPE.toLowerCase()+".png")+'" width="28" height="28" /></div>');t.append('<div class="mapTitle">'+
e.MAP_NAME+"</div>");t.append('<div class="gameType">'+e.GAME_TYPE_FULL+"</div>");t.append('<div class="gameTimestamp">'+x+"</div>");x=ZeroPad(Math.floor(e.GAME_LENGTH/60))+":"+ZeroPad(e.GAME_LENGTH%60);t.append('<div class="gameLength">Duration: '+x+"</div>");t.data("id",e.PUBLIC_ID);t.data("gt",e.GAME_TYPE);t.click(function(){quakelive.statstip.OnClickStatsTooltip(p,a(this).data("id"),a(this).data("gt"),"tracker")});for(var r in quakelive.statstip.BOARD_DEFS)try{p.find(".content").append(quakelive.statstip.GetScoreboard(e,
quakelive.statstip.BOARD_DEFS[r],{show_optional:true}))}catch(m){}p.find(".content").append('<div class="cl"></div>');b.prepend(p)}}};quakelive.AddHook("OnContentLoaded",d.Hook_OnContentLoaded);quakelive.RegisterModule("tracker",d)})(jQuery);
(function(a){function d(){if(quakelive.activeModule==c){var o;o=quakelive.userid?a.extend({},quakelive.mod_home.filter,{max_servers:e}):p;quakelive.serverManager.RefreshServers(o);x=setTimeout(d,u*1E3)}}function b(){if(z){clearTimeout(z);z=null}var o=a("#qlv_welcome .welcome_banner");if(!(o.length==0||o.children().length==0)){if(!r){l=(l+1)%m.length;var y=a("<img src='"+quakelive.resource("/images/modules/welcome/banner_"+m[l]+".jpg")+"' width='640' height='160' />").load(function(){r||(a.browser.msie?
o.empty().append(y):o.fadeOut(function(){r||o.empty().append(y).fadeIn()}))})}z=setTimeout(b,1E3*t)}}function k(){var o=a("#welcome_carousel");if(o.length>0){var y=o.find("li").length,v=[],C=[];C.push('<span class="carousel_nav_prev"></span> ');for(var G=0;G<y;++G){v.push(".carousel_item_"+G);C.push('<span class="carousel_nav_item carousel_item_'+G+(G==0?" carousel_nav_selitem":"")+'"></span> ')}C.push('<span class="carousel_nav_next"></span>');C.push('<div class="cl"><div>');a("#welcome_carousel_nav_inner").html(C.join(""));
o.jCarouselLite({auto:15E3,speed:500,visible:1,circluar:true,btnNext:".carousel_nav_next",btnPrev:".carousel_nav_prev",btnGo:v,afterEnd:function(H,F){var J=(F-1)%y;a(".carousel_nav_selitem").removeClass("carousel_nav_selitem");a(".carousel_item_"+J).addClass("carousel_nav_selitem")},beforeStart:function(){}})}}var c={TITLE:"Welcome",LAYOUT:"postlogin"},e=3,p={filters:{group:"any",game_type:"any",arena:"any",state:"any",difficulty:"any",location:"any","private":0},arena_type:"",players:[],game_types:[],
ig:0,max_servers:e},x=null,t=25,z=null,r=false,m=["fun","fast","free"],l=parseInt(Math.random()*m.length),q=true,u,g=["%USER is ready to go!","%USER is ready to rock!","%USER needs frags &#151; badly!"];c.ReloadServerList=function(){if(x!=null){clearTimeout(x);x=null}d()};c.HoverFeatureOn=function(o){r=true;q=false;a("#qlv_welcome .welcome_banner").html('<embed src="'+quakelive.resource("/flash/welcome/feature_detail_"+o+".swf")+'" wmode="opaque" quality="high" bgcolor="#333333" width="640" height="160" name="default" align="middle" allowscriptaccess="always" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />')};
c.HoverFeatureOff=function(){if(--l<0)l=m.length-1;r=false;q&&b()};c.FeatureDone=function(){q=true;r||b()};c.ShowContent=function(o){quakelive.ShowContent(o);a("#qlv_chatfill").hide();quakelive.MakeHomeChooser("welcome");var y;if(quakelive.userstatus=="REGISTERED"){if(ReadCookie("newaccount"))y="Welcome to Quake Live, %USER!"}else if(quakelive.userstatus=="ACTIVE")if(ReadCookie("newtraining"))y="You're now ready to play online!";y||(y=g[parseInt(Math.random()*g.length)]);y=y.replace("%USER",quakelive.username);
a("#qlv_welcome .top_heading").html(y);b();u=quakelive.userid?45:60;o=new quakelive.ServerPreviewIconView;o.SetDisplayProps({target:"qlv_welcome_matches",max:3});quakelive.serverManager.listener=o;c.ReloadServerList();quakelive.mod_home&&quakelive.mod_home.LoadQuickStats();k();o=a("#tips_carousel");o.length>0&&o.find("li").length>1&&o.jCarouselLite({auto:25E3,speed:500,visible:1,circluar:true})};c.ShowRegisterPrompt=function(){qlPrompt({title:"Registration Required to Play",body:"You're just a few clicks away from playing the most exciting and energetic game on the Internet!  Complete the quick and easy registration to start playing now!",
ok:function(){quakelive.Goto("register","returnto=welcome");qlHidePrompt()},okLabel:"Register Now",cancelLabel:"Close"})};c.BuildAjaxSuccessHandlers=function(o,y,v,C){var G={};C||(C=[]);G.onSuccess=function(H){if(typeof H.ECODE!="undefined"&&H.ECODE===o){C.unshift(H);return y.apply(C)}else return v.apply(C,[])};G.onError=function(){return v.apply(C,arguments)};return G};c.BypassSuccess=function(){qlProcessing("Your Skill has Been Updated!","Updating account for online play&hellip;");quakelive.TrackEvent("Training",
"Success");setTimeout(function(){quakelive.PageRedirect("/user/login_redirect")},1E3)};c.BypassFailed=function(o,y){qlAlert("Failed to Update Your Skill","There has been a problem updating your skill. Please try again later.");quakelive.TrackEvent("Training","Error",y[1])};c.ChooseSkill=function(o){qlProcessing("Manually Updating Your Skill","Please Wait&hellip;");var y=c.BuildAjaxSuccessHandlers(0,c.BypassSuccess,c.BypassFailed);a.ajax({url:"/user/bypass_skill_test/"+o,type:"post",mode:"abort",port:"skill_test",
dataType:"json",success:y.onSuccess,error:y.onError});quakelive.TrackEvent("Training","ChoseSkill",o)};quakelive.RegisterModule("welcome",c)})(jQuery);
(function(a){var d={},b=null;d.Init=function(){quakelive.AddHook("OnLayoutLoaded",d.checkSection)};d.LAYOUT="postlogin";d.ShowContent=function(k){quakelive.ShowContent(k);a("#previews > a").lightbox()};d.checkSection=function(){try{var k=true,c=a("#v-"+quakelive.valanceData.name);if(quakelive.pathParts[0]=="review"){if(!b){b={};var e=["background-color","background-image","background-repeat","background-position"];for(var p in e){var x=e[p];b[x]=c.css(x)}}var t={dcmap07:"2009-6m6w-1",coldcaptures:"2009-6m6w-2",
bloodlust:"2009-6m6w-3",classicduel:"2009-6m6w-4",conundrum:"2009-6m6w-5"}[quakelive.pathParts[1]];if(t){c.css("background-color","#000033");c.css("background-image","url("+quakelive.resource("/css/valances/"+t+"/default.jpg")+")");c.css("background-repeat","no-repeat");c.css("background-position","center top");k=false}}if(k)for(x in b)c.css(x,b[x])}catch(z){}};quakelive.RegisterModule("review",d)})(jQuery);
(function(a){var d={LAYOUT:"postlogin",TITLE:"Join a Match"};d.currentServerAddress=undefined;d.DoServerLookup=function(b){quakelive.serverManager.RefreshServerDetails(b,{onSuccess:function(){d.AjaxSuccess(b)},onError:function(){d.AjaxError(b)},port:"joinserver"})};d.CheckForJoin=function(){if(!(qlXfer.currentGroup<GROUP_EXTRA)){var b=quakelive.pathParts[1];""+parseInt(b)==b?d.DoServerLookup(b):a.ajax({url:"/request/rsvp",data:{inv_code:b},dataType:"json",success:function(k){k.host?d.DoServerLookup(k.player_id):
d.ShowJoinError("The requested match doesn't exist.<br /><br />Your match may have already expired, or the invitation code may not have been typed properly.")},error:d.AjaxError})}};d.ShowContent=function(b){if(quakelive.IsLoggedIn()){quakelive.ShowContent(b);d.CheckForJoin()}};d.AjaxSuccess=function(b){var k=quakelive.serverManager.GetServerInfo(b);if(k){b=new quakelive.ServerIconView;b.SetDisplayProps({target:"qlv_match_join",hide_best_pick:true});k.hidden=false;quakelive.serverManager.listener=
b;quakelive.serverManager.OnStartRefreshServers();if(quakelive.activeModule==d){quakelive.serverManager.UpdateServers([k]);quakelive.serverManager.OnRefreshServersSuccess()}a(".playButton").click(function(){d.ServerJoin(k)})}else d.ShowJoinError("The match you attempted to join no longer exists.")};d.ServerJoin=function(b){if(b){var k=new LaunchGameParams;k.Append("+connect "+b.host_address);LaunchGame(k,b)}};d.AjaxError=function(){d.ShowJoinError("We were unable to retrieve the details for the requested match.")};
d.ShowJoinError=function(b){a(".top_join_heading").html("Oops! Something doesn't look right here&hellip;");a("#qlv_match_join").css("width","100%").html("<p class='tc TwentyPxTxt orangeTxt'>"+b+"</p>")};d.OnServerListReload=function(){if(quakelive.activeModule==d){a("#qlv_match_join").css("width","auto");a(".top_join_heading").html("Join the match and start fragging!");a(".back_server_button, .playButton, .join_notification, .join_matches_header").css("visibility","visible").show()}};d.SetJoinURL=
function(b,k){var c=quakelive.Eval(k),e=a("#qlv_game_mode"),p=e.find(".url_link");if(c.sv_gtid!==undefined){d.currentServerAddress=quakelive.siteConfig.baseUrl+"/r/join/"+c.sv_gtid;quakelive.StopPathMonitor();quakelive.SetAnchor("join/"+c.sv_gtid);quakelive.StartPathMonitor();a("#url_link_input").unbind("blur").blur(function(x){a(x.target).hide().val("")});p.html('<img src="'+quakelive.resource("/images/link_glow.png")+'" width="26" height="26" style="vertical-align: middle;" /> <b>Show link for this match</b>').unbind("click").click(function(){a("#url_link_input").show().focus().val(quakelive.mod_join.currentServerAddress).get(0).select()})}else{d.currentServerAddress=
undefined;e.find(".url_link").text("Quake Live").unbind("click")}};d.Hook_OnGameExited=function(){d.currentServerAddress=undefined;var b=quakelive.GetPathHistory(0)||"";if(!b||b.indexOf("join")!=-1)b=quakelive.GetUserHome();quakelive.Goto(b)};quakelive.AddHook("OnGameExited",d.Hook_OnGameExited);quakelive.RegisterModule("join",d)})(jQuery);
(function(a){function d(m,l){a(m).removeClass("ff_state_ok").addClass("ff_state_error").find(".ff_status_text").text(l)}function b(m){a(m).removeClass("ff_state_error").addClass("ff_state_ok")}function k(m,l){a(m).removeClass("ff_state_error ff_state_ok");l&&a(m).find(".ff_status_text").text(l)}function c(m,l){a(m).each(function(q,u){var g=a(u);if(l.type=="text"||l.type=="textarea"||l.type=="password"||l.type=="checkbox"){var o=a(t[l.type]);l.title?a("label",o).text(l.title):a("label",o).hide();inputType=
l.type=="textarea"?"textarea":"input";a(inputType,o).attr("tabindex",l.tabindex||0).attr("name",l.name).attr("id",l.name).focus(function(){if(!g.hasClass("ff_state_error")&&l.type!="checkbox"){a(".ff_status_text",o).html(l.help);o.addClass("ff_state_focus")}}).blur(function(){o.removeClass("ff_state_focus ff_state_error ff_state_ok");if(l.validate){var ca=o;l.validate(function(){ca.removeClass("ff_state_error").addClass("ff_state_ok")},function(qa){ca.removeClass("ff_state_ok").addClass("ff_state_error");
a(".ff_status_text",ca).html(qa)})}});if(l.maxlength&&!l.validate){var y=o,v=l.maxlength,C=v;if(l.value)C-=l.value.length;a(inputType,y).attr("maxlength",l.maxlength).keyup(function(){C=a(this).val()?v-a(this).val().length:v;if(C<0){var ca=C*-1;a(".ff_status_text",y).html(ca+" over the limit of "+v);y.removeClass("ff_state_ok").addClass("ff_state_error")}else{a(".ff_status_text",y).html(C+" characters remaining.");y.removeClass("ff_state_error").addClass("ff_state_ok")}});a(".ff_status_text",y).html(C+
" characters remaining.")}l.tabindex==1&&a(inputType,o).focus();if(l.type=="checkbox"){l.help&&a(".ff_status_checkbox",o).html(l.help);a("label",o).attr("for",l.name)}l.cols&&a(inputType,o).attr("cols",l.cols);if(l.width){o.find(inputType).css("width",l.width+"px");o.find(".ff_field_wrapper,label").css("width",parseInt(l.width)+6+"px");o.css("width",parseInt(l.width)+6+"px")}l.align&&a(inputType,o).css("text-align",l.align);if(l.value)l.type=="checkbox"?a(inputType,o).attr("checked",true):a(inputType,
o).val(l.value);l.rows&&a(inputType,o).attr("rows",l.rows);g.empty().append(o)}else if(l.type=="birthdate"){o=a(t[l.type]);a("label",o).text(l.title);var G,H,F=function(){if(l.validate){var ca=o;l.validate(function(){ca.removeClass("ff_state_error").addClass("ff_state_ok")},function(qa){ca.removeClass("ff_state_ok").addClass("ff_state_error");a(".ff_status_text",ca).html(qa)})}};G=a(".ff_select_month",o).attr("tabindex",l.tabindex+0).attr("name",l.name+"_month").change(F);H='<option value="0">Month</option>';
var J="January|February|March|April|May|June|July|August|September|October|November|December".split("|");for(q=0;q<J.length;++q)H+='<option value="'+(q+1)+'">'+J[q]+"</option>";G.empty().append(H);G=a(".ff_select_day",o).attr("tabindex",l.tabindex+1).attr("name",l.name+"_day").change(F);H='<option value="0">Day</option>';for(q=0;q<31;++q)H+='<option value="'+(q+1)+'">'+(q+1)+"</option>";G.empty().append(H);G=a(".ff_select_year",o).attr("tabindex",l.tabindex+2).attr("name",l.name+"_year").change(F);
H='<option value="0">Year</option>';F=(new Date).getFullYear();for(q=0;q<100;++q)H+='<option value="'+(F-q)+'">'+(F-q)+"</option>";G.empty().append(H);g.empty().append(o)}else if(l.type=="captcha"){o=a(t[l.type]);a("label",o).text(l.title);a("input",o).focus(function(){if(!g.hasClass("ff_state_error")){a(".ff_status_text",o).html(l.help);o.addClass("ff_state_focus")}}).blur(function(){o.removeClass("ff_state_focus");if(l.validate){var ca=o;l.validate(function(){ca.removeClass("ff_state_error").addClass("ff_state_ok")},
function(qa){ca.removeClass("ff_state_ok").addClass("ff_state_error");a(".ff_status_text",ca).html(qa)})}}).attr("tabindex",l.tabindex||0).attr("name",l.name);g.empty().append(o);a(".btn_refresh",o).click(function(){RefreshCaptchaField(m);a("input",o).val("").focus()});RefreshCaptchaField(m)}else if(l.type=="colorpalette"){G="";g.empty();for(H=1;H<8;H++){F="";J=p[H].color;var Q=J.substr(0,1).toUpperCase()+J.substr(1);if(H==1)F+="palette_icon_selected";G+='<div class="color_block"><div class="interactive palette_icon '+
F+'" style="background-image: url('+quakelive.resource("/images/modules/account/palette-"+J+".png")+')" id="Palette-'+J+'" title="'+Q+'"></div></div>'}G+='<div class="color_block"><div class="palette_icon interactive" id="Palette-C" title="Toggle Capitalization"></div></div>';g.append('<div id="color_list">'+G+"</div>");for(H=1;H<8;H++)a("#Palette-"+p[H].color,g).click(function(){e.PaletteSetColor(this.id)});a(".reset").click(function(){e.ResetColors()});a("#Palette-C").click(function(){e.CaseChange()})}else if(l.type==
"colorize"){o=a(t[l.type]);a("label",o).html(l.title);G=quakelive.cvars.Get("name").value;F=quakelive.username;if(F.toLowerCase()!=StripColors(G).toLowerCase())G=F;F=0;J="";for(Q=0;Q<G.length;Q++){var aa=G.charAt(Q);F++;if(aa=="^"){Q++;for(q=1;q<8;q++)if(p[q].code==G.charAt(Q))H=p[q].color;currentPalette=H?"color_palette_"+H:"color_palette_white";Q++;aa=G.charAt(Q);J+='<td><div class="color_letter interactive '+currentPalette+'" id="tag-'+F+'" title="Click to style this letter">'+aa+"</div></td>"}else J+=
'<td><div class="color_letter interactive color_palette_white" id="tag-'+F+'" title="Click to style this letter">'+aa+"</div></td>"}a(".ff_colorize_wrapper",o).html('<table cellspacing="0" cellpadding="0" border="0" align="center"><tr>'+J+"</tr></table>");g.empty().append(o)}})}var e={LAYOUT:"account_mgt",TITLE:"Account Administration"},p={1:{color:"red",code:1,html:"#f00"},2:{color:"magenta",code:6,html:"#f07"},3:{color:"yellow",code:3,html:"#ff0"},4:{color:"green",code:2,html:"#0f0"},5:{color:"cyan",
code:5,html:"#08f"},6:{color:"blue",code:4,html:"#00f"},7:{color:"white",code:7,html:"#fff"}};"|#f00|#0f0|#ff0|#00f|#08f|#f07|#fff".split("|");var x=0,t={text:'<div class="ff_type_text"><div class="ff_status_icon"></div><label></label><div class="ff_field_wrapper"><div class="ff_input_wrapper"><input type="text" /></div><div class="ff_status_text">&nbsp;</div></div></div>',colorize:'<div class="ff_type_color"><div class="ff_colorize_wrapper"></div></div>',checkbox:'<div class="ff_type_checkbox"><div class="ff_checkbox_wrapper"> <input type="checkbox" /></div><div class="ff_field_wrapper"><div class="ff_label"><label></label></div></div></div><div class="cl"></div>',
textarea:'<div class="ff_type_textarea"><div class="ff_field_wrapper"><div class="ff_input_wrapper"><textarea></textarea></div><div class="ff_status_text">&nbsp;</div></div></div>',password:'<div class="ff_type_password"><div class="ff_status_icon"></div><label></label><div class="ff_field_wrapper"><div class="ff_input_wrapper"><input type="password" /></div><div class="ff_status_text">&nbsp;</div></div></div>'};quakelive.AddHook("OnCharacterChanged",function(m){e.UI_ChangeCharacter(m)});a(".accountHome").click(function(){window.location.href=
quakelive.siteConfig.baseUrl+"/"+quakelive.GetUserHome()});e.GetTemplate=function(m){var l=a("#account");qlProcessing("Please Wait","Loading Data...","Abort",function(){a.ajaxAbort("template");qlHidePrompt()});var q=m.charAt(0).toUpperCase()+m.substr(1);a.ajax({url:"/account/"+m,type:"get",dataType:"json",port:"template",mode:"abort",error:function(){qlAlert("Unable to load template","We were unable to load the requested template. Please try again")},success:function(u){if(u.options.Code){a("#emailPending").show();
u.options.okLabel="Confirm"}qlHidePrompt();qlPrompt({title:u.options.title,body:u.template,hideButtons:false,showX:true,id:"account",alert:u.options.alert,customWidth:u.options.width,customHeight:u.options.height,top:u.options.top,ok:u.options.ok?e[u.options.ok]:e["Edit"+q],okLabel:u.options.okLabel?u.options.okLabel:"Save",cancel:function(){qlHidePrompt(a("#account"))},cancelLabel:u.options.cancelLabel?u.options.cancelLabel:"Cancel"});var g,o=u.options.fields;for(f in o){var y=o[f];if((y.tabindex==
1||!y.tabindex)&&!g)g=f;c("."+f.toLowerCase(),{name:f,title:y.fieldTitle,type:y.fieldType,help:y.help,rows:y.fieldRows,cols:y.fieldCols,width:y.fieldWidth,align:y.fieldAlign,height:y.fieldHeight,maxlength:y.maxlength,validate:e[y.validate],tabindex:y.tabindex,value:y.value})}a("#resetCode").click(function(){e.ResetCode()});a("#resendEmail").click(function(){e.ResendEmail()});g&&a("#"+g).focus();m=="delete"&&e.BindDelete();m=="cancelsubscription"&&e.BindCancel();u.options.desc&&a("#qlv_"+m+" .desc").html(u.options.desc);
if(m=="nametag"){g=quakelive.cvars.Get("name").value;for(o=1;o<=g.length;o++)a("#tag-"+o).click(function(){e.ChangeColor(this.id)}).hover(function(){if(document.selection&&document.selection.createRange().text)document.selection.empty();else window.getSelection&&window.getSelection().removeAllRanges()})}if(m=="notifications"){quakelive.cvars.GetIntegerValue("web_chattimestamps")&&a("#chat_timestamps").attr("checked","checked");quakelive.cvars.GetIntegerValue("web_advancedbrowser")&&a("#advanced_browser").attr("checked",
"checked");ReadCookie("xi")&&a("#chat_invisible").attr("checked","checked")}if(m=="country"){$select=a('<select id="newcountry">');u=u.options.countries;for(g=0;u[g];g++){o=u[g];if(o.DISABLED!=1)$select.append("<option value='"+o.COUNTRY_ABBREV+"' "+(o.SELECTED===true?'selected="selected"':"")+">"+o.COUNTRY_NAME+"</option>")}a("#qlv_country").append($select)}},error:function(){qlHidePrompt(l);qlAlert("Popup Error","There was an internal error loading the template for this option. Please try again.")}})};
e.ViewPassword=function(){e.GetTemplate("password")};e.ViewEmail=function(m){e.GetTemplate("email");m&&a("#emailCode").val(m)};e.ViewPaymenthistory=function(){e.GetTemplate("paymenthistory")};e.ViewMyTokens=function(){e.GetTemplate("mytokens")};e.ViewNametag=function(){e.GetTemplate("nametag")};e.ViewBio=function(){e.GetTemplate("bio")};e.ViewToken=function(){e.GetTemplate("token")};e.ViewConfirmation=function(){e.GetTemplate("confirmation")};e.ViewNotifications=function(){e.GetTemplate("notifications",
"Update your Notifications")};e.ViewDelete=function(){e.GetTemplate("delete")};e.ViewCancelSubscription=function(){e.GetTemplate("cancelsubscription")};e.ViewDeletesubscription=function(){e.GetTemplate("deletesubscription")};e.ViewGenerateToken=function(){e.GetTemplate("generatetoken")};e.ViewCountry=function(){e.GetTemplate("country")};e.popups={redeem:e.ViewToken};e.EditDeleteSubscription=function(){var m=a("#account"),l=[];qlBeginSaving(m,"Deleting...");var q=0;a("#qlv_deletesubscription input").each(function(){var u=
a(this);if(u.attr("type").toLowerCase()=="checkbox")if(u.attr("checked")){l[q]=u.val();q++}});if(l[0])a.ajax({type:"post",url:"/account/deletesubscription",dataType:"json",data:{levels:l},success:function(u){if(u.ECODE==0){qlHidePrompt(m);qlPrompt({title:"Your Change Requires a Page Reload",body:"To apply your changes you must reload QUAKE LIVE.",ok:function(){qlProcessing("Reloading QUAKE LIVE","Please Wait&hellip;");window.location.reload()},okLabel:"Reload Now",alert:true,showX:false})}else{qlError(m,
"Subscription Delete Error");qlEndSaving(m,"Delete")}},error:function(){qlEndSaving(m,"Delete");qlError(m,"An internal error has occurred when attempting to delete your subscription. Please try again.")}});else{qlEndSaving(m,"Delete");qlError(m,"Please Choose a Subscription")}};e.EditGenerateToken=function(){var m=a("#account");qlBeginSaving(m,"Generating...");a.ajax({type:"post",url:"/account/generatetoken",dataType:"json",data:m.find("form").formToArray(),success:function(l){if(l.ECODE==0){qlHidePrompt(m);
qlAlert("Successful Token Generation",l.MSG)}else{qlError(m,"Token Generation Failed");qlEndSaving(m,"Generate!")}},error:function(){qlError(m,"An internal error has occurred when attempting to delete your subscription. Please try again.");qlEndSaving(m,"Generate!")}})};e.EditNotifications=function(){var m=a("#account");qlBeginSaving(m);var l=a("#qlv_notifications input"),q=[],u=false,g=a("#chat_timestamps").attr("checked")?1:0,o=a("#advanced_browser").attr("checked")?1:0,y=a("#chat_invisible").attr("checked")?
1:0,v=a("#chat_invisible").length,C={chat_invisible:true,chat_timestamps:true,mailing_list:true};l.each(function(){var G=a(this);if(this.tagName.toLowerCase()=="input")if(G.attr("type").toLowerCase()=="checkbox"&&G.attr("checked")==false&&this.name&&!C[this.name])q[q.length]=this.name});if(q.length>0)u=q.join(",");a.ajax({type:"post",url:"/account/notifications",dataType:"json",data:{notifications:u,mailing_list:a("#mailing_list").attr("checked")},success:function(){qlHidePrompt(m);if(v&&y!=SafeParseInt(ReadCookie("xi")))y?
CreateCookie("xi",1,7):EraseCookie("xi");SetCvar("web_chattimestamps",g);SetCvar("web_advancedbrowser",o)},error:function(){qlEndSaving(m);qlError(m,"An internal error has occurred when attempting to change your notifications. Please try again.")}})};e.ShowContent=function(m){quakelive.ShowContent(m);if(quakelive.IsLoggedIn()&&typeof quakelive.params.popup!="undefined"){m=quakelive.params.popup;typeof e.popups[m]!="undefined"&&e.popups[m].apply(e)}switch(quakelive.path){case "account/confirmation":a.ajax({type:"post",
url:"/account/confirmation",dataType:"json",data:{email:quakelive.params.email,emailCode:quakelive.params.emailCode},success:function(l){l.ECODE==0?qlPrompt({title:"Email Address Change Confirmed!",body:"Your email address has now updated.<br /><br />You will need to be sure to log in as <b>"+l.EMAIL+"</b> from now on.",okLabel:"Continue",ok:function(){qlHidePrompt();quakelive.GotoInsecure(quakelive.GetUserHome())},alert:true}):qlPrompt({title:"Unable to validate your email address",body:l.MSG,okLabel:"Go Home",
ok:function(){qlHidePrompt();quakelive.GotoInsecure(quakelive.GetUserHome())},showX:false,alert:true})},error:function(){qlError($prompt,"An internal error has occurred when attempting to change your email address. Please try again.")}});default:if(e.animated){a(".account_tab").css({height:"400px",bottom:0});a(".account_buttons").show()}else{a(".account_tab").animate({height:"400px",bottom:0},{duration:400,specialEasing:{height:"easeOutBounce"},complete:function(){a(".account_buttons").fadeIn("fast")}});
e.animated=true}}};e.ResetCode=function(){var m=a("#account");a.ajax({type:"post",url:"/account/resetemailcode",dataType:"json",success:function(){qlHidePrompt(m);qlAlert("Change Email Address Cancelled","<b>Your email address change has been cancelled.</b>");a("#emailPending").hide()},error:function(){qlAlert("Cancel Error","An internal error has occurred when attempting to cancel your change email address. Please try again.")}})};e.ResendEmail=function(){var m=a("#account");a.ajax({type:"post",
url:"/account/resendemail",dataType:"json",success:function(l){qlAlert("Address Confirmation Resent","A new address confirmation email has been sent to <b>"+l.MSG+"</b>.")},error:function(){qlError(m,"An internal error has occurred when attempting to send your email validation code. Please try again.")}})};e.BindDelete=function(){var m=a(".tell_us");a("#tell_story").find("input,textarea").focus(function(){}).blur(function(){});a("#tell_story").find("input[type='radio']").click(function(){x=a(this).val();
x=="other"?m.show():m.hide()})};e.BindCancel=function(){var m=a(".tell_us");a("#tell_story").find("input,textarea").focus(function(){}).blur(function(){});a("#tell_story").find("input[type='radio']").click(function(){x=a(this).val();x=="other"?m.show():m.hide()})};e.DoDelete=function(){var m=false,l=a("#account");qlError(l);if(x)if(x=="other"&&a("#comments").val()==""){d(a(".comments"),"Please tell us more");m=true}else x=="other"&&a("#comments").val().length>1?b(a(".comments")):k(a(".comments"));
else{qlError(l,"You must choose a reason before you can delete your account.");m=true}var q=a("#pw").val();if(q.length<1){d(a(".pw"),"Password is required for confirmation");m=true}else k(a(".pw"));m||qlPrompt({title:"Confirm Account Deletion",body:"Are you sure you want to delete your account?<br /><br />Once it is deleted you will lose all awards, stats and friends...<br /><br />",okLabel:"Delete",ok:function(){qlHidePrompt();var u={reason:x,password:q,comments:a("#comments").val()};qlBeginSaving(l,
"Deleting...");a.ajax({url:"/account/delete",type:"post",data:u,dataType:"json",success:function(g){if(g.ECODE==0){qlHidePrompt(l);quakelive.PageRedirect("/user/logout/deleted")}else if(g.ECODE==-1){qlEndSaving(l,"Delete");d(a(".pw"),"Password confirmation failed")}else{qlEndSaving(l,"Delete");qlError(l,"An internal error has occurred when attempting to queue your account for deletion.")}},error:function(){qlHidePrompt(l);qlAlert("Delete Error","An internal error has occurred when attempting to queue your account for deletion. Please try again.")}})},
cancel:function(){x="";qlHidePrompt();qlHidePrompt(l)}})};e.EditCancelsubscription=function(){var m="",l=a("#account");qlError(l);if(x)if(x=="other"&&a("#comments").val()==""){d(a(".comments"),"Please tell us more");m=true}else x=="other"&&a("#comments").val().length>1?b(a(".comments")):k(a(".comments"));else{qlError(l,"You must choose a reason before you can cancel your subscription.");m=true}var q=a("#pw").val();if(q.length<1){d(a(".pw"),"Password is required for confirmation");m=true}else k(a(".pw"));
m||qlPrompt({title:"Confirm Renewal Cancellation",body:"Are you sure you want to cancel your Renewal?<br /><br />"+m,okLabel:"Confirm",ok:function(){qlHidePrompt();var u={reason:x,password:q,comments:a("#comments").val()};qlBeginSaving(l,"Cancelling...");a.ajax({url:"/account/cancelsubscription",type:"post",data:u,dataType:"json",success:function(g){if(g.ECODE==0){qlHidePrompt(l);qlPrompt({title:"Renewal Cancelled",body:"Your premium membership renewal has been cancelled, and you will no longer be charged.  Once your active membership period expires, you will lose access to all premium QUAKE LIVE features.",
alert:true,showX:false,ok:function(){qlHidePrompt(l);quakelive.PageRedirect("/r/account")}})}else if(g.ECODE==-1){qlEndSaving(l,"Confirm");d(a(".pw"),"Password confirmation failed")}else{qlEndSaving(l,"Confirm");qlError(l,"An internal error has occurred when attempting to cancel your membership. Please try again.")}},error:function(){qlHidePrompt(l);qlAlert("Cancellation Error","An internal error has occurred when attempting to cancel your subscription. Please try again.")}})},cancelLabel:"Stay Active!",
cancel:function(){x="";qlHidePrompt(l);qlHidePrompt()}})};e.EditPassword=function(){var m={},l=[],q={mailinglist:true};a("#qlv_password input").each(function(){var o=a(this),y=this.tagName.toLowerCase();if(y=="input")if(o.attr("type").toLowerCase()=="checkbox"){m[this.name]=o.attr("checked")?1:0;m[this.name]==0&&!q[this.name]&&l.push(o.parent())}else{m[this.name]=o.val();m[this.name].length==0&&!q[this.name]&&l.push(o.parent().parent().parent())}else if(y=="select"){m[this.name]=parseInt(o.val());
m[this.name]==0&&!q[this.name]&&l.push(o.parent().parent().parent())}});if(l.length>0)for(var u in l)d(l[u],"This field is required");else{var g=a("#account");qlBeginSaving(g);$oldpass=a(".oldpassword");k($oldpass);a.ajax({type:"post",url:"/account/password",dataType:"json",data:{oldpassword:m.oldPassword,newpassword:m.newPassword},success:function(o){$newpass=a(".newpassword");$confirmpass=a(".confirmpassword");b($newpass);b($confirmpass);if(m.newPassword!=m.confirmPassword){o.ECODE=-3;o.MSG="Passwords do not match"}if(o.ECODE===
0){qlHidePrompt(g);qlAlert("Password Successfully Changed","Your password has now been changed. You will need to use this new password for future logins.")}else if(o.ECODE==-2){d($newpass,o.MSG);d($confirmpass,o.MSG)}else if(o.ECODE==-3){d($confirmpass,o.MSG);d($newpass,o.MSG)}else d($oldpass,o.MSG);qlEndSaving(g)},error:function(){qlEndSaving(g);qlError(g,"An internal error has occurred when attempting to change your password. Please try again.")}})}};e.EditBio=function(){var m=a("#newBio"),l=a("#account");
if(m.val().length>500)d(a(".newbio"),"Your message cannot be longer than 500 characters.");else{qlBeginSaving(l);a.ajax({type:"post",url:"/account/bio",dataType:"json",data:{newbio:m.val()},success:function(){qlHidePrompt(l)},error:function(){qlEndSaving(l);qlError(l,"An internal error has occurred when attempting to change your Bio. Please try again.")}})}};e.EditCountry=function(){a("#newcountry");var m=a("#account");qlBeginSaving(m);a.ajax({type:"post",url:"/account/country",dataType:"json",data:{newcountry:a("#newcountry").val()},
success:function(){qlHidePrompt(m)},error:function(){qlEndSaving(m);qlError(m,"An internal error has occurred when attempting to change your country. Please try again.")}})};e.EditToken=function(){var m=a("#token"),l=a("#account");if(m.val().length<36)d(a(".token"),"Invalid Token.");else{qlBeginSaving(l,"Processing...");a.ajax({type:"post",url:"/account/token",dataType:"json",data:{token:m.val()},success:function(q){if(q.ECODE==0){qlHidePrompt(l);quakelive.PageRedirect("/r/order/success;token="+m.val())}else{qlEndSaving(l,
"Redeem");d(a(".token"),q.MSG)}},error:function(){qlEndSaving(l,"Redeem");qlError(l,"An internal error has occurred when attempting to redeem your token. Please try again.")}})}};e.EditConfirmation=function(){qlProcessing("Verifying Code","Please wait...","Abort",function(){a.ajaxAbort("verify_code");qlHidePrompt()});a.ajax({type:"post",url:"/account/confirmation",dataType:"json",mode:"abort",port:"verify_code",data:{email:a("#email").val(),emailCode:a("#emailCode").val()},success:function(m){if(m.ECODE==
0){qlHidePrompt();qlAlert("Code Confirmed","<center><b>Your email has been updated!</b></center>")}},error:function(){qlHidePrompt();qlAlert("Confirmation Error","An internal error has occurred when attempting to confirm your email address change. Please try again.")}})};e.EditEmail=function(){var m=a("#newEmail"),l=a("#oldPassword"),q=a("#confirmEmail"),u=a("#emailCode"),g=a("#account");if(m.val()!=q.val())d(a(".newemail"),"Emails do not match.");else if(u&&!u.val()&&!m.val())d(a(".emailcode"),"Address confirmation code required");
else if(u.val()){qlBeginSaving(g,"Processing...");a.ajax({type:"post",url:"/account/email",dataType:"json",data:{emailCode:u.val()},success:function(o){if(o.ECODE==0){qlHidePrompt(g);qlAlert("Email Change Confirmed!","<center><b>Your email address has now been changed. You will need to be sure to use this new email address for all future logins.</b></center>");a("#emailPending").hide()}else{qlEndSaving(g,"Confirm");qlError(g,o.MSG);d(a(".emailcode"),"Invalid confirmation code")}},error:function(){qlEndSaving(g,
"Confirm");qlError(g,"An internal error has occurred when attempting to change your email address. Please try again.")}})}else{qlBeginSaving(g,"Processing...");a.ajax({type:"post",url:"/account/confirmemail",dataType:"json",data:{newEmail:m.val(),oldPassword:l.val()},success:function(o){if(o.ECODE==0){qlHidePrompt(g);a("#emailPending").show();e.GetTemplate("email")}else{b(a(".oldpassword"));b(a(".newemail"));o.ECODE==-3&&d(a(".oldpassword"),o.MSG);if(o.ECODE==-1){d(a(".newemail"),o.MSG);d(a(".confirmemail"),
o.MSG)}qlEndSaving(g)}},error:function(){qlEndSaving(g);qlError(g,"An internal error has occurred when attempting to confirm your email address. Please try again.")}})}};e.ValidateEmail=function(){var m=a("#newEmail"),l=a("#confirmEmail"),q=a(".newemail"),u=a(".confirmemail");if(m.val().length!=0){if(isEmailValid(m.val()))b(q);else{d(q,"Email format is invalid");l.val()==m.val()&&d(u,"Email format is invalid")}if(l.val().length!=0)if(isEmailValid(l.val()))m.val()!=l.val()?d(u,"Emails do not match"):
b(u);else d(u,"Email format is invalid")}};e.ValidatePassword=function(){var m=a("#newPassword"),l=a("#confirmPassword"),q=a(".newpassword"),u=a(".confirmpassword");if(l.val().length!=0)if(m.val()!=l.val())d(u,"New Passwords do Not Match");else{b(q);b(u)}};e.ResetColors=function(){a("[id^=Palette-]").removeClass("color_palette_selected");a("[id^=tag-]").attr("class",e.RemoveColors(a("[id^=tag-]").attr("class")));var m=a("[id^=tag-]"),l=quakelive.username,q=0;m.each(function(){var u=a(this);oldCharacter=
l[q];u.text(oldCharacter);q++})};e.CaseChange=function(){a("[id^=Palette-]").removeClass("palette_icon_selected");a("#Palette-C").addClass("palette_icon_selected")};e.RemoveColors=function(m){return m.replace(/color_palette_\S+/g,"")};e.PaletteSetColor=function(m){a("[id^=Palette-]").removeClass("palette_icon_selected");a("#"+m).addClass("palette_icon_selected")};e.ChangeColor=function(m){m=a("#"+m);var l=a(".palette_icon_selected").attr("id");if(l=="Palette-C"){l=m.text();l.toLowerCase()==l?m.text(l.toUpperCase()):
m.text(l.toLowerCase())}else if(l){l=l.substr(8);m.attr("class",e.RemoveColors(m.attr("class")));m.addClass("color_palette_"+l)}};e.UI_ChangeCharacter=function(m){m=quakelive.mod_prefs.models[m];a("#qlv_MainContent").find(".characterImg > img").attr("src",quakelive.resource("/images/players/body_lg/"+m.MODEL+"_"+m.SKIN+".png"));a("#qlv_MainContent").find(".charTypeLarge").text(m.NAME.substr(0,1).toUpperCase()+m.NAME.substr(1));a("#qlv_MainContent").find(".charType > img").attr("src",quakelive.resource("/images/player_races/"+
m.RACE+".png"));a("#qlv_MainContent").find(".charProfile").text(m.DESC)};e.FocusField=function(){var m=a("#help_"+this.id);m.find(".error").size()==0&&m.find(".success").size()==0&&m.addClass("lgrayBack").addClass("lgrayBorder").removeClass("transBorder").find(".help").show()};e.BlurField=function(){var m=a("#help_"+this.id);m.find(".error").size()==0&&m.find(".success").size()==0&&m.removeClass("lgrayBack").removeClass("lgrayBorder").addClass("transBorder").find(".help").hide()};e.EditNametag=function(){var m=
a("#account");qlBeginSaving(m);var l=[],q="";a("[id^=tag-]").each(function(){for(var u=q,g=a(this),o=g.attr("class").split(" "),y="",v=0;v<o.length;v++){y=o[v];if(y.substr(0,14)=="color_palette_"){for(var C=1;C<8;C++)if(p[C].color==y.substr(14))q=p[C].code;if(u!=q)var G="^"+q}}G&&l.push(G);l.push(g.text())});SetCvar("name",l.join(""));qlHidePrompt(m)};e.EditSuccess=function(m){quakelive.userinfo.IGNORED_NOTICES=m.IGNORED_NOTICES;quakelive.notifier.LoadFilters();for(var l in m.FIELDS){a("#help_"+l+
" .error").remove();a("#help_"+l+" .success").remove();a("#help_"+l).append("<span class='success'>"+m.FIELDS[l]+"</span>");e.StyleAsSuccess(l)}};e.EditFail=function(m){for(var l in m.ERRORS){a("#help_"+l+" .error").remove();a("#help_"+l+" .success").remove();a("#help_"+l).append("<span class='error'>"+m.ERRORS[l]+"</span>");e.StyleAsError(l)}};var z=["bio","shirtSize"],r=["birthdate","country"];e.StyleAsError=function(m){a("#wrap_"+m).addClass("orangeBorder");a("#label_"+m).addClass("orangeTxt");
a("#help_"+m).addClass("orangeBack").addClass("orangeBorder")};e.StyleAsSuccess=function(m){a("#wrap_"+m).addClass("greenBorder");a("#label_"+m).addClass("greenTxt");a("#help_"+m).addClass("greenBack").addClass("greenBorder")};e.StyleAsDefault=function(m){a("#help_"+m+" .error").remove();a("#help_"+m+" .success").remove();a("#wrap_"+m).removeClass("orangeBorder");a("#wrap_"+m).removeClass("greenBorder");a("#label_"+m).removeClass("orangeTxt");a("#label_"+m).removeClass("greenTxt");a("#help_"+m).removeClass("orangeBack").removeClass("orangeBorder");
a("#help_"+m).removeClass("greenBack").removeClass("greenBorder")};e.ClearFields=function(){a("#profile_form").find("input").each(function(){e.StyleAsDefault(this.id)});for(var m in r)e.StyleAsDefault(r[m]);for(m in z){a("#error_"+z[m]).empty();a("#label_"+z[m]).removeClass("orangeTxt");a("#label_"+z[m]).removeClass("greenTxt")}};quakelive.RegisterModule("account",e)})(jQuery);
(function(a){function d(){return"This will abort your current order"}function b(m){a("#mod_order .error_content").html(m).slideDown().effect("pulsate",{times:3},800)}function k(m){if(m.ECODE!=0){b(m.MSG||"An unknown error has occurred. Please try again later.");a(".fieldgroup_has_error").removeClass("fieldgroup_has_error");if(typeof m.ERRORS!="undefined")for(var l in m.ERRORS){var q=a("#FIELDINFO_"+l);q.find(".payment_field_error").html(m.ERRORS[l]);q.addClass("fieldgroup_has_error")}}else{window.onbeforeunload=
d;z.StorePaymentProductData();if(m.REDIRECT!=""){window.onbeforeunload=null;window.location=m.REDIRECT}else z.ShowContent(m.CONTENT)}}function c(){b("An internal error has occurred. Your payment has NOT been processed.")}function e(m){m.ECODE==0&&z.ShowContent(m.CONTENT)}function p(){z.RejectOrder()}function x(m){if(m.ECODE==0){qlProcessing("Order Completed Successfully!","Please wait as we update your membership information&hellip;");window.onbeforeunload=null;var l="/r/order/receipt?order_id="+
m.ORDER_ID+"&payment_id="+m.PAYMENT_ID;if(m.TOKEN!="")l+="&extra_token="+m.TOKEN;window.location=l}}function t(){z.RejectOrder()}var z={LAYOUT:"account_mgt",TITLE:"Go Pro!"};z.Init=function(){};z.OnContentLoaded=function(m){if(m==z){var l=a("#mod_order #active_error");l&&l.slideDown().effect("pulsate",{times:3},800)}if(m!=z){z.ClearPaymentProductData();window.onbeforeunload=null}};z.SubmitPaymentProducts=function(m){qlProcessing("Submitting Contact Information","Please wait&hellip;");a.ajax({type:"post",
url:"/order",dataType:"json",data:a(m).formToArray(),success:k,error:c,complete:function(){qlHidePrompt()}});return false};z.ChangePaymentProduct=function(m){m=a.extend({},quakelive.params,{payment:m});z.StorePaymentProductData();qlProcessing("Please wait&hellip;","Loading payment type form");quakelive.Goto("order",m)};z.ValidateOrder=function(m){qlProcessing("Validating Payment Details","Please wait&hellip;");a.ajax({type:"post",url:"/order/viewconfirmorder",dataType:"json",data:m,success:e,error:p,
complete:function(){qlHidePrompt()}})};z.SubmitConfirmOrder=function(m){qlProcessing("Completing Order","Please wait&hellip;");a.ajax({type:"post",url:"/order/confirmorder",dataType:"json",data:a(m).formToArray(),success:x,error:t});return false};z.ConfirmCancelOrder=function(){qlPrompt({title:"Confirm Order Cancellation",body:"This will cancel your Quake Live order. Are you sure you want to cancel?",ok:function(){z.CancelOrder();qlHidePrompt()},okLabel:"Cancel Order",cancel:function(){qlHidePrompt()},
cancelLabel:"Close"})};z.CancelOrder=function(){r={};window.onbeforeunload=null;quakelive.Goto("order/cancelled",quakelive.params)};z.RejectOrder=function(){window.onbeforeunload=null;r.ERROR="We could not process your order. Please verify your information and try again.";quakelive.Goto("order",quakelive.params)};var r={};z.StorePaymentProductData=function(){var m=a("#paymentproductsform").formToArray();for(var l in m){var q=m[l];r[q.name]=q.value}};z.ClearPaymentProductData=function(){r={}};z.AutofillPaymentProductData=
function(){for(var m in r)if(m.indexOf("GC_")==0){var l=m.substring(3);l=a("#"+l);l.length>0&&l[0].tagName=="SELECT"?l.selectOptions(r[m]):l.val(r[m])}if(typeof r.ERROR!="undefined"){b(r.ERROR);r.ERROR=undefined}};z.ShowContent=function(m){qlHidePrompt();quakelive.ShowContent(m);a(".verisign_seal").writeCapture().html(quakelive.GetVerisignSealHtml(true));z.AutofillPaymentProductData()};z.OverrideLanguage=function(m){m.length>0?CreateCookie("QL_LANGUAGE",m):EraseCookie("QL_LANGUAGE");z.StorePaymentProductData();
qlProcessing("Overriding Language Settings","Please Wait&hellip;");m=a.extend({},quakelive.params);quakelive.Goto("order",m)};z.OverrideCountry=function(m){m.length>0?CreateCookie("QL_COUNTRY",m):EraseCookie("QL_COUNTRY");z.StorePaymentProductData();qlProcessing("Overriding Country Settings","Please Wait&hellip;");m=a.extend({},quakelive.params);quakelive.Goto("order",m)};z.ShowDiscountHelp=function(){qlAlert("Quake Live Upgrade Discount","This is a description of the discount stuff")};z.ShowTokenHelp=
function(){qlAlert("QUAKE LIVE Membership Token",'QUAKE LIVE tokens can be redeemed by anyone to grant or extend a QUAKE LIVE membership. You can give one to a friend or redeem it for yourself. To redeem one, go to the <a href="#!account" onclick="qlHidePrompt()">account settings</a> page. You can also view any tokens that you own there.')};quakelive.RegisterModule("order",z)})(jQuery);
(function(a){function d(c){quakelive.IsLoggedIn()?quakelive.GotoSecure("order",{product:c}):quakelive.Goto("register",{product:c})}var b={TITLE:"Go Pro!"};b.GetLayout=function(){return quakelive.IsSecure()?"account_mgt":"postlogin"};var k=null;b.ActuallyShowPopup=function(){quakelive.TrackEvent("Brochure","PopupView");qlPrompt({title:"Go Pro and Get More!",body:k,customWidth:600,customHeight:380,okLabel:"Learn More",ok:function(){qlHidePrompt();quakelive.Goto("premium");quakelive.TrackEvent("Brochure",
"PopupLearnMore")},cancel:function(){qlHidePrompt();quakelive.TrackEvent("Brochure","PopupClose")},cancelLabel:"Close",showX:true})};b.ShowContent=function(c){quakelive.ShowContent(c);c=a("#brochure_carousel");for(var e=c.find("ul").empty(),p=mapdb.getAllByTag(mapdb.Tags.PREMIUM),x=0;x<p.length;x++){var t=p[x],z=t.name+" (",r=[];for(var m in t.gametypes){var l=mapdb.getGameTypeByID(m);r.push(l.name.toUpperCase())}z+=r.join(", ");z+=")";r="<li>";r+='<a href="'+quakelive.resource("/images/levelshots/xl/"+
t.sysname+".jpg")+'" title="'+z+'" rel="lightbox">';r+='<img width="112" height="84" src="'+quakelive.resource("/images/levelshots/md/"+t.sysname+".jpg")+'" class="map">';r+="</a>";r+='<div class="brochure_map_name">'+t.name+"</div>";r+="</li>";e.append(r)}c.jCarouselLite({auto:8E3,speed:1E3,visible:5,circluar:true});c.find("a").lightbox()};b.ShowBrochurePopup=function(){if(k)b.ActuallyShowPopup();else{qlProcessing("Please Wait&hellip;","");a.ajax({type:"get",url:"/premium/popup",success:function(c){k=
c;b.ActuallyShowPopup()},error:function(){qlHidePrompt()}})}};b.OrderPackage=function(c){quakelive.TrackEvent("Brochure","Order",quakelive.IsLoggedIn()?"LoggedIn":"Guest",c);d(c)};b.PopupOrderPackage=function(c){quakelive.TrackEvent("Brochure","PopupOrder",quakelive.IsLoggedIn()?"LoggedIn":"Guest",c);d(c)};quakelive.RegisterModule("premium",b)})(jQuery);
(function(a){function d(S){return function(fa,ha){a.ajax({type:"get",url:"/clans/validatefield",mode:"abort",port:"validator",dataType:"json",data:{name:S,value:a("#"+S).val()},success:function(O){O.ECODE===0?fa():ha(O.MSG)}})}}function b(){}function k(){}function c(){var S=a("#clan_invite_count").val();if(S>0){S=S==1?"You have 1 pending clan invitation":"You have "+S+" pending clan invitations";a(".clan_invite_count").text(S)}else{a("#qlv_claninvites .has_invites").hide();a("#qlv_claninvites .no_invites").show()}}
function e(S){return["<img width='16' height='16' src='",quakelive.resource("/images/modules/clans/ranks/rank_"+S+".png"),"' style='display: block; float: left' /><div style='margin-left: 5px; float: left; line-height: 21px'>",FormatClanRank(S),"</div><div class='cl'></div>"].join("")}function p(S,fa,ha){function O(){S.remove();a("th.controls").remove()}if(quakelive.clandb)if((fa=quakelive.clandb[fa])&&(fa.perms.can_kick||fa.perms.can_promote||fa.perms.can_demote)){fa.perms.can_kick&&ha>fa.rank?S.find(".btn_remove").css("visibility",
"visible"):S.find(".btn_remove").css("visibility","hidden");fa.perms.can_promote&&ha>fa.rank+1?S.find(".btn_promote").css("visibility","visible"):S.find(".btn_promote").css("visibility","hidden");fa.perms.can_demote&&fa.rank<ha&&ha<ClanRank.initiate?S.find(".btn_demote").css("visibility","visible"):S.find(".btn_demote").css("visibility","hidden")}else O();else O()}function x(){a(".clanroster td.rank").each(function(){var M=a(this),W=e(M.text());M.html(W)});var S=a(".clanroster tbody");for(var fa in pageData.roster){var ha=
pageData.roster[fa],O=a('<tr class="player_'+ha.player_id+(ha.online==1?" online":"")+'"></tr>'),P,R=new Date;P=quakelive.resource("/images/flags/"+ha.country.toLowerCase()+".gif");R=ha.online==1?"Online now!":'Last seen <span class="text_tooltip" title="'+ha.login_time+'">'+FormatTimeDelta(R.getTime()/1E3-ha.login_time_int)+" ago</span>";P=a("<td></td>").append(BuildPlayerIcon(ha.modelskin,"md",{status:ha.premium_status,extraClass:"fl"})).append("<div class='fl playername'><img src='"+P+"' /> <a href='#!profile/summary/"+
ha.player_name+"'>"+ha.player_name+"</a></div>").append("<br/><div class='fl playerstatus'>"+R+"</div>").append("<div class='cl'></div>").appendTo(O);P=a('<td class="rank"></td>').append(e(ha.rank)).appendTo(O);P=a("<td></td>").append(ha.join_time).appendTo(O);P=a("<a href='javascript:;' title='Kick player from clan' class='btn_remove fr' onclick='quakelive.mod_clans.KickMember("+pageData.clan.id+","+ha.player_id+"); return false'></a>");R=a("<a href='javascript:;' title='Demote player'class='btn_demote demote_on fr' onclick='quakelive.mod_clans.ChangeRank("+
pageData.clan.id+","+ha.player_id+',"demote"); return false\'></a>');var X=a("<a href='javascript:;' title='Promote player' class='btn_promote promote_on fr' onclick='quakelive.mod_clans.ChangeRank("+pageData.clan.id+","+ha.player_id+',"promote"); return false\'></a>');P=a('<td class="controls"></td>').append(P).append(R).append(X).append("<div class='cl'></div>").appendTo(O);p(P,pageData.clan.id,ha.rank);S.append(O)}}function t(S){var fa=a("#qlv_createclan .error");fa.html(S).slideDown("fast",function(){fa.effect("pulsate",
{times:1},500)})}function z(S){if(S.ECODE===0){qlProcessing("Clan Successfully Created","Please wait&hellip;");quakelive.AddClan(S.CLAN);quakelive.SetActiveClan(S.CLAN.clan_id);quakelive.Goto("clans")}else if(S.ECODE==-666){t("Premium or Pro membership required to create a clan");quakelive.mod_premium.ShowBrochurePopup()}else{formStyler.ResetFieldStatus(".f_clan_avatar,.f_clan_name,.f_clan_tag");var fa=S.MSG;if(a.isPlainObject(S.ERRORS))for(var ha in S.ERRORS){formStyler.SetFieldError(".f_clan_"+
ha,S.ERRORS[ha]);fa+="<br />";fa+=S.ERRORS[ha]}t(fa)}}function r(){}function m(S){a(".player_"+S.player_id+" td.rank").html(e(S.rank));var fa=a(".player_"+S.player_id+" td.controls");p(fa,S.clan_id,S.rank)}function l(){}function q(S){a(".player_"+S.player_id).hide()}function u(){}function g(S){S.ECODE===0?qlHidePrompt():o(S.MSG)}function o(S){var fa=a("#prompt");qlError(fa,S||"Internal Error. Please try again later.");qlEndSaving(fa,"Send Invite")}function y(){var S=a("#prompt"),fa={clan_id:a("#invite_clan").val(),
player_name:a("#invite_player").val(),message:a("#invite_message").val()||""};if(fa.player_name==0)qlError(S,"Missing player name");else{qlBeginSaving(S,"Sending...");a.ajax({type:"post",url:"/clans/invite",dataType:"json",data:fa,success:g,error:function(){o()}})}}function v(S){if(S.ECODE===0){var fa=quakelive.clandb[S.CLAN_ID];if(fa)fa.bio=S.BIO;qlHidePrompt();quakelive.Goto(quakelive.path)}else C(S.MSG)}function C(S){var fa=a("#prompt");qlError(fa,S||"Internal Error. Please try again later.");
qlEndSaving(fa,"Change")}function G(){var S=a("#prompt"),fa={clan_id:a("#clan_id").val(),bio:a("#newBio").val()};qlBeginSaving(S,"Sending...");a.ajax({type:"post",url:"/clans/changebio",dataType:"json",data:fa,success:v,error:function(){C()}})}function H(){var S=a("#newBio").attr("maxlength")-a("#newBio").val().length;a("#numchars").text(S+(S==1?" character":" characters")+" remaining.")}function F(S){if(S.ECODE===0){quakelive.RemoveClan(S.clan_id);quakelive.Goto("clans")}}function J(){}function Q(S){if(S.ECODE===
0){qlHidePrompt();quakelive.clandb[S.CLAN.clan_id]=a.extend(quakelive.clandb[S.CLAN.clan_id],S.CLAN);quakelive.Goto("clans")}else formStyler.SetFieldError(".f_tag_format",S.MSG)}function aa(){}function ca(S){if(S.ECODE===0){quakelive.RemoveClan(S.clan_id);quakelive.Goto("clans")}}function qa(){}function ja(S,fa){a.ajax({type:"post",url:"/clans/changeleader",dataType:"json",data:{clan_id:S,target_player_id:fa},success:function(ha){if(ha.ECODE==0){quakelive.Goto("clans");qlAlert("Clan Leadership Transferred",
"Clan leadership successfully transferred.")}else qlAlert("Unable to transfer leadership",ha.MSG)},error:function(){qlAlert("Internal error","Please try again later.")}})}var ga={LAYOUT:"postlogin",TITLE:"Clan Center"};quakelive.AddHook("OnClanChanged",function(S){if(S){a(".player_clan_name").text(S.name);a(".player_clan_tag").text(StripColors(S.pretty_tag))}else{a(".player_clan_name").text("");a(".player_clan_tag").text("")}});quakelive.AddHook("OnLayoutLoaded",function(){quakelive.clanid!=0&&quakelive.SetActiveClan(quakelive.clanid)});
var ma=false;quakelive.AddHook("IM_OnRosterFilled",function(){if(ma!==true){ma=true;setTimeout(function(){quakelive.startupClanInviteCount>0&&quakelive.notifier.Notify(quakelive.notifier.PendingClanInvites(quakelive.startupClanInviteCount))},6E3)}});ga.ActivateClan=function(S){a(".active_clan").removeClass("active_clan");a(".clanid_"+S).addClass("active_clan");quakelive.clanid!=S&&a.ajax({type:"post",url:"/clans/activate",dataType:"json",data:{clan_id:S},success:b,error:k});quakelive.SetActiveClan(S)};
var ka={"clans/create":function(){formStyler.SetupFormField(".f_clan_name",{name:"name",title:"Clan Name:",type:"text",help:"The full name of your clan.",description:"Enter the full name of your clan.",maxlength:20,tabindex:1,validate:d("name"),autocomplete:false});formStyler.SetupFormField(".f_clan_tag",{name:"tag",title:"Clan Tag:",type:"clan_tag",help:"The tag for your clan.",description:"Enter a short tag that represents your clan.",tabindex:2,validate:d("tag")});formStyler.SetupFormField(".f_clan_avatar",
{name:"clan_avatar",title:"Clan Avatar:",type:"clan_avatar",help:"The avatar of your clan.",description:"Click on an icon to select that as your clan's avatar.",tabindex:3,maxlength:15,avatars:quakelive.Eval(a("#clan_avatars_data").text())})},"clans/inbox":function(){c()},clans:function(){ga.ActivateClan(quakelive.clanid)}};ga.CreateClan=function(S){qlProcessing("Submitting Clan Details","Please wait&hellip;");a(".error").hide();a.ajax({type:"post",url:"/clans/create",dataType:"json",data:a(S).formToArray(),
success:z,error:r,complete:function(){qlHidePrompt()}});return false};ga.HandleInvite=function(S,fa){a.ajax({type:"post",url:fa=="decline"?"/clans/declineinvite":"/clans/acceptinvite",dataType:"json",port:"handleinvite",data:{invitation_id:S},success:function(ha){typeof ha.clan!="undefined"&&quakelive.AddClan(ha.clan);a(".invite_"+S).hide();ha=a("#clan_invite_count").val()-1;a("#clan_invite_count").val(ha);c()}})};ga.ShowContent=function(S){quakelive.ShowContent(S);if(typeof ka[quakelive.path]!="undefined")ka[quakelive.path]();
else if(quakelive.path.indexOf("clans/roster/")==0||quakelive.path.indexOf("clans/summary/")==0)x()};ga.ChangeRank=function(S,fa,ha){a.ajax({type:"post",url:ha=="demote"?"/clans/demote":"/clans/promote",dataType:"json",data:{clan_id:S,player_id:fa},success:m,error:l});return false};ga.KickMember=function(S,fa){a.ajax({type:"post",url:"/clans/kick",dataType:"json",data:{clan_id:S,player_id:fa},success:q,error:u});return false};ga.SendClanInvite=function(S,fa){var ha=quakelive.clandb[S];if(ha){$prompt=
qlPrompt({title:"Send Clan Invitation",body:'<table width="100%" class="invite_table"><tr><td valign="top" align="right">Choose clan:</td><td valign="top"><select id="invite_clan"></select></td></tr><tr><td valign="top" align="right">Player name:</td><td valign="top"><input id="invite_player" type="text" value="" /></td></tr><tr><td valign="top" align="right">Enter message:<br />(optional)</td><td valign="top"><textarea id="invite_message" style="width: 250px; height: 4.5em"></textarea></td></tr></table>',
ok:y,okLabel:"Send Invite",cancel:function(){qlHidePrompt()},cancelLabel:"Close"});for(var O in quakelive.clandb){ha=quakelive.clandb[O];if(ha.perms.can_invite)$prompt.find("#invite_clan").append('<option value="'+ha.clan_id+'"'+(ha.clan_id==S?' selected="selected"':"")+">"+ha.name+"</option>")}typeof fa!="undefined"&&$prompt.find("#invite_player").val(fa)}};ga.ChangeClanBio=function(S){if(S=quakelive.clandb[S]){S={title:"Change Clan Biography",body:['<textarea tabindex="1" name="newBio" id="newBio" maxlength="250" cols="42" style="width: 350px;" rows="8">',
S.bio,'</textarea><input type="hidden" name="clan_id" id="clan_id" value="',S.clan_id,'"/><div id="numchars"></div>'].join(""),ok:G,okLabel:"Change",cancel:function(){qlHidePrompt()},cancelLabel:"Close"};$prompt=qlPrompt(S);H();a("#newBio").bind("keydown keyup blur",H)}};ga.FormatClanTag=function(S){var fa=quakelive.clandb[S];qlPrompt({title:"Format Your Clan Tag",body:"Control the formatting of your clan tag by adding color codes or changing its capitalization. Color codes are created by entering a caret (^) followed by a number from 1 to 9.<br /><br />Your base clan tag is: <b>"+
EscapeHTML(StripClanName(fa.pretty_tag))+'</b><br /><div class="f_tag_format"></div>',hideButtons:false,showX:false,customWidth:490,customHeight:300,ok:function(){var ha={clanId:S,format_tag:a("#format_tag").val()};a.ajax({type:"post",url:"/clans/formatclantag",dataType:"json",data:ha,success:Q,error:aa})},okLabel:"Save"});formStyler.SetupFormField(".f_tag_format",{name:"format_tag",type:"format_tag",clan:fa,help:"Use color codes to customize your clan tag.",description:"",tabindex:2,validate:d("format_tag")});
a(".reset_tag").html("Clear Formatting").click(function(){a("#format_tag").val(StripClanName(fa.pretty_tag))});return false};ga.LeaveClan=function(S){qlConfirm("Are you sure?","Are you sure you want to leave this clan?",function(){a.ajax({type:"post",url:"/clans/leave",dataType:"json",data:{clan_id:S},success:F,error:J})},qlHidePrompt)};ga.ChangeClanLeader=function(S){qlProcessing("Loading&hellip;","Please wait");a.ajax({type:"get",url:"/clans/changeleader",dataType:"json",data:{clan_id:S},success:function(fa){if(fa.ECODE==
0)var ha=qlPrompt({title:"Transfer Clan Leadership",body:fa.MSG,ok:function(){var O=a("#xfer_clan_id").val(),P=a("#xfer_target_player_id").val();P==0?qlError(ha,"You must choose a player to promote."):ja(O,P)}});else qlAlert("Unable to transfer leadership",fa.MSG)},error:function(){qlAlert("Internal error","Please try again later.")}})};ga.DisbandClan=function(S){qlConfirm("Are you sure?","Are you sure you want to disband this clan?<br/><b>Disbanding clans can not be reversed!</b>",function(){a.ajax({type:"post",
url:"/clans/disband",dataType:"json",data:{clan_id:S},success:ca,error:qa})},qlHidePrompt)};ga.SelectAvatar=function(S,fa){var ha=a("#clan_avatar_field");fa!=ha.val()&&a(S).parent().find("a.selected").removeClass("selected").end().end().addClass("selected");ha.val(fa);formStyler.SetFieldOk(".f_clan_avatar")};quakelive.RegisterModule("clans",ga)})(jQuery);
(function(a){function d(c){k=c;if(c.pos<=0){qlHideBroadcast();quakelive.isQueued=0;quakelive.activeModule==b&&quakelive.PageRedirect("/r/"+quakelive.GetUserHome())}else if(quakelive.activeModule==b){qlHideBroadcast();document.title=c.title;a("#q_pos").text(c.posText)}else qlBroadcast({body:"Quake Live is packed! Your position in queue: "+c.pos,showClose:false})}var b={LAYOUT:"postlogin_bare",TITLE:"Quake Live is packed!"},k=null;b.ShowContent=function(c){quakelive.ShowContent(c);k&&d(k)};quakelive.AddHook("OnQueueStatusUpdated",
d);quakelive.RegisterModule("queue",b)})(jQuery);
(function(a){var d={LAYOUT:"account_mgt",TITLE:"Support"},b=null,k=[".txt",".jpg",".png",".gif",".dm_73"];d.Init=function(){};d.GotoSupport=function(c){qlHidePrompt(a("#account,#prompt"));!c&&quakelive.siteConfig.premiumStatus=="standard"&&quakelive.IsLoggedIn()?d.ShowSupportPopup():quakelive.Goto("support");return false};d.ShowSupportPopup=function(){if(b)d.ActuallyShowPopup();else{qlProcessing("Please Wait&hellip;","");a.ajax({type:"get",url:"/support/popup",success:function(c){b=c;d.ActuallyShowPopup()},
error:function(){qlHidePrompt()}})}return false};d.ActuallyShowPopup=function(){qlPrompt({title:"Quakelive Support",body:b,customWidth:400,customHeight:280,showX:true,okLabel:"Learn More",ok:function(){qlHidePrompt();quakelive.Goto("premium")},cancelLabel:"Close"});return false};d.ShowContent=function(c){quakelive.ShowContent(c);a.getScript("http://www.google.com/recaptcha/api/js/recaptcha_ajax.js",function(){Recaptcha.create("6LdqLsASAAAAAJIuAN8u5VnejtsbvwA8eguRNeMu","recaptcha_image",{theme:"custom"})});
a("#support_form").submit(function(){return d.ValidateFields()});a("#category,#email,#details").change(function(){d.ValidateFields(a(this))});a("#Validate").val()&&d.ValidateFields()};d.ValidateFields=function(c){if(c)var e="#"+c.context.name;var p=false;qlError(a("#qlv_support"));if(!e||e=="#category")if(a("#category").val()=="0"){d.SetFieldError("#category","Please Choose a Category");p=true}else d.SetFieldOk("#category");if(a("#email").length&&(!e||e=="#email"))if(isEmailValid(a("#email").val()))d.SetFieldOk("#email");
else{d.SetFieldError("#email","Email format is invalid.");p=true}if(!e||e=="#details")if(a("#details").val())d.SetFieldOk("#details");else{d.SetFieldError("#details","Please give us some information on your issue");p=true}a("#qlv_support input").each(function(){var x=a(this);if(x.attr("type").toLowerCase()=="file")if(!d.IsValidFileExt(x.val())&&x.val()){d.SetFieldError("#"+x.attr("id").toLowerCase(),"Invalid file extension");qlError(a("#qlv_support"),"You are only allowed to upload "+k.join(", ")+
" files");p=true}else d.SetFieldOk("#"+x.attr("id").toLowerCase())});if(a("#captcha").length&&(!e||e=="#captcha")){c=a("#captcha").val();if(c.length==5)a.ajax({type:"post",url:"/register/verify/captcha",dataType:"json",data:{value:c},success:function(x){if(x)if(x.ECODE==0)d.SetFieldOk("#captcha");else{d.SetFieldError("#captcha","Code Mismatch");p=true}}});else{d.SetFieldError("#captcha","Please enter your code");p=true}}if(p)return false;return true};d.IsValidFileExt=function(c){for(var e=0;e<k.length;e++)if(c.lastIndexOf(k[e])>
-1)return true;return false};d.SetFieldError=function(c,e){a(c+"_wrapper").removeClass("ff_state_ok").addClass("ff_state_error").find(c+"_status").text(e)};d.SetFieldOk=function(c){a(c+"_wrapper").removeClass("ff_state_error").addClass("ff_state_ok").find(c+"_status").empty()};quakelive.RegisterModule("support",d)})(jQuery);(function(){var a={};a.LAYOUT="postlogin_bare";quakelive.RegisterModule("banned",a)})(jQuery);
(function(){var a=null,d={GetDisplay:function(){return"QUAKE LIVE Stream!"},GetLayout:function(){return!quakelive.IsLoggedIn()||quakelive.path=="stream/guest"?"prelogin":"postlogin"},OnContentLoaded:function(b){if(b==d)a||(a=setInterval(function(){quakelive.ReloadVerts()},3E4));else if(a){clearInterval(a);a=null}}};quakelive.RegisterModule("stream",d)})(jQuery);(function(){quakelive.RegisterModule("marketing",{GetLayout:function(){return quakelive.IsLoggedIn()?"postlogin_bare":"prelogin"}})})(jQuery);
(function(a){var d={LAYOUT:"postlogin",TITLE:"Social Screenshots"};d.Init=function(){d.appid="62128223554";d.graphUrl="https://graph.facebook.com/me";d.oauthDialog="https://www.facebook.com/dialog/oauth?client_id="+d.appid+"&redirect_uri="+escape(quakelive.siteConfig.baseUrl+"/social/fb-oauth")+"&display=popup&scope=offline_access,publish_stream&response_type=token";d.oauth=undefined};d.ShowContent=function(b){quakelive.ShowContent(b);d.oauth=quakelive.cvars.Get("web_fboauth");if(OSGetName()==="os_win"||
OSGetName()==="os_mac"){d.CheckStatus();a("#linkButton").click(d.pop)}else{a("#linkButton").hide();a("#linkstatus").html("Social Screenshots are only supported on Windows.")}};d.pop=function(){signinWin=window.open(d.oauthDialog,"SignIn","width=780,height=410,toolbar=0,scrollbars=0,status=0,resizable=0,location=0,menuBar=0");signinWin.focus();return false};d.FBOAuthSuccess=function(b){CreateCookie("fb-oauth",b);quakelive.cvars.Set("web_fboauth",b);quakelive.cfgUpdater.Commit();d.CheckStatus()};d.FBOAuthFailure=
function(){a("#linkstatus").html("Failed to authorize Facebook application!")};d.CheckStatus=function(){d.oauth.value.length?a.ajax({url:d.graphUrl,dataType:"jsonp",data:{access_token:d.oauth.value},success:d.RenderGraphResponse}):d.RenderGraphResponse({error:{message:"Your Facebook account is not yet connected.",defaultText:true}})};d.RenderGraphResponse=function(b){var k=a("#linkstatus");if(b.error){var c="";if(b.error.defaultText!==true){k.addClass("error");c="<b>Error:</b> "}k.html(c+b.error.message)}else{k.removeClass("error");
k.addClass("success");c="https://graph.facebook.com/me/picture?access_token="+d.oauth.value;var e="";if(b.location)e="<br/>"+b.location.name;k.html('<div class="linked_desc">Current Linked Account:</div><a href="'+b.link+'"target="_blank"><img src="'+c+'"title="It\'s you!"/></a><a class="name"href="'+b.link+'"target="_blank">'+b.name+"</a>"+e+'<div style="clear: both"><a href="#" onclick="quakelive.mod_prefs.StartBinding(\'screenshotSocial\', 0); return false;">Bind a key</a> to take and upload a screenshot to Facebook</div>')}};
quakelive.RegisterModule("social",d)})(jQuery);
(function(a){var d={};d.LAYOUT="postlogin";var b=undefined;d.filter="";d.timeoutHandle=undefined;d.updateTime=3E4;d.Init=function(){};d.OnLayoutLoaded=function(){};d.Hook_OnContentLoaded=function(k){k!=d&&d.StopUpdates()};d.ShowContent=function(k){d.latest=0;quakelive.ShowContent(k);b=a("#matches");d.StartUpdates()};d.StopUpdates=function(){if(d.timeoutHandle!=null){clearTimeout(d.timeoutHandle);d.timeoutHandle=null}};d.StartUpdates=function(){d.StopUpdates();d.DoUpdate()};d.DoUpdate=function(){a.ajax({type:"GET",
url:"/livetracker/scores/",dataType:"json",success:function(k){d.UpdateDisplay(k)},complete:function(){d.timeoutHandle=setTimeout(d.DoUpdate,d.updateTime)}})};d.UpdateDisplay=function(k){if(k.length!=0){b.empty();for(var c=0;k[c];c++){var e=k[c];if(!e.ECODE){for(var p=[],x=0,t=0;e.players[t];t++){var z=e.players[t];if(z.team==0){p[x]=z;x++}}if(!(p.length<2)){x=quakelive.resource("/images/levelshots/sm/"+e.map+".jpg");t=ParseModelSkin(p[0].model);z=ParseModelSkin(p[1].model);t=quakelive.resource("/images/players/icon_lg/"+
t.model+"_"+t.skin+".png");z=quakelive.resource("/images/players/icon_lg/"+z.model+"_"+z.skin+".png");var r=parseInt((new Date).getTime()/1E3);r=e.timelimit*60-(r-e.g_levelstarttime);var m="";if(r>0){m=parseInt(r/60);r-=m*60;m=ZeroPad(m)+":"+ZeroPad(r)}else m="00:00";e=['<div class="match"><div class="wrap"><div class="mapthumb" style="background-image: url(\'',x,'\')" title="',e.map_title,'"></div><div class="p1 icon" style="background-image: url(\'',t,'\')"></div><div class="p2 icon" style="background-image: url(\'',
z,'\')"></div><div class="p1 name">',p[0].name,'</div><div class="p2 name">',p[1].name,'</div><span class="p1 score">',p[0].score,'</span><span class="p2 score">',p[1].score,'</span><span class="sep score">-</span><div class="time"><span class="time-desc">Time Left:</span><br/>',m,"</div></div></div>"].join("");b.append(e)}}}}};quakelive.AddHook("OnContentLoaded",d.Hook_OnContentLoaded);quakelive.RegisterModule("livetracker",d)})(jQuery);
(function(a){function d(){this.invitationCount=0;this.state=b.PAUSED;this.timerHandle=null;this.listeners=[];this.activeInvites=[]}var b={PAUSED:0,POLL_FOR_EXPIRY:1};d.prototype.SendEvent=function(k,c){for(var e in this.listeners){var p=this.listeners[e];typeof p[k]=="function"&&p[k].apply(p,c)}};d.prototype.OnMonitorSuccess=function(k){typeof k.INVITE_COUNT!="undefined"&&this.SetInvitationCount(k.INVITE_COUNT)};d.prototype.OnMonitorError=function(){};d.prototype.DoMonitor=function(){var k=this;a.ajax({url:"/user/invite_count",
dataType:"json",cache:false,success:function(c){k.OnMonitorSuccess(c)},error:function(c,e,p){k.OnMonitorError(c,e,p)},complete:function(){k.RunMonitorTimer()}})};d.prototype.RunMonitorTimer=function(){if(this.timerHandle){clearTimeout(this.timerHandle);this.timerHandle=null}if(this.state!=b.PAUSED){var k=this;this.timerHandle=setTimeout(function(){k.DoMonitor()},3E5)}};d.prototype.SetInvitationCount=function(k){var c;c=k>0?b.POLL_FOR_EXPIRY:b.PAUSED;var e=this.invitationCount;this.invitationCount=
k;this.state=c;this.RunMonitorTimer();k!=e&&this.SendEvent("OnInvitationCountChanged",[this,k,e])};d.prototype.AddInvitation=function(){this.SetInvitationCount(this.invitationCount+1)};d.prototype.AddListener=function(k){this.listeners.push(k)};quakelive.inviteMonitor=new d})(jQuery);
(function(a){function d(){}d.prototype.OnInvitationCountChanged=function(b,k,c){var e=a("#invite_watch");if(e.length==0){e=a('<div id="invite_watch" title="Click to view your match invitations"><div class="status"></div></div>').hide();e.click(function(){quakelive.Goto("home","private=2")});a("#post_spon_content").prepend(e)}if(k==0)e.slideUp(1E3,function(){b.count==0&&e.remove()});else{var p;p=k==1?"You have <b>1</b> invitation":"You have <b>"+k+"</b> invitations";e.find(".status").html(p);k>c&&
e.slideDown(1E3,function(){e.effect("pulsate",{times:2},800)})}};quakelive.inviteMonitor.AddListener(new d)})(jQuery);quakelive.mod_friends.TPL_MANAGE_ITEM=[unescape("%3Cdiv class=%22prf_friend%22%3E%3Cdiv class=%22head_icon interactive%22%3E%3Cimg class=%22online%22 src=%22"),quakelive.resource("/images/profile/icn_onlineflag.png"),unescape("%22 width=%2230%22 height=%2230%22 style=%22display:none;%22/%3E%3C/div%3E%3Cdiv class=%22player_name%22%3E%3Cimg width=%2216%22 height=%2211%22 /%3E%3Ca href='javascript:;'%3E%3C/a%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22info_left%22%3E%3C/div%3E%3Cdiv class=%22info_middle%22%3E%3C/div%3E%3Cdiv class=%22info_right%22%3E%3Cdiv class=%22invite_controls%22%3E%3Ca href=%22javascript:;%22 class=%22btn_fr_view_profile%22 %3E%3C/a%3E%3Cdiv class=%22cl%22/%3E%3C/div%3E%3Ca href=%22javascript:;%22 class=%22btn_fr_delete_friend%22 %3E%3C/a%3E%3C/div%3E%3C/div%3E")].join("");
quakelive.mod_friends.TPL_INCOMING_ITEM=[unescape("%3Cdiv class=%22prf_friend%22%3E%3Cdiv class=%22head_icon interactive%22%3E%3Cimg class=%22online%22 src=%22"),quakelive.resource("/images/profile/icn_onlineflag.png"),unescape("%22 width=%2230%22 height=%2230%22 style=%22display:none;%22/%3E%3C/div%3E%3Cdiv class=%22player_name%22%3E%3Cimg width=%2216%22 height=%2211%22 /%3E%3Ca href='javascript:;'%3E%3C/a%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22info_left%22%3E%3C/div%3E%3Cdiv class=%22info_middle_right%22%3E%3Cdiv class=%22invite_controls%22%3E%3Ca href=%22javascript:;%22 class=%22btn_fr_view_profile%22 %3E%3C/a%3E%3Cdiv class=%22cl%22/%3E%3C/div%3E%3Ca href=%22javascript:;%22 class=%22btn_fr_block_player%22 %3E%3C/a%3E%3C/div%3E%3Cdiv class=%22info_right%22%3E%3Cdiv class=%22invite_controls%22%3E%3Ca href=%22javascript:;%22 class=%22btn_fr_accept_invite%22 %3E%3C/a%3E%3Cdiv class=%22cl%22/%3E%3C/div%3E%3Ca href=%22javascript:;%22 class=%22btn_fr_decline_invite%22 %3E%3C/a%3E%3C/div%3E%3C/div%3E")].join("");
quakelive.mod_friends.TPL_OUTGOING_ITEM=[unescape("%3Cdiv class=%22prf_friend%22%3E%3Cdiv class=%22head_icon interactive%22%3E%3Cimg class=%22online%22 src=%22"),quakelive.resource("/images/profile/icn_onlineflag.png"),unescape("%22 width=%2230%22 height=%2230%22 style=%22display:none;%22/%3E%3C/div%3E%3Cdiv class=%22player_name%22%3E%3Cimg width=%2216%22 height=%2211%22 /%3E%3Ca href='javascript:;'%3E%3C/a%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22info_left%22%3E%3C/div%3E%3Cdiv class=%22info_middle%22%3E%3C/div%3E%3Cdiv class=%22info_right%22%3E%3Cdiv class=%22invite_controls%22%3E%3Ca href=%22javascript:;%22 class=%22btn_fr_view_profile%22 %3E%3C/a%3E%3Cdiv class=%22cl%22/%3E%3C/div%3E%3Ca href=%22javascript:;%22 class=%22btn_fr_revoke_invite%22 %3E%3C/a%3E%3C/div%3E%3C/div%3E")].join("");
quakelive.mod_friends.TPL_BLOCK_ITEM=[unescape("%3Cdiv class=%22prf_friend%22%3E%3Cdiv class=%22head_icon interactive%22%3E%3Cimg class=%22online%22 src=%22"),quakelive.resource("/images/profile/icn_onlineflag.png"),unescape("%22 width=%2230%22 height=%2230%22 style=%22display:none;%22/%3E%3C/div%3E%3Cdiv class=%22player_name%22%3E%3Cimg width=%2216%22 height=%2211%22 /%3E%3Ca href='javascript:;'%3E%3C/a%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22info_left%22%3E%3C/div%3E%3Cdiv class=%22info_middle%22%3E%3C/div%3E%3Cdiv class=%22info_right%22%3E%3Cdiv class=%22invite_controls%22%3E%3Ca href=%22javascript:;%22 class=%22btn_fr_view_profile%22 %3E%3C/a%3E%3Cdiv class=%22cl%22/%3E%3C/div%3E%3Ca href=%22javascript:;%22 class=%22btn_fr_unblock_player%22 %3E%3C/a%3E%3C/div%3E%3C/div%3E")].join("");
quakelive.mod_friends.TPL_SEARCH_EMAIL_REMOTE=[unescape("%3Cdiv class=%22qlv_searchForm%22%3E%3Cdiv class=%22qlv_success_left%22%3E%3Cimg src=%22"),quakelive.resource("/images/sf/friends/invite_success.gif"),unescape("%22 width=%22215%22 height=%22103%22 /%3E%3Cp%3E&nbsp;%3C/p%3E%3C/div%3E%3Cdiv class=%22qlv_searchForm_right%22%3E%3Cp class=%22footerCopy%22%3E&nbsp;%3C/p%3E%3Cp style=%22margin-bottom: 0px;%22%3E%3Cspan style=%22font-family: Arial,Helvetica,sans-serif; font-size: 12pt; font-weight: bold;%22%3EInvites Sent! %3Cbr /%3E However, you have Gmail contacts that are not current QUAKE LIVE players.%3C/span%3E%3Cbr /%3E%3Cbr /%3ESelect which contacts to invite from the list.%3C/p%3E%3Cp%3E%3C/p%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22qlv_resultListIE6Fix%22%3E%3Cdiv class=%22qlv_resultsList_popup%22%3E%3Cdiv class=%22qlv_resultsListNA%22 style=%22margin: 20px; text-align: center; font-size: 16px; font-family: Arial; display: none;%22%3E%3C/div%3E%3Ctable cellpadding=%220%22 cellspacing=%220%22 class=%22qlv_resultsTable%22%3E%3Ctr%3E%3Ctd%3E%3Cdiv align=%22center%22%3E%3Cinput id=%22qlv_selectAllEmail%22 type=%22checkbox%22 /%3E%3C/div%3E%3C/td%3E%3Ctd%3E%3Cspan style=%22width:198px;%22%3E%3Cimg src=%22"),
quakelive.resource("/images/sf/friends/sort_down_icon.gif"),unescape("%22 /%3E%3C/span%3E%3C/td%3E%3Ctd width=%22485%22 style=%22width:198px;%22%3E  email%3C/td%3E%3Ctd width=%2233%22%3E%3Cdiv align=%22right%22%3E%3C/div%3E%3C/td%3E%3C/tr%3E%3Ctbody%3E%3C/tbody%3E%3C/table%3E%3C/div%3E%3C/div%3E%3Cp class=%22qlv_skipbutton%22%3E%3Ca href=%22javascript:;%22 onclick=%22return false%22 /%3E%3C/p%3E%3Cp class=%22qlv_invitebutton%22%3E%3Ca href=%22javascript:;%22 onclick=%22return false%22 /%3E%3C/p%3E")].join("");
quakelive.mod_friends.TPL_FRIENDS_LIST=""+unescape("%3Cdiv id=%22im-header%22%3E%3C/div%3E%3Cdiv id=%22im-body%22%3E%3Cdiv id=%22im-active%22%3E%3Ch1%3E%3C/h1%3E%3Cdiv class=%22itemlist%22%3E%3C/div%3E%3C/div%3E%3Cdiv id=%22im-online%22%3E%3Ch1%3E%3C/h1%3E%3Cdiv class=%22itemlist%22%3E%3C/div%3E%3C/div%3E%3C/div%3E%3Cdiv id=%22im-footer%22%3E%3C/div%3E");
quakelive.mod_prefs.TPL_CHARACTER=[unescape("%3Cdiv class=%22innerpanel fl%22%3E%3Cdiv class=%22rollover fl%22%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.Nav('character')%22 class=%22btn_character fl selected%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.Nav('controls_movement')%22 class=%22btn_controls fl%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.Nav('settings_basic')%22 class=%22btn_settings fl%22%3E%3C/a%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22character_gallery fl%22%3E%3Cdiv class=%22thirtypxhigh%22%3E%3C/div%3E%3Cdiv id=%22character_list%22 class=%22character_select fl%22%3E%3Cimg src=%22"),quakelive.resource("/images/loader.gif"),
unescape("%22 width=%2262%22 height=%2213%22 /%3E Loading model list&hellip;%3C/div%3E%3Cdiv class=%22fl twentypxh long%22%3E%3Cdiv class=%22fl%22%3E%3Cdiv id=%22cfg_char_lgicon%22 class=%22char_lgicon fl%22%3E%3C/div%3E%3Cdiv class=%22fl twelvepxv tenpxh%22%3E%3Cdiv id=%22cfg_char_name%22 style=%22width: 220px; height: 24px%22%3E%3C/div%3E%3Cdiv id=%22cfg_char_race%22 style=%22width: 220px; height: 24px%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3Cdiv id=%22cfg_char_description%22 class=%22fl tenpxv eightypxhigh footerCopy%22 style=%22overflow: hidden%22%3E%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3Cdiv class=%22fifteenpxhigh%22%3E%3C/div%3E%3Cdiv class=%22team_game_version%22%3E%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3Cdiv id=%22cfg_char_redteam%22 class=%22red_team fl%22%3E%3C/div%3E%3Cdiv id=%22cfg_char_blueteam%22 class=%22blue_team fl%22%3E%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22fl%22 style=%22position: relative%22%3E%3Cdiv id=%22cfg_char_body%22 style=%22position: absolute; top: 10px; left: -15px%22 class=%22bodyshot fl%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3Cdiv class=%22twentypxh twentytwopxv%22%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.ResetDefaults(); return false%22 class=%22fl reset_settings_defaults%22%3E%3C/a%3E%3Cdiv class=%22fl tenpxh light-midGrayTxt footerCopy%22%3EReset Defaults for all game settings%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3C/div%3E")].join("");
quakelive.mod_prefs.TPL_SETTINGS_BASIC=""+unescape("%3Cdiv class=%22innerpanellong fl%22%3E%3Cdiv class=%22rollover fl%22%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.Nav('character')%22 class=%22btn_character fl%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.Nav('controls_movement')%22 class=%22btn_controls fl%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.Nav('settings_basic')%22 class=%22btn_settings fl selected%22%3E%3C/a%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3Cdiv%3E%3Cdiv class=%22fl%22 style=%22width: 276px;%22%3E&nbsp;%3C/div%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.Nav('settings_basic')%22 class=%22btn_basic_active fl%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.Nav('settings_advanced')%22 class=%22btn_advanced fl%22%3E%3C/a%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22fl sixteenpxv%22%3E%3Cdiv class=%22fl twentypxh%22%3E%3Cdiv class=%22panel_audio%22%3E%3Cdiv class=%22twentythreepxhigh%22%3E%3C/div%3E%3Cdiv class=%22fourteenpxh footerCopy%22%3E%3Cp%3E%3Cdiv class='fl'%3EEffects volume:&nbsp;%3C/div%3E %3Cdiv id='effects_volume_value' class='fl'%3E%3C/div%3E%3Cdiv class='cl'%3E%3C/div%3E%3C/p%3E%3Cdiv id=%22slider_s_volume%22 class=%22slider ui-slider%22%3E%3C/div%3E%3Cdiv class=%22sliderpxh%22%3E%3Cdiv class=%22fl ninePxTxt lightGrayTxt%22%3Emin%3C/div%3E%3Cdiv class=%22fr ninePxTxt lightGrayTxt%22%3Emax%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22fourpxv%22%3E%3C/div%3E%3Cdiv class=%22fourteenpxh footerCopy%22%3E%3Cp%3E%3Cdiv class='fl'%3EMusic volume:&nbsp;%3C/div%3E %3Cdiv id='music_volume_value' class='fl'%3E%3C/div%3E%3Cdiv class='cl'%3E%3C/div%3E%3C/p%3E%3Cdiv id=%22slider_s_musicvolume%22 class=%22slider ui-slider%22%3E%3C/div%3E%3Cdiv class=%22sliderpxh%22%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3Cdiv class=%22fl ninePxTxt lightGrayTxt%22%3Emin%3C/div%3E%3Cdiv class=%22fr ninePxTxt lightGrayTxt%22%3Emax%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22twentypxv%22%3E%3C/div%3E%3Cdiv class=%22panel_video%22%3E%3Cdiv class=%22twentythreepxhigh%22%3E%3C/div%3E%3Cdiv class=%22fourteenpxh twohundredseventywide%22%3E%3Cdiv class=%22fl med%22%3E%3Cdiv class=%22footerCopy thirtypxhigh%22%3EPlay Full Screen:%3C/div%3E%3Cdiv class=%22footerCopy thirtypxhigh%22%3EFull Screen Resolution:%3C/div%3E%3Cdiv class=%22footerCopy thirtypxhigh%22%3EBrowser Resolution:%3C/div%3E%3Cdiv class=%22footerCopy%22%3E%3Cp%3E%3Cdiv class='fl'%3EBrightness:&nbsp;%3C/div%3E %3Cdiv id='brightness_value' class='fl'%3E%3C/div%3E%3Cdiv class='cl'%3E%3C/div%3E%3C/p%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22fl fourteenpxh%22%3E%3Cdiv class=%22ninePxTxt lightGrayTxt thirtypxhigh%22 id=%22r_fullscreen%22%3E%3C/div%3E%3Cdiv class=%22thirtypxhigh%22%3E%3Cselect id='select_r_mode' name='r_mode'%3E%3C/select%3E%3C/div%3E%3Cdiv class=%22thirtypxhigh%22%3E%3Cselect id='select_r_inbrowsermode' name='r_inbrowsermode'%3E%3C/select%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3Cdiv id=%22slider_r_gamma%22 class=%22slider ui-slider%22%3E%3C/div%3E%3Cdiv class=%22sliderpxh%22%3E%3Cdiv class=%22fl ninePxTxt lightGrayTxt%22%3Emin%3C/div%3E%3Cdiv class=%22fr ninePxTxt lightGrayTxt%22%3Emax%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3C/div%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22panel_weapons fl twentypxh%22%3E%3Cdiv style=%22height: 25px%22%3E&nbsp;%3C/div%3E%3Cdiv class=%22fourteenpxh twohundredseventywide%22%3E%3Cdiv class=%22fl%22%3E%3Cdiv class=%22footerCopy thirtypxhigh%22%3EAuto Switch:%3C/div%3E%3C/div%3E%3Cdiv class=%22fl twentypxh%22%3E%3Cdiv class=%22ninePxTxt lightGrayTxt thirtypxhigh%22 id=%22cg_autoswitch%22%3E%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3Cdiv class=%22footerCopy%22%3ERail Gun Primary Color:%3C/div%3E%3Cdiv id=%22color1_select%22 class=%22rail_select%22%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.SelectColor('color1', 1); return false%22 id=%22color1_1%22 class=%22red%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.SelectColor('color1', 9); return false%22 id=%22color1_2%22 class=%22green%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.SelectColor('color1', 5); return false%22 id=%22color1_3%22 class=%22yellow%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.SelectColor('color1', 17); return false%22 id=%22color1_4%22 class=%22blue%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.SelectColor('color1', 13); return false%22 id=%22color1_5%22 class=%22ltpurple%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.SelectColor('color1', 21); return false%22 id=%22color1_6%22 class=%22purple%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.SelectColor('color1', 26); return false%22 id=%22color1_7%22 class=%22white%22%3E%3C/a%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3Cdiv class=%22tenpxhigh%22%3E%3C/div%3E%3Cdiv class=%22footerCopy%22%3ERail Gun Secondary Color:%3C/div%3E%3Cdiv id=%22color2_select%22 class=%22rail_select%22%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.SelectColor('color2', 1); return false%22 id=%22color2_1%22 class=%22red%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.SelectColor('color2', 9); return false%22 id=%22color2_2%22 class=%22green%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.SelectColor('color2', 5); return false%22 id=%22color2_3%22 class=%22yellow%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.SelectColor('color2', 17); return false%22 id=%22color2_4%22 class=%22blue%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.SelectColor('color2', 13); return false%22 id=%22color2_5%22 class=%22ltpurple%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.SelectColor('color2', 21); return false%22 id=%22color2_6%22 class=%22purple%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.SelectColor('color2', 26); return false%22 id=%22color2_7%22 class=%22white%22%3E%3C/a%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3Cdiv class=%22fifteenpxhigh%22%3E%3C/div%3E%3Cdiv class=%22footerCopy%22%3ECrosshair Symbol:%3C/div%3E%3Cdiv id=%22crosshair_select%22 class=%22crosshair_select%22%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.SelectCrosshair(1); return false%22 id=%22crosshair_1%22 class=%22a%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.SelectCrosshair(2); return false%22 id=%22crosshair_2%22 class=%22b%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.SelectCrosshair(3); return false%22 id=%22crosshair_3%22 class=%22c%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.SelectCrosshair(4); return false%22 id=%22crosshair_4%22 class=%22d%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.SelectCrosshair(5); return false%22 id=%22crosshair_5%22 class=%22e%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.SelectCrosshair(6); return false%22 id=%22crosshair_6%22 class=%22f%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.SelectCrosshair(7); return false%22 id=%22crosshair_7%22 class=%22g%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.SelectCrosshair(8); return false%22 id=%22crosshair_8%22 class=%22h%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.SelectCrosshair(9); return false%22 id=%22crosshair_9%22 class=%22i%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.SelectCrosshair(10); return false%22 id=%22crosshair_10%22 class=%22j%22%3E%3C/a%3E%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3Cdiv class=%22tenpxhigh%22%3E%3C/div%3E%3Cdiv class=%22footerCopy%22%3ECrosshair Color:%3C/div%3E%3Cdiv id=%22color2_select%22 class=%22rail_select%22%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.SelectColor('cg_crosshairColor', 1); return false%22 id=%22cg_crosshairColor_1%22 class=%22red%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.SelectColor('cg_crosshairColor', 9); return false%22 id=%22cg_crosshairColor_2%22 class=%22green%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.SelectColor('cg_crosshairColor', 5); return false%22 id=%22cg_crosshairColor_3%22 class=%22yellow%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.SelectColor('cg_crosshairColor', 17); return false%22 id=%22cg_crosshairColor_4%22 class=%22blue%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.SelectColor('cg_crosshairColor', 13); return false%22 id=%22cg_crosshairColor_5%22 class=%22ltpurple%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.SelectColor('cg_crosshairColor', 21); return false%22 id=%22cg_crosshairColor_6%22 class=%22purple%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.SelectColor('cg_crosshairColor', 26); return false%22 id=%22cg_crosshairColor_7%22 class=%22white%22%3E%3C/a%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22character_overlay fl%22%3E%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3Cdiv class=%22twentypxh%22%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.ResetDefaults(); return false%22 class=%22fl reset_settings_defaults%22%3E%3C/a%3E%3Cdiv class=%22fl tenpxh light-midGrayTxt footerCopy%22%3EReset Defaults for all game settings%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3C/div%3E");
quakelive.mod_prefs.TPL_SETTINGS_ADVANCED=""+unescape("%3Cdiv class=%22innerpanellong fl%22%3E%3Cdiv class=%22rollover fl%22%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.Nav('character')%22 class=%22btn_character fl%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.Nav('controls_movement')%22 class=%22btn_controls fl%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.Nav('settings_basic')%22 class=%22btn_settings fl selected%22%3E%3C/a%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3Cdiv%3E%3Cdiv class=%22fl%22 style=%22width: 276px;%22%3E&nbsp;%3C/div%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.Nav('settings_basic')%22 class=%22btn_basic fl%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.Nav('settings_advanced')%22 class=%22btn_advanced_active fl%22%3E%3C/a%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22fl sixteenpxv%22%3E%3Cdiv class=%22fl hundredwide%22%3E&nbsp;%3C/div%3E%3Cdiv class=%22fl%22%3E%3Cdiv class=%22panel_audio_advanced%22%3E%3Cdiv class=%22twentythreepxhigh%22%3E%3C/div%3E%3Cdiv class=%22fourteenpxh twohundredseventywide%22%3E%3Cdiv class=%22fl hundredwide%22%3E%3Cdiv class=%22footerCopy thirtypxhigh%22%3EDoppler%3C/div%3E%3C/div%3E%3Cdiv class=%22fl fourteenpxh%22%3E%3Cdiv class=%22ninePxTxt lightGrayTxt thirtypxhigh%22 id=%22s_doppler%22%3E%3C/div%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22twentypxv%22%3E%3C/div%3E%3Cdiv class=%22panel_options_advanced%22%3E%3Cdiv class=%22twentythreepxhigh%22%3E%3C/div%3E%3Cdiv class=%22fourteenpxh twohundredseventywide%22%3E%3Cdiv class=%22fl med tenpxh%22%3E%3Cdiv class=%22tenpxhigh%22%3E%3C/div%3E%3Cdiv class=%22footerCopy thirtypxhigh%22%3EDraw Target Names%3C/div%3E%3Cdiv class=%22footerCopy thirtypxhigh%22%3ETaunts%3C/div%3E%3C/div%3E%3Cdiv class=%22fl%22%3E%3Cdiv class=%22tenpxhigh%22%3E%3C/div%3E%3Cdiv class=%22ninePxTxt lightGrayTxt thirtypxhigh%22 id=%22cg_drawtargetnames%22%3E%3C/div%3E%3Cdiv class=%22ninePxTxt lightGrayTxt thirtypxhigh%22 id=%22cg_allowtaunt%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22advanced_panels_right fl%22%3E%3Cdiv class=%22twentyfivepxhigh%22%3E%3C/div%3E%3Cdiv class=%22panel_video_advanced fl%22%3E%3Cdiv class=%22thirtypxhigh%22%3E%3C/div%3E%3Cdiv class=%22twentypxh twohundredseventywide%22%3E%3Cdiv class=%22fl%22%3E%3Cdiv class=%22footerCopy thirtypxhigh hundredtwentywide%22%3ELighting Model%3C/div%3E%3Cdiv class=%22footerCopy thirtypxhigh hundredtwentywide%22%3EGeometry Detail%3C/div%3E%3Cdiv class=%22footerCopy thirtypxhigh hundredtwentywide%22%3ETexture Filter%3C/div%3E%3Cdiv class=%22footerCopy thirtypxhigh hundredtwentywide%22%3ETexture Quality%3C/div%3E%3Cdiv class=%22footerCopy thirtypxhigh hundredtwentywide%22%3ETexture Compression%3C/div%3E%3C/div%3E%3Cdiv class=%22fl twentypxh%22%3E%3Cdiv class=%22thirtypxhigh hundredwide tr%22%3E%3Cselect id=%22select_r_vertexlight%22 name=%22r_vertexlight%22%3E%3C/select%3E%3C/div%3E%3Cdiv class=%22thirtypxhigh hundredwide tr%22%3E%3Cselect id=%22select_r_lodbias%22 name=%22r_lodbias%22%3E%3C/select%3E%3C/div%3E%3Cdiv class=%22thirtypxhigh hundredwide tr%22%3E%3Cselect id=%22select_r_texturemode%22 name=%22r_texturemode%22%3E%3C/select%3E%3C/div%3E%3Cdiv class=%22thirtypxhigh hundredwide tr%22%3E%3Cselect id=%22select_r_picmip%22 name=%22r_picmip%22%3E%3C/select%3E%3C/div%3E%3Cdiv class=%22ninePxTxt lightGrayTxt thirtypxhigh hundredwide tr%22 id=%22r_ext_compressed_textures%22%3E%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3Cdiv class=%22footerCopy%22%3E%3Cp%3E%3Cdiv class='fl'%3EField of view:&nbsp;%3C/div%3E %3Cdiv id='fov_value' class='fl'%3E%3C/div%3E%3Cdiv class='cl'%3E%3C/div%3E%3C/p%3E%3Cdiv id=%22slider_cg_fov%22 class=%22slider ui-slider%22%3E%3C/div%3E%3Cdiv class=%22sliderpxh%22%3E%3Cdiv class=%22fl ninePxTxt lightGrayTxt%22%3Emin%3C/div%3E%3Cdiv class=%22fr ninePxTxt lightGrayTxt%22%3Emax%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22fifteenpxhigh%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22fifteenpxhigh%22%3E%3C/div%3E%3C/div%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3Cdiv class=%22twentypxh twentypxlh%22%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.ResetDefaults(); return false%22 class=%22fl reset_settings_defaults%22%3E%3C/a%3E%3Cdiv class=%22fl tenpxh light-midGrayTxt footerCopy%22%3EReset Defaults for all game settings%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3C/div%3E");
quakelive.mod_prefs.TPL_CONTROLS_ACTIONS=""+unescape("%3Cdiv class=%22innerpanellong fl%22%3E%3Cdiv class=%22rollover fl%22%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.Nav('character'); return false%22 class=%22btn_character fl%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.Nav('controls_movement'); return false%22 class=%22btn_controls fl selected%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.Nav('settings_basic'); return false%22 class=%22btn_settings fl%22%3E%3C/a%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3Cdiv class=%22innerpanelsubnav%22%3E%3Cdiv class=%22fl%22 style=%22width:132px;%22%3E&nbsp;%3C/div%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.Nav('controls_movement'); return false%22 class=%22btn_movement fl%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.Nav('controls_actions'); return false%22 class=%22btn_actions fl selected%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.Nav('controls_weapons'); return false%22 class=%22btn_weapons fl%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.Nav('controls_mouse'); return false%22 class=%22btn_mouse fl%22%3E%3C/a%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22innerpanelsettings%22%3E%3Cdiv class=%22controlsBG fl%22%3E%3Cdiv class=%22row%22%3E%3Cdiv class=%22medlong fl twentypxh fourpxpadtop%22%3E%3Cdiv class=%22txtCommand%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22sixtypxwide fl fourpxpadtop%22%3E%3Cdiv class=%22txtMainKey%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3Cdiv id=%22controls_actions_binds0%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22greyVertLine fl%22%3E%3C/div%3E%3Cdiv class=%22controlsBG fl%22%3E%3Cdiv class=%22row%22%3E%3Cdiv class=%22medlong fl twentypxh fourpxpadtop%22%3E%3Cdiv class=%22txtCommand%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22sixtypxwide fl fourpxpadtop%22%3E%3Cdiv class=%22txtMainKey%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3Cdiv id=%22controls_actions_binds1%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22fivepxhigh%22%3E%3C/div%3E%3Cdiv class=%22mainkeyhr%22%3E%3C/div%3E%3Cdiv class=%22keyboard_container%22%3E%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3Cdiv class=%22threepxhigh%22%3E%3C/div%3E%3Cdiv class=%22twentypxh%22%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.ResetDefaults(); return false%22 class=%22fl reset_settings_defaults%22%3E%3C/a%3E%3Cdiv class=%22fl tenpxh light-midGrayTxt footerCopy%22%3EReset Defaults for all game settings%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3C/div%3E");
quakelive.mod_prefs.TPL_CONTROLS_MOVEMENT=""+unescape("%3Cdiv class=%22innerpanellong fl%22%3E%3Cdiv class=%22rollover fl%22%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.Nav('character'); return false%22 class=%22btn_character fl%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.Nav('controls_movement'); return false%22 class=%22btn_controls fl selected%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.Nav('settings_basic'); return false%22 class=%22btn_settings fl%22%3E%3C/a%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3Cdiv class=%22innerpanelsubnav%22%3E%3Cdiv class=%22fl%22 style=%22width:132px;%22%3E&nbsp;%3C/div%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.Nav('controls_movement'); return false%22 class=%22btn_movement fl selected%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.Nav('controls_actions'); return false%22 class=%22btn_actions fl%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.Nav('controls_weapons'); return false%22 class=%22btn_weapons fl%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.Nav('controls_mouse'); return false%22 class=%22btn_mouse fl%22%3E%3C/a%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22innerpanelsettings%22%3E%3Cdiv class=%22controlsBG fl%22%3E%3Cdiv class=%22row%22%3E%3Cdiv class=%22medlong fl twentypxh fourpxpadtop%22%3E%3Cdiv class=%22txtCommand%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22sixtypxwide fl fourpxpadtop%22%3E%3Cdiv class=%22txtMainKey%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3Cdiv id=%22controls_movement_binds0%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22greyVertLine fl%22%3E%3C/div%3E%3Cdiv class=%22controlsBG fl%22%3E%3Cdiv class=%22row%22%3E%3Cdiv class=%22medlong fl twentypxh fourpxpadtop%22%3E%3Cdiv class=%22txtCommand%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22sixtypxwide fl fourpxpadtop%22%3E%3Cdiv class=%22txtMainKey%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3Cdiv id=%22controls_movement_binds1%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22fivepxhigh%22%3E%3C/div%3E%3Cdiv class=%22mainkeyhr%22%3E%3C/div%3E%3Cdiv class=%22keyboard_container%22%3E%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3Cdiv class=%22threepxhigh%22%3E%3C/div%3E%3Cdiv class=%22twentypxh%22%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.ResetDefaults(); return false%22 class=%22fl reset_settings_defaults%22%3E%3C/a%3E%3Cdiv class=%22fl tenpxh light-midGrayTxt footerCopy%22%3EReset Defaults for all game settings%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3C/div%3E");
quakelive.mod_prefs.TPL_CONTROLS_WEAPONS=""+unescape("%3Cdiv class=%22innerpanellong fl%22%3E%3Cdiv class=%22rollover fl%22%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.Nav('character'); return false%22 class=%22btn_character fl%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.Nav('controls_movement'); return false%22 class=%22btn_controls fl selected%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.Nav('settings_basic'); return false%22 class=%22btn_settings fl%22%3E%3C/a%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3Cdiv class=%22innerpanelsubnav%22%3E%3Cdiv class=%22fl%22 style=%22width:132px;%22%3E&nbsp;%3C/div%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.Nav('controls_movement'); return false%22 class=%22btn_movement fl%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.Nav('controls_actions'); return false%22 class=%22btn_actions fl%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.Nav('controls_weapons'); return false%22 class=%22btn_weapons fl selected%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.Nav('controls_mouse'); return false%22 class=%22btn_mouse fl%22%3E%3C/a%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22innerpanelsettings%22%3E%3Cdiv class=%22controlsBG fl%22%3E%3Cdiv class=%22row%22%3E%3Cdiv class=%22medlong fl twentypxh fourpxpadtop%22%3E%3Cdiv class=%22txtCommand%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22sixtypxwide fl fourpxpadtop%22%3E%3Cdiv class=%22txtMainKey%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3Cdiv id=%22controls_weapons_binds0%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22greyVertLine fl%22%3E%3C/div%3E%3Cdiv class=%22controlsBG fl%22%3E%3Cdiv class=%22row%22%3E%3Cdiv class=%22medlong fl twentypxh fourpxpadtop%22%3E%3Cdiv class=%22txtCommand%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22sixtypxwide fl fourpxpadtop%22%3E%3Cdiv class=%22txtMainKey%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3Cdiv id=%22controls_weapons_binds1%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22fivepxhigh%22%3E%3C/div%3E%3Cdiv class=%22mainkeyhr%22%3E%3C/div%3E%3Cdiv class=%22keyboard_container%22%3E%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3Cdiv class=%22threepxhigh%22%3E%3C/div%3E%3Cdiv class=%22twentypxh%22%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.ResetDefaults(); return false%22 class=%22fl reset_settings_defaults%22%3E%3C/a%3E%3Cdiv class=%22fl tenpxh light-midGrayTxt footerCopy%22%3EReset Defaults for all game settings%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3C/div%3E");
quakelive.mod_prefs.TPL_CONTROLS_MOUSE=[unescape("%3Cdiv class=%22innerpanellong fl%22%3E%3Cdiv class=%22rollover fl%22%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.Nav('character'); return false%22 class=%22btn_character fl%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.Nav('controls_movement'); return false%22 class=%22btn_controls fl selected%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.Nav('settings_basic'); return false%22 class=%22btn_settings fl%22%3E%3C/a%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3Cdiv class=%22innerpanelsubnav%22%3E%3Cdiv class=%22fl%22 style=%22width:132px;%22%3E&nbsp;%3C/div%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.Nav('controls_movement'); return false%22 class=%22btn_movement fl%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.Nav('controls_actions'); return false%22 class=%22btn_actions fl%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.Nav('controls_weapons'); return false%22 class=%22btn_weapons fl%22%3E%3C/a%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.Nav('controls_mouse'); return false%22 class=%22btn_mouse fl selected%22%3E%3C/a%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22innerpanelsettings%22%3E%3Cdiv class=%22fl%22%3E%3Cdiv class=%22mc_panel%22%3E%3Cimg src=%22"),
quakelive.resource("/images/sf/registration/controls/mouse_invert_label.gif"),unescape("%22 class=%22label%22 /%3E%3Cdiv class=%22tenpxv%22%3E%3C/div%3E%3Cdiv class=%22mc_opts tc%22%3E%3Cdiv class=%22fl tenpxwide%22%3E&nbsp;%3C/div%3E%3Cdiv class=%22fl%22%3E%3Cdiv class=%22fivepxv%22%3E%3C/div%3E%3Cdiv id=%22m_pitch%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22fl tenpxwide%22%3E&nbsp;%3C/div%3E%3Cdiv class=%22fl tl%22%3E&quot;On&quot; will reverse the direction%3Cbr /%3Eof looking up and down.%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22greyVertLine fl%22%3E%3C/div%3E%3Cdiv class=%22fl%22%3E%3Cdiv class=%22mc_panel%22%3E%3Cimg src=%22"),
quakelive.resource("/images/sf/registration/controls/mouse_sensitivity_label.gif"),unescape("%22 class=%22label%22 /%3E%3Cdiv class=%22mc_opts%22%3E%3Cp%3E%3Cdiv class='fl'%3EMouse sensitivity:&nbsp;%3C/div%3E %3Cdiv id='mouse_sens_value' class='fl'%3E%3C/div%3E%3Cdiv class='cl'%3E%3C/div%3E%3C/p%3E%3Cdiv class=%22fivepxv%22%3E%3C/div%3E%3Cdiv id=%22slider_sensitivity%22 class=%22slider ui-slider%22%3E%3C/div%3E%3Cdiv class=%22sliderpxh%22%3E%3Cdiv class=%22fl ninePxTxt lightGrayTxt%22%3Emin%3C/div%3E%3Cdiv class=%22fr ninePxTxt lightGrayTxt%22%3Emax%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3C/div%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22fivepxhigh%22%3E%3C/div%3E%3Cdiv class=%22mainkeyhr%22%3E%3C/div%3E%3Cdiv class=%22keyboard_container%22%3E%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3Cdiv class=%22threepxhigh%22%3E%3C/div%3E%3Cdiv class=%22twentypxh%22%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.ResetDefaults(); return false%22 class=%22fl reset_settings_defaults%22%3E%3C/a%3E%3Cdiv class=%22fl tenpxh light-midGrayTxt footerCopy%22%3EReset Defaults for all game settings%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3C/div%3E")].join("");
quakelive.mod_prefs.TPL_KEYBOARD=""+unescape("%3Cdiv id=%22qlv_keyboard%22%3E%3Cdiv class=%22left%22%3E%3Cdiv%3E%3Cspan class=%22key_ESCAPE esc%22%3E%3C/span%3E%3Cspan class=%22key_F1 f1%22%3E%3C/span%3E%3Cspan class=%22key_F2 f2%22%3E%3C/span%3E%3Cspan class=%22key_F3 f3%22%3E%3C/span%3E%3Cspan class=%22key_F4 f4%22%3E%3C/span%3E%3Cspan class=%22key_F5 f5%22%3E%3C/span%3E%3Cspan class=%22key_F6 f6%22%3E%3C/span%3E%3Cspan class=%22key_F7 f7%22%3E%3C/span%3E%3Cspan class=%22key_F8 f8%22%3E%3C/span%3E%3Cspan class=%22key_F9 f9%22%3E%3C/span%3E%3Cspan class=%22key_F10 f10%22%3E%3C/span%3E%3Cspan class=%22key_F11 f11%22%3E%3C/span%3E%3Cspan class=%22key_F12 f12%22%3E%3C/span%3E%3C/div%3E%3Cdiv%3E%3Cspan class=%22key_TILDE tilde%22%3E%3C/span%3E%3Cspan class=%22key_1 k1%22%3E%3C/span%3E%3Cspan class=%22key_2 k2%22%3E%3C/span%3E%3Cspan class=%22key_3 k3%22%3E%3C/span%3E%3Cspan class=%22key_4 k4%22%3E%3C/span%3E%3Cspan class=%22key_5 k5%22%3E%3C/span%3E%3Cspan class=%22key_6 k6%22%3E%3C/span%3E%3Cspan class=%22key_7 k7%22%3E%3C/span%3E%3Cspan class=%22key_8 k8%22%3E%3C/span%3E%3Cspan class=%22key_9 k9%22%3E%3C/span%3E%3Cspan class=%22key_0 k0%22%3E%3C/span%3E%3Cspan class=%22key_MINUS minus%22%3E%3C/span%3E%3Cspan class=%22key_EQUALS equal%22%3E%3C/span%3E%3Cspan class=%22key_BACKSPACE backspace%22%3E%3C/span%3E%3C/div%3E%3Cdiv%3E%3Cspan class=%22key_TAB tab%22%3E%3C/span%3E%3Cspan class=%22key_Q q%22%3E%3C/span%3E%3Cspan class=%22key_W w%22%3E%3C/span%3E%3Cspan class=%22key_E e%22%3E%3C/span%3E%3Cspan class=%22key_R r%22%3E%3C/span%3E%3Cspan class=%22key_T t%22%3E%3C/span%3E%3Cspan class=%22key_Y y%22%3E%3C/span%3E%3Cspan class=%22key_U u%22%3E%3C/span%3E%3Cspan class=%22key_I i%22%3E%3C/span%3E%3Cspan class=%22key_O o%22%3E%3C/span%3E%3Cspan class=%22key_P p%22%3E%3C/span%3E%3Cspan class=%22key_LEFTBRACKET lbrack%22%3E%3C/span%3E%3Cspan class=%22key_RIGHTBRACKET rbrack%22%3E%3C/span%3E%3Cspan class=%22key_BACKSLASH bslash%22%3E%3C/span%3E%3C/div%3E%3Cdiv%3E%3Cspan class=%22key_CAPSLOCK capslock%22%3E%3C/span%3E%3Cspan class=%22key_A a%22%3E%3C/span%3E%3Cspan class=%22key_S s%22%3E%3C/span%3E%3Cspan class=%22key_D d%22%3E%3C/span%3E%3Cspan class=%22key_F f%22%3E%3C/span%3E%3Cspan class=%22key_G g%22%3E%3C/span%3E%3Cspan class=%22key_H h%22%3E%3C/span%3E%3Cspan class=%22key_J j%22%3E%3C/span%3E%3Cspan class=%22key_K k%22%3E%3C/span%3E%3Cspan class=%22key_L l%22%3E%3C/span%3E%3Cspan class=%22key_SEMICOLON semicolon%22%3E%3C/span%3E%3Cspan class=%22key_APOSTROPHE apos%22%3E%3C/span%3E%3Cspan class=%22key_ENTER return%22%3E%3C/span%3E%3C/div%3E%3Cdiv%3E%3Cspan class=%22key_SHIFT shiftl%22%3E%3C/span%3E%3Cspan class=%22key_Z z%22%3E%3C/span%3E%3Cspan class=%22key_X x%22%3E%3C/span%3E%3Cspan class=%22key_C c%22%3E%3C/span%3E%3Cspan class=%22key_V v%22%3E%3C/span%3E%3Cspan class=%22key_B b%22%3E%3C/span%3E%3Cspan class=%22key_N n%22%3E%3C/span%3E%3Cspan class=%22key_M m%22%3E%3C/span%3E%3Cspan class=%22key_COMMA comma%22%3E%3C/span%3E%3Cspan class=%22key_PERIOD period%22%3E%3C/span%3E%3Cspan class=%22key_FORWARDSLASH fslash%22%3E%3C/span%3E%3Cspan class=%22key_SHIFT shiftr%22%3E%3C/span%3E%3C/div%3E%3Cdiv%3E%3Cspan class=%22key_CTRL ctrll%22%3E%3C/span%3E%3Cspan class=%22key_LEFTWIN winl%22%3E%3C/span%3E%3Cspan class=%22key_LEFTALT altl%22%3E%3C/span%3E%3Cspan class=%22key_SPACE spacebar%22%3E%3C/span%3E%3Cspan class=%22key_RIGHTALT altr%22%3E%3C/span%3E%3Cspan class=%22key_RIGHTWIN winr%22%3E%3C/span%3E%3Cspan class=%22key_CTRL ctrlr%22%3E%3C/span%3E%3Ca href=%22#%22 class=%22%22%3E%3C/a%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22center%22%3E%3Cdiv%3E%3Cspan class=%22key_PRTSCRN prtscr%22%3E%3C/span%3E%3Cspan class=%22key_SCROLLLOCK scrolllock%22%3E%3C/span%3E%3Cspan class=%22key_PAUSE pausebreak%22%3E%3C/span%3E%3C/div%3E%3Cdiv%3E%3Cspan class=%22key_INS insert%22%3E%3C/span%3E%3Cspan class=%22key_HOME home%22%3E%3C/span%3E%3Cspan class=%22key_PGUP pgup%22%3E%3C/span%3E%3C/div%3E%3Cdiv%3E%3Cspan class=%22key_DEL delete%22%3E%3C/span%3E%3Cspan class=%22key_END end%22%3E%3C/span%3E%3Cspan class=%22key_PGDN pgdown%22%3E%3C/span%3E%3C/div%3E%3Cdiv%3E%3Cspan class=%22key_UPARROW arrowup%22%3E%3C/span%3E%3C/div%3E%3Cdiv%3E%3Cspan class=%22key_LEFTARROW arrowleft%22%3E%3C/span%3E%3Cspan class=%22key_DOWNARROW arrowdown%22%3E%3C/span%3E%3Cspan class=%22key_RIGHTARROW arrowright%22%3E%3C/span%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22tenkey%22%3E%3Cdiv%3E%3Ca href=%22#%22 class=%22scrollLights%22%3E%3C/a%3E%3C/div%3E%3Cdiv%3E%3Cspan class=%22key_KP_NUMLOCK numlock%22%3E%3C/span%3E%3Cspan class=%22key_KP_SLASH slash%22%3E%3C/span%3E%3Cspan class=%22key_KP_STAR asterick%22%3E%3C/span%3E%3Cspan class=%22key_KP_MINUS minus%22%3E%3C/span%3E%3C/div%3E%3Cdiv%3E%3Cspan class=%22key_KP_HOME seven%22%3E%3C/span%3E%3Cspan class=%22key_KP_UPARROW eight%22%3E%3C/span%3E%3Cspan class=%22key_KP_PGUP nine%22%3E%3C/span%3E%3C/div%3E%3Cdiv%3E%3Cspan class=%22key_KP_LEFTARROW four%22%3E%3C/span%3E%3Cspan class=%22key_KP_5 five%22%3E%3C/span%3E%3Cspan class=%22key_KP_RIGHTARROW six%22%3E%3C/span%3E%3Cspan class=%22key_KP_PLUS tkPlus%22%3E%3C/span%3E%3C/div%3E%3Cdiv%3E%3Cspan class=%22key_KP_END one tkRow5%22%3E%3C/span%3E%3Cspan class=%22key_KP_DOWNARROW two tkRow5%22%3E%3C/span%3E%3Cspan class=%22key_KP_PGDN three tkRow5%22%3E%3C/span%3E%3C/div%3E%3Cdiv%3E%3Cspan class=%22key_KP_INS zero tkRow6%22%3E%3C/span%3E%3Cspan class=%22key_KP_DEL tkDelete tkRow6%22%3E%3C/span%3E%3Cspan class=%22key_KP_ENTER tkEnter%22%3E%3C/span%3E%3C/div%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22mouse fl%22 %3E%3Cdiv class=%22mouse_top%22%3E%3C/div%3E%3Ca class=%22key_KP_MOUSE2 btn_rmouse%22%3E%3C/a%3E%3Cdiv class=%22mouse_body%22%3E%3C/div%3E%3Cdiv class=%22mouse_bottom%22%3E%3C/div%3E%3C/div%3E");
quakelive.mod_prefs.TPL_OVERLAY_CONTAINER=""+unescape("%3Cdiv style='width: 100%; height: 100%'%3E%3Cdiv id=%22qlv_prefsoverlay%22 class=%22tl%22%3E%3Cdiv id=%22qlv_regWindow%22 class=%22regNone%22%3E%3C/div%3E%3C/div%3E%3Cdiv id=%22qlv_registrationContent%22 class=%22tl tenpxpad%22%3E%3Cdiv class=%22fortypxhigh%22%3E%3C/div%3E%3Cdiv class=%22registration leftAlign%22%3E%3Cdiv%3E%3Cdiv class=%22title fl%22%3E%3C/div%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.mod_prefs.CloseOverlay(); return false%22 class=%22close_window fr%22%3E%3C/a%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22fiftypxhigh%22%3E%3C/div%3E%3Cdiv%3E%3Cdiv class=%22fifteenpxhigh%22%3E%3C/div%3E%3Cdiv id=%22configContainer%22 style=%22position: relative; z-index: 1%22%3E%3C/div%3E%3C/div%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E");
quakelive.mod_stats.TPL_QUICKSTATS=[unescape("%3Ca href=%22#!stats%22 class=%22qlv_plts_offline%22%3E %3Cimg src=%22"),quakelive.resource("/images/sf/login/btn_viewfullstats.png"),unescape("%22 alt=%22offline%22 width=%22160%22 height=%2220%22 /%3E %3C/a%3E%3Cdiv class=%22qlv_plts_leftbox%22%3E%3Cdiv class=%22qlv_pltslb_top%22%3E %3Cspan class=%22qlv_pltslb_title%22%3E%3C/span%3E %3Cspan class=%22qlv_pltslb_last_played%22%3E%3C/span%3E %3C/div%3E%3Cdiv class=%22qlv_pltslb_bottom%22%3E%3Cdiv class=%22qlv_pltslb_character nametag-body-md%22%3E%3C/div%3E%3Ctable class=%22qlv_pltslb_bl%22%3E%3Ctr%3E%3Ctd%3E%3Cspan class=%22title%22%3EMost Played Arena%3C/span%3E %3Cspan class=%22fav_map_txt%22%3E%3C/span%3E %3C/td%3E%3Ctd height=%2260%22 width=%22100%22 class=%22fav_map_img tc%22%3E%3C/td%3E%3C/tr%3E%3Ctr%3E%3Ctd%3E%3Cspan class=%22title%22%3EMost Games Played%3C/span%3E %3Cspan class=%22fav_gametype_txt%22%3E%3C/span%3E %3C/td%3E%3Ctd height=%2260%22 width=%22100%22 class=%22fav_gametype_img tc%22%3E%3C/td%3E%3C/tr%3E%3Ctr%3E%3Ctd%3E%3Cspan class=%22title%22%3EWeapon of Choice%3C/span%3E %3Cspan class=%22fav_weapon_txt%22%3E%3C/span%3E %3C/td%3E%3Ctd height=%2260%22 width=%22100%22 class=%22fav_weapon_img%22%3E%3C/td%3E%3C/tr%3E%3C/table%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22qlv_plts_rightbox%22%3E%3Cdiv class=%22qlv_pltsrb_top%22%3E%3Ctable%3E%3Ctr class=%22qlv_pltslb_hd%22%3E%3Ctd%3ETotal Frags:%3C/td%3E%3Ctd style=%22width:94px%22 class=%22total_frags%22%3E%3C/td%3E%3C/tr%3E%3Ctr%3E%3Ctd%3ETotal Games Played:%3C/td%3E%3Ctd class=%22total_games%22%3E%3C/td%3E%3C/tr%3E%3Ctr%3E%3Ctd%3ETotal Time Played:%3C/td%3E%3Ctd class=%22total_time%22%3E%3C/td%3E%3C/tr%3E%3C/table%3E%3C/div%3E%3Cdiv class=%22qlv_pltsrb_middle%22%3E%3C/div%3E%3Cdiv class=%22qlv_pltsrb_bottom%22%3E%3Ctable%3E%3Ctr class=%22qlv_pltsrb_hd%22%3E%3Ctd%3EGame Type%3C/td%3E%3Ctd class=%22tc%22%3EPlayed%3C/td%3E%3Ctd class=%22tc%22%3EWins%3C/td%3E%3C/tr%3E%3Ctr%3E%3Ctd%3EDeath Match%3C/td%3E%3Ctd class=%22tc played_dm%22%3E%3C/td%3E%3Ctd class=%22tc wins_dm%22%3E%3C/td%3E%3C/tr%3E%3Ctr%3E%3Ctd%3EDuel%3C/td%3E%3Ctd class=%22tc played_duel%22%3E%3C/td%3E%3Ctd class=%22tc wins_duel%22%3E%3C/td%3E%3C/tr%3E%3Ctr%3E%3Ctd%3ECapture The Flag%3C/td%3E%3Ctd class=%22tc played_ctf%22%3E%3C/td%3E%3Ctd class=%22tc wins_ctf%22%3E%3C/td%3E%3C/tr%3E%3Ctr%3E%3Ctd%3ETeam Death Match%3C/td%3E%3Ctd class=%22tc played_tdm%22%3E%3C/td%3E%3Ctd class=%22tc wins_tdm%22%3E%3C/td%3E%3C/tr%3E%3Ctr class=%22qlv_pltsrb_totals%22%3E%3Ctd%3ETOTALS%3C/td%3E%3Ctd class=%22tc played_total%22%3E%3C/td%3E%3Ctd class=%22tc wins_total%22%3E%3C/td%3E%3C/tr%3E%3C/table%3E%3C/div%3E%3C/div%3E")].join("");
quakelive.mod_stats.TPL_MATCH_SUMMARY=[unescape("%3Cdiv id=%22stats_tip%22 style=%22position: absolute; z-index: 1000; left: 0; top: 0; display: none%22%3E%3Cimg src=%22"),quakelive.resource("/images/sf/pop_up/game_data_windows/onOver/shadow_top.png"),unescape("%22 width=%22385%22 height=%225%22 /%3E%3Cdiv style=%22background: url("),quakelive.resource("/images/sf/pop_up/game_data_windows/onOver/shadow_middle.png"),unescape("); width: 385px; text-align: center%22%3E%3Cdiv class=%22popheaderS%22%3E%3Cimg src=%22"),
quakelive.resource("/images/sf/pop_up/game_data_windows/onOver/hdr_gamesummary.png"),unescape("%22 class=%22fl%22 style=%22margin-left: 10px; margin-top: 2px%22 /%3E%3Cimg src=%22"),quakelive.resource("/images/sf/pop_up/game_data_windows/onOver/btn_clickformore.png"),unescape("%22 class=%22fr%22 style=%22margin-right: 10px; margin-top: 5px%22 /%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3Cdiv id=%22stats_datacontainer%22 class=%22popupBorder%22%3E%3Cdiv class=%22tc%22%3E%3Cimg src=%22"),quakelive.resource("/images/loader.gif"),
unescape("%22 width=%2262%22 height=%2213%22 style=%22margin: 20px 0px%22 /%3E%3C/div%3E%3C/div%3E%3C/div%3E%3Cimg src=%22"),quakelive.resource("/images/sf/pop_up/game_data_windows/onOver/shadow_bottom.png"),unescape("%22 width=%22385%22 height=%225%22 /%3E%3C/div%3E")].join("");quakelive.mod_stats.TPL_MATCH_SUMMARY_INNER=""+unescape("%3Cdiv class=%22mainData%22%3E%3Cdiv id=%22match_mapshot%22%3E%3C/div%3E%3Cdiv id=%22match_maindata%22 class=%22mainDataInfo%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22dataDetail%22%3E%3Cdiv class=%22match_highlights Norm11px%22%3E%3C/div%3E%3C/div%3E");
quakelive.mod_stats.TPL_MATCH_DETAILS=[unescape("%3Cdiv id=%22stats_details%22 style=%22position: absolute; z-index: 1001; left: 0; top: 0%22%3E%3Cimg src=%22"),quakelive.resource("/images/sf/pop_up/game_data_windows/onClick/shadow_top.png"),unescape("%22 width=%22645%22 height=%225%22 /%3E%3Cdiv style=%22background: url("),quakelive.resource("/images/sf/pop_up/game_data_windows/onClick/shadow_middle.png"),unescape("); width: 645px; text-align: center; margin: 0 auto%22%3E%3Cdiv class=%22statsDetailsBody%22%3E%3Cdiv id=%22stats_details_top_vert%22 style=%22background: url("),
quakelive.resource("/images/sf/pop_up/game_data_windows/onClick/bkd_header.jpg"),unescape(") no-repeat; width: 635px; height: 40px%22%3E%3C/div%3E%3Cdiv class=%22popupBorderW%22%3E%3Cdiv%3E%3Cdiv id=%22match_gametype%22 class=%22gameTypeContainer fl%22%3ELoading&hellip;%3C/div%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.statstip.CloseStatsDetails(); return false%22 class=%22closeBtn fr%22%3E%3C/a%3E%3Cdiv id=%22stats_datacontainer%22 class=%22cl%22%3E%3Cdiv class=%22tc%22%3E%3Cimg src=%22"),
quakelive.resource("/images/loader.gif"),unescape("%22 width=%2262%22 height=%2213%22 style=%22margin: 20px 0px%22 /%3E%3C/div%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22statsDetailsFooter%22%3E%3Cdiv class=%22adContainer%22 id=%22stats_details_bot_vert%22 style=%22background: url("),quakelive.resource("/images/a/full.jpg"),unescape(") no-repeat; width: 468px; height: 60px%22%3E%3C/div%3E%3C/div%3E%3C/div%3E%3C/div%3E%3C/div%3E%3Cimg src=%22"),quakelive.resource("/images/sf/pop_up/game_data_windows/onClick/shadow_bottom.png"),
unescape("%22 width=%22645%22 height=%225%22 /%3E%3C/div%3E")].join("");quakelive.mod_stats.TPL_MATCH_DETAILS_INNER=""+unescape("%3Cdiv class=%22mainDataW%22%3E%3Cdiv id=%22match_mapshot%22%3E%3C/div%3E%3Cdiv id=%22match_maindata%22 class=%22mainDataInfoW%22%3E%3C/div%3E%3C/div%3E%3Cdiv id=%22match_vscontainer%22 class=%22fr%22%3E%3C/div%3E%3Cdiv class=%22matchNavBar%22%3E%3Cdiv class=%22leftSide%22%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.statstip.SetDetailsMode('scoreboard'); return false%22 class=%22fl nav_scoreboard selected%22%3EScoreboard%3C/a%3E%3Cspan class=%22fl%22%3E&nbsp;|&nbsp;%3C/span%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.statstip.SetDetailsMode('weapons'); return false%22 class=%22fl nav_weapons%22%3EWeapon Frags%3C/a%3E%3Cspan class=%22fl%22%3E&nbsp;|&nbsp;%3C/span%3E%3Ca href=%22javascript:;%22 onclick=%22quakelive.statstip.SetDetailsMode('weaponaccuracy'); return false%22 class=%22fl nav_weaponaccuracy%22%3EWeapon Accuracy%3C/a%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22rightSide%22%3E%3Cspan class=%22fr addthis_container%22%3E%3C/span%3E%3Cspan class=%22fr%22%3E&nbsp;&nbsp;%3C/span%3E%3Ca href=%22javascript:;%22 class=%22share_email fr%22%3Eemail%3C/a%3E%3Ca href=%22javascript:;%22 class=%22share_email_img share_email fr%22%3E%3C/a%3E%3Cspan class=%22fr%22%3E&nbsp;&nbsp;%3C/span%3E%3Ca href=%22javascript:;%22 class=%22share_link fr%22%3Elink%3C/a%3E%3Ca href=%22javascript:;%22 class=%22share_link_img share_link fr%22%3E%3C/a%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3Cdiv class=%22dataDetailL%22%3E%3Cdiv class=%22match_scoreboard Norm11px%22%3E%3C/div%3E%3Cdiv class=%22match_weapons Norm11px%22 style=%22display: none%22%3E%3C/div%3E%3Cdiv class=%22match_weaponaccuracy Norm11px%22 style=%22display: none%22%3E%3C/div%3E%3C/div%3E");
quakelive.mod_stats.TPL_MATCH_VSCONTAINER=""+unescape("%3Cdiv class=%22vsFrameContainer%22%3E%3Cdiv class=%22gameTypeIcon%22%3E%3C/div%3E%3Cdiv class=%22headNum1%22%3E%3C/div%3E%3Cdiv class=%22headNum2%22%3E%3C/div%3E%3Cdiv class=%22vsFrame%22%3E%3C/div%3E%3Cdiv class=%22rankNum1%22%3E%3C/div%3E%3Cdiv class=%22scoreNum1%22%3E%3C/div%3E%3Cdiv class=%22nameNum1%22%3E%3C/div%3E%3Cdiv class=%22flagNum1%22%3E%3C/div%3E%3Cdiv class=%22rankNum2%22%3E%3C/div%3E%3Cdiv class=%22scoreNum2%22%3E%3C/div%3E%3Cdiv class=%22nameNum2%22%3E%3C/div%3E%3Cdiv class=%22flagNum2%22%3E%3C/div%3E%3Cdiv class=%22noPlayer2%22%3ENo Teammate Available%3C/div%3E%3C/div%3E");
quakelive.mod_lfg.TPL_MODE_MINIMIZED=""+unescape("%3Cdiv class=%22lfg_content%22 id=%22lfg_minimized%22%3E%3Cdiv class=%22footer%22%3E%3C/div%3E%3C/div%3E");
quakelive.mod_lfg.TPL_MODE_NORMAL=[unescape("%3Cdiv class=%22lfg_content%22 id=%22lfg_normal%22%3E%3Cdiv class=%22collapse_proxy%22%3E%3C/div%3E%3Cul class=%22jd_menu%22%3E%3Cli class=%22top%22%3E%3Ca href=%22javascript:;%22 class=%22accessible%22 style=%22position: relative; padding-left: 20px; padding-right: 31px%22%3E%3Cdiv class=%22arrow_right%22%3E%3C/div%3ESelect Game Type%3C/a%3E%3Cul%3E%3Cli class=%22select_gt_5 tl%22%3E%3Cimg src=%22"),quakelive.resource("/images/gametypes/sm/duel.png"),
unescape("%22 width=%2228%22 height=%2228%22 /%3EDuel%3C/li%3E%3C/ul%3E%3C/li%3E%3C/ul%3E%3Cdiv class=%22blurb%22%3EWe'll find an opponent at your skill level, then alert you when the game is ready.%3C/div%3E%3Cdiv class=%22cancel_blurb%22%3E%3C/div%3E%3Cdiv class=%22footer%22%3E%3C/div%3E%3C/div%3E")].join("");quakelive.mod_lfg.TPL_MODE_READY=""+unescape("%3Cdiv class=%22lfg_content%22 id=%22lfg_matchready%22%3E%3Cdiv class=%22description%22%3E%3C/div%3E%3Cdiv id=%22lfg_ready_tooltip%22%3E%3Cdiv class=%22levelshot%22%3E%3C/div%3E%3Ca href=%22javascript:;%22 class=%22play%22%3E%3C/a%3E%3C/div%3E%3Ca href=%22javascript:;%22 class=%22decline%22%3E%3C/a%3E%3Cdiv class=%22timer_header%22%3Eopen for%3C/div%3E%3Cdiv class=%22timer%22%3E%3C/div%3E%3C/div%3E");
quakelive.mod_lfg.TPL_MODE_INQUEUE=[unescape("%3Cdiv class=%22lfg_content%22 id=%22lfg_inqueue%22%3E%3Cdiv class=%22collapse_proxy%22%3E%3C/div%3E%3Cdiv class=%22blurb%22%3EWe're now finding you a Duel at your skill level. Please wait&hellip;%3C/div%3E%3Cdiv class=%22footer%22%3E%3Cimg src=%22"),quakelive.resource("/images/loader.gif"),unescape("%22 class=%22fl ticker%22 /%3E%3Cspan class=%22fl search_status%22%3ESearching%3C/span%3E%3Ca href=%22javascript:;%22 class=%22btn_stop fr%22%3E%3C/a%3E%3Cdiv class=%22cl%22%3E%3C/div%3E%3C/div%3E%3C/div%3E")].join("");
quakelive.mod_home.TPL_PROMPT_HTML=[unescape("%3Ctable id=%22main_modal%22 border=%220%22 cellpadding=%220%22 cellspacing=%220%22 align=%22center%22%3E%3Ctr%3E%3Ctd%3E%3Cimg src=%22"),quakelive.resource("/images/popup/modal_top_left.png"),unescape("%22 width=%2214%22 height=%2250%22 /%3E%3C/td%3E%3Ctd background=%22"),quakelive.resource("/images/popup/modal_top.png"),unescape("%22 width=%22100%%22 class=%22modal-title%22 nowrap=%22nowrap%22%3E%3C/td%3E%3Ctd background=%22"),quakelive.resource("/images/popup/modal_top.png"),
unescape("%22 width=%2220%22 height=%2250%22 class=%22modal-close-box%22%3E%3Cdiv id=%22modal-close%22 class=%22interactive%22%3E%3C/div%3E%3C/td%3E%3Ctd%3E%3Cimg src=%22"),quakelive.resource("/images/popup/modal_top_right.png"),unescape("%22 width=%2214%22 height=%2250%22 /%3E%3C/td%3E%3C/tr%3E%3Ctr%3E%3Ctd rowspan=%222%22 background=%22"),quakelive.resource("/images/popup/modal_left.png"),unescape("%22 width=%2214%22 height=%22100%%22%3E%3C/td%3E%3Ctd align=%22center%22 bgcolor=%22white%22 colspan=%222%22%3E%3Cimg src=%22"),
quakelive.resource("/images/popup/modal_shadow.png"),unescape("%22 height=%227%22 width=%2250%22 border=%220%22 id=%22modal-shadow%22 /%3E%3C/td%3E%3Ctd rowspan=%222%22 background=%22"),quakelive.resource("/images/popup/modal_right.png"),unescape("%22 width=%2214%22 height=%22100%%22%3E%3C/td%3E%3C/tr%3E%3Ctr%3E%3Ctd class=%22modal-content%22 colspan=%222%22 align=%22center%22%3E%3Cform method='post' action='javascript:;'%3E%3Cdiv id=%22modal-error%22%3E%3C/div%3E%3Cdiv id=%22modal-body%22%3E%3C/div%3E%3Cdiv class=%22modal-feedback%22%3E%3C/div%3E%3Cdiv id=%22modal-input%22%3E%3C/div%3E%3Cdiv id=%22modal-buttons%22 style=%22text-align: center%22%3E%3Cinput type=%22button%22 id=%22modal-ok%22 class=%22modal-submit-button interactive%22 /%3E%3Cinput type=%22button%22 id=%22modal-cancel%22 class=%22modal-submit-button interactive%22 /%3E%3Cinput type=%22submit%22 name=%22submit%22 value=%22submit%22 style=%22position: absolute; left: -9999px; top: -9999px;%22 /%3E%3C/div%3E%3C/form%3E%3C/td%3E%3C/tr%3E%3Ctr%3E%3Ctd%3E%3Cimg src=%22"),
quakelive.resource("/images/popup/modal_bottom_left.png"),unescape("%22 width=%2214%22 height=%2211%22 /%3E%3C/td%3E%3Ctd colspan=2 background=%22"),quakelive.resource("/images/popup/modal_bottom.png"),unescape("%22 width=%22100%%22 height=%2211%22%3E%3C/td%3E%3Ctd%3E%3Cimg src=%22"),quakelive.resource("/images/popup/modal_bottom_right.png"),unescape("%22 width=%2214%22 height=%2211%22 /%3E%3C/td%3E%3C/tr%3E%3C/table%3E")].join("");

