(function(x){if(!x.CFInstall){var w=function(e,d){return typeof e=="string"?(d||document).getElementById(e):e},v=function(){if(x.CFInstall._force){return x.CFInstall._forceValue}if(navigator.userAgent.toLowerCase().indexOf("chromeframe")>=0){return true}if(typeof window.ActiveXObject!="undefined"){try{var e=new ActiveXObject("ChromeTab.ChromeFrame");if(e){e.registerBhoIfNeeded();return true}}catch(d){}}return false},t=function(e){try{var d=document.createElement("style");d.setAttribute("type","text/css");if(d.styleSheet){d.styleSheet.cssText=e}else{d.appendChild(document.createTextNode(e))}var h=document.getElementsByTagName("head")[0];h.insertBefore(d,h.firstChild)}catch(f){}},r=false,q=false,g=function(){if(!q){t(".chromeFrameOverlayContent { display: none; }.chromeFrameOverlayUnderlay { display: none; }");document.cookie="disableGCFCheck=1;path=/;max-age=31536000000";q=true}},c=function(e){var d=document.createElement("iframe");d.setAttribute("frameborder","0");d.setAttribute("border","0");var f=w(e.node);d.id=e.id||(f?f.id||getUid(f):"");d.style.cssText=" "+(e.cssText||"");d.className=e.className||"";d.src=e.src||"about:blank";f&&f.parentNode.replaceChild(d,f);return d},b=function(d){d.className="chromeFrameInstallDefaultStyle "+(d.className||"");d=c(d);d.parentNode||document.body.insertBefore(d,document.body.firstChild)},a=function(e){if(!w("chromeFrameOverlayContent")){var d=document.createElement("span");d.innerHTML='
';for(var f=document.body;d.firstChild;){f.insertBefore(d.lastChild,f.firstChild)}e=c(e);w("chromeFrameIframeHolder").appendChild(e);w("chromeFrameCloseButton").onclick=g}},y={};y.check=function(e){e=e||{};var d=navigator.userAgent,l=/MSIE (\S+); Windows NT/,f=false;if(l.test(d)){if(parseFloat(l.exec(d)[1])<6&&d.indexOf("SV1")<0){f=true}}else{f=true}if(!f){if(!r){t('.chromeFrameInstallDefaultStyle {width: 800px;height: 600px;position: absolute;left: 50%;top: 50%;margin-left: -400px;margin-top: -300px;}.chromeFrameOverlayContent {position: absolute;margin-left: -400px;margin-top: -300px;left: 50%;top: 50%;border: 1px solid #93B4D9;background-color: white;z-index: 2001;}.chromeFrameOverlayContent iframe {width: 800px;height: 600px;border: none;}.chromeFrameOverlayCloseBar {height: 1em;text-align: right;background-color: #CADEF4;}.chromeFrameOverlayUnderlay {position: absolute;width: 100%;height: 100%;background-color: white;opacity: 0.5;-moz-opacity: 0.5;-webkit-opacity: 0.5;-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";filter: alpha(opacity=50);z-index: 2000;}');r=true}document.cookie.indexOf("disableGCFCheck=1")>=0&&g();d=(document.location.protocol=="https:"?"https:":"http:")+"//www.google.com/chromeframe";if(!v()){e.onmissing&&e.onmissing();e.src=e.url||d;d=e.mode||"inline";if(!(e.preventPrompt||0)){if(d=="inline"){b(e)}else{d=="overlay"?a(e):window.open(e.src)}}if(!e.preventInstallDetection){var h=setInterval(function(){if(v()){e.oninstall&&e.oninstall();clearInterval(h);window.location=e.destination||window.location}},2000)}}}};y._force=false;y._forceValue=false;y.isAvailable=v;x.CFInstall=y}})(this.ChromeFrameInstallScope||this); /*! jQuery v1.7.1 jquery.com | jquery.org/license */ (function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement){cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+""),cm.close()}d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border"){for(;g=0===c})}function S(a){return !a||!a.parentNode||a.parentNode.nodeType===11}function K(){return !0}function J(){return !1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b])){continue}if(b!=="toJSON"){return !1}}return !0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else{d=b}}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a){return this}if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2]){return f.find(a)}this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return !d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a)){return f.ready(a)}a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0){return}A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete"){return setTimeout(e.ready,1)}if(c.addEventListener){c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1)}else{if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval" in a},isNumeric:function(a){return !isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a)){return !1}try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf")){return !1}}catch(c){return !1}var d;for(d in a){}return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a){return !1}return !0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b){return null}b=e.trim(b);if(a.JSON&&a.JSON.parse){return a.JSON.parse(b)}if(n.test(b.replace(o,"@").replace(p,"]").replace(q,""))){return(new Function("return "+b))()}e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a){if(c.apply(a[f],d)===!1){break}}}else{for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k){for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
a",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e){return{}}g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent){for(o in {submit:1,change:1,focusin:1}){n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p}}k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="
",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="
t
",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="
",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return !!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b){return}n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function"){e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c)}g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c]){return g.events}k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k]){return}if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e-1){return !0}}return !1},val:function(a){var c,d,e,g=this[0];if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set" in c)||c.set(this,h,"value")===b){this.value=h}}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get" in c&&(d=c.get(g,"value"))!==b){return d}d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return !b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0){return null}c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn){return f(a)[c](d)}if(typeof a.getAttribute=="undefined"){return f.prop(a,c,d)}i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set" in h&&i&&(g=h.set(a,d,c))!==b){return g}a.setAttribute(c,""+d);return d}if(h&&"get" in h&&i&&(g=h.get(a,c))!==null){return g}g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h=0}}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h]){return}c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j){j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0)}return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1){return}r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode){r.push([m,s]),n=m}n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9){return[]}if(!b||typeof b!="string"){return e}var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b)){if(w.length===2&&o.relative[w[0]]){j=y(w[0]+w[1],d,f)}else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length){b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}}}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length){q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}}else{k=w=[]}}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]"){if(!u){e.push.apply(e,k)}else{if(d&&d.nodeType===1){for(t=0;k[t]!=null;t++){k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t])}}else{for(t=0;k[t]!=null;t++){k[t]&&k[t].nodeType===1&&e.push(j[t])}}}}else{s(k,e)}l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h){for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a){return[]}for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1))}return !1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else{a[2]&&m.error(a[0])}a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not"){if((a.exec(b[3])||"").length>1||/^\w/.test(b[3])){b[3]=m(b[3],null,null,c)}else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return !1}}else{if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0])){return !0}}return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return !!a.firstChild},empty:function(a){return !a.firstChild},has:function(a,b,c){return !!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f){return f(a,c,b,d)}if(e==="contains"){return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0}if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f){return f(a,c,b,d)}}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match){o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q))}var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]"){Array.prototype.push.apply(d,a)}else{if(typeof a.length=="number"){for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++){c[e].nodeType===1&&d.push(c[e])}c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1]){return s(e.getElementsByTagName(b),f)}if(h[2]&&o.find.CLASS&&e.getElementsByClassName){return s(e.getElementsByClassName(h[2]),f)}}if(e.nodeType===9){if(b==="body"&&e.body){return s([e.body],f)}if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode){return s([],f)}if(i.id===h[3]){return s([i],f)}}try{return s(e.querySelectorAll(b),f)}catch(j){}}else{if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p){return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}}catch(r){}finally{l||k.removeAttribute("id")}}}}return a(b,e,f,g)};for(var e in a){m[e]=a[e]}b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a)){try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11){return f}}}catch(g){}}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1){return}o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c){return b.getElementsByClassName(a[1])}},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return !!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return !1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a)){f+=d[0],a=a.replace(o.match.PSEUDO,"")}a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0){for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11){break}}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a){return this[0]&&this[0].parentNode?this.prevAll().length:-1}if(typeof a=="string"){return f.inArray(this[0],f(a))}return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d))){g.nodeType===1&&e.push(g),g=g[c]}return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c]){if(a.nodeType===1&&++e===b){break}}return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling){a.nodeType===1&&a!==b&&c.push(a)}return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a)){return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))})}if(typeof a!="object"&&a!==b){return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))}return f.text(this)},wrapAll:function(a){if(f.isFunction(a)){return this.each(function(b){f(this).wrapAll(a.call(this,b))})}if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1){a=a.firstChild}return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a)){return this.each(function(b){f(this).wrapInner(a.call(this,b))})}return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)})}if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)})}if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++){if(!a||f.filter(a,[d]).length){!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d)}}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild){b.removeChild(b.firstChild)}}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null}if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g){e[g]&&bk(d[g],e[g])}}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g){bj(d[g],e[g])}}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k){continue}if(typeof k=="string"){if(!_.test(k)){k=b.createTextNode(k)}else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--){o=o.lastChild}if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i){f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}}var r;if(!f.support.appendChecked){if(k[0]&&typeof(r=k.length)=="number"){for(i=0;i=0){return b+"px"}}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter){return}}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return !f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS){return bS.apply(this,arguments)}if(!this.length){return this}var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified")){f.lastModified[k]=y}if(z=v.getResponseHeader("Etag")){f.etag[k]=z}}if(a===304){w="notmodified",o=!0}else{try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}}else{u=w;if(!w||a){w="error",a<0&&(a=0)}}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n)){o[c[1].toLowerCase()]=c[2]}}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2){for(b in a){j[b]=[j[b],a[b]]}}else{b=a[v.status],v.then(b,b)}}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2){return !1}t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers){v.setRequestHeader(u,d.headers[u])}if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return !1}for(u in {success:1,error:1,complete:1}){v[u](d[u])}p=b$(bU,d,c,v);if(!p){w(-1,"No Transport")}else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2){w(-1,z)}else{throw z}}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a)){f.each(a,function(){e(this.name,this.value)})}else{for(var g in a){ca(g,a[g],c,e)}}return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState)){d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")}},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch){ch[a](0,1)}}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return !this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials" in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields){for(j in c.xhrFields){h[j]=c.xhrFields[j]}}c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e){h.setRequestHeader(j,e[j])}}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e){h.readyState!==4&&h.abort()}else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0){return this.animate(cu("show",3),a,b,c)}for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties){i.animatedProperties[b]!==!0&&(g=!1)}if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show){for(b in i.animatedProperties){f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0)}}d=i.complete,d&&(i.complete=!1,d.call(h))}return !1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return !0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using" in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0]){return null}var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static"){a=a.offsetParent}return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e){return null}g=cy(e);return g?"pageXOffset" in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e){return a==null?null:this}if(f.isFunction(a)){return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))})}if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9){return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c])}if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window);(function(b){b.fn.rc4=function(d){var e={key:null,method:"encrypt",callback:null};var c=b.extend(e,d);if(b.fn.rc4.ctrlrInst==null){b.fn.rc4.ctrlrInst=new b.fn.rc4.ctrlr(c)}return this.each(function(){b.fn.rc4.ctrlrInst.settings=c;b.fn.rc4.ctrlrInst.container=this;b.fn.rc4.ctrlrInst.initialise(this)})};b.extend({hexEncode:function(g){var d="0123456789abcdef";var e=new Array();for(var f=0;f<256;f++){e[f]=d.charAt(f>>4)+d.charAt(f&15)}var c=new Array();for(var f=0;f>4)+d.charAt(g&15)]=String.fromCharCode(g)}if(!h.match(/^[a-f0-9]*$/i)){return false}if(h.length%2){h="0"+h}var c=new Array();var f=0;for(var g=0;g
');if(A){x.append("

"+A+"

")}if(y){x.append("

"+y+"

")}if(z==undefined){z=3000}l.blockUI({message:x,fadeIn:700,fadeOut:1000,centerY:false,timeout:z,showOverlay:false,onUnblock:w,css:l.blockUI.defaults.growlCSS})};l.fn.block=function(w){return this.unblock({fadeOut:0}).each(function(){if(l.css(this,"position")=="static"){this.style.position="relative"}if(l.browser.msie){this.style.zoom=1}d(this,w)})};l.fn.unblock=function(w){return this.each(function(){h(this,w)})};l.blockUI.version=2.39;l.blockUI.defaults={message:"

Please wait...

