var hexcase=0;var b64pad="";var chrsz=8;function hex_md5(b){return binl2hex(core_md5(str2binl(b),b.length*chrsz))}function b64_md5(b){return binl2b64(core_md5(str2binl(b),b.length*chrsz))}function str_md5(b){return binl2str(core_md5(str2binl(b),b.length*chrsz))}function hex_hmac_md5(b,e){return binl2hex(core_hmac_md5(b,e))}function b64_hmac_md5(b,e){return binl2b64(core_hmac_md5(b,e))}function str_hmac_md5(b,e){return binl2str(core_hmac_md5(b,e))}function md5_vm_test(){return hex_md5("abc")=="900150983cd24fb0d6963f7d28e17f72"}function core_md5(w,l){w[l>>5]|=128<<((l)%32);w[(((l+64)>>>9)<<4)+14]=l;var v=1732584193;var q=-271733879;var o=-1732584194;var n=271733878;for(var h=0;h<w.length;h+=16){var k=v;var j=q;var g=o;var e=n;v=md5_ff(v,q,o,n,w[h+0],7,-680876936);n=md5_ff(n,v,q,o,w[h+1],12,-389564586);o=md5_ff(o,n,v,q,w[h+2],17,606105819);q=md5_ff(q,o,n,v,w[h+3],22,-1044525330);v=md5_ff(v,q,o,n,w[h+4],7,-176418897);n=md5_ff(n,v,q,o,w[h+5],12,1200080426);o=md5_ff(o,n,v,q,w[h+6],17,-1473231341);q=md5_ff(q,o,n,v,w[h+7],22,-45705983);v=md5_ff(v,q,o,n,w[h+8],7,1770035416);n=md5_ff(n,v,q,o,w[h+9],12,-1958414417);o=md5_ff(o,n,v,q,w[h+10],17,-42063);q=md5_ff(q,o,n,v,w[h+11],22,-1990404162);v=md5_ff(v,q,o,n,w[h+12],7,1804603682);n=md5_ff(n,v,q,o,w[h+13],12,-40341101);o=md5_ff(o,n,v,q,w[h+14],17,-1502002290);q=md5_ff(q,o,n,v,w[h+15],22,1236535329);v=md5_gg(v,q,o,n,w[h+1],5,-165796510);n=md5_gg(n,v,q,o,w[h+6],9,-1069501632);o=md5_gg(o,n,v,q,w[h+11],14,643717713);q=md5_gg(q,o,n,v,w[h+0],20,-373897302);v=md5_gg(v,q,o,n,w[h+5],5,-701558691);n=md5_gg(n,v,q,o,w[h+10],9,38016083);o=md5_gg(o,n,v,q,w[h+15],14,-660478335);q=md5_gg(q,o,n,v,w[h+4],20,-405537848);v=md5_gg(v,q,o,n,w[h+9],5,568446438);n=md5_gg(n,v,q,o,w[h+14],9,-1019803690);o=md5_gg(o,n,v,q,w[h+3],14,-187363961);q=md5_gg(q,o,n,v,w[h+8],20,1163531501);v=md5_gg(v,q,o,n,w[h+13],5,-1444681467);n=md5_gg(n,v,q,o,w[h+2],9,-51403784);o=md5_gg(o,n,v,q,w[h+7],14,1735328473);q=md5_gg(q,o,n,v,w[h+12],20,-1926607734);v=md5_hh(v,q,o,n,w[h+5],4,-378558);n=md5_hh(n,v,q,o,w[h+8],11,-2022574463);o=md5_hh(o,n,v,q,w[h+11],16,1839030562);q=md5_hh(q,o,n,v,w[h+14],23,-35309556);v=md5_hh(v,q,o,n,w[h+1],4,-1530992060);n=md5_hh(n,v,q,o,w[h+4],11,1272893353);o=md5_hh(o,n,v,q,w[h+7],16,-155497632);q=md5_hh(q,o,n,v,w[h+10],23,-1094730640);v=md5_hh(v,q,o,n,w[h+13],4,681279174);n=md5_hh(n,v,q,o,w[h+0],11,-358537222);o=md5_hh(o,n,v,q,w[h+3],16,-722521979);q=md5_hh(q,o,n,v,w[h+6],23,76029189);v=md5_hh(v,q,o,n,w[h+9],4,-640364487);n=md5_hh(n,v,q,o,w[h+12],11,-421815835);o=md5_hh(o,n,v,q,w[h+15],16,530742520);q=md5_hh(q,o,n,v,w[h+2],23,-995338651);v=md5_ii(v,q,o,n,w[h+0],6,-198630844);n=md5_ii(n,v,q,o,w[h+7],10,1126891415);o=md5_ii(o,n,v,q,w[h+14],15,-1416354905);q=md5_ii(q,o,n,v,w[h+5],21,-57434055);v=md5_ii(v,q,o,n,w[h+12],6,1700485571);n=md5_ii(n,v,q,o,w[h+3],10,-1894986606);o=md5_ii(o,n,v,q,w[h+10],15,-1051523);q=md5_ii(q,o,n,v,w[h+1],21,-2054922799);v=md5_ii(v,q,o,n,w[h+8],6,1873313359);n=md5_ii(n,v,q,o,w[h+15],10,-30611744);o=md5_ii(o,n,v,q,w[h+6],15,-1560198380);q=md5_ii(q,o,n,v,w[h+13],21,1309151649);v=md5_ii(v,q,o,n,w[h+4],6,-145523070);n=md5_ii(n,v,q,o,w[h+11],10,-1120210379);o=md5_ii(o,n,v,q,w[h+2],15,718787259);q=md5_ii(q,o,n,v,w[h+9],21,-343485551);v=safe_add(v,k);q=safe_add(q,j);o=safe_add(o,g);n=safe_add(n,e)}return Array(v,q,o,n)}function md5_cmn(l,h,g,e,k,j){return safe_add(bit_rol(safe_add(safe_add(h,l),safe_add(e,j)),k),g)}function md5_ff(h,g,n,l,e,k,j){return md5_cmn((g&n)|((~g)&l),h,g,e,k,j)}function md5_gg(h,g,n,l,e,k,j){return md5_cmn((g&l)|(n&(~l)),h,g,e,k,j)}function md5_hh(h,g,n,l,e,k,j){return md5_cmn(g^n^l,h,g,e,k,j)}function md5_ii(h,g,n,l,e,k,j){return md5_cmn(n^(g|(~l)),h,g,e,k,j)}function core_hmac_md5(g,k){var j=str2binl(g);if(j.length>16){j=core_md5(j,g.length*chrsz)}var b=Array(16),h=Array(16);for(var e=0;e<16;e++){b[e]=j[e]^909522486;h[e]=j[e]^1549556828}var l=core_md5(b.concat(str2binl(k)),512+k.length*chrsz);return core_md5(h.concat(l),512+128)}function safe_add(b,h){var g=(b&65535)+(h&65535);var e=(b>>16)+(h>>16)+(g>>16);return(e<<16)|(g&65535)}function bit_rol(b,e){return(b<<e)|(b>>>(32-e))}function str2binl(h){var g=Array();var b=(1<<chrsz)-1;for(var e=0;e<h.length*chrsz;e+=chrsz){g[e>>5]|=(h.charCodeAt(e/chrsz)&b)<<(e%32)}return g}function binl2str(g){var h="";var b=(1<<chrsz)-1;for(var e=0;e<g.length*32;e+=chrsz){h+=String.fromCharCode((g[e>>5]>>>(e%32))&b)}return h}function binl2hex(g){var e=hexcase?"0123456789ABCDEF":"0123456789abcdef";var h="";for(var b=0;b<g.length*4;b++){h+=e.charAt((g[b>>2]>>((b%4)*8+4))&15)+e.charAt((g[b>>2]>>((b%4)*8))&15)}return h}function binl2b64(h){var g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var l="";for(var e=0;e<h.length*4;e+=3){var k=(((h[e>>2]>>8*(e%4))&255)<<16)|(((h[e+1>>2]>>8*((e+1)%4))&255)<<8)|((h[e+2>>2]>>8*((e+2)%4))&255);for(var b=0;b<4;b++){if(e*8+b*6>h.length*32){l+=b64pad}else{l+=g.charAt((k>>6*(3-b))&63)}}}return l}
/*
 * 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
 */
(function(aX,ah){function a9(){if(!aq.isReady){try{ai.documentElement.doScroll("left")}catch(w){setTimeout(a9,1);return}aq.ready()}}function af(A,w){w.src?aq.ajax({url:w.src,async:false,dataType:"script"}):aq.globalEval(w.text||w.textContent||w.innerHTML||"");w.parentNode&&w.parentNode.removeChild(w)}function az(A,w,N,J,K,F){var G=A.length;if(typeof w==="object"){for(var L in w){az(A,L,w[L],J,K,N)}return A}if(N!==ah){J=!F&&J&&aq.isFunction(N);for(L=0;L<G;L++){K(A[L],w,J?N.call(A[L],L,K(A[L],w)):N,F)}return A}return G?K(A[0],w):ah}function aO(){return(new Date).getTime()}function ay(){return false}function aw(){return true}function aT(A,w,F){F[0].type=A;return aq.event.handle.apply(w,F)}function ap(Q){var P,O=[],L=[],N=arguments,J,K,A,G,F,w;K=aq.data(this,"events");if(!(Q.liveFired===this||!K||!K.live||Q.button&&Q.type==="click")){Q.liveFired=this;var R=K.live.slice(0);for(G=0;G<R.length;G++){K=R[G];K.origType.replace(aI,"")===Q.type?L.push(K.selector):R.splice(G--,1)}J=aq(Q.target).closest(L,Q.currentTarget);F=0;for(w=J.length;F<w;F++){for(G=0;G<R.length;G++){K=R[G];if(J[F].selector===K.selector){A=J[F].elem;L=null;if(K.preType==="mouseenter"||K.preType==="mouseleave"){L=aq(Q.relatedTarget).closest(K.selector)[0]}if(!L||L!==A){O.push({elem:A,handleObj:K})}}}}F=0;for(w=O.length;F<w;F++){J=O[F];Q.currentTarget=J.elem;Q.data=J.handleObj.data;Q.handleObj=J.handleObj;if(J.handleObj.origHandler.apply(J.elem,N)===false){P=false;break}}return P}}function U(A,w){return"live."+(A&&A!=="*"?A+".":"")+w.replace(/\./g,"`").replace(/ /g,"&")}function v(w){return !w||!w.parentNode||w.parentNode.nodeType===11}function bs(A,w){var F=0;w.each(function(){if(this.nodeName===(A[F]&&A[F].nodeName)){var K=aq.data(A[F++]),L=aq.data(this,K);if(K=K&&K.events){delete L.handle;L.events={};for(var G in K){for(var J in K[G]){aq.event.add(this,G,K[G][J],K[G][J].data)}}}}})}function be(A,w,K){var G,J,F;w=w&&w[0]?w[0].ownerDocument||w[0]:ai;if(A.length===1&&typeof A[0]==="string"&&A[0].length<512&&w===ai&&!aY.test(A[0])&&(aq.support.checkClone||!au.test(A[0]))){J=true;if(F=aq.fragments[A[0]]){if(F!==1){G=F}}}if(!G){G=w.createDocumentFragment();aq.clean(A,w,G,K)}if(J){aq.fragments[A[0]]=F?G:1}return{fragment:G,cacheable:J}}function aL(A,w){var F={};aq.each(ae.concat.apply([],ae.slice(0,w)),function(){F[this]=A});return F}function z(w){return"scrollTo" in w&&w.document?w:w.nodeType===9?w.defaultView||w.parentWindow:false}var aq=function(A,w){return new aq.fn.init(A,w)},B=aX.jQuery,g=aX.$,ai=aX.document,aC,bi=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,a2=/^.[^:#\[\.,]*$/,ax=/\S/,ag=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,C=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,aG=navigator.userAgent,e=false,aE=[],aK,bc=Object.prototype.toString,a4=Object.prototype.hasOwnProperty,aH=Array.prototype.push,aD=Array.prototype.slice,bh=Array.prototype.indexOf;aq.fn=aq.prototype={init:function(A,w){var G,F;if(!A){return this}if(A.nodeType){this.context=this[0]=A;this.length=1;return this}if(A==="body"&&!w){this.context=ai;this[0]=ai.body;this.selector="body";this.length=1;return this}if(typeof A==="string"){if((G=bi.exec(A))&&(G[1]||!w)){if(G[1]){F=w?w.ownerDocument||w:ai;if(A=C.exec(A)){if(aq.isPlainObject(w)){A=[ai.createElement(A[1])];aq.fn.attr.call(A,w,true)}else{A=[F.createElement(A[1])]}}else{A=be([G[1]],[F]);A=(A.cacheable?A.fragment.cloneNode(true):A.fragment).childNodes}return aq.merge(this,A)}else{if(w=ai.getElementById(G[2])){if(w.id!==G[2]){return aC.find(A)}this.length=1;this[0]=w}this.context=ai;this.selector=A;return this}}else{if(!w&&/^\w+$/.test(A)){this.selector=A;this.context=ai;A=ai.getElementsByTagName(A);return aq.merge(this,A)}else{return !w||w.jquery?(w||aC).find(A):aq(w).find(A)}}}else{if(aq.isFunction(A)){return aC.ready(A)}}if(A.selector!==ah){this.selector=A.selector;this.context=A.context}return aq.makeArray(A,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return aD.call(this,0)},get:function(w){return w==null?this.toArray():w<0?this.slice(w)[0]:this[w]},pushStack:function(A,w,G){var F=aq();aq.isArray(A)?aH.apply(F,A):aq.merge(F,A);F.prevObject=this;F.context=this.context;if(w==="find"){F.selector=this.selector+(this.selector?" ":"")+G}else{if(w){F.selector=this.selector+"."+w+"("+G+")"}}return F},each:function(A,w){return aq.each(this,A,w)},ready:function(w){aq.bindReady();if(aq.isReady){w.call(ai,aq)}else{aE&&aE.push(w)}return this},eq:function(w){return w===-1?this.slice(w):this.slice(w,+w+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(aD.apply(this,arguments),"slice",aD.call(arguments).join(","))},map:function(w){return this.pushStack(aq.map(this,function(A,F){return w.call(A,F,A)}))},end:function(){return this.prevObject||aq(null)},push:aH,sort:[].sort,splice:[].splice};aq.fn.init.prototype=aq.fn;aq.extend=aq.fn.extend=function(){var A=arguments[0]||{},w=1,N=arguments.length,J=false,K,F,G,L;if(typeof A==="boolean"){J=A;A=arguments[1]||{};w=2}if(typeof A!=="object"&&!aq.isFunction(A)){A={}}if(N===w){A=this;--w}for(;w<N;w++){if((K=arguments[w])!=null){for(F in K){G=A[F];L=K[F];if(A!==L){if(J&&L&&(aq.isPlainObject(L)||aq.isArray(L))){G=G&&(aq.isPlainObject(G)||aq.isArray(G))?G:aq.isArray(L)?[]:{};A[F]=aq.extend(J,G,L)}else{if(L!==ah){A[F]=L}}}}}}return A};aq.extend({noConflict:function(w){aX.$=g;if(w){aX.jQuery=B}return aq},isReady:false,ready:function(){if(!aq.isReady){if(!ai.body){return setTimeout(aq.ready,13)}aq.isReady=true;if(aE){for(var A,w=0;A=aE[w++];){A.call(ai,aq)}aE=null}aq.fn.triggerHandler&&aq(ai).triggerHandler("ready")}},bindReady:function(){if(!e){e=true;if(ai.readyState==="complete"){return aq.ready()}if(ai.addEventListener){ai.addEventListener("DOMContentLoaded",aK,false);aX.addEventListener("load",aq.ready,false)}else{if(ai.attachEvent){ai.attachEvent("onreadystatechange",aK);aX.attachEvent("onload",aq.ready);var A=false;try{A=aX.frameElement==null}catch(w){}ai.documentElement.doScroll&&A&&a9()}}}},isFunction:function(w){return bc.call(w)==="[object Function]"},isArray:function(w){return bc.call(w)==="[object Array]"},isPlainObject:function(A){if(!A||bc.call(A)!=="[object Object]"||A.nodeType||A.setInterval){return false}if(A.constructor&&!a4.call(A,"constructor")&&!a4.call(A.constructor.prototype,"isPrototypeOf")){return false}var w;for(w in A){}return w===ah||a4.call(A,w)},isEmptyObject:function(A){for(var w in A){return false}return true},error:function(w){throw w},parseJSON:function(w){if(typeof w!=="string"||!w){return null}w=aq.trim(w);if(/^[\],:{}\s]*$/.test(w.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){return aX.JSON&&aX.JSON.parse?aX.JSON.parse(w):(new Function("return "+w))()}else{aq.error("Invalid JSON: "+w)}},noop:function(){},globalEval:function(A){if(A&&ax.test(A)){var w=ai.getElementsByTagName("head")[0]||ai.documentElement,F=ai.createElement("script");F.type="text/javascript";if(aq.support.scriptEval){F.appendChild(ai.createTextNode(A))}else{F.text=A}w.insertBefore(F,w.firstChild);w.removeChild(F)}},nodeName:function(A,w){return A.nodeName&&A.nodeName.toUpperCase()===w.toUpperCase()},each:function(A,w,L){var J,K=0,F=A.length,G=F===ah||aq.isFunction(A);if(L){if(G){for(J in A){if(w.apply(A[J],L)===false){break}}}else{for(;K<F;){if(w.apply(A[K++],L)===false){break}}}}else{if(G){for(J in A){if(w.call(A[J],J,A[J])===false){break}}}else{for(L=A[0];K<F&&w.call(L,K,L)!==false;L=A[++K]){}}}return A},trim:function(w){return(w||"").replace(ag,"")},makeArray:function(A,w){w=w||[];if(A!=null){A.length==null||typeof A==="string"||aq.isFunction(A)||typeof A!=="function"&&A.setInterval?aH.call(w,A):aq.merge(w,A)}return w},inArray:function(A,w){if(w.indexOf){return w.indexOf(A)}for(var G=0,F=w.length;G<F;G++){if(w[G]===A){return G}}return -1},merge:function(A,w){var J=A.length,F=0;if(typeof w.length==="number"){for(var G=w.length;F<G;F++){A[J++]=w[F]}}else{for(;w[F]!==ah;){A[J++]=w[F++]}}A.length=J;return A},grep:function(A,w,K){for(var G=[],J=0,F=A.length;J<F;J++){!K!==!w(A[J],J)&&G.push(A[J])}return G},map:function(A,w,L){for(var J=[],K,F=0,G=A.length;F<G;F++){K=w(A[F],F,L);if(K!=null){J[J.length]=K}}return J.concat.apply([],J)},guid:1,proxy:function(A,w,F){if(arguments.length===2){if(typeof w==="string"){F=A;A=F[w];w=ah}else{if(w&&!aq.isFunction(w)){F=w;w=ah}}}if(!w&&A){w=function(){return A.apply(F||this,arguments)}}if(A){w.guid=A.guid=A.guid||w.guid||aq.guid++}return w},uaMatch:function(w){w=w.toLowerCase();w=/(webkit)[ \/]([\w.]+)/.exec(w)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(w)||/(msie) ([\w.]+)/.exec(w)||!/compatible/.test(w)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(w)||[];return{browser:w[1]||"",version:w[2]||"0"}},browser:{}});aG=aq.uaMatch(aG);if(aG.browser){aq.browser[aG.browser]=true;aq.browser.version=aG.version}if(aq.browser.webkit){aq.browser.safari=true}if(bh){aq.inArray=function(A,w){return bh.call(w,A)}}aC=aq(ai);if(ai.addEventListener){aK=function(){ai.removeEventListener("DOMContentLoaded",aK,false);aq.ready()}}else{if(ai.attachEvent){aK=function(){if(ai.readyState==="complete"){ai.detachEvent("onreadystatechange",aK);aq.ready()}}}}(function(){aq.support={};var O=ai.documentElement,N=ai.createElement("script"),L=ai.createElement("div"),J="script"+aO();L.style.display="none";L.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var K=L.getElementsByTagName("*"),F=L.getElementsByTagName("a")[0];if(!(!K||!K.length||!F)){aq.support={leadingWhitespace:L.firstChild.nodeType===3,tbody:!L.getElementsByTagName("tbody").length,htmlSerialize:!!L.getElementsByTagName("link").length,style:/red/.test(F.getAttribute("style")),hrefNormalized:F.getAttribute("href")==="/a",opacity:/^0.55$/.test(F.style.opacity),cssFloat:!!F.style.cssFloat,checkOn:L.getElementsByTagName("input")[0].value==="on",optSelected:ai.createElement("select").appendChild(ai.createElement("option")).selected,parentNode:L.removeChild(L.appendChild(ai.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};N.type="text/javascript";try{N.appendChild(ai.createTextNode("window."+J+"=1;"))}catch(G){}O.insertBefore(N,O.firstChild);if(aX[J]){aq.support.scriptEval=true;delete aX[J]}try{delete N.test}catch(w){aq.support.deleteExpando=false}O.removeChild(N);if(L.attachEvent&&L.fireEvent){L.attachEvent("onclick",function A(){aq.support.noCloneEvent=false;L.detachEvent("onclick",A)});L.cloneNode(true).fireEvent("onclick")}L=ai.createElement("div");L.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";O=ai.createDocumentFragment();O.appendChild(L.firstChild);aq.support.checkClone=O.cloneNode(true).cloneNode(true).lastChild.checked;aq(function(){var P=ai.createElement("div");P.style.width=P.style.paddingLeft="1px";ai.body.appendChild(P);aq.boxModel=aq.support.boxModel=P.offsetWidth===2;ai.body.removeChild(P).style.display="none"});O=function(P){var R=ai.createElement("div");P="on"+P;var Q=P in R;if(!Q){R.setAttribute(P,"return;");Q=typeof R[P]==="function"}return Q};aq.support.submitBubbles=O("submit");aq.support.changeBubbles=O("change");O=N=L=K=F=null}})();aq.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var aQ="jQuery"+aO(),h=0,a1={};aq.extend({cache:{},expando:aQ,noData:{embed:true,object:true,applet:true},data:function(A,w,J){if(!(A.nodeName&&aq.noData[A.nodeName.toLowerCase()])){A=A==aX?a1:A;var F=A[aQ],G=aq.cache;if(!F&&typeof w==="string"&&J===ah){return null}F||(F=++h);if(typeof w==="object"){A[aQ]=F;G[F]=aq.extend(true,{},w)}else{if(!G[F]){A[aQ]=F;G[F]={}}}A=G[F];if(J!==ah){A[w]=J}return typeof w==="string"?A[w]:A}},removeData:function(A,w){if(!(A.nodeName&&aq.noData[A.nodeName.toLowerCase()])){A=A==aX?a1:A;var J=A[aQ],F=aq.cache,G=F[J];if(w){if(G){delete G[w];aq.isEmptyObject(G)&&aq.removeData(A)}}else{if(aq.support.deleteExpando){delete A[aq.expando]}else{A.removeAttribute&&A.removeAttribute(aq.expando)}delete F[J]}}}});aq.fn.extend({data:function(A,w){if(typeof A==="undefined"&&this.length){return aq.data(this[0])}else{if(typeof A==="object"){return this.each(function(){aq.data(this,A)})}}var G=A.split(".");G[1]=G[1]?"."+G[1]:"";if(w===ah){var F=this.triggerHandler("getData"+G[1]+"!",[G[0]]);if(F===ah&&this.length){F=aq.data(this[0],A)}return F===ah&&G[1]?this.data(G[0]):F}else{return this.trigger("setData"+G[1]+"!",[G[0],w]).each(function(){aq.data(this,A,w)})}},removeData:function(w){return this.each(function(){aq.removeData(this,w)})}});aq.extend({queue:function(A,w,G){if(A){w=(w||"fx")+"queue";var F=aq.data(A,w);if(!G){return F||[]}if(!F||aq.isArray(G)){F=aq.data(A,w,aq.makeArray(G))}else{F.push(G)}return F}},dequeue:function(A,w){w=w||"fx";var G=aq.queue(A,w),F=G.shift();if(F==="inprogress"){F=G.shift()}if(F){w==="fx"&&G.unshift("inprogress");F.call(A,function(){aq.dequeue(A,w)})}}});aq.fn.extend({queue:function(A,w){if(typeof A!=="string"){w=A;A="fx"}if(w===ah){return aq.queue(this[0],A)}return this.each(function(){var F=aq.queue(this,A,w);A==="fx"&&F[0]!=="inprogress"&&aq.dequeue(this,A)})},dequeue:function(w){return this.each(function(){aq.dequeue(this,w)})},delay:function(A,w){A=aq.fx?aq.fx.speeds[A]||A:A;w=w||"fx";return this.queue(w,function(){var F=this;setTimeout(function(){aq.dequeue(F,w)},A)})},clearQueue:function(w){return this.queue(w||"fx",[])}});var bn=/[\n\t]/g,ak=/\s+/,bj=/\r/g,aV=/href|src|style/,a3=/(button|input)/i,aF=/(button|input|object|select|textarea)/i,aj=/^(a|area)$/i,a7=/radio|checkbox/;aq.fn.extend({attr:function(A,w){return az(this,A,w,true,aq.attr)},removeAttr:function(w){return this.each(function(){aq.attr(this,w,"");this.nodeType===1&&this.removeAttribute(w)})},addClass:function(O){if(aq.isFunction(O)){return this.each(function(Q){var P=aq(this);P.addClass(O.call(this,Q,P.attr("class")))})}if(O&&typeof O==="string"){for(var N=(O||"").split(ak),L=0,J=this.length;L<J;L++){var K=this[L];if(K.nodeType===1){if(K.className){for(var F=" "+K.className+" ",G=K.className,w=0,A=N.length;w<A;w++){if(F.indexOf(" "+N[w]+" ")<0){G+=" "+N[w]}}K.className=aq.trim(G)}else{K.className=O}}}}return this},removeClass:function(A){if(aq.isFunction(A)){return this.each(function(O){var P=aq(this);P.removeClass(A.call(this,O,P.attr("class")))})}if(A&&typeof A==="string"||A===ah){for(var w=(A||"").split(ak),N=0,J=this.length;N<J;N++){var K=this[N];if(K.nodeType===1&&K.className){if(A){for(var F=(" "+K.className+" ").replace(bn," "),G=0,L=w.length;G<L;G++){F=F.replace(" "+w[G]+" "," ")}K.className=aq.trim(F)}else{K.className=""}}}}return this},toggleClass:function(A,w){var G=typeof A,F=typeof w==="boolean";if(aq.isFunction(A)){return this.each(function(K){var J=aq(this);J.toggleClass(A.call(this,K,J.attr("class"),w),w)})}return this.each(function(){if(G==="string"){for(var N,K=0,L=aq(this),O=w,J=A.split(ak);N=J[K++];){O=F?O:!L.hasClass(N);L[O?"addClass":"removeClass"](N)}}else{if(G==="undefined"||G==="boolean"){this.className&&aq.data(this,"__className__",this.className);this.className=this.className||A===false?"":aq.data(this,"__className__")||""}}})},hasClass:function(A){A=" "+A+" ";for(var w=0,F=this.length;w<F;w++){if((" "+this[w].className+" ").replace(bn," ").indexOf(A)>-1){return true}}return false},val:function(A){if(A===ah){var w=this[0];if(w){if(aq.nodeName(w,"option")){return(w.attributes.value||{}).specified?w.value:w.text}if(aq.nodeName(w,"select")){var N=w.selectedIndex,J=[],K=w.options;w=w.type==="select-one";if(N<0){return null}var F=w?N:0;for(N=w?N+1:K.length;F<N;F++){var G=K[F];if(G.selected){A=aq(G).val();if(w){return A}J.push(A)}}return J}if(a7.test(w.type)&&!aq.support.checkOn){return w.getAttribute("value")===null?"on":w.value}return(w.value||"").replace(bj,"")}return ah}var L=aq.isFunction(A);return this.each(function(O){var R=aq(this),Q=A;if(this.nodeType===1){if(L){Q=A.call(this,O,R.val())}if(typeof Q==="number"){Q+=""}if(aq.isArray(Q)&&a7.test(this.type)){this.checked=aq.inArray(R.val(),Q)>=0}else{if(aq.nodeName(this,"select")){var P=aq.makeArray(Q);aq("option",this).each(function(){this.selected=aq.inArray(aq(this).val(),P)>=0});if(!P.length){this.selectedIndex=-1}}else{this.value=Q}}}})}});aq.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(A,w,K,G){if(!A||A.nodeType===3||A.nodeType===8){return ah}if(G&&w in aq.attrFn){return aq(A)[w](K)}G=A.nodeType!==1||!aq.isXMLDoc(A);var J=K!==ah;w=G&&aq.props[w]||w;if(A.nodeType===1){var F=aV.test(w);if(w in A&&G&&!F){if(J){w==="type"&&a3.test(A.nodeName)&&A.parentNode&&aq.error("type property can't be changed");A[w]=K}if(aq.nodeName(A,"form")&&A.getAttributeNode(w)){return A.getAttributeNode(w).nodeValue}if(w==="tabIndex"){return(w=A.getAttributeNode("tabIndex"))&&w.specified?w.value:aF.test(A.nodeName)||aj.test(A.nodeName)&&A.href?0:ah}return A[w]}if(!aq.support.style&&G&&w==="style"){if(J){A.style.cssText=""+K}return A.style.cssText}J&&A.setAttribute(w,""+K);A=!aq.support.hrefNormalized&&G&&F?A.getAttribute(w,2):A.getAttribute(w);return A===null?ah:A}return aq.style(A,w,K)}});var aI=/\.(.*)$/,D=function(w){return w.replace(/[^\w\s\.\|`]/g,function(A){return"\\"+A})};aq.event={add:function(R,Q,O,L){if(!(R.nodeType===3||R.nodeType===8)){if(R.setInterval&&R!==aX&&!R.frameElement){R=aX}var N,J;if(O.handler){N=O;O=N.handler}if(!O.guid){O.guid=aq.guid++}if(J=aq.data(R)){var K=J.events=J.events||{},A=J.handle;if(!A){J.handle=A=function(){return typeof aq!=="undefined"&&!aq.event.triggered?aq.event.handle.apply(A.elem,arguments):ah}}A.elem=R;Q=Q.split(" ");for(var G,F=0,w;G=Q[F++];){J=N?aq.extend({},N):{handler:O,data:L};if(G.indexOf(".")>-1){w=G.split(".");G=w.shift();J.namespace=w.slice(0).sort().join(".")}else{w=[];J.namespace=""}J.type=G;J.guid=O.guid;var T=K[G],P=aq.event.special[G]||{};if(!T){T=K[G]=[];if(!P.setup||P.setup.call(R,L,w,A)===false){if(R.addEventListener){R.addEventListener(G,A,false)}else{R.attachEvent&&R.attachEvent("on"+G,A)}}}if(P.add){P.add.call(R,J);if(!J.handler.guid){J.handler.guid=O.guid}}T.push(J);aq.event.global[G]=true}R=null}}},global:{},remove:function(V,T,Q,O){if(!(V.nodeType===3||V.nodeType===8)){var P,L=0,N,G,K,J,w,W,R=aq.data(V),A=R&&R.events;if(R&&A){if(T&&T.type){Q=T.handler;T=T.type}if(!T||typeof T==="string"&&T.charAt(0)==="."){T=T||"";for(P in A){aq.event.remove(V,P+T)}}else{for(T=T.split(" ");P=T[L++];){J=P;N=P.indexOf(".")<0;G=[];if(!N){G=P.split(".");P=G.shift();K=new RegExp("(^|\\.)"+aq.map(G.slice(0).sort(),D).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(w=A[P]){if(Q){J=aq.event.special[P]||{};for(F=O||0;F<w.length;F++){W=w[F];if(Q.guid===W.guid){if(N||K.test(W.namespace)){O==null&&w.splice(F--,1);J.remove&&J.remove.call(V,W)}if(O!=null){break}}}if(w.length===0||O!=null&&w.length===1){if(!J.teardown||J.teardown.call(V,G)===false){aP(V,P,R.handle)}delete A[P]}}else{for(var F=0;F<w.length;F++){W=w[F];if(N||K.test(W.namespace)){aq.event.remove(V,J,W.handler,F);w.splice(F--,1)}}}}}if(aq.isEmptyObject(A)){if(T=R.handle){T.elem=null}delete R.events;delete R.handle;aq.isEmptyObject(R)&&aq.removeData(V)}}}}},trigger:function(P,O,N,K){var L=P.type||P;if(!K){P=typeof P==="object"?P[aQ]?P:aq.extend(aq.Event(L),P):aq.Event(L);if(L.indexOf("!")>=0){P.type=L=L.slice(0,-1);P.exclusive=true}if(!N){P.stopPropagation();aq.event.global[L]&&aq.each(aq.cache,function(){this.events&&this.events[L]&&aq.event.trigger(P,O,this.handle.elem)})}if(!N||N.nodeType===3||N.nodeType===8){return ah}P.result=ah;P.target=N;O=aq.makeArray(O);O.unshift(P)}P.currentTarget=N;(K=aq.data(N,"handle"))&&K.apply(N,O);K=N.parentNode||N.ownerDocument;try{if(!(N&&N.nodeName&&aq.noData[N.nodeName.toLowerCase()])){if(N["on"+L]&&N["on"+L].apply(N,O)===false){P.result=false}}}catch(G){}if(!P.isPropagationStopped()&&K){aq.event.trigger(P,O,K,true)}else{if(!P.isDefaultPrevented()){K=P.target;var J,w=aq.nodeName(K,"a")&&L==="click",F=aq.event.special[L]||{};if((!F._default||F._default.call(N,P)===false)&&!w&&!(K&&K.nodeName&&aq.noData[K.nodeName.toLowerCase()])){try{if(K[L]){if(J=K["on"+L]){K["on"+L]=null}aq.event.triggered=true;K[L]()}}catch(A){}if(J){K["on"+L]=J}aq.event.triggered=false}}}},handle:function(A){var w,L,J,K;A=arguments[0]=aq.event.fix(A||aX.event);A.currentTarget=this;w=A.type.indexOf(".")<0&&!A.exclusive;if(!w){L=A.type.split(".");A.type=L.shift();J=new RegExp("(^|\\.)"+L.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}K=aq.data(this,"events");L=K[A.type];if(K&&L){L=L.slice(0);K=0;for(var F=L.length;K<F;K++){var G=L[K];if(w||J.test(G.namespace)){A.handler=G.handler;A.data=G.data;A.handleObj=G;G=G.handler.apply(this,arguments);if(G!==ah){A.result=G;if(G===false){A.preventDefault();A.stopPropagation()}}if(A.isImmediatePropagationStopped()){break}}}}return A.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(A){if(A[aQ]){return A}var w=A;A=aq.Event(w);for(var G=this.props.length,F;G;){F=this.props[--G];A[F]=w[F]}if(!A.target){A.target=A.srcElement||ai}if(A.target.nodeType===3){A.target=A.target.parentNode}if(!A.relatedTarget&&A.fromElement){A.relatedTarget=A.fromElement===A.target?A.toElement:A.fromElement}if(A.pageX==null&&A.clientX!=null){w=ai.documentElement;G=ai.body;A.pageX=A.clientX+(w&&w.scrollLeft||G&&G.scrollLeft||0)-(w&&w.clientLeft||G&&G.clientLeft||0);A.pageY=A.clientY+(w&&w.scrollTop||G&&G.scrollTop||0)-(w&&w.clientTop||G&&G.clientTop||0)}if(!A.which&&(A.charCode||A.charCode===0?A.charCode:A.keyCode)){A.which=A.charCode||A.keyCode}if(!A.metaKey&&A.ctrlKey){A.metaKey=A.ctrlKey}if(!A.which&&A.button!==ah){A.which=A.button&1?1:A.button&2?3:A.button&4?2:0}return A},guid:100000000,proxy:aq.proxy,special:{ready:{setup:aq.bindReady,teardown:aq.noop},live:{add:function(w){aq.event.add(this,w.origType,aq.extend({},w,{handler:ap}))},remove:function(A){var w=true,F=A.origType.replace(aI,"");aq.each(aq.data(this,"events").live||[],function(){if(F===this.origType.replace(aI,"")){return w=false}});w&&aq.event.remove(this,A.origType,ap)}},beforeunload:{setup:function(A,w,F){if(this.setInterval){this.onbeforeunload=F}return false},teardown:function(A,w){if(this.onbeforeunload===w){this.onbeforeunload=null}}}}};var aP=ai.removeEventListener?function(A,w,F){A.removeEventListener(w,F,false)}:function(A,w,F){A.detachEvent("on"+w,F)};aq.Event=function(w){if(!this.preventDefault){return new aq.Event(w)}if(w&&w.type){this.originalEvent=w;this.type=w.type}else{this.type=w}this.timeStamp=aO();this[aQ]=true};aq.Event.prototype={preventDefault:function(){this.isDefaultPrevented=aw;var w=this.originalEvent;if(w){w.preventDefault&&w.preventDefault();w.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=aw;var w=this.originalEvent;if(w){w.stopPropagation&&w.stopPropagation();w.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=aw;this.stopPropagation()},isDefaultPrevented:ay,isPropagationStopped:ay,isImmediatePropagationStopped:ay};var an=function(A){var w=A.relatedTarget;try{for(;w&&w!==this;){w=w.parentNode}if(w!==this){A.type=A.data;aq.event.handle.apply(this,arguments)}}catch(F){}},M=function(w){w.type=w.data;aq.event.handle.apply(this,arguments)};aq.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(A,w){aq.event.special[A]={setup:function(F){aq.event.add(this,w,F&&F.selector?M:an,A)},teardown:function(F){aq.event.remove(this,w,F&&F.selector?M:an)}}});if(!aq.support.submitBubbles){aq.event.special.submit={setup:function(){if(this.nodeName.toLowerCase()!=="form"){aq.event.add(this,"click.specialSubmit",function(A){var w=A.target,F=w.type;if((F==="submit"||F==="image")&&aq(w).closest("form").length){return aT("submit",this,arguments)}});aq.event.add(this,"keypress.specialSubmit",function(A){var w=A.target,F=w.type;if((F==="text"||F==="password")&&aq(w).closest("form").length&&A.keyCode===13){return aT("submit",this,arguments)}})}else{return false}},teardown:function(){aq.event.remove(this,".specialSubmit")}}}if(!aq.support.changeBubbles){var E=/textarea|input|select/i,k,o=function(A){var w=A.type,F=A.value;if(w==="radio"||w==="checkbox"){F=A.checked}else{if(w==="select-multiple"){F=A.selectedIndex>-1?aq.map(A.options,function(G){return G.selected}).join("-"):""}else{if(A.nodeName.toLowerCase()==="select"){F=A.selectedIndex}}}return F},bm=function(A,w){var J=A.target,F,G;if(!(!E.test(J.nodeName)||J.readOnly)){F=aq.data(J,"_change_data");G=o(J);if(A.type!=="focusout"||J.type!=="radio"){aq.data(J,"_change_data",G)}if(!(F===ah||G===F)){if(F!=null||G){A.type="change";return aq.event.trigger(A,w,J)}}}};aq.event.special.change={filters:{focusout:bm,click:function(A){var w=A.target,F=w.type;if(F==="radio"||F==="checkbox"||w.nodeName.toLowerCase()==="select"){return bm.call(this,A)}},keydown:function(A){var w=A.target,F=w.type;if(A.keyCode===13&&w.nodeName.toLowerCase()!=="textarea"||A.keyCode===32&&(F==="checkbox"||F==="radio")||F==="select-multiple"){return bm.call(this,A)}},beforeactivate:function(w){w=w.target;aq.data(w,"_change_data",o(w))}},setup:function(){if(this.type==="file"){return false}for(var w in k){aq.event.add(this,w+".specialChange",k[w])}return E.test(this.nodeName)},teardown:function(){aq.event.remove(this,".specialChange");return E.test(this.nodeName)}};k=aq.event.special.change.filters}ai.addEventListener&&aq.each({focus:"focusin",blur:"focusout"},function(A,w){function F(G){G=aq.event.fix(G);G.type=w;return aq.event.handle.call(this,G)}aq.event.special[w]={setup:function(){this.addEventListener(A,F,true)},teardown:function(){this.removeEventListener(A,F,true)}}});aq.each(["bind","one"],function(A,w){aq.fn[w]=function(N,J,K){if(typeof N==="object"){for(var F in N){this[w](F,J,N[F],K)}return this}if(aq.isFunction(J)){K=J;J=ah}var G=w==="one"?aq.proxy(K,function(O){aq(this).unbind(O,G);return K.apply(this,arguments)}):K;if(N==="unload"&&w!=="one"){this.one(N,J,K)}else{F=0;for(var L=this.length;F<L;F++){aq.event.add(this[F],N,G,J)}}return this}});aq.fn.extend({unbind:function(A,w){if(typeof A==="object"&&!A.preventDefault){for(var G in A){this.unbind(G,A[G])}}else{G=0;for(var F=this.length;G<F;G++){aq.event.remove(this[G],A,w)}}return this},delegate:function(A,w,G,F){return this.live(w,G,F,A)},undelegate:function(A,w,F){return arguments.length===0?this.unbind("live"):this.die(w,null,F,A)},trigger:function(A,w){return this.each(function(){aq.event.trigger(A,w,this)})},triggerHandler:function(A,w){if(this[0]){A=aq.Event(A);A.preventDefault();A.stopPropagation();aq.event.trigger(A,w,this[0]);return A.result}},toggle:function(A){for(var w=arguments,F=1;F<w.length;){aq.proxy(A,w[F++])}return this.click(aq.proxy(A,function(G){var J=(aq.data(this,"lastToggle"+A.guid)||0)%F;aq.data(this,"lastToggle"+A.guid,J+1);G.preventDefault();return w[J].apply(this,arguments)||false}))},hover:function(A,w){return this.mouseenter(A).mouseleave(w||A)}});var bq={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};aq.each(["live","die"],function(A,w){aq.fn[w]=function(Q,O,P,L){var N,G=0,K,J,F=L||this.selector,R=L?this:aq(this.context);if(aq.isFunction(O)){P=O;O=ah}for(Q=(Q||"").split(" ");(N=Q[G++])!=null;){L=aI.exec(N);K="";if(L){K=L[0];N=N.replace(aI,"")}if(N==="hover"){Q.push("mouseenter"+K,"mouseleave"+K)}else{J=N;if(N==="focus"||N==="blur"){Q.push(bq[N]+K);N+=K}else{N=(bq[N]||N)+K}w==="live"?R.each(function(){aq.event.add(this,U(N,F),{data:O,selector:F,handler:P,origType:N,origHandler:P,preType:J})}):R.unbind(U(N,F),P)}}return this}});aq.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(A,w){aq.fn[w]=function(F){return F?this.bind(w,F):this.trigger(w)};if(aq.attrFn){aq.attrFn[w]=true}});aX.attachEvent&&!aX.addEventListener&&aX.attachEvent("onunload",function(){for(var A in aq.cache){if(aq.cache[A].handle){try{aq.event.remove(aq.cache[A].handle.elem)}catch(w){}}}});(function(){function Y(bb){for(var ba="",ab,aa=0;bb[aa];aa++){ab=bb[aa];if(ab.nodeType===3||ab.nodeType===4){ba+=ab.nodeValue}else{if(ab.nodeType!==8){ba+=Y(ab.childNodes)}}}return ba}function X(bv,bu,bb,ba,aa,ab){aa=0;for(var bx=ba.length;aa<bx;aa++){var by=ba[aa];if(by){by=by[bv];for(var bw=false;by;){if(by.sizcache===bb){bw=ba[by.sizset];break}if(by.nodeType===1&&!ab){by.sizcache=bb;by.sizset=aa}if(by.nodeName.toLowerCase()===bu){bw=by;break}by=by[bv]}ba[aa]=bw}}}function W(bv,bu,bb,ba,aa,ab){aa=0;for(var bx=ba.length;aa<bx;aa++){var by=ba[aa];if(by){by=by[bv];for(var bw=false;by;){if(by.sizcache===bb){bw=ba[by.sizset];break}if(by.nodeType===1){if(!ab){by.sizcache=bb;by.sizset=aa}if(typeof bu!=="string"){if(by===bu){bw=true;break}}else{if(P.filter(bu,[by]).length>0){bw=by;break}}}by=by[bv]}ba[aa]=bw}}}var T=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,V=0,Q=Object.prototype.toString,R=false,N=true;[0,0].sort(function(){N=false;return 0});var P=function(bx,bw,bu,bb){bu=bu||[];var ab=bw=bw||ai;if(bw.nodeType!==1&&bw.nodeType!==9){return[]}if(!bx||typeof bx!=="string"){return bu}for(var ba=[],bC,bD,bz,bv,bB=true,by=A(bw),bA=bx;(T.exec(""),bC=T.exec(bA))!==null;){bA=bC[3];ba.push(bC[1]);if(bC[2]){bv=bC[3];break}}if(ba.length>1&&K.exec(bx)){if(ba.length===2&&O.relative[ba[0]]){bD=Z(ba[0]+ba[1],bw)}else{for(bD=O.relative[ba[0]]?[bw]:P(ba.shift(),bw);ba.length;){bx=ba.shift();if(O.relative[bx]){bx+=ba.shift()}bD=Z(bx,bD)}}}else{if(!bb&&ba.length>1&&bw.nodeType===9&&!by&&O.match.ID.test(ba[0])&&!O.match.ID.test(ba[ba.length-1])){bC=P.find(ba.shift(),bw,by);bw=bC.expr?P.filter(bC.expr,bC.set)[0]:bC.set[0]}if(bw){bC=bb?{expr:ba.pop(),set:w(bb)}:P.find(ba.pop(),ba.length===1&&(ba[0]==="~"||ba[0]==="+")&&bw.parentNode?bw.parentNode:bw,by);bD=bC.expr?P.filter(bC.expr,bC.set):bC.set;if(ba.length>0){bz=w(bD)}else{bB=false}for(;ba.length;){var aa=ba.pop();bC=aa;if(O.relative[aa]){bC=ba.pop()}else{aa=""}if(bC==null){bC=bw}O.relative[aa](bz,bC,by)}}else{bz=[]}}bz||(bz=bD);bz||P.error(aa||bx);if(Q.call(bz)==="[object Array]"){if(bB){if(bw&&bw.nodeType===1){for(bx=0;bz[bx]!=null;bx++){if(bz[bx]&&(bz[bx]===true||bz[bx].nodeType===1&&G(bw,bz[bx]))){bu.push(bD[bx])}}}else{for(bx=0;bz[bx]!=null;bx++){bz[bx]&&bz[bx].nodeType===1&&bu.push(bD[bx])}}}else{bu.push.apply(bu,bz)}}else{w(bz,bu)}if(bv){P(bv,ab,bu,bb);P.uniqueSort(bu)}return bu};P.uniqueSort=function(ab){if(L){R=N;ab.sort(L);if(R){for(var aa=1;aa<ab.length;aa++){ab[aa]===ab[aa-1]&&ab.splice(aa--,1)}}}return ab};P.matches=function(ab,aa){return P(ab,null,null,aa)};P.find=function(bv,bu,bb){var ba,aa;if(!bv){return[]}for(var ab=0,bx=O.order.length;ab<bx;ab++){var by=O.order[ab];if(aa=O.leftMatch[by].exec(bv)){var bw=aa[1];aa.splice(1,1);if(bw.substr(bw.length-1)!=="\\"){aa[1]=(aa[1]||"").replace(/\\/g,"");ba=O.find[by](aa,bu,bb);if(ba!=null){bv=bv.replace(O.match[by],"");break}}}}ba||(ba=bu.getElementsByTagName("*"));return{set:ba,expr:bv}};P.filter=function(by,bx,bv,bb){for(var ab=by,ba=[],bE=bx,bF,bB,bw=bx&&bx[0]&&A(bx[0]);by&&bx.length;){for(var bD in O.filter){if((bF=O.leftMatch[bD].exec(by))!=null&&bF[2]){var bz=O.filter[bD],bC,aa;aa=bF[1];bB=false;bF.splice(1,1);if(aa.substr(aa.length-1)!=="\\"){if(bE===ba){ba=[]}if(O.preFilter[bD]){if(bF=O.preFilter[bD](bF,bE,bv,ba,bb,bw)){if(bF===true){continue}}else{bB=bC=true}}if(bF){for(var bu=0;(aa=bE[bu])!=null;bu++){if(aa){bC=bz(aa,bF,bu,bE);var bA=bb^!!bC;if(bv&&bC!=null){if(bA){bB=true}else{bE[bu]=false}}else{if(bA){ba.push(aa);bB=true}}}}}if(bC!==ah){bv||(bE=ba);by=by.replace(O.match[bD],"");if(!bB){return[]}break}}}}if(by===ab){if(bB==null){P.error(by)}else{break}}ab=by}return bE};P.error=function(aa){throw"Syntax error, unrecognized expression: "+aa};var O=P.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(aa){return aa.getAttribute("href")}},relative:{"+":function(bb,ba){var ab=typeof ba==="string",aa=ab&&!/\W/.test(ba);ab=ab&&!aa;if(aa){ba=ba.toLowerCase()}aa=0;for(var bu=bb.length,bv;aa<bu;aa++){if(bv=bb[aa]){for(;(bv=bv.previousSibling)&&bv.nodeType!==1;){}bb[aa]=ab||bv&&bv.nodeName.toLowerCase()===ba?bv||false:bv===ba}}ab&&P.filter(ba,bb,true)},">":function(bb,ba){var ab=typeof ba==="string";if(ab&&!/\W/.test(ba)){ba=ba.toLowerCase();for(var aa=0,bu=bb.length;aa<bu;aa++){var bv=bb[aa];if(bv){ab=bv.parentNode;bb[aa]=ab.nodeName.toLowerCase()===ba?ab:false}}}else{aa=0;for(bu=bb.length;aa<bu;aa++){if(bv=bb[aa]){bb[aa]=ab?bv.parentNode:bv.parentNode===ba}}ab&&P.filter(ba,bb,true)}},"":function(bb,ba,ab){var aa=V++,bu=W;if(typeof ba==="string"&&!/\W/.test(ba)){var bv=ba=ba.toLowerCase();bu=X}bu("parentNode",ba,aa,bb,bv,ab)},"~":function(bb,ba,ab){var aa=V++,bu=W;if(typeof ba==="string"&&!/\W/.test(ba)){var bv=ba=ba.toLowerCase();bu=X}bu("previousSibling",ba,aa,bb,bv,ab)}},find:{ID:function(ba,ab,aa){if(typeof ab.getElementById!=="undefined"&&!aa){return(ba=ab.getElementById(ba[1]))?[ba]:[]}},NAME:function(bb,ba){if(typeof ba.getElementsByName!=="undefined"){var ab=[];ba=ba.getElementsByName(bb[1]);for(var aa=0,bu=ba.length;aa<bu;aa++){ba[aa].getAttribute("name")===bb[1]&&ab.push(ba[aa])}return ab.length===0?null:ab}},TAG:function(ab,aa){return aa.getElementsByTagName(ab[1])}},preFilter:{CLASS:function(bu,bb,ab,aa,bv,bw){bu=" "+bu[1].replace(/\\/g,"")+" ";if(bw){return bu}bw=0;for(var ba;(ba=bb[bw])!=null;bw++){if(ba){if(bv^(ba.className&&(" "+ba.className+" ").replace(/[\t\n]/g," ").indexOf(bu)>=0)){ab||aa.push(ba)}else{if(ab){bb[bw]=false}}}}return false},ID:function(aa){return aa[1].replace(/\\/g,"")},TAG:function(aa){return aa[1].toLowerCase()},CHILD:function(ab){if(ab[1]==="nth"){var aa=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(ab[2]==="even"&&"2n"||ab[2]==="odd"&&"2n+1"||!/\D/.test(ab[2])&&"0n+"+ab[2]||ab[2]);ab[2]=aa[1]+(aa[2]||1)-0;ab[3]=aa[3]-0}ab[0]=V++;return ab},ATTR:function(bb,ba,ab,aa,bu,bv){ba=bb[1].replace(/\\/g,"");if(!bv&&O.attrMap[ba]){bb[1]=O.attrMap[ba]}if(bb[2]==="~="){bb[4]=" "+bb[4]+" "}return bb},PSEUDO:function(bb,ba,ab,aa,bu){if(bb[1]==="not"){if((T.exec(bb[3])||"").length>1||/^\w/.test(bb[3])){bb[3]=P(bb[3],null,null,ba)}else{bb=P.filter(bb[3],ba,ab,true^bu);ab||aa.push.apply(aa,bb);return false}}else{if(O.match.POS.test(bb[0])||O.match.CHILD.test(bb[0])){return true}}return bb},POS:function(aa){aa.unshift(true);return aa}},filters:{enabled:function(aa){return aa.disabled===false&&aa.type!=="hidden"},disabled:function(aa){return aa.disabled===true},checked:function(aa){return aa.checked===true},selected:function(aa){return aa.selected===true},parent:function(aa){return !!aa.firstChild},empty:function(aa){return !aa.firstChild},has:function(ba,ab,aa){return !!P(aa[3],ba).length},header:function(aa){return/h\d/i.test(aa.nodeName)},text:function(aa){return"text"===aa.type},radio:function(aa){return"radio"===aa.type},checkbox:function(aa){return"checkbox"===aa.type},file:function(aa){return"file"===aa.type},password:function(aa){return"password"===aa.type},submit:function(aa){return"submit"===aa.type},image:function(aa){return"image"===aa.type},reset:function(aa){return"reset"===aa.type},button:function(aa){return"button"===aa.type||aa.nodeName.toLowerCase()==="button"},input:function(aa){return/input|select|textarea|button/i.test(aa.nodeName)}},setFilters:{first:function(ab,aa){return aa===0},last:function(bb,ba,ab,aa){return ba===aa.length-1},even:function(ab,aa){return aa%2===0},odd:function(ab,aa){return aa%2===1},lt:function(ba,ab,aa){return ab<aa[3]-0},gt:function(ba,ab,aa){return ab>aa[3]-0},nth:function(ba,ab,aa){return aa[3]-0===ab},eq:function(ba,ab,aa){return aa[3]-0===ab}},filter:{PSEUDO:function(bb,ba,ab,aa){var bu=ba[1],bv=O.filters[bu];if(bv){return bv(bb,ab,ba,aa)}else{if(bu==="contains"){return(bb.textContent||bb.innerText||Y([bb])||"").indexOf(ba[3])>=0}else{if(bu==="not"){ba=ba[3];ab=0;for(aa=ba.length;ab<aa;ab++){if(ba[ab]===bb){return false}}return true}else{P.error("Syntax error, unrecognized expression: "+bu)}}}},CHILD:function(bu,bb){var ab=bb[1],aa=bu;switch(ab){case"only":case"first":for(;aa=aa.previousSibling;){if(aa.nodeType===1){return false}}if(ab==="first"){return true}aa=bu;case"last":for(;aa=aa.nextSibling;){if(aa.nodeType===1){return false}}return true;case"nth":ab=bb[2];var bv=bb[3];if(ab===1&&bv===0){return true}bb=bb[0];var bw=bu.parentNode;if(bw&&(bw.sizcache!==bb||!bu.nodeIndex)){var ba=0;for(aa=bw.firstChild;aa;aa=aa.nextSibling){if(aa.nodeType===1){aa.nodeIndex=++ba}}bw.sizcache=bb}bu=bu.nodeIndex-bv;return ab===0?bu===0:bu%ab===0&&bu/ab>=0}},ID:function(ab,aa){return ab.nodeType===1&&ab.getAttribute("id")===aa},TAG:function(ab,aa){return aa==="*"&&ab.nodeType===1||ab.nodeName.toLowerCase()===aa},CLASS:function(ab,aa){return(" "+(ab.className||ab.getAttribute("class"))+" ").indexOf(aa)>-1},ATTR:function(bb,ba){var ab=ba[1];bb=O.attrHandle[ab]?O.attrHandle[ab](bb):bb[ab]!=null?bb[ab]:bb.getAttribute(ab);ab=bb+"";var aa=ba[2];ba=ba[4];return bb==null?aa==="!=":aa==="="?ab===ba:aa==="*="?ab.indexOf(ba)>=0:aa==="~="?(" "+ab+" ").indexOf(ba)>=0:!ba?ab&&bb!==false:aa==="!="?ab!==ba:aa==="^="?ab.indexOf(ba)===0:aa==="$="?ab.substr(ab.length-ba.length)===ba:aa==="|="?ab===ba||ab.substr(0,ba.length+1)===ba+"-":false},POS:function(bb,ba,ab,aa){var bu=O.setFilters[ba[2]];if(bu){return bu(bb,ab,ba,aa)}}}},K=O.match.POS;for(var F in O.match){O.match[F]=new RegExp(O.match[F].source+/(?![^\[]*\])(?![^\(]*\))/.source);O.leftMatch[F]=new RegExp(/(^(?:.|\r|\n)*?)/.source+O.match[F].source.replace(/\\(\d+)/g,function(ab,aa){return"\\"+(aa-0+1)}))}var w=function(ab,aa){ab=Array.prototype.slice.call(ab,0);if(aa){aa.push.apply(aa,ab);return aa}return ab};try{Array.prototype.slice.call(ai.documentElement.childNodes,0)}catch(J){w=function(bb,ba){ba=ba||[];if(Q.call(bb)==="[object Array]"){Array.prototype.push.apply(ba,bb)}else{if(typeof bb.length==="number"){for(var ab=0,aa=bb.length;ab<aa;ab++){ba.push(bb[ab])}}else{for(ab=0;bb[ab];ab++){ba.push(bb[ab])}}}return ba}}var L;if(ai.documentElement.compareDocumentPosition){L=function(ab,aa){if(!ab.compareDocumentPosition||!aa.compareDocumentPosition){if(ab==aa){R=true}return ab.compareDocumentPosition?-1:1}ab=ab.compareDocumentPosition(aa)&4?-1:ab===aa?0:1;if(ab===0){R=true}return ab}}else{if("sourceIndex" in ai.documentElement){L=function(ab,aa){if(!ab.sourceIndex||!aa.sourceIndex){if(ab==aa){R=true}return ab.sourceIndex?-1:1}ab=ab.sourceIndex-aa.sourceIndex;if(ab===0){R=true}return ab}}else{if(ai.createRange){L=function(bb,ba){if(!bb.ownerDocument||!ba.ownerDocument){if(bb==ba){R=true}return bb.ownerDocument?-1:1}var ab=bb.ownerDocument.createRange(),aa=ba.ownerDocument.createRange();ab.setStart(bb,0);ab.setEnd(bb,0);aa.setStart(ba,0);aa.setEnd(ba,0);bb=ab.compareBoundaryPoints(Range.START_TO_END,aa);if(bb===0){R=true}return bb}}}}(function(){var ba=ai.createElement("div"),ab="script"+(new Date).getTime();ba.innerHTML="<a name='"+ab+"'/>";var aa=ai.documentElement;aa.insertBefore(ba,aa.firstChild);if(ai.getElementById(ab)){O.find.ID=function(bb,bu,bv){if(typeof bu.getElementById!=="undefined"&&!bv){return(bu=bu.getElementById(bb[1]))?bu.id===bb[1]||typeof bu.getAttributeNode!=="undefined"&&bu.getAttributeNode("id").nodeValue===bb[1]?[bu]:ah:[]}};O.filter.ID=function(bb,bu){var bv=typeof bb.getAttributeNode!=="undefined"&&bb.getAttributeNode("id");return bb.nodeType===1&&bv&&bv.nodeValue===bu}}aa.removeChild(ba);aa=ba=null})();(function(){var aa=ai.createElement("div");aa.appendChild(ai.createComment(""));if(aa.getElementsByTagName("*").length>0){O.find.TAG=function(bb,ba){ba=ba.getElementsByTagName(bb[1]);if(bb[1]==="*"){bb=[];for(var ab=0;ba[ab];ab++){ba[ab].nodeType===1&&bb.push(ba[ab])}ba=bb}return ba}}aa.innerHTML="<a href='#'></a>";if(aa.firstChild&&typeof aa.firstChild.getAttribute!=="undefined"&&aa.firstChild.getAttribute("href")!=="#"){O.attrHandle.href=function(ab){return ab.getAttribute("href",2)}}aa=null})();ai.querySelectorAll&&function(){var ba=P,ab=ai.createElement("div");ab.innerHTML="<p class='TEST'></p>";if(!(ab.querySelectorAll&&ab.querySelectorAll(".TEST").length===0)){P=function(bb,bw,bx,bu){bw=bw||ai;if(!bu&&bw.nodeType===9&&!A(bw)){try{return w(bw.querySelectorAll(bb),bx)}catch(bv){}}return ba(bb,bw,bx,bu)};for(var aa in ba){P[aa]=ba[aa]}ab=null}}();(function(){var aa=ai.createElement("div");aa.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!aa.getElementsByClassName||aa.getElementsByClassName("e").length===0)){aa.lastChild.className="e";if(aa.getElementsByClassName("e").length!==1){O.order.splice(1,0,"CLASS");O.find.CLASS=function(bb,ba,ab){if(typeof ba.getElementsByClassName!=="undefined"&&!ab){return ba.getElementsByClassName(bb[1])}};aa=null}}})();var G=ai.compareDocumentPosition?function(ab,aa){return !!(ab.compareDocumentPosition(aa)&16)}:function(ab,aa){return ab!==aa&&(ab.contains?ab.contains(aa):true)},A=function(aa){return(aa=(aa?aa.ownerDocument||aa:0).documentElement)?aa.nodeName!=="HTML":false},Z=function(bb,ba){var ab=[],aa="",bu;for(ba=ba.nodeType?[ba]:ba;bu=O.match.PSEUDO.exec(bb);){aa+=bu[0];bb=bb.replace(O.match.PSEUDO,"")}bb=O.relative[bb]?bb+"*":bb;bu=0;for(var bv=ba.length;bu<bv;bu++){P(bb,ba[bu],ab)}return P.filter(aa,ab)};aq.find=P;aq.expr=P.selectors;aq.expr[":"]=aq.expr.filters;aq.unique=P.uniqueSort;aq.text=Y;aq.isXMLDoc=A;aq.contains=G})();var j=/Until$/,bk=/^(?:parents|prevUntil|prevAll)/,a5=/,/;aD=Array.prototype.slice;var aU=function(A,w,G){if(aq.isFunction(w)){return aq.grep(A,function(K,J){return !!w.call(K,J,K)===G})}else{if(w.nodeType){return aq.grep(A,function(J){return J===w===G})}else{if(typeof w==="string"){var F=aq.grep(A,function(J){return J.nodeType===1});if(a2.test(w)){return aq.filter(w,F,!G)}else{w=aq.filter(w,F)}}}}return aq.grep(A,function(J){return aq.inArray(J,w)>=0===G})};aq.fn.extend({find:function(A){for(var w=this.pushStack("","find",A),L=0,J=0,K=this.length;J<K;J++){L=w.length;aq.find(A,this[J],w);if(J>0){for(var F=L;F<w.length;F++){for(var G=0;G<L;G++){if(w[G]===w[F]){w.splice(F--,1);break}}}}}return w},has:function(A){var w=aq(A);return this.filter(function(){for(var G=0,F=w.length;G<F;G++){if(aq.contains(this,w[G])){return true}}})},not:function(w){return this.pushStack(aU(this,w,false),"not",w)},filter:function(w){return this.pushStack(aU(this,w,true),"filter",w)},is:function(w){return !!w&&aq.filter(w,this).length>0},closest:function(O,N){if(aq.isArray(O)){var L=[],J=this[0],K,F={},G;if(J&&O.length){K=0;for(var w=O.length;K<w;K++){G=O[K];F[G]||(F[G]=aq.expr.match.POS.test(G)?aq(G,N||this.context):G)}for(;J&&J.ownerDocument&&J!==N;){for(G in F){K=F[G];if(K.jquery?K.index(J)>-1:aq(J).is(K)){L.push({selector:G,elem:J});delete F[G]}}J=J.parentNode}}return L}var A=aq.expr.match.POS.test(O)?aq(O,N||this.context):null;return this.map(function(Q,P){for(;P&&P.ownerDocument&&P!==N;){if(A?A.index(P)>-1:aq(P).is(O)){return P}P=P.parentNode}return null})},index:function(w){if(!w||typeof w==="string"){return aq.inArray(this[0],w?aq(w):this.parent().children())}return aq.inArray(w.jquery?w[0]:w,this)},add:function(A,w){A=typeof A==="string"?aq(A,w||this.context):aq.makeArray(A);w=aq.merge(this.get(),A);return this.pushStack(v(A[0])||v(w[0])?w:aq.unique(w))},andSelf:function(){return this.add(this.prevObject)}});aq.each({parent:function(w){return(w=w.parentNode)&&w.nodeType!==11?w:null},parents:function(w){return aq.dir(w,"parentNode")},parentsUntil:function(A,w,F){return aq.dir(A,"parentNode",F)},next:function(w){return aq.nth(w,2,"nextSibling")},prev:function(w){return aq.nth(w,2,"previousSibling")},nextAll:function(w){return aq.dir(w,"nextSibling")},prevAll:function(w){return aq.dir(w,"previousSibling")},nextUntil:function(A,w,F){return aq.dir(A,"nextSibling",F)},prevUntil:function(A,w,F){return aq.dir(A,"previousSibling",F)},siblings:function(w){return aq.sibling(w.parentNode.firstChild,w)},children:function(w){return aq.sibling(w.firstChild)},contents:function(w){return aq.nodeName(w,"iframe")?w.contentDocument||w.contentWindow.document:aq.makeArray(w.childNodes)}},function(A,w){aq.fn[A]=function(J,F){var G=aq.map(this,w,J);j.test(A)||(F=J);if(F&&typeof F==="string"){G=aq.filter(F,G)}G=this.length>1?aq.unique(G):G;if((this.length>1||a5.test(F))&&bk.test(A)){G=G.reverse()}return this.pushStack(G,A,aD.call(arguments).join(","))}});aq.extend({filter:function(A,w,F){if(F){A=":not("+A+")"}return aq.find.matches(A,w)},dir:function(A,w,G){var F=[];for(A=A[w];A&&A.nodeType!==9&&(G===ah||A.nodeType!==1||!aq(A).is(G));){A.nodeType===1&&F.push(A);A=A[w]}return F},nth:function(A,w,G){w=w||1;for(var F=0;A;A=A[G]){if(A.nodeType===1&&++F===w){break}}return A},sibling:function(A,w){for(var F=[];A;A=A.nextSibling){A.nodeType===1&&A!==w&&F.push(A)}return F}});var ar=/ jQuery\d+="(?:\d+|null)"/g,aB=/^\s+/,ac=/(<([\w:]+)[^>]*?)\/>/g,aM=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,x=/<([\w:]+)/,al=/<tbody/i,H=/<|&#?\w+;/,aY=/<script|<object|<embed|<option|<style/i,au=/checked\s*(?:[^=]|=\s*.checked.)/i,bt=function(A,w,F){return aM.test(F)?A:w+"></"+F+">"},aS={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,"",""]};aS.optgroup=aS.option;aS.tbody=aS.tfoot=aS.colgroup=aS.caption=aS.thead;aS.th=aS.td;if(!aq.support.htmlSerialize){aS._default=[1,"div<div>","</div>"]}aq.fn.extend({text:function(w){if(aq.isFunction(w)){return this.each(function(A){var F=aq(this);F.text(w.call(this,A,F.text()))})}if(typeof w!=="object"&&w!==ah){return this.empty().append((this[0]&&this[0].ownerDocument||ai).createTextNode(w))}return aq.text(this)},wrapAll:function(A){if(aq.isFunction(A)){return this.each(function(F){aq(this).wrapAll(A.call(this,F))})}if(this[0]){var w=aq(A,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&w.insertBefore(this[0]);w.map(function(){for(var F=this;F.firstChild&&F.firstChild.nodeType===1;){F=F.firstChild}return F}).append(this)}return this},wrapInner:function(w){if(aq.isFunction(w)){return this.each(function(A){aq(this).wrapInner(w.call(this,A))})}return this.each(function(){var A=aq(this),F=A.contents();F.length?F.wrapAll(w):A.append(w)})},wrap:function(w){return this.each(function(){aq(this).wrapAll(w)})},unwrap:function(){return this.parent().each(function(){aq.nodeName(this,"body")||aq(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(w){this.nodeType===1&&this.appendChild(w)})},prepend:function(){return this.domManip(arguments,true,function(w){this.nodeType===1&&this.insertBefore(w,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 w=aq(arguments[0]);w.push.apply(w,this.toArray());return this.pushStack(w,"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 w=this.pushStack(this,"after",arguments);w.push.apply(w,aq(arguments[0]).toArray());return w}}},remove:function(A,w){for(var G=0,F;(F=this[G])!=null;G++){if(!A||aq.filter(A,[F]).length){if(!w&&F.nodeType===1){aq.cleanData(F.getElementsByTagName("*"));aq.cleanData([F])}F.parentNode&&F.parentNode.removeChild(F)}}return this},empty:function(){for(var A=0,w;(w=this[A])!=null;A++){for(w.nodeType===1&&aq.cleanData(w.getElementsByTagName("*"));w.firstChild;){w.removeChild(w.firstChild)}}return this},clone:function(A){var w=this.map(function(){if(!aq.support.noCloneEvent&&!aq.isXMLDoc(this)){var G=this.outerHTML,F=this.ownerDocument;if(!G){G=F.createElement("div");G.appendChild(this.cloneNode(true));G=G.innerHTML}return aq.clean([G.replace(ar,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(aB,"")],F)[0]}else{return this.cloneNode(true)}});if(A===true){bs(this,w);bs(this.find("*"),w.find("*"))}return w},html:function(A){if(A===ah){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(ar,""):null}else{if(typeof A==="string"&&!aY.test(A)&&(aq.support.leadingWhitespace||!aB.test(A))&&!aS[(x.exec(A)||["",""])[1].toLowerCase()]){A=A.replace(ac,bt);try{for(var w=0,G=this.length;w<G;w++){if(this[w].nodeType===1){aq.cleanData(this[w].getElementsByTagName("*"));this[w].innerHTML=A}}}catch(F){this.empty().append(A)}}else{aq.isFunction(A)?this.each(function(L){var J=aq(this),K=J.html();J.empty().append(function(){return A.call(this,L,K)})}):this.empty().append(A)}}return this},replaceWith:function(w){if(this[0]&&this[0].parentNode){if(aq.isFunction(w)){return this.each(function(A){var G=aq(this),F=G.html();G.replaceWith(w.call(this,A,F))})}if(typeof w!=="string"){w=aq(w).detach()}return this.each(function(){var A=this.nextSibling,F=this.parentNode;aq(this).remove();A?aq(A).before(w):aq(F).append(w)})}else{return this.pushStack(aq(aq.isFunction(w)?w():w),"replaceWith",w)}},detach:function(w){return this.remove(w,true)},domManip:function(Q,P,O){function L(R){return aq.nodeName(R,"table")?R.getElementsByTagName("tbody")[0]||R.appendChild(R.ownerDocument.createElement("tbody")):R}var N,J,K=Q[0],A=[],G;if(!aq.support.checkClone&&arguments.length===3&&typeof K==="string"&&au.test(K)){return this.each(function(){aq(this).domManip(Q,P,O,true)})}if(aq.isFunction(K)){return this.each(function(R){var T=aq(this);Q[0]=K.call(this,R,P?T.html():ah);T.domManip(Q,P,O)})}if(this[0]){N=K&&K.parentNode;N=aq.support.parentNode&&N&&N.nodeType===11&&N.childNodes.length===this.length?{fragment:N}:be(Q,this,A);G=N.fragment;if(J=G.childNodes.length===1?(G=G.firstChild):G.firstChild){P=P&&aq.nodeName(J,"tr");for(var F=0,w=this.length;F<w;F++){O.call(P?L(this[F],J):this[F],F>0||N.cacheable||this.length>1?G.cloneNode(true):G)}}A.length&&aq.each(A,af)}return this}});aq.fragments={};aq.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(A,w){aq.fn[A]=function(L){var J=[];L=aq(L);var K=this.length===1&&this[0].parentNode;if(K&&K.nodeType===11&&K.childNodes.length===1&&L.length===1){L[w](this[0]);return this}else{K=0;for(var F=L.length;K<F;K++){var G=(K>0?this.clone(true):this).get();aq.fn[w].apply(aq(L[K]),G);J=J.concat(G)}return this.pushStack(J,A,L.selector)}}});aq.extend({clean:function(Q,P,O,L){P=P||ai;if(typeof P.createElement==="undefined"){P=P.ownerDocument||P[0]&&P[0].ownerDocument||ai}for(var N=[],J=0,K;(K=Q[J])!=null;J++){if(typeof K==="number"){K+=""}if(K){if(typeof K==="string"&&!H.test(K)){K=P.createTextNode(K)}else{if(typeof K==="string"){K=K.replace(ac,bt);var A=(x.exec(K)||["",""])[1].toLowerCase(),G=aS[A]||aS._default,F=G[0],w=P.createElement("div");for(w.innerHTML=G[1]+K+G[2];F--;){w=w.lastChild}if(!aq.support.tbody){F=al.test(K);A=A==="table"&&!F?w.firstChild&&w.firstChild.childNodes:G[1]==="<table>"&&!F?w.childNodes:[];for(G=A.length-1;G>=0;--G){aq.nodeName(A[G],"tbody")&&!A[G].childNodes.length&&A[G].parentNode.removeChild(A[G])}}!aq.support.leadingWhitespace&&aB.test(K)&&w.insertBefore(P.createTextNode(aB.exec(K)[0]),w.firstChild);K=w.childNodes}}if(K.nodeType){N.push(K)}else{N=aq.merge(N,K)}}}if(O){for(J=0;N[J];J++){if(L&&aq.nodeName(N[J],"script")&&(!N[J].type||N[J].type.toLowerCase()==="text/javascript")){L.push(N[J].parentNode?N[J].parentNode.removeChild(N[J]):N[J])}else{N[J].nodeType===1&&N.splice.apply(N,[J+1,0].concat(aq.makeArray(N[J].getElementsByTagName("script"))));O.appendChild(N[J])}}}return N},cleanData:function(O){for(var N,L,J=aq.cache,K=aq.event.special,F=aq.support.deleteExpando,G=0,w;(w=O[G])!=null;G++){if(L=w[aq.expando]){N=J[L];if(N.events){for(var A in N.events){K[A]?aq.event.remove(w,A):aP(w,A,N.handle)}}if(F){delete w[aq.expando]}else{w.removeAttribute&&w.removeAttribute(aq.expando)}delete J[L]}}}});var l=/z-?index|font-?weight|opacity|zoom|line-?height/i,bf=/alpha\([^)]*\)/,aZ=/opacity=([^)]*)/,aN=/float/i,am=/-([a-z])/ig,bo=/([A-Z])/g,a8=/^-?\d+(?:px)?$/i,aR=/^-?\d/,ao={position:"absolute",visibility:"hidden",display:"block"},S=["Left","Right"],q=["Top","Bottom"],br=ai.defaultView&&ai.defaultView.getComputedStyle,av=aq.support.cssFloat?"cssFloat":"styleFloat",I=function(A,w){return w.toUpperCase()};aq.fn.css=function(A,w){return az(this,A,w,true,function(J,F,G){if(G===ah){return aq.curCSS(J,F)}if(typeof G==="number"&&!l.test(F)){G+="px"}aq.style(J,F,G)})};aq.extend({style:function(A,w,J){if(!A||A.nodeType===3||A.nodeType===8){return ah}if((w==="width"||w==="height")&&parseFloat(J)<0){J=ah}var F=A.style||A,G=J!==ah;if(!aq.support.opacity&&w==="opacity"){if(G){F.zoom=1;w=parseInt(J,10)+""==="NaN"?"":"alpha(opacity="+J*100+")";A=F.filter||aq.curCSS(A,"filter")||"";F.filter=bf.test(A)?A.replace(bf,w):w}return F.filter&&F.filter.indexOf("opacity=")>=0?parseFloat(aZ.exec(F.filter)[1])/100+"":""}if(aN.test(w)){w=av}w=w.replace(am,I);if(G){F[w]=J}return F[w]},css:function(A,w,L,J){if(w==="width"||w==="height"){var K,F=w==="width"?S:q;function G(){K=w==="width"?A.offsetWidth:A.offsetHeight;J!=="border"&&aq.each(F,function(){J||(K-=parseFloat(aq.curCSS(A,"padding"+this,true))||0);if(J==="margin"){K+=parseFloat(aq.curCSS(A,"margin"+this,true))||0}else{K-=parseFloat(aq.curCSS(A,"border"+this+"Width",true))||0}})}A.offsetWidth!==0?G():aq.swap(A,ao,G);return Math.max(0,Math.round(K))}return aq.curCSS(A,w,L)},curCSS:function(A,w,K){var G,J=A.style;if(!aq.support.opacity&&w==="opacity"&&A.currentStyle){G=aZ.test(A.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return G===""?"1":G}if(aN.test(w)){w=av}if(!K&&J&&J[w]){G=J[w]}else{if(br){if(aN.test(w)){w="float"}w=w.replace(bo,"-$1").toLowerCase();J=A.ownerDocument.defaultView;if(!J){return null}if(A=J.getComputedStyle(A,null)){G=A.getPropertyValue(w)}if(w==="opacity"&&G===""){G="1"}}else{if(A.currentStyle){K=w.replace(am,I);G=A.currentStyle[w]||A.currentStyle[K];if(!a8.test(G)&&aR.test(G)){w=J.left;var F=A.runtimeStyle.left;A.runtimeStyle.left=A.currentStyle.left;J.left=K==="fontSize"?"1em":G||0;G=J.pixelLeft+"px";J.left=w;A.runtimeStyle.left=F}}}}return G},swap:function(A,w,J){var F={};for(var G in w){F[G]=A.style[G];A.style[G]=w[G]}J.call(A);for(G in w){A.style[G]=F[G]}}});if(aq.expr&&aq.expr.filters){aq.expr.filters.hidden=function(A){var w=A.offsetWidth,G=A.offsetHeight,F=A.nodeName.toLowerCase()==="tr";return w===0&&G===0&&!F?true:w>0&&G>0&&!F?false:aq.curCSS(A,"display")==="none"};aq.expr.filters.visible=function(w){return !aq.expr.filters.hidden(w)}}var bd=aO(),aW=/<script(.|\s)*?\/script>/gi,at=/select|textarea/i,ad=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,aJ=/=\?(&|$)/,n=/\?/,y=/(\?|&)_=.*?(&|$)/,b=/^(\w+:)?\/\/([^\/?#]+)/,bg=/%20/g,a0=aq.fn.load;aq.fn.extend({load:function(A,w,K){if(typeof A!=="string"){return a0.call(this,A)}else{if(!this.length){return this}}var G=A.indexOf(" ");if(G>=0){var J=A.slice(G,A.length);A=A.slice(0,G)}G="GET";if(w){if(aq.isFunction(w)){K=w;w=null}else{if(typeof w==="object"){w=aq.param(w,aq.ajaxSettings.traditional);G="POST"}}}var F=this;aq.ajax({url:A,type:G,dataType:"html",data:w,complete:function(L,N){if(N==="success"||N==="notmodified"){F.html(J?aq("<div />").append(L.responseText.replace(aW,"")).find(J):L.responseText)}K&&F.each(K,[L.responseText,N,L])}});return this},serialize:function(){return aq.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?aq.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||at.test(this.nodeName)||ad.test(this.type))}).map(function(A,w){A=aq(this).val();return A==null?null:aq.isArray(A)?aq.map(A,function(F){return{name:w.name,value:F}}):{name:w.name,value:A}}).get()}});aq.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(A,w){aq.fn[w]=function(F){return this.bind(w,F)}});aq.extend({get:function(A,w,G,F){if(aq.isFunction(w)){F=F||G;G=w;w=null}return aq.ajax({type:"GET",url:A,data:w,success:G,dataType:F})},getScript:function(A,w){return aq.get(A,null,w,"script")},getJSON:function(A,w,F){return aq.get(A,w,F,"json")},post:function(A,w,G,F){if(aq.isFunction(w)){F=F||G;G=w;w={}}return aq.ajax({type:"POST",url:A,data:w,success:G,dataType:F})},ajaxSetup:function(w){aq.extend(aq.ajaxSettings,w)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:aX.XMLHttpRequest&&(aX.location.protocol!=="file:"||!aX.ActiveXObject)?function(){return new aX.XMLHttpRequest}:function(){try{return new aX.ActiveXObject("Microsoft.XMLHTTP")}catch(w){}},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(ba){function ab(){Z.success&&Z.success.call(R,N,V,A);Z.global&&Y("ajaxSuccess",[A,Z])}function aa(){Z.complete&&Z.complete.call(R,A,V);Z.global&&Y("ajaxComplete",[A,Z]);Z.global&&!--aq.active&&aq.event.trigger("ajaxStop")}function Y(bu,bv){(Z.context?aq(Z.context):aq.event).trigger(bu,bv)}var Z=aq.extend(true,{},aq.ajaxSettings,ba),T,V,N,R=ba&&ba.context||Z,O=Z.type.toUpperCase();if(Z.data&&Z.processData&&typeof Z.data!=="string"){Z.data=aq.param(Z.data,Z.traditional)}if(Z.dataType==="jsonp"){if(O==="GET"){aJ.test(Z.url)||(Z.url+=(n.test(Z.url)?"&":"?")+(Z.jsonp||"callback")+"=?")}else{if(!Z.data||!aJ.test(Z.data)){Z.data=(Z.data?Z.data+"&":"")+(Z.jsonp||"callback")+"=?"}}Z.dataType="json"}if(Z.dataType==="json"&&(Z.data&&aJ.test(Z.data)||aJ.test(Z.url))){T=Z.jsonpCallback||"jsonp"+bd++;if(Z.data){Z.data=(Z.data+"").replace(aJ,"="+T+"$1")}Z.url=Z.url.replace(aJ,"="+T+"$1");Z.dataType="script";aX[T]=aX[T]||function(bu){N=bu;ab();aa();aX[T]=ah;try{delete aX[T]}catch(bv){}w&&w.removeChild(J)}}if(Z.dataType==="script"&&Z.cache===null){Z.cache=false}if(Z.cache===false&&O==="GET"){var K=aO(),F=Z.url.replace(y,"$1_="+K+"$2");Z.url=F+(F===Z.url?(n.test(Z.url)?"&":"?")+"_="+K:"")}if(Z.data&&O==="GET"){Z.url+=(n.test(Z.url)?"&":"?")+Z.data}Z.global&&!aq.active++&&aq.event.trigger("ajaxStart");K=(K=b.exec(Z.url))&&(K[1]&&K[1]!==location.protocol||K[2]!==location.host);if(Z.dataType==="script"&&O==="GET"&&K){var w=ai.getElementsByTagName("head")[0]||ai.documentElement,J=ai.createElement("script");J.src=Z.url;if(Z.scriptCharset){J.charset=Z.scriptCharset}if(!T){var L=false;J.onload=J.onreadystatechange=function(){if(!L&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){L=true;ab();aa();J.onload=J.onreadystatechange=null;w&&J.parentNode&&w.removeChild(J)}}}w.insertBefore(J,w.firstChild);return ah}var G=false,A=Z.xhr();if(A){Z.username?A.open(O,Z.url,Z.async,Z.username,Z.password):A.open(O,Z.url,Z.async);try{if(Z.data||ba&&ba.contentType){A.setRequestHeader("Content-Type",Z.contentType)}if(Z.ifModified){aq.lastModified[Z.url]&&A.setRequestHeader("If-Modified-Since",aq.lastModified[Z.url]);aq.etag[Z.url]&&A.setRequestHeader("If-None-Match",aq.etag[Z.url])}K||A.setRequestHeader("X-Requested-With","XMLHttpRequest");A.setRequestHeader("Accept",Z.dataType&&Z.accepts[Z.dataType]?Z.accepts[Z.dataType]+", */*":Z.accepts._default)}catch(bb){}if(Z.beforeSend&&Z.beforeSend.call(R,A,Z)===false){Z.global&&!--aq.active&&aq.event.trigger("ajaxStop");A.abort();return false}Z.global&&Y("ajaxSend",[A,Z]);var X=A.onreadystatechange=function(bv){if(!A||A.readyState===0||bv==="abort"){G||aa();G=true;if(A){A.onreadystatechange=aq.noop}}else{if(!G&&A&&(A.readyState===4||bv==="timeout")){G=true;A.onreadystatechange=aq.noop;V=bv==="timeout"?"timeout":!aq.httpSuccess(A)?"error":Z.ifModified&&aq.httpNotModified(A,Z.url)?"notmodified":"success";var bw;if(V==="success"){try{N=aq.httpData(A,Z.dataType,Z)}catch(bu){V="parsererror";bw=bu}}if(V==="success"||V==="notmodified"){T||ab()}else{aq.handleError(Z,A,V,bw)}aa();bv==="timeout"&&A.abort();if(Z.async){A=null}}}};try{var W=A.abort;A.abort=function(){A&&W.call(A);X("abort")}}catch(Q){}Z.async&&Z.timeout>0&&setTimeout(function(){A&&!G&&X("timeout")},Z.timeout);try{A.send(O==="POST"||O==="PUT"||O==="DELETE"?Z.data:null)}catch(P){aq.handleError(Z,A,null,P);aa()}Z.async||X();return A}},handleError:function(A,w,G,F){if(A.error){A.error.call(A.context||A,w,G,F)}if(A.global){(A.context?aq(A.context):aq.event).trigger("ajaxError",[w,A,F])}},active:0,httpSuccess:function(A){try{return !A.status&&location.protocol==="file:"||A.status>=200&&A.status<300||A.status===304||A.status===1223||A.status===0}catch(w){}return false},httpNotModified:function(A,w){var G=A.getResponseHeader("Last-Modified"),F=A.getResponseHeader("Etag");if(G){aq.lastModified[w]=G}if(F){aq.etag[w]=F}return A.status===304||A.status===0},httpData:function(A,w,J){var F=A.getResponseHeader("content-type")||"",G=w==="xml"||!w&&F.indexOf("xml")>=0;A=G?A.responseXML:A.responseText;G&&A.documentElement.nodeName==="parsererror"&&aq.error("parsererror");if(J&&J.dataFilter){A=J.dataFilter(A,w)}if(typeof A==="string"){if(w==="json"||!w&&F.indexOf("json")>=0){A=aq.parseJSON(A)}else{if(w==="script"||!w&&F.indexOf("javascript")>=0){aq.globalEval(A)}}}return A},param:function(A,w){function K(L,N){if(aq.isArray(N)){aq.each(N,function(O,P){w||/\[\]$/.test(L)?G(L,P):K(L+"["+(typeof P==="object"||aq.isArray(P)?O:"")+"]",P)})}else{!w&&N!=null&&typeof N==="object"?aq.each(N,function(O,P){K(L+"["+O+"]",P)}):G(L,N)}}function G(L,N){N=aq.isFunction(N)?N():N;J[J.length]=encodeURIComponent(L)+"="+encodeURIComponent(N)}var J=[];if(w===ah){w=aq.ajaxSettings.traditional}if(aq.isArray(A)||A.jquery){aq.each(A,function(){G(this.name,this.value)})}else{for(var F in A){K(F,A[F])}}return J.join("&").replace(bg,"+")}});var bp={},bl=/toggle|show|hide/,a6=/^([+-]=)?([\d+-.]+)(.*)$/,aA,ae=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];aq.fn.extend({show:function(A,w){if(A||A===0){return this.animate(aL("show",3),A,w)}else{A=0;for(w=this.length;A<w;A++){var J=aq.data(this[A],"olddisplay");this[A].style.display=J||"";if(aq.css(this[A],"display")==="none"){J=this[A].nodeName;var F;if(bp[J]){F=bp[J]}else{var G=aq("<"+J+" />").appendTo("body");F=G.css("display");if(F==="none"){F="block"}G.remove();bp[J]=F}aq.data(this[A],"olddisplay",F)}}A=0;for(w=this.length;A<w;A++){this[A].style.display=aq.data(this[A],"olddisplay")||""}return this}},hide:function(A,w){if(A||A===0){return this.animate(aL("hide",3),A,w)}else{A=0;for(w=this.length;A<w;A++){var F=aq.data(this[A],"olddisplay");!F&&F!=="none"&&aq.data(this[A],"olddisplay",aq.css(this[A],"display"))}A=0;for(w=this.length;A<w;A++){this[A].style.display="none"}return this}},_toggle:aq.fn.toggle,toggle:function(A,w){var F=typeof A==="boolean";if(aq.isFunction(A)&&aq.isFunction(w)){this._toggle.apply(this,arguments)}else{A==null||F?this.each(function(){var G=F?A:aq(this).is(":hidden");aq(this)[G?"show":"hide"]()}):this.animate(aL("toggle",3),A,w)}return this},fadeTo:function(A,w,F){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:w},A,F)},animate:function(A,w,J,F){var G=aq.speed(w,J,F);if(aq.isEmptyObject(A)){return this.each(G.complete)}return this[G.queue===false?"each":"queue"](function(){var L=aq.extend({},G),N,O=this.nodeType===1&&aq(this).is(":hidden"),K=this;for(N in A){var P=N.replace(am,I);if(N!==P){A[P]=A[N];delete A[N];N=P}if(A[N]==="hide"&&O||A[N]==="show"&&!O){return L.complete.call(this)}if((N==="height"||N==="width")&&this.style){L.display=aq.css(this,"display");L.overflow=this.style.overflow}if(aq.isArray(A[N])){(L.specialEasing=L.specialEasing||{})[N]=A[N][1];A[N]=A[N][0]}}if(L.overflow!=null){this.style.overflow="hidden"}L.curAnim=aq.extend({},A);aq.each(A,function(R,Q){var W=new aq.fx(K,L,R);if(bl.test(Q)){W[Q==="toggle"?O?"show":"hide":Q](A)}else{var V=a6.exec(Q),X=W.cur(true)||0;if(V){Q=parseFloat(V[2]);var T=V[3]||"px";if(T!=="px"){K.style[R]=(Q||1)+T;X=(Q||1)/W.cur(true)*X;K.style[R]=X+T}if(V[1]){Q=(V[1]==="-="?-1:1)*Q+X}W.custom(X,Q,T)}else{W.custom(X,Q,"")}}});return true})},stop:function(A,w){var F=aq.timers;A&&this.queue([]);this.each(function(){for(var G=F.length-1;G>=0;G--){if(F[G].elem===this){w&&F[G](true);F.splice(G,1)}}});w||this.dequeue();return this}});aq.each({slideDown:aL("show",1),slideUp:aL("hide",1),slideToggle:aL("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(A,w){aq.fn[A]=function(G,F){return this.animate(w,G,F)}});aq.extend({speed:function(A,w,G){var F=A&&typeof A==="object"?A:{complete:G||!G&&w||aq.isFunction(A)&&A,duration:A,easing:G&&w||w&&!aq.isFunction(w)&&w};F.duration=aq.fx.off?0:typeof F.duration==="number"?F.duration:aq.fx.speeds[F.duration]||aq.fx.speeds._default;F.old=F.complete;F.complete=function(){F.queue!==false&&aq(this).dequeue();aq.isFunction(F.old)&&F.old.call(this)};return F},easing:{linear:function(A,w,G,F){return G+F*A},swing:function(A,w,G,F){return(-Math.cos(A*Math.PI)/2+0.5)*F+G}},timers:[],fx:function(A,w,F){this.options=w;this.elem=A;this.prop=F;if(!w.orig){w.orig={}}}});aq.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(aq.fx.step[this.prop]||aq.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(w){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}return(w=parseFloat(aq.css(this.elem,this.prop,w)))&&w>-10000?w:parseFloat(aq.curCSS(this.elem,this.prop))||0},custom:function(A,w,J){function F(K){return G.step(K)}this.startTime=aO();this.start=A;this.end=w;this.unit=J||this.unit||"px";this.now=this.start;this.pos=this.state=0;var G=this;F.elem=this.elem;if(F()&&aq.timers.push(F)&&!aA){aA=setInterval(aq.fx.tick,13)}},show:function(){this.options.orig[this.prop]=aq.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());aq(this.elem).show()},hide:function(){this.options.orig[this.prop]=aq.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(A){var w=aO(),J=true;if(A||w>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){J=false}}if(J){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;A=aq.data(this.elem,"olddisplay");this.elem.style.display=A?A:this.options.display;if(aq.css(this.elem,"display")==="none"){this.elem.style.display="block"}}this.options.hide&&aq(this.elem).hide();if(this.options.hide||this.options.show){for(var G in this.options.curAnim){aq.style(this.elem,G,this.options.orig[G])}}this.options.complete.call(this.elem)}return false}else{G=w-this.startTime;this.state=G/this.options.duration;A=this.options.easing||(aq.easing.swing?"swing":"linear");this.pos=aq.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||A](this.state,G,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};aq.extend(aq.fx,{tick:function(){for(var A=aq.timers,w=0;w<A.length;w++){A[w]()||A.splice(w--,1)}A.length||aq.fx.stop()},stop:function(){clearInterval(aA);aA=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(w){aq.style(w.elem,"opacity",w.now)},_default:function(w){if(w.elem.style&&w.elem.style[w.prop]!=null){w.elem.style[w.prop]=(w.prop==="width"||w.prop==="height"?Math.max(0,w.now):w.now)+w.unit}else{w.elem[w.prop]=w.now}}}});if(aq.expr&&aq.expr.filters){aq.expr.filters.animated=function(w){return aq.grep(aq.timers,function(A){return w===A.elem}).length}}aq.fn.offset="getBoundingClientRect" in ai.documentElement?function(A){var w=this[0];if(A){return this.each(function(J){aq.offset.setOffset(this,A,J)})}if(!w||!w.ownerDocument){return null}if(w===w.ownerDocument.body){return aq.offset.bodyOffset(w)}var G=w.getBoundingClientRect(),F=w.ownerDocument;w=F.body;F=F.documentElement;return{top:G.top+(self.pageYOffset||aq.support.boxModel&&F.scrollTop||w.scrollTop)-(F.clientTop||w.clientTop||0),left:G.left+(self.pageXOffset||aq.support.boxModel&&F.scrollLeft||w.scrollLeft)-(F.clientLeft||w.clientLeft||0)}}:function(P){var O=this[0];if(P){return this.each(function(Q){aq.offset.setOffset(this,P,Q)})}if(!O||!O.ownerDocument){return null}if(O===O.ownerDocument.body){return aq.offset.bodyOffset(O)}aq.offset.initialize();var N=O.offsetParent,K=O,L=O.ownerDocument,G,J=L.documentElement,w=L.body;K=(L=L.defaultView)?L.getComputedStyle(O,null):O.currentStyle;for(var F=O.offsetTop,A=O.offsetLeft;(O=O.parentNode)&&O!==w&&O!==J;){if(aq.offset.supportsFixedPosition&&K.position==="fixed"){break}G=L?L.getComputedStyle(O,null):O.currentStyle;F-=O.scrollTop;A-=O.scrollLeft;if(O===N){F+=O.offsetTop;A+=O.offsetLeft;if(aq.offset.doesNotAddBorder&&!(aq.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(O.nodeName))){F+=parseFloat(G.borderTopWidth)||0;A+=parseFloat(G.borderLeftWidth)||0}K=N;N=O.offsetParent}if(aq.offset.subtractsBorderForOverflowNotVisible&&G.overflow!=="visible"){F+=parseFloat(G.borderTopWidth)||0;A+=parseFloat(G.borderLeftWidth)||0}K=G}if(K.position==="relative"||K.position==="static"){F+=w.offsetTop;A+=w.offsetLeft}if(aq.offset.supportsFixedPosition&&K.position==="fixed"){F+=Math.max(J.scrollTop,w.scrollTop);A+=Math.max(J.scrollLeft,w.scrollLeft)}return{top:F,left:A}};aq.offset={initialize:function(){var A=ai.body,w=ai.createElement("div"),K,G,J,F=parseFloat(aq.curCSS(A,"marginTop",true))||0;aq.extend(w.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});w.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>";A.insertBefore(w,A.firstChild);K=w.firstChild;G=K.firstChild;J=K.nextSibling.firstChild.firstChild;this.doesNotAddBorder=G.offsetTop!==5;this.doesAddBorderForTableAndCells=J.offsetTop===5;G.style.position="fixed";G.style.top="20px";this.supportsFixedPosition=G.offsetTop===20||G.offsetTop===15;G.style.position=G.style.top="";K.style.overflow="hidden";K.style.position="relative";this.subtractsBorderForOverflowNotVisible=G.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=A.offsetTop!==F;A.removeChild(w);aq.offset.initialize=aq.noop},bodyOffset:function(A){var w=A.offsetTop,F=A.offsetLeft;aq.offset.initialize();if(aq.offset.doesNotIncludeMarginInBodyOffset){w+=parseFloat(aq.curCSS(A,"marginTop",true))||0;F+=parseFloat(aq.curCSS(A,"marginLeft",true))||0}return{top:w,left:F}},setOffset:function(A,w,L){if(/static/.test(aq.curCSS(A,"position"))){A.style.position="relative"}var J=aq(A),K=J.offset(),F=parseInt(aq.curCSS(A,"top",true),10)||0,G=parseInt(aq.curCSS(A,"left",true),10)||0;if(aq.isFunction(w)){w=w.call(A,L,K)}L={top:w.top-K.top+F,left:w.left-K.left+G};"using" in w?w.using.call(A,L):J.css(L)}};aq.fn.extend({position:function(){if(!this[0]){return null}var A=this[0],w=this.offsetParent(),G=this.offset(),F=/^body|html$/i.test(w[0].nodeName)?{top:0,left:0}:w.offset();G.top-=parseFloat(aq.curCSS(A,"marginTop",true))||0;G.left-=parseFloat(aq.curCSS(A,"marginLeft",true))||0;F.top+=parseFloat(aq.curCSS(w[0],"borderTopWidth",true))||0;F.left+=parseFloat(aq.curCSS(w[0],"borderLeftWidth",true))||0;return{top:G.top-F.top,left:G.left-F.left}},offsetParent:function(){return this.map(function(){for(var w=this.offsetParent||ai.body;w&&!/^body|html$/i.test(w.nodeName)&&aq.css(w,"position")==="static";){w=w.offsetParent}return w})}});aq.each(["Left","Top"],function(A,w){var F="scroll"+w;aq.fn[F]=function(J){var K=this[0],G;if(!K){return null}if(J!==ah){return this.each(function(){if(G=z(this)){G.scrollTo(!A?J:aq(G).scrollLeft(),A?J:aq(G).scrollTop())}else{this[F]=J}})}else{return(G=z(K))?"pageXOffset" in G?G[A?"pageYOffset":"pageXOffset"]:aq.support.boxModel&&G.document.documentElement[F]||G.document.body[F]:K[F]}}});aq.each(["Height","Width"],function(A,w){var F=w.toLowerCase();aq.fn["inner"+w]=function(){return this[0]?aq.css(this[0],F,false,"padding"):null};aq.fn["outer"+w]=function(G){return this[0]?aq.css(this[0],F,false,G?"margin":"border"):null};aq.fn[F]=function(G){var J=this[0];if(!J){return G==null?null:this}if(aq.isFunction(G)){return this.each(function(K){var L=aq(this);L[F](G.call(this,K,L[F]()))})}return"scrollTo" in J&&J.document?J.document.compatMode==="CSS1Compat"&&J.document.documentElement["client"+w]||J.document.body["client"+w]:J.nodeType===9?Math.max(J.documentElement["client"+w],J.body["scroll"+w],J.documentElement["scroll"+w],J.body["offset"+w],J.documentElement["offset"+w]):G===ah?aq.css(J,F):this.css(F,typeof G==="string"?G:G+"px")}});aX.jQuery=aX.$=aq})(window);jQuery.cookie=function(e,o,w){if(typeof o!="undefined"){w=w||{};if(o===null){o="";w.expires=-1}var j="";if(w.expires&&(typeof w.expires=="number"||w.expires.toUTCString)){var k;if(typeof w.expires=="number"){k=new Date();k.setTime(k.getTime()+(w.expires*24*60*60*1000))}else{k=w.expires}j="; expires="+k.toUTCString()}var v=w.path?"; path="+(w.path):"";var l=w.domain?"; domain="+(w.domain):"";var b=w.secure?"; secure":"";document.cookie=[e,"=",encodeURIComponent(o),j,v,l,b].join("")}else{var h=null;if(document.cookie&&document.cookie!=""){var q=document.cookie.split(";");for(var n=0;n<q.length;n++){var g=jQuery.trim(q[n]);if(g.substring(0,e.length+1)==(e+"=")){h=decodeURIComponent(g.substring(e.length+1));break}}}return h}};
/*
 * jQuery UI 1.8.2
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI
 */
(function(b){b.ui=b.ui||{};if(!b.ui.version){b.extend(b.ui,{version:"1.8.2",plugin:{add:function(h,g,k){h=b.ui[h].prototype;for(var j in k){h.plugins[j]=h.plugins[j]||[];h.plugins[j].push([g,k[j]])}},call:function(h,g,k){if((g=h.plugins[g])&&h.element[0].parentNode){for(var j=0;j<g.length;j++){h.options[g[j][0]]&&g[j][1].apply(h.element,k)}}}},contains:function(g,e){return document.compareDocumentPosition?g.compareDocumentPosition(e)&16:g!==e&&g.contains(e)},hasScroll:function(g,e){if(b(g).css("overflow")=="hidden"){return false}e=e&&e=="left"?"scrollLeft":"scrollTop";var h=false;if(g[e]>0){return true}g[e]=1;h=g[e]>0;g[e]=0;return h},isOverAxis:function(g,e,h){return g>e&&g<e+h},isOver:function(j,h,o,n,l,k){return b.ui.isOverAxis(j,o,l)&&b.ui.isOverAxis(h,n,k)},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}});b.fn.extend({_focus:b.fn.focus,focus:function(g,e){return typeof g==="number"?this.each(function(){var h=this;setTimeout(function(){b(h).focus();e&&e.call(h)},g)}):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 e;e=b.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(b.curCSS(this,"position",1))&&/(auto|scroll)/.test(b.curCSS(this,"overflow",1)+b.curCSS(this,"overflow-y",1)+b.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(b.curCSS(this,"overflow",1)+b.curCSS(this,"overflow-y",1)+b.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!e.length?b(document):e},zIndex:function(g){if(g!==undefined){return this.css("zIndex",g)}if(this.length){g=b(this[0]);for(var e;g.length&&g[0]!==document;){e=g.css("position");if(e=="absolute"||e=="relative"||e=="fixed"){e=parseInt(g.css("zIndex"));if(!isNaN(e)&&e!=0){return e}}g=g.parent()}}return 0}});b.extend(b.expr[":"],{data:function(g,e,h){return !!b.data(g,h[3])},focusable:function(g){var e=g.nodeName.toLowerCase(),h=b.attr(g,"tabindex");return(/input|select|textarea|button|object/.test(e)?!g.disabled:"a"==e||"area"==e?g.href||!isNaN(h):!isNaN(h))&&!b(g)["area"==e?"parents":"closest"](":hidden").length},tabbable:function(g){var e=b.attr(g,"tabindex");return(isNaN(e)||e>=0)&&b(g).is(":focusable")}})}})(jQuery);
/*
 * jQuery UI Widget 1.8.2
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Widget
 */
(function(e){var g=e.fn.remove;e.fn.remove=function(b,h){return this.each(function(){if(!h){if(!b||e.filter(b,[this]).length){e("*",this).add(this).each(function(){e(this).triggerHandler("remove")})}}return g.call(e(this),b,h)})};e.widget=function(b,l,k){var j=b.split(".")[0],h;b=b.split(".")[1];h=j+"-"+b;if(!k){k=l;l=e.Widget}e.expr[":"][h]=function(n){return !!e.data(n,b)};e[j]=e[j]||{};e[j][b]=function(n,o){arguments.length&&this._createWidget(n,o)};l=new l;l.options=e.extend({},l.options);e[j][b].prototype=e.extend(true,l,{namespace:j,widgetName:b,widgetEventPrefix:e[j][b].prototype.widgetEventPrefix||b,widgetBaseClass:h},k);e.widget.bridge(b,e[j][b])};e.widget.bridge=function(b,h){e.fn[b]=function(n){var l=typeof n==="string",k=Array.prototype.slice.call(arguments,1),j=this;n=!l&&k.length?e.extend.apply(null,[true,n].concat(k)):n;if(l&&n.substring(0,1)==="_"){return j}l?this.each(function(){var q=e.data(this,b),o=q&&e.isFunction(q[n])?q[n].apply(q,k):q;if(o!==q&&o!==undefined){j=o;return false}}):this.each(function(){var o=e.data(this,b);if(o){n&&o.option(n);o._init()}else{e.data(this,b,new h(n,this))}});return j}};e.Widget=function(b,h){arguments.length&&this._createWidget(b,h)};e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(b,j){this.element=e(j).data(this.widgetName,this);this.options=e.extend(true,{},this.options,e.metadata&&e.metadata.get(j)[this.widgetName],b);var h=this;this.element.bind("remove."+this.widgetName,function(){h.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 j=b,h=this;if(arguments.length===0){return e.extend({},h.options)}if(typeof b==="string"){if(k===undefined){return this.options[b]}j={};j[b]=k}e.each(j,function(n,l){h._setOption(n,l)});return h},_setOption:function(b,h){this.options[b]=h;if(b==="disabled"){this.widget()[h?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",h)}return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(b,l,k){var j=this.options[b];l=e.Event(l);l.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase();k=k||{};if(l.originalEvent){b=e.event.props.length;for(var h;b;){h=e.event.props[--b];l[h]=l.originalEvent[h]}}this.element.trigger(l,k);return !(e.isFunction(j)&&j.call(this.element[0],l,k)===false||l.isDefaultPrevented())}}})(jQuery);
/*
 * jQuery UI Mouse 1.8.2
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Mouse
 *
 * Depends:
 *	jquery.ui.widget.js
 */
(function(b){b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.bind("mousedown."+this.widgetName,function(g){return e._mouseDown(g)}).bind("click."+this.widgetName,function(g){if(e._preventClickEvent){e._preventClickEvent=false;g.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(h){h.originalEvent=h.originalEvent||{};if(!h.originalEvent.mouseHandled){this._mouseStarted&&this._mouseUp(h);this._mouseDownEvent=h;var g=this,k=h.which==1,j=typeof this.options.cancel=="string"?b(h.target).parents().add(h.target).filter(this.options.cancel).length:false;if(!k||j||!this._mouseCapture(h)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){g.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(h)&&this._mouseDelayMet(h)){this._mouseStarted=this._mouseStart(h)!==false;if(!this._mouseStarted){h.preventDefault();return true}}this._mouseMoveDelegate=function(e){return g._mouseMove(e)};this._mouseUpDelegate=function(e){return g._mouseUp(e)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);b.browser.safari||h.preventDefault();return h.originalEvent.mouseHandled=true}},_mouseMove:function(e){if(b.browser.msie&&!e.button){return this._mouseUp(e)}if(this._mouseStarted){this._mouseDrag(e);return e.preventDefault()}if(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)){(this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==false)?this._mouseDrag(e):this._mouseUp(e)}return !this._mouseStarted},_mouseUp:function(e){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=e.target==this._mouseDownEvent.target;this._mouseStop(e)}return false},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery);(function(j){j.ui=j.ui||{};var b=/left|center|right/,h=/top|center|bottom/,g=j.fn.position,e=j.fn.offset;j.fn.position=function(l){if(!l||!l.of){return g.apply(this,arguments)}l=j.extend({},l);var k=j(l.of),w=(l.collision||"flip").split(" "),v=l.offset?l.offset.split(" "):[0,0],q,o,n;if(l.of.nodeType===9){q=k.width();o=k.height();n={top:0,left:0}}else{if(l.of.scrollTo&&l.of.document){q=k.width();o=k.height();n={top:k.scrollTop(),left:k.scrollLeft()}}else{if(l.of.preventDefault){l.at="left top";q=o=0;n={top:l.of.pageY,left:l.of.pageX}}else{q=k.outerWidth();o=k.outerHeight();n=k.offset()}}}j.each(["my","at"],function(){var x=(l[this]||"").split(" ");if(x.length===1){x=b.test(x[0])?x.concat(["center"]):h.test(x[0])?["center"].concat(x):["center","center"]}x[0]=b.test(x[0])?x[0]:"center";x[1]=h.test(x[1])?x[1]:"center";l[this]=x});if(w.length===1){w[1]=w[0]}v[0]=parseInt(v[0],10)||0;if(v.length===1){v[1]=v[0]}v[1]=parseInt(v[1],10)||0;if(l.at[0]==="right"){n.left+=q}else{if(l.at[0]==="center"){n.left+=q/2}}if(l.at[1]==="bottom"){n.top+=o}else{if(l.at[1]==="center"){n.top+=o/2}}n.left+=v[0];n.top+=v[1];return this.each(function(){var A=j(this),y=A.outerWidth(),x=A.outerHeight(),z=j.extend({},n);if(l.my[0]==="right"){z.left-=y}else{if(l.my[0]==="center"){z.left-=y/2}}if(l.my[1]==="bottom"){z.top-=x}else{if(l.my[1]==="center"){z.top-=x/2}}z.left=parseInt(z.left);z.top=parseInt(z.top);j.each(["left","top"],function(C,B){j.ui.position[w[C]]&&j.ui.position[w[C]][B](z,{targetWidth:q,targetHeight:o,elemWidth:y,elemHeight:x,offset:v,my:l.my,at:l.at})});j.fn.bgiframe&&A.bgiframe();A.offset(j.extend(z,{using:l.using}))})};j.ui.position={fit:{left:function(l,k){var n=j(window);k=l.left+k.elemWidth-n.width()-n.scrollLeft();l.left=k>0?l.left-k:Math.max(0,l.left)},top:function(l,k){var n=j(window);k=l.top+k.elemHeight-n.height()-n.scrollTop();l.top=k>0?l.top-k:Math.max(0,l.top)}},flip:{left:function(l,k){if(k.at[0]!=="center"){var q=j(window);q=l.left+k.elemWidth-q.width()-q.scrollLeft();var o=k.my[0]==="left"?-k.elemWidth:k.my[0]==="right"?k.elemWidth:0,n=-2*k.offset[0];l.left+=l.left<0?o+k.targetWidth+n:q>0?o-k.targetWidth+n:0}},top:function(l,k){if(k.at[1]!=="center"){var v=j(window);v=l.top+k.elemHeight-v.height()-v.scrollTop();var q=k.my[1]==="top"?-k.elemHeight:k.my[1]==="bottom"?k.elemHeight:0,o=k.at[1]==="top"?k.targetHeight:-k.targetHeight,n=-2*k.offset[1];l.top+=l.top<0?q+k.targetHeight+n:v>0?q+o+n:0}}}};if(!j.offset.setOffset){j.offset.setOffset=function(l,k){if(/static/.test(j.curCSS(l,"position"))){l.style.position="relative"}var v=j(l),q=v.offset(),o=parseInt(j.curCSS(l,"top",true),10)||0,n=parseInt(j.curCSS(l,"left",true),10)||0;q={top:k.top-q.top+o,left:k.left-q.left+n};"using" in k?k.using.call(l,q):v.css(q)};j.fn.offset=function(l){var k=this[0];if(!k||!k.ownerDocument){return null}if(l){return this.each(function(){j.offset.setOffset(this,l)})}return e.call(this)}}})(jQuery);(function(b){b.widget("ui.draggable",b.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))){this.element[0].style.position="relative"}this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(g){var e=this.options;if(this.helper||e.disabled||b(g.target).is(".ui-resizable-handle")){return false}this.handle=this._getHandle(g);if(!this.handle){return false}return true},_mouseStart:function(g){var e=this.options;this.helper=this._createHelper(g);this._cacheHelperProportions();if(b.ui.ddmanager){b.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};b.extend(this.offset,{click:{left:g.pageX-this.offset.left,top:g.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(g);this.originalPageX=g.pageX;this.originalPageY=g.pageY;e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt);e.containment&&this._setContainment();if(this._trigger("start",g)===false){this._clear();return false}this._cacheHelperProportions();b.ui.ddmanager&&!e.dropBehaviour&&b.ui.ddmanager.prepareOffsets(this,g);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(g,true);return true},_mouseDrag:function(g,e){this.position=this._generatePosition(g);this.positionAbs=this._convertPositionTo("absolute");if(!e){e=this._uiHash();if(this._trigger("drag",g,e)===false){this._mouseUp({});return false}this.position=e.position}if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}b.ui.ddmanager&&b.ui.ddmanager.drag(this,g);return false},_mouseStop:function(g){var e=false;if(b.ui.ddmanager&&!this.options.dropBehaviour){e=b.ui.ddmanager.drop(this,g)}if(this.dropped){e=this.dropped;this.dropped=false}if(!this.element[0]||!this.element[0].parentNode){return false}if(this.options.revert=="invalid"&&!e||this.options.revert=="valid"&&e||this.options.revert===true||b.isFunction(this.options.revert)&&this.options.revert.call(this.element,e)){var h=this;b(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){h._trigger("stop",g)!==false&&h._clear()})}else{this._trigger("stop",g)!==false&&this._clear()}return false},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(g){var e=!this.options.handle||!b(this.options.handle,this.element).length?true:false;b(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==g.target){e=true}});return e},_createHelper:function(g){var e=this.options;g=b.isFunction(e.helper)?b(e.helper.apply(this.element[0],[g])):e.helper=="clone"?this.element.clone():this.element;g.parents("body").length||g.appendTo(e.appendTo=="parent"?this.element[0].parentNode:e.appendTo);g[0]!=this.element[0]&&!/(fixed|absolute)/.test(g.css("position"))&&g.css("position","absolute");return g},_adjustOffsetFromHelper:function(e){if(typeof e=="string"){e=e.split(" ")}if(b.isArray(e)){e={left:+e[0],top:+e[1]||0}}if("left" in e){this.offset.click.left=e.left+this.margins.left}if("right" in e){this.offset.click.left=this.helperProportions.width-e.right+this.margins.left}if("top" in e){this.offset.click.top=e.top+this.margins.top}if("bottom" in e){this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&b.ui.contains(this.scrollParent[0],this.offsetParent[0])){e.left+=this.scrollParent.scrollLeft();e.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&b.browser.msie){e={top:0,left:0}}return{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var e=this.element.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var g=this.options;if(g.containment=="parent"){g.containment=this.helper[0].parentNode}if(g.containment=="document"||g.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,b(g.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(b(g.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!/^(document|window|parent)$/.test(g.containment)&&g.containment.constructor!=Array){var e=b(g.containment)[0];if(e){g=b(g.containment).offset();var h=b(e).css("overflow")!="hidden";this.containment=[g.left+(parseInt(b(e).css("borderLeftWidth"),10)||0)+(parseInt(b(e).css("paddingLeft"),10)||0)-this.margins.left,g.top+(parseInt(b(e).css("borderTopWidth"),10)||0)+(parseInt(b(e).css("paddingTop"),10)||0)-this.margins.top,g.left+(h?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(b(e).css("borderLeftWidth"),10)||0)-(parseInt(b(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,g.top+(h?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(b(e).css("borderTopWidth"),10)||0)-(parseInt(b(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}}else{if(g.containment.constructor==Array){this.containment=g.containment}}},_convertPositionTo:function(g,e){if(!e){e=this.position}g=g=="absolute"?1:-1;var j=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&b.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,h=/(html|body)/i.test(j[0].tagName);return{top:e.top+this.offset.relative.top*g+this.offset.parent.top*g-(b.browser.safari&&b.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():h?0:j.scrollTop())*g),left:e.left+this.offset.relative.left*g+this.offset.parent.left*g-(b.browser.safari&&b.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():h?0:j.scrollLeft())*g)}},_generatePosition:function(j){var h=this.options,o=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&b.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,l=/(html|body)/i.test(o[0].tagName),n=j.pageX,k=j.pageY;if(this.originalPosition){if(this.containment){if(j.pageX-this.offset.click.left<this.containment[0]){n=this.containment[0]+this.offset.click.left}if(j.pageY-this.offset.click.top<this.containment[1]){k=this.containment[1]+this.offset.click.top}if(j.pageX-this.offset.click.left>this.containment[2]){n=this.containment[2]+this.offset.click.left}if(j.pageY-this.offset.click.top>this.containment[3]){k=this.containment[3]+this.offset.click.top}}if(h.grid){k=this.originalPageY+Math.round((k-this.originalPageY)/h.grid[1])*h.grid[1];k=this.containment?!(k-this.offset.click.top<this.containment[1]||k-this.offset.click.top>this.containment[3])?k:!(k-this.offset.click.top<this.containment[1])?k-h.grid[1]:k+h.grid[1]:k;n=this.originalPageX+Math.round((n-this.originalPageX)/h.grid[0])*h.grid[0];n=this.containment?!(n-this.offset.click.left<this.containment[0]||n-this.offset.click.left>this.containment[2])?n:!(n-this.offset.click.left<this.containment[0])?n-h.grid[0]:n+h.grid[0]:n}}return{top:k-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(b.browser.safari&&b.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():l?0:o.scrollTop()),left:n-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(b.browser.safari&&b.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():l?0:o.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove();this.helper=null;this.cancelHelperRemoval=false},_trigger:function(g,e,h){h=h||this._uiHash();b.ui.plugin.call(this,g,[e,h]);if(g=="drag"){this.positionAbs=this._convertPositionTo("absolute")}return b.Widget.prototype._trigger.call(this,g,e,h)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});b.extend(b.ui.draggable,{version:"1.8.2"});b.ui.plugin.add("draggable","connectToSortable",{start:function(h,g){var l=b(this).data("draggable"),j=l.options,k=b.extend({},g,{item:l.element});l.sortables=[];b(j.connectToSortable).each(function(){var e=b.data(this,"sortable");if(e&&!e.options.disabled){l.sortables.push({instance:e,shouldRevert:e.options.revert});e._refreshItems();e._trigger("activate",h,k)}})},stop:function(g,e){var j=b(this).data("draggable"),h=b.extend({},e,{item:j.element});b.each(j.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;j.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert){this.instance.options.revert=true}this.instance._mouseStop(g);this.instance.options.helper=this.instance.options._helper;j.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",g,h)}})},drag:function(g,e){var j=b(this).data("draggable"),h=this;b.each(j.sortables,function(){this.instance.positionAbs=j.positionAbs;this.instance.helperProportions=j.helperProportions;this.instance.offset.click=j.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=b(h).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return e.helper[0]};g.target=this.instance.currentItem[0];this.instance._mouseCapture(g,true);this.instance._mouseStart(g,true,true);this.instance.offset.click.top=j.offset.click.top;this.instance.offset.click.left=j.offset.click.left;this.instance.offset.parent.left-=j.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=j.offset.parent.top-this.instance.offset.parent.top;j._trigger("toSortable",g);j.dropped=this.instance.element;j.currentItem=j.element;this.instance.fromOutside=j}this.instance.currentItem&&this.instance._mouseDrag(g)}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",g,this.instance._uiHash(this.instance));this.instance._mouseStop(g,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();this.instance.placeholder&&this.instance.placeholder.remove();j._trigger("fromSortable",g);j.dropped=false}}})}});b.ui.plugin.add("draggable","cursor",{start:function(){var g=b("body"),e=b(this).data("draggable").options;if(g.css("cursor")){e._cursor=g.css("cursor")}g.css("cursor",e.cursor)},stop:function(){var e=b(this).data("draggable").options;e._cursor&&b("body").css("cursor",e._cursor)}});b.ui.plugin.add("draggable","iframeFix",{start:function(){var e=b(this).data("draggable").options;b(e.iframeFix===true?"iframe":e.iframeFix).each(function(){b('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(b(this).offset()).appendTo("body")})},stop:function(){b("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});b.ui.plugin.add("draggable","opacity",{start:function(g,e){g=b(e.helper);e=b(this).data("draggable").options;if(g.css("opacity")){e._opacity=g.css("opacity")}g.css("opacity",e.opacity)},stop:function(g,e){g=b(this).data("draggable").options;g._opacity&&b(e.helper).css("opacity",g._opacity)}});b.ui.plugin.add("draggable","scroll",{start:function(){var e=b(this).data("draggable");if(e.scrollParent[0]!=document&&e.scrollParent[0].tagName!="HTML"){e.overflowOffset=e.scrollParent.offset()}},drag:function(g){var e=b(this).data("draggable"),j=e.options,h=false;if(e.scrollParent[0]!=document&&e.scrollParent[0].tagName!="HTML"){if(!j.axis||j.axis!="x"){if(e.overflowOffset.top+e.scrollParent[0].offsetHeight-g.pageY<j.scrollSensitivity){e.scrollParent[0].scrollTop=h=e.scrollParent[0].scrollTop+j.scrollSpeed}else{if(g.pageY-e.overflowOffset.top<j.scrollSensitivity){e.scrollParent[0].scrollTop=h=e.scrollParent[0].scrollTop-j.scrollSpeed}}}if(!j.axis||j.axis!="y"){if(e.overflowOffset.left+e.scrollParent[0].offsetWidth-g.pageX<j.scrollSensitivity){e.scrollParent[0].scrollLeft=h=e.scrollParent[0].scrollLeft+j.scrollSpeed}else{if(g.pageX-e.overflowOffset.left<j.scrollSensitivity){e.scrollParent[0].scrollLeft=h=e.scrollParent[0].scrollLeft-j.scrollSpeed}}}}else{if(!j.axis||j.axis!="x"){if(g.pageY-b(document).scrollTop()<j.scrollSensitivity){h=b(document).scrollTop(b(document).scrollTop()-j.scrollSpeed)}else{if(b(window).height()-(g.pageY-b(document).scrollTop())<j.scrollSensitivity){h=b(document).scrollTop(b(document).scrollTop()+j.scrollSpeed)}}}if(!j.axis||j.axis!="y"){if(g.pageX-b(document).scrollLeft()<j.scrollSensitivity){h=b(document).scrollLeft(b(document).scrollLeft()-j.scrollSpeed)}else{if(b(window).width()-(g.pageX-b(document).scrollLeft())<j.scrollSensitivity){h=b(document).scrollLeft(b(document).scrollLeft()+j.scrollSpeed)}}}}h!==false&&b.ui.ddmanager&&!j.dropBehaviour&&b.ui.ddmanager.prepareOffsets(e,g)}});b.ui.plugin.add("draggable","snap",{start:function(){var g=b(this).data("draggable"),e=g.options;g.snapElements=[];b(e.snap.constructor!=String?e.snap.items||":data(draggable)":e.snap).each(function(){var j=b(this),h=j.offset();this!=g.element[0]&&g.snapElements.push({item:this,width:j.outerWidth(),height:j.outerHeight(),top:h.top,left:h.left})})},drag:function(N,M){for(var L=b(this).data("draggable"),J=L.options,K=J.snapTolerance,I=M.offset.left,B=I+L.helperProportions.width,C=M.offset.top,A=C+L.helperProportions.height,H=L.snapElements.length-1;H>=0;H--){var G=L.snapElements[H].left,E=G+L.snapElements[H].width,F=L.snapElements[H].top,D=F+L.snapElements[H].height;if(G-K<I&&I<E+K&&F-K<C&&C<D+K||G-K<I&&I<E+K&&F-K<A&&A<D+K||G-K<B&&B<E+K&&F-K<C&&C<D+K||G-K<B&&B<E+K&&F-K<A&&A<D+K){if(J.snapMode!="inner"){var z=Math.abs(F-A)<=K,y=Math.abs(D-C)<=K,x=Math.abs(G-B)<=K,w=Math.abs(E-I)<=K;if(z){M.position.top=L._convertPositionTo("relative",{top:F-L.helperProportions.height,left:0}).top-L.margins.top}if(y){M.position.top=L._convertPositionTo("relative",{top:D,left:0}).top-L.margins.top}if(x){M.position.left=L._convertPositionTo("relative",{top:0,left:G-L.helperProportions.width}).left-L.margins.left}if(w){M.position.left=L._convertPositionTo("relative",{top:0,left:E}).left-L.margins.left}}var v=z||y||x||w;if(J.snapMode!="outer"){z=Math.abs(F-C)<=K;y=Math.abs(D-A)<=K;x=Math.abs(G-I)<=K;w=Math.abs(E-B)<=K;if(z){M.position.top=L._convertPositionTo("relative",{top:F,left:0}).top-L.margins.top}if(y){M.position.top=L._convertPositionTo("relative",{top:D-L.helperProportions.height,left:0}).top-L.margins.top}if(x){M.position.left=L._convertPositionTo("relative",{top:0,left:G}).left-L.margins.left}if(w){M.position.left=L._convertPositionTo("relative",{top:0,left:E-L.helperProportions.width}).left-L.margins.left}}if(!L.snapElements[H].snapping&&(z||y||x||w||v)){L.options.snap.snap&&L.options.snap.snap.call(L.element,N,b.extend(L._uiHash(),{snapItem:L.snapElements[H].item}))}L.snapElements[H].snapping=z||y||x||w||v}else{L.snapElements[H].snapping&&L.options.snap.release&&L.options.snap.release.call(L.element,N,b.extend(L._uiHash(),{snapItem:L.snapElements[H].item}));L.snapElements[H].snapping=false}}}});b.ui.plugin.add("draggable","stack",{start:function(){var g=b(this).data("draggable").options;g=b.makeArray(b(g.stack)).sort(function(j,h){return(parseInt(b(j).css("zIndex"),10)||0)-(parseInt(b(h).css("zIndex"),10)||0)});if(g.length){var e=parseInt(g[0].style.zIndex)||0;b(g).each(function(h){this.style.zIndex=e+h});this[0].style.zIndex=e+g.length}}});b.ui.plugin.add("draggable","zIndex",{start:function(g,e){g=b(e.helper);e=b(this).data("draggable").options;if(g.css("zIndex")){e._zIndex=g.css("zIndex")}g.css("zIndex",e.zIndex)},stop:function(g,e){g=b(this).data("draggable").options;g._zIndex&&b(e.helper).css("zIndex",g._zIndex)}})})(jQuery);(function(g){g.widget("ui.resizable",g.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000},_create:function(){var h=this,j=this.options;this.element.addClass("ui-resizable");g.extend(this,{_aspectRatio:!!j.aspectRatio,aspectRatio:j.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:j.helper||j.ghost||j.animate?j.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){/relative/.test(this.element.css("position"))&&g.browser.opera&&this.element.css({position:"relative",top:"auto",left:"auto"});this.element.wrap(g('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=j.handles||(!g(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all"){this.handles="n,e,s,w,se,sw,ne,nw"}var o=this.handles.split(",");this.handles={};for(var n=0;n<o.length;n++){var k=g.trim(o[n]),l=g('<div class="ui-resizable-handle '+("ui-resizable-"+k)+'"></div>');/sw|se|ne|nw/.test(k)&&l.css({zIndex:++j.zIndex});"se"==k&&l.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[k]=".ui-resizable-"+k;this.element.append(l)}}this._renderAxis=function(x){x=x||this.element;for(var w in this.handles){if(this.handles[w].constructor==String){this.handles[w]=g(this.handles[w],this.element).show()}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var v=g(this.handles[w],this.element),q=0;q=/sw|ne|nw|se|n|s/.test(w)?v.outerHeight():v.outerWidth();v=["padding",/ne|nw|n/.test(w)?"Top":/se|sw|s/.test(w)?"Bottom":/^e$/.test(w)?"Right":"Left"].join("");x.css(v,q);this._proportionallyResize()}g(this.handles[w])}};this._renderAxis(this.element);this._handles=g(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!h.resizing){if(this.className){var q=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}h.axis=q&&q[1]?q[1]:"se"}});if(j.autoHide){this._handles.hide();g(this.element).addClass("ui-resizable-autohide").hover(function(){g(this).removeClass("ui-resizable-autohide");h._handles.show()},function(){if(!h.resizing){g(this).addClass("ui-resizable-autohide");h._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var h=function(k){g(k).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){h(this.element);var j=this.element;j.after(this.originalElement.css({position:j.css("position"),width:j.outerWidth(),height:j.outerHeight(),top:j.css("top"),left:j.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);h(this.originalElement);return this},_mouseCapture:function(h){var j=false;for(var k in this.handles){if(g(this.handles[k])[0]==h.target){j=true}}return !this.options.disabled&&j},_mouseStart:function(h){var j=this.options,n=this.element.position(),l=this.element;this.resizing=true;this.documentScroll={top:g(document).scrollTop(),left:g(document).scrollLeft()};if(l.is(".ui-draggable")||/absolute/.test(l.css("position"))){l.css({position:"absolute",top:n.top,left:n.left})}g.browser.opera&&/relative/.test(l.css("position"))&&l.css({position:"relative",top:"auto",left:"auto"});this._renderProxy();n=b(this.helper.css("left"));var k=b(this.helper.css("top"));if(j.containment){n+=g(j.containment).scrollLeft()||0;k+=g(j.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:n,top:k};this.size=this._helper?{width:l.outerWidth(),height:l.outerHeight()}:{width:l.width(),height:l.height()};this.originalSize=this._helper?{width:l.outerWidth(),height:l.outerHeight()}:{width:l.width(),height:l.height()};this.originalPosition={left:n,top:k};this.sizeDiff={width:l.outerWidth()-l.width(),height:l.outerHeight()-l.height()};this.originalMousePosition={left:h.pageX,top:h.pageY};this.aspectRatio=typeof j.aspectRatio=="number"?j.aspectRatio:this.originalSize.width/this.originalSize.height||1;j=g(".ui-resizable-"+this.axis).css("cursor");g("body").css("cursor",j=="auto"?this.axis+"-resize":j);l.addClass("ui-resizable-resizing");this._propagate("start",h);return true},_mouseDrag:function(h){var j=this.helper,l=this.originalMousePosition,k=this._change[this.axis];if(!k){return false}l=k.apply(this,[h,h.pageX-l.left||0,h.pageY-l.top||0]);if(this._aspectRatio||h.shiftKey){l=this._updateRatio(l,h)}l=this._respectSize(l,h);this._propagate("resize",h);j.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(l);this._trigger("resize",h,this.ui());return false},_mouseStop:function(h){this.resizing=false;var j=this.options,o=this;if(this._helper){var n=this._proportionallyResizeElements,k=n.length&&/textarea/i.test(n[0].nodeName);n=k&&g.ui.hasScroll(n[0],"left")?0:o.sizeDiff.height;k={width:o.size.width-(k?0:o.sizeDiff.width),height:o.size.height-n};n=parseInt(o.element.css("left"),10)+(o.position.left-o.originalPosition.left)||null;var l=parseInt(o.element.css("top"),10)+(o.position.top-o.originalPosition.top)||null;j.animate||this.element.css(g.extend(k,{top:l,left:n}));o.helper.height(o.size.height);o.helper.width(o.size.width);this._helper&&!j.animate&&this._proportionallyResize()}g("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",h);this._helper&&this.helper.remove();return false},_updateCache:function(h){this.offset=this.helper.offset();if(e(h.left)){this.position.left=h.left}if(e(h.top)){this.position.top=h.top}if(e(h.height)){this.size.height=h.height}if(e(h.width)){this.size.width=h.width}},_updateRatio:function(h){var j=this.position,l=this.size,k=this.axis;if(h.height){h.width=l.height*this.aspectRatio}else{if(h.width){h.height=l.width/this.aspectRatio}}if(k=="sw"){h.left=j.left+(l.width-h.width);h.top=null}if(k=="nw"){h.top=j.top+(l.height-h.height);h.left=j.left+(l.width-h.width)}return h},_respectSize:function(z){var A=this.options,y=this.axis,x=e(z.width)&&A.maxWidth&&A.maxWidth<z.width,v=e(z.height)&&A.maxHeight&&A.maxHeight<z.height,w=e(z.width)&&A.minWidth&&A.minWidth>z.width,q=e(z.height)&&A.minHeight&&A.minHeight>z.height;if(w){z.width=A.minWidth}if(q){z.height=A.minHeight}if(x){z.width=A.maxWidth}if(v){z.height=A.maxHeight}var o=this.originalPosition.left+this.originalSize.width,n=this.position.top+this.size.height,k=/sw|nw|w/.test(y);y=/nw|ne|n/.test(y);if(w&&k){z.left=o-A.minWidth}if(x&&k){z.left=o-A.maxWidth}if(q&&y){z.top=n-A.minHeight}if(v&&y){z.top=n-A.maxHeight}if((A=!z.width&&!z.height)&&!z.left&&z.top){z.top=null}else{if(A&&!z.top&&z.left){z.left=null}}return z},_proportionallyResize:function(){if(this._proportionallyResizeElements.length){for(var h=this.helper||this.element,j=0;j<this._proportionallyResizeElements.length;j++){var n=this._proportionallyResizeElements[j];if(!this.borderDif){var l=[n.css("borderTopWidth"),n.css("borderRightWidth"),n.css("borderBottomWidth"),n.css("borderLeftWidth")],k=[n.css("paddingTop"),n.css("paddingRight"),n.css("paddingBottom"),n.css("paddingLeft")];this.borderDif=g.map(l,function(q,o){q=parseInt(q,10)||0;o=parseInt(k[o],10)||0;return q+o})}g.browser.msie&&(g(h).is(":hidden")||g(h).parents(":hidden").length)||n.css({height:h.height()-this.borderDif[0]-this.borderDif[2]||0,width:h.width()-this.borderDif[1]-this.borderDif[3]||0})}}},_renderProxy:function(){var h=this.options;this.elementOffset=this.element.offset();if(this._helper){this.helper=this.helper||g('<div style="overflow:hidden;"></div>');var j=g.browser.msie&&g.browser.version<7,k=j?1:0;j=j?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+j,height:this.element.outerHeight()+j,position:"absolute",left:this.elementOffset.left-k+"px",top:this.elementOffset.top-k+"px",zIndex:++h.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(h,j){return{width:this.originalSize.width+j}},w:function(h,j){return{left:this.originalPosition.left+j,width:this.originalSize.width-j}},n:function(h,j,k){return{top:this.originalPosition.top+k,height:this.originalSize.height-k}},s:function(h,j,k){return{height:this.originalSize.height+k}},se:function(h,j,k){return g.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[h,j,k]))},sw:function(h,j,k){return g.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[h,j,k]))},ne:function(h,j,k){return g.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[h,j,k]))},nw:function(h,j,k){return g.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[h,j,k]))}},_propagate:function(h,j){g.ui.plugin.call(this,h,[j,this.ui()]);h!="resize"&&this._trigger(h,j,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});g.extend(g.ui.resizable,{version:"1.8.2"});g.ui.plugin.add("resizable","alsoResize",{start:function(){var h=g(this).data("resizable").options,j=function(k){g(k).each(function(){g(this).data("resizable-alsoresize",{width:parseInt(g(this).width(),10),height:parseInt(g(this).height(),10),left:parseInt(g(this).css("left"),10),top:parseInt(g(this).css("top"),10)})})};if(typeof h.alsoResize=="object"&&!h.alsoResize.parentNode){if(h.alsoResize.length){h.alsoResize=h.alsoResize[0];j(h.alsoResize)}else{g.each(h.alsoResize,function(k){j(k)})}}else{j(h.alsoResize)}},resize:function(){var h=g(this).data("resizable"),j=h.options,o=h.originalSize,n=h.originalPosition,k={height:h.size.height-o.height||0,width:h.size.width-o.width||0,top:h.position.top-n.top||0,left:h.position.left-n.left||0},l=function(v,q){g(v).each(function(){var x=g(this),w=g(this).data("resizable-alsoresize"),y={};g.each((q&&q.length?q:["width","height","top","left"])||["width","height","top","left"],function(A,z){if((A=(w[z]||0)+(k[z]||0))&&A>=0){y[z]=A||null}});if(/relative/.test(x.css("position"))&&g.browser.opera){h._revertToRelativePosition=true;x.css({position:"absolute",top:"auto",left:"auto"})}x.css(y)})};typeof j.alsoResize=="object"&&!j.alsoResize.nodeType?g.each(j.alsoResize,function(v,q){l(v,q)}):l(j.alsoResize)},stop:function(){var h=g(this).data("resizable");if(h._revertToRelativePosition&&g.browser.opera){h._revertToRelativePosition=false;el.css({position:"relative"})}g(this).removeData("resizable-alsoresize-start")}});g.ui.plugin.add("resizable","animate",{stop:function(j){var k=g(this).data("resizable"),v=k.options,q=k._proportionallyResizeElements,n=q.length&&/textarea/i.test(q[0].nodeName),o=n&&g.ui.hasScroll(q[0],"left")?0:k.sizeDiff.height;n={width:k.size.width-(n?0:k.sizeDiff.width),height:k.size.height-o};o=parseInt(k.element.css("left"),10)+(k.position.left-k.originalPosition.left)||null;var l=parseInt(k.element.css("top"),10)+(k.position.top-k.originalPosition.top)||null;k.element.animate(g.extend(n,l&&o?{top:l,left:o}:{}),{duration:v.animateDuration,easing:v.animateEasing,step:function(){var h={width:parseInt(k.element.css("width"),10),height:parseInt(k.element.css("height"),10),top:parseInt(k.element.css("top"),10),left:parseInt(k.element.css("left"),10)};q&&q.length&&g(q[0]).css({width:h.width,height:h.height});k._updateCache(h);k._propagate("resize",j)}})}});g.ui.plugin.add("resizable","containment",{start:function(){var j=g(this).data("resizable"),k=j.element,v=j.options.containment;if(k=v instanceof g?v.get(0):/parent/.test(v)?k.parent().get(0):v){j.containerElement=g(k);if(/document/.test(v)||v==document){j.containerOffset={left:0,top:0};j.containerPosition={left:0,top:0};j.parentData={element:g(document),left:0,top:0,width:g(document).width(),height:g(document).height()||document.body.parentNode.scrollHeight}}else{var q=g(k),n=[];g(["Top","Right","Left","Bottom"]).each(function(w,h){n[w]=b(q.css("padding"+h))});j.containerOffset=q.offset();j.containerPosition=q.position();j.containerSize={height:q.innerHeight()-n[3],width:q.innerWidth()-n[1]};v=j.containerOffset;var o=j.containerSize.height,l=j.containerSize.width;l=g.ui.hasScroll(k,"left")?k.scrollWidth:l;o=g.ui.hasScroll(k)?k.scrollHeight:o;j.parentData={element:k,left:v.left,top:v.top,width:l,height:o}}}},resize:function(j){var k=g(this).data("resizable"),v=k.options,q=k.containerOffset,n=k.position;j=k._aspectRatio||j.shiftKey;var o={top:0,left:0},l=k.containerElement;if(l[0]!=document&&/static/.test(l.css("position"))){o=q}if(n.left<(k._helper?q.left:0)){k.size.width+=k._helper?k.position.left-q.left:k.position.left-o.left;if(j){k.size.height=k.size.width/v.aspectRatio}k.position.left=v.helper?q.left:0}if(n.top<(k._helper?q.top:0)){k.size.height+=k._helper?k.position.top-q.top:k.position.top;if(j){k.size.width=k.size.height*v.aspectRatio}k.position.top=k._helper?q.top:0}k.offset.left=k.parentData.left+k.position.left;k.offset.top=k.parentData.top+k.position.top;v=Math.abs((k._helper?k.offset.left-o.left:k.offset.left-o.left)+k.sizeDiff.width);q=Math.abs((k._helper?k.offset.top-o.top:k.offset.top-q.top)+k.sizeDiff.height);n=k.containerElement.get(0)==k.element.parent().get(0);o=/relative|absolute/.test(k.containerElement.css("position"));if(n&&o){v-=k.parentData.left}if(v+k.size.width>=k.parentData.width){k.size.width=k.parentData.width-v;if(j){k.size.height=k.size.width/k.aspectRatio}}if(q+k.size.height>=k.parentData.height){k.size.height=k.parentData.height-q;if(j){k.size.width=k.size.height*k.aspectRatio}}},stop:function(){var j=g(this).data("resizable"),k=j.options,w=j.containerOffset,v=j.containerPosition,o=j.containerElement,q=g(j.helper),n=q.offset(),l=q.outerWidth()-j.sizeDiff.width;q=q.outerHeight()-j.sizeDiff.height;j._helper&&!k.animate&&/relative/.test(o.css("position"))&&g(this).css({left:n.left-v.left-w.left,width:l,height:q});j._helper&&!k.animate&&/static/.test(o.css("position"))&&g(this).css({left:n.left-v.left-w.left,width:l,height:q})}});g.ui.plugin.add("resizable","ghost",{start:function(){var h=g(this).data("resizable"),j=h.options,k=h.size;h.ghost=h.originalElement.clone();h.ghost.css({opacity:0.25,display:"block",position:"relative",height:k.height,width:k.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof j.ghost=="string"?j.ghost:"");h.ghost.appendTo(h.helper)},resize:function(){var h=g(this).data("resizable");h.ghost&&h.ghost.css({position:"relative",height:h.size.height,width:h.size.width})},stop:function(){var h=g(this).data("resizable");h.ghost&&h.helper&&h.helper.get(0).removeChild(h.ghost.get(0))}});g.ui.plugin.add("resizable","grid",{resize:function(){var j=g(this).data("resizable"),k=j.options,v=j.size,q=j.originalSize,n=j.originalPosition,o=j.axis;k.grid=typeof k.grid=="number"?[k.grid,k.grid]:k.grid;var l=Math.round((v.width-q.width)/(k.grid[0]||1))*(k.grid[0]||1);k=Math.round((v.height-q.height)/(k.grid[1]||1))*(k.grid[1]||1);if(/^(se|s|e)$/.test(o)){j.size.width=q.width+l;j.size.height=q.height+k}else{if(/^(ne)$/.test(o)){j.size.width=q.width+l;j.size.height=q.height+k;j.position.top=n.top-k}else{if(/^(sw)$/.test(o)){j.size.width=q.width+l;j.size.height=q.height+k}else{j.size.width=q.width+l;j.size.height=q.height+k;j.position.top=n.top-k}j.position.left=n.left-l}}}});var b=function(h){return parseInt(h,10)||0},e=function(h){return !isNaN(parseInt(h,10))}})(jQuery);(function(b){b.widget("ui.selectable",b.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var e=this;this.element.addClass("ui-selectable");this.dragged=false;var g;this.refresh=function(){g=b(e.options.filter,e.element[0]);g.each(function(){var h=b(this);var j=h.offset();b.data(this,"selectable-item",{element:this,$element:h,left:j.left,top:j.top,right:j.left+h.outerWidth(),bottom:j.top+h.outerHeight(),startselected:false,selected:h.hasClass("ui-selected"),selecting:h.hasClass("ui-selecting"),unselecting:h.hasClass("ui-unselecting")})})};this.refresh();this.selectees=g.addClass("ui-selectee");this._mouseInit();this.helper=b("<div class='ui-selectable-helper'></div>")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(h){var e=this;this.opos=[h.pageX,h.pageY];if(this.options.disabled){return}var g=this.options;this.selectees=b(g.filter,this.element[0]);this._trigger("start",h);b(g.appendTo).append(this.helper);this.helper.css({"z-index":100,position:"absolute",left:h.clientX,top:h.clientY,width:0,height:0});if(g.autoRefresh){this.refresh()}this.selectees.filter(".ui-selected").each(function(){var j=b.data(this,"selectable-item");j.startselected=true;if(!h.metaKey){j.$element.removeClass("ui-selected");j.selected=false;j.$element.addClass("ui-unselecting");j.unselecting=true;e._trigger("unselecting",h,{unselecting:j.element})}});b(h.target).parents().andSelf().each(function(){var k=b.data(this,"selectable-item");if(k){var j=!h.metaKey||!k.$element.hasClass("ui-selected");k.$element.removeClass(j?"ui-unselecting":"ui-selected").addClass(j?"ui-selecting":"ui-unselecting");k.unselecting=!j;k.selecting=j;k.selected=j;if(j){e._trigger("selecting",h,{selecting:k.element})}else{e._trigger("unselecting",h,{unselecting:k.element})}return false}})},_mouseDrag:function(o){var g=this;this.dragged=true;if(this.options.disabled){return}var j=this.options;var h=this.opos[0],n=this.opos[1],e=o.pageX,l=o.pageY;if(h>e){var k=e;e=h;h=k}if(n>l){var k=l;l=n;n=k}this.helper.css({left:h,top:n,width:e-h,height:l-n});this.selectees.each(function(){var q=b.data(this,"selectable-item");if(!q||q.element==g.element[0]){return}var v=false;if(j.tolerance=="touch"){v=(!(q.left>e||q.right<h||q.top>l||q.bottom<n))}else{if(j.tolerance=="fit"){v=(q.left>h&&q.right<e&&q.top>n&&q.bottom<l)}}if(v){if(q.selected){q.$element.removeClass("ui-selected");q.selected=false}if(q.unselecting){q.$element.removeClass("ui-unselecting");q.unselecting=false}if(!q.selecting){q.$element.addClass("ui-selecting");q.selecting=true;g._trigger("selecting",o,{selecting:q.element})}}else{if(q.selecting){if(o.metaKey&&q.startselected){q.$element.removeClass("ui-selecting");q.selecting=false;q.$element.addClass("ui-selected");q.selected=true}else{q.$element.removeClass("ui-selecting");q.selecting=false;if(q.startselected){q.$element.addClass("ui-unselecting");q.unselecting=true}g._trigger("unselecting",o,{unselecting:q.element})}}if(q.selected){if(!o.metaKey&&!q.startselected){q.$element.removeClass("ui-selected");q.selected=false;q.$element.addClass("ui-unselecting");q.unselecting=true;g._trigger("unselecting",o,{unselecting:q.element})}}}});return false},_mouseStop:function(h){var e=this;this.dragged=false;var g=this.options;b(".ui-unselecting",this.element[0]).each(function(){var j=b.data(this,"selectable-item");j.$element.removeClass("ui-unselecting");j.unselecting=false;j.startselected=false;e._trigger("unselected",h,{unselected:j.element})});b(".ui-selecting",this.element[0]).each(function(){var j=b.data(this,"selectable-item");j.$element.removeClass("ui-selecting").addClass("ui-selected");j.selecting=false;j.selected=true;j.startselected=true;e._trigger("selected",h,{selected:j.element})});this._trigger("stop",h);this.helper.remove();return false}});b.extend(b.ui.selectable,{version:"1.8.2"})})(jQuery);(function(b){b.widget("ui.selectable",b.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var g=this;this.element.addClass("ui-selectable");this.dragged=false;var e;this.refresh=function(){e=b(g.options.filter,g.element[0]);e.each(function(){var j=b(this),h=j.offset();b.data(this,"selectable-item",{element:this,$element:j,left:h.left,top:h.top,right:h.left+j.outerWidth(),bottom:h.top+j.outerHeight(),startselected:false,selected:j.hasClass("ui-selected"),selecting:j.hasClass("ui-selecting"),unselecting:j.hasClass("ui-unselecting")})})};this.refresh();this.selectees=e.addClass("ui-selectee");this._mouseInit();this.helper=b("<div class='ui-selectable-helper'></div>")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(h){var e=this;this.opos=[h.pageX,h.pageY];if(!this.options.disabled){var g=this.options;this.selectees=b(g.filter,this.element[0]);this._trigger("start",h);b(g.appendTo).append(this.helper);this.helper.css({"z-index":100,position:"absolute",left:h.clientX,top:h.clientY,width:0,height:0});g.autoRefresh&&this.refresh();this.selectees.filter(".ui-selected").each(function(){var j=b.data(this,"selectable-item");j.startselected=true;if(!h.metaKey){j.$element.removeClass("ui-selected");j.selected=false;j.$element.addClass("ui-unselecting");j.unselecting=true;e._trigger("unselecting",h,{unselecting:j.element})}});b(h.target).parents().andSelf().each(function(){var j=b.data(this,"selectable-item");if(j){var k=!h.metaKey||!j.$element.hasClass("ui-selected");j.$element.removeClass(k?"ui-unselecting":"ui-selected").addClass(k?"ui-selecting":"ui-unselecting");j.unselecting=!k;j.selecting=k;(j.selected=k)?e._trigger("selecting",h,{selecting:j.element}):e._trigger("unselecting",h,{unselecting:j.element});return false}})}},_mouseDrag:function(w){var q=this;this.dragged=true;if(!this.options.disabled){var v=this.options,e=this.opos[0],o=this.opos[1],n=w.pageX,l=w.pageY;if(e>n){var k=n;n=e;e=k}if(o>l){k=l;l=o;o=k}this.helper.css({left:e,top:o,width:n-e,height:l-o});this.selectees.each(function(){var g=b.data(this,"selectable-item");if(!(!g||g.element==q.element[0])){var h=false;if(v.tolerance=="touch"){h=!(g.left>n||g.right<e||g.top>l||g.bottom<o)}else{if(v.tolerance=="fit"){h=g.left>e&&g.right<n&&g.top>o&&g.bottom<l}}if(h){if(g.selected){g.$element.removeClass("ui-selected");g.selected=false}if(g.unselecting){g.$element.removeClass("ui-unselecting");g.unselecting=false}if(!g.selecting){g.$element.addClass("ui-selecting");g.selecting=true;q._trigger("selecting",w,{selecting:g.element})}}else{if(g.selecting){if(w.metaKey&&g.startselected){g.$element.removeClass("ui-selecting");g.selecting=false;g.$element.addClass("ui-selected");g.selected=true}else{g.$element.removeClass("ui-selecting");g.selecting=false;if(g.startselected){g.$element.addClass("ui-unselecting");g.unselecting=true}q._trigger("unselecting",w,{unselecting:g.element})}}if(g.selected){if(!w.metaKey&&!g.startselected){g.$element.removeClass("ui-selected");g.selected=false;g.$element.addClass("ui-unselecting");g.unselecting=true;q._trigger("unselecting",w,{unselecting:g.element})}}}}});return false}},_mouseStop:function(g){var e=this;this.dragged=false;b(".ui-unselecting",this.element[0]).each(function(){var h=b.data(this,"selectable-item");h.$element.removeClass("ui-unselecting");h.unselecting=false;h.startselected=false;e._trigger("unselected",g,{unselected:h.element})});b(".ui-selecting",this.element[0]).each(function(){var h=b.data(this,"selectable-item");h.$element.removeClass("ui-selecting").addClass("ui-selected");h.selecting=false;h.selected=true;h.startselected=true;e._trigger("selected",g,{selected:h.element})});this._trigger("stop",g);this.helper.remove();return false}});b.extend(b.ui.selectable,{version:"1.8.2"})})(jQuery);(function(b){var k,e=function(g){b(":ui-button",g.target.form).each(function(){var h=b(this).data("button");setTimeout(function(){h.refresh()},1)})},j=function(g){var n=g.name,l=g.form,h=b([]);if(n){h=l?b(l).find("[name='"+n+"']"):b("[name='"+n+"']",g.ownerDocument).filter(function(){return !this.form})}return h};b.widget("ui.button",{options:{text:true,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset.button").bind("reset.button",e);this._determineButtonType();this.hasTitle=!!this.buttonElement.attr("title");var g=this,n=this.options,l=this.type==="checkbox"||this.type==="radio",h="ui-state-hover"+(!l?" ui-state-active":"");if(n.label===null){n.label=this.buttonElement.html()}if(this.element.is(":disabled")){n.disabled=true}this.buttonElement.addClass("ui-button ui-widget ui-state-default ui-corner-all").attr("role","button").bind("mouseenter.button",function(){if(!n.disabled){b(this).addClass("ui-state-hover");this===k&&b(this).addClass("ui-state-active")}}).bind("mouseleave.button",function(){n.disabled||b(this).removeClass(h)}).bind("focus.button",function(){b(this).addClass("ui-state-focus")}).bind("blur.button",function(){b(this).removeClass("ui-state-focus")});l&&this.element.bind("change.button",function(){g.refresh()});if(this.type==="checkbox"){this.buttonElement.bind("click.button",function(){if(n.disabled){return false}b(this).toggleClass("ui-state-active");g.buttonElement.attr("aria-pressed",g.element[0].checked)})}else{if(this.type==="radio"){this.buttonElement.bind("click.button",function(){if(n.disabled){return false}b(this).addClass("ui-state-active");g.buttonElement.attr("aria-pressed",true);var o=g.element[0];j(o).not(o).map(function(){return b(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed",false)})}else{this.buttonElement.bind("mousedown.button",function(){if(n.disabled){return false}b(this).addClass("ui-state-active");k=this;b(document).one("mouseup",function(){k=null})}).bind("mouseup.button",function(){if(n.disabled){return false}b(this).removeClass("ui-state-active")}).bind("keydown.button",function(o){if(n.disabled){return false}if(o.keyCode==b.ui.keyCode.SPACE||o.keyCode==b.ui.keyCode.ENTER){b(this).addClass("ui-state-active")}}).bind("keyup.button",function(){b(this).removeClass("ui-state-active")});this.buttonElement.is("a")&&this.buttonElement.keyup(function(o){o.keyCode===b.ui.keyCode.SPACE&&b(this).click()})}}this._setOption("disabled",n.disabled)},_determineButtonType:function(){this.type=this.element.is(":checkbox")?"checkbox":this.element.is(":radio")?"radio":this.element.is("input")?"input":"button";if(this.type==="checkbox"||this.type==="radio"){this.buttonElement=this.element.parents().last().find("[for="+this.element.attr("id")+"]");this.element.addClass("ui-helper-hidden-accessible");var g=this.element.is(":checked");g&&this.buttonElement.addClass("ui-state-active");this.buttonElement.attr("aria-pressed",g)}else{this.buttonElement=this.element}},widget:function(){return this.buttonElement},destroy:function(){this.element.removeClass("ui-helper-hidden-accessible");this.buttonElement.removeClass("ui-button ui-widget ui-state-default ui-corner-all ui-state-hover ui-state-active  ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon ui-button-text-only").removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html());this.hasTitle||this.buttonElement.removeAttr("title");b.Widget.prototype.destroy.call(this)},_setOption:function(g,h){b.Widget.prototype._setOption.apply(this,arguments);if(g==="disabled"){h?this.element.attr("disabled",true):this.element.removeAttr("disabled")}this._resetButton()},refresh:function(){var g=this.element.is(":disabled");g!==this.options.disabled&&this._setOption("disabled",g);if(this.type==="radio"){j(this.element[0]).each(function(){b(this).is(":checked")?b(this).button("widget").addClass("ui-state-active").attr("aria-pressed",true):b(this).button("widget").removeClass("ui-state-active").attr("aria-pressed",false)})}else{if(this.type==="checkbox"){this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed",true):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed",false)}}},_resetButton:function(){if(this.type==="input"){this.options.label&&this.element.val(this.options.label)}else{var g=this.buttonElement.removeClass("ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon ui-button-text-only"),n=b("<span></span>").addClass("ui-button-text").html(this.options.label).appendTo(g.empty()).text(),l=this.options.icons,h=l.primary&&l.secondary;if(l.primary||l.secondary){g.addClass("ui-button-text-icon"+(h?"s":""));l.primary&&g.prepend("<span class='ui-button-icon-primary ui-icon "+l.primary+"'></span>");l.secondary&&g.append("<span class='ui-button-icon-secondary ui-icon "+l.secondary+"'></span>");if(!this.options.text){g.addClass(h?"ui-button-icons-only":"ui-button-icon-only").removeClass("ui-button-text-icons ui-button-text-icon");this.hasTitle||g.attr("title",n)}}else{g.addClass("ui-button-text-only")}}}});b.widget("ui.buttonset",{_create:function(){this.element.addClass("ui-buttonset");this._init()},_init:function(){this.refresh()},_setOption:function(g,h){g==="disabled"&&this.buttons.button("option",g,h);b.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){this.buttons=this.element.find(":button, :submit, :reset, :checkbox, :radio, a, :data(button)").filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return b(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass("ui-corner-left").end().filter(":last").addClass("ui-corner-right").end().end()},destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return b(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy");b.Widget.prototype.destroy.call(this)}})})(jQuery);(function(b){b.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:"center",resizable:true,show:null,stack:true,title:"",width:300,zIndex:1000},_create:function(){this.originalTitle=this.element.attr("title");var k=this,j=k.options,v=j.title||k.originalTitle||"&#160;",q=b.ui.dialog.getTitleId(k.element),n=(k.uiDialog=b("<div></div>")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+j.dialogClass).css({zIndex:j.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(e){if(j.closeOnEscape&&e.keyCode&&e.keyCode===b.ui.keyCode.ESCAPE){k.close(e);e.preventDefault()}}).attr({role:"dialog","aria-labelledby":q}).mousedown(function(e){k.moveToTop(false,e)});k.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(n);var o=(k.uiDialogTitlebar=b("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(n),l=b('<a href="#"></a>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){l.addClass("ui-state-hover")},function(){l.removeClass("ui-state-hover")}).focus(function(){l.addClass("ui-state-focus")}).blur(function(){l.removeClass("ui-state-focus")}).click(function(e){k.close(e);return false}).appendTo(o);(k.uiDialogTitlebarCloseText=b("<span></span>")).addClass("ui-icon ui-icon-closethick").text(j.closeText).appendTo(l);b("<span></span>").addClass("ui-dialog-title").attr("id",q).html(v).prependTo(o);if(b.isFunction(j.beforeclose)&&!b.isFunction(j.beforeClose)){j.beforeClose=j.beforeclose}o.find("*").add(o).disableSelection();j.draggable&&b.fn.draggable&&k._makeDraggable();j.resizable&&b.fn.resizable&&k._makeResizable();k._createButtons(j.buttons);k._isOpen=false;b.fn.bgiframe&&n.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var e=this;e.overlay&&e.overlay.destroy();e.uiDialog.hide();e.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");e.uiDialog.remove();e.originalTitle&&e.element.attr("title",e.originalTitle);return e},widget:function(){return this.uiDialog},close:function(g){var e=this,h;if(false!==e._trigger("beforeClose",g)){e.overlay&&e.overlay.destroy();e.uiDialog.unbind("keypress.ui-dialog");e._isOpen=false;if(e.options.hide){e.uiDialog.hide(e.options.hide,function(){e._trigger("close",g)})}else{e.uiDialog.hide();e._trigger("close",g)}b.ui.dialog.overlay.resize();if(e.options.modal){h=0;b(".ui-dialog").each(function(){if(this!==e.uiDialog[0]){h=Math.max(h,b(this).css("z-index"))}});b.ui.dialog.maxZ=h}return e}},isOpen:function(){return this._isOpen},moveToTop:function(h,g){var k=this,j=k.options;if(j.modal&&!h||!j.stack&&!j.modal){return k._trigger("focus",g)}if(j.zIndex>b.ui.dialog.maxZ){b.ui.dialog.maxZ=j.zIndex}if(k.overlay){b.ui.dialog.maxZ+=1;k.overlay.$el.css("z-index",b.ui.dialog.overlay.maxZ=b.ui.dialog.maxZ)}h={scrollTop:k.element.attr("scrollTop"),scrollLeft:k.element.attr("scrollLeft")};b.ui.dialog.maxZ+=1;k.uiDialog.css("z-index",b.ui.dialog.maxZ);k.element.attr(h);k._trigger("focus",g);return k},open:function(){if(!this._isOpen){var g=this,e=g.options,h=g.uiDialog;g.overlay=e.modal?new b.ui.dialog.overlay(g):null;h.next().length&&h.appendTo("body");g._size();g._position(e.position);h.show(e.show);g.moveToTop(true);e.modal&&h.bind("keypress.ui-dialog",function(l){if(l.keyCode===b.ui.keyCode.TAB){var j=b(":tabbable",this),k=j.filter(":first");j=j.filter(":last");if(l.target===j[0]&&!l.shiftKey){k.focus(1);return false}else{if(l.target===k[0]&&l.shiftKey){j.focus(1);return false}}}});b([]).add(h.find(".ui-dialog-content :tabbable:first")).add(h.find(".ui-dialog-buttonpane :tabbable:first")).add(h).filter(":first").focus();g._trigger("open");g._isOpen=true;return g}},_createButtons:function(h){var g=this,k=false,j=b("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix");g.uiDialog.find(".ui-dialog-buttonpane").remove();typeof h==="object"&&h!==null&&b.each(h,function(){return !(k=true)});if(k){b.each(h,function(e,l){e=b('<button type="button"></button>').text(e).click(function(){l.apply(g.element[0],arguments)}).appendTo(j);b.fn.button&&e.button()});j.appendTo(g.uiDialog)}},_makeDraggable:function(){function j(e){return{position:e.position,offset:e.offset}}var h=this,n=h.options,l=b(document),k;h.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(g,e){k=n.height==="auto"?"auto":b(this).height();b(this).height(b(this).height()).addClass("ui-dialog-dragging");h._trigger("dragStart",g,j(e))},drag:function(g,e){h._trigger("drag",g,j(e))},stop:function(g,e){n.position=[e.position.left-l.scrollLeft(),e.position.top-l.scrollTop()];b(this).removeClass("ui-dialog-dragging").height(k);h._trigger("dragStop",g,j(e));b.ui.dialog.overlay.resize()}})},_makeResizable:function(j){function h(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}j=j===undefined?this.options.resizable:j;var n=this,l=n.options,k=n.uiDialog.css("position");j=typeof j==="string"?j:"n,e,s,w,se,sw,ne,nw";n.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:n.element,maxWidth:l.maxWidth,maxHeight:l.maxHeight,minWidth:l.minWidth,minHeight:n._minHeight(),handles:j,start:function(g,e){b(this).addClass("ui-dialog-resizing");n._trigger("resizeStart",g,h(e))},resize:function(g,e){n._trigger("resize",g,h(e))},stop:function(g,e){b(this).removeClass("ui-dialog-resizing");l.height=b(this).height();l.width=b(this).width();n._trigger("resizeStop",g,h(e));b.ui.dialog.overlay.resize()}}).css("position",k).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var e=this.options;return e.height==="auto"?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(g){var e=[],h=[0,0];g=g||b.ui.dialog.prototype.options.position;if(typeof g==="string"||typeof g==="object"&&"0" in g){e=g.split?g.split(" "):[g[0],g[1]];if(e.length===1){e[1]=e[0]}b.each(["left","top"],function(k,j){if(+e[k]===e[k]){h[k]=e[k];e[k]=j}})}else{if(typeof g==="object"){if("left" in g){e[0]="left";h[0]=g.left}else{if("right" in g){e[0]="right";h[0]=-g.right}}if("top" in g){e[1]="top";h[1]=g.top}else{if("bottom" in g){e[1]="bottom";h[1]=-g.bottom}}}}(g=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position({my:e.join(" "),at:e.join(" "),offset:h.join(" "),of:window,collision:"fit",using:function(k){var j=b(this).css(k).offset().top;j<0&&b(this).css("top",k.top-j)}});g||this.uiDialog.hide()},_setOption:function(j,h){var o=this,n=o.uiDialog,k=n.is(":data(resizable)"),l=false;switch(j){case"beforeclose":j="beforeClose";break;case"buttons":o._createButtons(h);break;case"closeText":o.uiDialogTitlebarCloseText.text(""+h);break;case"dialogClass":n.removeClass(o.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+h);break;case"disabled":h?n.addClass("ui-dialog-disabled"):n.removeClass("ui-dialog-disabled");break;case"draggable":h?o._makeDraggable():n.draggable("destroy");break;case"height":l=true;break;case"maxHeight":k&&n.resizable("option","maxHeight",h);l=true;break;case"maxWidth":k&&n.resizable("option","maxWidth",h);l=true;break;case"minHeight":k&&n.resizable("option","minHeight",h);l=true;break;case"minWidth":k&&n.resizable("option","minWidth",h);l=true;break;case"position":o._position(h);break;case"resizable":k&&!h&&n.resizable("destroy");k&&typeof h==="string"&&n.resizable("option","handles",h);!k&&h!==false&&o._makeResizable(h);break;case"title":b(".ui-dialog-title",o.uiDialogTitlebar).html(""+(h||"&#160;"));break;case"width":l=true;break}b.Widget.prototype._setOption.apply(o,arguments);l&&o._size()},_size:function(){var g=this.options,e;this.element.css({width:"auto",minHeight:0,height:0});e=this.uiDialog.css({height:"auto",width:g.width}).height();this.element.css(g.height==="auto"?{minHeight:Math.max(g.minHeight-e,0),height:"auto"}:{minHeight:0,height:Math.max(g.height-e,0)}).show();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}});b.extend(b.ui.dialog,{version:"1.8.2",uuid:0,maxZ:0,getTitleId:function(e){e=e.attr("id");if(!e){this.uuid+=1;e=this.uuid}return"ui-dialog-title-"+e},overlay:function(e){this.$el=b.ui.dialog.overlay.create(e)}});b.extend(b.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:b.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(e){return e+".dialog-overlay"}).join(" "),create:function(g){if(this.instances.length===0){setTimeout(function(){b.ui.dialog.overlay.instances.length&&b(document).bind(b.ui.dialog.overlay.events,function(h){return b(h.target).zIndex()>=b.ui.dialog.overlay.maxZ})},1);b(document).bind("keydown.dialog-overlay",function(h){if(g.options.closeOnEscape&&h.keyCode&&h.keyCode===b.ui.keyCode.ESCAPE){g.close(h);h.preventDefault()}});b(window).bind("resize.dialog-overlay",b.ui.dialog.overlay.resize)}var e=(this.oldInstances.pop()||b("<div></div>").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});b.fn.bgiframe&&e.bgiframe();this.instances.push(e);return e},destroy:function(g){this.oldInstances.push(this.instances.splice(b.inArray(g,this.instances),1)[0]);this.instances.length===0&&b([document,window]).unbind(".dialog-overlay");g.remove();var e=0;b.each(this.instances,function(){e=Math.max(e,this.css("z-index"))});this.maxZ=e},height:function(){var g,e;if(b.browser.msie&&b.browser.version<7){g=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);e=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return g<e?b(window).height()+"px":g+"px"}else{return b(document).height()+"px"}},width:function(){var g,e;if(b.browser.msie&&b.browser.version<7){g=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);e=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);return g<e?b(window).width()+"px":g+"px"}else{return b(document).width()+"px"}},resize:function(){var e=b([]);b.each(b.ui.dialog.overlay.instances,function(){e=e.add(this)});e.css({width:0,height:0}).css({width:b.ui.dialog.overlay.width(),height:b.ui.dialog.overlay.height()})}});b.extend(b.ui.dialog.overlay.prototype,{destroy:function(){b.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);(function(b){b.widget("ui.slider",b.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null},_create:function(){var g=this,e=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");e.disabled&&this.element.addClass("ui-slider-disabled ui-disabled");this.range=b([]);if(e.range){if(e.range===true){this.range=b("<div></div>");if(!e.values){e.values=[this._valueMin(),this._valueMin()]}if(e.values.length&&e.values.length!==2){e.values=[e.values[0],e.values[0]]}}else{this.range=b("<div></div>")}this.range.appendTo(this.element).addClass("ui-slider-range");if(e.range==="min"||e.range==="max"){this.range.addClass("ui-slider-range-"+e.range)}this.range.addClass("ui-widget-header")}b(".ui-slider-handle",this.element).length===0&&b("<a href='#'></a>").appendTo(this.element).addClass("ui-slider-handle");if(e.values&&e.values.length){for(;b(".ui-slider-handle",this.element).length<e.values.length;){b("<a href='#'></a>").appendTo(this.element).addClass("ui-slider-handle")}}this.handles=b(".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(h){h.preventDefault()}).hover(function(){e.disabled||b(this).addClass("ui-state-hover")},function(){b(this).removeClass("ui-state-hover")}).focus(function(){if(e.disabled){b(this).blur()}else{b(".ui-slider .ui-state-focus").removeClass("ui-state-focus");b(this).addClass("ui-state-focus")}}).blur(function(){b(this).removeClass("ui-state-focus")});this.handles.each(function(h){b(this).data("index.ui-slider-handle",h)});this.handles.keydown(function(q){var o=true,n=b(this).data("index.ui-slider-handle"),l,k,j;if(!g.options.disabled){switch(q.keyCode){case b.ui.keyCode.HOME:case b.ui.keyCode.END:case b.ui.keyCode.PAGE_UP:case b.ui.keyCode.PAGE_DOWN:case b.ui.keyCode.UP:case b.ui.keyCode.RIGHT:case b.ui.keyCode.DOWN:case b.ui.keyCode.LEFT:o=false;if(!g._keySliding){g._keySliding=true;b(this).addClass("ui-state-active");l=g._start(q,n);if(l===false){return}}break}j=g.options.step;l=g.options.values&&g.options.values.length?(k=g.values(n)):(k=g.value());switch(q.keyCode){case b.ui.keyCode.HOME:k=g._valueMin();break;case b.ui.keyCode.END:k=g._valueMax();break;case b.ui.keyCode.PAGE_UP:k=g._trimAlignValue(l+(g._valueMax()-g._valueMin())/5);break;case b.ui.keyCode.PAGE_DOWN:k=g._trimAlignValue(l-(g._valueMax()-g._valueMin())/5);break;case b.ui.keyCode.UP:case b.ui.keyCode.RIGHT:if(l===g._valueMax()){return}k=g._trimAlignValue(l+j);break;case b.ui.keyCode.DOWN:case b.ui.keyCode.LEFT:if(l===g._valueMin()){return}k=g._trimAlignValue(l-j);break}g._slide(q,n,k);return o}}).keyup(function(j){var h=b(this).data("index.ui-slider-handle");if(g._keySliding){g._keySliding=false;g._stop(j,h);g._change(j,h);b(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy();return this},_mouseCapture:function(k){var j=this.options,w,v,q,o,n,l;if(j.disabled){return false}this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();w={x:k.pageX,y:k.pageY};v=this._normValueFromMouse(w);q=this._valueMax()-this._valueMin()+1;n=this;this.handles.each(function(g){var e=Math.abs(v-n.values(g));if(q>e){q=e;o=b(this);l=g}});if(j.range===true&&this.values(1)===j.min){l+=1;o=b(this.handles[l])}if(this._start(k,l)===false){return false}this._mouseSliding=true;n._handleIndex=l;o.addClass("ui-state-active").focus();j=o.offset();this._clickOffset=!b(k.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:k.pageX-j.left-o.width()/2,top:k.pageY-j.top-o.height()/2-(parseInt(o.css("borderTopWidth"),10)||0)-(parseInt(o.css("borderBottomWidth"),10)||0)+(parseInt(o.css("marginTop"),10)||0)};v=this._normValueFromMouse(w);this._slide(k,l,v);return this._animateOff=true},_mouseStart:function(){return true},_mouseDrag:function(g){var e=this._normValueFromMouse({x:g.pageX,y:g.pageY});this._slide(g,this._handleIndex,e);return false},_mouseStop:function(e){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(e,this._handleIndex);this._change(e,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(g){var e;if(this.orientation==="horizontal"){e=this.elementSize.width;g=g.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{e=this.elementSize.height;g=g.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}e=g/e;if(e>1){e=1}if(e<0){e=0}if(this.orientation==="vertical"){e=1-e}g=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+e*g)},_start:function(g,e){var h={handle:this.handles[e],value:this.value()};if(this.options.values&&this.options.values.length){h.value=this.values(e);h.values=this.values()}return this._trigger("start",g,h)},_slide:function(h,g,k){var j;if(this.options.values&&this.options.values.length){j=this.values(g?0:1);if(this.options.values.length===2&&this.options.range===true&&(g===0&&k>j||g===1&&k<j)){k=j}if(k!==this.values(g)){j=this.values();j[g]=k;h=this._trigger("slide",h,{handle:this.handles[g],value:k,values:j});this.values(g?0:1);h!==false&&this.values(g,k,true)}}else{if(k!==this.value()){h=this._trigger("slide",h,{handle:this.handles[g],value:k});h!==false&&this.value(k)}}},_stop:function(g,e){var h={handle:this.handles[e],value:this.value()};if(this.options.values&&this.options.values.length){h.value=this.values(e);h.values=this.values()}this._trigger("stop",g,h)},_change:function(g,e){if(!this._keySliding&&!this._mouseSliding){var h={handle:this.handles[e],value:this.value()};if(this.options.values&&this.options.values.length){h.value=this.values(e);h.values=this.values()}this._trigger("change",g,h)}},value:function(e){if(arguments.length){this.options.value=this._trimAlignValue(e);this._refreshValue();this._change(null,0)}return this._value()},values:function(h,g){var l,k,j;if(arguments.length>1){this.options.values[h]=this._trimAlignValue(g);this._refreshValue();this._change(null,h)}if(arguments.length){if(b.isArray(arguments[0])){l=this.options.values;k=arguments[0];for(j=0;j<l.length;j+=1){l[j]=this._trimAlignValue(k[j]);this._change(null,j)}this._refreshValue()}else{return this.options.values&&this.options.values.length?this._values(h):this.value()}}else{return this._values()}},_setOption:function(h,g){var k,j=0;if(b.isArray(this.options.values)){j=this.options.values.length}b.Widget.prototype._setOption.apply(this,arguments);switch(h){case"disabled":if(g){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<j;k+=1){this._change(null,k)}this._animateOff=false;break}},_value:function(){var e=this.options.value;return e=this._trimAlignValue(e)},_values:function(g){var e,h;if(arguments.length){e=this.options.values[g];return e=this._trimAlignValue(e)}else{e=this.options.values.slice();for(h=0;h<e.length;h+=1){e[h]=this._trimAlignValue(e[h])}return e}},_trimAlignValue:function(g){if(g<this._valueMin()){return this._valueMin()}if(g>this._valueMax()){return this._valueMax()}var e=this.options.step>0?this.options.step:1,h=g%e;g=g-h;if(Math.abs(h)*2>=e){g+=h>0?e:-e}return parseFloat(g.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var A=this.options.range,z=this.options,y=this,x=!this._animateOff?z.animate:false,w,v={},q,o,n,l;if(this.options.values&&this.options.values.length){this.handles.each(function(e){w=(y.values(e)-y._valueMin())/(y._valueMax()-y._valueMin())*100;v[y.orientation==="horizontal"?"left":"bottom"]=w+"%";b(this).stop(1,1)[x?"animate":"css"](v,z.animate);if(y.options.range===true){if(y.orientation==="horizontal"){if(e===0){y.range.stop(1,1)[x?"animate":"css"]({left:w+"%"},z.animate)}if(e===1){y.range[x?"animate":"css"]({width:w-q+"%"},{queue:false,duration:z.animate})}}else{if(e===0){y.range.stop(1,1)[x?"animate":"css"]({bottom:w+"%"},z.animate)}if(e===1){y.range[x?"animate":"css"]({height:w-q+"%"},{queue:false,duration:z.animate})}}}q=w})}else{o=this.value();n=this._valueMin();l=this._valueMax();w=l!==n?(o-n)/(l-n)*100:0;v[y.orientation==="horizontal"?"left":"bottom"]=w+"%";this.handle.stop(1,1)[x?"animate":"css"](v,z.animate);if(A==="min"&&this.orientation==="horizontal"){this.range.stop(1,1)[x?"animate":"css"]({width:w+"%"},z.animate)}if(A==="max"&&this.orientation==="horizontal"){this.range[x?"animate":"css"]({width:100-w+"%"},{queue:false,duration:z.animate})}if(A==="min"&&this.orientation==="vertical"){this.range.stop(1,1)[x?"animate":"css"]({height:w+"%"},z.animate)}if(A==="max"&&this.orientation==="vertical"){this.range[x?"animate":"css"]({height:100-w+"%"},{queue:false,duration:z.animate})}}}});b.extend(b.ui.slider,{version:"1.8.2"})})(jQuery);(function(g){var h=(g.browser.msie?"paste":"input")+".mask";var e=(window.orientation!=undefined);g.mask={definitions:{"9":"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"}};g.fn.extend({caret:function(j,b){if(this.length==0){return}if(typeof j=="number"){b=(typeof b=="number")?b:j;return this.each(function(){if(this.setSelectionRange){this.focus();this.setSelectionRange(j,b)}else{if(this.createTextRange){var l=this.createTextRange();l.collapse(true);l.moveEnd("character",b);l.moveStart("character",j);l.select()}}})}else{if(this[0].setSelectionRange){j=this[0].selectionStart;b=this[0].selectionEnd}else{if(document.selection&&document.selection.createRange){var k=document.selection.createRange();j=0-k.duplicate().moveStart("character",-100000);b=j+k.text.length}}return{begin:j,end:b}}},unmask:function(){return this.trigger("unmask")},mask:function(l,x){if(!l&&this.length>0){var v=g(this[0]);var q=v.data("tests");return g.map(v.data("buffer"),function(k,j){return q[j]?k:null}).join("")}x=g.extend({placeholder:"_",completed:null},x);var b=g.mask.definitions;var q=[];var w=l.length;var n=null;var o=l.length;g.each(l.split(""),function(j,k){if(k=="?"){o--;w=j}else{if(b[k]){q.push(new RegExp(b[k]));if(n==null){n=q.length-1}}else{q.push(null)}}});return this.each(function(){var j=g(this);var B=g.map(l.split(""),function(I,J){if(I!="?"){return b[I]?x.placeholder:I}});var A=false;var k=j.val();j.data("buffer",B).data("tests",q);function E(I){while(++I<=o&&!q[I]){}return I}function G(I){while(!q[I]&&--I>=0){}for(var K=I;K<o;K++){if(q[K]){B[K]=x.placeholder;var J=E(K);if(J<o&&q[K].test(B[J])){B[K]=B[J]}else{break}}}H();j.caret(Math.max(n,I))}function F(M){for(var J=M,K=x.placeholder;J<o;J++){if(q[J]){var L=E(J);var I=B[J];B[J]=K;if(L<o&&q[L].test(I)){K=I}else{break}}}}function C(K){var I=g(this).caret();var J=K.keyCode;A=(J<16||(J>16&&J<32)||(J>32&&J<41));if((I.begin-I.end)!=0&&(!A||J==8||J==46)){D(I.begin,I.end)}if(J==8||J==46||(e&&J==127)){G(I.begin+(J==46?0:-1));return false}else{if(J==27){j.val(k);j.caret(0,y());return false}}}function z(N){if(A){A=false;return(N.keyCode==8)?false:null}N=N||window.event;var L=N.charCode||N.keyCode||N.which;var K=g(this).caret();if(N.ctrlKey||N.altKey||N.metaKey){return true}else{if((L>=32&&L<=125)||L>186){var J=E(K.begin-1);if(J<o){var I=String.fromCharCode(L);if(q[J].test(I)){F(J);B[J]=I;H();var M=E(J);g(this).caret(M);if(x.completed&&M==o){x.completed.call(j)}}}}}return false}function D(I,K){for(var J=I;J<K&&J<o;J++){if(q[J]){B[J]=x.placeholder}}}function H(){return j.val(B.join("")).val()}function y(N){var L=j.val();var K=-1;for(var M=0,J=0;M<o;M++){if(q[M]){B[M]=x.placeholder;while(J++<L.length){var I=L.charAt(J-1);if(q[M].test(I)){B[M]=I;K=M;break}}if(J>L.length){break}}else{if(B[M]==L[J]&&M!=w){J++;K=M}}}if(!N&&K+1<w){j.val("");D(0,o)}else{if(N||K+1>=w){H();if(!N){j.val(j.val().substring(0,K+1))}}}return(w?M:n)}if(!j.attr("readonly")){j.one("unmask",function(){j.unbind(".mask").removeData("buffer").removeData("tests")}).bind("focus.mask",function(){k=j.val();var I=y();H();setTimeout(function(){if(I==l.length){j.caret(0,I)}else{j.caret(I)}},0)}).bind("blur.mask",function(){y();if(j.val()!=k){j.change()}}).bind("keydown.mask",C).bind("keypress.mask",z).bind(h,function(){setTimeout(function(){j.caret(y(true))},0)})}y()})}})})(jQuery);(function(){function log(){if(typeof(console)!="undefined"&&typeof(console.log)=="function"){Array.prototype.unshift.call(arguments,"[Ajax Upload]");console.log(Array.prototype.join.call(arguments," "))}}function addEvent(el,type,fn){if(el.addEventListener){el.addEventListener(type,fn,false)}else{if(el.attachEvent){el.attachEvent("on"+type,function(){fn.call(el)})}else{throw new Error("not supported or DOM not loaded")}}}function addResizeEvent(fn){var timeout;addEvent(window,"resize",function(){if(timeout){clearTimeout(timeout)}timeout=setTimeout(fn,100)})}if(document.documentElement.getBoundingClientRect){var getOffset=function(el){var box=el.getBoundingClientRect();var doc=el.ownerDocument;var body=doc.body;var docElem=doc.documentElement;var clientTop=docElem.clientTop||body.clientTop||0;var clientLeft=docElem.clientLeft||body.clientLeft||0;var zoom=1;if(body.getBoundingClientRect){var bound=body.getBoundingClientRect();zoom=(bound.right-bound.left)/body.clientWidth}if(zoom>1){clientTop=0;clientLeft=0}var top=box.top/zoom+(window.pageYOffset||docElem&&docElem.scrollTop/zoom||body.scrollTop/zoom)-clientTop,left=box.left/zoom+(window.pageXOffset||docElem&&docElem.scrollLeft/zoom||body.scrollLeft/zoom)-clientLeft;return{top:top,left:left}}}else{var getOffset=function(el){var top=0,left=0;do{top+=el.offsetTop||0;left+=el.offsetLeft||0;el=el.offsetParent}while(el);return{left:left,top:top}}}function getBox(el){var left,right,top,bottom;var offset=getOffset(el);left=offset.left;top=offset.top;right=left+el.offsetWidth;bottom=top+el.offsetHeight;return{left:left,right:right,top:top,bottom:bottom}}function addStyles(el,styles){for(var name in styles){if(styles.hasOwnProperty(name)){el.style[name]=styles[name]}}}function copyLayout(from,to){var box=getBox(from);addStyles(to,{position:"absolute",left:box.left+"px",top:box.top+"px",width:from.offsetWidth+"px",height:from.offsetHeight+"px"})}var toElement=(function(){var div=document.createElement("div");return function(html){div.innerHTML=html;var el=div.firstChild;return div.removeChild(el)}})();var getUID=(function(){var id=0;return function(){return"ValumsAjaxUpload"+id++}})();function fileFromPath(file){return file.replace(/.*(\/|\\)/,"")}function getExt(file){return(-1!==file.indexOf("."))?file.replace(/.*[.]/,""):""}function hasClass(el,name){var re=new RegExp("\\b"+name+"\\b");return re.test(el.className)}function addClass(el,name){if(!hasClass(el,name)){el.className+=" "+name}}function removeClass(el,name){var re=new RegExp("\\b"+name+"\\b");el.className=el.className.replace(re,"")}function removeNode(el){el.parentNode.removeChild(el)}window.AjaxUpload=function(button,options){this._settings={action:"upload.php",name:"userfile",data:{},autoSubmit:true,responseType:false,hoverClass:"hover",disabledClass:"disabled",onChange:function(file,extension){},onSubmit:function(file,extension){},onComplete:function(file,response){}};for(var i in options){if(options.hasOwnProperty(i)){this._settings[i]=options[i]}}if(button.jquery){button=button[0]}else{if(typeof button=="string"){if(/^#.*/.test(button)){button=button.slice(1)}button=document.getElementById(button)}}if(!button||button.nodeType!==1){throw new Error("Please make sure that you're passing a valid element")}if(button.nodeName.toUpperCase()=="A"){addEvent(button,"click",function(e){if(e&&e.preventDefault){e.preventDefault()}else{if(window.event){window.event.returnValue=false}}})}this._button=button;this._input=null;this._disabled=false;this.enable();this._rerouteClicks()};AjaxUpload.prototype={setData:function(data){this._settings.data=data},disable:function(){addClass(this._button,this._settings.disabledClass);this._disabled=true;var nodeName=this._button.nodeName.toUpperCase();if(nodeName=="INPUT"||nodeName=="BUTTON"){this._button.setAttribute("disabled","disabled")}if(this._input){this._input.parentNode.style.visibility="hidden"}},enable:function(){removeClass(this._button,this._settings.disabledClass);this._button.removeAttribute("disabled");this._disabled=false},_createInput:function(){var self=this;var input=document.createElement("input");input.setAttribute("type","file");input.setAttribute("name",this._settings.name);addStyles(input,{position:"absolute",right:0,margin:0,padding:0,fontSize:"480px",cursor:"pointer"});var div=document.createElement("div");addStyles(div,{display:"block",position:"absolute",overflow:"hidden",margin:0,padding:0,opacity:0,direction:"ltr",zIndex:2147483583});if(div.style.opacity!=="0"){if(typeof(div.filters)=="undefined"){throw new Error("Opacity not supported by the browser")}div.style.filter="alpha(opacity=0)"}addEvent(input,"change",function(){if(!input||input.value===""){return}var file=fileFromPath(input.value);if(false===self._settings.onChange.call(self,file,getExt(file))){self._clearInput();return}if(self._settings.autoSubmit){self.submit()}});addEvent(input,"mouseover",function(){addClass(self._button,self._settings.hoverClass)});addEvent(input,"mouseout",function(){removeClass(self._button,self._settings.hoverClass);input.parentNode.style.visibility="hidden"});div.appendChild(input);document.body.appendChild(div);this._input=input},_clearInput:function(){if(!this._input){return}removeNode(this._input.parentNode);this._input=null;this._createInput();removeClass(this._button,this._settings.hoverClass)},_rerouteClicks:function(){var self=this;addEvent(self._button,"mouseover",function(){if(self._disabled){return}if(!self._input){self._createInput()}var div=self._input.parentNode;copyLayout(self._button,div);div.style.visibility="visible"})},_createIframe:function(){var id=getUID();var iframe=toElement('<iframe src="javascript:false;" name="'+id+'" />');iframe.setAttribute("id",id);iframe.style.display="none";document.body.appendChild(iframe);return iframe},_createForm:function(iframe){var settings=this._settings;var form=toElement('<form method="post" enctype="multipart/form-data"></form>');form.setAttribute("action",settings.action);form.setAttribute("target",iframe.name);form.style.display="none";document.body.appendChild(form);for(var prop in settings.data){if(settings.data.hasOwnProperty(prop)){var el=document.createElement("input");el.setAttribute("type","hidden");el.setAttribute("name",prop);el.setAttribute("value",settings.data[prop]);form.appendChild(el)}}return form},_getResponse:function(iframe,file){var toDeleteFlag=false,self=this,settings=this._settings;addEvent(iframe,"load",function(){if(iframe.src=="javascript:'%3Chtml%3E%3C/html%3E';"||iframe.src=="javascript:'<html></html>';"){if(toDeleteFlag){setTimeout(function(){removeNode(iframe)},0)}return}var doc=iframe.contentDocument?iframe.contentDocument:window.frames[iframe.id].document;if(doc.readyState&&doc.readyState!="complete"){return}if(doc.body&&doc.body.innerHTML=="false"){return}var response;if(doc.XMLDocument){response=doc.XMLDocument}else{if(doc.body){response=doc.body.innerHTML;if(settings.responseType&&settings.responseType.toLowerCase()=="json"){if(doc.body.firstChild&&doc.body.firstChild.nodeName.toUpperCase()=="PRE"){response=doc.body.firstChild.firstChild.nodeValue}if(response){response=eval("("+response+")")}else{response={}}}}else{response=doc}}settings.onComplete.call(self,file,response);toDeleteFlag=true;iframe.src="javascript:'<html></html>';"})},submit:function(){var self=this,settings=this._settings;if(!this._input||this._input.value===""){return}var file=fileFromPath(this._input.value);if(false===settings.onSubmit.call(this,file,getExt(file))){this._clearInput();return}var iframe=this._createIframe();var form=this._createForm(iframe);removeNode(this._input.parentNode);removeClass(self._button,self._settings.hoverClass);form.appendChild(this._input);form.submit();removeNode(form);form=null;removeNode(this._input);this._input=null;this._getResponse(iframe,file);this._createInput()}}})();if(typeof deconcept=="undefined"){var deconcept=new Object()}if(typeof deconcept.util=="undefined"){deconcept.util=new Object()}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object()}deconcept.SWFObject=function(y,e,z,j,o,v,l,k,g,x){if(!document.getElementById){return}this.DETECT_KEY=x?x:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(y){this.setAttribute("swf",y)}if(e){this.setAttribute("id",e)}if(z){this.setAttribute("width",z)}if(j){this.setAttribute("height",j)}if(o){this.setAttribute("version",new deconcept.PlayerVersion(o.toString().split(".")))}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true}if(v){this.addParam("bgcolor",v)}var b=l?l:"high";this.addParam("quality",b);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var n=(k)?k:window.location;this.setAttribute("xiRedirectUrl",n);this.setAttribute("redirectUrl","");if(g){this.setAttribute("redirectUrl",g)}};deconcept.SWFObject.prototype={useExpressInstall:function(b){this.xiSWFPath=!b?"expressinstall.swf":b;this.setAttribute("useExpressInstall",true)},setAttribute:function(b,e){this.attributes[b]=e},getAttribute:function(b){return this.attributes[b]},addParam:function(e,b){this.params[e]=b},getParams:function(){return this.params},addVariable:function(e,b){this.variables[e]=b},getVariable:function(b){return this.variables[b]},getVariables:function(){return this.variables},getVariablePairs:function(){var g=new Array();var e;var b=this.getVariables();for(e in b){g[g.length]=e+"="+b[e]}return g},getSWFHTML:function(){var e="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath)}e='<embed type="application/x-shockwave-flash" src="'+this.getAttribute("swf")+'" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'"';e+=' id="'+this.getAttribute("id")+'" name="'+this.getAttribute("id")+'" ';var k=this.getParams();for(var j in k){e+=[j]+'="'+k[j]+'" '}var h=this.getVariablePairs().join("&");if(h.length>0){e+='flashvars="'+h+'"'}e+="/>"}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath)}e='<object id="'+this.getAttribute("id")+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'">';e+='<param name="movie" value="'+this.getAttribute("swf")+'" />';var g=this.getParams();for(var j in g){e+='<param name="'+j+'" value="'+g[j]+'" />'}var b=this.getVariablePairs().join("&");if(b.length>0){e+='<param name="flashvars" value="'+b+'" />'}e+="</object>"}return e},write:function(e){if(this.getAttribute("useExpressInstall")){var b=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(b)&&!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"))){var g=(typeof e=="string")?document.getElementById(e):e;g.innerHTML=this.getSWFHTML();return true}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"))}}return false}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var k=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var b=navigator.plugins["Shockwave Flash"];if(b&&b.description){k=new deconcept.PlayerVersion(b.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."))}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var g=1;var h=3;while(g){try{h++;g=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+h);k=new deconcept.PlayerVersion([h,0,0])}catch(j){g=null}}}else{try{var g=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(j){try{var g=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");k=new deconcept.PlayerVersion([6,0,21]);g.AllowScriptAccess="always"}catch(j){if(k.major==6){return k}}try{g=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(j){}}if(g!=null){k=new deconcept.PlayerVersion(g.GetVariable("$version").split(" ")[1].split(","))}}}return k};deconcept.PlayerVersion=function(b){this.major=b[0]!=null?parseInt(b[0]):0;this.minor=b[1]!=null?parseInt(b[1]):0;this.rev=b[2]!=null?parseInt(b[2]):0};deconcept.PlayerVersion.prototype.versionIsValid=function(b){if(this.major<b.major){return false}if(this.major>b.major){return true}if(this.minor<b.minor){return false}if(this.minor>b.minor){return true}if(this.rev<b.rev){return false}return true};deconcept.util={getRequestParameter:function(g){var h=document.location.search||document.location.hash;if(g==null){return h}if(h){var e=h.substring(1).split("&");for(var b=0;b<e.length;b++){if(e[b].substring(0,e[b].indexOf("="))==g){return e[b].substring((e[b].indexOf("=")+1))}}}return""}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var e=document.getElementsByTagName("OBJECT");for(var g=e.length-1;g>=0;g--){e[g].style.display="none";for(var b in e[g]){if(typeof e[g][b]=="function"){e[g][b]=function(){}}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs)};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true}}if(!document.getElementById&&document.all){document.getElementById=function(b){return document.all[b]}}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;(function(C){var H;C.jqplot=function(e,k,g){var b,h;if(k==null){throw"No data specified"}if(k.constructor==Array&&k.length==0||k[0].constructor!=Array){throw"Improper Data Array"}if(g==null){if(k instanceof Array){b=k;h=null}else{if(k.constructor==Object){b=null;h=k}}}else{b=k;h=g}var j=new y();j.init(e,b,h);j.draw();return j};C.jqplot.debug=1;C.jqplot.config={debug:1,enablePlugins:true,defaultHeight:300,defaultWidth:400};C.jqplot.enablePlugins=C.jqplot.config.enablePlugins;C.jqplot.preInitHooks=[];C.jqplot.postInitHooks=[];C.jqplot.preParseOptionsHooks=[];C.jqplot.postParseOptionsHooks=[];C.jqplot.preDrawHooks=[];C.jqplot.postDrawHooks=[];C.jqplot.preDrawSeriesHooks=[];C.jqplot.postDrawSeriesHooks=[];C.jqplot.preDrawLegendHooks=[];C.jqplot.addLegendRowHooks=[];C.jqplot.preSeriesInitHooks=[];C.jqplot.postSeriesInitHooks=[];C.jqplot.preParseSeriesOptionsHooks=[];C.jqplot.postParseSeriesOptionsHooks=[];C.jqplot.eventListenerHooks=[];C.jqplot.preDrawSeriesShadowHooks=[];C.jqplot.postDrawSeriesShadowHooks=[];C.jqplot.ElemContainer=function(){this._elem;this._plotWidth;this._plotHeight;this._plotDimensions={height:null,width:null}};C.jqplot.ElemContainer.prototype.getWidth=function(){if(this._elem){return this._elem.outerWidth(true)}else{return null}};C.jqplot.ElemContainer.prototype.getHeight=function(){if(this._elem){return this._elem.outerHeight(true)}else{return null}};C.jqplot.ElemContainer.prototype.getPosition=function(){if(this._elem){return this._elem.position()}else{return{top:null,left:null,bottom:null,right:null}}};C.jqplot.ElemContainer.prototype.getTop=function(){return this.getPosition().top};C.jqplot.ElemContainer.prototype.getLeft=function(){return this.getPosition().left};C.jqplot.ElemContainer.prototype.getBottom=function(){return this._elem.css("bottom")};C.jqplot.ElemContainer.prototype.getRight=function(){return this._elem.css("right")};function z(b){C.jqplot.ElemContainer.call(this);this.name=b;this._series=[];this.show=false;this.tickRenderer=C.jqplot.AxisTickRenderer;this.tickOptions={};this.labelRenderer=C.jqplot.AxisLabelRenderer;this.labelOptions={};this.label=null;this.showLabel=true;this.min=null;this.max=null;this.autoscale=false;this.pad=1.2;this.padMax=null;this.padMin=null;this.ticks=[];this.numberTicks;this.tickInterval;this.renderer=C.jqplot.LinearAxisRenderer;this.rendererOptions={};this.showTicks=true;this.showTickMarks=true;this.showMinorTicks=true;this.useSeriesColor=false;this.borderWidth=null;this.borderColor=null;this._dataBounds={min:null,max:null};this._offsets={min:null,max:null};this._ticks=[];this._label=null;this.syncTicks=null;this.tickSpacing=75;this._min=null;this._max=null;this._tickInterval=null;this._numberTicks=null;this.__ticks=null}z.prototype=new C.jqplot.ElemContainer();z.prototype.constructor=z;z.prototype.init=function(){this.renderer=new this.renderer();this.tickOptions.axis=this.name;if(this.label==null||this.label==""){this.showLabel=false}else{this.labelOptions.label=this.label}if(this.showLabel==false){this.labelOptions.show=false}if(this.pad==0){this.pad=1}if(this.padMax==0){this.padMax=1}if(this.padMin==0){this.padMin=1}if(this.padMax==null){this.padMax=(this.pad-1)/2+1}if(this.padMin==null){this.padMin=(this.pad-1)/2+1}this.pad=this.padMax+this.padMin-1;if(this.min!=null||this.max!=null){this.autoscale=false}if(this.syncTicks==null&&this.name.indexOf("y")>-1){this.syncTicks=true}else{if(this.syncTicks==null){this.syncTicks=false}}this.renderer.init.call(this,this.rendererOptions)};z.prototype.draw=function(b){return this.renderer.draw.call(this,b)};z.prototype.set=function(){this.renderer.set.call(this)};z.prototype.pack=function(b,e){if(this.show){this.renderer.pack.call(this,b,e)}if(this._min==null){this._min=this.min;this._max=this.max;this._tickInterval=this.tickInterval;this._numberTicks=this.numberTicks;this.__ticks=this._ticks}};z.prototype.reset=function(){this.renderer.reset.call(this)};z.prototype.resetScale=function(){this.min=null;this.max=null;this.numberTicks=null;this.tickInterval=null};function I(b){C.jqplot.ElemContainer.call(this);this.show=false;this.location="ne";this.xoffset=12;this.yoffset=12;this.border;this.background;this.textColor;this.fontFamily;this.fontSize;this.rowSpacing="0.5em";this.renderer=C.jqplot.TableLegendRenderer;this.rendererOptions={};this.preDraw=false;this.escapeHtml=false;this._series=[];C.extend(true,this,b)}I.prototype=new C.jqplot.ElemContainer();I.prototype.constructor=I;I.prototype.init=function(){this.renderer=new this.renderer();this.renderer.init.call(this,this.rendererOptions)};I.prototype.draw=function(b){for(var e=0;e<C.jqplot.preDrawLegendHooks.length;e++){C.jqplot.preDrawLegendHooks[e].call(this,b)}return this.renderer.draw.call(this,b)};I.prototype.pack=function(b){this.renderer.pack.call(this,b)};function A(b){C.jqplot.ElemContainer.call(this);this.text=b;this.show=true;this.fontFamily;this.fontSize;this.textAlign;this.textColor;this.renderer=C.jqplot.DivTitleRenderer;this.rendererOptions={}}A.prototype=new C.jqplot.ElemContainer();A.prototype.constructor=A;A.prototype.init=function(){this.renderer=new this.renderer();this.renderer.init.call(this,this.rendererOptions)};A.prototype.draw=function(b){return this.renderer.draw.call(this,b)};A.prototype.pack=function(){this.renderer.pack.call(this)};function x(){C.jqplot.ElemContainer.call(this);this.show=true;this.xaxis="xaxis";this._xaxis;this.yaxis="yaxis";this._yaxis;this.gridBorderWidth=2;this.renderer=C.jqplot.LineRenderer;this.rendererOptions={};this.data=[];this.gridData=[];this.label="";this.showLabel=true;this.color;this.lineWidth=2.5;this.shadow=true;this.shadowAngle=45;this.shadowOffset=1.25;this.shadowDepth=3;this.shadowAlpha="0.1";this.breakOnNull=false;this.markerRenderer=C.jqplot.MarkerRenderer;this.markerOptions={};this.showLine=true;this.showMarker=true;this.index;this.fill=false;this.fillColor;this.fillAlpha;this.fillAndStroke=false;this.disableStack=false;this._stack=false;this.neighborThreshold=4;this.fillToZero=false;this.fillAxis="y";this.useNegativeColors=true;this._stackData=[];this._plotData=[];this._plotValues={x:[],y:[]};this._intervals={x:{},y:{}};this._prevPlotData=[];this._prevGridData=[];this._stackAxis="y";this._primaryAxis="_xaxis";this.canvas=new C.jqplot.GenericCanvas();this.shadowCanvas=new C.jqplot.GenericCanvas();this.plugins={};this._sumy=0;this._sumx=0}x.prototype=new C.jqplot.ElemContainer();x.prototype.constructor=x;x.prototype.init=function(g,l,k){this.index=g;this.gridBorderWidth=l;var e=this.data;for(var b=0;b<e.length;b++){if(!this.breakOnNull){if(e[b]==null||e[b][0]==null||e[b][1]==null){e.splice(b,1);continue}}else{if(e[b]==null||e[b][0]==null||e[b][1]==null){var j}}}if(!this.fillColor){this.fillColor=this.color}if(this.fillAlpha){var h=C.jqplot.normalize2rgb(this.fillColor);var h=C.jqplot.getColorComponents(h);this.fillColor="rgba("+h[0]+","+h[1]+","+h[2]+","+this.fillAlpha+")"}this.renderer=new this.renderer();this.renderer.init.call(this,this.rendererOptions,k);this.markerRenderer=new this.markerRenderer();if(!this.markerOptions.color){this.markerOptions.color=this.color}if(this.markerOptions.show==null){this.markerOptions.show=this.showMarker}this.markerRenderer.init(this.markerOptions)};x.prototype.draw=function(l,k,e){var g=(k==H)?{}:k;l=(l==H)?this.canvas._ctx:l;for(var h=0;h<C.jqplot.preDrawSeriesHooks.length;h++){C.jqplot.preDrawSeriesHooks[h].call(this,l,g)}if(this.show){this.renderer.setGridData.call(this,e);if(!g.preventJqPlotSeriesDrawTrigger){C(l.canvas).trigger("jqplotSeriesDraw",[this.data,this.gridData])}var j=[];if(g.data){j=g.data}else{if(!this._stack){j=this.data}else{j=this._plotData}}var b=g.gridData||this.renderer.makeGridData.call(this,j,e);this.renderer.draw.call(this,l,b,g)}for(var h=0;h<C.jqplot.postDrawSeriesHooks.length;h++){C.jqplot.postDrawSeriesHooks[h].call(this,l,g)}};x.prototype.drawShadow=function(l,k,e){var g=(k==H)?{}:k;l=(l==H)?this.shadowCanvas._ctx:l;for(var h=0;h<C.jqplot.preDrawSeriesShadowHooks.length;h++){C.jqplot.preDrawSeriesShadowHooks[h].call(this,l,g)}if(this.shadow){this.renderer.setGridData.call(this,e);var j=[];if(g.data){j=g.data}else{if(!this._stack){j=this.data}else{j=this._plotData}}var b=g.gridData||this.renderer.makeGridData.call(this,j,e);this.renderer.drawShadow.call(this,l,b,g)}for(var h=0;h<C.jqplot.postDrawSeriesShadowHooks.length;h++){C.jqplot.postDrawSeriesShadowHooks[h].call(this,l,g)}};function D(){C.jqplot.ElemContainer.call(this);this.drawGridlines=true;this.gridLineColor="#cccccc";this.gridLineWidth=1;this.background="#fffdf6";this.borderColor="#999999";this.borderWidth=2;this.shadow=true;this.shadowAngle=45;this.shadowOffset=1.5;this.shadowWidth=3;this.shadowDepth=3;this.shadowAlpha="0.07";this._left;this._top;this._right;this._bottom;this._width;this._height;this._axes=[];this.renderer=C.jqplot.CanvasGridRenderer;this.rendererOptions={};this._offsets={top:null,bottom:null,left:null,right:null}}D.prototype=new C.jqplot.ElemContainer();D.prototype.constructor=D;D.prototype.init=function(){this.renderer=new this.renderer();this.renderer.init.call(this,this.rendererOptions)};D.prototype.createElement=function(b){this._offsets=b;return this.renderer.createElement.call(this)};D.prototype.draw=function(){this.renderer.draw.call(this)};C.jqplot.GenericCanvas=function(){C.jqplot.ElemContainer.call(this);this._ctx};C.jqplot.GenericCanvas.prototype=new C.jqplot.ElemContainer();C.jqplot.GenericCanvas.prototype.constructor=C.jqplot.GenericCanvas;C.jqplot.GenericCanvas.prototype.createElement=function(h,b,e){this._offsets=h;var g="jqplot";if(b!=H){g=b}var j=document.createElement("canvas");if(e!=H){this._plotDimensions=e}j.width=this._plotDimensions.width-this._offsets.left-this._offsets.right;j.height=this._plotDimensions.height-this._offsets.top-this._offsets.bottom;this._elem=C(j);this._elem.addClass(g);this._elem.css({position:"absolute",left:this._offsets.left,top:this._offsets.top});if(C.browser.msie){window.G_vmlCanvasManager.init_(document)}if(C.browser.msie){j=window.G_vmlCanvasManager.initElement(j)}return this._elem};C.jqplot.GenericCanvas.prototype.setContext=function(){this._ctx=this._elem.get(0).getContext("2d");return this._ctx};function y(){this.data=[];this.targetId=null;this.target=null;this.defaults={axesDefaults:{},axes:{xaxis:{},yaxis:{},x2axis:{},y2axis:{},y3axis:{},y4axis:{},y5axis:{},y6axis:{},y7axis:{},y8axis:{},y9axis:{}},seriesDefaults:{},gridPadding:{top:10,right:10,bottom:23,left:10},series:[]};this.series=[];this.axes={xaxis:new z("xaxis"),yaxis:new z("yaxis"),x2axis:new z("x2axis"),y2axis:new z("y2axis"),y3axis:new z("y3axis"),y4axis:new z("y4axis"),y5axis:new z("y5axis"),y6axis:new z("y6axis"),y7axis:new z("y7axis"),y8axis:new z("y8axis"),y9axis:new z("y9axis")};this.grid=new D();this.legend=new I();this.baseCanvas=new C.jqplot.GenericCanvas();this.eventCanvas=new C.jqplot.GenericCanvas();this._width=null;this._height=null;this._plotDimensions={height:null,width:null};this._gridPadding={top:10,right:10,bottom:10,left:10};this.syncXTicks=true;this.syncYTicks=true;this.seriesColors=["#4bb2c5","#EAA228","#c5b47f","#579575","#839557","#958c12","#953579","#4b5de4","#d8b83f","#ff5800","#0085cc","#c747a3","#cddf54","#FBD178","#26B4E3","#bd70c7"];this.negativeSeriesColors=["#498991","#C08840","#9F9274","#546D61","#646C4A","#6F6621","#6E3F5F","#4F64B0","#A89050","#C45923","#187399","#945381","#959E5C","#C7AF7B","#478396","#907294"];this.sortData=true;var h=0;this.textColor;this.fontFamily;this.fontSize;this.title=new A();this.options={};this.stackSeries=false;this._stackData=[];this._plotData=[];this.plugins={};this._drawCount=0;this.drawIfHidden=false;this._sumy=0;this._sumx=0;this.colorGenerator=C.jqplot.ColorGenerator;this.init=function(k,l,M){for(var o=0;o<C.jqplot.preInitHooks.length;o++){C.jqplot.preInitHooks[o].call(this,k,l,M)}this.targetId="#"+k;this.target=C("#"+k);if(!this.target.get(0)){throw"No plot target specified"}if(this.target.css("position")=="static"){this.target.css("position","relative")}if(!this.target.hasClass("jqplot-target")){this.target.addClass("jqplot-target")}if(!this.target.height()){var n;if(M&&M.height){n=parseInt(M.height,10)}else{if(this.target.attr("data-height")){n=parseInt(this.target.attr("data-height"),10)}else{n=parseInt(C.jqplot.config.defaultHeight,10)}}this._height=n;this.target.css("height",n+"px")}else{this._height=this.target.height()}if(!this.target.width()){var q;if(M&&M.width){q=parseInt(M.width,10)}else{if(this.target.attr("data-width")){q=parseInt(this.target.attr("data-width"),10)}else{q=parseInt(C.jqplot.config.defaultWidth,10)}}this._width=q;this.target.css("width",q+"px")}else{this._width=this.target.width()}this._plotDimensions.height=this._height;this._plotDimensions.width=this._width;this.grid._plotDimensions=this._plotDimensions;this.title._plotDimensions=this._plotDimensions;this.baseCanvas._plotDimensions=this._plotDimensions;this.eventCanvas._plotDimensions=this._plotDimensions;this.legend._plotDimensions=this._plotDimensions;if(this._height<=0||this._width<=0||!this._height||!this._width){throw"Canvas dimension not set"}this.data=l;this.parseOptions(M);if(this.textColor){this.target.css("color",this.textColor)}if(this.fontFamily){this.target.css("font-family",this.fontFamily)}if(this.fontSize){this.target.css("font-size",this.fontSize)}this.title.init();this.legend.init();this._sumy=0;this._sumx=0;for(var o=0;o<this.series.length;o++){this.series[o].shadowCanvas._plotDimensions=this._plotDimensions;this.series[o].canvas._plotDimensions=this._plotDimensions;for(var N=0;N<C.jqplot.preSeriesInitHooks.length;N++){C.jqplot.preSeriesInitHooks[N].call(this.series[o],k,l,this.options.seriesDefaults,this.options.series[o])}this.populatePlotData(this.series[o],o);this.series[o]._plotDimensions=this._plotDimensions;this.series[o].init(o,this.grid.borderWidth,this);for(var N=0;N<C.jqplot.postSeriesInitHooks.length;N++){C.jqplot.postSeriesInitHooks[N].call(this.series[o],k,l,this.options.seriesDefaults,this.options.series[o])}this._sumy+=this.series[o]._sumy;this._sumx+=this.series[o]._sumx}for(var j in this.axes){this.axes[j]._plotDimensions=this._plotDimensions;this.axes[j].init()}if(this.sortData){g(this.series)}this.grid.init();this.grid._axes=this.axes;this.legend._series=this.series;for(var o=0;o<C.jqplot.postInitHooks.length;o++){C.jqplot.postInitHooks[o].call(this,k,l,M)}};this.resetAxesScale=function(l){var n=(l!=H)?l:this.axes;if(n===true){n=this.axes}if(n.constructor===Array){for(var j=0;j<n.length;j++){this.axes[n[j]].resetScale()}}else{if(n.constructor===Object){for(var k in n){this.axes[k].resetScale()}}}};this.reInitialize=function(){if(!this.target.height()){var l;if(options&&options.height){l=parseInt(options.height,10)}else{if(this.target.attr("data-height")){l=parseInt(this.target.attr("data-height"),10)}else{l=parseInt(C.jqplot.config.defaultHeight,10)}}this._height=l;this.target.css("height",l+"px")}else{this._height=this.target.height()}if(!this.target.width()){var o;if(options&&options.width){o=parseInt(options.width,10)}else{if(this.target.attr("data-width")){o=parseInt(this.target.attr("data-width"),10)}else{o=parseInt(C.jqplot.config.defaultWidth,10)}}this._width=o;this.target.css("width",o+"px")}else{this._width=this.target.width()}if(this._height<=0||this._width<=0||!this._height||!this._width){throw"Target dimension not set"}this._plotDimensions.height=this._height;this._plotDimensions.width=this._width;this.grid._plotDimensions=this._plotDimensions;this.title._plotDimensions=this._plotDimensions;this.baseCanvas._plotDimensions=this._plotDimensions;this.eventCanvas._plotDimensions=this._plotDimensions;this.legend._plotDimensions=this._plotDimensions;for(var k in this.axes){var n=this.axes[k];n._plotWidth=this._width;n._plotHeight=this._height}this.title._plotWidth=this._width;if(this.textColor){this.target.css("color",this.textColor)}if(this.fontFamily){this.target.css("font-family",this.fontFamily)}if(this.fontSize){this.target.css("font-size",this.fontSize)}this._sumy=0;this._sumx=0;for(var q=0;q<this.series.length;q++){this.populatePlotData(this.series[q],q);this.series[q]._plotDimensions=this._plotDimensions;this.series[q].canvas._plotDimensions=this._plotDimensions;this._sumy+=this.series[q]._sumy;this._sumx+=this.series[q]._sumx}for(var j in this.axes){this.axes[j]._plotDimensions=this._plotDimensions;this.axes[j]._ticks=[];this.axes[j].renderer.init.call(this.axes[j],{})}if(this.sortData){g(this.series)}this.grid._axes=this.axes;this.legend._series=this.series};function g(l){var k,q;for(var o=0;o<l.length;o++){k=l[o].data;var n=true;if(l[o]._stackAxis=="x"){for(var j=0;j<k.length;j++){if(typeof(k[j][1])!="number"){n=false;break}}if(n){k.sort(function(M,N){return M[1]-N[1]})}}else{for(var j=0;j<k.length;j++){if(typeof(k[j][0])!="number"){n=false;break}}if(n){k.sort(function(M,N){return M[0]-N[0]})}}}}this.populatePlotData=function(j,Q){this._plotData=[];this._stackData=[];j._stackData=[];j._plotData=[];var N={x:[],y:[]};if(this.stackSeries&&!j.disableStack){j._stack=true;var P=j._stackAxis=="x"?0:1;var O=P?0:1;var M=C.extend(true,[],j.data);var q=C.extend(true,[],j.data);for(var l=0;l<Q;l++){var o=this.series[l].data;for(var n=0;n<o.length;n++){M[n][0]+=o[n][0];M[n][1]+=o[n][1];q[n][P]+=o[n][P]}}for(var k=0;k<q.length;k++){N.x.push(q[k][0]);N.y.push(q[k][1])}this._plotData.push(q);this._stackData.push(M);j._stackData=M;j._plotData=q;j._plotValues=N}else{for(var k=0;k<j.data.length;k++){N.x.push(j.data[k][0]);N.y.push(j.data[k][1])}this._stackData.push(j.data);this.series[Q]._stackData=j.data;this._plotData.push(j.data);j._plotData=j.data;j._plotValues=N}if(Q>0){j._prevPlotData=this.series[Q-1]._plotData}j._sumy=0;j._sumx=0;for(k=j.data.length-1;k>-1;k--){j._sumy+=j.data[k][1];j._sumx+=j.data[k][0]}};this.getNextSeriesColor=(function(j){var k=0;var l=j.seriesColors;return function(){if(k<l.length){return l[k++]}else{k=0;return l[k++]}}})(this);this.parseOptions=function(q){for(var O=0;O<C.jqplot.preParseOptionsHooks.length;O++){C.jqplot.preParseOptionsHooks[O].call(this,q)}this.options=C.extend(true,{},this.defaults,q);this.stackSeries=this.options.stackSeries;if(this.options.seriesColors){this.seriesColors=this.options.seriesColors}var o=new this.colorGenerator(this.seriesColors);C.extend(true,this._gridPadding,this.options.gridPadding);this.sortData=(this.options.sortData!=null)?this.options.sortData:this.sortData;for(var n in this.axes){var k=this.axes[n];C.extend(true,k,this.options.axesDefaults,this.options.axes[n]);k._plotWidth=this._width;k._plotHeight=this._height}if(this.data.length==0){this.data=[];for(var O=0;O<this.options.series.length;O++){this.data.push(this.options.series.data)}}var N=function(P,R){var S=[];var Q;R=R||"vertical";if(!(P[0] instanceof Array)){for(var Q=0;Q<P.length;Q++){if(R=="vertical"){S.push([Q+1,P[Q]])}else{S.push([P[Q],Q+1])}}}else{C.extend(true,S,P)}return S};for(var O=0;O<this.data.length;O++){var M=new x();for(var j=0;j<C.jqplot.preParseSeriesOptionsHooks.length;j++){C.jqplot.preParseSeriesOptionsHooks[j].call(M,this.options.seriesDefaults,this.options.series[O])}C.extend(true,M,{seriesColors:this.seriesColors,negativeSeriesColors:this.negativeSeriesColors},this.options.seriesDefaults,this.options.series[O]);var l="vertical";if(M.renderer.constructor==C.jqplot.barRenderer&&M.rendererOptions&&M.rendererOptions.barDirection=="horizontal"){l="horizontal"}M.data=N(this.data[O],l);switch(M.xaxis){case"xaxis":M._xaxis=this.axes.xaxis;break;case"x2axis":M._xaxis=this.axes.x2axis;break;default:break}M._yaxis=this.axes[M.yaxis];M._xaxis._series.push(M);M._yaxis._series.push(M);if(M.show){M._xaxis.show=true;M._yaxis.show=true}if(!M.color&&M.show!=false){M.color=o.next()}if(!M.label){M.label="Series "+(O+1).toString()}this.series.push(M);for(var j=0;j<C.jqplot.postParseSeriesOptionsHooks.length;j++){C.jqplot.postParseSeriesOptionsHooks[j].call(this.series[O],this.options.seriesDefaults,this.options.series[O])}}C.extend(true,this.grid,this.options.grid);for(var n in this.axes){var k=this.axes[n];if(k.borderWidth==null){k.borderWidth=this.grid.borderWidth}if(k.borderColor==null){if(n!="xaxis"&&n!="x2axis"&&k.useSeriesColor===true&&k.show){k.borderColor=k._series[0].color}else{k.borderColor=this.grid.borderColor}}}if(typeof this.options.title=="string"){this.title.text=this.options.title}else{if(typeof this.options.title=="object"){C.extend(true,this.title,this.options.title)}}this.title._plotWidth=this._width;C.extend(true,this.legend,this.options.legend);for(var O=0;O<C.jqplot.postParseOptionsHooks.length;O++){C.jqplot.postParseOptionsHooks[O].call(this,q)}};this.replot=function(j){var n=(j!=H)?j:{};var l=(n.clear!=H)?n.clear:true;var k=(n.resetAxes!=H)?n.resetAxes:false;this.target.trigger("jqplotPreReplot");if(l){this.target.empty()}if(k){this.resetAxesScale(k)}this.reInitialize();this.draw();this.target.trigger("jqplotPostReplot")};this.redraw=function(k){k=(k!=null)?k:true;this.target.trigger("jqplotPreRedraw");if(k){this.target.empty()}for(var l in this.axes){this.axes[l]._ticks=[]}for(var j=0;j<this.series.length;j++){this.populatePlotData(this.series[j],j)}this._sumy=0;this._sumx=0;for(j=0;j<this.series.length;j++){this._sumy+=this.series[j]._sumy;this._sumx+=this.series[j]._sumx}this.draw();this.target.trigger("jqplotPostRedraw")};this.draw=function(){if(this.drawIfHidden||this.target.is(":visible")){this.target.trigger("jqplotPreDraw");var O;for(O=0;O<C.jqplot.preDrawHooks.length;O++){C.jqplot.preDrawHooks[O].call(this)}this.target.append(this.baseCanvas.createElement({left:0,right:0,top:0,bottom:0},"jqplot-base-canvas"));var P=this.baseCanvas.setContext();this.target.append(this.title.draw());this.title.pack({top:0,left:0});for(var l in this.axes){this.target.append(this.axes[l].draw(P));this.axes[l].set()}if(this.axes.yaxis.show){this._gridPadding.left=this.axes.yaxis.getWidth()}var k=["y2axis","y3axis","y4axis","y5axis","y6axis","y7axis","y8axis","y9axis"];var n=[0,0,0,0];var M=0;var j,o;for(j=8;j>0;j--){o=this.axes[k[j-1]];if(o.show){n[j-1]=M;M+=o.getWidth()}}if(M>this._gridPadding.right){this._gridPadding.right=M}if(this.title.show&&this.axes.x2axis.show){this._gridPadding.top=this.title.getHeight()+this.axes.x2axis.getHeight()}else{if(this.title.show){this._gridPadding.top=this.title.getHeight()}else{if(this.axes.x2axis.show){this._gridPadding.top=this.axes.x2axis.getHeight()}}}if(this.axes.xaxis.show){this._gridPadding.bottom=this.axes.xaxis.getHeight()}this.axes.xaxis.pack({position:"absolute",bottom:0,left:0,width:this._width},{min:this._gridPadding.left,max:this._width-this._gridPadding.right});this.axes.yaxis.pack({position:"absolute",top:0,left:0,height:this._height},{min:this._height-this._gridPadding.bottom,max:this._gridPadding.top});this.axes.x2axis.pack({position:"absolute",top:this.title.getHeight(),left:0,width:this._width},{min:this._gridPadding.left,max:this._width-this._gridPadding.right});for(O=8;O>0;O--){this.axes[k[O-1]].pack({position:"absolute",top:0,right:n[O-1]},{min:this._height-this._gridPadding.bottom,max:this._gridPadding.top})}this.target.append(this.grid.createElement(this._gridPadding));this.grid.draw();for(O=0;O<this.series.length;O++){this.target.append(this.series[O].shadowCanvas.createElement(this._gridPadding,"jqplot-series-canvas jqplot-shadow"));this.series[O].shadowCanvas.setContext()}for(O=0;O<this.series.length;O++){this.target.append(this.series[O].canvas.createElement(this._gridPadding,"jqplot-series-canvas"));this.series[O].canvas.setContext()}this.target.append(this.eventCanvas.createElement(this._gridPadding,"jqplot-event-canvas"));var q=this.eventCanvas.setContext();q.fillStyle="rgba(0,0,0,0)";q.fillRect(0,0,q.canvas.width,q.canvas.height);this.bindCustomEvents();if(this.legend.preDraw){this.target.append(this.legend.draw());this.legend.pack(this._gridPadding);if(this.legend._elem){this.drawSeries({legendInfo:{location:this.legend.location,width:this.legend.getWidth(),height:this.legend.getHeight(),xoffset:this.legend.xoffset,yoffset:this.legend.yoffset}})}else{this.drawSeries()}}else{this.drawSeries();C(this.series[this.series.length-1].canvas._elem).after(this.legend.draw());this.legend.pack(this._gridPadding)}for(var O=0;O<C.jqplot.eventListenerHooks.length;O++){var N=C.jqplot.eventListenerHooks[O];this.eventCanvas._elem.bind(N[0],{plot:this},N[1])}for(var O=0;O<C.jqplot.postDrawHooks.length;O++){C.jqplot.postDrawHooks[O].call(this)}if(this.target.is(":visible")){this._drawCount+=1}this.target.trigger("jqplotPostDraw",[this])}};this.bindCustomEvents=function(){this.eventCanvas._elem.bind("click",{plot:this},this.onClick);this.eventCanvas._elem.bind("dblclick",{plot:this},this.onDblClick);this.eventCanvas._elem.bind("mousedown",{plot:this},this.onMouseDown);this.eventCanvas._elem.bind("mouseup",{plot:this},this.onMouseUp);this.eventCanvas._elem.bind("mousemove",{plot:this},this.onMouseMove);this.eventCanvas._elem.bind("mouseenter",{plot:this},this.onMouseEnter);this.eventCanvas._elem.bind("mouseleave",{plot:this},this.onMouseLeave)};function e(q){var M=q.data.plot;var k=M.eventCanvas._elem.offset();var N={x:q.pageX-k.left,y:q.pageY-k.top};var j={xaxis:null,yaxis:null,x2axis:null,y2axis:null,y3axis:null,y4axis:null,y5axis:null,y6axis:null,y7axis:null,y8axis:null,y9axis:null};var O=["xaxis","yaxis","x2axis","y2axis","y3axis","y4axis","y5axis","y6axis","y7axis","y8axis","y9axis"];var o=M.axes;for(var n=11;n>0;n--){var l=O[n-1];if(o[l].show){j[l]=o[l].series_p2u(N[l.charAt(0)])}}return({offsets:k,gridPos:N,dataPos:j})}function b(Q,M,N){var P=null;var q,j,l,O,k,n;var R;for(var j=0;j<Q.series.length;j++){q=Q.series[j];n=q.renderer;if(q.show){R=Math.abs(q.markerRenderer.size/2+q.neighborThreshold);for(var k=0;k<q.gridData.length;k++){p=q.gridData[k];if(n.constructor==C.jqplot.OHLCRenderer){if(n.candleStick){var o=q._yaxis.series_u2p;if(M>=p[0]-n._bodyWidth/2&&M<=p[0]+n._bodyWidth/2&&N>=o(q.data[k][2])&&N<=o(q.data[k][3])){P={seriesIndex:j,pointIndex:k,gridData:p,data:q.data[k]}}}else{if(!n.hlc){var o=q._yaxis.series_u2p;if(M>=p[0]-n._tickLength&&M<=p[0]+n._tickLength&&N>=o(q.data[k][2])&&N<=o(q.data[k][3])){P={seriesIndex:j,pointIndex:k,gridData:p,data:q.data[k]}}}else{var o=q._yaxis.series_u2p;if(M>=p[0]-n._tickLength&&M<=p[0]+n._tickLength&&N>=o(q.data[k][1])&&N<=o(q.data[k][2])){P={seriesIndex:j,pointIndex:k,gridData:p,data:q.data[k]}}}}}else{O=Math.sqrt((M-p[0])*(M-p[0])+(N-p[1])*(N-p[1]));if(O<=R&&(O<=l||l==null)){l=O;P={seriesIndex:j,pointIndex:k,gridData:p,data:q.data[k]}}}}}}return P}this.onClick=function(j){var l=e(j);var k=j.data.plot;var n=b(k,l.gridPos.x,l.gridPos.y);j.data.plot.eventCanvas._elem.trigger("jqplotClick",[l.gridPos,l.dataPos,n,k])};this.onDblClick=function(j){var l=e(j);var k=j.data.plot;var n=b(k,l.gridPos.x,l.gridPos.y);j.data.plot.eventCanvas._elem.trigger("jqplotDblClick",[l.gridPos,l.dataPos,n,k])};this.onMouseDown=function(j){var l=e(j);var k=j.data.plot;var n=b(k,l.gridPos.x,l.gridPos.y);j.data.plot.eventCanvas._elem.trigger("jqplotMouseDown",[l.gridPos,l.dataPos,n,k])};this.onMouseUp=function(j){var k=e(j);j.data.plot.eventCanvas._elem.trigger("jqplotMouseUp",[k.gridPos,k.dataPos,null,j.data.plot])};this.onMouseMove=function(j){var l=e(j);var k=j.data.plot;var n=b(k,l.gridPos.x,l.gridPos.y);j.data.plot.eventCanvas._elem.trigger("jqplotMouseMove",[l.gridPos,l.dataPos,n,k])};this.onMouseEnter=function(j){var k=e(j);var l=j.data.plot;j.data.plot.eventCanvas._elem.trigger("jqplotMouseEnter",[k.gridPos,k.dataPos,null,l])};this.onMouseLeave=function(j){var k=e(j);var l=j.data.plot;j.data.plot.eventCanvas._elem.trigger("jqplotMouseLeave",[k.gridPos,k.dataPos,null,l])};this.drawSeries=function(o,n){var k,l,j;if(n!=H){l=this.series[n];j=l.shadowCanvas._ctx;j.clearRect(0,0,j.canvas.width,j.canvas.height);l.drawShadow(j,o,this);j=l.canvas._ctx;j.clearRect(0,0,j.canvas.width,j.canvas.height);l.draw(j,o,this)}else{for(k=0;k<this.series.length;k++){l=this.series[k];j=l.shadowCanvas._ctx;j.clearRect(0,0,j.canvas.width,j.canvas.height);l.drawShadow(j,o,this);j=l.canvas._ctx;j.clearRect(0,0,j.canvas.width,j.canvas.height);l.draw(j,o,this)}}}}C.jqplot.ColorGenerator=function(b){var e=0;this.next=function(){if(e<b.length){return b[e++]}else{e=0;return b[e++]}};this.previous=function(){if(e>0){return b[e--]}else{e=b.length-1;return b[e]}};this.get=function(g){return b[g]};this.setColors=function(g){b=g};this.reset=function(){e=0}};C.jqplot.hex2rgb=function(b,g){b=b.replace("#","");if(b.length==3){b=b[0]+b[0]+b[1]+b[1]+b[2]+b[2]}var e;e="rgba("+parseInt(b.slice(0,2),16)+", "+parseInt(b.slice(2,4),16)+", "+parseInt(b.slice(4,6),16);if(g){e+=", "+g}e+=")";return e};C.jqplot.rgb2hex=function(h){var b=/rgba?\( *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *(?:, *[0-9.]*)?\)/;var g=h.match(b);var j="#";for(i=1;i<4;i++){var e;if(g[i].search(/%/)!=-1){e=parseInt(255*g[i]/100,10).toString(16);if(e.length==1){e="0"+e}}else{e=parseInt(g[i],10).toString(16);if(e.length==1){e="0"+e}}j+=e}return j};C.jqplot.normalize2rgb=function(b,e){if(b.search(/^ *rgba?\(/)!=-1){return b}else{if(b.search(/^ *#?[0-9a-fA-F]?[0-9a-fA-F]/)!=-1){return C.jqplot.hex2rgb(b,e)}else{throw"invalid color spec"}}};C.jqplot.getColorComponents=function(h){var j=C.jqplot.normalize2rgb(h);var b=/rgba?\( *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *,? *([0-9.]* *)?\)/;var g=j.match(b);var e=[];for(i=1;i<4;i++){if(g[i].search(/%/)!=-1){e[i-1]=parseInt(255*g[i]/100,10)}else{e[i-1]=parseInt(g[i],10)}}e[3]=parseFloat(g[4])?parseFloat(g[4]):1;return e};C.jqplot.log=function(){if(window.console&&C.jqplot.debug){if(arguments.length==1){console.log(arguments[0])}else{console.log(arguments)}}};var E=C.jqplot.log;C.jqplot.AxisLabelRenderer=function(b){C.jqplot.ElemContainer.call(this);this.axis;this.show=true;this.label="";this._elem;this.escapeHTML=false;C.extend(true,this,b)};C.jqplot.AxisLabelRenderer.prototype=new C.jqplot.ElemContainer();C.jqplot.AxisLabelRenderer.prototype.constructor=C.jqplot.AxisLabelRenderer;C.jqplot.AxisLabelRenderer.prototype.init=function(b){C.extend(true,this,b)};C.jqplot.AxisLabelRenderer.prototype.draw=function(){this._elem=C('<div style="position:absolute;" class="jqplot-'+this.axis+'-label"></div>');if(Number(this.label)){this._elem.css("white-space","nowrap")}if(!this.escapeHTML){this._elem.html(this.label)}else{this._elem.text(this.label)}return this._elem};C.jqplot.AxisLabelRenderer.prototype.pack=function(){};C.jqplot.AxisTickRenderer=function(b){C.jqplot.ElemContainer.call(this);this.mark="outside";this.axis;this.showMark=true;this.showGridline=true;this.isMinorTick=false;this.size=4;this.markSize=6;this.show=true;this.showLabel=true;this.label="";this.value=null;this._styles={};this.formatter=C.jqplot.DefaultTickFormatter;this.formatString="";this.fontFamily;this.fontSize;this.textColor;this._elem;C.extend(true,this,b)};C.jqplot.AxisTickRenderer.prototype.init=function(b){C.extend(true,this,b)};C.jqplot.AxisTickRenderer.prototype=new C.jqplot.ElemContainer();C.jqplot.AxisTickRenderer.prototype.constructor=C.jqplot.AxisTickRenderer;C.jqplot.AxisTickRenderer.prototype.setTick=function(g,b,e){this.value=g;this.axis=b;if(e){this.isMinorTick=true}return this};C.jqplot.AxisTickRenderer.prototype.draw=function(){if(!this.label){this.label=this.formatter(this.formatString,this.value)}style='style="position:absolute;';if(Number(this.label)){style+="white-space:nowrap;"}style+='"';this._elem=C("<div "+style+' class="jqplot-'+this.axis+'-tick">'+this.label+"</div>");for(var b in this._styles){this._elem.css(b,this._styles[b])}if(this.fontFamily){this._elem.css("font-family",this.fontFamily)}if(this.fontSize){this._elem.css("font-size",this.fontSize)}if(this.textColor){this._elem.css("color",this.textColor)}return this._elem};C.jqplot.DefaultTickFormatter=function(e,b){if(typeof b=="number"){if(!e){e="%.1f"}return C.jqplot.sprintf(e,b)}else{return String(b)}};C.jqplot.AxisTickRenderer.prototype.pack=function(){};C.jqplot.CanvasGridRenderer=function(){this.shadowRenderer=new C.jqplot.ShadowRenderer()};C.jqplot.CanvasGridRenderer.prototype.init=function(b){this._ctx;C.extend(true,this,b);var e={lineJoin:"miter",lineCap:"round",fill:false,isarc:false,angle:this.shadowAngle,offset:this.shadowOffset,alpha:this.shadowAlpha,depth:this.shadowDepth,lineWidth:this.shadowWidth,closePath:false};this.renderer.shadowRenderer.init(e)};C.jqplot.CanvasGridRenderer.prototype.createElement=function(){var g=document.createElement("canvas");var e=this._plotDimensions.width;var b=this._plotDimensions.height;g.width=e;g.height=b;this._elem=C(g);this._elem.addClass("jqplot-grid-canvas");this._elem.css({position:"absolute",left:0,top:0});if(C.browser.msie){window.G_vmlCanvasManager.init_(document)}if(C.browser.msie){g=window.G_vmlCanvasManager.initElement(g)}this._top=this._offsets.top;this._bottom=b-this._offsets.bottom;this._left=this._offsets.left;this._right=e-this._offsets.right;this._width=this._right-this._left;this._height=this._bottom-this._top;return this._elem};C.jqplot.CanvasGridRenderer.prototype.draw=function(){this._ctx=this._elem.get(0).getContext("2d");var k=this._ctx;var S=this._axes;k.save();k.fillStyle=this.background;k.fillRect(this._left,this._top,this._width,this._height);if(this.drawGridlines){k.save();k.lineJoin="miter";k.lineCap="butt";k.lineWidth=this.gridLineWidth;k.strokeStyle=this.gridLineColor;var Q,b;var P=["xaxis","yaxis","x2axis","y2axis"];for(var h=4;h>0;h--){var N=P[h-1];var n=S[N];var O=n._ticks;if(n.show){for(var j=O.length;j>0;j--){var l=O[j-1];if(l.show){var R=Math.round(n.u2p(l.value))+0.5;switch(N){case"xaxis":if(l.showGridline){e(R,this._top,R,this._bottom)}if(l.showMark&&l.mark){s=l.markSize;m=l.mark;var R=Math.round(n.u2p(l.value))+0.5;switch(m){case"outside":Q=this._bottom;b=this._bottom+s;break;case"inside":Q=this._bottom-s;b=this._bottom;break;case"cross":Q=this._bottom-s;b=this._bottom+s;break;default:Q=this._bottom;b=this._bottom+s;break}if(this.shadow){this.renderer.shadowRenderer.draw(k,[[R,Q],[R,b]],{lineCap:"butt",lineWidth:this.gridLineWidth,offset:this.gridLineWidth*0.75,depth:2,fill:false,closePath:false})}e(R,Q,R,b)}break;case"yaxis":if(l.showGridline){e(this._right,R,this._left,R)}if(l.showMark&&l.mark){s=l.markSize;m=l.mark;var R=Math.round(n.u2p(l.value))+0.5;switch(m){case"outside":Q=this._left-s;b=this._left;break;case"inside":Q=this._left;b=this._left+s;break;case"cross":Q=this._left-s;b=this._left+s;break;default:Q=this._left-s;b=this._left;break}if(this.shadow){this.renderer.shadowRenderer.draw(k,[[Q,R],[b,R]],{lineCap:"butt",lineWidth:this.gridLineWidth*1.5,offset:this.gridLineWidth*0.75,fill:false,closePath:false})}e(Q,R,b,R,{strokeStyle:n.borderColor})}break;case"x2axis":if(l.showGridline){e(R,this._bottom,R,this._top)}if(l.showMark&&l.mark){s=l.markSize;m=l.mark;var R=Math.round(n.u2p(l.value))+0.5;switch(m){case"outside":Q=this._top-s;b=this._top;break;case"inside":Q=this._top;b=this._top+s;break;case"cross":Q=this._top-s;b=this._top+s;break;default:Q=this._top-s;b=this._top;break}if(this.shadow){this.renderer.shadowRenderer.draw(k,[[R,Q],[R,b]],{lineCap:"butt",lineWidth:this.gridLineWidth,offset:this.gridLineWidth*0.75,depth:2,fill:false,closePath:false})}e(R,Q,R,b)}break;case"y2axis":if(l.showGridline){e(this._left,R,this._right,R)}if(l.showMark&&l.mark){s=l.markSize;m=l.mark;var R=Math.round(n.u2p(l.value))+0.5;switch(m){case"outside":Q=this._right;b=this._right+s;break;case"inside":Q=this._right-s;b=this._right;break;case"cross":Q=this._right-s;b=this._right+s;break;default:Q=this._right;b=this._right+s;break}if(this.shadow){this.renderer.shadowRenderer.draw(k,[[Q,R],[b,R]],{lineCap:"butt",lineWidth:this.gridLineWidth*1.5,offset:this.gridLineWidth*0.75,fill:false,closePath:false})}e(Q,R,b,R,{strokeStyle:n.borderColor})}break;default:break}}}}}P=["y3axis","y4axis","y5axis","y6axis","y7axis","y8axis","y9axis"];for(var h=7;h>0;h--){var n=S[P[h-1]];var O=n._ticks;if(n.show){var q=O[n.numberTicks-1];var g=O[0];var o=n.getLeft();var M=[[o,q.getTop()+q.getHeight()/2],[o,g.getTop()+g.getHeight()/2+1]];if(this.shadow){this.renderer.shadowRenderer.draw(k,M,{lineCap:"butt",fill:false,closePath:false})}e(M[0][0],M[0][1],M[1][0],M[1][1],{lineCap:"butt",strokeStyle:n.borderColor,lineWidth:n.borderWidth});for(var j=O.length;j>0;j--){var l=O[j-1];s=l.markSize;m=l.mark;var R=Math.round(n.u2p(l.value))+0.5;if(l.showMark&&l.mark){switch(m){case"outside":Q=o;b=o+s;break;case"inside":Q=o-s;b=o;break;case"cross":Q=o-s;b=o+s;break;default:Q=o;b=o+s;break}M=[[Q,R],[b,R]];if(this.shadow){this.renderer.shadowRenderer.draw(k,M,{lineCap:"butt",lineWidth:this.gridLineWidth*1.5,offset:this.gridLineWidth*0.75,fill:false,closePath:false})}e(Q,R,b,R,{strokeStyle:n.borderColor})}}}}k.restore()}function e(T,U,W,X,V){k.save();V=V||{};C.extend(true,k,V);k.beginPath();k.moveTo(T,U);k.lineTo(W,X);k.stroke();k.restore()}if(this.shadow){var M=[[this._left,this._bottom],[this._right,this._bottom],[this._right,this._top]];this.renderer.shadowRenderer.draw(k,M)}e(this._left,this._top,this._right,this._top,{lineCap:"round",strokeStyle:S.x2axis.borderColor,lineWidth:S.x2axis.borderWidth});e(this._right,this._top,this._right,this._bottom,{lineCap:"round",strokeStyle:S.y2axis.borderColor,lineWidth:S.y2axis.borderWidth});e(this._right,this._bottom,this._left,this._bottom,{lineCap:"round",strokeStyle:S.xaxis.borderColor,lineWidth:S.xaxis.borderWidth});e(this._left,this._bottom,this._left,this._top,{lineCap:"round",strokeStyle:S.yaxis.borderColor,lineWidth:S.yaxis.borderWidth});k.restore()};var v=24*60*60*1000;var B=function(e,b){e=String(e);while(e.length<b){e="0"+e}return e};var F={millisecond:1,second:1000,minute:60*1000,hour:60*60*1000,day:v,week:7*v,month:{add:function(b,g){F.year.add(b,Math[g>0?"floor":"ceil"](g/12));var e=b.getMonth()+(g%12);if(e==12){e=0;b.setYear(b.getFullYear()+1)}else{if(e==-1){e=11;b.setYear(b.getFullYear()-1)}}b.setMonth(e)},diff:function(h,b){var g=h.getFullYear()-b.getFullYear();var e=h.getMonth()-b.getMonth()+(g*12);var j=h.getDate()-b.getDate();return e+(j/30)}},year:{add:function(b,e){b.setYear(b.getFullYear()+Math[e>0?"floor":"ceil"](e))},diff:function(b,e){return F.month.diff(b,e)/12}}};for(var K in F){if(K.substring(K.length-1)!="s"){F[K+"s"]=F[K]}}var L=function(h,b){if(Date.prototype.strftime.formatShortcuts[b]){return h.strftime(Date.prototype.strftime.formatShortcuts[b])}else{var g=(Date.prototype.strftime.formatCodes[b]||"").split(".");var e=h["get"+g[0]]?h["get"+g[0]]():"";if(g[1]){e=B(e,g[1])}return e}};var w={succ:function(b){return this.clone().add(1,b)},add:function(b,e){var g=F[e]||F.day;if(typeof g=="number"){this.setTime(this.getTime()+(g*b))}else{g.add(this,b)}return this},diff:function(e,h,g){e=Date.create(e);if(e===null){return null}var b=F[h]||F.day;if(typeof b=="number"){var j=(this.getTime()-e.getTime())/b}else{var j=b.diff(this,e)}return(g?j:Math[j>0?"floor":"ceil"](j))},strftime:function(e){var h=e||"%Y-%m-%d",g="",b;while(h.length>0){if(b=h.match(Date.prototype.strftime.formatCodes.matcher)){g+=h.slice(0,b.index);g+=(b[1]||"")+L(this,b[2]);h=h.slice(b.index+b[0].length)}else{g+=h;h=""}}return g},getShortYear:function(){return this.getYear()%100},getMonthNumber:function(){return this.getMonth()+1},getMonthName:function(){return Date.MONTHNAMES[this.getMonth()]},getAbbrMonthName:function(){return Date.ABBR_MONTHNAMES[this.getMonth()]},getDayName:function(){return Date.DAYNAMES[this.getDay()]},getAbbrDayName:function(){return Date.ABBR_DAYNAMES[this.getDay()]},getDayOrdinal:function(){return Date.ORDINALNAMES[this.getDate()%10]},getHours12:function(){var b=this.getHours();return b>12?b-12:(b==0?12:b)},getAmPm:function(){return this.getHours()>=12?"PM":"AM"},getUnix:function(){return Math.round(this.getTime()/1000,0)},getGmtOffset:function(){var e=this.getTimezoneOffset()/60;var b=e<0?"+":"-";e=Math.abs(e);return b+B(Math.floor(e),2)+":"+B((e%1)*60,2)},getTimezoneName:function(){var b=/(?:\((.+)\)$| ([A-Z]{3}) )/.exec(this.toString());return b[1]||b[2]||"GMT"+this.getGmtOffset()},toYmdInt:function(){return(this.getFullYear()*10000)+(this.getMonthNumber()*100)+this.getDate()},clone:function(){return new Date(this.getTime())}};for(var J in w){Date.prototype[J]=w[J]}var G={create:function(h){if(h instanceof Date){return h}if(typeof h=="number"){return new Date(h)}var e=String(h).replace(/^\s*(.+)\s*$/,"$1"),g=0,b=Date.create.patterns.length,k;var j=e;while(g<b){ms=Date.parse(j);if(!isNaN(ms)){return new Date(ms)}k=Date.create.patterns[g];if(typeof k=="function"){obj=k(j);if(obj instanceof Date){return obj}}else{j=e.replace(k[0],k[1])}g++}return NaN},MONTHNAMES:"January February March April May June July August September October November December".split(" "),ABBR_MONTHNAMES:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),DAYNAMES:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),ABBR_DAYNAMES:"Sun Mon Tue Wed Thu Fri Sat".split(" "),ORDINALNAMES:"th st nd rd th th th th th th".split(" "),ISO:"%Y-%m-%dT%H:%M:%S.%N%G",SQL:"%Y-%m-%d %H:%M:%S",daysInMonth:function(e,b){if(b==2){return new Date(e,1,29).getDate()==29?29:28}return[H,31,H,31,30,31,30,31,31,30,31,30,31][b]}};for(var J in G){Date[J]=G[J]}Date.prototype.strftime.formatCodes={matcher:/()%(#?(%|[a-z]))/i,Y:"FullYear",y:"ShortYear.2",m:"MonthNumber.2","#m":"MonthNumber",B:"MonthName",b:"AbbrMonthName",d:"Date.2","#d":"Date",e:"Date",A:"DayName",a:"AbbrDayName",w:"Day",o:"DayOrdinal",H:"Hours.2","#H":"Hours",I:"Hours12.2","#I":"Hours12",p:"AmPm",M:"Minutes.2","#M":"Minutes",S:"Seconds.2","#S":"Seconds",s:"Unix",N:"Milliseconds.3","#N":"Milliseconds",O:"TimezoneOffset",Z:"TimezoneName",G:"GmtOffset"};Date.prototype.strftime.formatShortcuts={F:"%Y-%m-%d",T:"%H:%M:%S",X:"%H:%M:%S",x:"%m/%d/%y",D:"%m/%d/%y","#c":"%a %b %e %H:%M:%S %Y",v:"%e-%b-%Y",R:"%H:%M",r:"%I:%M:%S %p",t:"\t",n:"\n","%":"%"};Date.create.patterns=[[/-/g,"/"],[/st|nd|rd|th/g,""],[/(3[01]|[0-2]\d)\s*\.\s*(1[0-2]|0\d)\s*\.\s*([1-9]\d{3})/,"$2/$1/$3"],[/([1-9]\d{3})\s*-\s*(1[0-2]|0\d)\s*-\s*(3[01]|[0-2]\d)/,"$2/$3/$1"],function(h){var e=h.match(/^(?:(.+)\s+)?([012]?\d)(?:\s*\:\s*(\d\d))?(?:\s*\:\s*(\d\d(\.\d*)?))?\s*(am|pm)?\s*$/i);if(e){if(e[1]){var b=Date.create(e[1]);if(isNaN(b)){return}}else{var b=new Date();b.setMilliseconds(0)}var g=parseFloat(e[2]);if(e[6]){g=e[6].toLowerCase()=="am"?(g==12?0:g):(g==12?12:g+12)}b.setHours(g,parseInt(e[3]||0,10),parseInt(e[4]||0,10),((parseFloat(e[5]||0))||0)*1000);return b}else{return h}},function(h){var e=h.match(/^(?:(.+))[T|\s+]([012]\d)(?:\:(\d\d))(?:\:(\d\d))(?:\.\d+)([\+\-]\d\d\:\d\d)$/i);if(e){if(e[1]){var b=Date.create(e[1]);if(isNaN(b)){return}}else{var b=new Date();b.setMilliseconds(0)}var g=parseFloat(e[2]);b.setHours(g,parseInt(e[3],10),parseInt(e[4],10),parseFloat(e[5])*1000);return b}else{return h}},function(h){var k=h.match(/^([0-3]?\d)\s*[-\/.\s]{1}\s*([a-zA-Z]{3,9})\s*[-\/.\s]{1}\s*([0-3]?\d)$/);if(k){var j=new Date();var g=parseFloat(String(j.getFullYear()).slice(2,4));var e=parseInt(String(j.getFullYear())/100,10)*100;var M=1;var q=parseFloat(k[1]);var b=parseFloat(k[3]);var l,n,o;if(q>31){n=k[3];if(q<g+M){l=e+q}else{l=e-100+q}}else{n=k[1];if(b<g+M){l=e+b}else{l=e-100+b}}var o=C.inArray(k[2],Date.ABBR_MONTHNAMES);if(o==-1){o=C.inArray(k[2],Date.MONTHNAMES)}j.setFullYear(l,o,n);j.setHours(0,0,0,0);return j}else{return h}}];if(C.jqplot.config.debug){C.date=Date.create}C.jqplot.DivTitleRenderer=function(){};C.jqplot.DivTitleRenderer.prototype.init=function(b){C.extend(true,this,b)};C.jqplot.DivTitleRenderer.prototype.draw=function(){var b=this.renderer;if(!this.text){this.show=false;this._elem=C('<div style="height:0px;width:0px;"></div>')}else{if(this.text){var e="position:absolute;top:0px;left:0px;";e+=(this._plotWidth)?"width:"+this._plotWidth+"px;":"";e+=(this.fontFamily)?"font-family:"+this.fontFamily+";":"";e+=(this.fontSize)?"font-size:"+this.fontSize+";":"";e+=(this.textAlign)?"text-align:"+this.textAlign+";":"text-align:center;";e+=(this.textColor)?"color:"+this.textColor+";":"";this._elem=C('<div class="jqplot-title" style="'+e+'">'+this.text+"</div>")}}return this._elem};C.jqplot.DivTitleRenderer.prototype.pack=function(){};C.jqplot.LineRenderer=function(){this.shapeRenderer=new C.jqplot.ShapeRenderer();this.shadowRenderer=new C.jqplot.ShadowRenderer()};C.jqplot.LineRenderer.prototype.init=function(e){C.extend(true,this.renderer,e);var h={lineJoin:"round",lineCap:"round",fill:this.fill,isarc:false,strokeStyle:this.color,fillStyle:this.fillColor,lineWidth:this.lineWidth,closePath:this.fill};this.renderer.shapeRenderer.init(h);if(this.lineWidth>2.5){var b=this.shadowOffset*(1+(Math.atan((this.lineWidth/2.5))/0.785398163-1)*0.6)}else{var b=this.shadowOffset*Math.atan((this.lineWidth/2.5))/0.785398163}var g={lineJoin:"round",lineCap:"round",fill:this.fill,isarc:false,angle:this.shadowAngle,offset:b,alpha:this.shadowAlpha,depth:this.shadowDepth,lineWidth:this.lineWidth,closePath:this.fill};this.renderer.shadowRenderer.init(g)};C.jqplot.LineRenderer.prototype.setGridData=function(e){var g=this._xaxis.series_u2p;var j=this._yaxis.series_u2p;var b=this._plotData;var k=this._prevPlotData;this.gridData=[];this._prevGridData=[];for(var h=0;h<this.data.length;h++){if(b[h]!=null){this.gridData.push([g.call(this._xaxis,b[h][0]),j.call(this._yaxis,b[h][1])])}if(k[h]!=null){this._prevGridData.push([g.call(this._xaxis,k[h][0]),j.call(this._yaxis,k[h][1])])}}};C.jqplot.LineRenderer.prototype.makeGridData=function(l,e){var b=this._xaxis.series_u2p;var j=this._yaxis.series_u2p;var g=[];var k=[];for(var h=0;h<l.length;h++){if(l[h]!=null){g.push([b.call(this._xaxis,l[h][0]),j.call(this._yaxis,l[h][1])])}}return g};C.jqplot.LineRenderer.prototype.draw=function(T,g,S){var k;var W=(S!=H)?S:{};var o=(W.shadow!=H)?W.shadow:this.shadow;var b=(W.showLine!=H)?W.showLine:this.showLine;var n=(W.fill!=H)?W.fill:this.fill;var U=(W.fillAndStroke!=H)?W.fillAndStroke:this.fillAndStroke;T.save();if(g.length){if(b){if(n){if(this.fillToZero){var l=new C.jqplot.ColorGenerator(this.negativeSeriesColors);var j=l.get(this.index);if(!this.useNegativeColors){j=W.fillStyle}var Y=false;var X=W.fillStyle;if(U){var e=g.slice(0)}if(this.index==0||!this._stack){var R=[];var h=this._yaxis.series_u2p(0);var Q=this._xaxis.series_u2p(0);if(this.fillAxis=="y"){R.push([g[0][0],h]);for(var k=0;k<g.length-1;k++){R.push(g[k]);if(this._plotData[k][1]*this._plotData[k+1][1]<0){if(this._plotData[k][1]<0){Y=true;W.fillStyle=j}else{Y=false;W.fillStyle=X}var Z=g[k][0]+(g[k+1][0]-g[k][0])*(h-g[k][1])/(g[k+1][1]-g[k][1]);R.push([Z,h]);if(o){this.renderer.shadowRenderer.draw(T,R,W)}this.renderer.shapeRenderer.draw(T,R,W);R=[[Z,h]]}}if(this._plotData[g.length-1][1]<0){Y=true;W.fillStyle=j}else{Y=false;W.fillStyle=X}R.push(g[g.length-1]);R.push([g[g.length-1][0],h])}if(o){this.renderer.shadowRenderer.draw(T,R,W)}this.renderer.shapeRenderer.draw(T,R,W)}else{var V=this._prevGridData;for(var k=V.length;k>0;k--){g.push(V[k-1])}if(o){this.renderer.shadowRenderer.draw(T,g,W)}this.renderer.shapeRenderer.draw(T,g,W)}}else{if(U){var e=g.slice(0)}if(this.index==0||!this._stack){var aa=T.canvas.height;g.unshift([g[0][0],aa]);len=g.length;g.push([g[len-1][0],aa])}else{var V=this._prevGridData;for(var k=V.length;k>0;k--){g.push(V[k-1])}}if(o){this.renderer.shadowRenderer.draw(T,g,W)}this.renderer.shapeRenderer.draw(T,g,W)}if(U){var q=C.extend(true,{},W,{fill:false,closePath:false});this.renderer.shapeRenderer.draw(T,e,q);if(this.markerRenderer.show){for(k=0;k<e.length;k++){this.markerRenderer.draw(e[k][0],e[k][1],T,W.markerOptions)}}}}else{if(o){this.renderer.shadowRenderer.draw(T,g,W)}this.renderer.shapeRenderer.draw(T,g,W)}}if(this.markerRenderer.show&&!n){for(k=0;k<g.length;k++){this.markerRenderer.draw(g[k][0],g[k][1],T,W.markerOptions)}}}T.restore()};C.jqplot.LineRenderer.prototype.drawShadow=function(g,b,e){};C.jqplot.LinearAxisRenderer=function(){};C.jqplot.LinearAxisRenderer.prototype.init=function(e){C.extend(true,this,e);var h=this._dataBounds;for(var k=0;k<this._series.length;k++){var j=this._series[k];var b=j._plotData;for(var g=0;g<b.length;g++){if(this.name=="xaxis"||this.name=="x2axis"){if(b[g][0]<h.min||h.min==null){h.min=b[g][0]}if(b[g][0]>h.max||h.max==null){h.max=b[g][0]}}else{if(b[g][1]<h.min||h.min==null){h.min=b[g][1]}if(b[g][1]>h.max||h.max==null){h.max=b[g][1]}}}}};C.jqplot.LinearAxisRenderer.prototype.draw=function(h){if(this.show){this.renderer.createTicks.call(this);var l=0;var g;this._elem=C('<div class="jqplot-axis jqplot-'+this.name+'" style="position:absolute;"></div>');if(this.name=="xaxis"||this.name=="x2axis"){this._elem.width(this._plotDimensions.width)}else{this._elem.height(this._plotDimensions.height)}this.labelOptions.axis=this.name;this._label=new this.labelRenderer(this.labelOptions);if(this._label.show){var e=this._label.draw(h);e.appendTo(this._elem)}if(this.showTicks){var j=this._ticks;for(var k=0;k<j.length;k++){var b=j[k];if(b.showLabel&&(!b.isMinorTick||this.showMinorTicks)){var e=b.draw(h);e.appendTo(this._elem)}}}}return this._elem};C.jqplot.LinearAxisRenderer.prototype.reset=function(){this.min=this._min;this.max=this._max;this.tickInterval=this._tickInterval;this.numberTicks=this._numberTicks};C.jqplot.LinearAxisRenderer.prototype.set=function(){var h=0;var n;var e=0;var k=0;var g=(this._label==null)?false:this._label.show;if(this.show&&this.showTicks){var l=this._ticks;for(var b=0;b<l.length;b++){var j=l[b];if(j.showLabel&&(!j.isMinorTick||this.showMinorTicks)){if(this.name=="xaxis"||this.name=="x2axis"){n=j._elem.outerHeight(true)}else{n=j._elem.outerWidth(true)}if(n>h){h=n}}}if(g){e=this._label._elem.outerWidth(true);k=this._label._elem.outerHeight(true)}if(this.name=="xaxis"){h=h+k;this._elem.css({height:h+"px",left:"0px",bottom:"0px"})}else{if(this.name=="x2axis"){h=h+k;this._elem.css({height:h+"px",left:"0px",top:"0px"})}else{if(this.name=="yaxis"){h=h+e;this._elem.css({width:h+"px",left:"0px",top:"0px"});if(g&&this._label.constructor==C.jqplot.AxisLabelRenderer){this._label._elem.css("width",e+"px")}}else{h=h+e;this._elem.css({width:h+"px",right:"0px",top:"0px"});if(g&&this._label.constructor==C.jqplot.AxisLabelRenderer){this._label._elem.css("width",e+"px")}}}}}};C.jqplot.LinearAxisRenderer.prototype.createTicks=function(){var aA=this._ticks;var g=this.ticks;var az=this.name;var aB=this._dataBounds;var n,e;var ad,l;var al,an;var ar,k;if(g.length){for(k=0;k<g.length;k++){var av=g[k];var aq=new this.tickRenderer(this.tickOptions);if(av.constructor==Array){aq.value=av[0];aq.label=av[1];if(!this.showTicks){aq.showLabel=false;aq.showMark=false}else{if(!this.showTickMarks){aq.showMark=false}}aq.setTick(av[0],this.name);this._ticks.push(aq)}else{aq.value=av;if(!this.showTicks){aq.showLabel=false;aq.showMark=false}else{if(!this.showTickMarks){aq.showMark=false}}aq.setTick(av,this.name);this._ticks.push(aq)}}this.numberTicks=g.length;this.min=this._ticks[0].value;this.max=this._ticks[this.numberTicks-1].value;this.tickInterval=(this.max-this.min)/(this.numberTicks-1)}else{if(az=="xaxis"||az=="x2axis"){n=this._plotDimensions.width}else{n=this._plotDimensions.height}if(!this.autoscale&&this.min!=null&&this.max!=null&&this.numberTicks!=null){this.tickInterval=null}ad=((this.min!=null)?this.min:aB.min);l=((this.max!=null)?this.max:aB.max);if(ad==l){var au=0.05;if(ad>0){au=Math.max(Math.log(ad)/Math.LN10,0.05)}ad-=au;l+=au}var aj=l-ad;var ae,o;var h;if(this.autoscale&&this.min==null&&this.max==null){var ak,ai,ah;var at=false;var af=false;var ap={min:null,max:null,average:null,stddev:null};for(var k=0;k<this._series.length;k++){var am=this._series[k];var ax=(am.fillAxis=="x")?am._xaxis.name:am._yaxis.name;if(this.name==ax){var ao=am._plotValues[am.fillAxis];var ay=ao[0];var aw=ao[0];for(var q=1;q<ao.length;q++){if(ao[q]<ay){ay=ao[q]}else{if(ao[q]>aw){aw=ao[q]}}}var ag=(aw-ay)/aw;if(am.renderer.constructor==C.jqplot.BarRenderer){if(ay>=0&&(am.fillToZero||ag>0.1)){at=true}else{at=false;if(am.fill&&am.fillToZero&&ay<0&&aw>0){af=true}else{af=false}}}else{if(am.fill){if(ay>=0&&(am.fillToZero||ag>0.1)){at=true}else{if(ay<0&&aw>0&&am.fillToZero){at=false;af=true}else{at=false;af=false}}}else{if(ay<0){at=false}}}}}if(at){this.numberTicks=2+Math.ceil((n-(this.tickSpacing-1))/this.tickSpacing);this.min=0;ai=l/(this.numberTicks-1);h=Math.pow(10,Math.abs(Math.floor(Math.log(ai)/Math.LN10)));if(ai/h==parseInt(ai/h,10)){ai+=h}this.tickInterval=Math.ceil(ai/h)*h;this.max=this.tickInterval*(this.numberTicks-1)}else{if(af){this.numberTicks=2+Math.ceil((n-(this.tickSpacing-1))/this.tickSpacing);var j=Math.ceil(Math.abs(ad)/aj*(this.numberTicks-1));var b=this.numberTicks-1-j;ai=Math.max(Math.abs(ad/j),Math.abs(l/b));h=Math.pow(10,Math.abs(Math.floor(Math.log(ai)/Math.LN10)));this.tickInterval=Math.ceil(ai/h)*h;this.max=this.tickInterval*b;this.min=-this.tickInterval*j}else{if(this.numberTicks==null){if(this.tickInterval){this.numberTicks=3+Math.ceil(aj/this.tickInterval)}else{this.numberTicks=2+Math.ceil((n-(this.tickSpacing-1))/this.tickSpacing)}}if(this.tickInterval==null){ai=aj/(this.numberTicks-1);if(ai<1){h=Math.pow(10,Math.abs(Math.floor(Math.log(ai)/Math.LN10)))}else{h=1}this.tickInterval=Math.ceil(ai*h*this.pad)/h}else{h=1/this.tickInterval}ak=this.tickInterval*(this.numberTicks-1);ah=(ak-aj)/2;if(this.min==null){this.min=Math.floor(h*(ad-ah))/h}if(this.max==null){this.max=this.min+ak}}}}else{ae=(this.min!=null)?this.min:ad-aj*(this.padMin-1);o=(this.max!=null)?this.max:l+aj*(this.padMax-1);this.min=ae;this.max=o;aj=this.max-this.min;if(this.numberTicks==null){if(this.tickInterval!=null){this.numberTicks=Math.ceil((this.max-this.min)/this.tickInterval)+1;this.max=this.min+this.tickInterval*(this.numberTicks-1)}else{if(n>100){this.numberTicks=parseInt(3+(n-100)/75,10)}else{this.numberTicks=2}}}if(this.tickInterval==null){this.tickInterval=aj/(this.numberTicks-1)}}for(var k=0;k<this.numberTicks;k++){ar=this.min+k*this.tickInterval;var aq=new this.tickRenderer(this.tickOptions);if(!this.showTicks){aq.showLabel=false;aq.showMark=false}else{if(!this.showTickMarks){aq.showMark=false}}aq.setTick(ar,this.name);this._ticks.push(aq)}}};C.jqplot.LinearAxisRenderer.prototype.pack=function(S,h){var O=this._ticks;var R=this.max;var e=this.min;var l=h.max;var j=h.min;var b=(this._label==null)?false:this._label.show;for(var Q in S){this._elem.css(Q,S[Q])}this._offsets=h;var o=l-j;var k=R-e;this.p2u=function(M){return(M-j)*k/o+e};this.u2p=function(M){return(M-e)*o/k+j};if(this.name=="xaxis"||this.name=="x2axis"){this.series_u2p=function(M){return(M-e)*o/k};this.series_p2u=function(M){return M*k/o+e}}else{this.series_u2p=function(M){return(M-R)*o/k};this.series_p2u=function(M){return M*k/o+R}}if(this.show){if(this.name=="xaxis"||this.name=="x2axis"){for(i=0;i<O.length;i++){var n=O[i];if(n.show&&n.showLabel){var g;if(n.constructor==C.jqplot.CanvasAxisTickRenderer&&n.angle){var N=(this.name=="xaxis")?1:-1;switch(n.labelPosition){case"auto":if(N*n.angle<0){g=-n.getWidth()+n._textRenderer.height*Math.sin(-n._textRenderer.angle)/2}else{g=-n._textRenderer.height*Math.sin(n._textRenderer.angle)/2}break;case"end":g=-n.getWidth()+n._textRenderer.height*Math.sin(-n._textRenderer.angle)/2;break;case"start":g=-n._textRenderer.height*Math.sin(n._textRenderer.angle)/2;break;case"middle":g=-n.getWidth()/2+n._textRenderer.height*Math.sin(-n._textRenderer.angle)/2;break;default:g=-n.getWidth()/2+n._textRenderer.height*Math.sin(-n._textRenderer.angle)/2;break}}else{g=-n.getWidth()/2}var q=this.u2p(n.value)+g+"px";n._elem.css("left",q);n.pack()}}if(b){var P=this._label._elem.outerWidth(true);this._label._elem.css("left",j+o/2-P/2+"px");if(this.name=="xaxis"){this._label._elem.css("bottom","0px")}else{this._label._elem.css("top","0px")}this._label.pack()}}else{for(i=0;i<O.length;i++){var n=O[i];if(n.show&&n.showLabel){var g;if(n.constructor==C.jqplot.CanvasAxisTickRenderer&&n.angle){var N=(this.name=="yaxis")?1:-1;switch(n.labelPosition){case"auto":case"end":if(N*n.angle<0){g=-n._textRenderer.height*Math.cos(-n._textRenderer.angle)/2}else{g=-n.getHeight()+n._textRenderer.height*Math.cos(n._textRenderer.angle)/2}break;case"start":if(n.angle>0){g=-n._textRenderer.height*Math.cos(-n._textRenderer.angle)/2}else{g=-n.getHeight()+n._textRenderer.height*Math.cos(n._textRenderer.angle)/2}break;case"middle":g=-n.getHeight()/2;break;default:g=-n.getHeight()/2;break}}else{g=-n.getHeight()/2}var q=this.u2p(n.value)+g+"px";n._elem.css("top",q);n.pack()}}if(b){var T=this._label._elem.outerHeight(true);this._label._elem.css("top",l-o/2-T/2+"px");if(this.name=="yaxis"){this._label._elem.css("left","0px")}else{this._label._elem.css("right","0px")}this._label.pack()}}}};C.jqplot.MarkerRenderer=function(b){this.show=true;this.style="filledCircle";this.lineWidth=2;this.size=9;this.color="#666666";this.shadow=true;this.shadowAngle=45;this.shadowOffset=1;this.shadowDepth=3;this.shadowAlpha="0.07";this.shadowRenderer=new C.jqplot.ShadowRenderer();this.shapeRenderer=new C.jqplot.ShapeRenderer();C.extend(true,this,b)};C.jqplot.MarkerRenderer.prototype.init=function(g){C.extend(true,this,g);var b={angle:this.shadowAngle,offset:this.shadowOffset,alpha:this.shadowAlpha,lineWidth:this.lineWidth,depth:this.shadowDepth,closePath:true};if(this.style.indexOf("filled")!=-1){b.fill=true}if(this.style.indexOf("ircle")!=-1){b.isarc=true;b.closePath=false}this.shadowRenderer.init(b);var e={fill:false,isarc:false,strokeStyle:this.color,fillStyle:this.color,lineWidth:this.lineWidth,closePath:true};if(this.style.indexOf("filled")!=-1){e.fill=true}if(this.style.indexOf("ircle")!=-1){e.isarc=true;e.closePath=false}this.shapeRenderer.init(e)};C.jqplot.MarkerRenderer.prototype.drawDiamond=function(j,k,e,g,o){var l=1.2;var n=this.size/2/l;var b=this.size/2*l;var h=[[j-n,k],[j,k+b],[j+n,k],[j,k-b]];if(this.shadow){this.shadowRenderer.draw(e,h)}this.shapeRenderer.draw(e,h,o);e.restore()};C.jqplot.MarkerRenderer.prototype.drawPlus=function(h,j,b,e,o){var k=1;var n=this.size/2*k;var M=this.size/2*k;var q=[[h,j-M],[h,j+M]];var g=[[h+n,j],[h-n,j]];var l=C.extend(true,{},this.options,{closePath:false});if(this.shadow){this.shadowRenderer.draw(b,q,{closePath:false});this.shadowRenderer.draw(b,g,{closePath:false})}this.shapeRenderer.draw(b,q,l);this.shapeRenderer.draw(b,g,l);b.restore()};C.jqplot.MarkerRenderer.prototype.drawX=function(h,j,b,e,o){var k=1;var n=this.size/2*k;var M=this.size/2*k;var l=C.extend(true,{},this.options,{closePath:false});var q=[[h-n,j-M],[h+n,j+M]];var g=[[h-n,j+M],[h+n,j-M]];if(this.shadow){this.shadowRenderer.draw(b,q,{closePath:false});this.shadowRenderer.draw(b,g,{closePath:false})}this.shapeRenderer.draw(b,q,l);this.shapeRenderer.draw(b,g,l);b.restore()};C.jqplot.MarkerRenderer.prototype.drawDash=function(j,k,e,g,o){var l=1;var n=this.size/2*l;var b=this.size/2*l;var h=[[j-n,k],[j+n,k]];if(this.shadow){this.shadowRenderer.draw(e,h)}this.shapeRenderer.draw(e,h,o);e.restore()};C.jqplot.MarkerRenderer.prototype.drawSquare=function(j,k,e,g,o){var l=1;var n=this.size/2/l;var b=this.size/2*l;var h=[[j-n,k-b],[j-n,k+b],[j+n,k+b],[j+n,k-b]];if(this.shadow){this.shadowRenderer.draw(e,h)}this.shapeRenderer.draw(e,h,o);e.restore()};C.jqplot.MarkerRenderer.prototype.drawCircle=function(e,h,b,j,n){var g=this.size/2;var l=2*Math.PI;var k=[e,h,g,0,l,true];if(this.shadow){this.shadowRenderer.draw(b,k)}this.shapeRenderer.draw(b,k,n);b.restore()};C.jqplot.MarkerRenderer.prototype.draw=function(g,b,e,h){h=h||{};switch(this.style){case"diamond":this.drawDiamond(g,b,e,false,h);break;case"filledDiamond":this.drawDiamond(g,b,e,true,h);break;case"circle":this.drawCircle(g,b,e,false,h);break;case"filledCircle":this.drawCircle(g,b,e,true,h);break;case"square":this.drawSquare(g,b,e,false,h);break;case"filledSquare":this.drawSquare(g,b,e,true,h);break;case"x":this.drawX(g,b,e,true,h);break;case"plus":this.drawPlus(g,b,e,true,h);break;case"dash":this.drawDash(g,b,e,true,h);break;default:this.drawDiamond(g,b,e,false,h);break}};C.jqplot.ShadowRenderer=function(b){this.angle=45;this.offset=1;this.alpha=0.07;this.lineWidth=1.5;this.lineJoin="miter";this.lineCap="round";this.closePath=false;this.fill=false;this.depth=3;this.isarc=false;C.extend(true,this,b)};C.jqplot.ShadowRenderer.prototype.init=function(b){C.extend(true,this,b)};C.jqplot.ShadowRenderer.prototype.draw=function(M,e,q){M.save();var o=(q!=null)?q:{};var b=(o.fill!=null)?o.fill:this.fill;var g=(o.closePath!=null)?o.closePath:this.closePath;var k=(o.offset!=null)?o.offset:this.offset;var n=(o.alpha!=null)?o.alpha:this.alpha;var h=(o.depth!=null)?o.depth:this.depth;M.lineWidth=(o.lineWidth!=null)?o.lineWidth:this.lineWidth;M.lineJoin=(o.lineJoin!=null)?o.lineJoin:this.lineJoin;M.lineCap=(o.lineCap!=null)?o.lineCap:this.lineCap;M.strokeStyle="rgba(0,0,0,"+n+")";M.fillStyle="rgba(0,0,0,"+n+")";for(var l=0;l<h;l++){M.translate(Math.cos(this.angle*Math.PI/180)*k,Math.sin(this.angle*Math.PI/180)*k);M.beginPath();if(this.isarc){M.arc(e[0],e[1],e[2],e[3],e[4],true)}else{M.moveTo(e[0][0],e[0][1]);for(var j=1;j<e.length;j++){M.lineTo(e[j][0],e[j][1])}}if(g){M.closePath()}if(b){M.fill()}else{M.stroke()}}M.restore()};C.jqplot.ShapeRenderer=function(b){this.lineWidth=1.5;this.lineJoin="miter";this.lineCap="round";this.closePath=false;this.fill=false;this.isarc=false;this.fillRect=false;this.strokeRect=false;this.clearRect=false;this.strokeStyle="#999999";this.fillStyle="#999999";C.extend(true,this,b)};C.jqplot.ShapeRenderer.prototype.init=function(b){C.extend(true,this,b)};C.jqplot.ShapeRenderer.prototype.draw=function(b,g,q){b.save();var o=(q!=null)?q:{};var e=(o.fill!=null)?o.fill:this.fill;var j=(o.closePath!=null)?o.closePath:this.closePath;var h=(o.fillRect!=null)?o.fillRect:this.fillRect;var l=(o.strokeRect!=null)?o.strokeRect:this.strokeRect;var n=(o.clearRect!=null)?o.clearRect:this.clearRect;var M=(o.isarc!=null)?o.isarc:this.isarc;b.lineWidth=o.lineWidth||this.lineWidth;b.lineJoin=o.lineJoing||this.lineJoin;b.lineCap=o.lineCap||this.lineCap;b.strokeStyle=(o.strokeStyle||o.color)||this.strokeStyle;b.fillStyle=o.fillStyle||this.fillStyle;b.beginPath();if(M){b.arc(g[0],g[1],g[2],g[3],g[4],true);if(j){b.closePath()}if(e){b.fill()}else{b.stroke()}b.restore();return}else{if(n){b.clearRect(g[0],g[1],g[2],g[3]);b.restore();return}else{if(h||l){if(h){b.fillRect(g[0],g[1],g[2],g[3])}if(l){b.strokeRect(g[0],g[1],g[2],g[3]);b.restore();return}}else{b.moveTo(g[0][0],g[0][1]);for(var k=1;k<g.length;k++){b.lineTo(g[k][0],g[k][1])}if(j){b.closePath()}if(e){b.fill()}else{b.stroke()}}}}b.restore()};C.jqplot.TableLegendRenderer=function(){};C.jqplot.TableLegendRenderer.prototype.init=function(b){C.extend(true,this,b)};C.jqplot.TableLegendRenderer.prototype.addrow=function(e,g,b){var h=(b)?this.rowSpacing:"0";var j=C('<tr class="jqplot-table-legend"></tr>').appendTo(this._elem);C('<td class="jqplot-table-legend" style="text-align:center;padding-top:'+h+';"><div><div class="jqplot-table-legend-swatch" style="border-color:'+g+';"></div></div></td>').appendTo(j);var k=C('<td class="jqplot-table-legend" style="padding-top:'+h+';"></td>');k.appendTo(j);if(this.escapeHtml){k.text(e)}else{k.html(e)}};C.jqplot.TableLegendRenderer.prototype.draw=function(){var g=this;if(this.show){var j=this._series;var b="position:absolute;";b+=(this.background)?"background:"+this.background+";":"";b+=(this.border)?"border:"+this.border+";":"";b+=(this.fontSize)?"font-size:"+this.fontSize+";":"";b+=(this.fontFamily)?"font-family:"+this.fontFamily+";":"";b+=(this.textColor)?"color:"+this.textColor+";":"";this._elem=C('<table class="jqplot-table-legend" style="'+b+'"></table>');var o=false;for(var h=0;h<j.length;h++){s=j[h];if(s.show&&s.showLabel){var k=s.label.toString();if(k){var n=s.color;if(s._stack&&!s.fill){n=""}this.renderer.addrow.call(this,k,n,o);o=true}for(var l=0;l<C.jqplot.addLegendRowHooks.length;l++){var e=C.jqplot.addLegendRowHooks[l].call(this,s);if(e){this.renderer.addrow.call(this,e.label,e.color,o);o=true}}}}}return this._elem};C.jqplot.TableLegendRenderer.prototype.pack=function(h){if(this.show){var b={_top:h.top,_left:h.left,_right:h.right,_bottom:this._plotDimensions.height-h.bottom};switch(this.location){case"nw":var e=b._left+this.xoffset;var g=b._top+this.yoffset;this._elem.css("left",e);this._elem.css("top",g);break;case"n":var e=(h.left+(this._plotDimensions.width-h.right))/2-this.getWidth()/2;var g=b._top+this.yoffset;this._elem.css("left",e);this._elem.css("top",g);break;case"ne":var e=h.right+this.xoffset;var g=b._top+this.yoffset;this._elem.css({right:e,top:g});break;case"e":var e=h.right+this.xoffset;var g=(h.top+(this._plotDimensions.height-h.bottom))/2-this.getHeight()/2;this._elem.css({right:e,top:g});break;case"se":var e=h.right+this.xoffset;var g=h.bottom+this.yoffset;this._elem.css({right:e,bottom:g});break;case"s":var e=(h.left+(this._plotDimensions.width-h.right))/2-this.getWidth()/2;var g=h.bottom+this.yoffset;this._elem.css({left:e,bottom:g});break;case"sw":var e=b._left+this.xoffset;var g=h.bottom+this.yoffset;this._elem.css({left:e,bottom:g});break;case"w":var e=b._left+this.xoffset;var g=(h.top+(this._plotDimensions.height-h.bottom))/2-this.getHeight()/2;this._elem.css({left:e,top:g});break;default:var e=b._right-this.xoffset;var g=b._bottom+this.yoffset;this._elem.css({right:e,bottom:g});break}}};C.jqplot.sprintf=function(){function e(n,N,M,o){var q=(n.length>=N)?"":Array(1+N-n.length>>>0).join(M);return o?n+q:q+n}function b(q,M,n,O,N,P){var o=O-q.length;if(o>0){var Q=" ";if(P){Q="&nbsp;"}if(n||!N){q=e(q,O,Q,n)}else{q=q.slice(0,M.length)+e("",o,"0",true)+q.slice(M.length)}}return q}function l(q,n,N,R,o,O,M,P){var Q=q>>>0;N=N&&Q&&{"2":"0b","8":"0","16":"0x"}[n]||"";q=N+e(Q.toString(n),O||0,"0",false);return b(q,N,R,o,M,P)}function h(o,n,M,O,q,N){if(O!=null){o=o.slice(0,O)}return b(o,"",n,M,q,N)}var g=arguments,k=0,j=g[k++];return j.replace(C.jqplot.sprintf.regex,function(q,ak,aj,ag,n,Z,am){if(q=="%%"){return"%"}var af=false,ai="",ah=false,Y=false,al=false;for(var aa=0;aj&&aa<aj.length;aa++){switch(aj.charAt(aa)){case" ":ai=" ";break;case"+":ai="+";break;case"-":af=true;break;case"0":ah=true;break;case"#":Y=true;break;case"&":al=true;break}}if(!ag){ag=0}else{if(ag=="*"){ag=+g[k++]}else{if(ag.charAt(0)=="*"){ag=+g[ag.slice(1,-1)]}else{ag=+ag}}}if(ag<0){ag=-ag;af=true}if(!isFinite(ag)){throw new Error("$.jqplot.sprintf: (minimum-)width must be finite")}if(!Z){Z="fFeE".indexOf(am)>-1?6:(am=="d")?0:void (0)}else{if(Z=="*"){Z=+g[k++]}else{if(Z.charAt(0)=="*"){Z=+g[Z.slice(1,-1)]}else{Z=+Z}}}var ad=ak?g[ak.slice(0,-1)]:g[k++];switch(am){case"s":if(ad==null){return""}return h(String(ad),af,ag,Z,ah,al);case"c":return h(String.fromCharCode(+ad),af,ag,Z,ah,al);case"b":return l(ad,2,Y,af,ag,Z,ah,al);case"o":return l(ad,8,Y,af,ag,Z,ah,al);case"x":return l(ad,16,Y,af,ag,Z,ah,al);case"X":return l(ad,16,Y,af,ag,Z,ah,al).toUpperCase();case"u":return l(ad,10,Y,af,ag,Z,ah,al);case"i":case"d":var ao=parseInt(+ad,10);if(isNaN(ao)){return""}var ab=ao<0?"-":ai;ad=ab+e(String(Math.abs(ao)),Z,"0",false);return b(ad,ab,af,ag,ah,al);case"e":case"E":case"f":case"F":case"g":case"G":var ao=+ad;if(isNaN(ao)){return""}var ab=ao<0?"-":ai;var an=["toExponential","toFixed","toPrecision"]["efg".indexOf(am.toLowerCase())];var o=["toString","toUpperCase"]["eEfFgG".indexOf(am)%2];ad=ab+Math.abs(ao)[an](Z);return b(ad,ab,af,ag,ah,al)[o]();case"p":case"P":var ao=+ad;if(isNaN(ao)){return""}var ab=ao<0?"-":ai;var ae=String(Number(Math.abs(ao)).toExponential()).split(/e|E/);var ap=(ae[0].indexOf(".")!=-1)?ae[0].length-1:ae[0].length;var ac=(ae[1]<0)?-ae[1]-1:0;if(Math.abs(ao)<1){if(ap+ac<=Z){ad=ab+Math.abs(ao).toPrecision(ap)}else{if(ap<=Z-1){ad=ab+Math.abs(ao).toExponential(ap-1)}else{ad=ab+Math.abs(ao).toExponential(Z-1)}}}else{var aq=(ap<=Z)?ap:Z;ad=ab+Math.abs(ao).toPrecision(aq)}var o=["toString","toUpperCase"]["pP".indexOf(am)%2];return b(ad,ab,af,ag,ah,al)[o]();case"n":return"";default:return q}})};C.jqplot.sprintf.regex=/%%|%(\d+\$)?([-+#0& ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([nAscboxXuidfegpEGP])/g})(jQuery);var BASE_URL_INTEGRATION_API=BASE_URL_WEB+"api/";var REQUEST_DONGLE_API=BASE_URL_INTEGRATION_API+"request_dongle/";var SEARCH_LEGACY_API=BASE_URL_INTEGRATION_API+"integration/search/";var LAST_CONTENTS_WITHOUT_USER_API=BASE_URL_INTEGRATION_API+"integration/anonymous/";var USERS_CONTENTS_API=BASE_URL_INTEGRATION_API+"integration/user/";var USER_PROFILE_CONTENTS_API=BASE_URL_INTEGRATION_API+"integration/profile/";var POOL_ANSWER_API=BASE_URL_INTEGRATION_API+"pool_answer/";var ONLINE_INTEGRATION_API=BASE_URL_INTEGRATION_API+"online/";var BASE_URL_API=BASE_URL_SERVER+"api/";var MESSAGE_API=BASE_URL_API+"message/";var SEND_MESSAGE_API=MESSAGE_API+"create/";var DELETE_DISTRIBUTION_API=MESSAGE_API+"delete/";var INVITE_API=MESSAGE_API+"invite/";var ACTION_LOG_API=MESSAGE_API+"action/log/";var CONTACT_API=BASE_URL_API+"contact/";var UPDATE_CONTACT_API=CONTACT_API+"set/";var REMOVE_CONTACT_API=CONTACT_API+"unset/";var AUTHORIZE_TWITTER_API=CONTACT_API+"twitter/request_authorization/";var SUBSCRIBE_API=BASE_URL_API+"subscription/";var USER_FOLLOW_API=SUBSCRIBE_API+"set/";var USER_UNFOLLOW_API=SUBSCRIBE_API+"unset/";var USER_API=BASE_URL_API+"profile/";var USER_AUTHENTICATE_API=USER_API+"authenticate/";var USER_CREATE_API=USER_API+"create/";var USER_UPDATE_API=USER_API+"update/";var RETRIEVE_PASSWORD_API=USER_API+"recover_password/";var USER_BLOCK_API=USER_API+"block/";var FILE_API=BASE_URL_API+"resource/";var STREAM_FILE_API=FILE_API+"get/";var GET_FILE_API=FILE_API+"meta_info/";var CREATE_RESOURCE_API=FILE_API+"create/";var HOTSPOT_API=BASE_URL_API+"hotspot/";var GET_ONLINE_DEVICES_API=HOTSPOT_API+"device/list/";var STATISTIC_API=HOTSPOT_API+"statistic/";var DONGLE_REQ_API=BASE_URL_API+"dongle_request/";var CREATE_DONGLE_REQ_API=DONGLE_REQ_API+"create/";var RETURN_DONGLE_COUNT_API=DONGLE_REQ_API+"count/";var VERIFY_VSCYBER_LOGIN=DONGLE_REQ_API+"verify_vscyber/";var VERSION_API=BASE_URL_API+"version/";var ONLINE_API=BASE_URL_API+"online/";var UPDATE_VIA_AJAX_ENABLED=true;var AUTO_UPDATE_VIA_AJAX_ENABLED=true;var FORCE_EMBED_HTML_TAG_FOR_VIDEO=false;var FORCE_EMBED_HTML_TAG_FOR_AUDIO=false;var USERS_PER_PAGE=25;var USERS_PER_PAGE_OFFLINE=75;var USER_NAME_MAX_LENGTH=36;var MESSAGE_REPLY_MAX_LENGTH=25;var CONTACT_MAX_LENGTH=20;var SPECIAL_USER_ALOUW_APPLICATION="alouw_application";var TIME={UPDATE_TAB_MILLIS_INTERVAL:30000,MAC_ASSOCIATION_LAST_CONTENTS_MILLIS_INTERVAL:1000,PUBLISHER_MESSAGE_FADE_OUT:5000,SEARCH_KEYBOARD_KEY_INTERVAL:1000,MESSAGE_TOP:5000};var SIZE={AVATAR_FOLLOWING:32,AVATAR_SENDER:60,AVATAR_SENDER_COMMENT:32};var TAB={RECOMMENDED:"RECOMMENDED",ALL:"ALL",MESSAGES:"MESSAGES",SEARCH_RESULT:"SEARCH_RESULT",WALL:"WALL",HOTSPOT:"HOTSPOT",NOWHERE:"NOWHERE",FRIENDS:"FRIENDS",IFRAME:"IFRAME"};var BOOST={ALL:"boost-all",RINGTONES:"boost-ringtones",VIDEOS:"boost-videos",WALLPAPERS:"boost-wallpapers",GAMES:"boost-apps",LOADING:"boost-loading"};var SENDING_MODE={SMS:1,BLUETOOTH:2,DOWNLOAD:3};var DIV={BLUETOOTH:{READY:"bluetooth-ready",SELECTED:"bluetooth-selected"},SMS:{INPUT_POPUP:"smsInputPopup",POPUP_TITLE:"smsInputPopupTitle"},BODY:{TIMELINE:"content-timeline",SELECTED_DEVICE:"selected-device",BLUETOOTH_RESULTS:"bluetooth-results",SMS_NUMBER:"smsMobileNumber",EMAIL:"profileEmail",PHONE:"profilePhone",MSN:"profileMSN",TWITTER:"profileTwitter",FOLLOW:"follow-content",BLOCK:"block-content",PERSON_MENU_NAME:"person-menu-name",LAST_PUSHES:"lastPushes",ONLINE:"content-online",MOBILES:"mobiles-content",MESSAGE_TOP:"message-top-body"},CURRENT_USER:{FOLLOWERS:"followers",FOLLOWERS_COUNT:"followers-count",FOLLOWING:"following",FOLLOWING_COUNT:"following-count",ONLINE_COUNT:"online-count",CONTENT_FOLLOWERS:"content-followers",CONTENT_FOLLOWING:"content-following",PERSONAL_DATA:"personal-data",FOLLOW_TEXT_CONTENT:"follow-text-content",FOLLOW_ICON:"follow-icon",UNFOLLOW_ICON:"unfollow-icon",FOLLOWING_PAGE:"following-page",FOLLOWING_TOTAL_PAGE:"following-total-page",FOLLOWERS_PAGE:"followers-page",FOLLOWERS_TOTAL_PAGE:"followers-total-page",FOLLOWING_PAGINATION:"following-pagination",FOLLOWERS_PAGINATION:"followers-pagination",ONLINE_PAGE:"online-page",ONLINE_TOTAL_PAGE:"online-total-page",ONLINE_PAGINATION:"online-pagination"},PUBLISHER:{ATTACHMENT:"attachment",ATTACHMENT_HELP:"attachmentHelp",FILE_SELECTED:"fileSelected",FILE_SENDING:"fileSending",FILE_NAME:"fileName",FILE_SUCCESS:"fileSuccess",FILE_ERROR:"fileError",KNOW_MORE:"publisherSaibaMais"},POPUP:{WELCOME:"welcomePopup",WELCOME_START_NOW:"welcomeStartNowBtn",LOGIN:"popup-login",SIGNUP_PART1:"signupPart1",SIGNUP_PART1_ERROR:"signupPart1Error",SIGNUP_PART1_LOADING:"signupPart1Loading",SIGNUP_PART2:"signupPart2",SEND_VIA_BT_INSTRUCTIONS:"sendContentViaBluetoothPopup",BLUETOOTH:{INQUIRY:"popup-bluetooth-inquiry",READY:"popup-bluetooth-ready"},BT_READY_TITLE:"popup-bt-ready-title",BT_READY_DATA:"popup-bt-ready-data",BT_READY_DATA_INICIO_DA_NET:"assignProcessStep4",BT_READY_NOTFOUND:"popup-bt-ready-not-found",BT_REMOTE_OK:"remoteSentOk",ASK_IF_LAN:"askIfLan",COMMENT:"comment",COMMENT_LOADING:"commentLoading",COMMENT_TO:"commentTo",COMMENT_ATTACHMENT:"commentAttachment",COMMENT_ATTACHMENT_HELP:"commentAttachmentHelp",COMMENT_FILE_SELECTED:"commentFileSelected",COMMENT_FILE_SENDING:"commentFileSending",COMMENT_FILE_NAME:"commentFileName",COMMENT_FILE_SUCCESS:"commentFileSuccess",COMMENT_FILE_ERROR:"commentFileError",COMMENT_KNOW_MORE:"commentPublisherSaibaMais",REMEMBER_NICK:"rememberPopupNick",REMEMBER:"rememberPopup",REMEMBER_LOADING:"rememberLoading",REMEMBER_NICK_LOADING:"rememberNickLoading",ASSIGN_MOBILE:"assignMobileInputPopup",MAC_INPUT:"assignMacInputPopup",MAC_OK:"assinMacOkPopup",GET_BY_MAIL:"getByMailPopup",NO_BLUETOOTH:"NoBluetoothSucess",MAC_ASSOC:{STEP1:"assignProcessStep1",STEP2:"assignProcessStep2",STEP3:"assignProcessStep3",HS_NOTFOUND:"assignProcessHotspotNotFound"},PUBLISH_INSTRUCTIONS:"publishInstructions",CONTACT_US:"contact-us",STATISTIC:"statistic"},PICTURE:{INPUT_POPUP:"pictureInputPopup",LOADING:"pictureLoading",FILE_NAME:"avatar-file-name"},TAB:{MESSAGES:"messages-tab",NUMBER_OF_MESSAGES:"number-of-messages",NUMBER_OF_ALL:"number-of-all",NUMBER_OF_WALL:"number-of-wall",NUMBER_OF_RECOMMENDED:"number-of-recommended",NUMBER_OF_FRIENDS:"number-of-friends",SEARCH:"search-tab",WALL:"wall-tab",HOTSPOT:"hotspot-tab"},NAME:{INPUT_POPUP:"nameInputPopup",LOADING:"nameLoading",PROFILE_HOME:"profile-home-name",AREA_TOP:"area-top-name"},UPLOADBT:{INPUT_POPUP:"uploadBtInputPopup",LOADING:"uploadBtLoading"},PASSWORD:{INPUT_POPUP:"passwordInputPopup",LOADING:"passwordLoading"},EMAIL:{INPUT_POPUP:"emailInputPopup",LOADING:"emailLoading",REMOVE_BUTTON:"removeContactEmailButton"},PHONE:{INPUT_POPUP:"phoneInputPopup",LOADING:"phoneLoading",REMOVE_BUTTON:"removeContactPhoneButton"},MSN:{INPUT_POPUP:"msnInputPopup",LOADING:"msnLoading",REMOVE_BUTTON:"removeContactMsnButton"},TWITTER:{INPUT_POPUP:"twitterInputPopup",LOADING:"twitterLoading",REMOVE_BUTTON:"removeContactTwitterButton"},MAC_INSTRUCTIONS:{NOKIA:"macInstructionsNokia",SAMSUNG:"macInstructionsSamsung",LG:"macInstructionsLg",OTHER:"macInstructionsOther"},INSERT_MAC:"insertMac",SYSTEM_MESSAGE:"system-message",MESSAGE_TOP:"message-top",POOL:{BUTTON:"poolButton",WAIT:"pool-wait"},VIDEO:"youtubeAlouw",LEDS_OTHERS:"leds-others"};var INPUT={SEARCH:{TEXT_DEFAULT:"procurar",VALUE:"search-value"},SMS:{DDD:"ddd",MOBILE:"mobile"},LOGIN:{NICK:"nick",PASS:"pass"},SIGNUP:{NICK:"signupNick",PASS:"signupPassword",CONFIRMPASS:"signupConfirmPassword",EMAIL:"signupEmail",DDD:"signupDdd",MOBILE:"signupMobile"},POPUP:{LOGIN:{NICK:"popup-nick",PASS:"popup-pass"}},PUBLISHER:{SECTION:"publisher",TEXT:"publisherText",TEXT_HIDDEN:"publisherTextHidden",FILE:"publisherFile",NICK:"publisherNick",PASS:"publisherPass",DESTINATIONS:"publisherDestinations"},BLUETOOTH:{SEARCH_AGAIN:"search-again"},COMMENT:{TEXT:"commentText"},PICTURE:{NICK:"picureNick",PASS:"picturePass",FILE:"pictureFile"},NAME:{VALUE:"nameInput"},UPLOADBT:{VALUE:"uploadBtInput"},PASSWORD:{CURRENT:"passwordInputCurrent",VALUE:"passwordInput",CONFIRM:"passwordInputConfirm"},EMAIL:{VALUE:"emailInput"},DDD:{VALUE:"dddPhoneInput"},PHONE:{VALUE:"phoneInput"},MSN:{VALUE:"msnInput"},TWITTER:{VALUE:"twitterInput"},REMEMBER:{EMAIL:"rememberEmail",DDD:"rememberSMSddd",MOBILE:"rememberSMSmobile",MSN:"rememberMSN",NICK:"rememberNick"},REMEMBER_METHOD:{EMAIL:"rememberMethodEmail",SMS:"rememberMethodSMS",MSN:"rememberMethodMSN"},MANUAL_MAC:{VALUE:"inputManualMac",ASSIGN_OK:"assignMacOk",RADIO_NOKIA:"radioNokia",RADIO_SAMSUNG:"radioSamsung",RADIO_LG:"radioLg",RADIO_OUTRO:"radioOutro"},DONGLE:{STORE_NAME:"nomeLoja",NAME:"nome",EMAIL:"email",PHONE:"telefone",PHONE2:"telefone2",ADDRESS:"endereco",DISTRICT:"bairro",CITY:"cidade",STATE:"estado",ZIPCODE:"cep",COMMENTS:"comentarios",ORIGIN:"origin"}};var FORM={LOGIN:"login-form",LOGOFF:"logoff-form",PUBLISHER:{UPLOAD:"uploadForm"},PICTURE:{UPLOAD:"avatarUploadForm"}};var IMG={FOLLOW:"follow-image",BLOCK:"block-image",PROFILE_AVATAR:"avatarGrande"};var TEMPLATE={TIMELINE:{CONTENT_HOME:"template-timeline-home",CONTENT_COMMENT:"template-timeline-home-comment",CONTENT_HOME_SHARED:"template-timeline-home-shared",MOBILES:"mobiles-template",CONTENT_STATISTIC:"template-radar-statistic",USER:"template-timeline-user",NO_CONTENT:"template-no-content-timeline",PROFILE_NO_CONTENT:"template-profile-no-content-timeline",NO_BROADCAST:"template-no-broadcast",NO_MESSAGE:"template-no-message-timeline",INVALID_QUERY:"template-timeline-invalid-query",LOADING:"template-timeline-loading",NOT_FOUND:"template-timeline-not-found",RADAR_OFF:"template-radar-off",FRIENDS_NO_CONTENT:"template-friends-no-content",FRIENDS:"template-friends-timeline-user"},BOOST:{TOP:"turbine-top",CONTENT:"turbine-content",BUTTONS:"template-buttons"},IFRAME:{TOP:"iframe-top",CONTENT:"turbine-content",BUTTONS:"template-buttons"},SEARCH:{TOP:"search-top"},FOLLOWING:"template-following",FOLLOWERS:"template-followers"};var MANUFACTURERS={NOKIA:"nokia",SAMSUNG:"samsung",LG:"lg",OTHER:"other"};var LAYOUT_SOURCE={FOLLOWER:"layout-sorce-follower",FOLLOWING:"layout-sorce-following",CONTENT:"layout-sorce-content",CONTENT_COMMENT:"layout-sorce-content-comment"};var loggedUser,loginPopup,production,pageTracker,BASE_URL_IMAGES;function internalError(b){window.status=b;if(!production){$("#foot-div").append("*** INTERNAL ERROR *** "+b)}}function logAction(e){try{pageTracker._trackPageview("/"+e)}catch(b){internalError("Google Analytics error: "+b)}}var messageTopId=0;function showMessage(e,b){if(!b){b="success"}if(b!="success"){showBoxMessage(e,b)}else{clearTimeout(messageTopId);setDivContent(DIV.BODY.MESSAGE_TOP,'<img src="'+BASE_URL_IMAGES+'ico-success-attach.gif"/> '+e);$("#"+DIV.MESSAGE_TOP).slideDown(800,function(){messageTopId=setTimeout("$('#' + DIV.MESSAGE_TOP).slideUp(1000);",TIME.MESSAGE_TOP)})}}function showBoxMessage(e,b){if(!b){b="success"}switch(b){case"success":$("#dialog-icon").attr("src",BASE_URL_IMAGES+"ico-success-attach.gif");break;case"error":$("#dialog-icon").attr("src",BASE_URL_IMAGES+"ico-error-attach.gif");break;case"warning":$("#dialog-icon").attr("src",BASE_URL_IMAGES+"ico_alert.gif");break;default:$("#dialog-icon").attr("src",BASE_URL_IMAGES+"ico_alert.gif")}$("#dialog-text").html(e);$("#dialog-message").dialog({modal:true,position:"center",resizable:false,buttons:{Ok:function(){$(this).dialog("close")}}})}function getCookie(b){return $.cookie(b)}function setCookie(b,e,g){$.cookie(b,e,{expires:g?g:365,path:"/"})}function showDiv(b){$("#"+b).show()}function setDivContent(b,e){$("#"+b).html(e)}function getDivContent(b){return $("#"+b).html()}function hideDiv(b){$("#"+b).hide()}function selectDiv(e,b){var g;for(g in e){if(e.hasOwnProperty(g)){var h=e[g];if(h==b){showDiv(h)}else{hideDiv(h)}}}}function getIntCookie(b){var e=getCookie(b);if(!e){return 0}else{return parseInt(e)}}function getInputValue(b){return $("#"+b).val()}function getInputValueTrim(b){return jQuery.trim($("#"+b).val())}function setInputValue(b,e){$("#"+b).val(e)}function submitForm(b){$("#"+b).submit()}function autoTab(b,e){if(b.getAttribute&&b.value.length==b.getAttribute("maxlength")){$("#"+e).focus()}}function enterPressed(b){return(b.which&&b.which==13)||(b.keyCode&&b.keyCode==13)}var limitCount=0;function limitText(e,b){if(e.val().length>b){e.val(e.val().substring(0,b));showMessage(text.get("limit_error")+" "+b,"error")}else{limitCount=b-e.val().length}}function doAfterLogin(whatToExecute){if(!loggedUser.isLogged()){loginPopup.doAfterLogin(whatToExecute);var cookie=getCookie("inicioDaNet");if(cookie){signupPopup.show(1)}else{loginPopup.show()}}else{try{eval(whatToExecute)}catch(err){internalError(err+" on "+whatToExecute)}}}function replaceAll(b,e,g){return b.replace(new RegExp(e,"g"),g)}function isOnlyNumbers(b){if(b.match(/[0-9]$/)){return true}return false}function isValidEmail(b){if(b.match(/^[a-z0-9.+-_]+@([a-z0-9-]{2,}(.[a-z0-9-]{2,})+)$/gi)){return true}return false}function cutText(e,b){return(e.length<=b?e:e.substring(0,(b-3))+"...")}function convertMACToServerFormat(g){var b="";if(g!=""){g=g.toUpperCase();var e=0;for(e=0;e<g.length;e++){b+=g.charAt(e);if(e%2!==0&&e!=g.length-1){b+=":"}}}return b}function TODO(b){showMessage(text.get("comming_soon")+": "+b,"error")}function convertMACToJSFormat(g){var b="";if(g!=""){g=g.toUpperCase();var e=0;for(e=0;e<g.length;e++){if(g.charAt(e)!=":"){b+=g.charAt(e)}}}b=b.toUpperCase();return b}function goToUrl(b,e){$.ajax({url:b,cache:false,error:function(){e(false)},success:function(g){e(true);window.location.href=b},dataType:"text/html"})}var player;function playerReady(b){player=document.getElementById(b.id)}function showContentPreview(n,v){var o=this;var k=v.innerBean.attachment;var w=v.innerBean.content_type;if(w=="DEFAULT"||w=="TEXT"){n=true}var b=350;var x=$(window).width()-130;var y=$(window).height()-130;var g;var q=STREAM_FILE_API+"?resource="+k+"&attachment=false";var l=STREAM_FILE_API+"%3Fresource%3D"+k+"%26attachment%3Dfalse";switch(w){case"IMAGE":g='<img id="img-preview-'+k+'" src="'+q+"&width="+x+"&height="+y+'"/>';break;case"VIDEO":var h=v.innerBean.attachment_name&&((v.innerBean.attachment_name.toString().toLocaleLowerCase().indexOf(".mp4")>=0)||(v.innerBean.attachment_name.toString().toLocaleLowerCase().indexOf(".flv")>=0));if(FORCE_EMBED_HTML_TAG_FOR_VIDEO||!h){g='<EMBED width="500" SRC="'+q+'"></EMBED>'}else{g='<div id="mediaspace">'+text.get("loading")+"</div>";g+="<script type='text/javascript'>";g+="var so = new SWFObject('"+BASE_URL_WEB+"pages/js/jwplayer-5.2/player.swf','mpl','470','320','9');";g+="so.addParam('allowfullscreen','true');";g+="so.addParam('allowscriptaccess','always');";g+="so.addParam('wmode','opaque');";g+="so.addVariable('file','"+l+"');";g+="so.addVariable('autostart','true');";g+="so.addVariable('provider','video');";g+="so.addVariable('viral.allowmenu','false');";g+="so.addVariable('viral.onpause','false');";g+="so.addVariable('viral.oncomplete','false');";g+="so.write('mediaspace');";g+="<\/script>"}g+='<br/><p style="margin:5px;">'+v.getTextToRecommendedTab()+"</p>";break;case"AUDIO":var j=v.innerBean.attachment_name&&(v.innerBean.attachment_name.toString().toLocaleLowerCase().indexOf(".mp3")>=0);if(FORCE_EMBED_HTML_TAG_FOR_AUDIO||!j){g='<EMBED width="500" height="40" SRC="'+q+'"></EMBED>'}else{g='<div id="mediaspace">'+text.get("loading")+"</div>";g+="<script type='text/javascript'>";g+="var so = new SWFObject('"+BASE_URL_WEB+"pages/js/jwplayer-5.2/player.swf','mpl','470','24','9');";g+="so.addParam('allowscriptaccess','always');";g+="so.addParam('wmode','opaque');";g+="so.addVariable('file','"+l+"');";g+="so.addVariable('autostart','true');";g+="so.addVariable('provider','sound');";g+="so.addVariable('viral.allowmenu','false');";g+="so.addVariable('viral.onpause','false');";g+="so.addVariable('viral.oncomplete','false');";g+="so.write('mediaspace');";g+="<\/script>"}g+='<br/><p style="margin:5px;">'+v.getTextToRecommendedTab()+"</p>";break;default:g='<div class="turboPopApps">'+text.get("content")+": <span>"+v.getTextToRecommendedTab()+"</span></div>";break}if(w=="IMAGE"){this.loading=true;$("#img-preview-loader").dialog({beforeclose:function(){o.loading=false},modal:true,resizable:false,width:150,height:100})}var e=!n?"<br/>":getDivContent(TEMPLATE.BOOST.BUTTONS);e=e.replace("!MOBILE_CODE!",'<div style="width:150px; float:left" onclick="contents.selectContent(\''+v.getId()+'\'); sendSelectedContent(SENDING_MODE.BLUETOOTH);"><div style="font-size:13px; height:26px; padding-top:5px; padding-left:18px; text-align:left" class="btTurboPopCel2"><a href="#" style="color:#2274c3">por Bluetooth</a> <span style="color:#888686"></span></div></div>');e=e.replace("!PC_CODE!","<div style=\"width:180px; float:left;\" onclick=\"$('#img-preview').dialog('destroy'); contents.selectContent('"+v.getId()+'\'); sendSelectedContent(SENDING_MODE.SMS);"><div style="font-size:13px; height:26px; padding-top:5px; padding-left:25px; text-align:left" class="btTurboPopPC2"><a href="#" style="color:#2274c3">por Torpedo</a> <span style="color:#888686"></span></div></div>');$("#img-preview").html(e+g);if(w!="IMAGE"){var z=(w=="DEFAULT"||w=="AUDIO"||w=="TEXT"?150:460);if(!n){z-=28}$("#img-preview").dialog({beforeclose:function(){if(player){try{player.sendEvent("stop")}catch(A){}}$("#mediaspace").html("")},modal:true,position:"center",resizable:false,width:600,height:z})}else{$("#img-preview-"+k).load(function(){if(o.loading){$("#img-preview-loader").dialog("destroy");$("#img-preview").dialog({modal:false,position:"center",resizable:false,width:1,height:1});var A=$("#img-preview-"+k).outerWidth();var B=$("#img-preview-"+k).outerHeight();$("#img-preview").dialog("destroy");if(A>x){A=x;$("#img-preview-"+k).attr("width",A)}if(A<b){A=b}if(B>y){B=y;$("#img-preview-"+k).attr("height",B)}$("#img-preview").dialog({modal:true,position:"center",resizable:false,width:A+50,height:(n?B+100:B+50)});o.loading=false}})}logAction("js/common/showContentPreview")}function forEachDo(g,e){var b;for(b in g){if(g.hasOwnProperty(b)){e(g[b])}}}function forEachTabDo(b){forEachDo(TAB,b)}function showContactUs(){$("#"+DIV.POPUP.CONTACT_US).dialog({modal:true,position:"center",resizable:false,width:350,height:215,buttons:{Ok:function(){$(this).dialog("close")}}})}function getLastVersion(b,e){server.call({url:VERSION_API,data:{app_version:b},error:function(g,j,h){e(false)},success:function(g){if(g==null||!g.update_path){e(false)}else{e(true,g.update_path)}}})}function Pagination(){this.currentPage=1;this.totalPage=1;this.elementsPerPage=1;this.totalLength=0;Pagination.prototype.getCurrentPage=function(){return this.currentPage};Pagination.prototype.getTotalPages=function(){return this.totalPage};Pagination.prototype.setLength=function(e,b){this.totalPage=e==0?0:Math.floor((e-1)/b)+1;this.elementsPerPage=b;this.totalLength=e};Pagination.prototype.getStartIndex=function(){return(this.currentPage-1)*this.elementsPerPage};Pagination.prototype.getEndIndex=function(){return this.getStartIndex()+this.elementsPerPage};Pagination.prototype.isThisIndexInside=function(b){return(b>=this.getStartIndex())&&(b<this.getEndIndex())};Pagination.prototype.nextPage=function(){this.currentPage++;if(this.currentPage>this.totalPage){this.currentPage=1}};Pagination.prototype.isInTheLastPage=function(){return this.currentPage>=this.totalPage};Pagination.prototype.isInTheFirstPage=function(){return this.currentPage==1};Pagination.prototype.needPagination=function(){return this.totalPage>1};Pagination.prototype.previousPage=function(){this.currentPage--;if(this.currentPage<1){this.currentPage=this.totalPage}}}var askAgain=true;function Server(){var b=this;Server.prototype.lostSession=function(){if(!askAgain){return true}else{askAgain=false;if(window.confirm(text.get("server.lost_session_error"))){window.location.reload();return false}else{return true}}};Server.prototype.call=function(e){$.ajax({cache:false,dataType:"json",url:e.url,data:e.data,error:function(g,k,j){var h="Error";if(g){h+=" :: textStatus="+k;h+=" :: responseText="+g.responseText;if(j){h+=" :: "+j.description}internalError(h)}e.error()},contentType:"application/x-www-form-urlencoded; charset=UTF-8",success:function(g){if(!g){e.error()}else{if(g&&g.success){e.success(g)}else{if(g&&!g.success){if(g.error=="INVALID_SESSION"){b.lostSession()}else{internalError("Error code: "+g.error)}e.error(g.error)}}}}})}}function Cache(){function e(h){return getCookie("cache."+h)}function b(j,h){if(h!=""){setCookie("cache."+j,h)}}function g(h){Cache.prototype["get"+h]=function(j){return e(h+"."+j)};Cache.prototype["update"+h]=function(j,k){b(h+"."+j,k)}}g("FriendlyName");g("Channel")}function ReadMessagesController(){var b=this;ReadMessagesController.prototype.reset=function(){b.tabs=new Array();forEachTabDo(function(e){b.tabs[e]=new Array();b.tabs[e].latestKnownMessage="0";b.tabs[e].unreadMessages=0;if(!getCookie("latestReadMessage."+e)){setCookie("latestReadMessage."+e,"0")}if(!getCookie("latestReadMessageOnExit."+e)){setCookie("latestReadMessageOnExit."+e,"0")}})};this.reset();ReadMessagesController.prototype.getLastReadId=function(e){return getIntCookie("latestReadMessage."+e)};ReadMessagesController.prototype.getLastReadOnExitId=function(e){return getIntCookie("latestReadMessageOnExit."+e)};ReadMessagesController.prototype.knowMessage=function(j,h){var g=parseInt(h);var e=parseInt(b.tabs[j].latestKnownMessage);if(g>e){b.tabs[j].latestKnownMessage=h}var k=b.getLastReadId(j);if(g>k){b.tabs[j].unreadMessages++}};ReadMessagesController.prototype.openTab=function(e){setCookie("latestReadMessage."+e,b.tabs[e].latestKnownMessage);b.tabs[e].unreadMessages=0};ReadMessagesController.prototype.closeTab=function(e){setCookie("latestReadMessageOnExit."+e,b.tabs[e].latestKnownMessage)};ReadMessagesController.prototype.getHowManyNewMessages=function(e){return b.tabs[e].unreadMessages}}function TabEntry(){this.type="UNKNOWN";TabEntry.prototype.getType=function(){return this.type};TabEntry.prototype.toHTML=function(){return this.getType()+" HTML code is undefined!"};TabEntry.prototype.isUser=function(){return this.getType()=="USER"};TabEntry.prototype.isContent=function(){return this.getType()=="CONTENT"}}Content.prototype=new TabEntry();function Content(h){var e=this;this.type="CONTENT";this.innerBean=h;this.isComment=h.conversation;this.wasRendered=false;this.isCommentOpen=h.isCommentOpen;if(h.attachment&&h.content_type=="IMAGE"){this.thumb=STREAM_FILE_API+"?resource="+h.attachment+"&width=320&height=176"}Content.prototype.isShared=function(){if(!this.innerBean.sender_nick||!this.innerBean.author){return false}else{return this.innerBean.sender_nick.toLowerCase()!=this.innerBean.author.toLowerCase()}};Content.prototype.isNewMessage=function(){return this.innerBean.message>readMessagesController.getLastReadOnExitId(this.innerBean.tab)};Content.prototype.getId=function(){var j="";if(this.innerBean.special_id){j=this.innerBean.special_id}else{if(this.innerBean.message){j="message_"+this.innerBean.message;if(this.innerBean.delivery){j+="_delivery_"+this.innerBean.delivery}}}return j};Content.prototype.getHash=function(){var j="";if(this.innerBean.attachment){j+="file_"+this.innerBean.attachment}else{if(this.innerBean.text){j+="text_"+this.innerBean.text}}return j};Content.prototype.remove=function(){var j=this;server.call({url:DELETE_DISTRIBUTION_API,data:{session_id:loggedUser.session_id,delivery:j.innerBean.delivery,origin:"WEB"},error:function(){showMessage(text.get("content.delete.error"),"error");logAction("js/Content/remove/error")},success:function(k){tabs.removeAllTabsEntry(j);conversationCount=e.innerBean.conversation_count-1;for(t in tabs.tabs[e.innerBean.tab]){var l=tabs.tabs[e.innerBean.tab][t];if(l.innerBean.message==e.innerBean.conversation){l.innerBean.conversation_count=l.innerBean.conversation_count-1}}tabs.updateLayout();logAction("js/Content/remove/success")}})};Content.prototype.sendByBluetoothDirectly=function(){if(!loggedUser.mac){loggedUser.pendingContent=this;bluetooth.showPopup()}else{bluetooth.send(loggedUser.mac,this.innerBean.attachment)}};Content.prototype.sendBySmsDirectly=function(){if(!loggedUser.phone){loggedUser.pendingContent=this;actionLoggedUserPhone(ACTIONS_INPUT.CHANGE)}else{sms.send(this.innerBean.attachment)}};Content.prototype.send=function(k){if(!this.innerBean.attachment){showMessage(text.get("content.send.error"),"error")}else{if(k==SENDING_MODE.DOWNLOAD){window.location=STREAM_FILE_API+"?resource="+this.innerBean.attachment+"&attachment=true"}else{if(k==SENDING_MODE.BLUETOOTH){var j=" if (!contents.hasContent('"+this.getId()+"')) {     showMessage('"+text.get("content.send.error2")+"', 'error');     internalError('Content not found! "+this.getId()+"'); } else {     contents.getContent('"+this.getId()+"').sendByBluetoothDirectly(); }";doAfterLogin(j)}else{if(k==SENDING_MODE.SMS){var j=" if (!contents.hasContent('"+this.getId()+"')) {     showMessage('"+text.get("content.send.error2")+"', 'error');     internalError('Content not found! "+this.getId()+"'); } else {     contents.getContent('"+this.getId()+"').sendBySmsDirectly(); }";doAfterLogin(j)}else{if(k==SENDING_MODE.SMS){var j=" if (!contents.hasContent('"+this.getId()+"')) {     showMessage('"+text.get("content.send.error2")+"', 'error');     internalError('Content not found! "+this.getId()+"'); } else {     contents.getContent('"+this.getId()+"').sendBySmsDirectly(); }";doAfterLogin(j)}}}}}logAction("js/Content/send/"+k)};Content.prototype.getText=function(){var j=this.innerBean.text;j=replaceAll(j,"<br/>","\n");return j};Content.prototype.shareInFact=function(){var k=this;if(loggedUser.isLogged()&&loggedUser.nick==k.innerBean.author){showMessage(text.get("content.duplicated"),"error")}else{var j=this.getText();if(loggedUser.administrator){var l=prompt(text.get("content.share.alouw"),j);if(l){j=l}}server.call({url:SEND_MESSAGE_API,data:{session_id:loggedUser.session_id,author:k.innerBean.author,attachments:!k.innerBean.attachment?"":k.innerBean.attachment,text:j,destinations:(loggedUser.nick+"#WALL"),origin:"WEB"},error:function(){showMessage(text.get("content.share.error"),"error");logAction("js/Content/shareInFact/error")},success:function(n){showMessage(text.get("content.share.success"),"success");if(loggedUser.isLogged()){loggedUser.sharedContents[k.getHash()]="true"}tabs.updateLayout();logAction("js/Content/shareInFact/success")}})}};Content.prototype.reportInFact=function(){var j=this;server.call({url:ACTION_LOG_API,data:{session_id:loggedUser.session_id,profile:loggedUser.nick,message:j.innerBean.message,action:"REPORT",origin:"WEB"},error:function(){showMessage(text.get("content.report.error"),"error")},success:function(k){showMessage(text.get("content.report.success"),"success")}})};Content.prototype.share=function(){doAfterLogin("if (contents.hasContent('"+this.getId()+"')) { contents.getContent('"+this.getId()+"').shareInFact(); }")};Content.prototype.report=function(){doAfterLogin("if (contents.hasContent('"+this.getId()+"')) { contents.getContent('"+this.getId()+"').reportInFact(); }")};Content.prototype.orkutShare=function(){if(!withOrkut){$(".orkutButton").hide();showMessage(text.get("content.orkut_share.error")+" "+k,"error");logAction("js/Content/orkutShare/error")}else{var l=this;try{var n={};if(l.innerBean.text){n[google.orkut.share.Field.TITLE]=cutText(l.getText(),30);if(l.innerBean.text.length>30){n[google.orkut.share.Field.CONTENT]=l.getText()}}else{n[google.orkut.share.Field.TITLE]=text.get("content.orkut_share.title")}n[google.orkut.share.Field.DESTINATION_URL]=BASE_URL_WEB+"?profile/profile="+l.innerBean.sender_nick+"&message="+this.innerBean.message;if(l.thumb){n[google.orkut.share.Field.THUMBNAIL]=l.thumb}var j=new google.orkut.share.Connection(n);j.send("orkut.com",{},function(o){if(!o){showMessage(text.get("content.orkut_share.error"),"error");logAction("js/Content/orkutShare/error")}else{showMessage(text.get("content.orkut_share.success"),"success");logAction("js/Content/orkutShare/success")}})}catch(k){showMessage(text.get("content.orkut_share.error")+" "+k,"error");logAction("js/Content/orkutShare/error")}}};function g(l,k,j){if(!j){j="SENDER_CODE"}k=k.replace(j,"showPerson(this, '"+l.nick+"');");return k}Content.prototype.comment=function(k,j,n){var q=!this.innerBean.text?"":this.getText();var o=this;var v=o.innerBean.conversation;var l=o.innerBean.message;q=cutText(q,MESSAGE_REPLY_MAX_LENGTH);if(n=="answer"){j=j+" ("+text.get("content.reply_of")+' "'+q+'")'}else{}if(n=="comment"){server.call({url:SEND_MESSAGE_API,data:{session_id:loggedUser.session_id,destinations:k+"#WALL",text:j,conversation:o.innerBean.message,origin:"WEB"},error:function(){showMessage(text.get("content.comment.error"),"error")},success:function(w){showCommentsDiv(v?v:l,e.innerBean.tab,"true")}})}else{server.call({url:SEND_MESSAGE_API,data:{session_id:loggedUser.session_id,destinations:k,text:j,origin:"WEB"},error:function(){showMessage(text.get("content.message.error"),"error")},success:function(w){showMessage(text.get("content.message.success"),"success")}})}logAction("js/Content/comment/"+n)};Content.prototype.wasViaBluetooth=function(){return this.innerBean.origin=="BLUETOOTH"};Content.prototype.wasViaJME=function(){return this.innerBean.origin=="JME"||this.innerBean.origin=="MOBILE"};Content.prototype.getTextToRecommendedTab=function(k){if(!k){k=9999}var j=this.innerBean.text;if(!j){j=this.innerBean.attachment_name}if(j){j=cutText(j,k)}else{if(this.innerBean.content_type=="AUDIO"){j=text.get("content.ringtone")}else{if(this.innerBean.content_type=="VIDEO"){j=text.get("content.video")}else{if(this.innerBean.content_type=="IMAGE"){j=text.get("content.wallpaper")}else{j=text.get("content.app")}}}}return j};Content.prototype.toHTMLRecommendedStyle=function(n){var l='<div class="boxTurbine'+(n?"Last":"")+'">';l+=getDivContent(TEMPLATE.BOOST.CONTENT);var k=users.getUser(this.innerBean.author);l=l.replace("!SENDER_IMAGE_CODE!",k.toRecommendedHTML());l=l.replace("!SENDER_NAME!","<label onclick=\"showPerson(this, '"+k.nick+'\');" title="'+k.name+'">'+k.name+"</label>");if(this.innerBean.content_type=="MESSAGE"){l=l.replace("!CONTENT_TEXT!","&nbsp;");l=l.replace("IMAGE_CODE",'<div style="cursor: default;" class="boxTurbinePreview">'+this.innerBean.text+"</div>")}else{var j=this.getTextToRecommendedTab();l=l.replace("!CONTENT_TEXT!",'<span title="'+this.getText()+'">'+j+"</span>");var q=this.innerBean.content_type=="IMAGE"?(STREAM_FILE_API+"?resource="+this.innerBean.attachment+"&width=104&height=137&distortion=cut"):this.innerBean.content_type=="VIDEO"?(BASE_URL_IMAGES+"thumb-turbo-video2.jpg"):this.innerBean.content_type=="AUDIO"?(BASE_URL_IMAGES+"thumb-turbo-audio.jpg"):(BASE_URL_IMAGES+"thumb-turbo-apps.jpg");var o='<div class="boxTurbinePreview" onclick="showContentPreview(true, contents.getContent(\''+this.getId()+'\'));"><img src="'+q+'" /></div>';l=l.replace("IMAGE_CODE",o)}l+="</div>";return l};function b(k){var v=k.substring(0,k.indexOf("#"));var n=v.split("|").length-1;var l=k.substring(k.indexOf("#"),k.length);var q=l.split("|").length-1;var o=l.split(";1|").length-1;var w=l.split(";0|").length-1;var j="alouw-broadcaster-"+e.getId();k='<div title="Alouw.net" id="'+j+'_popup"><div id="'+j+'" class="jqPlot" style="display: none; width: 400px; height: 300px;" align="center"></div></div><b>'+text.get("content.broadcaster.report")+'</b><br/><img src="'+BASE_URL_IMAGES+'icon-chart.gif" align="absmiddle"> <a href="javascript: plotAlouwBroadcaster(\''+j+"', "+n+", "+q+", "+o+", "+w+')">'+text.get("content.broadcaster.click")+"</a>";return k}Content.prototype.toHTML=function(){var G=(tabs.selectedTab==TAB.MESSAGES);var w=(tabs.selectedTab==TAB.HOTSPOT);var F=(tabs.selectedTab==TAB.SEARCH_RESULT);var A=this.innerBean.sender_nick=="alouw";var z=(this.isShared()?TEMPLATE.TIMELINE.CONTENT_HOME_SHARED:(this.isComment?TEMPLATE.TIMELINE.CONTENT_COMMENT:TEMPLATE.TIMELINE.CONTENT_HOME));var x=getDivContent(z);var l=this.getId().split("_");x='<div id="message_id_'+l[1]+'"  class="newContent" style="'+(!contents.isNew(this.getId())?"":"display:none;")+'">'+x;contents.setIsOld(this.getId());if(A){x=x.replace("content top_breaker","content contentHighlight top_breaker")}var k=users.getUser(this.innerBean.sender_nick);x=x.replace("!SENDER_IMAGE_CODE!",k.toFollowHTML((this.isComment?LAYOUT_SOURCE.CONTENT_COMMENT:LAYOUT_SOURCE.CONTENT),this.getId()));x=x.replace("!SENDER!",'<label id="user-content-sender-'+this.getId()+'" onclick="SENDER_CODE">!SENDER_NAME!</label> POS_SENDER_NAME');if(this.isNewMessage()&&!F){x=x.replace("!NEW!",'<div style="position:absolute;width:32px;height:7px;margin-bottom:10px; margin-left:420px; margin-top:-8px;"><img    class="avisoNovo" src="'+BASE_URL_IMAGES+'ico-novo.gif"></div> <div style="clear:both"></div>')}else{x=x.replace("!NEW!","")}var H="";if(this.wasViaJME()){H='(pelo <a href="javascript:;"  onclick="window.open(\''+BASE_URL_WEB+"?p=celular');\">"+text.get("content.by_mobile.title")+'</a> <img src="'+BASE_URL_IMAGES+'celular.gif" />)';x=x.replace("POS_SENDER_NAME",H)}else{if(this.wasViaBluetooth()){var o=this.innerBean.shared_at;var I=o.split("#")[0];H="("+text.get("content.by_bluetooth.title")+' <img src="'+BASE_URL_IMAGES+'bluetooth.png" />)';if(this.innerBean.recent&&this.innerBean.sender_mac){H+='<br><img src="'+BASE_URL_IMAGES+'arrow.png" /> <label onclick="actionISentThat(\''+this.innerBean.sender_mac+"')\">"+text.get("content.itsmine")+"</label>"}H+='<div style="width:94px; position: absolute; * position: relative; margin-left:356px; margin-top:-25px; * margin-bottom:-35px;" ><img  src="'+BASE_URL_IMAGES+'checkin_png.png" /><div style="margin-left:10px; margin-top:-5px;"  alt="'+I+'" title="'+I+'"   ><span style="color:#64c13d; font-size:11px; font-weight:bold;"><em>VIA</em>&nbsp;</span><label onclick="location.href=\''+BASE_URL_WEB+"?profile="+I+'\'"   style="color:#2c98d6; text-decoration:underline; font-size:11px; font-weight:normal"><em>'+I+"</em> </label></div></div>";x=x.replace("POS_SENDER_NAME",H)}else{x=x.replace("POS_SENDER_NAME","");var B=users.getUser(this.innerBean.author);x=x.replace("!VIA_CODE!",'<label id="user-content-sender-'+this.getId()+'" onclick="SENDER_VIA_CODE">'+B.name+"</label>");x=g(B,x,"SENDER_VIA_CODE")}}x=x.replace("!SENDER_NAME!",(!k.anonymous?"":text.get("content.mobile_before_friendlyname")+" ")+k.name);x=g(k,x);var j=false;if(!this.innerBean.attachment){j=true}else{x=x.replace("OPEN_SPAN_STYLE","");x=x.replace("CLOSE_SPAN_STYLE","");var n="onclick=\"showContentPreview(true, contents.getContent('"+this.getId()+"'))\"";if(this.innerBean.content_type=="IMAGE"){x=x.replace("!CONTENT_IMAGE_CODE!",'<img src="'+this.thumb+'" '+n+' style="cursor:pointer;"/><br/>'+(this.innerBean.attachment_name?'<span class="details">'+this.innerBean.attachment_name+"</span><br/>":""))}else{if(this.innerBean.content_type=="VIDEO"){x=x.replace("!CONTENT_IMAGE_CODE!",'<img src="'+BASE_URL_IMAGES+'ico-video.jpg" '+n+' style="cursor:pointer;"/><br/>'+(this.innerBean.attachment_name?'<span class="details">'+this.innerBean.attachment_name+"</span><br/>":""))}else{if(this.innerBean.content_type=="AUDIO"){x=x.replace("!CONTENT_IMAGE_CODE!",'<img src="'+BASE_URL_IMAGES+'ico-audio.jpg" '+n+' style="cursor:pointer;"/><br/>'+(this.innerBean.attachment_name?'<span class="details">'+this.innerBean.attachment_name+"</span><br/>":""))}else{if(this.innerBean.content_type=="TEXT"){x=x.replace("!CONTENT_IMAGE_CODE!",'<img src="'+BASE_URL_IMAGES+'alouw_text.gif" '+n+' style="cursor:pointer;"/><br/>'+(this.innerBean.attachment_name?'<span class="details">'+this.innerBean.attachment_name+"</span><br/>":""))}else{if(this.innerBean.content_type!="TEXT"&&this.innerBean.content_type!="MESSAGE"){x=x.replace("!CONTENT_IMAGE_CODE!",'<img src="'+BASE_URL_IMAGES+'ico-apps.jpg" '+n+' style="cursor:pointer;"/><br/>'+(this.innerBean.attachment_name?'<span class="details">'+this.innerBean.attachment_name+"</span><br/>":""))}else{j=true}}}}}}if(!this.innerBean.text){x=x.replace("!CONTENT_TEXT!","")}else{var E=this.innerBean.text;if(E.indexOf("[abc]")==1){x=x.replace("!CONTENT_TEXT!",b(E))}else{E=replaceAll(E,"<br/>","\n");try{E=E.replace(new RegExp("(^|[\\t\\s\\n])@([^;, :!?.\\-\\(\\?\\)\\*\\.\\+\\[\\]]+)([;, :!?.\\-\\(\\?\\)\\*\\.\\+\\[\\]]|$)","gi"),'$1<b>@<label class="name" onclick="window.location.href = BASE_URL_WEB + \'/?profile=$2\'">$2</label></b>$3');E=E.replace(new RegExp("(https?://|www\\.)([\\w\\d:#@%/;$()~_?\\+-=\\\\\\.&]*)","gi"),'<a target="_blank" href="$1$2">$1$2</a>');E=E.replace(/href="www/g,'href="http://www');E=E.replace(new RegExp("#message\\|(.*?),(.*?)\\|(.*?)#","gi"),'<b><label class="name" onclick="window.location.href = BASE_URL_WEB + \'/?profile=$1&message=$2\'">$3</label></b>')}catch(v){}var q=getInputValue(INPUT.SEARCH.VALUE);try{if(q.length>0){E=E.replace(new RegExp("("+q+")","gi"),'<span class="textMarker">$1</span>')}}catch(v){}E=replaceAll(E,"\n","<br/>");x=x.replace("!CONTENT_TEXT!",E)}}if(j){x=x.replace("!CONTENT_IMAGE_CODE!","")}var C="";var y=!loggedUser.isLogged()?false:(this.innerBean.sender_nick==loggedUser.nick);var D=!loggedUser.isLogged()?false:(this.innerBean.to_nick==loggedUser.nick);if(this.innerBean.date){C+=this.innerBean.date}else{C+=""}C+="<br/>";if(!F&&(y||D||loggedUser.administrator)){C+='<img src="'+BASE_URL_IMAGES+'ico-excluir.gif" align="absmiddle">&nbsp;';C+="<label onclick=\"$(this).html('"+text.get("content.deleting")+"'); $(this).unbind('click'); contents.getContent('"+this.getId()+"').remove();\">"+(w?text.get("content.hotspot.stop_share"):text.get("content.delete"))+"</label>&nbsp;&nbsp;"}if(G||(!w&&!this.innerBean.conversation)){if(G){C+='<img src="'+BASE_URL_IMAGES+'ico-responder.gif" align="absmiddle">&nbsp;';C+='<label id="content'+this.getId()+'" onclick="commentPopup.show(\'content'+this.getId()+"', '"+this.innerBean.sender_nick+"', '"+this.getId()+"', 'answer');\">"+text.get("content.reply")+"</label>&nbsp;&nbsp;&nbsp;"}else{C+='<img src="'+BASE_URL_IMAGES+'ico-comentar.gif" align="absmiddle">&nbsp;';C+='<label id="content'+this.getId()+'" onclick="commentPopup.show(\'content'+this.getId()+"', '"+this.innerBean.sender_nick+"', '"+this.getId()+"', 'comment');\">"+text.get("content.comment")+"</label>&nbsp;&nbsp;";if(this.isCommentOpen!=true&&this.innerBean.conversation_count>0){C+='<a  id="comment_count_'+this.innerBean.message+'" class="link2010" href="javascript:showCommentsDiv('+this.innerBean.message+",'"+this.innerBean.tab+"','false');\"><span id=\"comment_count_"+this.innerBean.message+'">';if(this.innerBean.conversation_count==1){C+="<b>"+text.get("content.comment.view.one")+"</b></span></a>&nbsp;&nbsp;&nbsp;"}else{C+="<b>"+text.get("content.comment.view.all")+"&nbsp;"+this.innerBean.conversation_count+"&nbsp;"+text.get("content.comments")+"</b></span></a>&nbsp;&nbsp;"}}else{if(this.isCommentOpen==true&&this.innerBean.conversation_count>0){C+='<a class="link2010" href="javascript:hideCommentsDiv('+this.innerBean.message+",'"+this.innerBean.tab+'\');"><span id="comment_count_'+this.innerBean.message+'">';if(this.innerBean.conversation_count==1){C+="<b>"+text.get("content.comment.hide.one")+"</b></span></a>&nbsp;&nbsp;&nbsp;"}else{C+="<b>"+text.get("content.comment.hide.all")+"&nbsp;"+this.innerBean.conversation_count+"&nbsp;"+text.get("content.comments")+"</b></span></a>&nbsp;&nbsp;"}}}}}if(G||(!w&&!this.innerBean.conversation)){if(!G&&!w){C+='<span style="color:#999">&bull;</span>&nbsp;&nbsp;&nbsp;'}if(!loggedUser.sharedContents[this.getHash()]&&!y&&!G){C+="<a onclick=\"contents.getContent('"+this.getId()+'\').share();" style="cursor:pointer"><img alt="'+text.get("share.alouw.alt")+'" title="'+text.get("share.alouw.title")+'" src="'+BASE_URL_IMAGES+'share/alouw.png" align="absmiddle"></img></a>'}if(withOrkut&&!G){C+='<a href="http://api.addthis.com/oexchange/0.8/forward/orkut/offer?username=alouw&url='+escape(BASE_URL_WEB)+escape("?profile=")+escape(this.innerBean.sender_nick)+escape("&message=")+escape(this.innerBean.message)+'" target="_blank"><img alt="'+text.get("share.orkut.alt")+'" title="'+text.get("share.orkut.title")+'" src="'+BASE_URL_IMAGES+'share/orkut.png" align="absmiddle"></img></a>&nbsp;';C+='<a href="http://api.addthis.com/oexchange/0.8/forward/live/offer?username=alouw&url='+escape(BASE_URL_WEB)+escape("?profile=")+escape(this.innerBean.sender_nick)+escape("&message=")+escape(this.innerBean.message)+'" target="_blank"><img alt="'+text.get("share.live.alt")+'" title="'+text.get("share.live.title")+'" src="'+BASE_URL_IMAGES+'share/msn.png" align="absmiddle"></img></a>&nbsp;';C+='<a href="http://api.addthis.com/oexchange/0.8/forward/facebook/offer?username=alouw&url='+escape(BASE_URL_WEB)+escape("?profile=")+escape(this.innerBean.sender_nick)+escape("&message=")+escape(this.innerBean.message)+'" target="_blank"><img alt="'+text.get("share.facebook.alt")+'" title="'+text.get("share.facebook.title")+'" src="'+BASE_URL_IMAGES+'share/facebook.png" align="absmiddle"></img></a>&nbsp;';C+='<a href="http://api.addthis.com/oexchange/0.8/forward/twitter/offer?username=alouw&url='+escape(BASE_URL_WEB)+escape("?profile=")+escape(this.innerBean.sender_nick)+escape("&message=")+escape(this.innerBean.message)+'" target="_blank"><img alt="'+text.get("share.twitter.alt")+'" title="'+text.get("share.twitter.title")+'" src="'+BASE_URL_IMAGES+'share/twitter.png" align="absmiddle"></img></a>&nbsp;';C+='<a href="http://api.addthis.com/oexchange/0.8/forward/email/offer?username=alouw&url='+escape(BASE_URL_WEB)+escape("?profile=")+escape(this.innerBean.sender_nick)+escape("&message=")+escape(this.innerBean.message)+'" target="_blank"><img alt="'+text.get("share.email.alt")+'" title="'+text.get("share.email.title")+'" src="'+BASE_URL_IMAGES+'share/mail.png" align="absmiddle"></img></a>&nbsp;'}}x=x.replace("!DETAILS!",C);x+="</div>";return x}}function ContentPublisher(){this.isShowingAttachment=false;this.fileToSend=false;this.fileExt=false;this.sending=false;this.success=false;this.error=false;this.timerToHideId=undefined;var b=this;$(document).ready(function(){if($("#upload_button").length>0){b.uploader=new AjaxUpload("upload_button",{action:SEND_MESSAGE_API,name:"file",autoSubmit:false,responseType:"json",onChange:function(e,g){if(b.timerToHideId){clearTimeout(b.timerToHideId)}b.isShowingAttachment=false;b.success=false;b.error=false;b.fileToSend=e;b.fileExt=g;b.updateLayout()},onSubmit:function(e,g){b.sending=true;b.updateLayout()},onComplete:function(g,e){b.hasBeenPublished(e)}})}});ContentPublisher.prototype.toHotspot=function(){if(!loggedUser.hasHotspot){return false}else{return $("#toHotspot").hasClass("selectedChk")}};ContentPublisher.prototype.toWall=function(){if(!loggedUser.hasHotspot){return true}else{return $("#toWall").hasClass("selectedChk")}};ContentPublisher.prototype.checkWall=function(){$("#toHotspot").removeClass("selectedChk");$("#toWall").addClass("selectedChk")};ContentPublisher.prototype.checkHotspot=function(){$("#toWall").removeClass("selectedChk");$("#toHotspot").addClass("selectedChk")};ContentPublisher.prototype.checkBoth=function(){$("#toWall").addClass("selectedChk");$("#toHotspot").addClass("selectedChk")};ContentPublisher.prototype.setAttachmentVisibility=function(e){if(e===undefined){this.isShowingAttachment=!this.isShowingAttachment}else{this.isShowingAttachment=e}doAfterLogin("contentPublisher.isShowingAttachment = "+this.isShowingAttachment+";contentPublisher.updateLayout();")};ContentPublisher.prototype.updateLayout=function(){hideDiv(DIV.PUBLISHER.FILE_SENDING);hideDiv(DIV.PUBLISHER.FILE_SELECTED);hideDiv(DIV.PUBLISHER.FILE_SUCCESS);hideDiv(DIV.PUBLISHER.FILE_ERROR);hideDiv(DIV.PUBLISHER.ATTACHMENT);if(this.sending){showDiv(DIV.PUBLISHER.FILE_SENDING)}else{if(this.success){showDiv(DIV.PUBLISHER.FILE_SUCCESS)}else{if(this.error){showDiv(DIV.PUBLISHER.FILE_ERROR)}else{if(this.fileToSend){var e=30;var h=this.fileToSend;var g=this.fileExt;if((h.length-g.length)>e){h=cutText(h.substr(0,(h.length-g.length)),e)+g}setDivContent(DIV.PUBLISHER.FILE_NAME,h);setDivContent(DIV.PUBLISHER.FILE_NAME+"2",h);setDivContent(DIV.PUBLISHER.FILE_NAME+"3",h);showDiv(DIV.PUBLISHER.FILE_SELECTED)}}}}if(this.isShowingAttachment){showDiv(DIV.PUBLISHER.ATTACHMENT)}};ContentPublisher.prototype.hasBeenPublished=function(h){this.sending=false;this.fileToSend=false;this.isShowingAttachment=false;if(h&&h.success){this.success=true;this.error=false;var e=(this.toHotspot()&&!this.toWall());if((!e&&(tabs.selectedTab!=TAB.ALL&&tabs.selectedTab!=TAB.WALL))||(e&&tabs.selectedTab!=TAB.HOTSPOT)){if(e){showMessage(text.get("content_publisher.success_hotspot"),"success")}else{showMessage(text.get("content_publisher.success"),"success")}}tabs.updateViaAjax();setInputValue(INPUT.PUBLISHER.TEXT,text.get("input.publisher.text_default"))}else{this.success=false;this.error=true;if(h&&h.error=="INVALID_SESSION"){server.lostSession()}else{if(h&&h.error=="INVALID_UPLOADED_FILE"){showMessage(text.get("content_publisher.error.invalid_uploaded_file"),"error")}else{if(h&&h.error=="FILE_IS_TOO_LARGE"){showMessage(text.get("content_publisher.error.file_is_too_large"),"error")}else{var g=text.get("content_publisher.error");if(h&&h.error){g+=" "+text.get("content.code")+" "+h.error}showMessage(g,"error")}}}}if(this.success){this.timerToHideId=setTimeout("$('#' + DIV.PUBLISHER.FILE_SUCCESS).fadeOut();contentPublisher.success = false;",TIME.PUBLISHER_MESSAGE_FADE_OUT)}else{if(this.error){this.timerToHideId=setTimeout("$('#' + DIV.PUBLISHER.FILE_ERROR).fadeOut();contentPublisher.error = false;",TIME.PUBLISHER_MESSAGE_FADE_OUT)}}this.updateLayout()};ContentPublisher.prototype.publish=function(){if(!loggedUser.isLogged()){loginPopup.show()}else{var e="";if(this.toWall()){e+=loggedUser.nick+"#WALL"}if(this.toHotspot()){e+=(e?",":"")+loggedUser.nick+"#BROADCAST"}if(this.fileToSend){var g=getInputValue(INPUT.PUBLISHER.TEXT);if(g==text.get("input.publisher.text_default")){g=""}this.uploader.setData({text:g,session_id:loggedUser.session_id,destinations:e,origin:"WEB"});this.uploader.submit()}else{setDivContent(DIV.PUBLISHER.FILE_NAME,text.get("content_publisher.text"));setDivContent(DIV.PUBLISHER.FILE_NAME+"2",text.get("content_publisher.text"));setDivContent(DIV.PUBLISHER.FILE_NAME+"3",text.get("content_publisher.text"));if((getInputValue(INPUT.PUBLISHER.TEXT)==""||getInputValue(INPUT.PUBLISHER.TEXT)==text.get("input.publisher.text_default"))){this.success=false;this.error=true;showMessage(text.get("content_publisher.void"),"error")}else{var h=this;server.call({url:SEND_MESSAGE_API,data:{session_id:loggedUser.session_id,origin:"WEB",destinations:e,text:getInputValue(INPUT.PUBLISHER.TEXT)},success:function(j){h.hasBeenPublished(j)},error:function(){h.success=false;h.error=true;showMessage(text.get("content_publisher.error"),"error")}})}this.updateLayout()}}}}var AVATAR_UPLOAD_ERROR={SUCCESS:"AVATAR_SUCCESS",ERROR:"AVATAR_ERROR",INVALID_FILE_SIZE:"AVATAR_INVALID_FILE_SIZE"};function AvatarUploader(){this.isShowing=false;this.isLoading=false;var e=this;var b=function(g){showMessage(text.get("avatar.update.error")+(!g?"":" "+g),"error")};$(document).ready(function(){if($("#change-avatar").length>0){e.uploader=new AjaxUpload("change-avatar",{action:CREATE_RESOURCE_API,name:"file",autoSubmit:false,responseType:"json",onChange:function(g,h){if(!h.match(/jpg|jpeg|gif|png|bmp/i)){showMessage(text.get("avatar.update.wrong_image_type"),"error");return false}else{setDivContent(DIV.PICTURE.FILE_NAME,g);return true}},onSubmit:function(g,h){},onComplete:function(h,g){if(!g.success){b(text.get("avatar.error")+" "+g.error)}else{loggedUser.setAvatar(g.resource,function(j){if(!j){b(text.get("avatar.connection_error"))}else{showMessage(text.get("avatar.update.success"),"success");e.close();tabs.updateViaAjax()}})}}})}});AvatarUploader.prototype.show=function(){this.isShowing=true;this.updateLayout()};AvatarUploader.prototype.close=function(){this.isShowing=false;this.updateLayout()};AvatarUploader.prototype.updateLayout=function(){if(!this.isShowing){hideDiv(DIV.PICTURE.INPUT_POPUP)}else{showDiv(DIV.PICTURE.INPUT_POPUP);if(this.isLoading){showDiv(DIV.PICTURE.LOADING)}else{hideDiv(DIV.PICTURE.LOADING)}}};AvatarUploader.prototype.hasBeenPublished=function(g){if(g==AVATAR_UPLOAD_ERROR.SUCCESS){showMessage(text.get("picture.success"),"success")}else{if(g==AVATAR_UPLOAD_ERROR.ERROR){showMessage(text.get("picture.error"),"error")}else{if(g==AVATAR_UPLOAD_ERROR.INVALID_FILE_SIZE){showMessage(text.get("picture.big"),"error")}}}};AvatarUploader.prototype.upload=function(){if(!loggedUser.isLogged()){b(text.get("avatar.not_logged"))}else{e.uploader.setData({session_id:loggedUser.session_id,origin:"WEB"});e.uploader.submit()}}}function Contents(){this.contents=new Array();this.oldContentsStatus=new Array();this.selectedContent=undefined;Contents.prototype.selectContent=function(b){this.selectedContent=b};Contents.prototype.getSelectedContent=function(){return this.getContent(this.selectedContent)};Contents.prototype.addContent=function(e,b){this.contents[e]=b};Contents.prototype.hasContent=function(b){return this.contents[b]};Contents.prototype.isNew=function(b){return !this.oldContentsStatus[b]};Contents.prototype.setIsOld=function(b){this.oldContentsStatus[b]=true};Contents.prototype.getContent=function(b){if(!this.hasContent(b)){internalError("content '"+b+"' is undefined!")}return this.contents[b]}}User.prototype=new TabEntry();function User(e){this.type="USER";if(e){this.nick=e.nick;this.name=cutText(e.name,USER_NAME_MAX_LENGTH);this.avatar=e.avatar;this.anonymous=e.anonymous;this.online=e.online;this.blocked=e.blocked;this.creationDate=e.creationDate}User.prototype.isBlocked=function(){return this.blocked!=null&&this.blocked};User.prototype.isFollowing=function(){if(!loggedUser.isLogged()){return false}else{return($.inArray(this.nick,loggedUser.following)>=0)}};User.prototype.toHTML=function(){var n=getDivContent(TEMPLATE.TIMELINE.USER);n=n.replace("!SENDER_IMAGE_CODE!",this.toFollowHTML(LAYOUT_SOURCE.CONTENT,this.nick));var k=this.name;var q=getInputValue(INPUT.SEARCH.VALUE);try{if(q.length>0){k=k.replace(new RegExp("("+q+")","gi"),'<span class="textMarker">$1</span>')}}catch(o){}n=n.replace("!USER_NAME!",k);n=n.replace(new RegExp("NICKNAME","g"),this.nick);if(loggedUser.nick==this.nick){n=n.replace("FOLLOW_CODE","");n=n.replace("WRITE_CODE","");n=n.replace("GO_TO_PROFILE_CODE","")}else{var l='<label class="follow-code-'+this.nick+'" onclick="users.getUser(\''+this.nick+"').follow(); actionFollow('"+this.nick+"',this);\">"+(this.isFollowing()?text.get("unfollow"):text.get("follow"))+"</label> &middot";n=n.replace("FOLLOW_CODE",l);var j='<label id="writeTo'+this.nick+'" onclick="commentPopup.show(\'writeTo'+this.nick+"', '"+this.nick+"', '', undefined);\">"+text.get("user.write")+"</label> &middot;";n=n.replace("WRITE_CODE",j);var h="<label onclick=\"users.getUser('"+this.nick+"').goToProfile();\">"+text.get("user.see_profile")+"</label>";n=n.replace("GO_TO_PROFILE_CODE",h)}return n};User.prototype.toFriendsHTML=function(){var n=getDivContent(TEMPLATE.TIMELINE.FRIENDS);n=n.replace("!SENDER_IMAGE_CODE!",this.toFollowHTML(LAYOUT_SOURCE.CONTENT,this.nick));var k=this.name;var q=getInputValue(INPUT.SEARCH.VALUE);try{if(q.length>0){k=k.replace(new RegExp("("+q+")","gi"),'<span class="textMarker">$1</span>')}}catch(o){}n=n.replace("!USER_NAME!",k);n=n.replace(new RegExp("NICKNAME","g"),this.nick);n=n.replace("!SINCE_DATE!",text.get("user.since.date")+this.creationDate);if(loggedUser.nick==this.nick){n=n.replace("FOLLOW_CODE","");n=n.replace("WRITE_CODE","");n=n.replace("GO_TO_PROFILE_CODE","")}else{var l='<img src="'+BASE_URL_IMAGES+'follow.png"> <label class="follow-code-'+this.nick+'" onclick="users.getUser(\''+this.nick+"').follow(); actionFollow('"+this.nick+"',this);\">"+(this.isFollowing()?text.get("unfollow"):text.get("follow"))+"</label> &middot";n=n.replace("FOLLOW_CODE",l);var j='<img src="'+BASE_URL_IMAGES+'ico_email.png"> <label id="writeTo'+this.nick+'" onclick="commentPopup.show(\'writeTo'+this.nick+"', '"+this.nick+"', '', undefined);\">"+text.get("user.write")+"</label> &middot;";n=n.replace("WRITE_CODE",j);var h='<img src="'+BASE_URL_IMAGES+'dropdown_perfil.png"> <label onclick="users.getUser(\''+this.nick+"').goToProfile();\">"+text.get("user.see_profile")+"</label>";n=n.replace("GO_TO_PROFILE_CODE",h)}return n};User.prototype.fakeAvatar=function(){if(!this.nick){return 0}else{var h=hex_md5(this.nick).substring(0,5);var j=parseInt("0x"+h)%3;return j}};User.prototype.getAvatarURL=function(j){var h=BASE_URL_IMAGES+"avatar"+this.fakeAvatar()+""+j+".png";if(this.avatar){h=STREAM_FILE_API+"?resource="+this.avatar+"&width="+j+"&height="+j+"&distortion=cut"}return h};User.prototype.toRecommendedHTML=function(){var h='<img width="25" onclick="showPerson(this, \''+this.nick+'\');" src="'+this.getAvatarURL(25)+'" class="boxTurbineUser floatL" />';return h};User.prototype.toFollowHTML=function(h,q){var n=this.isFollowing()?getDivContent(TEMPLATE.FOLLOWING):getDivContent(TEMPLATE.FOLLOWERS);var l=this.name;var x=SIZE.AVATAR_FOLLOWING;switch(h){case LAYOUT_SOURCE.FOLLOWER:l="user-follower-"+q;x=SIZE.AVATAR_FOLLOWING;break;case LAYOUT_SOURCE.FOLLOWING:l="user-following-"+q;x=SIZE.AVATAR_FOLLOWING;break;case LAYOUT_SOURCE.CONTENT:l="user-content-"+q;x=SIZE.AVATAR_SENDER;break;case LAYOUT_SOURCE.CONTENT_COMMENT:l="user-content-"+q;x=SIZE.AVATAR_SENDER_COMMENT;break}var v=(this.nick=="alouw")&&(h==LAYOUT_SOURCE.CONTENT);var w='<div title="'+this.name+'" onclick="PERSON_CLICK_SCRIPT" id="'+l+'" style="background: url('+(!v?this.getAvatarURL(x):BASE_URL_IMAGES+"ico-alouw-post.jpg")+") no-repeat; width: "+x+"px; height: "+x+'px; margin-bottom: 5px; margin-right: 4px; float: left;">';if(this.online){var k=(x==SIZE.AVATAR_FOLLOWING);var o;var j;if(!k){o=BASE_URL_IMAGES+"ico-online.gif";j="9px"}else{o=BASE_URL_IMAGES+"ico-online-small.gif";j="4px"}w+='<img src="'+o+'" style="position: relative; top: 3px; right: 3px; float: right; width: '+j+"; height: "+j+'; margin: 0px;">'}w+="</div>";n=n.replace("!IMG_CODE!",w);n=n.replace("PERSON_CLICK_SCRIPT","showPerson(this, '"+this.nick+"');");return n};function g(h,j){users.getUser(h).blocked=j}function b(h,j){if(j){loggedUser.following.push(h)}else{loggedUser.following=$.grep(loggedUser.following,function(k){return k!=h})}if(currentProfile){if(currentProfile.nick==loggedUser.nick){currentProfile.following=loggedUser.following}}if(!currentProfile){loggedUser.updateLayout()}}User.prototype.forceFollow=function(h){if(this.isFollowing()){h(true)}else{this.follow(h)}};User.prototype.follow=function(){var h=!this.isFollowing();doAfterLogin("users.getUser('"+this.nick+"').followInFact("+h+");")};User.prototype.block=function(){var h=!this.isBlocked();doAfterLogin("users.getUser('"+this.nick+"').blockInFact("+h+");")};User.prototype.blockInFact=function(j){if(loggedUser.isLogged()){var k=this;if(this.nick==loggedUser.nick){showMessage(text.get("user.cannot_block_yourself"),"error")}else{g(k.nick,j);var h=USER_BLOCK_API;server.call({url:h,data:{session_id:loggedUser.session_id,origin:"WEB",blocking_profile:k.nick,blocked:j},error:function(){showMessage(text.get("user.cannot_block_or_unblock")+" "+k.nick,"error");g(k.nick,!j)},success:function(l){if(j){showMessage(text.get("user.block")+" "+k.name+"!","success")}else{showMessage(text.get("user.unblock")+" "+k.name+"!","success")}}})}}};User.prototype.followInFact=function(k){if(loggedUser.isLogged()){var j=this;if(this.nick==loggedUser.nick){showMessage(text.get("user.cannot_follow_yourself"),"error")}else{b(j.nick,k);var h="";if(k){h=USER_FOLLOW_API}else{h=USER_UNFOLLOW_API}server.call({url:h,data:{session_id:loggedUser.session_id,origin:"WEB",to:(loggedUser.nick+"#INBOX"),from:(j.nick+"#WALL")},error:function(){showMessage(text.get("user.cannot_follow_or_unfollow")+" "+j.nick,"error");b(j.nick,!k)},success:function(l){if(currentProfile){currentProfile.updateFollowers(j,k)}if(k){showMessage(text.get("user.follow")+" "+j.name+"!","success")}else{showMessage(text.get("user.unfollow")+" "+j.name+"!","success")}}})}}};User.prototype.write=function(h){server.call({url:SEND_MESSAGE_API,data:{session_id:loggedUser.session_id,destinations:this.nick,text:h,origin:"WEB"},error:function(){showMessage(text.get("user.cannot_send_message"),"error")},success:function(j){showMessage(text.get("user.message.success"),"success")}})};User.prototype.goToProfile=function(){window.location.href=BASE_URL_WEB+"/?profile="+this.nick}}Profile.prototype=new User();function Profile(){this.followers=new Array();this.following=new Array();this.pagination=new Array();this.pagination[DIV.CURRENT_USER.CONTENT_FOLLOWING]=new Pagination();this.pagination[DIV.CURRENT_USER.CONTENT_FOLLOWERS]=new Pagination();Profile.prototype.setData=function(b){this.nick=b.nick;this.name=cutText(b.name,USER_NAME_MAX_LENGTH);this.avatar=b.avatar;this.anonymous=b.anonymous;this.online=b.online;this.following=b.following;this.followers=b.followers;this.pagination[DIV.CURRENT_USER.CONTENT_FOLLOWING].setLength(b.following.length,USERS_PER_PAGE);this.pagination[DIV.CURRENT_USER.CONTENT_FOLLOWERS].setLength(b.followers.length,USERS_PER_PAGE)};Profile.prototype.followersToHTML=function(){var e="";var g=this.followers;if(g.length==0){if(currentProfile){e='<p class="noFollow">'+text.get("profile.nobody_follow")+"</p>"}else{e='<p class="noFollow">'+text.get("profile.nobody_follow_you")+"</p>"}}else{setDivContent(DIV.CURRENT_USER.FOLLOWERS_COUNT,g.length);var b=0;for(f in g){if(this.pagination[DIV.CURRENT_USER.CONTENT_FOLLOWERS].isThisIndexInside(b)){var h=g[f];if(!h){internalError("follower can't be null! this="+this.nick)}else{e+=users.getUser(h).toFollowHTML(LAYOUT_SOURCE.FOLLOWER,users.getUser(h).nick)}}b++}}return e};Profile.prototype.nextPage=function(b){this.pagination[b].nextPage();this.updateLayoutWithEffect(b)};Profile.prototype.previousPage=function(b){this.pagination[b].previousPage();this.updateLayoutWithEffect(b)};Profile.prototype.followingToHTML=function(){var g="";var e=this.following;if(e.length==0){if(currentProfile){g='<p class="noFollow">'+text.get("profile.nobody_following")+"</p>"}else{g='<p class="noFollow">'+text.get("profile.you_following_nobody")+"</p>"}}else{var b=0;for(f in e){if(this.pagination[DIV.CURRENT_USER.CONTENT_FOLLOWING].isThisIndexInside(b)){setDivContent(DIV.CURRENT_USER.FOLLOWING_COUNT,e.length);var h=e[f];if(!h){internalError("following can't be null! this="+this.nick)}else{g+=users.getUser(h).toFollowHTML(LAYOUT_SOURCE.FOLLOWING,users.getUser(h).nick)}}b++}}return g};Profile.prototype.updateFollowers=function(b,e){if(loggedUser.isLogged()){if(this.nick!=loggedUser.nick){if(b.nick==this.nick){if(e){if($.inArray(loggedUser.nick,this.followers)<0){this.followers.push(loggedUser.nick)}}else{this.followers=$.grep(this.followers,function(g){return g!=loggedUser.nick})}}}this.updateLayout()}};Profile.prototype.updateLayoutWithEffect=function(e){var b=this;$("#"+e).fadeOut("fast",function(){b.updateLayout();$("#"+e).fadeIn("slow")})};Profile.prototype.updateLayout=function(){var b=(!currentProfile?true:(currentProfile.nick==loggedUser.nick));if(b){loggedUser.updatePersonalDataLayout()}setDivContent(DIV.CURRENT_USER.CONTENT_FOLLOWERS,this.followersToHTML());setDivContent(DIV.CURRENT_USER.CONTENT_FOLLOWING,this.followingToHTML());if(!this.pagination[DIV.CURRENT_USER.CONTENT_FOLLOWING].needPagination()){hideDiv(DIV.CURRENT_USER.FOLLOWING_PAGINATION)}else{showDiv(DIV.CURRENT_USER.FOLLOWING_PAGINATION);setDivContent(DIV.CURRENT_USER.FOLLOWING_PAGE,this.pagination[DIV.CURRENT_USER.CONTENT_FOLLOWING].getCurrentPage());setDivContent(DIV.CURRENT_USER.FOLLOWING_TOTAL_PAGE,this.pagination[DIV.CURRENT_USER.CONTENT_FOLLOWING].getTotalPages())}if(!this.pagination[DIV.CURRENT_USER.CONTENT_FOLLOWERS].needPagination()){hideDiv(DIV.CURRENT_USER.FOLLOWERS_PAGINATION)}else{showDiv(DIV.CURRENT_USER.FOLLOWERS_PAGINATION);setDivContent(DIV.CURRENT_USER.FOLLOWERS_PAGE,this.pagination[DIV.CURRENT_USER.CONTENT_FOLLOWERS].getCurrentPage());setDivContent(DIV.CURRENT_USER.FOLLOWERS_TOTAL_PAGE,this.pagination[DIV.CURRENT_USER.CONTENT_FOLLOWERS].getTotalPages())}if(currentProfile){if(currentProfile.isFollowing()){setDivContent(DIV.CURRENT_USER.FOLLOW_TEXT_CONTENT,text.get("unfollow"));hideDiv(DIV.CURRENT_USER.FOLLOW_ICON);showDiv(DIV.CURRENT_USER.UNFOLLOW_ICON)}else{setDivContent(DIV.CURRENT_USER.FOLLOW_TEXT_CONTENT,text.get("follow"));hideDiv(DIV.CURRENT_USER.UNFOLLOW_ICON);showDiv(DIV.CURRENT_USER.FOLLOW_ICON)}$("#"+DIV.LEDS_OTHERS).slideDown(1000)}}}LoggedUser.prototype=new Profile();function LoggedUser(){this.logged=false;this.updatingMAC=false;this.nick=undefined;this.session_id=undefined;this.sharedContents=new Array();this.administrator=false;this.bluetooth_upload=undefined;var e=this;LoggedUser.prototype.isLogged=function(){return loggedUser.logged};function h(j){if(e.isLogged()){var k="";switch(j){case text.get("user.contact.email"):showDiv(DIV.EMAIL.LOADING);k=e.email;break;case text.get("user.contact.phone"):showDiv(DIV.PHONE.LOADING);k=e.phone;break;case text.get("user.contact.msn"):showDiv(DIV.MSN.LOADING);k=e.msn;break;case text.get("user.contact.twitter"):showDiv(DIV.TWITTER.LOADING);k=e.twitter;break;case text.get("user.contact.bluetooth"):k=convertMACToServerFormat(e.mac);break}server.call({url:REMOVE_CONTACT_API,data:{session_id:e.session_id,origin:"WEB",type:j,name:k},error:function(){showMessage(text.get("user.contact.delete.error")+" "+j,"error");g(j)},success:function(l){b(j);e.updateLayout();g(j)}})}}function g(j){switch(j){case text.get("user.contact.email"):actionLoggedUserEmail(ACTIONS_INPUT.CANCEL);break;case text.get("user.contact.phone"):actionLoggedUserPhone(ACTIONS_INPUT.CANCEL);break;case text.get("user.contact.msn"):actionLoggedUserMSN(ACTIONS_INPUT.CANCEL);break;case text.get("user.contact.twitter"):actionLoggedUserTwitter(ACTIONS_INPUT.CANCEL);break}}function b(j){switch(j){case text.get("user.contact.email"):setCookie("email","");e.email="";break;case text.get("user.contact.phone"):setCookie("phone","");e.phone="";break;case text.get("user.contact.msn"):setCookie("msn","");e.msn="";break;case text.get("user.contact.twitter"):setCookie("twitter","");e.twitter="";break;case text.get("user.contact.bluetooth"):setCookie("mac","");e.mac="";break}}LoggedUser.prototype.setData=function(j){this.logged=true;this.nick=j.nick;this.session_id=global_session_id;if(!j.mac){this.mac=""}else{j.mac=convertMACToJSFormat(j.mac);if(j.device_friendly_name&&!cache.getFriendlyName(j.mac)){cache.updateFriendlyName(j.mac,j.device_friendly_name)}this.setPrivateBluetooth(j.mac)}this.name=cutText(j.name,USER_NAME_MAX_LENGTH);this.anonymous=j.anonymous;this.online=j.online;this.avatar=j.avatar;this.email=j.email;this.phone=j.phone;this.msn=j.msn;this.twitter=j.twitter;this.hasHotspot=j.has_hotspot;this.following=j.following;this.followers=j.followers;this.administrator=j.administrator;this.bluetooth_upload=j.bluetooth_upload;this.pagination[DIV.CURRENT_USER.CONTENT_FOLLOWING].setLength(j.following.length,USERS_PER_PAGE);this.pagination[DIV.CURRENT_USER.CONTENT_FOLLOWERS].setLength(j.followers.length,USERS_PER_PAGE)};LoggedUser.prototype.doLogin=function(j){if(j){$(j).attr("action",function(){return this.action+"?c="+escape(document.cookie)})}};LoggedUser.prototype.validateLoginFields=function(){if(getInputValue("nick")==""||getInputValue("pass")==""){showMessage(text.get("login.error3"),"error");return false}return true};LoggedUser.prototype.doLogoff=function(){setCookie("mac","");setCookie("email","");setCookie("phone","");setCookie("twitter","");setCookie("executeAfterLogin",undefined);setCookie("selectedTab",undefined);$.cookie("JSESSIONID",null)};LoggedUser.prototype.setPrivateBluetooth=function(j){this.updatingMAC=false;this.mac=j;this.updateLayout()};LoggedUser.prototype.setBluetooth=function(l){this.updatingMAC=true;this.updateLayout();if(this.isLogged()){var k=this;var j=convertMACToServerFormat(l);server.call({url:UPDATE_CONTACT_API,data:{session_id:k.session_id,type:"BLUETOOTH",name:j,origin:"WEB"},error:function(){showMessage(text.get("user.contact.mobile.error"),"error");k.updatingMAC=false;k.updateLayout()},success:function(n){k.setPrivateBluetooth(l);tabs.updateViaAjax()}})}};LoggedUser.prototype.setAvatar=function(l,k){var j=this;if(!this.isLogged()||!l){k(false)}else{server.call({url:USER_UPDATE_API,data:{session_id:j.session_id,avatar:l,origin:"WEB"},error:function(){k(false)},success:function(n){e.avatar=l;loggedUser.updatePersonalDataLayout();k(true)}})}};LoggedUser.prototype.setName=function(k){var j=!k?this.nick:k;if(this.isLogged()){var l=this;if(k.length>USER_NAME_MAX_LENGTH){showMessage(text.get("user.name.maxlength")+" "+USER_NAME_MAX_LENGTH+" "+text.get("user.name.chars")+"!");actionLoggedUserName(ACTIONS_INPUT.CANCEL)}else{server.call({url:USER_UPDATE_API,data:{session_id:l.session_id,name:j,origin:"WEB"},error:function(){showMessage(text.get("user.name.update.error"),"error");actionLoggedUserName(ACTIONS_INPUT.CANCEL)},success:function(n){l.name=j;l.updateLayout();actionLoggedUserName(ACTIONS_INPUT.CANCEL);if(!k){showMessage(text.get("user.name.redefined")+" "+l.nick,"success")}else{showMessage(text.get("user.name.update.success"),"success")}tabs.updateViaAjax();actionLoggedUserName(ACTIONS_INPUT.CANCEL)}})}}};LoggedUser.prototype.setBluetoothUpload=function(k){var j=!k?this.bluetooth_upload:k;if(this.isLogged()){var l=this;server.call({url:USER_UPDATE_API,data:{session_id:l.session_id,bluetooth_upload:j,origin:"WEB"},error:function(){showMessage(text.get("user.uploadbt.update.error"),"error");actionLoggedUserUploadBt(ACTIONS_INPUT.CANCEL)},success:function(n){l.bluetooth_upload=j;l.updateLayout();actionLoggedUserUploadBt(ACTIONS_INPUT.CANCEL);showMessage(text.get("user.uploadbt.update.success"),"success");tabs.updateViaAjax();actionLoggedUserUploadBt(ACTIONS_INPUT.CANCEL)}})}};LoggedUser.prototype.setPassword=function(l,k){if(this.isLogged()){var j=this;server.call({url:USER_UPDATE_API,data:{profile:j.nick,password:l,new_password:k,origin:"WEB"},error:function(n){if(n=="INCORRECT_PASSWORD"){showMessage(text.get("password.current_wrong"),"error")}else{showMessage(text.get("user.password.update.error"),"error")}actionLoggedUserPassword(ACTIONS_INPUT.CANCEL)},success:function(n){showMessage(text.get("user.password.update.success"),"success");actionLoggedUserPassword(ACTIONS_INPUT.CANCEL)}})}};LoggedUser.prototype.setEmail=function(j){if(this.isLogged()){var k=this;if(!isValidEmail(j)){showMessage(text.get("user.contact.email.invalid"),"error")}else{showDiv(DIV.EMAIL.LOADING);server.call({url:UPDATE_CONTACT_API,data:{session_id:k.session_id,type:"EMAIL",name:j,origin:"WEB"},error:function(){showMessage(text.get("user.contact.email.update.error"),"error");actionLoggedUserEmail(ACTIONS_INPUT.CANCEL)},success:function(l){setCookie("email",j);k.email=j;k.updateLayout();actionLoggedUserEmail(ACTIONS_INPUT.CANCEL)}})}}};LoggedUser.prototype.setPhone=function(j){if(this.isLogged()){var k=this;if(!isOnlyNumbers(j)){showMessage(text.get("user.contact.phone.invalid"),"error")}else{showDiv(DIV.PHONE.LOADING);server.call({url:UPDATE_CONTACT_API,data:{session_id:k.session_id,type:"PHONE",name:j,origin:"WEB"},error:function(){showMessage(text.get("user.contact.phone.update.error"),"error");actionLoggedUserEmail(ACTIONS_INPUT.CANCEL)},success:function(n){setCookie("phone",j);k.phone=j;k.updateLayout();var l=k.pendingContent;k.pendingContent=undefined;if(l){l.sendBySmsDirectly()}actionLoggedUserPhone(ACTIONS_INPUT.CANCEL)}})}}};LoggedUser.prototype.setMSN=function(j){if(this.isLogged()){var k=this;if(!isValidEmail(j)){showMessage(text.get("user.contact.msn.invalid"),"error")}else{showDiv(DIV.MSN.LOADING);server.call({url:UPDATE_CONTACT_API,data:{session_id:k.session_id,type:"MSN",name:j,origin:"WEB"},error:function(){showMessage(text.get("user.contact.msn.update.error"),"error");actionLoggedUserMSN(ACTIONS_INPUT.CANCEL)},success:function(l){setCookie("msn",j);k.msn=j;k.updateLayout();actionLoggedUserMSN(ACTIONS_INPUT.CANCEL)}})}}};LoggedUser.prototype.setTwitter=function(k){if(this.isLogged()){var j=this;if(!k||k.length==0){showMessage(text.get("user.contact.twitter.invalid"),"error")}else{showDiv(DIV.TWITTER.LOADING);server.call({url:UPDATE_CONTACT_API,data:{session_id:j.session_id,type:"TWITTER",name:k,origin:"WEB"},error:function(){showMessage(text.get("user.contact.twitter.update.error"),"error");actionLoggedUserTwitter(ACTIONS_INPUT.CANCEL)},success:function(l){setCookie("twitter",k);j.twitter=k;j.updateLayout();server.call({url:AUTHORIZE_TWITTER_API,data:{session_id:j.session_id,origin:"WEB"},error:function(){showMessage(text.get("user.contact.twitter.oauth.error"),"error");actionLoggedUserTwitter(ACTIONS_INPUT.CANCEL)},success:function(n){window.location=n.url}});actionLoggedUserTwitter(ACTIONS_INPUT.CANCEL)}})}}};LoggedUser.prototype.removeEmail=function(){h(text.get("user.contact.email"))};LoggedUser.prototype.removePhone=function(){h(text.get("user.contact.phone"))};LoggedUser.prototype.removeMSN=function(){h(text.get("user.contact.msn"))};LoggedUser.prototype.removeTwitter=function(){h(text.get("user.contact.twitter"))};LoggedUser.prototype.removeBluetooth=function(){if(window.confirm(text.get("user.contact.bluetooth.cancel_confirm"))){h(text.get("user.contact.bluetooth"))}};LoggedUser.prototype.removeEmail=function(){h(text.get("user.contact.email"))};LoggedUser.prototype.removeMSN=function(){h(text.get("user.contact.msn"))};LoggedUser.prototype.removeTwitter=function(){h(text.get("user.contact.twitter"))};LoggedUser.prototype.updatePersonalDataLayout=function(){var k=(this.name?this.name:"");var j=(this.email?this.email:"");var q=(this.phone?this.phone:"");var n=(this.msn?this.msn:"");var l=(this.twitter?this.twitter:"");j=cutText(j,CONTACT_MAX_LENGTH);q=cutText(q,CONTACT_MAX_LENGTH);n=cutText(n,CONTACT_MAX_LENGTH);l=cutText(l,CONTACT_MAX_LENGTH);if(this.isLogged()){if(!this.avatar){$("#"+IMG.PROFILE_AVATAR).attr("src",BASE_URL_IMAGES+"avatar-cinza.gif")}else{$("#"+IMG.PROFILE_AVATAR).attr("src",STREAM_FILE_API+"?resource="+this.avatar+"&width=180&height=180&distortion=cut")}}if(k.length>0){setDivContent(DIV.NAME.PROFILE_HOME,k);setDivContent(DIV.NAME.AREA_TOP,k)}else{setDivContent(DIV.NAME.PROFILE_HOME,loggedUser.nick);setDivContent(DIV.NAME.AREA_TOP,loggedUser.nick)}if(j.length>0){setDivContent(DIV.BODY.EMAIL,j)}else{setDivContent(DIV.BODY.EMAIL,text.get("logged_user.no_email"))}if(q.length>0){setDivContent(DIV.BODY.PHONE,q)}else{setDivContent(DIV.BODY.PHONE,text.get("logged_user.no_phone"))}if(n.length>0){setDivContent(DIV.BODY.MSN,n)}else{setDivContent(DIV.BODY.MSN,text.get("logged_user.no_msn"))}if(l.length>0){setDivContent(DIV.BODY.TWITTER,l)}else{setDivContent(DIV.BODY.TWITTER,text.get("logged_user.no_twitter"))}bluetooth.updateLayout();var o;if(this.updatingMAC){o=text.get("updating")}else{o=cache.getFriendlyName(this.mac);if(!o){o=this.mac}}setDivContent(DIV.BODY.SELECTED_DEVICE,o)}}function Users(){this.selectedUser=undefined;this.users=new Array();this.onlineUsers=undefined;this.howManyOnlineUsers=0;Users.prototype.selectUser=function(b){this.selectedUser=b};Users.prototype.getSelectedUser=function(){return this.getUser(this.selectedUser)};Users.prototype.setOnlineUsers=function(e,b){this.onlineUsers=e;this.howManyOnlineUsers=b};Users.prototype.setUser=function(b,e){this.users[b]=e};Users.prototype.exists=function(b){return this.users[b]};Users.prototype.getUser=function(b){if(!this.users[b]){internalError("User '"+b+"' is undefined!")}return this.users[b]}}function Tabs(){var g=this;this.tabs=new Array();this.lastMore=0;this.selectedTab=undefined;this.forceUpdate=false;this.onlineUsersPagination=new Pagination();this.updating=false;function j(){forEachTabDo(function(n){if(n!=TAB.SEARCH_RESULT){g.tabs[n]=new Array()}})}function e(n){if(AUTO_UPDATE_VIA_AJAX_ENABLED){if(!n){n=TIME.UPDATE_TAB_MILLIS_INTERVAL}clearTimeout(g.updateTabsId);g.updateTabsId=setTimeout("tabs.updateViaAjax();",n)}}function b(){clearTimeout(g.updateTabsId)}j();g.tabs[TAB.SEARCH_RESULT]=new Array();this.searchVisible=false;Tabs.prototype.markTabAsRead=function(n){readMessagesController.openTab(n);this.updateTabsLayout()};Tabs.prototype.setSelectedRecommendedTab=function(n){if(n){$("#"+TAB.RECOMMENDED).removeClass("turbine");$("#"+TAB.RECOMMENDED).addClass("turbineSelected")}else{$("#"+TAB.RECOMMENDED).removeClass("turbineSelected");$("#"+TAB.RECOMMENDED).addClass("turbine")}};Tabs.prototype.setSelectedFriendsTab=function(n){if(n){$("#"+TAB.RECOMMENDED).removeClass("turbine");$("#"+TAB.RECOMMENDED).addClass("turbineSelected")}else{$("#"+TAB.RECOMMENDED).removeClass("turbineSelected");$("#"+TAB.RECOMMENDED).addClass("turbine")}};Tabs.prototype.setSelectedTab=function(n){if(n){this.lastMore=0;if(n!=TAB.SEARCH_RESULT&&n!=TAB.HOTSPOT){setCookie("selectedTab",n)}logAction("js/Tabs/setSelectedTab/"+n)}else{e(TIME.UPDATE_TAB_MILLIS_INTERVAL);this.updateOnlineUsersCountViaAjax();if(currentProfile){n=TAB.WALL}else{if(!loggedUser.isLogged()){n=TAB.ALL}else{n=getCookie("selectedTab");if(!n||n==TAB.SEARCH_RESULT){n=TAB.WALL}if(n==TAB.WALL&&this.tabs[TAB.WALL].length==0){n=TAB.ALL}}}}this.markTabAsRead(n);if(this.selectedTab&&n&&this.selectedTab!=n){readMessagesController.closeTab(this.selectedTab)}if(n&&(n!=TAB.SEARCH_RESULT)){this.searchVisible=false}if(n==TAB.HOTSPOT){if(!contentPublisher.toHotspot()||!contentPublisher.toWall()){contentPublisher.checkHotspot()}}else{if(n!=TAB.HOTSPOT){if(!contentPublisher.toHotspot()||!contentPublisher.toWall()){contentPublisher.checkWall()}}}this.selectedTab=n;$(".selected").removeClass("selected");if(n!=TAB.NOWHERE){if(n==TAB.RECOMMENDED){this.setSelectedRecommendedTab(true)}else{this.setSelectedRecommendedTab(false);$("#"+n).addClass("selected")}}this.updateLayout()};Tabs.prototype.cleanTabEntry=function(n){this.tabs[n]=new Array()};Tabs.prototype.removeAllTabsEntry=function(n){forEachTabDo(function(o){g.removeTabEntry(o,n)})};Tabs.prototype.removeTabEntry=function(o,n){if(!n){internalError("tabEntry is undefined!")}else{this.tabs[o]=$.grep(this.tabs[o],function(q){if(n instanceof Content&&q instanceof Content){return q.getId()!=n.getId()}return true})}};Tabs.prototype.addTabEntry=function(o,n){if(!n){internalError("tabEntry is undefined!")}else{if(!this.tabs[o]){this.tabs[o]=new Array()}this.tabs[o].push(n)}};Tabs.prototype.getSize=function(){return this.getTabEntries().length};Tabs.prototype.getTabEntries=function(){if(!this.tabs[this.selectedTab]){internalError("tab '"+this.selectedTab+"' is undefined!");return new Array()}return this.tabs[this.selectedTab]};Tabs.prototype.nextPage=function(){this.onlineUsersPagination.nextPage();this.updateOnlineUsers(true)};Tabs.prototype.previousPage=function(){this.onlineUsersPagination.previousPage();this.updateOnlineUsers(true)};Tabs.prototype.onlineToHTML=function(){this.onlineUsersPagination.setLength(users.onlineUsers.length,loggedUser.isLogged()?USERS_PER_PAGE:USERS_PER_PAGE_OFFLINE);var q="";if(users.onlineUsers){var n;var o=0;for(n in users.onlineUsers){if(this.onlineUsersPagination.isThisIndexInside(o)){users.onlineUsers[n].online=true;q+=users.onlineUsers[n].toFollowHTML()+" "}o++}}return q};Tabs.prototype.renderContentsFriendsStyle=function(o,n,v){o="<div>";var w;for(w in n){var q=n[w];if(q.name){o+=q.toFriendsHTML()}}o+='<div id="friend-count"></div>';o+='<div class="fix"></div>';o+="</div>";return o};Tabs.prototype.renderContentsRecommendedStyle=function(o,n){o=o+=getDivContent(TEMPLATE.BOOST.TOP);o+='<div class="content">';var v;var w=0;for(v in n){var q=n[v];if(q.isContent()){if(!q.isComment){o+=q.toHTMLRecommendedStyle(w==n.length-1)}}w++}o+='<div class="fix"></div>';o+="</div>";return o};Tabs.prototype.renderContentsBTRemoteOKStyle=function(o,n){o+='<div class="content">';var v;var w=0;for(v in n){var q=n[v];if(q.isContent()){if(!q.isComment&&w<=3){o+=q.toHTMLRecommendedStyle(w==n.length-1)}}w++}o+='<div class="fix"></div>';o+="</div>";return o};Tabs.prototype.renderContentsIframeStyle=function(o,n){o=o+=getDivContent(TEMPLATE.IFRAME.TOP);o+='<div class="content">';var v;var w=0;for(v in n){var q=n[v];if(q.isContent()){if(!q.isComment&&w<=19){o+=q.toHTMLRecommendedStyle(w==n.length-1)}}w++}o+='<div class="fix"></div>';o+="</div>";return o};Tabs.prototype.renderContentsDefaultStyle=function(z,A){var y=true;var v=false;var I=undefined;var B=new Array();var w=new Array();var o=new Array();var C;var F;for(F in A){var q=A[F];if(!q.innerBean.conversation){w[F]=q}else{B[F]=q}}function n(K,J){if(parseInt(K.innerBean.message)>parseInt(J.innerBean.message)){return -1}if(parseInt(K.innerBean.message)<parseInt(J.innerBean.message)){return 1}}w.sort(n);for(m in w){var x=w[m];o.push(x);for(F in B){var E=B[F];if(x.innerBean.message==E.innerBean.conversation){o.push(E)}}}for(C in o){var G=o[C];var D=true;if(!G.isContent()){I=undefined}else{if(!G.isComment){I=G.innerBean.message}else{if(I!=G.innerBean.conversation){D=false}}if(!D){G.isComment=false}var H=G.isComment;if(H){if(!v){}}else{if(v){z+='<div class="fix"></div>'}}v=H}z+=G.toHTML();if(y){z=z.replace("top_breaker","")}y=false}return z};Tabs.prototype.toHTML=function(){var o="";var n=this.getTabEntries();var q="";if(this.selectedTab==TAB.HOTSPOT){q+='<div class="fix"></div><div class="titRadar">'+text.get("tabs.hotspot.sharing")+"</div>";if(n.length==0){q+=getDivContent(TEMPLATE.TIMELINE.NO_BROADCAST)}}else{if(this.selectedTab==TAB.SEARCH_RESULT){q=q+=getDivContent(TEMPLATE.SEARCH.TOP)}}if(search.searching&&this.selectedTab==TAB.SEARCH_RESULT){o=getDivContent(TEMPLATE.TIMELINE.LOADING)}else{if(n.length==0&&this.selectedTab==TAB.SEARCH_RESULT&&!search.invalidQuery){o=q+getDivContent(TEMPLATE.TIMELINE.NOT_FOUND)}else{if(this.selectedTab==TAB.SEARCH_RESULT&&search.invalidQuery){o=q+getDivContent(TEMPLATE.TIMELINE.INVALID_QUERY)}else{if(n.length==0&&this.selectedTab==TAB.MESSAGES){o=getDivContent(TEMPLATE.TIMELINE.NO_MESSAGE)}else{if(n.length==0&&this.selectedTab!=TAB.HOTSPOT&&this.selectedTab!=TAB.RECOMMENDED){if(currentProfile){o=getDivContent(TEMPLATE.TIMELINE.PROFILE_NO_CONTENT)}else{o=getDivContent(TEMPLATE.TIMELINE.NO_CONTENT)}}else{if(this.selectedTab==TAB.RECOMMENDED){if(!origin_iframe){o+=this.renderContentsRecommendedStyle(o,n)}else{o+=this.renderContentsIframeStyle(o,n)}}else{o+=q+this.renderContentsDefaultStyle(o,n)}if(this.selectedTab!=TAB.HOTSPOT){o+='<br><span style="display:none;" id="more-loading"><img src="'+BASE_URL_IMAGES+'bluetooth-loader.gif" /></span>';if(!origin_iframe){o+='<span id="more-contents"><input type="button" value="'+text.get("tabs.more_content")+'" onclick="tabs.moreViaAjax()" class="button" /></span>'}else{o+='<span id="more-contents"><input type="button" value="'+text.get("tabs.more_content")+'" onclick="javascript:window.top.location = \'http://www.alouw.net/web/?tab=turbine\'" class="button" /></span>'}}else{o+=getDivContent(TEMPLATE.TIMELINE.MOBILES);broadcast.searchForMobiles()}}}}}}return o};function k(n){var o=readMessagesController.getHowManyNewMessages(n);var q;switch(n){case TAB.ALL:q=DIV.TAB.NUMBER_OF_ALL;break;case TAB.MESSAGES:q=DIV.TAB.NUMBER_OF_MESSAGES;break;case TAB.RECOMMENDED:q=DIV.TAB.NUMBER_OF_RECOMMENDED;break;case TAB.WALL:q=DIV.TAB.NUMBER_OF_WALL;break;case TAB.FRIENDS:q=DIV.TAB.NUMBER_OF_FRIENDS;break}if(q){if(o==0){setDivContent(q,"")}else{setDivContent(q,"("+o+")");if(q==DIV.TAB.NUMBER_OF_MESSAGES){$("#"+q).append(' <img src="'+BASE_URL_IMAGES+'ico-newmessage.gif">')}}}}Tabs.prototype.updateTabsLayout=function(){forEachTabDo(function(n){k(n)})};Tabs.prototype.updateOnlineUsers=function(n){var o=this;var q=function(){setDivContent(DIV.BODY.ONLINE,o.onlineToHTML());if(!o.onlineUsersPagination.needPagination()){hideDiv(DIV.CURRENT_USER.ONLINE_PAGINATION)}else{showDiv(DIV.CURRENT_USER.ONLINE_PAGINATION);setDivContent(DIV.CURRENT_USER.ONLINE_PAGE,o.onlineUsersPagination.getCurrentPage());setDivContent(DIV.CURRENT_USER.ONLINE_TOTAL_PAGE,o.onlineUsersPagination.getTotalPages())}};if(!n){q()}else{$("#"+DIV.BODY.ONLINE).fadeOut("fast",function(){q();$("#"+DIV.BODY.ONLINE).fadeIn("slow")})}};Tabs.prototype.updateLayout=function(){showDiv("tabs");setDivContent(DIV.BODY.TIMELINE,this.toHTML());this.updateOnlineUsers(false);this.updateTabsLayout();if(this.searchVisible){showDiv(DIV.TAB.SEARCH)}else{hideDiv(DIV.TAB.SEARCH)}if(this.selectedTab==TAB.RECOMMENDED){boost.updateLayout()}$(".newContent").fadeIn(1000)};function l(v){var n=tabs.selectedTab;for(t in g.tabs[n]){var o=g.tabs[n][t];exclude=true;if(o){for(c in v.contents){var q=v.contents[c];if(o.innerBean.message==q.message||o.innerBean.conversation!=""){exclude=false;break}}if(exclude){g.removeAllTabsEntry(o)}}}}function h(w,x){readMessagesController.reset();setOnlineUsers(w.online_users,w.how_many_online_users);for(u in w.users){var o=w.users[u];setUser(o)}l(w);for(c in w.contents){var v=w.contents[c];var n=true;for(t in g.tabs[v.tab]){var q=g.tabs[v.tab][t];if(q.innerBean.message==v.message){g.tabs[v.tab][t].innerBean.conversation_count=v.conversation_count;n=false}}if(n){addContentToTab(v);readMessagesController.knowMessage(v.tab,v.message)}}g.markTabAsRead(g.selectedTab);g.updateLayout();$("#more-loading").hide();$("#more-contents").show();if(x>=g.getSize()){$("#more-contents").hide()}}Tabs.prototype.moreViaAjax=function(){$("#more-contents").hide();$("#more-loading").show();g.forceUpdate=true;this.updateViaAjaxComplete(true);logAction("js/Tabs/moreViaAjax")};Tabs.prototype.softUpdateViaAjax=function(){g.forceUpdate=false;this.updateViaAjaxComplete(false)};Tabs.prototype.updateViaAjax=function(){systemMessage.close();this.forceUpdate=true;this.updateViaAjaxComplete(false)};Tabs.prototype.updateOnlineUsersCountViaAjax=function(){server.call({url:ONLINE_API,data:{origin:"WEB"},error:function(){},success:function(q){var n=q.profiles;var o=q.devices;server.call({url:ONLINE_INTEGRATION_API,data:{},error:function(){},success:function(w){var v="<span>";v+=(q.users+w.anonymous_users);v+="</span>";setDivContent(DIV.CURRENT_USER.ONLINE_COUNT,v)}})}})};Tabs.prototype.updateViaAjaxComplete=function(v){var x=this.updating;var w=v||(UPDATE_VIA_AJAX_ENABLED&&!x);if(!w){if(x){this.forceFastUpdate=true}}else{this.updating=true;var o;if(v){o=this.getSize();this.lastMore=o}else{o=this.lastMore}var n=currentProfile?currentProfile.nick:(!loggedUser.isLogged()?"":loggedUser.nick);var q=!loggedUser.isLogged()?"":loggedUser.session_id;if((this.selectedTab==TAB.SEARCH_RESULT)&&v){search.doSearch(o);this.updating=false}else{showDiv(BOOST.LOADING);server.call({url:currentProfile?USER_PROFILE_CONTENTS_API:USERS_CONTENTS_API,data:{profile:n,session_id:q,more:o},error:function(){$("#more-loading").hide();$("#more-contents").hide();hideDiv(BOOST.LOADING);g.updating=false},success:function(y){var z=true;if(g.forceUpdate){h(y,o)}else{systemMessage.show(text.get("tabs.new_contents"),function(){g.updateViaAjax()});z=false}if(z){e()}else{b()}hideDiv(BOOST.LOADING);g.updating=false;if(g.forceFastUpdate){g.forceFastUpdate=false;g.updateViaAjax()}}});this.updateOnlineUsersCountViaAjax()}}}}function Search(){var b=this;this.timerToSearchId=0;this.searching=false;this.invalidQuery=false;this.restriction=BOOST.ALL;function e(j,h){if(j==INPUT.SEARCH.TEXT_DEFAULT){j=""}server.call({url:SEARCH_LEGACY_API,data:{q:j,more:h},error:function(){showMessage(text.get("search.error"),"error");search.searching=false;tabs.updateLayout();b.updateLayout()},success:function(k){g(k);tabs.searchVisible=true;search.searching=false;tabs.updateLayout();if(h>=tabs.getSize()){$("#more-contents").hide()}b.updateLayout()}})}function g(l){for(u in l.users){var j=l.users[u];setUser(j)}for(su in l.shown_users){var h=l.shown_users[su];addUserToTab(TAB.SEARCH_RESULT,h)}for(c in l.contents){var k=l.contents[c];addContentToTab(k)}}Search.prototype.click=function(h){this.restriction=h;this.doSearch()};Search.prototype.doSearch=function(h){var l=getInputValue(INPUT.SEARCH.VALUE);if(l==INPUT.SEARCH.TEXT_DEFAULT){l=""}var k="";if(this.restriction==BOOST.RINGTONES){k=" resource-type:AUDIO"}else{if(this.restriction==BOOST.VIDEOS){k=" resource-type:VIDEO"}else{if(this.restriction==BOOST.WALLPAPERS){k=" resource-type:IMAGE"}else{if(this.restriction==BOOST.GAMES){k=" resource-type:OTHER"}}}}var j=l+k;if(j.length<3){this.invalidQuery=true;tabs.cleanTabEntry(TAB.SEARCH_RESULT);tabs.setSelectedTab(TAB.SEARCH_RESULT);tabs.updateLayout();this.searching=false;this.updateLayout()}else{clearTimeout(this.timerToSearchId);this.searching=true;this.invalidQuery=false;tabs.cleanTabEntry(TAB.SEARCH_RESULT);tabs.setSelectedTab(TAB.SEARCH_RESULT);e(j,!h?0:h)}};Search.prototype.doSearchOnTheFly=function(h){if(!this.searching){clearTimeout(this.timerToSearchId);if((h.which&&h.which==13)||(h.keyCode&&h.keyCode==13)){this.doSearch()}else{this.timerToSearchId=setTimeout("if (!this.searching) { search.doSearch(); }",TIME.SEARCH_KEYBOARD_KEY_INTERVAL)}}};Search.prototype.updateLayout=function(){forEachDo(BOOST,function(h){if(b.restriction==h){$("#"+h).addClass("btTurboAtivo")}else{$("#"+h).removeClass("btTurboAtivo")}})}}function LoginPopup(){this.isShowing=false;LoginPopup.prototype.doAfterLogin=function(whatToExecute){setCookie("executeAfterLogin",whatToExecute,1)};LoginPopup.prototype.executeAfterLogin=function(){if(loggedUser.isLogged()){var whatToExecute=getCookie("executeAfterLogin");if(whatToExecute){try{eval(whatToExecute)}catch(err){internalError(err+" on "+whatToExecute)}setCookie("executeAfterLogin","",0)}}};LoginPopup.prototype.show=function(){this.isShowing=true;this.updateLayout()};LoginPopup.prototype.close=function(){this.isShowing=false;this.updateLayout()};LoginPopup.prototype.updateLayout=function(){if(!this.isShowing){$("#"+DIV.POPUP.LOGIN).dialog("destroy")}else{$(document).ready(function(){signupPopup.close(1);signupPopup.close(2);bluetooth.isShowingPopup=false;bluetooth.updateLayout();$("#"+DIV.POPUP.LOGIN).dialog({beforeClose:function(event,ui){setCookie("executeAfterLogin","",0);this.isShowing=false},title:text.get("login_popup.title"),open:function(event,ui){setTimeout("$('#' + INPUT.POPUP.LOGIN.NICK).focus();",100)},modal:true,position:"center",resizable:false,width:450,height:550})})}}}function SignupPopup(){this.isShowingPart1=false;this.isShowingPart1Error=false;this.errorMsg="";this.isShowingPart1Loading=false;this.isShowingPart2=false;SignupPopup.prototype.show=function(b){showDiv("clickhere1");hideDiv("clickhere2");if(b==1){this.isShowingPart1=true;this.isShowingPart2=false;this.reset(1);this.updateLayout()}else{if(b==2){this.isShowingPart1=false;this.isShowingPart2=true;this.reset(2);this.updateLayout()}}};SignupPopup.prototype.close=function(b){if(b==1){this.isShowingPart1=false}else{if(b==2){this.isShowingPart2=false}}this.updateLayout()};SignupPopup.prototype.validate=function(){var b=true;if(getInputValueTrim(INPUT.SIGNUP.NICK).length==0){this.errorMsg=text.get("signup.fill_nickname");b=false}else{if(getInputValue(INPUT.SIGNUP.PASS).length==0){this.errorMsg=text.get("signup.fill_password");b=false}else{if(getInputValue(INPUT.SIGNUP.PASS).length>0&&!isOnlyNumbers(getInputValue(INPUT.SIGNUP.PASS))){this.errorMsg=text.get("signup.only_numbers");b=false}else{if(getInputValue(INPUT.SIGNUP.CONFIRMPASS).length==0){this.errorMsg=text.get("signup.confirm");b=false}else{if(getInputValue(INPUT.SIGNUP.PASS)!=getInputValue(INPUT.SIGNUP.CONFIRMPASS)){this.errorMsg=text.get("signup.wrong_password_check");b=false}}}}}if(!b){showMessage(this.errorMsg,"error")}return b};SignupPopup.prototype.commit=function(b){if(b==1){if(this.validate()){this.isShowingPart1Error=false;this.isShowingPart1Loading=true;this.updateLayout();signupProcessor.create(getInputValueTrim(INPUT.SIGNUP.NICK),getInputValue(INPUT.SIGNUP.PASS))}else{this.isShowingPart1Error=true;this.updateLayout()}}else{if(b==2){signupProcessor.update(getInputValueTrim(INPUT.SIGNUP.NICK),getInputValue(INPUT.SIGNUP.PASS),getInputValue(INPUT.SIGNUP.EMAIL))}}};SignupPopup.prototype.reset=function(b){if(b==1){setInputValue(INPUT.SIGNUP.NICK,"");setInputValue(INPUT.SIGNUP.PASS,"");setInputValue(INPUT.SIGNUP.CONFIRMPASS,"");this.isShowingPart1Error=false;this.isShowingPart1Loading=false}else{if(b==2){}}};SignupPopup.prototype.showError=function(b,e){if(b==1){this.isShowingPart1Loading=false;this.isShowingPart1Error=true;this.errorMsg=e;showMessage(this.errorMsg,"error");this.updateLayout()}else{if(b==2){}}};SignupPopup.prototype.updateLayout=function(){var e=false;if(!this.isShowingPart1){$("#"+DIV.POPUP.SIGNUP_PART1).dialog("destroy")}else{e=true;$(document).ready(function(){$("#"+DIV.POPUP.SIGNUP_PART1).dialog({beforeClose:function(g,h){this.isShowingPart1=false},title:text.get("signup.title"),open:function(g,h){setTimeout("$('#' + INPUT.SIGNUP.NICK).focus();",100)},modal:true,position:"center",resizable:false,width:450,height:530})})}if(this.isShowingPart1Loading){hideDiv("clickhere1");showDiv("clickhere2")}else{showDiv("clickhere1");hideDiv("clickhere2")}if(!this.isShowingPart2){$("#"+DIV.POPUP.SIGNUP_PART2).dialog("destroy")}else{e=true;$(document).ready(function(){$("#"+DIV.POPUP.SIGNUP_PART2).dialog({beforeClose:function(g,h){this.isShowingPart2=false},title:text.get("signup.title2"),open:function(g,h){setTimeout("$('#' + INPUT.SIGNUP.EMAIL).focus();",100)},modal:true,position:"center",resizable:false,width:550,height:240})})}if(e){var b=getCookie("executeAfterLogin");loginPopup.close();setCookie("executeAfterLogin",b)}}}function StatisticPopup(){StatisticPopup.prototype.show=function(){server.call({url:STATISTIC_API,data:{session_id:loggedUser.session_id,origin:"WEB"},error:function(){showMessage(text.get("statistic.load.error"),"error")},success:function(data){showDiv(DIV.POPUP.STATISTIC);fillMacsPerHourChart(data.macsPerHour);fillMacsPerDayChart(data.macsPerDay);fillMacsPerIncidenceChart(data.macsPerIncidence)}})};StatisticPopup.prototype.close=function(){hideDiv(DIV.POPUP.STATISTIC)};function fillMacsPerHourChart(macsPerHour){var hourPoints=[];for(var i=0;i<macsPerHour.length;i++){hourPoints.push([macsPerHour[i].hour+"h",macsPerHour[i].macsTotal])}$.jqplot("chartMacsPerHour",[hourPoints],{grid:{borderWidth:0,shadow:false},series:[{renderer:$.jqplot.BarRenderer}],axes:{xaxis:{renderer:$.jqplot.CategoryAxisRenderer},yaxis:{tickOptions:{formatString:"%d"}}}})}function fillMacsPerDayChart(macsPerDay){var dayPoints=[];for(var i=0;i<macsPerDay.length;i++){dayPoints.push([macsPerDay[i].day,macsPerDay[i].macsTotal])}$.jqplot("chartMacsPerDay",[dayPoints],{grid:{borderWidth:0,shadow:false},series:[{renderer:$.jqplot.BarRenderer}],axes:{xaxis:{renderer:$.jqplot.CategoryAxisRenderer},yaxis:{tickOptions:{formatString:"%d"}}}})}function fillMacsPerIncidenceChart(macsPerIncidence){var points=[];if(macsPerIncidence.length==1){var oldMacs=eval(macsPerIncidence[0].oldMacs);var newMacs=eval(macsPerIncidence[0].newMacs);if(newMacs!=0||oldMacs!=0){points.push([text.get("statistic.new"),newMacs]);points.push([text.get("statistic.known"),oldMacs]);$.jqplot("chartMacsPerIncidence",[points],{grid:{borderWidth:0,shadow:false},seriesDefaults:{renderer:$.jqplot.PieRenderer,rendererOptions:{diameter:170,lineLabels:true,lineLabelsLineColor:"#777",sliceMargin:1,shadowOffset:2,shadowDepth:5,shadowAlpha:0.07,padding:10,sliceMargin:8}},legend:{show:false}})}}}}function CommentPopup(){this.isShowing=false;this.selectedUserNick="";this.selectedUserName="";this.text="";this.contentId="";this.anchor=null;this.type=undefined;this.isShowingAttachment=false;this.fileToSend=false;this.fileExt=false;this.sending=false;this.success=false;this.error=false;this.timerToHideId=undefined;var b=this;$(document).ready(function(){if($("#upload_button_comment").length>0){b.uploader=new AjaxUpload("upload_button_comment",{action:SEND_MESSAGE_API,name:"file",autoSubmit:false,responseType:"json",onChange:function(e,g){if(b.timerToHideId){clearTimeout(b.timerToHideId)}b.isShowingAttachment=false;b.success=false;b.error=false;b.fileToSend=e;b.fileExt=g;b.updateLayout()},onSubmit:function(e,g){b.sending=true;b.isShowing=true;b.updateLayout()},onComplete:function(h,g){var e=tabs.selectedTab;showCommentsDiv(b.uploader._settings.data.conversation,e,"false");b.hasBeenPublished(g)}})}});CommentPopup.prototype.hasBeenPublished=function(g){this.sending=false;this.fileToSend=false;this.isShowingAttachment=false;if(g&&g.success){this.success=true;this.error=false}else{this.success=false;this.error=false;if(g&&g.error=="INVALID_SESSION"){server.lostSession()}else{if(g&&g.error=="INVALID_UPLOADED_FILE"){showMessage(text.get("content_publisher.error.invalid_uploaded_file"),"error")}else{if(g&&g.error=="FILE_IS_TOO_LARGE"){showMessage(text.get("content_publisher.error.file_is_too_large"),"error")}else{var e=text.get("content_publisher.error");if(g&&g.error){e+=" "+text.get("content.code")+" "+g.error}showMessage(e,"error")}}}}if(this.success){this.isShowing=false;this.success=false;showMessage(text.get("user.message.success"),"success")}else{if(this.error){this.isShowing=false;this.error=false;showMessage(text.get("user.cannot_send_message"),"error")}else{}}this.updateLayout();tabs.updateViaAjax()};CommentPopup.prototype.setAttachmentVisibility=function(e){if(e===undefined){this.isShowingAttachment=!this.isShowingAttachment}else{this.isShowingAttachment=e}doAfterLogin("commentPopup.isShowingAttachment = "+this.isShowingAttachment+";commentPopup.updateLayout();")};CommentPopup.prototype.show=function(g,e,j,h){doAfterLogin("commentPopup.reset();var anchor = document.getElementById('"+g+"');if (anchor) {  commentPopup.type = '"+h+"';  commentPopup.isShowing = true;  commentPopup.selectedUserNick = '"+e+"';  commentPopup.selectedUserName = '"+users.getUser(e).name+"';  commentPopup.contentId = '"+(!j?"":j)+"';  commentPopup.anchor = anchor;    commentPopup.updateLayout();}")};CommentPopup.prototype.close=function(){this.isShowing=false;this.updateLayout()};CommentPopup.prototype.validate=function(){return(getInputValue(INPUT.COMMENT.TEXT)!=""||this.fileToSend)};CommentPopup.prototype.commit=function(){this.close();if(!loggedUser.isLogged()){loginPopup.show()}else{this.text=getInputValue(INPUT.COMMENT.TEXT);if(this.validate()){if(this.fileToSend){var e=users.getUser(this.selectedUserNick);if(this.contentId){var g=contents.getContent(this.contentId);if(g){if(this.type=="comment"){this.uploader.setData({text:this.text,session_id:loggedUser.session_id,conversation:g.innerBean.message,destinations:e.nick+"#WALL",origin:"WEB"})}else{this.uploader.setData({text:this.text,session_id:loggedUser.session_id,destinations:e.nick,origin:"WEB"})}}}else{this.uploader.setData({text:this.text,session_id:loggedUser.session_id,destinations:e.nick,origin:"WEB"})}this.uploader.submit()}else{if(this.contentId){var g=contents.getContent(this.contentId);if(g){g.comment(this.selectedUserNick,this.text,this.type)}}else{var e=users.getUser(this.selectedUserNick);e.write(this.text)}}}}};CommentPopup.prototype.reset=function(){this.selectedUserNick="";this.text="";this.contentId="";this.anchor="";setDivContent(DIV.POPUP.COMMENT_TO,"");setInputValue(INPUT.COMMENT.TEXT,"")};CommentPopup.prototype.updateLayout=function(){hideDiv(DIV.POPUP.COMMENT_FILE_SENDING);hideDiv(DIV.POPUP.COMMENT_FILE_SELECTED);hideDiv(DIV.POPUP.COMMENT_FILE_SUCCESS);hideDiv(DIV.POPUP.COMMENT_FILE_ERROR);hideDiv(DIV.POPUP.COMMENT_ATTACHMENT);if(this.sending){showDiv(DIV.POPUP.COMMENT_FILE_SENDING)}else{if(this.success){showDiv(DIV.POPUP.COMMENT_FILE_SUCCESS)}else{if(this.error){showDiv(DIV.POPUP.COMMENT_FILE_ERROR)}else{if(this.fileToSend){var g=30;var n=this.fileToSend;var j=this.fileExt;if((n.length-j.length)>g){n=cutText(n.substr(0,(n.length-j.length)),g)+j}setDivContent(DIV.POPUP.COMMENT_FILE_NAME,n);setDivContent(DIV.POPUP.COMMENT_FILE_NAME+"2",n);setDivContent(DIV.POPUP.COMMENT_FILE_NAME+"3",n);showDiv(DIV.POPUP.COMMENT_FILE_SELECTED)}}}}if(this.isShowingAttachment){showDiv(DIV.POPUP.COMMENT_ATTACHMENT)}if(!this.isShowing){if($("#"+DIV.POPUP.COMMENT).is(":visible")){hideDiv(DIV.POPUP.COMMENT)}}else{if($("#"+DIV.POPUP.COMMENT).is(":hidden")){var l=$(this.anchor).offset();var e=l.left;var k=l.top;var h=$(this.anchor).width();setDivContent(DIV.POPUP.COMMENT_TO,text.get("to")+": "+this.selectedUserName);if(e!=0&&k!=0&&h!=0){$("#"+DIV.POPUP.COMMENT).css({left:(e+h+8)+"px",top:k+2+"px"})}showDiv(DIV.POPUP.COMMENT);$("#"+INPUT.COMMENT.TEXT).focus();adjustPositionToWindow(DIV.POPUP.COMMENT,-24)}}}}function RememberPopup(){this.isShowing=false;this.isShowingLoading=false;RememberPopup.prototype.show=function(){this.isShowing=true;this.isShowingLoading=false;this.updateLayout();$("#"+INPUT.REMEMBER.NICK).focus()};RememberPopup.prototype.close=function(){this.isShowing=false;this.isShowingLoading=false;this.updateLayout()};RememberPopup.prototype.commit=function(){this.isShowingLoading=true;this.updateLayout();rememberProcessor.sendByNickname(getInputValue(INPUT.REMEMBER.NICK))};RememberPopup.prototype.updateLayout=function(){if(!this.isShowing){$("#"+DIV.POPUP.REMEMBER).dialog("destroy")}else{$(document).ready(function(){$("#"+DIV.POPUP.REMEMBER).dialog({beforeClose:function(b,e){this.isShowing=false},title:text.get("signup.title"),modal:true,position:"center",resizable:false,width:300,height:190})})}if(this.isShowingLoading){showDiv(DIV.POPUP.REMEMBER_LOADING)}else{hideDiv(DIV.POPUP.REMEMBER_LOADING)}}}function RememberPopupNick(){this.isShowing=false;this.isShowingLoading=false;RememberPopupNick.prototype.show=function(){this.isShowing=true;this.isShowingLoading=false;this.updateLayout();$("#"+INPUT.REMEMBER.EMAIL).focus()};RememberPopupNick.prototype.close=function(){this.isShowing=false;this.isShowingLoading=false;this.updateLayout()};RememberPopupNick.prototype.commit=function(){this.isShowingLoading=true;this.updateLayout();if($("#"+INPUT.REMEMBER_METHOD.EMAIL).attr("checked")){rememberProcessor.sendEmail(getInputValue(INPUT.REMEMBER.EMAIL))}else{if($("#"+INPUT.REMEMBER_METHOD.MSN).attr("checked")){rememberProcessor.sendMSN(getInputValue(INPUT.REMEMBER.MSN))}}};RememberPopupNick.prototype.updateLayout=function(){if(!this.isShowing){$("#"+DIV.POPUP.REMEMBER_NICK).dialog("destroy")}else{$(document).ready(function(){$("#"+DIV.POPUP.REMEMBER_NICK).dialog({beforeClose:function(b,e){this.isShowing=false},title:text.get("signup.title"),modal:true,position:"center",resizable:false,width:460,height:210})})}if(this.isShowingLoading){showDiv(DIV.POPUP.REMEMBER_NICK_LOADING)}else{hideDiv(DIV.POPUP.REMEMBER_NICK_LOADING)}}}function MacInputPopup(){this.isShowing=false;this.selectedManufacturer=undefined;MacInputPopup.prototype.show=function(){doAfterLogin("macInputPopup.isShowing = true;macInputPopup.updateLayout();")};MacInputPopup.prototype.close=function(){this.isShowing=false;this.selectedManufacturer=undefined;this.updateLayout()};MacInputPopup.prototype.notFound=function(){this.isShowing=false;this.selectedManufacturer=undefined;this.updateLayout();showDiv(DIV.POPUP.GET_BY_MAIL)};MacInputPopup.prototype.selectManufacturer=function(b){this.isShowing=true;this.selectedManufacturer=b;this.updateLayout();$("#"+INPUT.MANUAL_MAC.VALUE).focus()};MacInputPopup.prototype.commit=function(){var b=convertMACToJSFormat(getInputValue(INPUT.MANUAL_MAC.VALUE));if(b.indexOf("_")>=0){showMessage(text.get("bluetooth.invalid_mac")+" "+b,"error")}else{if(loggedUser.isLogged()){if(b.length!=12){showMessage(text.get("bluetooth.mac.too_short"),"error")}else{loggedUser.setBluetooth(b);this.isShowing=false;this.updateLayout();bluetooth.updateLayout();macAssociationPopup.showOK()}}}};MacInputPopup.prototype.updateLayout=function(){if(this.isShowing){showDiv(DIV.POPUP.MAC_INPUT);if(this.selectedManufacturer){hideDiv(DIV.MAC_INSTRUCTIONS.NOKIA);hideDiv(DIV.MAC_INSTRUCTIONS.SAMSUNG);hideDiv(DIV.MAC_INSTRUCTIONS.LG);hideDiv(DIV.MAC_INSTRUCTIONS.OTHER);if(this.selectedManufacturer==MANUFACTURERS.NOKIA){showDiv(DIV.MAC_INSTRUCTIONS.NOKIA)}else{if(this.selectedManufacturer==MANUFACTURERS.SAMSUNG){showDiv(DIV.MAC_INSTRUCTIONS.SAMSUNG)}else{if(this.selectedManufacturer==MANUFACTURERS.LG){showDiv(DIV.MAC_INSTRUCTIONS.LG)}else{if(this.selectedManufacturer==MANUFACTURERS.OTHER){showDiv(DIV.MAC_INSTRUCTIONS.OTHER)}}}}showDiv(DIV.INSERT_MAC);$("#"+INPUT.MANUAL_MAC.ASSIGN_OK).css("display","inline")}}else{hideDiv(DIV.POPUP.MAC_INPUT);$("#"+INPUT.MANUAL_MAC.RADIO_NOKIA).attr("checked",false);$("#"+INPUT.MANUAL_MAC.RADIO_SAMSUNG).attr("checked",false);$("#"+INPUT.MANUAL_MAC.RADIO_LG).attr("checked",false);$("#"+INPUT.MANUAL_MAC.RADIO_OUTRO).attr("checked",false);hideDiv(DIV.MAC_INSTRUCTIONS.NOKIA);hideDiv(DIV.MAC_INSTRUCTIONS.SAMSUNG);hideDiv(DIV.MAC_INSTRUCTIONS.LG);hideDiv(DIV.MAC_INSTRUCTIONS.OTHER);hideDiv(DIV.INSERT_MAC);hideDiv(INPUT.MANUAL_MAC.ASSIGN_OK)}}}function MacAssociationPopup(){var b=this;this.isShowing=false;this.step=1;this.lastContentsHTML="";this.mac=undefined;this.contents=0;this.secondAttempt=false;this.showIfLan=true;MacAssociationPopup.prototype.show=function(){this.isShowing=true;this.step=1;this.mac=undefined;this.contents=0;this.updateLastContents();this.updateLayout()};MacAssociationPopup.prototype.showOK=function(){$(document).ready(function(){$("#"+DIV.POPUP.MAC_OK).dialog({title:text.get("home.popups.assign_mac.title"),modal:true,position:"center",resizable:false,width:550,height:290})})};MacAssociationPopup.prototype.closeOK=function(){$("#"+DIV.POPUP.MAC_OK).dialog("destroy")};MacAssociationPopup.prototype.assign=function(h){var g=false;if(h){if(h.indexOf("_")>=0){g=true}if(g){showMessage(text.get("bluetooth.invalid_mac")+" "+h,"error")}else{this.mac=h}}if(!g){if(this.mac){loggedUser.setBluetooth(convertMACToJSFormat(this.mac));this.close();this.showOK()}else{if(this.contents==0){showMessage(text.get("bluetooth.association.send_image_before"),"error");$("#assignProcessStep1Description").slideDown("fast")}else{showMessage(text.get("bluetooth.association.select_image"),"error")}}}};MacAssociationPopup.prototype.showManualMac=function(){macInputPopup.show();this.close()};MacAssociationPopup.prototype.wasntFound=function(){clearTimeout(this.updateId);this.step=2;this.updateLayout()};MacAssociationPopup.prototype.tryAgain=function(){this.secondAttempt=true;this.show()};function e(n){var k="";for(u in n.users){var h=n.users[u];setUser(h)}if(n.contents.length>0){k+="<ul>";for(c in n.contents){var l=n.contents[c];if(l.content_type=="IMAGE"){var g=l.attachment;var j=l.sender_mac;var o=l.sender_friendly_name;if(j&&o){cache.updateFriendlyName(convertMACToJSFormat(j),o)}if(j&&g){b.contents++;k+="<li>";k+='<img src="'+STREAM_FILE_API+"?resource="+g+'&width=60&height=60" onclick="if (confirm(\''+text.get("bluetooth.association.confirm")+"')) { macAssociationPopup.assign('"+j+"'); }\"/>";k+="</li>"}}}k+="</ul>"}b.lastContentsHTML=k;b.updateLayout()}MacAssociationPopup.prototype.updateLastContents=function(){var g=this;server.call({url:LAST_CONTENTS_WITHOUT_USER_API,error:function(){},success:function(h){e(h);clearTimeout(g.updateId);g.updateId=setTimeout("macAssociationPopup.updateLastContents()",TIME.MAC_ASSOCIATION_LAST_CONTENTS_MILLIS_INTERVAL)}})};MacAssociationPopup.prototype.close=function(){this.secondAttempt=false;this.isShowing=false;this.updateLayout();clearTimeout(this.updateId)};MacAssociationPopup.prototype.updateLayout=function(){if(!this.isShowing){hideDiv(DIV.POPUP.MAC_ASSOC.STEP1);hideDiv(DIV.POPUP.MAC_ASSOC.STEP2);hideDiv(DIV.POPUP.MAC_ASSOC.STEP3)}else{if(this.step==1){hideDiv(DIV.POPUP.MAC_ASSOC.STEP2);showDiv(DIV.POPUP.MAC_ASSOC.STEP1);if(b.contents>0){setTimeout("setDivContent(DIV.BODY.LAST_PUSHES, '<p>"+text.get("bluetooth.association.select_image2")+"</p>' + macAssociationPopup.lastContentsHTML);",TIME.MAC_ASSOCIATION_LAST_CONTENTS_MILLIS_INTERVAL*2)}else{setDivContent(DIV.BODY.LAST_PUSHES,"")}}else{if(this.step==2){hideDiv(DIV.POPUP.MAC_ASSOC.STEP1);showDiv(DIV.POPUP.MAC_ASSOC.STEP2);if(this.secondAttempt){this.step=3;this.secondAttempt=false}if(this.step==3){hideDiv(DIV.POPUP.MAC_ASSOC.STEP2);showDiv(DIV.POPUP.MAC_ASSOC.STEP3)}}}}}}var SEARCH_STATE={FIRST_TIME:0,INQUIRY:1,INCOMPLETE:2,COMPLETE:3};function Bluetooth(){var b=this;this.searchState=SEARCH_STATE.FIRST_TIME;this.mustShowManualMac=false;this.isShowingPopup=false;function e(k){if(b.searchState==SEARCH_STATE.INQUIRY){b.searchState=SEARCH_STATE.INCOMPLETE;b.updateLayout()}if($("#found-"+k).length<=0){$("#"+DIV.BODY.BLUETOOTH_RESULTS).append('<li id="found-'+k+'"><img id="loading-'+k+'" class="iconCel" src="'+BASE_URL_IMAGES+'mobile.png"/><span id="'+k+'">'+k+"</span></li>");$("#found-"+k).click(function(){if(window.confirm(text.get("bluetooth.confirm"))){b.setMac(k);b.closePopup()}})}var j=cache.getFriendlyName(k);if(j){setDivContent(k,j)}}Bluetooth.prototype.updateDeviceName=function(k,j){if(j!=""){setDivContent(k,j);cache.updateFriendlyName(k,j)}};Bluetooth.prototype.startSearch=function(){var l=getCookie("inicioDaNet");if(this.searchState==SEARCH_STATE.COMPLETE||this.searchState==SEARCH_STATE.FIRST_TIME){setDivContent(DIV.BODY.BLUETOOTH_RESULTS,"");hideDiv(INPUT.BLUETOOTH.SEARCH_AGAIN);this.searchState=SEARCH_STATE.INQUIRY;this.updateLayout();var n=this;var k=function(){setDivContent(DIV.POPUP.BT_READY_DATA,text.get("bluetooth.not_found"));n.searchCompleted();n.giveup()};var j=function(){hideDiv(DIV.POPUP.BLUETOOTH.INQUIRY);hideDiv(DIV.POPUP.BLUETOOTH.READY);showDiv(DIV.POPUP.BT_READY_DATA_INICIO_DA_NET)};server.call({url:GET_ONLINE_DEVICES_API,data:{origin:"WEB"},error:k,success:function(x){if(x.devices.length==0){if(l){j();return}else{k()}}else{for(d in x.devices){var v=x.devices[d];setDivContent(DIV.POPUP.BT_READY_DATA,text.get("bluetooth.mobiles_found"));var w=convertMACToJSFormat(v.address);var q=v.friendly_name;e(w);var o=cache.getFriendlyName(w);if(q){n.updateDeviceName(w,q)}else{if(!o){n.updateDeviceName(w,v.address)}}}showDiv(DIV.POPUP.BT_READY_NOTFOUND)}n.searchCompleted()}})}};Bluetooth.prototype.giveup=function(){this.mustShowManualMac=true;this.bluetoothError()};Bluetooth.prototype.bluetoothError=function(){this.closePopup();this.updateLayout();if(this.mustShowManualMac){this.mustShowManualMac=false;macAssociationPopup.show()}};Bluetooth.prototype.showPopup=function(){$("#img-preview").dialog("destroy");doAfterLogin("bluetooth.startSearch();bluetooth.isShowingPopup = true;bluetooth.updateLayout();")};Bluetooth.prototype.closePopup=function(){this.isShowingPopup=false;this.updateLayout()};Bluetooth.prototype.searchCompleted=function(){b.searchState=SEARCH_STATE.COMPLETE;showDiv(INPUT.BLUETOOTH.SEARCH_AGAIN);this.updateLayout()};Bluetooth.prototype.setMac=function(k){var j=loggedUser.pendingContent;loggedUser.pendingContent=undefined;loggedUser.setBluetooth(k);if(j){this.send(k,j.innerBean.attachment)}};Bluetooth.prototype.updateLayout=function(){var j="";if(!loggedUser.mac){j=DIV.BLUETOOTH.READY}else{j=DIV.BLUETOOTH.SELECTED}selectDiv(DIV.BLUETOOTH,j);if(!this.isShowingPopup){selectDiv(DIV.POPUP.BLUETOOTH,"")}else{if(this.searchState==SEARCH_STATE.INQUIRY||this.searchState==SEARCH_STATE.FIRST_TIME){selectDiv(DIV.POPUP.BLUETOOTH,DIV.POPUP.BLUETOOTH.INQUIRY)}else{selectDiv(DIV.POPUP.BLUETOOTH,DIV.POPUP.BLUETOOTH.READY)}}};function h(j){b.updateLayout();if(!j){showMessage(text.get("bluetooth.error"),"error")}else{$(document).ready(function(){$("#"+DIV.POPUP.BT_REMOTE_OK).dialog({title:text.get("home.popups.remote_ok.sent"),modal:true,position:"center",resizable:false,width:580,height:290})})}}function g(k,j){if(!j){internalError("Resource ID is undefined!")}else{server.call({url:SEND_MESSAGE_API,data:{profile:(loggedUser.isLogged()?loggedUser.nick:"web"),session_id:(loggedUser.isLogged()?loggedUser.session_id:"web"),destinations:(convertMACToServerFormat(k)+"#BLUETOOTH"),attachments:j,origin:"WEB"},error:function(){h(false)},success:function(l){h(true)}})}}Bluetooth.prototype.send=function(k,j){g(k,j)}}function SignupProcessor(){SignupProcessor.prototype.create=function(b,e){server.call({url:USER_CREATE_API,data:{login:b,password:e,name:b,city:"",country:"",auto_login:"false",origin:"WEB"},error:function(g){if(g=="LOGIN_ALREADY_EXISTS"){signupPopup.showError(1,text.get("signup.login_in_use"))}else{if(g=="INVALID_LOGIN"){signupPopup.showError(1,text.get("signup.invalid_login"))}else{signupPopup.showError(1,text.get("signup.error"));internalError("Code: "+g)}}},success:function(g){signupPopup.close(1);signupPopup.show(2)}})};SignupProcessor.prototype.update=function(b,j,g){var h=function(){setInputValue(INPUT.LOGIN.NICK,getInputValueTrim(INPUT.SIGNUP.NICK));setInputValue(INPUT.LOGIN.PASS,getInputValue(INPUT.SIGNUP.PASS));setCookie("newUser","true");submitForm(FORM.LOGIN)};var e=function(){if(window.confirm(text.get("signup.email_warning"))){h()}};server.call({url:UPDATE_CONTACT_API,data:{profile:b,password:j,name:g,type:"EMAIL",origin:"WEB"},error:e,success:h})}}function RememberProcessor(){function b(e){rememberPopup.isShowingLoading=false;rememberPopup.updateLayout();rememberPopupNick.isShowingLoading=false;rememberPopupNick.updateLayout();if(e){showMessage(text.get("lost_password.error")+" "+e+". "+text.get("lost_password.error2"),"error")}else{showMessage(text.get("lost_password.error3"),"error")}}RememberProcessor.prototype.sendByNickname=function(e){server.call({url:RETRIEVE_PASSWORD_API,data:{profile:e,origin:"WEB"},error:function(){b()},success:function(g){showMessage(text.get("lost_password.success"),"success");rememberPopup.close()}})};RememberProcessor.prototype.sendEmail=function(e){server.call({url:RETRIEVE_PASSWORD_API,data:{address:e,type:"EMAIL",origin:"WEB"},error:function(){b("email")},success:function(g){showMessage(text.get("lost_password.email.success"),"success");rememberPopupNick.close()}})};RememberProcessor.prototype.sendMSN=function(e){server.call({url:RETRIEVE_PASSWORD_API,data:{address:e,type:"MSN",origin:"WEB"},error:function(){b("MSN")},success:function(g){showMessage(text.get("lost_password.msn.success"),"success");rememberPopupNick.close()}})}}function Broadcast(){Broadcast.prototype.searchForMobiles=function(){var b=function(){setDivContent(DIV.BODY.MOBILES,getDivContent(TEMPLATE.TIMELINE.RADAR_OFF))};server.call({url:GET_ONLINE_DEVICES_API,data:{profile:loggedUser.nick,origin:"WEB"},error:b,success:function(k){if(k.devices.length==0){b()}else{var l="";var g=new Array();var j;var h;var e;for(d in k.devices){j=k.devices[d];e=convertMACToJSFormat(j.address);h=cache.getFriendlyName(e);if(j.friendly_name){bluetooth.updateDeviceName(e,j.friendly_name)}else{if(!h){bluetooth.updateDeviceName(e,j.address)}}if(!g[e]){l+='<div class="celRadar"><img src="'+BASE_URL_IMAGES+'ico-celradar.gif" /><p><span id="dev-'+e+'"></span></p></div>';g[e]=true}}setDivContent(DIV.BODY.MOBILES,l);for(d in k.devices){j=k.devices[d];e=convertMACToJSFormat(j.address);h=cache.getFriendlyName(e);setDivContent("dev-"+e,cutText(h,17))}}}})}}function SystemMessage(){this.isShowing=false;this.msgText="";this.functionOnClick=undefined;SystemMessage.prototype.show=function(b,e){this.isShowing=true;this.msgText=b;this.functionOnClick=e;this.updateLayout()};SystemMessage.prototype.close=function(){this.isShowing=false;this.msgText="";this.updateLayout()};SystemMessage.prototype.updateLayout=function(){setDivContent(DIV.SYSTEM_MESSAGE,this.msgText);if(this.functionOnClick){$("#"+DIV.SYSTEM_MESSAGE).click(this.functionOnClick)}if(this.isShowing){$("#"+DIV.SYSTEM_MESSAGE).slideDown("fast")}else{$("#"+DIV.SYSTEM_MESSAGE).slideUp("fast")}}}function Boost(){function e(g){return getCookie("BOOST."+g)=="true"}function b(h,g){setCookie("BOOST."+h,g?"true":"false")}if(!getCookie("BOOST."+BOOST.ALL)){b(BOOST.ALL,true)}Boost.prototype.click=function(g){forEachDo(BOOST,function(h){if(g==h){b(h,true)}else{b(h,false)}});tabs.updateViaAjax();this.updateLayout()};Boost.prototype.updateLayout=function(){forEachDo(BOOST,function(g){if(e(g)){$("#"+g).addClass("btTurboAtivo")}else{$("#"+g).removeClass("btTurboAtivo")}})}}var User,users,loggedUser,currentProfile,Profile,TAB,Content,contents,tabs;function setUser(e){if(!e.name){e.name=e.nick}var b=new User(e);users.setUser(e.nick,b)}function setOnlineUsers(b,e){var g=new Array();for(ou in b){var h=b[ou];if(h.nick!=SPECIAL_USER_ALOUW_APPLICATION){setUser(h);g.push(users.getUser(h.nick))}}users.setOnlineUsers(g,e)}function setLoggedUser(b){if(!b.name){b.name=b.nick}loggedUser.setData(b);users.setUser(b.nick,loggedUser)}function setCurrentProfile(b){if(!b.name){b.name=b.nick}currentProfile=new Profile();currentProfile.setData(b);users.setUser(b.nick,currentProfile)}function addContentToTab(e){if(!e.sender_nick){e.sender_nick="web"}if(!e.author){e.author=e.sender_nick}if(e.sender_nick!=SPECIAL_USER_ALOUW_APPLICATION){var b=new Content(e);if(b.isShared()&&loggedUser.isLogged()){if(b.innerBean.sender_nick==loggedUser.nick||b.innerBean.author==loggedUser.nick){loggedUser.sharedContents[b.getHash()]="true"}}contents.addContent(b.getId(),b);tabs.addTabEntry(e.tab,b)}}function addUserToTab(g,b){var e=users.getUser(b);if(e&&b!=SPECIAL_USER_ALOUW_APPLICATION){tabs.addTabEntry(g,e)}}var ACTIONS_INPUT={CHANGE:"CHANGE",UPDATE:"UPDATE",CANCEL:"CANCEL",REMOVE:"REMOVE"};function actionChangePicture(b){if(!loggedUser.isLogged()){loginPopup.show()}else{if(b==ACTIONS_INPUT.CHANGE){avatarUploader.isLoading=false;avatarUploader.show()}else{if(b==ACTIONS_INPUT.CANCEL){avatarUploader.close()}else{if(b==ACTIONS_INPUT.UPDATE){avatarUploader.upload()}}}}}function actionLoggedUserUploadBt(b){if(b==ACTIONS_INPUT.CHANGE){hideDiv(DIV.UPLOADBT.LOADING);if(loggedUser.bluetooth_upload=="INBOX"){$("input[name="+INPUT.UPLOADBT.VALUE+"]")[1].checked=true}else{$("input[name="+INPUT.UPLOADBT.VALUE+"]")[0].checked=true}showDiv(DIV.UPLOADBT.INPUT_POPUP)}else{if(b==ACTIONS_INPUT.CANCEL){hideDiv(DIV.UPLOADBT.INPUT_POPUP)}else{if(b==ACTIONS_INPUT.UPDATE){showDiv(DIV.UPLOADBT.LOADING);if($("input[name="+INPUT.UPLOADBT.VALUE+"]")[1].checked){loggedUser.setBluetoothUpload("INBOX")}else{loggedUser.setBluetoothUpload("WALL")}}}}}function actionLoggedUserName(g){if(g==ACTIONS_INPUT.CHANGE){hideDiv(DIV.NAME.LOADING);var b=replaceAll(loggedUser.name,"&#36;","$");setInputValue(INPUT.NAME.VALUE,b);showDiv(DIV.NAME.INPUT_POPUP);$("#"+INPUT.NAME.VALUE).select()}else{if(g==ACTIONS_INPUT.CANCEL){hideDiv(DIV.NAME.INPUT_POPUP)}else{if(g==ACTIONS_INPUT.UPDATE){showDiv(DIV.NAME.LOADING);var e=getInputValue(INPUT.NAME.VALUE);loggedUser.setName(e)}}}}function actionLoggedUserPassword(b){if(b==ACTIONS_INPUT.CHANGE){hideDiv(DIV.PASSWORD.LOADING);setInputValue(INPUT.PASSWORD.CURRENT,"");setInputValue(INPUT.PASSWORD.VALUE,"");setInputValue(INPUT.PASSWORD.CONFIRM,"");showDiv(DIV.PASSWORD.INPUT_POPUP);$("#"+INPUT.PASSWORD.CURRENT).focus()}else{if(b==ACTIONS_INPUT.CANCEL){hideDiv(DIV.PASSWORD.INPUT_POPUP)}else{if(b==ACTIONS_INPUT.UPDATE){if(getInputValue(INPUT.PASSWORD.VALUE).length==0){showMessage(text.get("password.type_new_pass"),"error");$("#"+INPUT.PASSWORD.VALUE).select()}else{if(getInputValue(INPUT.PASSWORD.VALUE)!=getInputValue(INPUT.PASSWORD.CONFIRM)){showMessage(text.get("signup.wrong_password_check"),"error");$("#"+INPUT.PASSWORD.VALUE).select()}else{showDiv(DIV.PASSWORD.LOADING);loggedUser.setPassword(getInputValue(INPUT.PASSWORD.CURRENT),getInputValue(INPUT.PASSWORD.VALUE))}}}}}}function actionLoggedUserEmail(b){if(b==ACTIONS_INPUT.CHANGE){hideDiv(DIV.EMAIL.LOADING);if(!loggedUser.email){setInputValue(INPUT.EMAIL.VALUE,"");hideDiv(DIV.EMAIL.REMOVE_BUTTON)}else{setInputValue(INPUT.EMAIL.VALUE,loggedUser.email);showDiv(DIV.EMAIL.REMOVE_BUTTON)}showDiv(DIV.EMAIL.INPUT_POPUP);$("#"+INPUT.EMAIL.VALUE).select()}else{if(b==ACTIONS_INPUT.CANCEL){hideDiv(DIV.EMAIL.INPUT_POPUP)}else{if(b==ACTIONS_INPUT.UPDATE){loggedUser.setEmail(getInputValue(INPUT.EMAIL.VALUE))}else{if(b==ACTIONS_INPUT.REMOVE){loggedUser.removeEmail()}}}}}function actionLoggedUserMSN(b){if(b==ACTIONS_INPUT.CHANGE){hideDiv(DIV.MSN.LOADING);if(!loggedUser.msn){setInputValue(INPUT.MSN.VALUE,"");hideDiv(DIV.MSN.REMOVE_BUTTON)}else{setInputValue(INPUT.MSN.VALUE,loggedUser.msn);showDiv(DIV.MSN.REMOVE_BUTTON)}showDiv(DIV.MSN.INPUT_POPUP);$("#"+INPUT.MSN.VALUE).select()}else{if(b==ACTIONS_INPUT.CANCEL){hideDiv(DIV.MSN.INPUT_POPUP)}else{if(b==ACTIONS_INPUT.UPDATE){loggedUser.setMSN(getInputValue(INPUT.MSN.VALUE))}else{if(b==ACTIONS_INPUT.REMOVE){loggedUser.removeMSN()}}}}}function actionLoggedUserTwitter(b){if(b==ACTIONS_INPUT.CHANGE){hideDiv(DIV.TWITTER.LOADING);if(!loggedUser.twitter){setInputValue(INPUT.TWITTER.VALUE,"");hideDiv(DIV.TWITTER.REMOVE_BUTTON)}else{setInputValue(INPUT.TWITTER.VALUE,loggedUser.twitter);showDiv(DIV.TWITTER.REMOVE_BUTTON)}showDiv(DIV.TWITTER.INPUT_POPUP);$("#"+INPUT.TWITTER.VALUE).select()}else{if(b==ACTIONS_INPUT.CANCEL){hideDiv(DIV.TWITTER.INPUT_POPUP)}else{if(b==ACTIONS_INPUT.UPDATE){loggedUser.setTwitter(getInputValue(INPUT.TWITTER.VALUE))}else{if(b==ACTIONS_INPUT.REMOVE){loggedUser.removeTwitter()}}}}}function sendSelectedContent(e){hideDownload();var b=contents.getSelectedContent();if(b){b.send(e)}}var ACTIONS_USER={FOLLOW:"FOLLOW",MESSAGE:"MESSAGE",GO_TO_PROFILE:"GO_TO_PROFILE",BLOCK:"BLOCK"};function actionSelectedUser(e){hidePerson();var b=users.getSelectedUser();if(b){if(e==ACTIONS_USER.FOLLOW){b.follow()}else{if(e==ACTIONS_USER.MESSAGE){commentPopup.show(lastPersonAnchorId,b.nick,undefined,undefined)}else{if(e==ACTIONS_USER.GO_TO_PROFILE){b.goToProfile()}else{if(e==ACTIONS_USER.BLOCK){b.block()}}}}}}function actionFollow(g,e){var b=e.innerHTML;if(loggedUser.isLogged()&&loggedUser.nick!=g){if(b==text.get("follow")){b=text.get("unfollow")}else{if(b==text.get("unfollow")){b=text.get("follow")}}e.innerHTML=b;$(".follow-code-"+g).html(b)}}function validateDongleFields(){var v=false;var q=getInputValue(INPUT.DONGLE.ADDRESS);var w=getInputValue(INPUT.DONGLE.DISTRICT);var g=getInputValue(INPUT.DONGLE.CITY);var b=getInputValue(INPUT.DONGLE.STATE);var l=getInputValue(INPUT.DONGLE.ZIPCODE);var e=getInputValue(INPUT.DONGLE.NAME);var n=getInputValue(INPUT.DONGLE.STORE_NAME);var k=getInputValue(INPUT.DONGLE.EMAIL);var j=getInputValue(INPUT.DONGLE.PHONE);var x=getInputValue(INPUT.DONGLE.PHONE2);var h=getInputValue(INPUT.DONGLE.COMMENTS);var o=getInputValue(INPUT.DONGLE.ORIGIN);if(n.length<3){v=true;$("#"+INPUT.DONGLE.STORE_NAME).focus();$("#"+INPUT.DONGLE.STORE_NAME).addClass("fieldError");return v}if(q.length<3){v=true;$("#"+INPUT.DONGLE.ADDRESS).focus();$("#"+INPUT.DONGLE.ADDRESS).addClass("fieldError");return v}if(w.length<3){v=true;$("#"+INPUT.DONGLE.DISTRICT).focus();$("#"+INPUT.DONGLE.DISTRICT).addClass("fieldError");return v}if(g.length<3){v=true;$("#"+INPUT.DONGLE.CITY).focus();$("#"+INPUT.DONGLE.CITY).addClass("fieldError");return v}if(l.length<3){v=true;$("#"+INPUT.DONGLE.ZIPCODE).focus();$("#"+INPUT.DONGLE.ZIPCODE).addClass("fieldError");return v}if(e.length<3){v=true;$("#"+INPUT.DONGLE.NAME).focus();$("#"+INPUT.DONGLE.NAME).addClass("fieldError");return v}if(k.length<3||!isValidEmail(k)){v=true;$("#"+INPUT.DONGLE.EMAIL).focus();$("#"+INPUT.DONGLE.EMAIL).addClass("fieldError");return v}if(j.length<3){v=true;$("#"+INPUT.DONGLE.PHONE).focus();$("#"+INPUT.DONGLE.PHONE).addClass("fieldError");return v}return v}function submitStep3(){var n=false;function o(E){var D,G,F,H,J,I;I=1;if(E.length<11){return false}for(H=0;H<E.length-1;H++){if(E.charAt(H)!=E.charAt(H+1)){I=0;break}}if(!I){D=E.substring(0,9);G=E.substring(9);F=0;for(H=10;H>1;H--){F+=D.charAt(10-H)*H}J=F%11<2?0:11-F%11;if(J!=G.charAt(0)){return false}D=E.substring(0,10);F=0;for(H=11;H>1;H--){F+=D.charAt(11-H)*H}J=F%11<2?0:11-F%11;if(J!=G.charAt(1)){return false}return true}else{return false}}function q(H){var D,I,L,G,F,J,K,E;E=1;if(H.length<14&&H.length<15){return false}for(G=0;G<H.length-1;G++){if(H.charAt(G)!=H.charAt(G+1)){E=0;break}}if(!E){K=H.length-2;D=H.substring(0,K);I=H.substring(K);L=0;J=K-7;for(G=K;G>=1;G--){L+=D.charAt(K-G)*J--;if(J<2){J=9}}F=L%11<2?0:11-L%11;if(F!=I.charAt(0)){return false}K=K+1;D=H.substring(0,K);L=0;J=K-7;for(G=K;G>=1;G--){L+=D.charAt(K-G)*J--;if(J<2){J=9}}F=L%11<2?0:11-L%11;if(F!=I.charAt(1)){return false}return true}else{return false}}var z=getInputValue(INPUT.DONGLE.CPF);var l=getInputValue(INPUT.DONGLE.CNPJ);var e=getInputValue(INPUT.DONGLE.ADDRESS);var w=getInputValue(INPUT.DONGLE.DISTRICT);var A=getInputValue(INPUT.DONGLE.CITY);var g=getInputValue(INPUT.DONGLE.STATE);var b=getInputValue(INPUT.DONGLE.ZIPCODE);var C=getInputValue(INPUT.DONGLE.NAME);var x=getInputValue(INPUT.DONGLE.STORE_NAME);var y=getInputValue(INPUT.DONGLE.EMAIL);var h=getInputValue(INPUT.DONGLE.PHONE);var v=getInputValue(INPUT.DONGLE.PHONE2);var k=getInputValue(INPUT.DONGLE.COMMENTS);var B=getInputValue(INPUT.DONGLE.ORIGIN);var j=getInputValue(INPUT.DONGLE.REQUEST_ID);n=validateDongleFields();if(!o(z)){n=true;$("#"+INPUT.DONGLE.CPF).focus();$("#"+INPUT.DONGLE.CPF).addClass("fieldError")}if(l!=""){if(!q(l)){n=true;$("#"+INPUT.DONGLE.CNPJ).focus();$("#"+INPUT.DONGLE.CNPJ).addClass("fieldError")}}if(n){showDiv("formErro");return false}else{server.call({url:DONGLE_STEP_3,data:{address:e,district:w,city:A,state:g,zipcode:b,name:C,email:y,phone:h,comments:k,storeName:x,phone2:v,ro:B,cnpj:l,cpf:z,request_id:j},error:function(){showMessage(text.get("dongle_request.error"),"error");requestingDongle=false;hideDiv("dongle-wait")},success:function(E){var D=E.cpnj_cpf_ok;if(D=="ok"){hideDiv("formContent");hideDiv("formErro");hideDiv("submitPoolbt");hideDiv("form_cnpj_cpf");showDiv("formSucesso");document.getElementById("free").value=E.request_id;document.getElementById("cep_field").value=E.cep;if(E.cnpj!=null){document.getElementById("cnpj_field").value=E.cnpj}if(E.cpf!=null){document.getElementById("cpf_field").value=E.cpf}document.getElementById("nome_field").value=E.nome;document.getElementById("email_field").value=E.email;document.getElementById("bairro_field").value=E.bairro;document.getElementById("endereco_field").value=E.endereco;document.getElementById("telefone_field").value=E.telefone;document.getElementById("celular_field").value=E.celular}else{alert("Ja existe CPF ou CNPJ cadastrado com o email cadastrado.")}}})}}function requestDongleStep2(){var x=false;var g=getInputValue(INPUT.DONGLE.ESTAB);var w=getInputValue(INPUT.DONGLE.ADDRESS);var y=getInputValue(INPUT.DONGLE.DISTRICT);var h=getInputValue(INPUT.DONGLE.CITY);var b=getInputValue(INPUT.DONGLE.STATE);var q=getInputValue(INPUT.DONGLE.ZIPCODE);var e=getInputValue(INPUT.DONGLE.NAME);var o=getInputValue(INPUT.DONGLE.STORE_NAME);var n=getInputValue(INPUT.DONGLE.EMAIL);var l=getInputValue(INPUT.DONGLE.PHONE);var z=getInputValue(INPUT.DONGLE.PHONE2);var k=getInputValue(INPUT.DONGLE.COMMENTS);var v=getInputValue(INPUT.DONGLE.ORIGIN);var j=document.getElementById("estabelecimento");x=validateDongleFields();if(j.value==""){alert("Por favor selecione o tipo de estabelecimento.");return false}if(x){showDiv("formErro");return false}else{showDiv("dongle-wait");server.call({url:DONGLE_STEP_1,data:{address:w,district:y,city:h,state:b,zipcode:q,name:e,email:n,phone:l,comments:k,storeName:o,phone2:z,ro:v},error:function(){showMessage(text.get("dongle_request.error"),"error");requestingDongle=false;hideDiv("dongle-wait")},success:function(B){hideDiv("dongle-wait");var A=B.create_return;if(A=="not_ok"){alert("Já existe pedido cadastrado para o email fornecido.");return}if(g=="NCOM"){alert("Voce não é um estabelecimento comercial, será direcionado para comprar sua propria antena.");window.location=text.get("dongle.wheretobuy")}else{var C=B.request_id;document.getElementById("request_id").value=C;hideDiv("formErro");hideDiv("step2bt");showDiv("donglePesquisa")}}})}}function submitDonglePool(){var E=document.getElementById("questao1");var D=document.getElementById("questao2");var C=document.getElementById("questao3");var B=document.getElementById("questao4");var A=document.getElementById("questao5");var b=document.getElementById("checks");var g=getInputValue(INPUT.DONGLE.ADDRESS);var v=getInputValue(INPUT.DONGLE.DISTRICT);var z=getInputValue(INPUT.DONGLE.CITY);var h=getInputValue(INPUT.DONGLE.STATE);var e=getInputValue(INPUT.DONGLE.ZIPCODE);var G=getInputValue(INPUT.DONGLE.NAME);var w=getInputValue(INPUT.DONGLE.STORE_NAME);var x=getInputValue(INPUT.DONGLE.EMAIL);var j=getInputValue(INPUT.DONGLE.PHONE);var q=getInputValue(INPUT.DONGLE.PHONE2);var l=getInputValue(INPUT.DONGLE.COMMENTS);var F=getInputValue(INPUT.DONGLE.ORIGIN);var y=getInputValue(INPUT.DONGLE.CPF);var n=getInputValue(INPUT.DONGLE.CNPJ);var k=getInputValue(INPUT.DONGLE.REQUEST_ID);if(b.value>2){alert("Por favor selecione até duas opções na questao 5.");return false}if(E.value==""||D.value==""||C.value==""||B.value==""||A.value==""){alert("Por favor complete a pesquisa.");return false}var o=E.value+"_"+D.value+"_"+C.value+"_"+B.value+"_"+A.value;showDiv("dongle-wait");server.call({url:DONGLE_STEP_2,data:{address:g,district:v,city:z,state:h,zipcode:e,name:G,email:x,phone:j,comments:l,storeName:w,phone2:q,ro:F,answer:o,cpf:y,cnpj:n,request_id:k},error:function(){showMessage(text.get("dongle_request.error"),"error");requestingDongle=false;hideDiv("dongle-wait")},success:function(I){hideDiv("dongle-wait");var H=I.pool_check;if(H=="fail"){hideDiv("formContent");hideDiv("formErro");hideDiv("submitPoolbt");hideDiv("form_cnpj_cpf");showDiv("formPoolFail");return false}hideDiv("formErro");hideDiv("submitPoolbt");showDiv("form_cnpj_cpf");hideDiv("donglePesquisa")}})}var requestingDongle=false;function requestDongle(){if(requestingDongle){return false}var w=getInputValue(INPUT.DONGLE.ADDRESS);var y=getInputValue(INPUT.DONGLE.DISTRICT);var h=getInputValue(INPUT.DONGLE.CITY);var b=getInputValue(INPUT.DONGLE.STATE);var o=getInputValue(INPUT.DONGLE.ZIPCODE);var e=getInputValue(INPUT.DONGLE.NAME);var q=getInputValue(INPUT.DONGLE.STORE_NAME);var n=getInputValue(INPUT.DONGLE.EMAIL);var l=getInputValue(INPUT.DONGLE.PHONE);var z=getInputValue(INPUT.DONGLE.PHONE2);var k=getInputValue(INPUT.DONGLE.COMMENTS);var v=getInputValue(INPUT.DONGLE.ORIGIN);var A=getInputValue("login_vscyber");var j=getInputValue("login_alouw");var g=getInputValue("status");var x=false;if(q.length<3){x=true;$("#"+INPUT.DONGLE.STORE_NAME).addClass("inputErro")}if(w.length<3){x=true;$("#"+INPUT.DONGLE.ADDRESS).addClass("inputErro")}if(y.length<3){x=true;$("#"+INPUT.DONGLE.DISTRICT).addClass("inputErro")}if(h.length<3){x=true;$("#"+INPUT.DONGLE.CITY).addClass("inputErro")}if(o.length<3){x=true;$("#"+INPUT.DONGLE.ZIPCODE).addClass("inputErro")}if(e.length<3){x=true;$("#"+INPUT.DONGLE.NAME).addClass("inputErro")}if(n.length<3||!isValidEmail(n)){x=true;$("#"+INPUT.DONGLE.EMAIL).addClass("inputErro")}if(l.length<3){x=true;$("#"+INPUT.DONGLE.PHONE).addClass("inputErro")}if(x){showDiv("formErro");return false}else{requestingDongle=true;showDiv("dongle-wait");server.call({url:CREATE_DONGLE_REQ_API,data:{address:w,district:y,city:h,state:b,zipcode:o,name:e,email:n,phone:l,comments:k,storeName:q,phone2:z,ro:v,login_vscyber:A,login_alouw:j,status:g},error:function(){showMessage(text.get("dongle_request.error"),"error");requestingDongle=false;hideDiv("dongle-wait")},success:function(B){hideDiv("formErro");hideDiv("formContent");hideDiv("only-stores");if(B.existe_pedido){showDiv("formValidacao_cadastro");return}if(g!="OK"){showDiv("formSucesso_limite_antenas")}else{showDiv("formSucesso")}}})}return false}function actionISentThat(b){if(window.confirm(text.get("bluetooth.association.confirm2"))){if(loggedUser.isLogged){loggedUser.setBluetooth(b)}else{setCookie("iSentThat","true");loginPopup.doAfterLogin("loggedUser.setBluetooth('"+b+"'); macAssociationPopup.showOK();");signupPopup.show(1)}}}var sendingPoolAnswer=false;function sendPoolAnswer(){if(sendingPoolAnswer){return false}sendingPoolAnswer=true;var b=$("#enquete-valor").val();if(b=="0"){showMessage(text.get("pool_answer.not_selected"),"error");sendingPoolAnswer=false}else{if(getCookie("pool_answered."+loggedUser.nick)=="true"){showMessage(text.get("pool_answer.answered"),"error");sendingPoolAnswer=false}else{showDiv(DIV.POOL.WAIT);hideDiv(DIV.POOL.BUTTON);server.call({url:POOL_ANSWER_API,data:{value:b,profile:loggedUser.nick},error:function(){showMessage(text.get("pool_answer.error"),"error");hideDiv(DIV.POOL.WAIT);showDiv(DIV.POOL.BUTTON);sendingPoolAnswer=false},success:function(e){showMessage(text.get("pool_answer.success"),"success");hideDiv("pool-wait");hideDiv("div-pool");setCookie("pool_answered."+loggedUser.nick,"true");hideDiv(DIV.POOL.WAIT);sendingPoolAnswer=false}})}}return false}function plotAlouwBroadcaster(b,e,h,g,k){$("#"+b).show();var j=Math.max(e,h,g,k);line1=[e,h,g,k];broadcastPlot=$.jqplot(b,[line1],{title:text.get("content.broadcaster.report"),seriesDefaults:{renderer:$.jqplot.BarRenderer,rendererOptions:{barWidth:50}},axes:{xaxis:{renderer:$.jqplot.CategoryAxisRenderer,ticks:[text.get("broadcaster.devices"),text.get("broadcaster.pushes"),text.get("broadcaster.pushes.success"),text.get("broadcaster.pushes.error")]},yaxis:{min:0,max:j}}});$("#"+b+"_popup").dialog({modal:true,position:"center",resizable:false,width:450,height:350})}function showCommentsDiv(k,l,j){var h=tabs.selectedTab;for(t in this.tabs.tabs[h]){var b=this.tabs.tabs[h][t];if(b.innerBean.message==k){$("#comment_count_"+k).removeAttr("href");b.isCommentOpen=true}}var g=new Array();for(t in tabs.tabs[h]){var n=tabs.tabs[h][t];if(n.innerBean.conversation==k){g[t]=n}}for(r in g){var e=g[r];tabs.removeTabEntry(l,e)}server.call({url:MESSAGE_API+"list/",data:{message:k,include_conversation_count:true},error:function(){},success:function(w){var E=w.messages[0].conversation_count;updateContentCount(k,E,h);w.messages.shift();for(c in w.messages){var y=w.messages[c];var z=new Date(y.date);var x=null;var q="";var A="";var B="";var v=z.getMonth()+1;var C="MESSAGE";B=z.getDate()+"/"+v+"/"+z.getUTCFullYear()+" "+z.getHours()+":"+z.getMinutes()+":"+z.getSeconds();for(a in y.attachments){x=y.attachments[a]}if(x){q=x.id;A=x.display_name;C=x.mime_type.split("/")[0].toUpperCase()}if(!users.exists(y.from_login)){setUser({nick:y.from_login,name:y.from_login,anonymous:false,avatar:y.from_avatar})}addContentToTab({tab:h,message:y.message,delivery:y.delivery,conversation:y.conversation,attachment:q,attachment_name:A,date:B,sender_nick:y.body.author,to_nick:y.to_login,sender_mac:"",recent:false,origin:y.origin,text:y.body.text,content_type:C,author:y.body.author,shared_at:"",conversation_count:E})}tabs.updateLayout();if(w.messages.length>3&&j=="true"){var o=w.messages.length;var D=w.messages[o-3];location.href="#message_id_"+D.message}}})}function hideCommentsDiv(j,k){var h=tabs.selectedTab;for(t in this.tabs.tabs[h]){var b=this.tabs.tabs[h][t];if(b.innerBean.message==j){b.isCommentOpen=false}}var g=new Array();for(t in tabs.tabs[h]){var l=tabs.tabs[h][t];if(l.innerBean.conversation==j){g[t]=l}}for(r in g){var e=g[r];tabs.removeTabEntry(k,e)}tabs.updateLayout();tabs.updateTabsLayout()}function updateContentCount(e,h,b){for(t in tabs.tabs[b]){var g=tabs.tabs[b][t];if(g.innerBean.message==e){g.innerBean.conversation_count=h}}}var menuDisplay=[];var menuTimer=2000;var lastPersonAnchorId;function showAttachmentHelp(b){$("#attachmentHelp").html(b)}function hideAttachmentHelp(){$("#attachmentHelp").html("")}function showAttachment(){$("#attachment").slideDown()}function hideAttachment(){$("#attachment").hide()}function hideMenu(b){$("#"+b).hide();menuDisplay[b]="hidden"}function automaticHideMenu(b){if(menuDisplay[b]=="visible"){hideMenu(b)}}function fixMenu(b){menuDisplay[b.id]="fixed"}function checkEvent(g,e){if(!g){g=window.event}g.cancelBubble=true;if(g.stopPropagation){g.stopPropagation()}var b;if(g.target){b=g.target}else{if(g.srcElement){b=g.srcElement}}if(b.nodeType==3){b=b.parentNode}b=g.relatedTarget?g.relatedTarget:(g.type=="mouseout")?g.toElement:g.fromElement;if(!b||b==e){return false}while(b.parentNode){if(b==e){return false}b=b.parentNode}return true}function leaveMenu(b){var e=window.event||arguments.callee.caller.arguments[0];if(checkEvent(e,b)){hideMenu(b.id)}}function showPositioned(k,e,j,h){var b=$(e).offset();var g=$(e).width();$("#"+k).css({left:(b.left+g+j)+"px",top:b.top+h+"px"});$("#"+k).slideDown();adjustPositionToWindow(k,j)}function adjustPositionToWindow(l,k){var j=$(window).width();var h=$(window).scrollLeft();var g=j+h;var e=$("#"+l).offset().left;var b=$("#"+l).width();if((e+b)>g){$("#"+l).css("left",e-(b-(g-e))+k)}}function showMenu(h,b,g,e){showPositioned(h,b,g,e);menuDisplay[h]="visible";setTimeout('automaticHideMenu("'+h+'")',menuTimer)}function showPerson(g,b){lastPersonAnchorId=g.id;if(b==loggedUser.nick){loggedUser.goToProfile()}else{if(users.exists(b)){users.selectUser(b);var e=users.getUser(b);$("#url-profile").attr("href",BASE_URL_WEB+"?profile="+b);$("#"+DIV.BODY.PERSON_MENU_NAME).html(e.name);$("#url-profile").attr("target","_top");$("#"+IMG.FOLLOW).attr("src",e.isFollowing()?(BASE_URL_IMAGES+"unfollow.gif"):(BASE_URL_IMAGES+"follow.png"));if(e.isFollowing()){setDivContent(DIV.BODY.FOLLOW,text.get("unfollow"))}else{setDivContent(DIV.BODY.FOLLOW,text.get("follow"))}if(loggedUser.administrator){$("#"+IMG.BLOCK).attr("src",e.isBlocked()?(BASE_URL_IMAGES+"ico_unblock.png"):(BASE_URL_IMAGES+"ico_block.png"));if(e.isBlocked()){setDivContent(DIV.BODY.BLOCK,text.get("unblock"))}else{setDivContent(DIV.BODY.BLOCK,text.get("block"))}}else{$("#person-menu-block-item").hide()}showMenu("person",g,-16,-4)}}}function hidePerson(){hideMenu("person")}function hideDownload(){hideMenu("download")}var server=new Server();var cache=new Cache();var readMessagesController=new ReadMessagesController();var currentProfile;var loggedUser=new LoggedUser();var users=new Users();var contents=new Contents();var tabs=new Tabs();var boost=new Boost();var contentPublisher=new ContentPublisher();var avatarUploader=new AvatarUploader();var signupProcessor=new SignupProcessor();var rememberProcessor=new RememberProcessor();var loginPopup=new LoginPopup();var signupPopup=new SignupPopup();var commentPopup=new CommentPopup();var macInputPopup=new MacInputPopup();var rememberPopup=new RememberPopup();var rememberPopupNick=new RememberPopupNick();var macAssociationPopup=new MacAssociationPopup();var statisticPopup=new StatisticPopup();var search=new Search();var bluetooth=new Bluetooth();var sms=new Sms();var broadcast=new Broadcast();var systemMessage=new SystemMessage();var friendsCount=0;var origin_iframe;function Sms(){var b=this;function e(g){b.updateLayout();if(!g){showMessage(text.get("sms.error"),"error")}else{showMessage("Enviado com sucesso!","success")}}Sms.prototype.updateLayout=function(){$("#img-preview").dialog("destroy")};Sms.prototype.send=function(g){if(!g){internalError("Resource ID is undefined!")}else{server.call({url:SEND_MESSAGE_API,data:{profile:(loggedUser.isLogged()?loggedUser.nick:"web"),session_id:(loggedUser.isLogged()?loggedUser.session_id:"web"),destinations:(loggedUser.nick+"#PHONE"),attachments:g,origin:"WEB"},error:function(){e(false)},success:function(h){e(true)}})}}};