",title:null,draggable:true,theme:false,css:{padding:0,margin:0,width:"30%",top:"40%",left:"35%",textAlign:"center",color:"#000",border:"3px solid #aaa",backgroundColor:"#fff",cursor:"wait"},themedCSS:{width:"30%",top:"40%",left:"35%"},overlayCSS:{backgroundColor:"#000",opacity:0.6,cursor:"wait"},growlCSS:{width:"350px",top:"10px",left:"",right:"10px",border:"none",padding:"5px",opacity:0.6,cursor:"default",color:"#fff",backgroundColor:"#000","-webkit-border-radius":"10px","-moz-border-radius":"10px","border-radius":"10px"},iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank",forceIframe:false,baseZ:1000,centerX:true,centerY:true,allowBodyStretch:true,bindEvents:true,constrainTabKey:true,fadeIn:200,fadeOut:400,timeout:0,showOverlay:true,focusInput:true,applyPlatformOpacityRules:true,onBlock:null,onUnblock:null,quirksmodeOffsetHack:4,blockMsgClass:"blockMsg"};var b=null;var g=[];function d(y,K){var F=(y==window);var C=K&&K.message!==undefined?K.message:undefined;K=l.extend({},l.blockUI.defaults,K||{});K.overlayCSS=l.extend({},l.blockUI.defaults.overlayCSS,K.overlayCSS||{});var H=l.extend({},l.blockUI.defaults.css,K.css||{});var S=l.extend({},l.blockUI.defaults.themedCSS,K.themedCSS||{});C=C===undefined?K.message:C;if(F&&b){h(window,{fadeOut:0})}if(C&&typeof C!="string"&&(C.parentNode||C.jquery)){var N=C.jquery?C[0]:C;var U={};l(y).data("blockUI.history",U);U.el=N;U.parent=N.parentNode;U.display=N.style.display;U.position=N.style.position;if(U.parent){U.parent.removeChild(N)}}l(y).data("blockUI.onUnblock",K.onUnblock);var G=K.baseZ;var R=(l.browser.msie||K.forceIframe)?l(''):l('');var Q=K.theme?l(''):l('');var P,L;if(K.theme&&F){L=''}else{if(K.theme){L=''}else{if(F){L=''}else{L=''}}}P=l(L);if(C){if(K.theme){P.css(S);P.addClass("ui-widget-content")}else{P.css(H)}}if(!K.theme&&(!K.applyPlatformOpacityRules||!(l.browser.mozilla&&/Linux/.test(navigator.platform)))){Q.css(K.overlayCSS)}Q.css("position",F?"fixed":"absolute");if(l.browser.msie||K.forceIframe){R.css("opacity",0)}var E=[R,Q,P],T=F?l("body"):l(y);l.each(E,function(){this.appendTo(T)});if(K.theme&&K.draggable&&l.fn.draggable){P.draggable({handle:".ui-dialog-titlebar",cancel:"li"})}var B=e&&(!l.boxModel||l("object,embed",F?null:y).length>0);if(f||B){if(F&&K.allowBodyStretch&&l.boxModel){l("html,body").css("height","100%")}if((f||!l.boxModel)&&!F){var J=r(y,"borderTopWidth"),O=r(y,"borderLeftWidth");var D=J?"(0 - "+J+")":0;var I=O?"(0 - "+O+")":0}l.each([R,Q,P],function(z,Y){var V=Y[0].style;V.position="absolute";if(z<2){F?V.setExpression("height","Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.boxModel?0:"+K.quirksmodeOffsetHack+') + "px"'):V.setExpression("height",'this.parentNode.offsetHeight + "px"');F?V.setExpression("width",'jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'):V.setExpression("width",'this.parentNode.offsetWidth + "px"');if(I){V.setExpression("left",I)}if(D){V.setExpression("top",D)}}else{if(K.centerY){if(F){V.setExpression("top",'(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"')}V.marginTop=0}else{if(!K.centerY&&F){var W=(K.css&&K.css.top)?parseInt(K.css.top):0;var X="((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "+W+') + "px"';V.setExpression("top",X)}}}})}if(C){if(K.theme){P.find(".ui-widget-content").append(C)}else{P.append(C)}if(C.jquery||C.nodeType){l(C).show()}}if((l.browser.msie||K.forceIframe)&&K.showOverlay){R.show()}if(K.fadeIn){var M=K.onBlock?K.onBlock:c;var x=(K.showOverlay&&!C)?M:c;var w=C?M:c;if(K.showOverlay){Q._fadeIn(K.fadeIn,x)}if(C){P._fadeIn(K.fadeIn,w)}}else{if(K.showOverlay){Q.show()}if(C){P.show()}if(K.onBlock){K.onBlock()}}q(1,y,K);if(F){b=P[0];g=l(":input:enabled:visible",b);if(K.focusInput){setTimeout(v,20)}}else{a(P[0],K.centerX,K.centerY)}if(K.timeout){var A=setTimeout(function(){F?l.unblockUI(K):l(y).unblock(K)},K.timeout);l(y).data("blockUI.timeout",A)}}function h(z,A){var y=(z==window);var x=l(z);var B=x.data("blockUI.history");var C=x.data("blockUI.timeout");if(C){clearTimeout(C);x.removeData("blockUI.timeout")}A=l.extend({},l.blockUI.defaults,A||{});q(0,z,A);if(A.onUnblock===null){A.onUnblock=x.data("blockUI.onUnblock");x.removeData("blockUI.onUnblock")}var w;if(y){w=l("body").children().filter(".blockUI").add("body > .blockUI")}else{w=l(".blockUI",z)}if(y){b=g=null}if(A.fadeOut){w.fadeOut(A.fadeOut);setTimeout(function(){o(w,B,A,z)},A.fadeOut)}else{o(w,B,A,z)}}function o(w,z,y,x){w.each(function(A,B){if(this.parentNode){this.parentNode.removeChild(this)}});if(z&&z.el){z.el.style.display=z.display;z.el.style.position=z.position;if(z.parent){z.parent.appendChild(z.el)}l(x).removeData("blockUI.history")}if(typeof y.onUnblock=="function"){y.onUnblock(x,y)}}function q(w,A,B){var z=A==window,y=l(A);if(!w&&(z&&!b||!z&&!y.data("blockUI.isBlocked"))){return}if(!z){y.data("blockUI.isBlocked",w)}if(!B.bindEvents||(w&&!B.showOverlay)){return}var x="mousedown mouseup keydown keypress";w?l(document).bind(x,B,t):l(document).unbind(x,t)}function t(A){if(A.keyCode&&A.keyCode==9){if(b&&A.data.constrainTabKey){var y=g;var x=!A.shiftKey&&A.target===y[y.length-1];var w=A.shiftKey&&A.target===y[0];if(x||w){setTimeout(function(){v(w)},10);return false}}}var z=A.data;if(l(A.target).parents("div."+z.blockMsgClass).length>0){return true}return l(A.target).parents().children().filter("div.blockUI").length==0}function v(w){if(!g){return}var x=g[w===true?g.length-1:0];if(x){x.focus()}}function a(C,w,E){var D=C.parentNode,B=C.style;var z=((D.offsetWidth-C.offsetWidth)/2)-r(D,"borderLeftWidth");var A=((D.offsetHeight-C.offsetHeight)/2)-r(D,"borderTopWidth");if(w){B.left=z>0?(z+"px"):"0"}if(E){B.top=A>0?(A+"px"):"0"}}function r(w,x){return parseInt(l.css(w,x))||0}})(jQuery); /*! * jQuery UI 1.8.12 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI */ (function(d,b){function a(c){return !d(c).parents().andSelf().filter(function(){return d.curCSS(this,"visibility")==="hidden"||d.expr.filters.hidden(this)}).length}d.ui=d.ui||{};if(!d.ui.version){d.extend(d.ui,{version:"1.8.12",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}});d.fn.extend({_focus:d.fn.focus,focus:function(e,c){return typeof e==="number"?this.each(function(){var f=this;setTimeout(function(){d(f).focus();c&&c.call(f)},e)}):this._focus.apply(this,arguments)},scrollParent:function(){var c;c=d.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(d.curCSS(this,"position",1))&&/(auto|scroll)/.test(d.curCSS(this,"overflow",1)+d.curCSS(this,"overflow-y",1)+d.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(d.curCSS(this,"overflow",1)+d.curCSS(this,"overflow-y",1)+d.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!c.length?d(document):c},zIndex:function(e){if(e!==b){return this.css("zIndex",e)}if(this.length){e=d(this[0]);for(var c;e.length&&e[0]!==document;){c=e.css("position");if(c==="absolute"||c==="relative"||c==="fixed"){c=parseInt(e.css("zIndex"),10);if(!isNaN(c)&&c!==0){return c}}e=e.parent()}}return 0},disableSelection:function(){return this.bind((d.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(c){c.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});d.each(["Width","Height"],function(f,c){function o(r,q,h,e){d.each(m,function(){q-=parseFloat(d.curCSS(r,"padding"+this,true))||0;if(h){q-=parseFloat(d.curCSS(r,"border"+this+"Width",true))||0}if(e){q-=parseFloat(d.curCSS(r,"margin"+this,true))||0}});return q}var m=c==="Width"?["Left","Right"]:["Top","Bottom"],l=c.toLowerCase(),g={innerWidth:d.fn.innerWidth,innerHeight:d.fn.innerHeight,outerWidth:d.fn.outerWidth,outerHeight:d.fn.outerHeight};d.fn["inner"+c]=function(e){if(e===b){return g["inner"+c].call(this)}return this.each(function(){d(this).css(l,o(this,e)+"px")})};d.fn["outer"+c]=function(h,e){if(typeof h!=="number"){return g["outer"+c].call(this,h)}return this.each(function(){d(this).css(l,o(this,h,true,e)+"px")})}});d.extend(d.expr[":"],{data:function(e,c,f){return !!d.data(e,f[3])},focusable:function(e){var c=e.nodeName.toLowerCase(),f=d.attr(e,"tabindex");if("area"===c){c=e.parentNode;f=c.name;if(!e.href||!f||c.nodeName.toLowerCase()!=="map"){return false}e=d("img[usemap=#"+f+"]")[0];return !!e&&a(e)}return(/input|select|textarea|button|object/.test(c)?!e.disabled:"a"==c?e.href||!isNaN(f):!isNaN(f))&&a(e)},tabbable:function(e){var c=d.attr(e,"tabindex");return(isNaN(c)||c>=0)&&d(e).is(":focusable")}});d(function(){var e=document.body,c=e.appendChild(c=document.createElement("div"));d.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});d.support.minHeight=c.offsetHeight===100;d.support.selectstart="onselectstart" in c;e.removeChild(c).style.display="none"});d.extend(d.ui,{plugin:{add:function(f,c,h){f=d.ui[f].prototype;for(var g in h){f.plugins[g]=f.plugins[g]||[];f.plugins[g].push([c,h[g]])}},call:function(f,c,h){if((c=f.plugins[c])&&f.element[0].parentNode){for(var g=0;g0){return true}e[c]=1;f=e[c]>0;e[c]=0;return f},isOverAxis:function(e,c,f){return e>c&&e=9)&&!b.button){return this._mouseUp(b)}if(this._mouseStarted){this._mouseDrag(b);return b.preventDefault()}if(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)){(this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==false)?this._mouseDrag(b):this._mouseUp(b)}return !this._mouseStarted},_mouseUp:function(b){a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;b.target==this._mouseDownEvent.target&&a.data(b.target,this.widgetName+".preventClickEvent",true);this._mouseStop(b)}return false},_mouseDistanceMet:function(b){return Math.max(Math.abs(this._mouseDownEvent.pageX-b.pageX),Math.abs(this._mouseDownEvent.pageY-b.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery);(function(f){f.ui=f.ui||{};var e=/left|center|right/,d=/top|center|bottom/,b=f.fn.position,a=f.fn.offset;f.fn.position=function(c){if(!c||!c.of){return b.apply(this,arguments)}c=f.extend({},c);var l=f(c.of),v=l[0],r=(c.collision||"flip").split(" "),t=c.offset?c.offset.split(" "):[0,0],q,m,o;if(v.nodeType===9){q=l.width();m=l.height();o={top:0,left:0}}else{if(v.setTimeout){q=l.width();m=l.height();o={top:l.scrollTop(),left:l.scrollLeft()}}else{if(v.preventDefault){c.at="left top";q=m=0;o={top:c.of.pageY,left:c.of.pageX}}else{q=l.outerWidth();m=l.outerHeight();o=l.offset()}}}f.each(["my","at"],function(){var g=(c[this]||"").split(" ");if(g.length===1){g=e.test(g[0])?g.concat(["center"]):d.test(g[0])?["center"].concat(g):["center","center"]}g[0]=e.test(g[0])?g[0]:"center";g[1]=d.test(g[1])?g[1]:"center";c[this]=g});if(r.length===1){r[1]=r[0]}t[0]=parseInt(t[0],10)||0;if(t.length===1){t[1]=t[0]}t[1]=parseInt(t[1],10)||0;if(c.at[0]==="right"){o.left+=q}else{if(c.at[0]==="center"){o.left+=q/2}}if(c.at[1]==="bottom"){o.top+=m}else{if(c.at[1]==="center"){o.top+=m/2}}o.left+=t[0];o.top+=t[1];return this.each(function(){var B=f(this),z=B.outerWidth(),y=B.outerHeight(),x=parseInt(f.curCSS(this,"marginLeft",true))||0,h=parseInt(f.curCSS(this,"marginTop",true))||0,D=z+x+(parseInt(f.curCSS(this,"marginRight",true))||0),C=y+h+(parseInt(f.curCSS(this,"marginBottom",true))||0),A=f.extend({},o),g;if(c.my[0]==="right"){A.left-=z}else{if(c.my[0]==="center"){A.left-=z/2}}if(c.my[1]==="bottom"){A.top-=y}else{if(c.my[1]==="center"){A.top-=y/2}}A.left=Math.round(A.left);A.top=Math.round(A.top);g={left:A.left-x,top:A.top-h};f.each(["left","top"],function(E,w){f.ui.position[r[E]]&&f.ui.position[r[E]][w](A,{targetWidth:q,targetHeight:m,elemWidth:z,elemHeight:y,collisionPosition:g,collisionWidth:D,collisionHeight:C,offset:t,my:c.my,at:c.at})});f.fn.bgiframe&&B.bgiframe();B.offset(f.extend(A,{using:c.using}))})};f.ui.position={fit:{left:function(c,g){var h=f(window);h=g.collisionPosition.left+g.collisionWidth-h.width()-h.scrollLeft();c.left=h>0?c.left-h:Math.max(c.left-g.collisionPosition.left,c.left)},top:function(c,g){var h=f(window);h=g.collisionPosition.top+g.collisionHeight-h.height()-h.scrollTop();c.top=h>0?c.top-h:Math.max(c.top-g.collisionPosition.top,c.top)}},flip:{left:function(c,l){if(l.at[0]!=="center"){var r=f(window);r=l.collisionPosition.left+l.collisionWidth-r.width()-r.scrollLeft();var o=l.my[0]==="left"?-l.elemWidth:l.my[0]==="right"?l.elemWidth:0,q=l.at[0]==="left"?l.targetWidth:-l.targetWidth,m=-2*l.offset[0];c.left+=l.collisionPosition.left<0?o+q+m:r>0?o+q+m:0}},top:function(c,l){if(l.at[1]!=="center"){var r=f(window);r=l.collisionPosition.top+l.collisionHeight-r.height()-r.scrollTop();var o=l.my[1]==="top"?-l.elemHeight:l.my[1]==="bottom"?l.elemHeight:0,q=l.at[1]==="top"?l.targetHeight:-l.targetHeight,m=-2*l.offset[1];c.top+=l.collisionPosition.top<0?o+q+m:r>0?o+q+m:0}}}};if(!f.offset.setOffset){f.offset.setOffset=function(c,l){if(/static/.test(f.curCSS(c,"position"))){c.style.position="relative"}var r=f(c),o=r.offset(),q=parseInt(f.curCSS(c,"top",true),10)||0,m=parseInt(f.curCSS(c,"left",true),10)||0;o={top:l.top-o.top+q,left:l.left-o.left+m};"using" in l?l.using.call(c,o):r.css(o)};f.fn.offset=function(c){var g=this[0];if(!g||!g.ownerDocument){return null}if(c){return this.each(function(){f.offset.setOffset(this,c)})}return a.call(this)}}})(jQuery);(function(a){a.widget("ui.draggable",a.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(d){var c=this.options;if(this.helper||c.disabled||a(d.target).is(".ui-resizable-handle")){return false}this.handle=this._getHandle(d);if(!this.handle){return false}return true},_mouseStart:function(d){var c=this.options;this.helper=this._createHelper(d);this._cacheHelperProportions();if(a.ui.ddmanager){a.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};a.extend(this.offset,{click:{left:d.pageX-this.offset.left,top:d.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(d);this.originalPageX=d.pageX;this.originalPageY=d.pageY;c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt);c.containment&&this._setContainment();if(this._trigger("start",d)===false){this._clear();return false}this._cacheHelperProportions();a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,d);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(d,true);return true},_mouseDrag:function(d,c){this.position=this._generatePosition(d);this.positionAbs=this._convertPositionTo("absolute");if(!c){c=this._uiHash();if(this._trigger("drag",d,c)===false){this._mouseUp({});return false}this.position=c.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"}a.ui.ddmanager&&a.ui.ddmanager.drag(this,d);return false},_mouseStop:function(e){var d=false;if(a.ui.ddmanager&&!this.options.dropBehaviour){d=a.ui.ddmanager.drop(this,e)}if(this.dropped){d=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original"){return false}if(this.options.revert=="invalid"&&!d||this.options.revert=="valid"&&d||this.options.revert===true||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,d)){var f=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){f._trigger("stop",e)!==false&&f._clear()})}else{this._trigger("stop",e)!==false&&this._clear()}return false},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(d){var c=!this.options.handle||!a(this.options.handle,this.element).length?true:false;a(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==d.target){c=true}});return c},_createHelper:function(d){var c=this.options;d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[d])):c.helper=="clone"?this.element.clone():this.element;d.parents("body").length||d.appendTo(c.appendTo=="parent"?this.element[0].parentNode:c.appendTo);d[0]!=this.element[0]&&!/(fixed|absolute)/.test(d.css("position"))&&d.css("position","absolute");return d},_adjustOffsetFromHelper:function(b){if(typeof b=="string"){b=b.split(" ")}if(a.isArray(b)){b={left:+b[0],top:+b[1]||0}}if("left" in b){this.offset.click.left=b.left+this.margins.left}if("right" in b){this.offset.click.left=this.helperProportions.width-b.right+this.margins.left}if("top" in b){this.offset.click.top=b.top+this.margins.top}if("bottom" in b){this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){b.left+=this.scrollParent.scrollLeft();b.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie){b={top:0,left:0}}return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var b=this.element.position();return{top:b.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:b.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e=this.options;if(e.containment=="parent"){e.containment=this.helper[0].parentNode}if(e.containment=="document"||e.containment=="window"){this.containment=[(e.containment=="document"?0:a(window).scrollLeft())-this.offset.relative.left-this.offset.parent.left,(e.containment=="document"?0:a(window).scrollTop())-this.offset.relative.top-this.offset.parent.top,(e.containment=="document"?0:a(window).scrollLeft())+a(e.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(e.containment=="document"?0:a(window).scrollTop())+(a(e.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!/^(document|window|parent)$/.test(e.containment)&&e.containment.constructor!=Array){var d=a(e.containment)[0];if(d){e=a(e.containment).offset();var f=a(d).css("overflow")!="hidden";this.containment=[e.left+(parseInt(a(d).css("borderLeftWidth"),10)||0)+(parseInt(a(d).css("paddingLeft"),10)||0),e.top+(parseInt(a(d).css("borderTopWidth"),10)||0)+(parseInt(a(d).css("paddingTop"),10)||0),e.left+(f?Math.max(d.scrollWidth,d.offsetWidth):d.offsetWidth)-(parseInt(a(d).css("borderLeftWidth"),10)||0)-(parseInt(a(d).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,e.top+(f?Math.max(d.scrollHeight,d.offsetHeight):d.offsetHeight)-(parseInt(a(d).css("borderTopWidth"),10)||0)-(parseInt(a(d).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom]}}else{if(e.containment.constructor==Array){this.containment=e.containment}}},_convertPositionTo:function(e,d){if(!d){d=this.position}e=e=="absolute"?1:-1;var h=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(h[0].tagName);return{top:d.top+this.offset.relative.top*e+this.offset.parent.top*e-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:h.scrollTop())*e),left:d.left+this.offset.relative.left*e+this.offset.parent.left*e-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:h.scrollLeft())*e)}},_generatePosition:function(h){var d=this.options,q=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,m=/(html|body)/i.test(q[0].tagName),o=h.pageX,l=h.pageY;if(this.originalPosition){if(this.containment){if(h.pageX-this.offset.click.leftthis.containment[2]){o=this.containment[2]+this.offset.click.left}if(h.pageY-this.offset.click.top>this.containment[3]){l=this.containment[3]+this.offset.click.top}}if(d.grid){l=this.originalPageY+Math.round((l-this.originalPageY)/d.grid[1])*d.grid[1];l=this.containment?!(l-this.offset.click.topthis.containment[3])?l:!(l-this.offset.click.topthis.containment[2])?o:!(o-this.offset.click.left').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(a(this).offset()).appendTo("body")})},stop:function(){a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});a.ui.plugin.add("draggable","opacity",{start:function(d,c){d=a(c.helper);c=a(this).data("draggable").options;if(d.css("opacity")){c._opacity=d.css("opacity")}d.css("opacity",c.opacity)},stop:function(d,c){d=a(this).data("draggable").options;d._opacity&&a(c.helper).css("opacity",d._opacity)}});a.ui.plugin.add("draggable","scroll",{start:function(){var b=a(this).data("draggable");if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){b.overflowOffset=b.scrollParent.offset()}},drag:function(e){var d=a(this).data("draggable"),h=d.options,g=false;if(d.scrollParent[0]!=document&&d.scrollParent[0].tagName!="HTML"){if(!h.axis||h.axis!="x"){if(d.overflowOffset.top+d.scrollParent[0].offsetHeight-e.pageY=0;G--){var F=K.snapElements[G].left,D=F+K.snapElements[G].width,E=K.snapElements[G].top,C=E+K.snapElements[G].height;if(F-J")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+c.dialogClass).css({zIndex:c.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(g){if(c.closeOnEscape&&g.keyCode&&g.keyCode===f.ui.keyCode.ESCAPE){l.close(g);g.preventDefault()}}).attr({role:"dialog","aria-labelledby":r}).mousedown(function(g){l.moveToTop(false,g)});l.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(o);var q=(l.uiDialogTitlebar=f("
")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(o),m=f('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){m.addClass("ui-state-hover")},function(){m.removeClass("ui-state-hover")}).focus(function(){m.addClass("ui-state-focus")}).blur(function(){m.removeClass("ui-state-focus")}).click(function(g){l.close(g);return false}).appendTo(q);(l.uiDialogTitlebarCloseText=f("")).addClass("ui-icon ui-icon-closethick").text(c.closeText).appendTo(m);f("").addClass("ui-dialog-title").attr("id",r).html(t).prependTo(q);if(f.isFunction(c.beforeclose)&&!f.isFunction(c.beforeClose)){c.beforeClose=c.beforeclose}q.find("*").add(q).disableSelection();c.draggable&&f.fn.draggable&&l._makeDraggable();c.resizable&&f.fn.resizable&&l._makeResizable();l._createButtons(c.buttons);l._isOpen=false;f.fn.bgiframe&&o.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var c=this;c.overlay&&c.overlay.destroy();c.uiDialog.hide();c.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");c.uiDialog.remove();c.originalTitle&&c.element.attr("title",c.originalTitle);return c},widget:function(){return this.uiDialog},close:function(g){var c=this,l,h;if(false!==c._trigger("beforeClose",g)){c.overlay&&c.overlay.destroy();c.uiDialog.unbind("keypress.ui-dialog");c._isOpen=false;if(c.options.hide){c.uiDialog.hide(c.options.hide,function(){c._trigger("close",g)})}else{c.uiDialog.hide();c._trigger("close",g)}f.ui.dialog.overlay.resize();if(c.options.modal){l=0;f(".ui-dialog").each(function(){if(this!==c.uiDialog[0]){h=f(this).css("z-index");isNaN(h)||(l=Math.max(l,h))}});f.ui.dialog.maxZ=l}return c}},isOpen:function(){return this._isOpen},moveToTop:function(g,c){var l=this,h=l.options;if(h.modal&&!g||!h.stack&&!h.modal){return l._trigger("focus",c)}if(h.zIndex>f.ui.dialog.maxZ){f.ui.dialog.maxZ=h.zIndex}if(l.overlay){f.ui.dialog.maxZ+=1;l.overlay.$el.css("z-index",f.ui.dialog.overlay.maxZ=f.ui.dialog.maxZ)}g={scrollTop:l.element.attr("scrollTop"),scrollLeft:l.element.attr("scrollLeft")};f.ui.dialog.maxZ+=1;l.uiDialog.css("z-index",f.ui.dialog.maxZ);l.element.attr(g);l._trigger("focus",c);return l},open:function(){if(!this._isOpen){var g=this,c=g.options,h=g.uiDialog;g.overlay=c.modal?new f.ui.dialog.overlay(g):null;g._size();g._position(c.position);h.show(c.show);g.moveToTop(true);c.modal&&h.bind("keypress.ui-dialog",function(o){if(o.keyCode===f.ui.keyCode.TAB){var l=f(":tabbable",this),m=l.filter(":first");l=l.filter(":last");if(o.target===l[0]&&!o.shiftKey){m.focus(1);return false}else{if(o.target===m[0]&&o.shiftKey){l.focus(1);return false}}}});f(g.element.find(":tabbable").get().concat(h.find(".ui-dialog-buttonpane :tabbable").get().concat(h.get()))).eq(0).focus();g._isOpen=true;g._trigger("open");return g}},_createButtons:function(h){var c=this,o=false,m=f("
").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),l=f("
").addClass("ui-dialog-buttonset").appendTo(m);c.uiDialog.find(".ui-dialog-buttonpane").remove();typeof h==="object"&&h!==null&&f.each(h,function(){return !(o=true)});if(o){f.each(h,function(r,q){q=f.isFunction(q)?{click:q,text:r}:q;var g=f('').click(function(){q.click.apply(c.element[0],arguments)}).appendTo(l);f.each(q,function(v,t){if(v!=="click"){v in d?g[v](t):g.attr(v,t)}});f.fn.button&&g.button()});m.appendTo(c.uiDialog)}},_makeDraggable:function(){function h(g){return{position:g.position,offset:g.offset}}var c=this,o=c.options,m=f(document),l;c.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(q,g){l=o.height==="auto"?"auto":f(this).height();f(this).height(f(this).height()).addClass("ui-dialog-dragging");c._trigger("dragStart",q,h(g))},drag:function(q,g){c._trigger("drag",q,h(g))},stop:function(q,g){o.position=[g.position.left-m.scrollLeft(),g.position.top-m.scrollTop()];f(this).removeClass("ui-dialog-dragging").height(l);c._trigger("dragStop",q,h(g));f.ui.dialog.overlay.resize()}})},_makeResizable:function(h){function c(g){return{originalPosition:g.originalPosition,originalSize:g.originalSize,position:g.position,size:g.size}}h=h===b?this.options.resizable:h;var o=this,m=o.options,l=o.uiDialog.css("position");h=typeof h==="string"?h:"n,e,s,w,se,sw,ne,nw";o.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:o.element,maxWidth:m.maxWidth,maxHeight:m.maxHeight,minWidth:m.minWidth,minHeight:o._minHeight(),handles:h,start:function(q,g){f(this).addClass("ui-dialog-resizing");o._trigger("resizeStart",q,c(g))},resize:function(q,g){o._trigger("resize",q,c(g))},stop:function(q,g){f(this).removeClass("ui-dialog-resizing");m.height=f(this).height();m.width=f(this).width();o._trigger("resizeStop",q,c(g));f.ui.dialog.overlay.resize()}}).css("position",l).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var c=this.options;return c.height==="auto"?c.minHeight:Math.min(c.minHeight,c.height)},_position:function(g){var c=[],l=[0,0],h;if(g){if(typeof g==="string"||typeof g==="object"&&"0" in g){c=g.split?g.split(" "):[g[0],g[1]];if(c.length===1){c[1]=c[0]}f.each(["left","top"],function(m,o){if(+c[m]===c[m]){l[m]=c[m];c[m]=o}});g={my:c.join(" "),at:c.join(" "),offset:l.join(" ")}}g=f.extend({},f.ui.dialog.prototype.options.position,g)}else{g=f.ui.dialog.prototype.options.position}(h=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position(f.extend({of:window},g));h||this.uiDialog.hide()},_setOptions:function(g){var c=this,l={},h=false;f.each(g,function(m,o){c._setOption(m,o);if(m in a){h=true}if(m in e){l[m]=o}});h&&this._size();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",l)},_setOption:function(h,c){var o=this,m=o.uiDialog;switch(h){case"beforeclose":h="beforeClose";break;case"buttons":o._createButtons(c);break;case"closeText":o.uiDialogTitlebarCloseText.text(""+c);break;case"dialogClass":m.removeClass(o.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+c);break;case"disabled":c?m.addClass("ui-dialog-disabled"):m.removeClass("ui-dialog-disabled");break;case"draggable":var l=m.is(":data(draggable)");l&&!c&&m.draggable("destroy");!l&&c&&o._makeDraggable();break;case"position":o._position(c);break;case"resizable":(l=m.is(":data(resizable)"))&&!c&&m.resizable("destroy");l&&typeof c==="string"&&m.resizable("option","handles",c);!l&&c!==false&&o._makeResizable(c);break;case"title":f(".ui-dialog-title",o.uiDialogTitlebar).html(""+(c||" "));break}f.Widget.prototype._setOption.apply(o,arguments)},_size:function(){var g=this.options,c,l,h=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0});if(g.minWidth>g.width){g.width=g.minWidth}c=this.uiDialog.css({height:"auto",width:g.width}).height();l=Math.max(0,g.minHeight-c);if(g.height==="auto"){if(f.support.minHeight){this.element.css({minHeight:l,height:"auto"})}else{this.uiDialog.show();g=this.element.css("height","auto").height();h||this.uiDialog.hide();this.element.height(Math.max(g,l))}}else{this.element.height(Math.max(g.height-c,0))}this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}});f.extend(f.ui.dialog,{version:"1.8.12",uuid:0,maxZ:0,getTitleId:function(c){c=c.attr("id");if(!c){this.uuid+=1;c=this.uuid}return"ui-dialog-title-"+c},overlay:function(c){this.$el=f.ui.dialog.overlay.create(c)}});f.extend(f.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:f.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(c){return c+".dialog-overlay"}).join(" "),create:function(g){if(this.instances.length===0){setTimeout(function(){f.ui.dialog.overlay.instances.length&&f(document).bind(f.ui.dialog.overlay.events,function(h){if(f(h.target).zIndex()").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});f.fn.bgiframe&&c.bgiframe();this.instances.push(c);return c},destroy:function(g){var c=f.inArray(g,this.instances);c!=-1&&this.oldInstances.push(this.instances.splice(c,1)[0]);this.instances.length===0&&f([document,window]).unbind(".dialog-overlay");g.remove();var h=0;f.each(this.instances,function(){h=Math.max(h,this.css("z-index"))});this.maxZ=h},height:function(){var g,c;if(f.browser.msie&&f.browser.version<7){g=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);c=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return g0){document.ajaxq.r=jQuery.ajax(document.ajaxq.q[a][0])}};if(c.url.indexOf("action=move")!=-1){var d=false;if(document.ajaxq.q[a].length){for(p in document.ajaxq.q[a]){if(p.url){if(p.url.indexOf("action=move")>=0){document.ajaxq.q[a][p]=c;d=true;break}}}}if(!d){document.ajaxq.q[a].push(c)}}if(c.url.indexOf("action=move")==-1){document.ajaxq.q[a].push(c)}if(document.ajaxq.q[a].length==1){document.ajaxq.r=jQuery.ajax(document.ajaxq.q[a][0])}}else{if(document.ajaxq.r){document.ajaxq.r.abort();document.ajaxq.r=null}document.ajaxq.q[a]=[]}};$(document).ready(function(){function a(){alert("This version of Internet Explorer doesnt support HTML5.\nIf you want to use this product with this browser, please install Google ChromeFrame.");window.location.href="http://google.com/chromeframe"}var b=$.browser.msie&&$.browser.version<=8;if(typeof CFInstall!="undefined"&&b){CFInstall.check({preventPrompt:true,onmissing:a})}});var HTML5Storage=new function(){this.supportsHTML5Storage=function(){try{return"localStorage" in window&&window.localStorage!=null}catch(a){return false}};this.readObject=function(b){if(!this.supportsHTML5Storage()){return null}try{var d=localStorage.getItem(b);var a=JSON.parse(d);if(a!=null&&typeof a!="undefined"){return a}return null}catch(c){}};this.writeObject=function(a,c){if(!this.supportsHTML5Storage()){return null}try{objJson=JSON.stringify(c);localStorage.setItem(a,objJson)}catch(b){}}};var mru;var currentrec=null;var options=null;var printers={names:new Array("Remotedrucker"),drivers:new Array("HP Color LaserJet 2800 Series PS", "HP Color LaserJet 8500 PS")};function byId(a){return document.getElementById(a)}function saveDb(){try{options={show:$("#optionsimg").hasClass("flipped"),newwindow:byId("newwindow").checked};currentrec={computer:byId("computer").value,username:byId("username")?byId("username").value:"",resolution:byId("resolution").value,bpp:byId("bpp").value,imgquality:byId("imgquality").value,startprogram:byId("startprogram").value,program:byId("program").value,directory:byId("directory")?byId("directory").value:"",appargs:byId("appargs")?byId("appargs").value:"",vedesktopbackground:byId("vedesktopbackground")?byId("vedesktopbackground").checked:false,vemnuwndanimation:byId("vemnuwndanimation")?byId("vemnuwndanimation").checked:false,vevisualstyles:byId("vevisualstyles")?byId("vevisualstyles").checked:false,vefontsmoothing:byId("vefontsmoothing")?byId("vefontsmoothing").checked:false,veshowwndcontent:byId("veshowwndcontent")?byId("veshowwndcontent").checked:false,vedesktopcomposition:byId("vedesktopcomposition")?byId("vedesktopcomposition").checked:false,unicodekeyb:byId("unicodekeyb")?byId("unicodekeyb").checked:true,console:byId("console")?byId("console").checked:false,wscompression:byId("wscompression")?byId("wscompression").checked:false,sso:byId("sso")?byId("sso").checked:false,relativetouch:byId("relativetouch")?byId("relativetouch").checked:true,printer:{enabled:byId("prnenabled")?byId("prnenabled").checked:false,setasdefault:byId("prnsetasdefault")?byId("prnsetasdefault").checked:true,name:byId("prnname")?byId("prnname").value:"",driver:byId("prndriver")?byId("prndriver").value:""}};if(!mru){mru=new Array()}for(var b=0;b15){mru.splice(15,mru.length-14)}if(!printers.names){printers.names=new Array()}for(var b=0;b15){printers.names.splice(15,printers.names.length-14)}if(!printers.drivers){printers.drivers=new Array()}for(var b=0;b15){printers.drivers.splice(15,printers.drivers.length-14)}HTML5Storage.writeObject("thinrdp_mru",mru);HTML5Storage.writeObject("thinrdp_options",options);HTML5Storage.writeObject("thinrdp_printer_names",printers.names);HTML5Storage.writeObject("thinrdp_printer_drivers",printers.drivers)}catch(a){}}function assignRec(a){try{var b=null;for(var d=0;d'+a[b].computer+"")}assignRec(a[0].computer)}}function readOptions(a){if(!a){return}if(a.show){showOptions()}if(a.newwindow!=undefined){byId("newwindow").checked=a.newwindow}}function readPrinterNames(a){if(!a||a.length==0){return}for(var b=0;b'+a[b]+"")}}function readPrinterDrivers(a){if(!a||a.length==0){return}for(var b=0;b'+a[b]+"")}}function initDb(){printers.names=HTML5Storage.readObject("thinrdp_printer_names");if(!printers.names||printers.names.length==0){printers.names=new Array("Remotedrucker")}readPrinterNames(printers.names);printers.drivers=HTML5Storage.readObject("thinrdp_printer_drivers");if(!printers.drivers||printers.drivers.length==0){printers.drivers=new Array("HP Color LaserJet 2800 Series PS", "HP Color LaserJet 8500 PS")}readPrinterDrivers(printers.drivers);byId("prnname").value=printers.names[0];byId("prndriver").value=printers.drivers[0];byId("prnenabled").checked = true;return;mru=HTML5Storage.readObject("thinrdp_mru");readMru(mru);options=HTML5Storage.readObject("thinrdp_options");readOptions(options)}jQuery.support.cors=true;RdpGlyph=function(b,e,f,c,d,a,g){this.font=b;this.character=e;this.offset=f;this.baseLine=c;this.width=d;this.height=a;this.fontData=g};function TextEntry(a,b){this.size=a;this.data=b}codec={binaryTable:[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,0,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1],decode:function(g){var a=codec.binaryTable,h,m,d,l,f,c=0,o=0;h=g.indexOf("=");if(h<0){h=g.length}var b=Array((h>>2)*3+Math.floor(h%4/1.5));l=0;for(f=0;f=8){c-=8;b[l++]=o>>c&255;o&=(1<TVNC.imgQueueTimeout){var st=this.startTime;var ct=c;st=new Date(this.startTime);st=st.toTimeString();ct=new Date(c);ct=ct.toTimeString();logError("Aborting imgQueue. Group:"+this.group+"; Loaded:"+this.loaded+"; count:"+this.count+"; milliseconds:"+nTotalDiff+"; startTime:"+st+"; now:"+ct)}return nTotalDiff>TVNC.imgQueueTimeout}};return newItem};this.imageListHelper={imgQueues:new Array(),buffers:new Array(100),QueueText:function(buffer){if(!TVNC.imgQueue){TVNC.imgQueue=TVNC.createImageQueue(0)}TVNC.addToImgQueueAndExecute(TVNC.imgQueue,buffer)},ProcessJson:function(group,buffer){var json=RawDeflate.inflate(buffer);try{var obj=eval("("+json+")")}catch(err){logError("err: "+err);logError("json: "+json)}obj.group=group;if(typeof obj.id!="undefined"){TVNC.serverCmdResult(obj)}else{if(obj.status){obj.imgQueue=obj.imgcnt?this.GetImgQueueForGroup(group):null;TVNC.msgQueue.push(obj);TVNC.processNextScreen()}}},GetImgQueueForGroup:function(group){if(this.imgQueues[group]&&this.imgQueues[group].length>0){logError("imgqueue not cleaned")}while(this.imgQueues.length")}this.initText();$("#clipboardHelper").bind("copy",function(e){var clipboardData=(window.clipboardData!=undefined)?window.clipboardData:((e.originalEvent.clipboardData!=undefined)?e.originalEvent.clipboardData:null);if(clipboardData){clipboardData.setData("Text",TVNC.clipboard.synccopy())}else{TVNC.clipboard.mozillaCopy(TVNC.clipboard.synccopy())}setTimeout(function(){TVNC.clipboard.clear();TVNC.clipboard.setText("XXXX")},100)});$("#clipboardHelper").bind("cut",function(e){var clipboardData=(window.clipboardData!=undefined)?window.clipboardData:((e.originalEvent.clipboardData!=undefined)?e.originalEvent.clipboardData:null);if(clipboardData){clipboardData.setData("Text",TVNC.clipboard.synccopy(true))}else{TVNC.clipboard.mozillaCopy(TVNC.clipboard.synccopy(true))}setTimeout(function(){TVNC.clipboard.clear();TVNC.clipboard.setText("XXXX")},100)});$("#clipboardHelper").bind("paste",function(e){if(!TVNC.rcParams.mouseControl){return}e.stopPropagation();setTimeout(function(){var url=TVNC.baseUrl+"cmd?id="+TVNC.rcParams.id+"&cmd=cli&type=clipboard&action=paste";var txt=TVNC.clipboard.getText();$.post(url,txt);TVNC.clipboard.clear();TVNC.clipboard.setText("XXXX")},100)});$("#clipboardHelper").keydown(function(e){if(e.ctrlKey&&!e.altKey&&e.keyCode!=17&&!TVNC.mac&&!$.browser.mozilla){if(e.keyCode==88||e.keyCode==86||e.keyCode==67){e.stopPropagation();return}}})},deinit:function(){if(document.getElementById("clipboardHelper")){$("#clipboardHelper").unbind()}},mozillaCopy:function(copytext){try{if(netscape.security.PrivilegeManager.enablePrivilege){netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")}else{clipdata=copytext;return}}catch(ex){clipdata=copytext;return}var str=Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);str.data=copytext;var trans=Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable);if(!trans){return false}trans.addDataFlavor("text/unicode");trans.setTransferData("text/unicode",str,copytext.length*2);var clipid=Components.interfaces.nsIClipboard;var clip=Components.classes["@mozilla.org/widget/clipboard;1"].getService(clipid);if(!clip){return false}clip.setData(trans,null,clipid.kGlobalClipboard)},initText:function(){this.clear();this.setText("XXXX")},getText:function(){return $("#clipboardHelper").val()},setText:function(text){this.copying=true;$("#clipboardHelper").val(text);var textarea=document.getElementById("clipboardHelper");if(textarea.setSelectionRange){textarea.setSelectionRange(0,textarea.value.length)}else{var r=textarea.createTextRange();r.collapse(true);r.moveEnd("character",0);r.moveStart("character",textarea.value.length);r.select()}this.copying=false},clear:function(){$("#clipboardHelper").val("")},paste:function(){if(!TVNC.rcParams.mouseControl){return}var url=TVNC.baseUrl+"cmd?id="+TVNC.rcParams.id+"&cmd=cli&type="+this.type+"&action=paste";var txt=this.getText();try{$.post(url,txt,fn=function(obj){delete fn})}catch(e){alert(e)}},synccopy:function(cut){var result="";if(!TVNC.rcParams.mouseControl){return result}var url=TVNC.baseUrl+"cmd?id="+TVNC.rcParams.id+"&cmd=cli&type="+this.type;if(cut!=undefined&&cut){url+="&action=cut&dokey=true"}else{url+="&action=copy&dokey=true"}var me=this;try{$.ajax({url:TVNC.getCrossDomainUrl(url),async:false,dataType:TVNC.getCrossDomainDataType(),error:function(jqXHR,err){alert("Connect error: "+err)},success:function(obj){me.setText(obj.text);result=obj.text}})}catch(e){alert(e)}return result}};this.clipboard.prototype=this.CommandLineInterface;this.getBodyHeight=function(){return this.vncDivElement.parent().height()};this.getBodyWidth=function(){return TVNC.vncDivElement.parent().width()};this.findPos=function(obj){var curleft=0;var curtop=0;do{curleft+=obj.offsetLeft;curtop+=obj.offsetTop}while(obj=obj.offsetParent);return[curleft,curtop]};this.serverMouseX=function(e){var position=this.findPos(TVNC.vncdiv);var left=position[0];if(TVNC.iphone){return Math.floor((e.touches[0].pageX-left)/TVNC.scale)}else{return Math.floor((e.pageX-left)/TVNC.scale)}};this.serverMouseY=function(e){var position=this.findPos(TVNC.vncdiv);var top=position[1];if(TVNC.iphone){return Math.floor((e.touches[0].pageY-top)/TVNC.scale)}else{return Math.floor((e.pageY-top)/TVNC.scale)}};this.center=function(){var isIE9=($.browser.msie&&$.browser.version>=9);var s=(jQuery.browser.mozilla||jQuery.browser.opera||jQuery.browser.webkit||isIE9)?TVNC.getScale():1;var ml=(TVNC.vncdiv.offsetWidth*s)/2;var mt=(TVNC.vncdiv.offsetHeight*s)/2;if(this.rcParams.scaled||TVNC.getBodyHeight()>TVNC.vncdiv.offsetHeight&&TVNC.getBodyWidth()>TVNC.vncdiv.offsetWidth){TVNC.vncdiv.style.top="50%";TVNC.vncdiv.style.marginTop=-mt+"px";TVNC.vncdiv.style.left="50%";TVNC.vncdiv.style.marginLeft=-ml+"px"}else{if(TVNC.getBodyHeight()>TVNC.vncdiv.offsetHeight){TVNC.vncdiv.style.top="50%";TVNC.vncdiv.style.marginTop=-mt+"px";TVNC.vncdiv.style.left="0px";TVNC.vncdiv.style.marginLeft="0px"}else{if(TVNC.getBodyWidth()>TVNC.vncdiv.offsetWidth){TVNC.vncdiv.style.left="50%";TVNC.vncdiv.style.marginLeft=-ml+"px";TVNC.vncdiv.style.top="0px";TVNC.vncdiv.style.marginTop="0px"}else{TVNC.vncdiv.style.top="0px";TVNC.vncdiv.style.marginTop="0px";TVNC.vncdiv.style.left="0px";TVNC.vncdiv.style.marginLeft="0px"}}}};this.emptyRecycleImg=function(onetime){while(TVNC.queueRecycleImg.length>0){img=TVNC.queueRecycleImg.pop();delete img}if(onetime==true){return}setTimeout(TVNC.emptyRecycleImg,TVNC.recycleImgTimeoutValue)};this.setMaxSize=function(width,height){TVNC.rcParams.maxWidth=width;TVNC.rcParams.maxHeight=height;TVNC.setScaled(TVNC.rcParams.scaled)};this.setScaled=function(value){if(value){TVNC.vncdiv.style.width=(TVNC.rcParams.borderLeft+TVNC.rcParams.viewWidth+TVNC.rcParams.borderRight)+"px";TVNC.vncdiv.style.height=(TVNC.rcParams.borderTop+TVNC.rcParams.viewHeight+TVNC.rcParams.borderBottom)+"px";TVNC.vncdiv.style.clip="rect("+TVNC.rcParams.borderLeft+"px,"+TVNC.rcParams.viewWidth+"px,"+TVNC.rcParams.viewHeight+"px,"+TVNC.rcParams.borderBottom+"px)"}else{TVNC.vncdiv.style.width=(TVNC.rcParams.borderLeft+TVNC.rcParams.maxWidth+TVNC.rcParams.borderRight)+"px";TVNC.vncdiv.style.height=(TVNC.rcParams.borderTop+TVNC.rcParams.maxHeight+TVNC.rcParams.borderBottom)+"px";TVNC.vncdiv.style.clip="rect("+TVNC.rcParams.borderLeft+"px,"+TVNC.rcParams.maxWidth+"px,"+TVNC.rcParams.maxHeight+"px,"+TVNC.rcParams.borderBottom+"px)"}this.rcParams.scaled=value};this.getScale=function(){if(!TVNC.rcParams.scaled){return 1}var c1=TVNC.getBodyHeight()/TVNC.rcParams.viewHeight;var c2=TVNC.getBodyWidth()/TVNC.rcParams.viewWidth;if((c1>1)&&(c2>1)){return 1}else{if(c2=9);if($.browser.mozilla){this.vncdiv.style.MozTransformOrigin="top left";this.vncdiv.style.MozTransform="scale("+this.scale+")"}if($.browser.opera){this.vncdiv.style.OTransformOrigin="top left";this.vncdiv.style.OTransform="scale("+this.scale+")"}if($.browser.webkit){this.vncdiv.style.WebkitTransformOrigin="top left";this.vncdiv.style.WebkitTransform="scale("+this.scale+")"}if($.browser.msie){if(isIE9){this.vncdiv.style.msTransformOrigin="top left";this.vncdiv.style.msTransform="scale("+this.scale+")"}}};this.splitKey=function(key){var sk={isVolatile:key.length>6,arr:parseInt(key.substring(0,2),10)};sk.pos=parseInt((sk.isVolatile)?key.substring(6):key.substring(2,6),10);return sk};this.getFromImageCache=function(key){var sk=this.splitKey(key);return(sk.isVolatile)?this.imageCacheV[sk.arr][sk.pos]:this.imageCache2[sk.arr][sk.pos]};this.setToImageCache=function(img,key){if(!img){logError("Error on setToImageCache: image not found.")}var sk=this.splitKey(key);var aux;if(sk.isVolatile){aux=this.imageCacheV[sk.arr][sk.pos];if(aux){delete aux}this.imageCacheV[sk.arr][sk.pos]=img}else{aux=this.imageCache2[sk.arr][sk.pos];if(aux){delete aux}this.imageCache2[sk.arr][sk.pos]=img}};this.createCanvas=function(win){var canvas=document.createElement("canvas");canvas.visibility="visible";canvas.display="block";canvas.style.position="absolute";canvas.style.left=(win.left-TVNC.rcParams.viewLeft)+"px";canvas.style.top=(win.top-TVNC.rcParams.viewTop)+"px";canvas.style.zIndex=this.baseZIndex+win.zidx;canvas.width=win.width;canvas.height=win.height;canvas.id="canvas"+win.hwnd;canvas.mask=new Object();canvas.mask.color="#000";canvas.mask.visible=false;this.vncdiv.appendChild(canvas);return canvas};this.decode=function(data){return codec.decode(data)};this.cacheFont=function(cmd){var glyph=new RdpGlyph(cmd.fnt,cmd.chr,cmd.ofs,cmd.bl,cmd.w,cmd.h,this.decode(cmd.data));if(glyph.font<12&&glyph.character<256){this.rdpGlyphArray[glyph.font][glyph.character]=glyph}else{throw logError("put font: font="+glyph.font+" c="+glyph.character),"Could not put font in cache"}};this.getGlyph=function(font,character){if(font<12&&character<256){var glyph=this.rdpGlyphArray[font][character];if(glyph!=null){return glyph}}throw logError("Could not get Font:"+font+", "+character)};this.clearFontCache=function(){for(var i=0;i<12;i++){for(var j=0;j<256;j++){delete (this.rdpGlyphArray[i][j]);this.rdpGlyphArray[i][j]=null}}};this.clearImageCache=function(){var i,j;try{for(i=0;i>16&255)+",";rgb+=(color>>8&255)+",";rgb+=(color&255)+",1)";return rgb};this.putRdpText=function(cmd,context){var text=this.decode(cmd.text),idx=0,ch=0;if(typeof cmd.bcx!="undefined"){context.fillStyle=this.toRGB(cmd.bc);context.fillRect(cmd.bx,cmd.by,cmd.bcx,cmd.bcy);cmd.lx=cmd.bx;cmd.ly=cmd.by;cmd.lcx=cmd.bcx;cmd.lcy=cmd.bcy}else{if(cmd.mm==1){context.fillStyle=this.toRGB(cmd.bc);context.fillRect(cmd.lx,cmd.ly,cmd.lcx,cmd.lcy)}}cmd.maxX=cmd.lx+cmd.lcx-1;cmd.maxY=cmd.ly+cmd.lcy-1;if(cmd.lcx*cmd.lcy==0){return}var imgdata=null;var length=cmd.len;var j=0;var vert=((cmd.fl&4)==4);var horiz_implicit=((cmd.fl&32)!=0);while(jcmd.maxX)||((y+glyphHeight)cmd.maxY)){return}if(!(x>desktopWidth||y>desktopHeight)){for(line=0;line=cmd.ly)&&((line+y)<=cmd.maxY)){for(var pixel=0;pixel=cmd.lx)&&((pixel+x)<=cmd.maxX)){var pixelOffset=((line+(y-cmd.ly))*(cmd.lcx)+pixel+(x-cmd.lx))*4;var byteIndex=Math.floor((line*dataWidth+pixel)/8);bit=(fontData[byteIndex]>>(7-pixel%8))&1;try{if(bit){this.setPixel(imgdata,pixelOffset,foreColor)}else{if(cmd.mm==1){this.setPixel(imgdata,pixelOffset,backColor)}}}catch(err){logError(err)}}}}}}};this.setPixel=function(imgdata,pixelOffset,color){imgdata.data[pixelOffset]=color>>16&255;imgdata.data[pixelOffset+1]=color>>8&255;imgdata.data[pixelOffset+2]=color&255;imgdata.data[pixelOffset+3]=255};this.doROP=function(rop,src,dst){switch(rop){case 0:return 0;case 1:return ~(src|dst);case 2:return(~src)&dst;case 3:return ~src;case 4:return src&(~dst);case 5:return ~(dst);case 6:return src^dst;case 7:return ~(src&dst);case 8:return src&dst;case 9:return ~(src)^dst;case 10:return dst;case 11:return(~src)|dst;case 12:return src;s;case 13:return src|(~dst);case 14:return src|dst;case 15:return ~0;case 16:return ~src&~dst}return dst};this.doROP3=function(rop,src,dst,bc,fc){switch(rop){case 0:return 0;case 1:return ~(src|dst);case 2:return(~src)&dst;case 3:return ~src;case 4:return src&(~dst);case 5:return ~(dst);case 6:return src^dst;case 7:return ~(src&dst);case 8:return src&dst;case 9:return ~(src)^dst;case 10:return dst;case 11:return(~src)|dst;case 12:return src;case 13:return src|(~dst);case 14:return src|dst;case 15:return ~0;case 16:return ~src&~dst;case 17:return ~src&fc;case 18:return src==0?bc:fc;case 19:return dst|(fc|~src);case 20:return src==0?bc^dst:fc^dst;case 21:return(src&fc)|(~src&dst);case 22:return src&~fc;case 23:return dst^~fc}return dst};this.getFontSize=function(context,cmd){var n=1;context.font=Math.floor(cmd.bcy*n)+"px zscope";var mw=context.measureText("H").width;while(mw>cmd.fw&&n>0.7){n-=0.01;context.font=Math.floor(cmd.fh*n)+"px zscope";mw=context.measureText("H").width}return Math.floor(cmd.fh*(n))};this.putFixedFontText=function(cmd,context){cmd.text=window.atob(cmd.text),idx=0,ch=0;if(cmd.bcx==0||cmd.bcy==0){return}context.fillStyle=this.toRGB(cmd.bc);context.fillRect(cmd.bx,cmd.by,cmd.bcx,cmd.bcy);context.font=Math.floor(cmd.fh*0.85)+"px zscope";context.fillStyle=this.toRGB(cmd.fc);context.textBaseline="top";var dy=4;for(var x=0;x>16)&255;data[offset+1]=(color>>8)&255;data[offset+2]=color&255}}context.putImageData(imagedata,cmd.x,cmd.y)}}}else{if(cmd.c=="IP"){var sx=0,sy=0;if(typeof cmd.sx!="undefined"){sx=cmd.sx;sy=cmd.sy}try{context.drawImage(root.imgQueue.items[cmd.qidx].img,sx,sy,cmd.cx,cmd.cy,cmd.x,cmd.y,cmd.cx,cmd.cy)}catch(ex){logError("IP: context.drawImage failed. cmd.qidx="+cmd.qidx);if(root.imgQueue.items[cmd.qidx]){logError("size: "+root.imgQueue.items[cmd.qidx].img.width+"x"+root.imgQueue.items[cmd.qidx].img.height)}}TVNC.queueRecycleImg.push(cmd.img);win.cmds[i].img=null}else{if(cmd.c=="CB"){var item=root.imgQueue.items[cmd.qidx];if(item){TVNC.brushCache[cmd.idx]=item.img}}else{if(cmd.c=="FR"){context.fillStyle=this.toRGB(cmd.clr);if(cmd.pm&&cmd.pm==14){context.globalCompositeOperation="xor"}context.fillRect(cmd.x,cmd.y,cmd.w,cmd.h);context.globalCompositeOperation="source-over"}else{if(cmd.c=="PB"){var auxCanvas=document.createElement("canvas");auxCanvas.width=cmd.cx;auxCanvas.height=cmd.cy;var auxContext=auxCanvas.getContext("2d");cmd.fc&=16777215;cmd.bc&=16777215;if(cmd.bs==0){auxContext.fillStyle=this.toRGB(cmd.fc);auxContext.fillRect(0,0,cmd.cx,cmd.cy)}else{var img;if(cmd.cidx>=0){img=TVNC.brushCache[cmd.cidx]}else{var item=root.imgQueue.items[cmd.qidx];if(!item){logError("pattern missing");continue}img=item.img}var ptrn=context.createPattern(img,"repeat");auxContext.fillStyle=ptrn;auxContext.fillRect(0,0,cmd.cx,cmd.cy)}var auxImageData=auxContext.getImageData(0,0,cmd.cx,cmd.cy);var imagedata=context.getImageData(cmd.x,cmd.y,cmd.cx,cmd.cy);if(auxImageData&&imagedata){var data=imagedata.data;var offset=0;var auxData=auxImageData.data;for(var line=0;line>16)&255;data[offset+1]=(color>>8)&255;data[offset+2]=color&255}}context.putImageData(imagedata,cmd.x,cmd.y)}}else{if(cmd.c=="SB"){var imagedata=null;try{imagedata=context.getImageData(cmd.sx,cmd.sy,cmd.cx,cmd.cy)}catch(e){if(jQuery.browser.mozilla){netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");imagedata=context.getImageData(cmd.sx,cmd.sy,cmd.cx,cmd.cy)}}if(imagedata){context.putImageData(imagedata,cmd.x,cmd.y)}}else{if(cmd.c=="LI"){context.save();if(cmd.cw&&cmd.ch){context.beginPath();context.rect(cmd.cl,cmd.ct,cmd.cw,cmd.ch);context.clip()}context.beginPath();if(cmd.ey-cmd.y==0){cmd.y+=0.5;cmd.ey+=0.5}if(cmd.ex-cmd.x==0){cmd.x+=0.5;cmd.ex+=0.5}if(cmd.pm&&cmd.pm==14){context.globalCompositeOperation="xor"}context.moveTo(cmd.x,cmd.y);context.lineTo(cmd.ex,cmd.ey);context.lineWidth=cmd.w;context.strokeStyle=this.toRGB(cmd.fg);context.stroke();context.globalCompositeOperation="source-over";context.restore()}else{if(cmd.c=="PL"){if(cmd.p.length>0){var n;var px=cmd.p[0].x;var py=cmd.p[0].y;var cx;var cy;var vertical=false;var horizontal=false;for(n=1;n>16)&255;data[offset+1]=(color>>8)&255;data[offset+2]=color&255}}context.putImageData(imagedata,x,y)}};this.processNextScreen=function(){if(TVNC.msgQueue.length>0){var m=TVNC.msgQueue[0];if(!m.imgQueue||m.imgQueue.loaded==m.imgcnt||m.imgQueue.aborted()){if(TVNC.imageListType==0&&m.windows&&!m.imgQueue){TVNC.buildImgQueue(m);if(m.imgQueue.loaded=0;i--){var canvas=TVNC.vncdiv.children[i];if(canvas.tagName=="CANVAS"){var found=false;for(j=0;j=this.rcParams.monitorCount){m=-1}this.sendCmd("cmd=params&monitor="+m)};this.clearSID=function(){document.cookie="SID=; expires=-1;"};this.disconnect=function(){TVNC.endingsession=true;if(document.getElementById(TVNC.reconnectDivId)){$("#"+TVNC.reconnectDivId).remove()}TVNC.disposeTimeout=setTimeout(TVNC.dispose,TVNC.disposeTimeoutValue);TVNC.sendCmd("cmd=disconnect")};this.removeListeners=function(){$(document).unbind();$("#"+TVNC.vncdivId).unbind();window.removeEventListener("DOMMouseScroll",TVNC.wheel,false);window.onmousewheel=null};this.dispose=function(){TVNC.alive=false;clearTimeout(TVNC.ackTimeout);clearTimeout(TVNC.disposeTimeout);if(!TVNC.useAjax){TVNC.ws.close()}$.ajaxq(TVNC.queueRequestName);TVNC.connected=false;TVNC.connecting=false;TVNC.useAjax=true;TVNC.removeListeners();$(window).trigger("serverDisconnect");$(window).unbind();$("#clipboardHelper").unbind();TVNC.clipboard.deinit();TVNC.vncdiv.innerHTML="";if(TVNC.xmlHttpJson){TVNC.xmlHttpJson.abort();TVNC.xmlHttpJson=null}TVNC.emptyRecycleImg(true);if(TVNC.cursorCanvas){if(TVNC.cursorCanvas.mask){delete TVNC.cursorCanvas.mask;TVNC.cursorCanvas.mask=null}delete TVNC.cursorCanvas;TVNC.cursorCanvas=null}TVNC.clearImageCache();TVNC.clearTextCache();TVNC.clearFontCache();TVNC.clearOffscreenCache()};this.stop=function(){this.sendCmd("cmd=stop")};this.start=function(){this.startPending=false;this.rcParams.active=false;var cmd="cmd=start";if(this.rcParams.scraper!=null){cmd=cmd+"&scraper="+this.rcParams.scraper;if(this.rcParams.scraperArgs!=null){cmd=cmd+"&"+this.rcParams.scraperArgs}}if(!TVNC.useAjax){if(TVNC.ws.binaryType&&window.FileReader&&$.browser.webkit){cmd+="&imageList=binary";TVNC.imageListType=2}else{}}cmd+="&mouseControl="+this.rcParams.mouseControl+"&kbdControl="+this.rcParams.kbdControl;cmd+="&imageMethod="+this.rcParams.imageMethod+"&quality="+this.rcParams.quality+"&pixelFormat="+this.rcParams.pixelFormat;cmd+="&monitor="+this.rcParams.monitor;(!TVNC.rcParams.clientAck&&!TVNC.useAjax)?TVNC.rcParams.clientAck=false:TVNC.rcParams.clientAck=true;if(TVNC.rcParams.clientAck){cmd+="&clientAck=true"}else{cmd+="&clientAck=false"}if(TVNC.rcParams.screenResX>0){cmd+="&screenResX="+TVNC.rcParams.screenResX+"&screenResY="+TVNC.rcParams.screenResY}TVNC.sendCmd(cmd);if(this.rcParams.showOnStart==true){$("#"+TVNC.vncdivId).show()}};this.connect=function(userid,password){if(!this.connecting&&!this.connected&&TVNC.xmlHttpJson==null){$(window).trigger("serverAuthenticationRequired");if((typeof userid=="undefined")&&(TVNC.rcParams.userid!=null)){userid=TVNC.rcParams.userid}if((typeof password=="undefined")&&(TVNC.rcParams.password!=null)){password=TVNC.rcParams.password}var cmd="cmd";var query="cmd=connect";if(typeof userid!="undefined"){query+="&userid="+userid;this.userid=userid;if(typeof password!="undefined"){query+="&password="+escape(password);this.password=password}}query+="&wscompression="+this.rcParams.wscompression;if(TVNC.rcParams.ticket!=""){query=query+"&ticket="+TVNC.rcParams.ticket}if(TVNC.rcParams.pin!=""){query=query+"&pin="+TVNC.rcParams.pin}query=query+"&destAddr="+TVNC.rcParams.address;if(TVNC.rcParams.scraper!=null){query=query+"&scraper="+TVNC.rcParams.scraper;if(TVNC.rcParams.scraperArgs!=null){query=query+"&"+this.rcParams.scraperArgs}}query=query+"&screenWidth="+screen.width+"&screenHeight="+screen.height;if(typeof TVNC.rcParams.lfn!="undefined"&&TVNC.rcParams.lfn!=null&&TVNC.rcParams.lfn!=""){query=query+"&lfn="+TVNC.rcParams.lfn}var url=TVNC.getAjaxUrl()+cmd+"?"+query+"&id="+TVNC.rcParams.id;this.connecting=true;TVNC.xmlHttpJson=$.ajax({url:TVNC.getCrossDomainUrl(url),dataType:TVNC.getCrossDomainDataType(),timeout:70000,error:function(jqXHR,err){alert("Connect error: "+err);TVNC.connecting=false;TVNC.xmlHttpJson=null},success:TVNC.onConnectResult});$(window).trigger("serverConnecting")}};this.onConnectResult=function(data){TVNC.xmlHttpJson=null;TVNC.connecting=false;if(data!=""&&data){try{var obj=(TVNC.crossdomain)?data:eval("("+data+")");if(obj.status&&typeof obj.status!="undefined"){TVNC.connected=true;TVNC.reconnecting=false;TVNC.rcParams.id=obj.id;TVNC.vncdiv.innerHTML="";if(!TVNC.rcParams.forceAjax&&("WebSocket" in window||"MozWebSocket" in window)){TVNC.connectWebSocket()}else{TVNC.start()}$(window).trigger("serverConnect",obj)}else{if(obj.authStatus==3){$(window).trigger("serverAuthenticationFailed",obj.errormsg)}else{if(obj.errormsg){if(!TVNC.reconnecting){$(window).trigger("serverConnectionError","Connection attempt failed. "+obj.errormsg);TVNC.dispose()}else{TVNC.reconnect()}}}}delete obj}catch(err){$(window).trigger("serverConnectionError",err.Message)}}else{TVNC.reconnect()}};this.gup=function(name){name=name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(window.location.href);delete regex;if(results==null){return""}else{return results[1]}};this.refresh=function(){this.vncdiv.innerHTML="";this.cursorCanvas=null;this.sendCmd("cmd=refresh")};this.onJsonTimeout=function(){if(TVNC.xmlHttpJson){TVNC.xmlHttpJson.abort()}TVNC.xmlHttpJson=null;TVNC.reconnect()};this.reload=function(){if(!TVNC.connected){return}if(TVNC.useAjax){var url=TVNC.getAjaxUrl()+"json?id="+TVNC.rcParams.id;clearTimeout(TVNC.jsonTimeout);TVNC.jsonTimeout=setTimeout(TVNC.onJsonTimeout,TVNC.jsonTimeoutValue);if(TVNC.xmlHttpJson==null){TVNC.xmlHttpJson=$.ajax({url:TVNC.getCrossDomainUrl(url),dataType:TVNC.getCrossDomainDataType(),error:function(){TVNC.xmlHttpJson=null;setTimeout(TVNC.reload,1)},success:function(data){clearTimeout(TVNC.jsonTimeout);TVNC.xmlHttpJson=null;if(TVNC.connected){if(data!=""&&data){try{var obj=(TVNC.crossdomain)?data:eval("("+data+")");TVNC.msgQueue.push(obj);TVNC.processNextScreen()}catch(err){logError("ajax error: "+err)}}else{TVNC.reconnect()}}}})}}else{TVNC.sendAck()}};this.clearMouse=function(){this.mouseMoved=false};this.sendEvent=function(url){$.ajaxq(this.queueRequestName,{url:TVNC.getCrossDomainUrl(url),async:true,dataType:TVNC.getCrossDomainDataType()})};this.sendKey=function(key,ch,action){if(TVNC.rcParams.active&&TVNC.rcParams.kbdControl){var query="cmd=keyb&key="+key+"&char="+ch+"&action="+action+"&id="+TVNC.rcParams.id;if(TVNC.useAjax){var url=TVNC.getAjaxUrl()+"cmd?"+query;this.sendEvent(url)}else{TVNC.wsSend(query)}}};this.sendFunctionKey=function(key){if(TVNC.rcParams.active&&TVNC.rcParams.kbdControl){var query="cmd=fkey&key="+key+"&id="+TVNC.rcParams.id;if(TVNC.useAjax){var url=TVNC.getAjaxUrl()+"cmd?"+query;this.sendEvent(url)}else{TVNC.wsSend(query)}}};this.sendText=function(text){for(var c=0;c=112)&&(keyCode<=123)||(keyCode>=33)&&(keyCode<=40)||(keyCode>=45)&&(keyCode<=46)||(keyCode>=16)&&(keyCode<=20)||(keyCode>=91)&&(keyCode<=93)||(keyCode==13)||(keyCode==9)||(keyCode==8)||(keyCode==27)||(keyCode==144)||(keyCode==12)||(keyCode==224))};this.hookKM=function(){if(!TVNC.KMHooked){TVNC.KMHooked=true;if(TVNC.rcParams.hookMouse){if(TVNC.iphone){document.addEventListener("touchstart",TVNC.onTouchStart,false);document.addEventListener("touchmove",TVNC.onTouchMove,false);document.addEventListener("touchend",TVNC.onTouchEnd,false)}else{if(window.addEventListener){window.addEventListener("DOMMouseScroll",TVNC.wheel,false)}window.onmousewheel=document.onmousewheel=TVNC.wheel;this.vncDivElement.mousedown(TVNC.onTouchStart);this.vncDivElement.mouseup(TVNC.onTouchEnd);this.vncDivElement.mousemove(TVNC.onTouchMove)}}if(TVNC.rcParams.hookKeyboard){$(document).keydown(function(e){if(TVNC.IsFunctionKey(e.keyCode)||(e.altKey||e.ctrlKey)&&(e.altKey!=e.ctrlKey)){if(!TVNC.isMacAltKey(e)){TVNC.sendKey(e.keyCode,0,"down");e.stopPropagation();e.preventDefault()}}if(!TVNC.isMacAltKey(e.keyCode)){TVNC.lastKeyCode=e.keyCode}});$(document).keypress(function(e){var charCode=($.browser.opera)?e.which:e.charCode;if(!TVNC.isMacAltKey(e)&&((e.keyCode!=0)&&TVNC.IsFunctionKey(TVNC.lastKeyCode)||(e.altKey||e.ctrlKey)&&(e.altKey!=e.ctrlKey))){e.stopPropagation();e.preventDefault();return}var isMAK=TVNC.isMacAltKey(e)&&(TVNC.lastKeyCode==18);if(isMAK){TVNC.sendKey(17,0,"down")}if(TVNC.onlyKeyCode){TVNC.sendKey(TVNC.lastKeyCode,0,"down")}else{TVNC.sendKey(TVNC.lastKeyCode,charCode,"down")}if(isMAK){TVNC.sendKey(17,0,"up")}e.stopPropagation();e.preventDefault()});$(document).keyup(function(e){TVNC.lastKeyCode=0;TVNC.sendKey(e.keyCode,0,"up");if($.browser.mozilla&&e.altKey){TVNC.sendKey(18,0,"up")}e.stopPropagation();e.preventDefault()})}}this.vncDivElement.bind("contextmenu",function(e){return false})};this.isMacAltKey=function(e){return(this.mac&&e.altKey)};this.mouseDown=function(X,Y,button){$("#clipboardHelper").focus();if(TVNC.rcParams.active&&TVNC.rcParams.mouseControl){TVNC.sendMouse(TVNC.mouseX,TVNC.mouseY,button,"down")}};this.mouseUp=function(X,Y,button){if(TVNC.rcParams.active&&TVNC.rcParams.mouseControl){TVNC.sendMouse(TVNC.mouseX,TVNC.mouseY,button,"up")}};this.mouseMove=function(X,Y){if(TVNC.rcParams.active&&TVNC.rcParams.mouseControl){var position=this.findPos(TVNC.vncdiv);var left=position[0];var top=position[1];if(X(left+TVNC.rcParams.viewWidth)){X=left+TVNC.rcParams.viewWidth}if(Y>(top+TVNC.rcParams.viewHeight)){Y=top+TVNC.rcParams.viewHeight}TVNC.mouseX=Math.floor((X-left)/TVNC.scale);TVNC.mouseY=Math.floor((Y-top)/TVNC.scale);TVNC.mouseMoved=true;TVNC.moveCursorCanvas(X,Y)}};this.onTouchStart=function(e){if(TVNC.iphone){if(e.touches.length==1){var button=0;TVNC.mouseX=TVNC.serverMouseX(e,false);TVNC.mouseY=TVNC.serverMouseY(e,false);TVNC.moveCursorCanvas(e.touches[0].pageX,e.touches[0].pageY);TVNC.mouseDown(TVNC.mouseX,TVNC.mouseY,button)}else{var button=2;TVNC.mouseDown(TVNC.mouseX,TVNC.mouseY,button);TVNC.mouseUp(TVNC.mouseX,TVNC.mouseY,button)}}else{TVNC.mouseX=TVNC.serverMouseX(e,false);TVNC.mouseY=TVNC.serverMouseY(e,false);TVNC.mouseDown(TVNC.mouseX,TVNC.mouseY,e.button)}e.stopPropagation();e.preventDefault()};this.onTouchMove=function(e){var currentX=TVNC.serverMouseX(e,false);var currentY=TVNC.serverMouseY(e,false);if((TVNC.mouseX!=currentX)||(TVNC.mouseY!=currentY)){TVNC.mouseX=currentX;TVNC.mouseY=currentY;if(!TVNC.iphone){TVNC.mouseMove(e.pageX,e.pageY)}else{TVNC.mouseMove(e.touches[0].pageX,e.touches[0].pageY)}}};this.onTouchEnd=function(e){var button=(TVNC.iphone)?0:e.button;TVNC.sendMouse(TVNC.mouseX,TVNC.mouseY,button,"up");e.stopPropagation();e.preventDefault()};this.connectWebSocket=function(){var buffer="";logDebug("connectWebSocket. TVNC.connected: "+TVNC.connected);if(TVNC.connected){var server=(TVNC.rcParams.server)?TVNC.rcParams.server:window.location.host;var url="://"+server+TVNC.baseUrl+"/"+TVNC.rcParams.id;if(TVNC.getProtocol()=="https:"){url="wss"+url}else{url="ws"+url}try{if("WebSocket" in window){TVNC.ws=new WebSocket(url)}else{TVNC.ws=new MozWebSocket(url)}TVNC.ws.onopen=function(){TVNC.alive=true;logDebug("TVNC.ws.onopen. TVNC.alive = true");TVNC.useAjax=false;TVNC.imageListHelper.PurgeImgQueues();TVNC.start()};TVNC.ws.onmessage=function(msg){if(!TVNC.connected){logDebug("TVNC.ws.onmessage -> !TVNC.connected. Return");return}if(msg.data==""){logDebug("TVNC.ws.onmessage -> msg.data == ''. Return");return}var obj=null;if(typeof msg.data=="object"){TVNC.imageListHelper.QueueBinary(msg.data)}else{var version=msg.data[0];if(version=="{"){obj=eval("("+msg.data+")")}else{var datatype=msg.data[0];var endofdata=msg.data[1];buffer+=msg.data.substring(6);if(endofdata=="0"){return}if(datatype=="0"){try{obj=eval("("+buffer+")");buffer=""}catch(err){alert("websocket onmessage err: "+err)}}else{if(datatype=="1"){TVNC.imageListHelper.QueueText(buffer);buffer="";return}}}if(obj.id!=undefined){TVNC.serverCmdResult(obj)}else{if(obj.status){obj.imgQueue=TVNC.imgQueue;TVNC.imgQueue=null;TVNC.msgQueue.push(obj);TVNC.processNextScreen()}}}obj=null};TVNC.ws.onerror=function(e){logDebug("TVNC.ws.onerror")};TVNC.ws.onclose=function(e){logDebug("TVNC.ws.onclose");if(TVNC.endingsession){logDebug("TVNC.ws.onclose. TVNC.endingsession: "+TVNC.endingsession);return}if(TVNC.alive&&!TVNC.useAjax){logError("TVNC.ws.onclose. Try to reconnect.");TVNC.reconnect()}else{TVNC.start()}}}catch(e){logDebug("TVNC.ws Try-Catch -> Event Data = "+JSON.stringify(e));TVNC.start()}}};this.getNextHighestZindex=function(obj){var highestIndex=0;var currentIndex=0;var elArray=Array();if(obj){elArray=obj.getElementsByTagName("*")}else{elArray=document.getElementsByTagName("*")}for(var i=0;ihighestIndex){highestIndex=currentIndex}}return(highestIndex+1)};this.reconnect=function(){clearTimeout(TVNC.jsonTimeout);if(TVNC.endingsession){return}TVNC.reconnecting=true;TVNC.connected=false;if(document.getElementById(TVNC.reconnectDivId)==null){TVNC.vncdiv.style.cursor="default";$("#"+TVNC.vncdivId).append('
Connection lost. Reconnecting...
');$(window).trigger("serverReconnect");$("#cancelRecnx").click(function(){$("#"+TVNC.reconnectDivId).remove();TVNC.disconnect()});$(document).unbind();$("#"+TVNC.vncdivId).unbind();if(TVNC.useAjax){TVNC.xmlHttpJson=null;$.ajaxq(TVNC.queueRequestName)}}TVNC.connect()};this.supportsHTML5Storage=function(){try{return"localStorage" in window&&window.localStorage!=null}catch(err){return false}};this.getStorageName=function(){var middle=(this.rcParams.address)?"_"+this.rcParams.address:"";return"thinvnc"+middle+"_prefs"};this.loadPreferences=function(){if(!this.supportsHTML5Storage()){return}try{var objJson=localStorage.getItem(this.getStorageName());var objData=JSON.parse(objJson);if(objData!=null&&typeof objData!="undefined"){this.onlyKeyCode=(objData.onlykeycode!=null)?objData.onlykeycode:this.onlyKeyCode}}catch(err){}};this.savePreferences=function(){if(!this.supportsHTML5Storage()){return}try{var objData=new Object();objData.onlykeycode=this.onlyKeyCode;var objJson=JSON.stringify(objData);localStorage.setItem(this.getStorageName(),objJson)}catch(err){}};this.setParams=function(dd){for(var o in dd){TVNC.rcParams[o]=dd[o]}};this.init=function(dd){for(var o in dd){TVNC.rcParams[o]=dd[o]}TVNC.vncdivId=(TVNC.rcParams.divId)?TVNC.rcParams.divId:TVNC.vncdivId;TVNC.centered=TVNC.rcParams.centered;if(this.rcParams.showOnStart==false){$("#"+TVNC.vncdivId).hide()}var agent=navigator.userAgent.toLowerCase();TVNC.mac=(agent.indexOf("macintosh")!=-1);TVNC.iphone=((agent.indexOf("iphone")!=-1)||(agent.indexOf("ipod")!=-1)||(agent.indexOf("ipad")!=-1));TVNC.mobile=((agent.indexOf("iphone")!=-1)||(agent.indexOf("ipod")!=-1)||(agent.indexOf("ipad")!=-1)||(agent.indexOf("android")!=-1)||(agent.indexOf("hp-tablet")!=-1)||(agent.indexOf("playbook")!=-1));TVNC.vncdiv=document.getElementById(TVNC.vncdivId);if(!TVNC.vncdiv){throw new Error("the "+TVNC.vncdivId+" is not available")}TVNC.vncDivElement=$("#"+TVNC.vncdivId);TVNC.vncdiv.style.position="relative";TVNC.vncdiv.style.overflow="hidden";TVNC.vncdiv.style.top="0px";TVNC.vncdiv.style.marginTop="0px";TVNC.vncdiv.style.left="0px";TVNC.vncdiv.style.marginLeft="0px";TVNC.supportsCanvas=!!document.createElement("canvas").getContext;var path=(TVNC.rcParams.url)?TVNC.rcParams.url:window.location.pathname;var pathArray=path.split("/");TVNC.baseUrl="";for(i=0;iopen";if(showCancel){msg+="    discard"}msg+="";$.blockUI({message:msg,css:{padding:0,margin:0,width:"100%",height:"100%",top:"0px",left:"0px",textAlign:"center",backgroundColor:"transparent",border:"none",cursor:"auto"},centerX:true,centerY:true,onBlock:function(){setTimeout(TVNC.reload,1)}})}};function logDebug(a){if(typeof(MsgLogger)=="undefined"){if(window.console){window.console.log(a)}}else{logDebugW(a)}}function logError(a){if(typeof(MsgLogger)=="undefined"){if(window.console){window.console.error(a)}return a}else{logErrorW(a)}}var oMsgLogger=null;function logDebugW(a){if(!oMsgLogger){oMsgLogger=new MsgLogger()}oMsgLogger.log(a)}function logErrorW(a){logDebugW("ERROR: "+a)}var button="left";var dblClickStartDate=new Date();var tapholdTimeout=null;var touchstate=0;var lastEvent=null;var tapintensity=0;var stdKeyboardVisible=false;var extKeyboardVisible=false;var dialogVisible=false;var THIN=null;var ctrlDown=false;var altDown=false;var shiftDown=false;var deltaCursorX=0;var deltaCursorY=0;var pageX=0;var pageY=0;var lastTouchkbdTop=0;var mouseScrollX=-1;var startMouseX=0;var startMouseY=0;var mouseScrollY=-1;var theme="b";var keySentOnKeyPress=0;var relativeTouch=true;var scrollWithMouse=true;var mouseButtonDown=false;var divScrolling=true;var screenHeight=$(window).height();var screenWidth=$(window).width();var currentKey=null;var chkScrSizeTimeout=null;var showToolbar=true;var relPath=window.location.pathname;if(relPath=="/"||relPath==""){relPath=""}else{aPath=relPath.split("/");if(aPath[aPath.length-1]==""){aPath.splice(aPath.length-1,1)}relPath=(aPath[aPath.length-1]=="rdp"||aPath[aPath.length-1]=="vnc")?"../":""}document.write('');document.write('');document.write('');document.write('');document.write('');document.write('');document.write('');document.write('');document.write('');document.write('');function byId(a){return document.getElementById(a)}function CtrlKeyToggle(){ctrlDown=!ctrlDown;if(ctrlDown){$("#keyctrl").addClass("selected")}else{$("#keyctrl").removeClass("selected")}}function CtrlKeyOff(){ctrlDown=false;$("#keyctrl").removeClass("selected")}function AltKeyToggle(){altDown=!altDown;if(altDown){$("#keyalt").addClass("selected")}else{$("#keyalt").removeClass("selected")}}function AltKeyOff(){altDown=false;$("#keyalt").removeClass("selected")}function ShiftKeyToggle(){shiftDown=!shiftDown;if(shiftDown){$("#keyshift").addClass("selected")}else{$("#keyshift").removeClass("selected")}}function ShiftKeyOff(){shiftDown=false;$("#keyshift").removeClass("selected")}function sendSpecialKeysBegin(){if(ctrlDown){THIN.sendKeyDown(17)}if(altDown){THIN.sendKeyDown(18)}if(shiftDown){THIN.sendKeyDown(16)}}function sendSpecialKeysEnd(){if(ctrlDown){THIN.sendKeyUp(17)}if(altDown){THIN.sendKeyUp(18)}if(shiftDown){THIN.sendKeyUp(16)}CtrlKeyOff();AltKeyOff();ShiftKeyOff()}function sendExtKey(b,a){sendSpecialKeysBegin();THIN.sendKeyStroke(a);sendSpecialKeysEnd()}function sendCtrlAltDel(){THIN.sendCtrlAltDel()}function sendShiftCtrlEsc(){THIN.sendShiftCtrlEsc()}function sendShellExplorer(){THIN.sendShellExplorer()}function sendShellRun(){THIN.sendShellRun()}function sendCtrlEsc(){THIN.sendCtrlEsc()}function sendCut(){THIN.sendCut()}function sendCopy(){THIN.sendCopy()}function sendPaste(){THIN.sendPaste()}function btnDblClick(){btnLeftClick();btnLeftClick()}function btnLeftClick(){mouseDown("left",getTouchX(),getTouchY());mouseUp("left",getTouchX(),getTouchY())}function btnRightClick(){mouseDown("right",getTouchX(),getTouchY());mouseUp("right",getTouchX(),getTouchY())}function openExtKeyboard(c){if(typeof c=="undefined"){$("#extkeyboard").addClass("slide")}else{$("#extkeyboard").removeClass("slide")}$("#extkeyboard").show();extKeyboardVisible=true;var b=document.getElementById("extkeyboard");var a=b.offsetHeight;b.style.top=$(window).height+"px";b.style.left=$(window).scrollLeft()+"px";var d=screenHeight-a+$(window).scrollTop();b.style.top=d+"px"}function closeExtKeyboard(){$("#extkeyboard").hide();$("#extkeys").hide();extKeyboardVisible=false}function moveExtKeyboard(){if(!extKeyboardVisible){return}var b=document.getElementById("extkeyboard");var a=b.offsetHeight;b.style.top=$(window).height+"px";var c=screenHeight-a+$(window).scrollTop();b.style.left=$(window).scrollLeft()+"px";b.style.top=c+"px"}function ShowExtKeys(){var a=document.getElementById("extkeys");a.style.top=a.offsetHeight-$(window).scrollTop()-2+"px";$("#extkeys").show();window.setTimeout(function(){a.style.left=(screenWidth-a.offsetWidth)/2+$(window).scrollLeft()+"px";a.style.top=$(window).scrollTop()-2+"px"},50)}function ShowStdKbd(){var a=document.getElementById("touchkbd");stdKeyboardVisible=true;var b=THIN.caretY;if(b<=0){b=THIN.mouseY}a.style.top=b-THIN.vncdiv.scrollTop+"px";a.focus();a.style.left="-2000px"}function btnShowStdKbd(){closeExtKeyboard();ShowStdKbd();ShowExtKeys()}function btnShowExtKbd(){openExtKeyboard();ShowExtKeys()}function addKeyImg(e,a,c,b,g,d){if(typeof b=="undefined"){b=2}var f=' class="key t'+b+'"';if((typeof g!="undefined")&&(g!="")){f+=' ontouchend="'+g+'"'}else{f+=' ontouchend="sendExtKey(this,'+c+')"'}$("#extkeyboard_row"+e).append('
')}function addKey(e,d,b,a,g,c){if(typeof a=="undefined"){a=2}var f="";if((typeof g!="undefined")&&(g!="")){var f=' class="key t'+a+'"';f+=' ontouchend="'+g+'"'}else{if((d!="")&&(b!=0)){f=' class="key t'+a+'" ontouchend="sendExtKey(this,'+b+')"'}}$("#extkeyboard_row"+e).append('")}function addExtKey(e,d,b,a,g,c){if(typeof a=="undefined"){a=2}var f="";if(d!=""){f=' class="key t'+a+'"';if(g!=parseInt(g)){f+=' id="'+g+'"'}else{f+=' ontouchend="sendExtKey(this,'+g+')"'}}$("#extkeys_row"+e).append('")}function getRelativeX(b){if(relativeTouch){var a=b;b=Math.floor((b-startMouseX)/1)+pageX;b=(b<0)?0:(b>THIN.rcParams.viewWidth)?THIN.rcParams.viewWidth:b;startMouseX=a}else{b=Math.floor(b/1)}pageX=b;return b}function getRelativeY(b){if(relativeTouch){var a=b;b=Math.floor((b-startMouseY)/1)+pageY;b=(b<0)?0:(b>THIN.rcParams.viewHeight)?THIN.rcParams.viewHeight:b;startMouseY=a}else{b=Math.floor(b/1)}pageY=b;return b}function mouseDown(b,d,c){var a=0;mouseButtonDown=true;lastY=c;if(b=="right"){a=2}THIN.mouseDown(getRelativeX(d)+deltaCursorX,getRelativeY(c)+deltaCursorY,a)}function mouseUp(b,d,c){var a=0;mouseButtonDown=false;if(b=="right"){a=2}THIN.mouseUp(getRelativeX(d)+deltaCursorX,getRelativeY(c)+deltaCursorY,a)}function mouseMove(b,a){THIN.mouseMove(getRelativeX(b)+deltaCursorX,getRelativeY(a)+deltaCursorY)}function divScroll(b,a){if(divScrolling){THIN.vncdiv.scrollLeft+=(mouseScrollX-b);THIN.vncdiv.scrollTop+=(mouseScrollY-a)}else{window.scroll($(window).scrollLeft()+(mouseScrollX-b),$(window).scrollTop()+(mouseScrollY-a))}mouseScrollX=b;mouseScrollY=a;return}function windowScroll(b,a){window.scroll($(window).scrollLeft()+mouseScrollX-b,$(window).scrollTop()+mouseScrollY-a);return}function getTouchX(){var a;if(typeof lastEvent.targetTouches=="undefined"){if(typeof lastEvent.changedTouches!="undefined"){a=lastEvent.changedTouches[0].clientX}else{a=lastEvent.pageX}}else{a=lastEvent.targetTouches[0].clientX}return a+THIN.vncdiv.scrollLeft}function getTouchY(){var a;if(typeof lastEvent.targetTouches=="undefined"){if(typeof lastEvent.changedTouches!="undefined"){a=lastEvent.changedTouches[0].clientY}else{a=lastEvent.pageY}}else{a=lastEvent.targetTouches[0].clientY}return a+THIN.vncdiv.scrollTop}function checkTapIntensity(){if(touchstate!=1){return}tapintensity++;if(typeof lastEvent.touches!="undefined"){if(lastEvent.touches.length>1){return}}var a=200;if(tapintensity==2){a=400}if(tapintensity<3){tapholdTimeout=setTimeout(checkTapIntensity,a)}}function touchstart(a){button="left";touchstate=1;lastEvent=a;tapintensity=0;if(lastEvent.targetTouches.length==2){button="right"}mouseScrollX=lastEvent.targetTouches[0].clientX;mouseScrollY=lastEvent.targetTouches[0].clientY;startMouseX=getTouchX();startMouseY=getTouchY();setTimeout(checkTapIntensity,200);if(!relativeTouch){mouseMove(getTouchX(),getTouchY())}a.preventDefault()}function touchmove(g){lastEvent=g;clearTimeout(tapholdTimeout);if(!THIN.rcParams.scaled&&((!THIN.rcParams.active||!THIN.rcParams.kbdControl)||(lastEvent.targetTouches.length==2))){if(stdKeyboardVisible&&(lastEvent.targetTouches.length==2)){divScroll(lastEvent.targetTouches[0].clientX,lastEvent.targetTouches[0].clientY)}else{divScroll(lastEvent.targetTouches[0].clientX,lastEvent.targetTouches[0].clientY)}}else{if((tapintensity>0)&&(touchstate==1)){mouseDown(button,getTouchX(),getTouchY())}mouseMove(getTouchX(),getTouchY());if(scrollWithMouse&&!THIN.rcParams.scaled){if(divScrolling){if((THIN.vncdiv.scrollLeft<(THIN.mouseX-screenWidth))||(THIN.mouseX(THIN.mouseX-THIN.vncdiv.scrollLeft))){THIN.vncdiv.scrollLeft=(THIN.mouseX(f-THIN.vncdiv.scrollTop))){THIN.vncdiv.scrollTop=(f(THIN.mouseX-b))){b=(THIN.mouseX(THIN.mouseY-c))){c=(THIN.mouseY
';a+='

';if(!(THIN.rdParams.disableExtKeys)){a+='

'}a+='
';a+='';a+='

"+d+"

"+d+"

';a+='';a+='';$(document.body).append(a);if(isTouchDevice()){document.getElementById(THIN.rcParams.divId).addEventListener("touchstart",touchstart,false);document.getElementById(THIN.rcParams.divId).addEventListener("touchmove",touchmove,false);document.getElementById(THIN.rcParams.divId).addEventListener("touchend",touchend,false);relativeTouch=(typeof THIN.rcParams.relativeTouch!="undefined")?THIN.rcParams.relativeTouch:true}else{document.getElementById(THIN.rcParams.divId).addEventListener("mousedown",touchstart,false);document.getElementById(THIN.rcParams.divId).addEventListener("mousemove",touchmove,false);document.getElementById(THIN.rcParams.divId).addEventListener("mouseup",touchend,false)}$("#touchkbd").focus(function(){});$("#touchkbd").blur(function(){if(stdKeyboardVisible){stdKeyboardVisible=false;$("#extkeys").hide();window.scroll(0,1)}});$(window).bind("orientationchange",function(f){checkScreenSize();showKeypad()});$(window).bind("resize",function(f){if(THIN==null||!THIN.connected){return}window.clearTimeout(chkScrSizeTimeout);chkScrSizeTimeout=window.setTimeout(checkScreenSize,50)});$("#ctrlAltDel").click(function(f){THIN.sendFunctionKey("CtrlAltDel")});$("#ctrlEsc").click(function(f){THIN.sendFunctionKey("CtrlEsc")});$("#refresh").click(function(f){if(THIN.rcParams.active){THIN.refresh()}});$("#monitor").click(function(f){THIN.setMonitor(THIN.rcParams.monitor+1)});$("#kimouse").click(function(f){d(!THIN.rcParams.mouseControl,THIN.rcParams.remotePointer,THIN.rcParams.pixelFormat)});function b(){if(THIN.rcParams.active&&THIN.rcParams.mouseControl){$("#kimouse").fadeTo(0,1)}else{$("#kimouse").fadeTo(0,0.4)}if(THIN.rcParams.scaled){$("#scale").parent().removeClass("ui-btn-up-b").addClass("ui-btn-down-a")}else{$("#scale").parent().removeClass("ui-btn-down-a").addClass("ui-btn-up-b")}if(THIN.rcParams.pixelFormat==1){$("#colors").parent().removeClass("ui-btn-up-b").addClass("ui-btn-down-a")}else{$("#colors").parent().removeClass("ui-btn-down-a").addClass("ui-btn-up-b")}}$("#kiscale").click(function(f){THIN.setScaled(!THIN.rcParams.scaled);THIN.zoomDesktop();b()});function d(e,g,f){THIN.sendCmd("cmd=params&mouseControl="+e+"&kbdControl="+e+"&remotePointer="+g+"&pixelFormat="+f)}$("#kisettings").click(function(f){editAction=2;openPreferences()});$("#kistdkbd").click(function(f){ShowStdKbd();ShowExtKeys()});$("#kiextkbd").click(function(f){openExtKeyboard();ShowExtKeys()});$("#kimouseright").click(function(f){btnRightClick()});$("#kidisconnect").click(function(f){$.blockUI({message:$("#closequestion")})});$(window).bind("serverConnect",function(f){window.scrollTo(0,1);adjustMainSize();showKeypad();$("#connectpanel").hide();$("#mainheader").hide();$(window).bind("touchmove",function(g){if(!dialogVisible){g.preventDefault()}});$(document).keyup(function(g){if(!keySentOnKeyPress){sendSpecialKeysBegin();THIN.sendKey(g.keyCode,0,"down");THIN.sendKey(g.keyCode,0,"up");sendSpecialKeysEnd()}keySentOnKeyPress=false;g.preventDefault()});$(document).keypress(function(m){var l=ctrlDown||altDown;var q=(l)?0:m.charCode;var g=m.keyCode;if(l){var h=String.fromCharCode(m.charCode).toUpperCase();if(h.length>0){var o=h.charCodeAt(0);if(o>0){g=o}}}sendSpecialKeysBegin();keySentOnKeyPress=true;THIN.sendKey(g,q,"down");THIN.sendKey(g,q,"up");sendSpecialKeysEnd();m.stopPropagation();m.preventDefault()})});$(window).bind("serverDisconnect",function(e){if(!e.isDefaultPrevented()){window.location.href="/"}else{$("#keypad").hide();$("#touchkbd").blur()}});$(window).bind("serverReconnect",function(){$("#keypad").show()});$(window).bind("onServerCommandResult",function(g,f){if(THIN.connected){if((typeof THIN.rcParams.pin!="undefined")&&(THIN.rcParams.pin!="")){$("#mouse").button("disable")}b()}});addKey(1,"F1",112);addKey(1,"F2",113);addKey(1,"F3",114);addKey(1,"F4",115);addKey(1,"F5",116);addKey(1,"F6",117);addKey(1,"Esc",27);addKey(1,"Print",42);addKey(1,"Scrlck",44);addKey(1,"Pause",19);addKey(1,"NumL",144);addKey(2,"F7",118);addKey(2,"F8",119);addKey(2,"F9",120);addKey(2,"F10",121);addKey(2,"F11",122);addKey(2,"F12",123);addKey(2,"PgUp",33);addKey(2,"PgDn",34);addKeyImg(2,"images/arrow-up.png",38);addKey(2,"Return",13,4);addKey(3,"WinKey",0,4,"sendCtrlEsc()");addKey(3,"CtrlAltDel",0,4,"sendCtrlAltDel()");addKey(3,"Computer",0,4,"sendShellExplorer()");addKey(3,"Tab",9);addKeyImg(3,"images/arrow-left.png",37);addKeyImg(3,"images/arrow-down.png",40);addKeyImg(3,"images/arrow-right.png",39);addKeyImg(3,"images/querty.png",0,2,"closeExtKeyboard()");addExtKey(1,"Ctrl",0,2,"keyctrl");addExtKey(1,"Alt",0,2,"keyalt");addExtKey(1,"Shift",0,2,"keyshift");addExtKey(1,"Ins",0,2,45);addExtKey(1,"Del",0,2,46);addExtKey(1,"Home",0,2,36);addExtKey(1,"End",0,2,35);addExtKey(1,"Next",0,2,9);addExtKey(1,String.fromCharCode(9650),0,2,"keyCloseKeyboards");$("div.key").bind("touchstart",function(f){$(this).addClass("pressed")});$("div.key").bind("touchend",function(f){$(this).removeClass("pressed")});$("#keyctrl").bind("touchend",function(f){CtrlKeyToggle()});$("#keyalt").bind("touchend",function(f){AltKeyToggle()});$("#keyshift").bind("touchend",function(f){ShiftKeyToggle()});$("#keyCloseKeyboards").bind("click",function(f){if(extKeyboardVisible){closeExtKeyboard()}$("#touchkbd").blur();$("#extkeys").hide()});$(window).bind("scrollstart",function(e){if(!divScrolling){$("#extkeys").hide();$("#extkeyboard").hide()}else{}});$(window).bind("scrollstop",function(e){if(divScrolling){}alignPanels()});$("#closeyes").click(function(){$.unblockUI();THIN.disconnect();return false});$("#closeno").click(function(){$.unblockUI();return false});$("#keypad").hide();$("#touchkbd").blur();$("#extkeys").hide();$("#extkeyboard").hide()}function GetThinRDP(a,c){if(typeof(a)=="undefined"){a=""}if(typeof(c)=="undefined"){c=false}if(!c){ThinRDP.prototype=new ThinVNC()}var b=new ThinRDP(a,c);return b}function ThinRDP(serverData,runRemote){this.baseUrl=(typeof(serverData)!="undefined")?serverData:"";this.runRemote=(typeof(runRemote)!="undefined")?runRemote:false;if(this.baseUrl.charAt(this.baseUrl.length-1)!="/"){this.baseUrl+="/"}this.clearParams=function(){this.rdParams={newWindow:false,baseUrl:this.baseUrl,postPage:"connection.html",computer:null,username:"",password:"",credentials:"",startprg:0,command:"",cmdargs:"",directory:"",profileKey:null,overrideDefaults:false,width:$(window).width(),height:$(window).height(),bpp:16,console:false,experience:{desktopbackground:false,visualstyles:false,menuwindowanimation:false,fontsmoothing:false,desktopcomposition:false,showwindowcontent:false},relativeTouch:true,unicodekeyboard:true,scaled:false,centered:true,clientAck:false,divId:"rdpdiv",maxWidth:0,maxHeight:0,hookMouse:true,hookKeyboard:true,printer:{enabled:false,setasdefault:true,name:null,driver:null},imagequality:0}};this.clearParams();this.username=null;this.password=null;this.sessionTimer=null;this.encryptedLogin=function(credentials,success,fail){var result=false;this.credentials=credentials;$.ajax({url:this.baseUrl+"login?credentials="+encodeURIComponent(this.credentials),async:true,dataType:"html",error:function(jqXHR,err){result=false;fail()},success:function(data){var obj=eval("("+data+")");if(obj.rc==0){result=true;this.sessionTimer=setInterval(function(){$.ajax({url:THIN.baseUrl+"ping",async:true,dataType:"html"})},60000);success()}else{result=false;fail()}}});return result};this.login=function(username,password,success,fail){var result=false;this.username=username;this.password=password;$.ajax({url:this.baseUrl+"login?username="+encodeURIComponent(username)+"&password="+encodeURIComponent(password),async:true,dataType:"html",error:function(jqXHR,err){result=false;fail()},success:function(data){var obj=eval("("+data+")");if(obj.rc==0){result=true;this.sessionTimer=setInterval(function(){$.ajax({url:THIN.baseUrl+"ping",async:true,dataType:"html"})},60000*5);success()}else{result=false;fail()}}});return result};this.logout=function(){$.ajax({url:this.baseUrl+"logout",async:false,dataType:"json",})};this.getProfiles=function(credentials,success){var result=null;$.ajax({url:this.baseUrl+((credentials=="")?"getprofiles":"getprofiles?credentials="+encodeURIComponent(credentials)),async:true,dataType:"html",statusCode:{401:function(){result=null;this.profileList=result;success(result)},200:function(data){result=eval("("+data+")");this.profileList=result;success(result)}}});this.profileList=result;return result};this.connect=function(params){this.clearParams();for(var p in params){this.rdParams[p]=params[p]}var iq=(typeof this.rdParams.imagequality=="undefined")?1:parseInt(this.rdParams.imagequality,10);switch(iq){case 0:this.rdParams.imageMethod=1;break;case 1:this.rdParams.imageMethod=2;this.rdParams.quality=90;break;case 2:this.rdParams.imageMethod=2;this.rdParams.quality=60;break;case 3:this.rdParams.imageMethod=0;this.rdParams.quality=50;break}if(this.runRemote){var form=this.getForm();this.rdParams.credentials=form.elements.credentials.value;document.getElementById("ThinRDPForm").elements.data.value=escape(JSON.stringify(this.rdParams));form.target=(this.rdParams.newWindow)?this.buildTargetName():"_self";form.action=this.baseUrl+this.rdParams.postPage;form.submit()}else{this.setParams(this.rdParams);if(this.rdParams.logWindow){var scr=document.createElement("SCRIPT");scr.setAttribute("type","text/javascript");scr.setAttribute("src",this.baseUrl+"js/msgLogger.js");document.getElementsByTagName("HEAD")[0].appendChild(scr)}var agent=navigator.userAgent.toLowerCase();mobile=((agent.indexOf("iphone")!=-1)||(agent.indexOf("ipod")!=-1)||(agent.indexOf("ipad")!=-1)||(agent.indexOf("android")!=-1)||(agent.indexOf("hp-tablet")!=-1)||(agent.indexOf("playbook")!=-1));if(mobile){this.maxWidth=this.rcParams.width;this.maxHeight=this.rcParams.height;this.rcParams.hookMouse=false;this.rcParams.hookKeyboard=false;this.rcParams.centered=false;initMobile(this)}if(this.__proto__==null){this.__proto__=Object.getPrototypeOf(this)}this.__proto__.init.call(this,{scraper:"RDP",scraperArgs:this.buildArgs(params)});this.__proto__.connect.call(this)}};this.buildArgs=function(params){var args="";if(this.rdParams.profileKey){args+="profileKey="+this.rdParams.profileKey;args+="&browserWidth="+this.rdParams.width+"&browserHeight="+this.rdParams.height;args+="&screenWidth="+screen.width+"&screenHeight="+screen.height;if(this.rdParams.computer!=null){args+="&rdpcomputer="+this.rdParams.computer}if(this.rdParams.username!=""){args+="&rdpusername="+escape(this.rdParams.username)}if(this.rdParams.password!=""){args+="&rdppassword="+escape(this.rdParams.password)}if(this.rdParams.credentials!=""){args+="&rdpcredentials="+escape(this.rdParams.credentials)}if(this.rdParams.startprg!=""&&this.rdParams.startprg!="0"){args+="&rdpappmode="+this.rdParams.startprg;if(this.rdParams.command!=""){args+="&rdpcommand="+escape(this.rdParams.command)}}if(this.rdParams.overrideDefaults){args+="&overrideDefaults=true";if(this.rdParams.directory!=""){args+="&rdpdirectory="+escape(this.rdParams.directory)}if(this.rdParams.cmdargs!=""){args+="&rdpcmdargs="+escape(this.rdParams.cmdargs)}if(typeof params.bpp!="undefined"){args+="&bpp="+params.bpp}if(typeof params.console!="undefined"){args+="&console="+params.console}if(typeof params.unicodekeyboard!="undefined"){args+="&rdpkbdunicode="+this.rdParams.unicodekeyboard}if(typeof params.experience!="undefined"){if(typeof params.experience.desktopbackground!="undefined"){args+="&vedesktopbackground="+this.rdParams.experience.desktopbackground}if(typeof params.experience.visualstyles!="undefined"){args+="&vevisualstyles="+this.rdParams.experience.visualstyles}if(typeof params.experience.menuwindowanimation!="undefined"){args+="&vemnuwndanimation="+this.rdParams.experience.menuwindowanimation}if(typeof params.experience.fontsmoothing!="undefined"){args+="&vefontsmoothing="+this.rdParams.experience.fontsmoothing}if(typeof params.experience.showwindowcontent!="undefined"){args+="&veshowwndcontent="+this.rdParams.experience.showwindowcontent}if(typeof params.experience.desktopcomposition!="undefined"){args+="&vedesktopcomposition="+this.rdParams.experience.desktopcomposition}}if(typeof params.printer!="undefined"){if(typeof params.printer.enabled!="undefined"){args+="&prnenabled="+params.printer.enabled}if(typeof params.printer.setasdefault!="undefined"){args+="&prnsetasdefault="+params.printer.setasdefault}if(typeof params.printer.name!="undefined"){if(this.rdParams.printer.name){args+="&prnname="+params.printer.name}}if(typeof params.printer.driver!="undefined"){if(this.rdParams.printer.driver){args+="&prndriver="+params.printer.driver}}}}}else{if(!this.rdParams.profileKey||this.rdParams.computer){if(args!=""){args+="&"}if(this.rdParams.computer!=""){args+="rdpcomputer="+this.rdParams.computer}if(this.rdParams.width*this.rdParams.height>0){args+="&screenWidth="+this.rdParams.width+"&screenHeight="+this.rdParams.height}if(this.rdParams.username!=""){args+="&rdpusername="+escape(this.rdParams.username)}if(this.rdParams.password!=""){args+="&rdppassword="+escape(this.rdParams.password)}if(this.rdParams.credentials!=""){args+="&rdpcredentials="+escape(this.rdParams.credentials)}if(this.rdParams.startprg!=""&&this.rdParams.startprg!="0"){args+="&rdpappmode="+this.rdParams.startprg;if(this.rdParams.command!=""){args+="&rdpcommand="+escape(this.rdParams.command)}if(this.rdParams.directory!=""){args+="&rdpdirectory="+escape(this.rdParams.directory)}if(this.rdParams.cmdargs!=""){args+="&rdpcmdargs="+escape(this.rdParams.cmdargs)}}args+="&bpp="+this.rdParams.bpp+"&console="+this.rdParams.console+"&vedesktopbackground="+this.rdParams.experience.desktopbackground;args+="&vevisualstyles="+this.rdParams.experience.visualstyles+"&vemnuwndanimation="+this.rdParams.experience.menuwindowanimation;args+="&vefontsmoothing="+this.rdParams.experience.fontsmoothing+"&veshowwndcontent="+this.rdParams.experience.showwindowcontent;args+="&vedesktopcomposition="+this.rdParams.experience.desktopcomposition+"&rdpkbdunicode="+this.rdParams.unicodekeyboard;if(typeof params.relativeTouch!="undefined"){args+="&relativetouch="+this.rdParams.relativeTouch}}if(this.rdParams.printer.enabled){args+="&prnenabled="+this.rdParams.printer.enabled;args+="&prnsetasdefault="+this.rdParams.printer.setasdefault;if(this.rdParams.printer.name){args+="&prnname="+this.rdParams.printer.name}if(this.rdParams.printer.driver){args+="&prndriver="+this.rdParams.printer.driver}}}return args};this.getForm=function(){return document.getElementById("ThinRDPForm")};this.buildTargetName=function(){var d=new Date();return"RDPCONN_"+(d.getFullYear()*10000+d.getMonth()*100+d.getDate()).toString(16).toUpperCase()+"_"+(d.getHours()*360+d.getMinutes()*60+d.getSeconds()).toString(16).toUpperCase()};this.buildForm=function(){var form=this.appendElement(document.body,"FORM","ThinRDPForm",{method:"POST"});this.appendElement(form,"INPUT","credentials",{type:"HIDDEN",value:""});this.appendElement(form,"INPUT","data",{type:"HIDDEN",value:""})};this.appendElement=function(parentElem,type,name,attrColl){var elem=document.createElement(type);elem.setAttribute("name",name);elem.setAttribute("id",name);for(var a in attrColl){elem.setAttribute(a,attrColl[a])}parentElem.appendChild(elem);return elem};if(this.runRemote&&document.body){this.buildForm()}THIN=this;return this}function canStartThinRDP(){function getConnectionInfo(){var url=window.location.href;return unescape(data)}try{eval("data="+getConnectionInfo())}catch(e){data=null}if(data){$(window).trigger("startThinRDP",[data]);return true}return false}var fullusername=null,mobile=false,oldtitle,THIN=null;function gup(b){b=b.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var a="[\\?&]"+b+"=([^&#]*)";var d=new RegExp(a);var c=d.exec(window.location.href);if(c==null){return""}else{return c[1]}}function rdpConnect(o,D,A,y,I,l,m,c,K,h,b,t,E,F,w,B,C,r,H,q,a,f,J,x,G,z,e){$.blockUI();var d=gup("ack")==="true";var g=gup("lfn");var v=gup("log");THIN.connect({divId:o,width:A,height:y,profileKey:D,bpp:I,computer:l,username:m,password:c,startprg:K,command:h,directory:b,cmdargs:t,console:E,wscompression:F,imagequality:w,unicodekeyboard:f,relativetouch:J,showOnStart:false,experience:{desktopbackground:(typeof B!="undefined")?B:false,visualstyles:C,menuwindowanimation:r,fontsmoothing:H,showwindowcontent:q,desktopcomposition:a},printer:{enabled:x,setasdefault:G,name:z,driver:e},overrideDefaults:true,clientAck:d,lfn:g,logWindow:v=="1"})}function rdpConnectByKey(g,b,f,c){$.blockUI();var e=gup("ack")==="true";var a=gup("lfn");var d=gup("log");THIN.connect({divId:g,profileKey:b,username:f,password:c,clientAck:e,lfn:a,logWindow:d=="1"})}$(document).ready(function(){var connected=false;var profiles=null;if(typeof(serverUrl)=="undefined"){serverUrl=window.location.protocol+"//"+window.location.host+"/"}THIN=GetThinRDP(serverUrl,true);window.scroll(0,1);$("#computer_btn").click(function(){var select=byId("computer_list");if(select.style.display=="none"){select.style.display="block";select.style.marginTop="-2px";select.focus()}else{select.style.display="none";byId("computer").focus()}});$("#computer_list").change(function(){assignRec(byId("computer_list").value);$("#computer_list").hide()});$("#computer_list").blur(function(){$("#computer_list").hide()});$("#connect").click(connect);function connect(){$(window).bind("remoteCommand",function(event,cmd){if(typeof cmd.showdesktop!="undefined"){if(cmd.showdesktop=="true"){$("#deskdiv").show()}if(cmd.showdesktop=="false"){$("#deskdiv").hide();byId("deskdiv").style.height="0px"}}});$(window).bind("execResult",function(event,cmd){$.unblockUI();if(cmd.rc!=0){alert("exename: "+cmd.exename+" rc: "+cmd.rc)}else{connected=true;saveDb();$("#deskdiv").show();$("#connect-page").hide();$("#footer").hide()}});$(window).bind("sessionStart",function(){$.unblockUI();connected=true;saveDb();$("#deskdiv").show();$("#connect-page").hide();$("#footer").hide()});$(window).bind("serverDisconnect",function(){$.unblockUI();$(window).unbind("remoteCommand");$(window).unbind("sessionStart");$(window).unbind("serverDisconnect");if(!connected){alert("The connection could not be established")}connected=false;THIN.dispose();delete THIN;THIN=GetThinRDP();document.title=oldtitle;byId("deskdiv").style.height="0px";$("#deskdiv").hide();$("#connect-page").show();$("#footer").show()});var publickey="";if(profiles&&(profiles.length>0)){var profile=profiles[byId("profiles").selectedIndex];publickey=profile.publickey;if(!profile.unrestricted){document.title=profile.name;var logonusername="";var logonpassword="";if(profile.authentication.needed){logonusername=byId("username").value;logonpassword=byId("rdppassword").value}rdpConnectByKey("deskdiv",publickey,logonusername,logonpassword);return}}var w=$(document.body).width();var h=$(document.body).height();var res=byId("resolution").value;if(res=="fittobrowser"){w=$(window).width();h=$(window).height()}else{if(res=="fittoscreen"){w=screen.width;h=screen.height}else{var a=res.split("x");w=a[0];h=a[1]}}var computer=byId("computer").value;if(computer==""){return}document.title=computer;var directory,program,cmdargs,startProgram;startProgram=0;directory=program=args="";var username=byId("username").value;var password=byId("rdppassword").value;if(username&&fullusername&&username.toLowerCase()==fullusername.toLowerCase()){username=fullusername;if(byId("password").value){password=byId("password").value}}rdpConnect("deskdiv",publickey,w,h,byId("bpp").value,computer,username,password,startProgram,program,directory,cmdargs,byId("console").checked,byId("wscompression").checked,byId("imgquality").value,byId("vedesktopbackground").checked,byId("vevisualstyles").checked,byId("vemnuwndanimation").checked,byId("vefontsmoothing").checked,byId("veshowwndcontent").checked,byId("vedesktopcomposition").checked,byId("unicodekeyb").checked,byId("relativetouch").checked,byId("prnenabled").checked,byId("prnsetasdefault").checked,byId("prnname").value,byId("prndriver").value)}$(".tab_content").hide();$(".tabs").hide();$(".expanded_config").hide();$("ul.tabs li:first").addClass("active").show();$(".tab_content:first").show();$("ul.tabs li").click(function(){$("ul.tabs li").removeClass("active");$(this).addClass("active");$(".tab_content").hide();var activeTab=$(this).find("a").attr("href");$(activeTab).fadeIn();return false});$("#profiles").change(function(){profileChanged()});$("#prnname_btn").click(function(){var select=byId("prnname_list");if(select.style.display=="none"){select.style.display="block";select.style.marginTop="-2px";select.focus()}else{select.style.display="none";byId("prnname").focus()}});$("#prnname_list").change(function(){byId("prnname").value=byId("prnname_list").value;$("#prnname_list").hide()});$("#prnname_list").blur(function(){$("#prnname_list").hide()});$("#prndriver_btn").click(function(){var select=byId("prndriver_list");if(select.style.display=="none"){select.style.display="block";select.style.marginTop="-2px";select.focus()}else{select.style.display="none";byId("prndriver").focus()}});$("#prndriver_list").change(function(){byId("prndriver").value=byId("prndriver_list").value;$("#prndriver_list").hide()});$("#prndriver_list").blur(function(){$("#prndriver_list").hide()});function autoStart(){var result=false;if(profiles&&(profiles.length==1)){var profile=profiles[0];if(!profile.unrestricted&&!profile.authentication.needed){connect();result=true}}return result}function profileChanged(){if(profiles&&(profiles.length>0)){var profile=profiles[byId("profiles").selectedIndex];byId("username").value="";byId("rdppassword").value="";if(profile.unrestricted){$(".unrestricted_access").show();$("#btnshowoptions").show()}else{$(".unrestricted_access").hide();$(".expanded_config").hide();$(".tabs").hide();if(profile.authentication.needed){$("#usernametr").show();$("#passwordtr").show();$("#btntable").show();$("#btnshowoptions").hide();$("#username").val(profile.authentication.logonusername)}}}}$(document.body).keydown(function(event){if(connected){return}if(event.keyCode=="13"){if($("#login-page").css("display")=="block"){doLogin()}else{connect()}}});$("#login-page").hide();$("#connect-page").hide();$("#access_profiles").hide();var agent=navigator.userAgent.toLowerCase();mobile=((agent.indexOf("iphone")!=-1)||(agent.indexOf("ipod")!=-1)||(agent.indexOf("ipad")!=-1)||(agent.indexOf("android")!=-1)||(agent.indexOf("playbook")!=-1)||(agent.indexOf("hp-tablet")!=-1));oldtitle=document.title;if(u.crossdata!=""){var usr=$.parseJSON(eval("<%=$CROSS_DATA_RESOLVE%>"));byId("userid").value=usr.username;byId("password").value=usr.password}$.blockUI.defaults.fadeOut=0;initDb();$("#connect-page").show()});function showOptions(){if($(".tabs").css("display")=="none"){$(".tabs").show();$(".expanded_config").show();$("#optionsimg").addClass("flipped")}else{$(".tabs").hide();$("#tabDisplay,#tabExperience,#tabAdvanced,#tabPrinter").hide();$("#tabGeneral").show();$(".expanded_config").hide();$("ul.tabs li").removeClass("active");$("ul.tabs li:nth-child(1)").addClass("active");$("#optionsimg").removeClass("flipped")}}(function(){var t=32768;var C=0;var O=1;var l=2;var Y=9;var h=6;var z=32768;var a=64;var I;var o;var W=null;var b;var S,J;var y;var x;var aa;var T;var Z;var E;var r,v;var f,m;var H;var L;var V=new Array(0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535);var c=new Array(3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0);var R=new Array(0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,99,99);var P=new Array(1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577);var F=new Array(0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13);var w=new Array(16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15);var D=function(){this.next=null;this.list=null};var N=function(){this.e=0;this.b=0;this.n=0;this.t=null};var q=function(aD,ar,am,aB,aA,ax){this.BMAX=16;this.N_MAX=288;this.status=0;this.root=null;this.m=0;var aE;var aC=new Array(this.BMAX+1);var ab;var az;var ay;var aw;var av;var au;var at;var ac=new Array(this.BMAX+1);var ap;var ad;var ao;var an=new N();var al=new Array(this.BMAX);var ak=new Array(this.N_MAX);var aj;var ah=new Array(this.BMAX+1);var ai;var ag;var af;var aq;var ae;ae=this.root=null;for(av=0;av256?aD[256]:this.BMAX;ap=aD;ad=0;av=ar;do{aC[ap[ad]]++;ad++}while(--av>0);if(aC[0]==ar){this.root=null;this.m=0;this.status=0;return}for(au=1;au<=this.BMAX;au++){if(aC[au]!=0){break}}at=au;if(axav){ax=av}for(ag=1<0){ah[ai++]=(au+=ap[ad++])}ap=aD;ad=0;av=0;do{if((au=ap[ad++])!=0){ak[ah[au]++]=av}}while(++av0){while(at>aj+ac[1+aw]){aj+=ac[1+aw];aw++;af=(af=ay-aj)>ax?ax:af;if((az=1<<(au=at-aj))>aE+1){az-=aE+1;ai=at;while(++auab&&aj0){ah[aw]=av;an.b=ac[aw];an.e=16+au;an.t=ao;au=(av&((1<>(aj-ac[aw]);al[aw-1][au].e=an.e;al[aw-1][au].b=an.b;al[aw-1][au].n=an.n;al[aw-1][au].t=an.t}}an.b=at-aj;if(ad>=ar){an.e=99}else{if(ap[ad]>aj;au>=1){av^=au}av^=au;while((av&((1<>=ab;x-=ab};var g=function(ag,ae,ac){var ad;var ab;var af;if(ac==0){return 0}af=0;for(;;){X(f);ab=r.list[A(f)];ad=ab.e;while(ad>16){if(ad==99){return -1}d(ab.b);ad-=16;X(ad);ab=ab.t[A(ad)];ad=ab.e}d(ab.b);if(ad==16){o&=t-1;ag[ae+af++]=I[o++]=ab.n;if(af==ac){return ac}continue}if(ad==15){break}X(ad);Z=ab.n+A(ad);d(ad);X(m);ab=v.list[A(m)];ad=ab.e;while(ad>16){if(ad==99){return -1}d(ab.b);ad-=16;X(ad);ab=ab.t[A(ad)];ad=ab.e}d(ab.b);X(ad);E=o-ab.n-A(ad);d(ad);while(Z>0&&af0&&ad1){W=null;alert("HufBuild error: "+ae.status);return -1}b=ae.root;zip_fixed_bd=ae.m}r=W;v=b;f=S;m=zip_fixed_bd;return g(ag,af,ad)};var G=function(al,ad,an){var ah;var ag;var ae;var ac;var am;var aj;var ab;var af;var ak=new Array(286+30);var ai;for(ah=0;ah286||af>30){return -1}for(ag=0;agac){return -1}while(ag-->0){ak[ah++]=ae}}else{if(ag==17){X(3);ag=3+A(3);d(3);if(ah+ag>ac){return -1}while(ag-->0){ak[ah++]=0}ae=0}else{X(7);ag=11+A(7);d(7);if(ah+ag>ac){return -1}while(ag-->0){ak[ah++]=0}ae=0}}}}f=Y;ai=new q(ak,ab,257,c,R,f);if(f==0){ai.status=1}if(ai.status!=0){if(ai.status==1){}return -1}r=ai.root;f=ai.m;for(ah=0;ah257){return -1}if(ai.status==1){}if(ai.status!=0){return -1}return g(al,ad,an)};var U=function(){var ab;if(I==null){I=new Array(2*t)}o=0;y=0;x=0;aa=-1;T=false;Z=E=0;r=null};var M=function(af,ad,ac){var ae,ab;ae=0;while(ae0){if(aa!=C){while(Z>0&&ae0&&ae0){var ab=new Array(ad);for(ac=0;ac